PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
47
30.1k
OpenStatus_id
int64
0
4
6,461,733
06/23/2011 23:19:01
813,263
06/23/2011 23:19:01
1
0
How many clients can following server handle ?
CPU Dual core 2GHz (X86), 2GB RAM, 7200rpm SATA 100GB, 100Mbps bandwidth. This server config is for application sharing with multiple clients concurrently. If other better config available at low cost, please suggest one. Thank you.
configuration
null
null
null
null
06/23/2011 23:21:57
not a real question
How many clients can following server handle ? === CPU Dual core 2GHz (X86), 2GB RAM, 7200rpm SATA 100GB, 100Mbps bandwidth. This server config is for application sharing with multiple clients concurrently. If other better config available at low cost, please suggest one. Thank you.
1
6,169,480
05/29/2011 18:09:36
699,174
04/08/2011 18:39:34
19
0
How to make pear to pear connection
I am using Android 2.2 SDK, What is the best way to make "pear to pear" connection between two devices Thanks in advance
android
connection
null
null
null
06/09/2011 21:55:53
not a real question
How to make pear to pear connection === I am using Android 2.2 SDK, What is the best way to make "pear to pear" connection between two devices Thanks in advance
1
11,180,290
06/24/2012 18:53:12
1,454,835
06/13/2012 21:32:27
27
0
putting an xls file in a jar
I have an xls spreadsheet that I'm querying using metaModel, and I want to keep the xls file in the jar, because it won't be updated. The method used for creating the data context doesn't allow inputstreams, I tried using this code: > DataContext dataContext = DataContextFactory.createExcelDataContext(getClass().getResourceAsStream("database.xls")); Unfortunately this doesn't work, as the method createExcelDataContext doesn't take inputstreams as a parameter. Is there any way to keep the file in the jar?
java
excel
jar
metamodel
null
null
open
putting an xls file in a jar === I have an xls spreadsheet that I'm querying using metaModel, and I want to keep the xls file in the jar, because it won't be updated. The method used for creating the data context doesn't allow inputstreams, I tried using this code: > DataContext dataContext = DataContextFactory.createExcelDataContext(getClass().getResourceAsStream("database.xls")); Unfortunately this doesn't work, as the method createExcelDataContext doesn't take inputstreams as a parameter. Is there any way to keep the file in the jar?
0
9,672,271
03/12/2012 17:58:20
1,248,779
03/04/2012 23:54:40
40
0
ubuntu serial port on VirutalBOX (virtual machine)
I have ubuntu runing on window 7 host. I have noticed that there's about 1.3 seconds delay between RX (The receive line) blinking on TTYS0/COM1 and my software to receive the message that came through the port. Is there a way to reduce this? with this delay, the software is thinking that the slave accross the rs232 line is timing out... Thanks.
ubuntu
serial-port
null
null
null
03/13/2012 19:38:54
off topic
ubuntu serial port on VirutalBOX (virtual machine) === I have ubuntu runing on window 7 host. I have noticed that there's about 1.3 seconds delay between RX (The receive line) blinking on TTYS0/COM1 and my software to receive the message that came through the port. Is there a way to reduce this? with this delay, the software is thinking that the slave accross the rs232 line is timing out... Thanks.
2
2,691,894
04/22/2010 14:56:12
315,687
04/13/2010 16:06:32
1
0
qtjambi - QApplication.initialize outside of main method
I want to use qt jambi to make screenshots. I use the integrated webkit browser and it works like a charm. The problem is: how can I initialize QApplication.initialize(args); outside of the main method. Since I want to make screenshots out of my java web application without calling an external program I need to initialize QApplication outside of main. import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import com.trolltech.qt.core.QObject; import com.trolltech.qt.core.QUrl; import com.trolltech.qt.gui.QApplication; import com.trolltech.qt.gui.QImage; import com.trolltech.qt.gui.QPainter; import com.trolltech.qt.webkit.QWebPage; import com.trolltech.qt.webkit.QWebView; /** * * @author Marc Giombetti Created on: 16.04.2010 */ public class ScreenshotWithoutWindow { private QWebView browser; /** * @param args */ public static void main(String[] args) { if (args.length > 2) { String file = args[0]; String baseUrl = args[1]; String writeTo = args[2]; Thumbnailer thumbnail = new Thumbnailer(file, baseUrl, writeTo); } else { System.out.println("Please provide file, baseURL and savetoPath parameters"); System.out .println("For example:java -jar ScreenshotWithoutWindow C:\\test\\test.htm file:///C:/Marc/test/ c:\\screenshot\\screenshot-new.png"); } } public static class Thumbnailer extends QObject { private QWebPage page = new QWebPage(); public Signal0 finished = new Signal0(); private static String file; private static String baseUrl; private static String writeTo; public Thumbnailer(String _file, String _baseUrl, String _writeTo) { file = _file; baseUrl = _baseUrl; writeTo = _writeTo; initialize(); } private void initialize(){ QApplication.initialize(null); page.loadFinished.connect(this, "render(Boolean)"); try { page.mainFrame().setHtml(readFileAsString(file), new QUrl(baseUrl)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finished.connect(QApplication.instance(), "quit()"); QApplication.exec(); } void render(Boolean b) { page.setViewportSize(page.mainFrame().contentsSize()); QImage image = new QImage(page.viewportSize(), QImage.Format.Format_ARGB32); QPainter painter = new QPainter(image); page.mainFrame().render(painter); painter.end(); image.save(writeTo); System.out.println("Saved screenshot as "+writeTo); finished.emit(); } private static String readFileAsString(String filePath) throws java.io.IOException { StringBuffer fileData = new StringBuffer(1000); BufferedReader reader = new BufferedReader(new FileReader(filePath)); char[] buf = new char[1024]; int numRead = 0; while ((numRead = reader.read(buf)) != -1) { String readData = String.valueOf(buf, 0, numRead); fileData.append(readData); buf = new char[1024]; } reader.close(); return fileData.toString(); } } } This doesn not work and the application crashes with a fatal error: # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x670ddc30, pid=4588, tid=2776 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) Client VM (14.3-b01 mixed mode windows-x86 ) # Problematic frame: # C [QtCore4.dll+0xddc30] Does anyone have an idea how to initialize the QApplication outside of the main method. Thanks a lot for your help Marc
qt-jambi
qt
java
null
null
null
open
qtjambi - QApplication.initialize outside of main method === I want to use qt jambi to make screenshots. I use the integrated webkit browser and it works like a charm. The problem is: how can I initialize QApplication.initialize(args); outside of the main method. Since I want to make screenshots out of my java web application without calling an external program I need to initialize QApplication outside of main. import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import com.trolltech.qt.core.QObject; import com.trolltech.qt.core.QUrl; import com.trolltech.qt.gui.QApplication; import com.trolltech.qt.gui.QImage; import com.trolltech.qt.gui.QPainter; import com.trolltech.qt.webkit.QWebPage; import com.trolltech.qt.webkit.QWebView; /** * * @author Marc Giombetti Created on: 16.04.2010 */ public class ScreenshotWithoutWindow { private QWebView browser; /** * @param args */ public static void main(String[] args) { if (args.length > 2) { String file = args[0]; String baseUrl = args[1]; String writeTo = args[2]; Thumbnailer thumbnail = new Thumbnailer(file, baseUrl, writeTo); } else { System.out.println("Please provide file, baseURL and savetoPath parameters"); System.out .println("For example:java -jar ScreenshotWithoutWindow C:\\test\\test.htm file:///C:/Marc/test/ c:\\screenshot\\screenshot-new.png"); } } public static class Thumbnailer extends QObject { private QWebPage page = new QWebPage(); public Signal0 finished = new Signal0(); private static String file; private static String baseUrl; private static String writeTo; public Thumbnailer(String _file, String _baseUrl, String _writeTo) { file = _file; baseUrl = _baseUrl; writeTo = _writeTo; initialize(); } private void initialize(){ QApplication.initialize(null); page.loadFinished.connect(this, "render(Boolean)"); try { page.mainFrame().setHtml(readFileAsString(file), new QUrl(baseUrl)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finished.connect(QApplication.instance(), "quit()"); QApplication.exec(); } void render(Boolean b) { page.setViewportSize(page.mainFrame().contentsSize()); QImage image = new QImage(page.viewportSize(), QImage.Format.Format_ARGB32); QPainter painter = new QPainter(image); page.mainFrame().render(painter); painter.end(); image.save(writeTo); System.out.println("Saved screenshot as "+writeTo); finished.emit(); } private static String readFileAsString(String filePath) throws java.io.IOException { StringBuffer fileData = new StringBuffer(1000); BufferedReader reader = new BufferedReader(new FileReader(filePath)); char[] buf = new char[1024]; int numRead = 0; while ((numRead = reader.read(buf)) != -1) { String readData = String.valueOf(buf, 0, numRead); fileData.append(readData); buf = new char[1024]; } reader.close(); return fileData.toString(); } } } This doesn not work and the application crashes with a fatal error: # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x670ddc30, pid=4588, tid=2776 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) Client VM (14.3-b01 mixed mode windows-x86 ) # Problematic frame: # C [QtCore4.dll+0xddc30] Does anyone have an idea how to initialize the QApplication outside of the main method. Thanks a lot for your help Marc
0
2,690,503
04/22/2010 11:55:37
323,208
04/22/2010 11:55:37
1
0
Can BitmapFactory.decodeFile handle .ICO (Windows icons) files ?
I am working on Android. Trying to display the "favicon" (aka "shortcut icon") or web pages. So I already have the code to get the URL of this icon from any website, and download it onto my Android. Now I am trying to make a Bitmap out of it, but always get null as a result. The code: String src = String.format("file:///data/data/com.intuitiveui.android/files/%s",prefName); // prefName is "facebook.ico", and I do see tht file in my DDMS file browser. It's // a valid icon file. Bitmap res = BitmapFactory.decodeFile(src); // This returns null TIA
icons
android
bitmap
null
null
null
open
Can BitmapFactory.decodeFile handle .ICO (Windows icons) files ? === I am working on Android. Trying to display the "favicon" (aka "shortcut icon") or web pages. So I already have the code to get the URL of this icon from any website, and download it onto my Android. Now I am trying to make a Bitmap out of it, but always get null as a result. The code: String src = String.format("file:///data/data/com.intuitiveui.android/files/%s",prefName); // prefName is "facebook.ico", and I do see tht file in my DDMS file browser. It's // a valid icon file. Bitmap res = BitmapFactory.decodeFile(src); // This returns null TIA
0
6,556,879
07/02/2011 12:05:23
281,651
11/19/2009 13:19:37
82
3
May I store View objects in instance fields?
I've got an Activity class. It sould be really nice to find all the views I need in `onCreate`, and then just reference these fields, without calling `findViewById`. But is it OK to do so? Can't views be assigned different objects at runtime? E.g., is it always true that `findBiewById(res1) == findBiewById(res1)` at any time?
java
android
null
null
null
null
open
May I store View objects in instance fields? === I've got an Activity class. It sould be really nice to find all the views I need in `onCreate`, and then just reference these fields, without calling `findViewById`. But is it OK to do so? Can't views be assigned different objects at runtime? E.g., is it always true that `findBiewById(res1) == findBiewById(res1)` at any time?
0
4,058,297
10/30/2010 10:38:35
243,225
01/04/2010 14:10:44
814
29
How to promote Android app
I released a free app on Android Market called Pubtran London (it's a London journey planner), what are the best ways to promote it? I mean besides posting about it here ;-). Users who want the functionality my app provides probably already use some other app, that is possibly worse than my app. How can I make them switch?
android
null
null
null
null
06/22/2011 12:45:19
off topic
How to promote Android app === I released a free app on Android Market called Pubtran London (it's a London journey planner), what are the best ways to promote it? I mean besides posting about it here ;-). Users who want the functionality my app provides probably already use some other app, that is possibly worse than my app. How can I make them switch?
2
10,232,424
04/19/2012 16:20:40
1,238,934
02/28/2012 22:00:36
161
1
xcode get UITabBar height
My app has a tabBarController as main controller and I need to get the height of tabBar from any view controller in order to calculate proper position for the rest of elements. How to get it programmatically? Thank you.
iphone
objective-c
ios
xcode
cocoa-touch
null
open
xcode get UITabBar height === My app has a tabBarController as main controller and I need to get the height of tabBar from any view controller in order to calculate proper position for the rest of elements. How to get it programmatically? Thank you.
0
9,144,886
02/04/2012 21:52:59
969,984
09/28/2011 21:21:53
57
14
Django admin interface filter from another table linked with foreign key
I have given two tables and its models. mysql> SELECT gid, sk, source from datagen_gidskmap limit 10; +-----+------+----------+ | gid | sk | source | +-----+------+----------+ | 1 | 3829 | smsarena | | 2 | 623 | smsarena | | 3 | 1308 | smsarena | | 4 | 1747 | smsarena | | 5 | 1827 | smsarena | | 6 | 1218 | smsarena | | 7 | 2957 | smsarena | | 8 | 3468 | smsarena | | 9 | 2580 | smsarena | | 10 | 2579 | smsarena | +-----+------+----------+ 10 rows in set (0.00 sec) class GidSkMap(models.Model): gid = models.AutoField(primary_key=True) sk = models.CharField(max_length=256) source = models.CharField(max_length=64) creation_date = models.DateTimeField(auto_now_add=True) modification_date = models.DateTimeField(auto_now=True) def __unicode__(self): return u'%s' % self.gid class Meta: unique_together = ("sk", "source") --------------- mysql> SELECT id, gid_id, nm from datagen_crawlmeta limit 10; +----+--------+----------------------------+ | id | gid_id | nm | +----+--------+----------------------------+ | 1 | 1 | votes | | 2 | 1 | performance_rating | | 3 | 1 | title | | 4 | 1 | specs__Sound__Loudspeaker | | 5 | 1 | specs__Sound__3.5mm jack | | 6 | 1 | specs__Sound__Alert types | | 7 | 1 | specs__Sound__unknown0 | | 8 | 1 | specs__Features__Java | | 9 | 1 | specs__Features__Messaging | | 10 | 1 | specs__Features__Colors | +----+--------+----------------------------+ 10 rows in set (0.00 sec) class CrawlMeta(models.Model): gid = models.ForeignKey(GidSkMap) nm = models.CharField(max_length=256) val = models.TextField() modification_date = models.DateTimeField(auto_now=True) def __unicode__(self): return u'%s' % self.gid class Meta: unique_together = ("gid", "nm") While viewing the CrawlMeta model in the django admin interface, I would like to have a filter based on "source"(Eg: smsarena) which can be accessed via gid (which is a foriegn key in CrawlMeta and primary_key in GidSkMap). Any help would be appreciated.
django
django-models
django-admin
null
null
null
open
Django admin interface filter from another table linked with foreign key === I have given two tables and its models. mysql> SELECT gid, sk, source from datagen_gidskmap limit 10; +-----+------+----------+ | gid | sk | source | +-----+------+----------+ | 1 | 3829 | smsarena | | 2 | 623 | smsarena | | 3 | 1308 | smsarena | | 4 | 1747 | smsarena | | 5 | 1827 | smsarena | | 6 | 1218 | smsarena | | 7 | 2957 | smsarena | | 8 | 3468 | smsarena | | 9 | 2580 | smsarena | | 10 | 2579 | smsarena | +-----+------+----------+ 10 rows in set (0.00 sec) class GidSkMap(models.Model): gid = models.AutoField(primary_key=True) sk = models.CharField(max_length=256) source = models.CharField(max_length=64) creation_date = models.DateTimeField(auto_now_add=True) modification_date = models.DateTimeField(auto_now=True) def __unicode__(self): return u'%s' % self.gid class Meta: unique_together = ("sk", "source") --------------- mysql> SELECT id, gid_id, nm from datagen_crawlmeta limit 10; +----+--------+----------------------------+ | id | gid_id | nm | +----+--------+----------------------------+ | 1 | 1 | votes | | 2 | 1 | performance_rating | | 3 | 1 | title | | 4 | 1 | specs__Sound__Loudspeaker | | 5 | 1 | specs__Sound__3.5mm jack | | 6 | 1 | specs__Sound__Alert types | | 7 | 1 | specs__Sound__unknown0 | | 8 | 1 | specs__Features__Java | | 9 | 1 | specs__Features__Messaging | | 10 | 1 | specs__Features__Colors | +----+--------+----------------------------+ 10 rows in set (0.00 sec) class CrawlMeta(models.Model): gid = models.ForeignKey(GidSkMap) nm = models.CharField(max_length=256) val = models.TextField() modification_date = models.DateTimeField(auto_now=True) def __unicode__(self): return u'%s' % self.gid class Meta: unique_together = ("gid", "nm") While viewing the CrawlMeta model in the django admin interface, I would like to have a filter based on "source"(Eg: smsarena) which can be accessed via gid (which is a foriegn key in CrawlMeta and primary_key in GidSkMap). Any help would be appreciated.
0
8,279,016
11/26/2011 14:17:25
1,063,040
11/24/2011 01:29:44
1
0
Jquery file posting help needed
Im trying to upload a file using jquery. I use a hidden form which contains an Input, then I use jquery to trigger the file browser. Once the input is changed the file is then posted to the php server script. My problem is that if i just do $("form1").submit(); everything works perfect but my page then gets redirected. To avoid redirecting I want to get the response text from the php script therefore I used the jquery Post function but this time the php script doesnt recognize that there is a file post and returns an error whenever theres ($_FILES) = nothing. My Html Code: <form id="form1" name="up1" method="POST" action="upload.php" enctype="multipart/form-data"> <input style="width:0px;height:0px"id="br" type="file" name="Filedata"/> </form> Jquery: $("#br").change(function() { var $el = $('#br'); $('#form1').submit(); }); //The code above works perfectly if I dont add this code below. $("#form1").submit(function(event) { event.preventDefault(); var $el = $('#br'); var $form = $( this ), term = $form.find('input[name="Filedata"]').val(), url = $form.attr( 'action' ), enctype= "multipart/form-data"; $.post( url, { s: term }, function( data ) { alert(data); } ); });
php
javascript
jquery
html
null
null
open
Jquery file posting help needed === Im trying to upload a file using jquery. I use a hidden form which contains an Input, then I use jquery to trigger the file browser. Once the input is changed the file is then posted to the php server script. My problem is that if i just do $("form1").submit(); everything works perfect but my page then gets redirected. To avoid redirecting I want to get the response text from the php script therefore I used the jquery Post function but this time the php script doesnt recognize that there is a file post and returns an error whenever theres ($_FILES) = nothing. My Html Code: <form id="form1" name="up1" method="POST" action="upload.php" enctype="multipart/form-data"> <input style="width:0px;height:0px"id="br" type="file" name="Filedata"/> </form> Jquery: $("#br").change(function() { var $el = $('#br'); $('#form1').submit(); }); //The code above works perfectly if I dont add this code below. $("#form1").submit(function(event) { event.preventDefault(); var $el = $('#br'); var $form = $( this ), term = $form.find('input[name="Filedata"]').val(), url = $form.attr( 'action' ), enctype= "multipart/form-data"; $.post( url, { s: term }, function( data ) { alert(data); } ); });
0
11,570,976
07/19/2012 23:51:20
1,359,306
04/26/2012 17:09:47
81
5
iPhone backup restore SMS
I have had to restore my iPhone 4S to factory settings - wiping everything on the device. Fortunately I have frequent backups so I was able to restore most of the settings and stuff. However, is there a way (on mac) to restore SMS messages - as I know they are backed up, I just don't know how to get them back on the device. To make matters worse...the back ups are all encrypted. Any help is much appreciated!!!
iphone
backup
restore
null
null
07/20/2012 00:15:39
off topic
iPhone backup restore SMS === I have had to restore my iPhone 4S to factory settings - wiping everything on the device. Fortunately I have frequent backups so I was able to restore most of the settings and stuff. However, is there a way (on mac) to restore SMS messages - as I know they are backed up, I just don't know how to get them back on the device. To make matters worse...the back ups are all encrypted. Any help is much appreciated!!!
2
7,891,046
10/25/2011 14:42:31
159,687
08/20/2009 00:51:06
69
0
Red Hat Enterprise Linux for Workstations vs. Other Distributions: Any Reason to Prefer Red Hat?
Work just sprang for a Dell T5500 Workstation for me, which I ordered with Red Hat Enterprise Linux for Workstations pre-installed. I have always used Ubuntu or Fedora. Is there any reason to prefer Enterprise Red Hat over these other popular distributions? I find Ubuntu much more friendly and easy to use. I am wondering if there are any specific optimizations that Dell goes through during installation. I desire top performance out of the machine, as that is its raison d'etre. I appreciate your insights and suggestions!
linux
ubuntu
fedora
redhat
suse
10/25/2011 16:14:01
off topic
Red Hat Enterprise Linux for Workstations vs. Other Distributions: Any Reason to Prefer Red Hat? === Work just sprang for a Dell T5500 Workstation for me, which I ordered with Red Hat Enterprise Linux for Workstations pre-installed. I have always used Ubuntu or Fedora. Is there any reason to prefer Enterprise Red Hat over these other popular distributions? I find Ubuntu much more friendly and easy to use. I am wondering if there are any specific optimizations that Dell goes through during installation. I desire top performance out of the machine, as that is its raison d'etre. I appreciate your insights and suggestions!
2
8,486,626
12/13/2011 09:07:52
59,015
01/26/2009 14:15:37
3,477
114
Understanding the behaviour of Syncronized
I'm trying to improve my understanding of the scope of the lock issued during a `synchronized` call. Eg: class CopyOnReadList<T> { private final List<T> items = new ArrayList<T>(); public void add(T item) { items.add(item); } public List<T> makeSnapshot() { List<T> copy = new ArrayList<T>(); synchronized (items) { // Make a copy while holding the lock. for (T t : items) copy.add(t); } return copy; } } (Code lovingly borrowed from [this excellent answer][1]) In this code snippet, can one thread call `add` while another is calling `makeSnapshot`?. Ie., does the lock created by `synchronized (items)` affect all attempted reads to `items`, or only those attempted through the `makeSnapshot()` method? The original post actually used a `synchonized` lock in the add method: public void add(T item) { synchronized (items) { // Add item while holding the lock. items.add(item); } } What is the side effect of removing this? [1]: http://stackoverflow.com/a/3943310/59015
java
concurrency
null
null
null
null
open
Understanding the behaviour of Syncronized === I'm trying to improve my understanding of the scope of the lock issued during a `synchronized` call. Eg: class CopyOnReadList<T> { private final List<T> items = new ArrayList<T>(); public void add(T item) { items.add(item); } public List<T> makeSnapshot() { List<T> copy = new ArrayList<T>(); synchronized (items) { // Make a copy while holding the lock. for (T t : items) copy.add(t); } return copy; } } (Code lovingly borrowed from [this excellent answer][1]) In this code snippet, can one thread call `add` while another is calling `makeSnapshot`?. Ie., does the lock created by `synchronized (items)` affect all attempted reads to `items`, or only those attempted through the `makeSnapshot()` method? The original post actually used a `synchonized` lock in the add method: public void add(T item) { synchronized (items) { // Add item while holding the lock. items.add(item); } } What is the side effect of removing this? [1]: http://stackoverflow.com/a/3943310/59015
0
7,815,071
10/18/2011 23:43:19
984,435
10/07/2011 17:19:08
1
0
What is the best book/sources to learn the language design and internals of Python?
I have been using Python for around 1.5 yrs now and wish to understand how things are implemented. If no books exist for this, what would be the best approach to get a deeper understanding of the language and it's implementation
python
language-design
python-internals
null
null
10/19/2011 02:51:24
not constructive
What is the best book/sources to learn the language design and internals of Python? === I have been using Python for around 1.5 yrs now and wish to understand how things are implemented. If no books exist for this, what would be the best approach to get a deeper understanding of the language and it's implementation
4
8,998,754
01/25/2012 06:32:20
134,713
07/08/2009 05:51:58
4,736
189
How to know a process's idle time
Probably this question is a duplicate.but i was not able to find. How do i check that how much time a process has been in idle state. my actual problem: I have a process which runs on solaris unix X86 server. In our test servers its finishes its job in 4 hours.But in our client servers its taking more than than 10 hours.I checked in the client server and found that the configuration in our client server is different from our test server.for eg: number of virtual processors in testserver are-24 but in client server are only 8. and processor speed also differs. I suspect it is because of the configuration that the process is not actually getting the cpu time and i suspect that it is idle for most of the time. But i just want to know how much time the process is idle.Is there any specific way to do this?The process is written in c++ so i am also tagging this as c++
c++
unix
process
solaris
null
null
open
How to know a process's idle time === Probably this question is a duplicate.but i was not able to find. How do i check that how much time a process has been in idle state. my actual problem: I have a process which runs on solaris unix X86 server. In our test servers its finishes its job in 4 hours.But in our client servers its taking more than than 10 hours.I checked in the client server and found that the configuration in our client server is different from our test server.for eg: number of virtual processors in testserver are-24 but in client server are only 8. and processor speed also differs. I suspect it is because of the configuration that the process is not actually getting the cpu time and i suspect that it is idle for most of the time. But i just want to know how much time the process is idle.Is there any specific way to do this?The process is written in c++ so i am also tagging this as c++
0
3,544,919
08/23/2010 05:20:38
426,021
08/20/2010 06:13:19
1
1
What are Transient and Volatile Modifiers?-
Transient: The transient modifier applies to variables only and it is not stored as part of its object’s Persistent state. Transient variables are not serialized. Volatile: Volatile modifier applies to variables only and it tells the compiler that the variable modified by volatile can be changed unexpectedly by other parts of the program.
java
null
null
null
null
08/27/2010 12:16:35
not a real question
What are Transient and Volatile Modifiers?- === Transient: The transient modifier applies to variables only and it is not stored as part of its object’s Persistent state. Transient variables are not serialized. Volatile: Volatile modifier applies to variables only and it tells the compiler that the variable modified by volatile can be changed unexpectedly by other parts of the program.
1
4,861,302
02/01/2011 10:15:09
333,422
05/05/2010 12:29:38
9
4
Sigbus on std::map.find
I have got a map defined inside a class in header file like this: <pre> std::map(int, char) mCompletedIds; </pre> Sorry, I used braces here for map because if I use "<" then parameters get removed. I can do with a vector here, as I just need to store the ids which have been completed. But to have fast find, I am using map. So, I always put second argument of pair as 0. Now, In one of the fns. of class, I am doing find. <pre> std::map(int, char)::iterator it = mCompletedIds.find(id); //id is defined above </pre> On this statement, I am getting SIGBUS. Is it because map is empty at the moment? Can anyone pls. help me understand the reason. Thanks, sg
c++
stl
null
null
null
null
open
Sigbus on std::map.find === I have got a map defined inside a class in header file like this: <pre> std::map(int, char) mCompletedIds; </pre> Sorry, I used braces here for map because if I use "<" then parameters get removed. I can do with a vector here, as I just need to store the ids which have been completed. But to have fast find, I am using map. So, I always put second argument of pair as 0. Now, In one of the fns. of class, I am doing find. <pre> std::map(int, char)::iterator it = mCompletedIds.find(id); //id is defined above </pre> On this statement, I am getting SIGBUS. Is it because map is empty at the moment? Can anyone pls. help me understand the reason. Thanks, sg
0
3,003,878
06/09/2010 07:38:52
159,610
08/19/2009 21:08:40
153
3
Books recommendation to learn about java networking
In order to cover for my (glaring) lack of knowledge in the basics of networking, I'm looking for a book which would ideally cover: -> 1 or 2 chapters on the transport layer: tcp, udp... -> 1 or 2 chapters on the application layer: http, dns... -> rest of the book would be devoted to pratical way of sending data across the wire using Java-related technologies. This would involve discussions about existing products (eg. hessian, protobuf, thrift, tibco...) , performances comparisons, case studies...etc.. Does such a book exist ?
java
networking
null
null
null
09/17/2011 22:42:57
not constructive
Books recommendation to learn about java networking === In order to cover for my (glaring) lack of knowledge in the basics of networking, I'm looking for a book which would ideally cover: -> 1 or 2 chapters on the transport layer: tcp, udp... -> 1 or 2 chapters on the application layer: http, dns... -> rest of the book would be devoted to pratical way of sending data across the wire using Java-related technologies. This would involve discussions about existing products (eg. hessian, protobuf, thrift, tibco...) , performances comparisons, case studies...etc.. Does such a book exist ?
4
1,937,800
12/21/2009 01:51:32
239,663
08/26/2008 13:22:07
2,207
83
Apply CSS to table cells (td) in JQGrid?
Is there any way to apply a specific CSS class to all cells in a given column in a JQGrid?
css
jqgrid
null
null
null
null
open
Apply CSS to table cells (td) in JQGrid? === Is there any way to apply a specific CSS class to all cells in a given column in a JQGrid?
0
10,879,891
06/04/2012 10:34:39
1,360,708
04/27/2012 08:54:24
12
6
Sending html web site form to e mail with smtp and adress
Hello i have fields like; name, surname, phone, message. I m trying to send this informations to my email. How can i do it with html or javascript codes ?
javascript
html
forms
email
smtp
06/05/2012 12:26:14
not a real question
Sending html web site form to e mail with smtp and adress === Hello i have fields like; name, surname, phone, message. I m trying to send this informations to my email. How can i do it with html or javascript codes ?
1
9,199,062
02/08/2012 18:13:26
1,068,529
11/28/2011 01:00:41
187
6
Pass by reference or return array in PHP?
All of my functions that have multiple parameters and that need to return more than one of those values I return an `array` like so... function eg($a, $b) { $a += 5; $b += 10; return array('a' => $a, 'b' => $b); } $no = eg(0, 5); echo $no['a']; // 5 echo $no['b']; // 10 Is this considered bad practice compared to passing by reference ie; function eg(&$a, &$b) { $a += 5; $b += 10; } eg(0, 5); echo $a; // 5 echo $b; // 10 Does this really matter? When would I want to use one over the other when using the examples above? Is there any difference in performance? Thanks
php
pass-by-reference
null
null
null
02/08/2012 20:36:41
not constructive
Pass by reference or return array in PHP? === All of my functions that have multiple parameters and that need to return more than one of those values I return an `array` like so... function eg($a, $b) { $a += 5; $b += 10; return array('a' => $a, 'b' => $b); } $no = eg(0, 5); echo $no['a']; // 5 echo $no['b']; // 10 Is this considered bad practice compared to passing by reference ie; function eg(&$a, &$b) { $a += 5; $b += 10; } eg(0, 5); echo $a; // 5 echo $b; // 10 Does this really matter? When would I want to use one over the other when using the examples above? Is there any difference in performance? Thanks
4
11,295,335
07/02/2012 14:05:46
1,496,203
07/02/2012 13:41:43
1
0
Retrieve all the values from listview in a button click event in asp.net
I tried to retrive the all the data from the listview in asp.net. Actually, I have two listview i drag and drop row from one listview to another listview using Jquery <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script> // drag nd drop $(function () { $("#list3, #list4").sortable({ connectWith: ".conn" }).disableSelection(); }); that is working fine for me. what should i want is to retrive all the value of listview on a single button Click. I have listview1 like this <table width="100%" border="0" cellpadding="1" cellspacing="1"> <tr> <td width="100%"> <div id="l1" style="width: 100%; height: 171px; overflow: auto;"> <asp:ListView ID="lstvRCGroupSource" runat="server" ViewStateMode="Disabled"> <LayoutTemplate> <ul id="list3" class="conn" style="width: 100%; height: 171px;"> <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder> </ul> </LayoutTemplate> <ItemTemplate> <li class="add" id="l3"> <table id="tbl" style="width: 100%;"> <tr class="mytr" style="width: 100%;"> <td class="mytd border2 borderlistview" style="width: 50%;"> <asp:Image ID="ProductImage" runat="server" ImageUrl='<%#Eval("EventImage") %>' Height="20" /> </td> <td class="weekid"> <%#Eval("WeekID")%> </td> <td class="promotedprice"> <%#Eval("PromotedPrice")%> </td> <td class="display"> <%#Eval("Display")%> </td> <td class="feature"> <%#Eval("Feature")%> </td> <td class="featuredisplay"> <%#Eval("FeatureDisplay")%> </td> <td class="tpronly"> <%#Eval("TPRonly")%> </td> </tr> </table> </li> </ItemTemplate> </asp:ListView> </div> </td> </tr> </table> and listview 2 as like this <table width="100%"> <tr> <td width="100%"> <div id="l2" style="width: 100%; height: 171px; overflow: auto;"> <asp:ListView ID="lstvRCGroupTarget" runat="server"> <LayoutTemplate> <ul id="list4" class="conn" style="width: 100%; height: 171px;"> <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder> </ul> </LayoutTemplate> <ItemTemplate> <li class="add1"> <table style="width: 100%;"> <tr style="width: 100%;"> <td class="borderlistview" style="width: 50%;"> <%# Eval("EventImage")%> </td> <td> <%#Eval("WeekID") %> </td> <td> <%#Eval("PromotedPrice") %> </td> <td> <%#Eval("Display") %> </td> <td> <%#Eval("Feature") %> </td> <td> <%#Eval("FeatureDisplay") %> </td> <td> <%#Eval("TPRonly") %> </td> </tr> </table> </ItemTemplate> </asp:ListView> </div> </td> </tr> </table> and also I tried to retrive the data with jquery, but not works function btnDone() { alert("hai"); var values = ''; $("#lstvRCGroupTarget li.add table .mytr .weekid").each(function () { values = $.trim($(this).html() + '|' + values); alert(values); }); document.getElementById("hdnWeekID").value = values; I tried the for one day but i cann't retrive the data of listview either in javascript nor in asp.net code behind. please anyone give the right solution for me.
javascript
jquery
asp.net
c#-4.0
null
null
open
Retrieve all the values from listview in a button click event in asp.net === I tried to retrive the all the data from the listview in asp.net. Actually, I have two listview i drag and drop row from one listview to another listview using Jquery <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script> // drag nd drop $(function () { $("#list3, #list4").sortable({ connectWith: ".conn" }).disableSelection(); }); that is working fine for me. what should i want is to retrive all the value of listview on a single button Click. I have listview1 like this <table width="100%" border="0" cellpadding="1" cellspacing="1"> <tr> <td width="100%"> <div id="l1" style="width: 100%; height: 171px; overflow: auto;"> <asp:ListView ID="lstvRCGroupSource" runat="server" ViewStateMode="Disabled"> <LayoutTemplate> <ul id="list3" class="conn" style="width: 100%; height: 171px;"> <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder> </ul> </LayoutTemplate> <ItemTemplate> <li class="add" id="l3"> <table id="tbl" style="width: 100%;"> <tr class="mytr" style="width: 100%;"> <td class="mytd border2 borderlistview" style="width: 50%;"> <asp:Image ID="ProductImage" runat="server" ImageUrl='<%#Eval("EventImage") %>' Height="20" /> </td> <td class="weekid"> <%#Eval("WeekID")%> </td> <td class="promotedprice"> <%#Eval("PromotedPrice")%> </td> <td class="display"> <%#Eval("Display")%> </td> <td class="feature"> <%#Eval("Feature")%> </td> <td class="featuredisplay"> <%#Eval("FeatureDisplay")%> </td> <td class="tpronly"> <%#Eval("TPRonly")%> </td> </tr> </table> </li> </ItemTemplate> </asp:ListView> </div> </td> </tr> </table> and listview 2 as like this <table width="100%"> <tr> <td width="100%"> <div id="l2" style="width: 100%; height: 171px; overflow: auto;"> <asp:ListView ID="lstvRCGroupTarget" runat="server"> <LayoutTemplate> <ul id="list4" class="conn" style="width: 100%; height: 171px;"> <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder> </ul> </LayoutTemplate> <ItemTemplate> <li class="add1"> <table style="width: 100%;"> <tr style="width: 100%;"> <td class="borderlistview" style="width: 50%;"> <%# Eval("EventImage")%> </td> <td> <%#Eval("WeekID") %> </td> <td> <%#Eval("PromotedPrice") %> </td> <td> <%#Eval("Display") %> </td> <td> <%#Eval("Feature") %> </td> <td> <%#Eval("FeatureDisplay") %> </td> <td> <%#Eval("TPRonly") %> </td> </tr> </table> </ItemTemplate> </asp:ListView> </div> </td> </tr> </table> and also I tried to retrive the data with jquery, but not works function btnDone() { alert("hai"); var values = ''; $("#lstvRCGroupTarget li.add table .mytr .weekid").each(function () { values = $.trim($(this).html() + '|' + values); alert(values); }); document.getElementById("hdnWeekID").value = values; I tried the for one day but i cann't retrive the data of listview either in javascript nor in asp.net code behind. please anyone give the right solution for me.
0
6,424,284
06/21/2011 11:07:48
368,026
06/16/2010 08:14:21
108
12
firebug console stops working - commands just dump string into output
I have this weird problem again. My console (actually console.info()) stops working completely - no messages get "echoed" from my View (MVC) <script> tags, also it doesn't work in Firebug directly. Most weird thing about this bug, is, that in Firebug's console, command just repeat as string into output (see [fig.][1]) when I run the command. ![firebug console bug][2] In normal circumstances selector should dump a DOM nodes into console output. Has anybody same experience. First this bug occured to me on Archlinux w/ Gnome2.32, now on Mac OS - SN. I'm using lots of extensions, maybe some of them is causing this behavior. Adblock+, ColorZilla, Delicious Ext., Download manager tweak, Downthemall, Firebug, firegestures, Greasemonkey (w/ FFixer), gTranslate, HttpFox, JSONview, JSView, Linkification, NoScript, Organize statusbar, Read it later, Screen capture elite, show Go! (updated), Slovniky slovenskeho pravopisu (slovak spellchecker), Stylish, Tab mix+, tamper data, US eng. spellchecker, Web Developer (toolbar), Xmarks, Zoom Page [1]: http://i54.tinypic.com/1zxqph5.png [2]: http://i.stack.imgur.com/99VKi.png
console
firebug
null
null
null
06/25/2011 10:33:07
too localized
firebug console stops working - commands just dump string into output === I have this weird problem again. My console (actually console.info()) stops working completely - no messages get "echoed" from my View (MVC) <script> tags, also it doesn't work in Firebug directly. Most weird thing about this bug, is, that in Firebug's console, command just repeat as string into output (see [fig.][1]) when I run the command. ![firebug console bug][2] In normal circumstances selector should dump a DOM nodes into console output. Has anybody same experience. First this bug occured to me on Archlinux w/ Gnome2.32, now on Mac OS - SN. I'm using lots of extensions, maybe some of them is causing this behavior. Adblock+, ColorZilla, Delicious Ext., Download manager tweak, Downthemall, Firebug, firegestures, Greasemonkey (w/ FFixer), gTranslate, HttpFox, JSONview, JSView, Linkification, NoScript, Organize statusbar, Read it later, Screen capture elite, show Go! (updated), Slovniky slovenskeho pravopisu (slovak spellchecker), Stylish, Tab mix+, tamper data, US eng. spellchecker, Web Developer (toolbar), Xmarks, Zoom Page [1]: http://i54.tinypic.com/1zxqph5.png [2]: http://i.stack.imgur.com/99VKi.png
3
11,225,319
06/27/2012 11:38:27
834,387
07/07/2011 21:24:24
1
0
How to automate capability changes for file?
I have a file in linux, that need some capabilities for start. I can set them using `setcap`, but the problem is that this file is updated very often and I don't want to set them every time the file is updated(and enter password during this process). Is there any other way to do this, except to write a program that will do this? Or maybe could I somehow omit to save password in this program?(But I prefer don't write program at all) And yes, I've already goggled about capabilities and my problem, and haven't found any suitable solution for it. Thanks!
linux
capability
null
null
null
07/02/2012 14:02:50
not a real question
How to automate capability changes for file? === I have a file in linux, that need some capabilities for start. I can set them using `setcap`, but the problem is that this file is updated very often and I don't want to set them every time the file is updated(and enter password during this process). Is there any other way to do this, except to write a program that will do this? Or maybe could I somehow omit to save password in this program?(But I prefer don't write program at all) And yes, I've already goggled about capabilities and my problem, and haven't found any suitable solution for it. Thanks!
1
1,296,301
08/18/2009 20:27:13
98,215
04/30/2009 03:15:21
241
5
Employer expectations of a developer (first programming job, 2 year degree)
I've been in the engineering world for over 15 years. I have experience in the corporate world as well as small mom & pop companies. In my previous jobs, one of my tasks was to write software apps and do some project-specific database development (project tracking, record data from scientific analysis, GIS stuff, etc.) using VBA, vb.net, c#, VB6, and even some AutoLISP. Now, I decided to switch gears and do software development as my career instead of the occassional task. I recently picked up a .NET development degree from a local tech college to prove I was at least a little bit more than just some hack that cobbled together a few programs for my boss. What TECHNICAL skills does a software company expect from someone like me, in my first development job? I assume the basics like create classes, do some CRUD stuff, and how to debug. What else?
career-development
null
null
null
null
02/02/2012 08:41:31
not constructive
Employer expectations of a developer (first programming job, 2 year degree) === I've been in the engineering world for over 15 years. I have experience in the corporate world as well as small mom & pop companies. In my previous jobs, one of my tasks was to write software apps and do some project-specific database development (project tracking, record data from scientific analysis, GIS stuff, etc.) using VBA, vb.net, c#, VB6, and even some AutoLISP. Now, I decided to switch gears and do software development as my career instead of the occassional task. I recently picked up a .NET development degree from a local tech college to prove I was at least a little bit more than just some hack that cobbled together a few programs for my boss. What TECHNICAL skills does a software company expect from someone like me, in my first development job? I assume the basics like create classes, do some CRUD stuff, and how to debug. What else?
4
9,372,918
02/21/2012 06:00:41
1,012,152
10/25/2011 05:49:03
51
0
ubuntu 11.10 installation with dell 990
I have tried installing ubuntu 11.10 x64 on my dell 990 PC. When installation completed, I restart and tried log in,system was blocked, with only background and no task bar。keyboard can not respond,mouse can do move,right button can not respond.It's so weird and I have spend two days with the situation. help!!
linux
ubuntu
x64
block
null
02/21/2012 12:15:20
off topic
ubuntu 11.10 installation with dell 990 === I have tried installing ubuntu 11.10 x64 on my dell 990 PC. When installation completed, I restart and tried log in,system was blocked, with only background and no task bar。keyboard can not respond,mouse can do move,right button can not respond.It's so weird and I have spend two days with the situation. help!!
2
1,861,411
12/07/2009 17:13:38
172,617
09/12/2009 22:43:15
213
6
Recommended Multithreading books in .Net / C#?
Does anyone have any books written for .net that deal with multithreading? I've looked at Joe Duffy's and Joseph Albahari's books, and they're good. I was hoping however, to have something that also touches on PLINQ and TPL, which Duffy's book certainly does, but many of its examples and snippets are in C++. I was ideally looking for something a little more C# oriented. Thanks for your suggestions.
multithreading
c#
null
null
null
09/28/2011 11:31:53
not constructive
Recommended Multithreading books in .Net / C#? === Does anyone have any books written for .net that deal with multithreading? I've looked at Joe Duffy's and Joseph Albahari's books, and they're good. I was hoping however, to have something that also touches on PLINQ and TPL, which Duffy's book certainly does, but many of its examples and snippets are in C++. I was ideally looking for something a little more C# oriented. Thanks for your suggestions.
4
5,563,196
04/06/2011 08:02:53
617,518
02/15/2011 09:39:52
6
0
how do i get multiple twitter name using API querystring?
HI,how do i get multiple twitter name using API querystring,exmaple i need to populate related with the name of 'john'.how can i do that here i have one example below 'http://search.twitter.com/search.atom?q=from%3Ajohn' by this example we can see only particular user name only but i want related name.Kindly let me know ASAP.
salesforce
null
null
null
null
null
open
how do i get multiple twitter name using API querystring? === HI,how do i get multiple twitter name using API querystring,exmaple i need to populate related with the name of 'john'.how can i do that here i have one example below 'http://search.twitter.com/search.atom?q=from%3Ajohn' by this example we can see only particular user name only but i want related name.Kindly let me know ASAP.
0
2,500,625
03/23/2010 14:22:41
121,366
06/11/2009 14:24:54
1,399
48
DockPanel Suite : Open Document-tab Location?
We're revamping our winforms user interface to use the [Weifen Luo DockPanel Suite][1] and since our old UI didn't have tabs, we would like to show a ballon tooltip when a new window is docked to the document area, informing users that they may rip-out the document and float it wherever they would like. I figure to do this I need to be able to programatically determine the location of a docked window's tab. Our DockPanel's DocumentStyle is set to DockingWindow, so tabs are always shown for any windows docked into the 'document' area. Any ideas? [1]: http://sourceforge.net/projects/dockpanelsuite/
dockpanel-suite
winforms
c#
.net
null
null
open
DockPanel Suite : Open Document-tab Location? === We're revamping our winforms user interface to use the [Weifen Luo DockPanel Suite][1] and since our old UI didn't have tabs, we would like to show a ballon tooltip when a new window is docked to the document area, informing users that they may rip-out the document and float it wherever they would like. I figure to do this I need to be able to programatically determine the location of a docked window's tab. Our DockPanel's DocumentStyle is set to DockingWindow, so tabs are always shown for any windows docked into the 'document' area. Any ideas? [1]: http://sourceforge.net/projects/dockpanelsuite/
0
9,357,558
02/20/2012 07:25:43
1,208,594
02/14/2012 08:07:30
3
0
execute application jumping lock screen
I want to develop an application that triggers up automatically when the user pulls out the earphones. I would like to know if it is possible to run it in the foreground automatically avoiding the unlock screen. Thank you in advance.
ios
background-process
lockscreen
null
null
null
open
execute application jumping lock screen === I want to develop an application that triggers up automatically when the user pulls out the earphones. I would like to know if it is possible to run it in the foreground automatically avoiding the unlock screen. Thank you in advance.
0
6,015,496
05/16/2011 09:38:15
564,580
01/05/2011 21:06:10
23
1
How does Youtube control Flash content loading (Chrome 12)
Several days ago my Google Chrome was updated to 12.0.742.53 beta, and I've noticed very interesting change. When opening a Youtube video page, page loading process does not end even when all the content (text, images) is loaded; loading ends only when **video buffering** completes! Also, when I interrupt the loading (by pressing `Esc`, for example) video downloading is also stopped! (Until now I had to right click on the video and press _Stop Download_ to abort buffering). IMHO that's a great user experience and a big step for making the Flash-based content behave like ordinary web content. My question is: how this is done?! I thought they're simulating some loading process until the buffering completes. Also they should have handled the `window.onAbort` event or something, in order to "tell" the Flash to stop buffering. I tried to catch that event using Chrome's DOM Inspector, but no luck... Or... do they use some special API that is currently available only in Chrome? There is no such behavior on FF4 right now.
javascript
flash
youtube
null
null
null
open
How does Youtube control Flash content loading (Chrome 12) === Several days ago my Google Chrome was updated to 12.0.742.53 beta, and I've noticed very interesting change. When opening a Youtube video page, page loading process does not end even when all the content (text, images) is loaded; loading ends only when **video buffering** completes! Also, when I interrupt the loading (by pressing `Esc`, for example) video downloading is also stopped! (Until now I had to right click on the video and press _Stop Download_ to abort buffering). IMHO that's a great user experience and a big step for making the Flash-based content behave like ordinary web content. My question is: how this is done?! I thought they're simulating some loading process until the buffering completes. Also they should have handled the `window.onAbort` event or something, in order to "tell" the Flash to stop buffering. I tried to catch that event using Chrome's DOM Inspector, but no luck... Or... do they use some special API that is currently available only in Chrome? There is no such behavior on FF4 right now.
0
10,375,430
04/29/2012 19:53:50
518,397
11/24/2010 06:40:34
133
10
Submitting email submit success on page, not loading a new page via php
I'm finished an email form using phpmailer() and at the end I have success and and error that is echo'd. Unfortunately it loads a new page and echo's these values. I'm trying to get them to echo on the page of the form. if(!$mail->Send()) { echo 'Message was not sent, please try again.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent. You will be contacted soon!'; } This message I want sent to either the top of the `<form>` or the bottom of it. (javascript, jquery?)
php
html
phpmailer
null
null
null
open
Submitting email submit success on page, not loading a new page via php === I'm finished an email form using phpmailer() and at the end I have success and and error that is echo'd. Unfortunately it loads a new page and echo's these values. I'm trying to get them to echo on the page of the form. if(!$mail->Send()) { echo 'Message was not sent, please try again.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent. You will be contacted soon!'; } This message I want sent to either the top of the `<form>` or the bottom of it. (javascript, jquery?)
0
10,635,677
05/17/2012 12:22:33
1,359,375
04/26/2012 17:41:13
17
0
Does anyone know a good program
I want to learn Delphi, does anyone know of a good free program that would let me write code with Delphi? I want to learn as many languages as I can, I already kinda know C#, some LUA, some VB and Java, but I want to know more, for the sake of knowing I guess.
delphi
null
null
null
null
05/18/2012 15:03:25
not constructive
Does anyone know a good program === I want to learn Delphi, does anyone know of a good free program that would let me write code with Delphi? I want to learn as many languages as I can, I already kinda know C#, some LUA, some VB and Java, but I want to know more, for the sake of knowing I guess.
4
4,589,416
01/03/2011 23:39:27
36,693
11/11/2008 20:16:25
460
21
Touchscreen Windows 7 WPF
I have an app which I need to make accessible for Windows Touch. It is not a **multi**-touch application. I've looked at Microsoft's [guidelines][1] for touch applications which is interesting. There is one thing I am not clear on though, that is text input. I would like a keyboard to appear when I click in a TextBox field. Is there a way to use the built-in on screen keyboard for this? The first monitor I tested with was a Wacom. It is an older unit that uses a pen. It had some software that pulled up an on screen keyboard whenever I clicked in any text field (in any application). It was very handy. I thought this feature was using built-in Windows Tablet software because it didn't look like it came from a third party. A newer monitor I just purchased (Elo) does not have this feature though. [1]: http://msdn.microsoft.com/en-us/library/cc872774.aspx
wpf
windows-7
touchscreen
null
null
null
open
Touchscreen Windows 7 WPF === I have an app which I need to make accessible for Windows Touch. It is not a **multi**-touch application. I've looked at Microsoft's [guidelines][1] for touch applications which is interesting. There is one thing I am not clear on though, that is text input. I would like a keyboard to appear when I click in a TextBox field. Is there a way to use the built-in on screen keyboard for this? The first monitor I tested with was a Wacom. It is an older unit that uses a pen. It had some software that pulled up an on screen keyboard whenever I clicked in any text field (in any application). It was very handy. I thought this feature was using built-in Windows Tablet software because it didn't look like it came from a third party. A newer monitor I just purchased (Elo) does not have this feature though. [1]: http://msdn.microsoft.com/en-us/library/cc872774.aspx
0
11,414,251
07/10/2012 13:21:34
1,514,833
07/10/2012 12:55:51
1
0
android application crashs when exit
> if (MusicService.player1.isPlaying()) { MusicService.player1.stop(); stopService(new Intent(ButtonActivity.this, MusicService.class)); ButtonActivity.this.finish(); } else { ButtonActivity.this.finish(); } ***in this code, when you click "exit", if background music is playing, app exits succesfully.. but when background music is not playing, app crashs.. ı am a newbie about programming... thanx for help..***
java
android
exit
background-music
null
07/12/2012 02:06:41
too localized
android application crashs when exit === > if (MusicService.player1.isPlaying()) { MusicService.player1.stop(); stopService(new Intent(ButtonActivity.this, MusicService.class)); ButtonActivity.this.finish(); } else { ButtonActivity.this.finish(); } ***in this code, when you click "exit", if background music is playing, app exits succesfully.. but when background music is not playing, app crashs.. ı am a newbie about programming... thanx for help..***
3
11,326,978
07/04/2012 10:12:09
636,329
02/27/2011 09:49:57
313
6
Moving files between home directories
Good morning, I am attempting to setup a cron job on my CentOS machine that will transfer a file from one users home directory to a directory in anothers. btiseis@mymachine [~]# mv ./myfile.csv /home/mmh/tmp I have ensured that the tmp directory has 0777 permissions but I still get the following error message: mv: accessing '/home/mmh/tmp': Permission denied I assume this problem is due to transferring the file across home directories. Any ideas? Dan
linux
centos
mv
null
null
07/04/2012 22:34:01
off topic
Moving files between home directories === Good morning, I am attempting to setup a cron job on my CentOS machine that will transfer a file from one users home directory to a directory in anothers. btiseis@mymachine [~]# mv ./myfile.csv /home/mmh/tmp I have ensured that the tmp directory has 0777 permissions but I still get the following error message: mv: accessing '/home/mmh/tmp': Permission denied I assume this problem is due to transferring the file across home directories. Any ideas? Dan
2
9,915,819
03/28/2012 21:19:49
659,932
03/15/2011 04:14:38
136
4
I installed mysql 5.1 from the official site, but am having issues
Two issues in particular: 1) The server won't start when I try to start it from the pref pane 2) I get this error when I type "mysql" in the command line. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
mysql
setup
environment
null
null
null
open
I installed mysql 5.1 from the official site, but am having issues === Two issues in particular: 1) The server won't start when I try to start it from the pref pane 2) I get this error when I type "mysql" in the command line. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
0
2,719,039
04/27/2010 05:56:52
326,592
04/27/2010 05:56:52
1
0
looking to scan documents directly to be uploaded to a webpage
I was hoping to do this from a flash plugin, kind of how flash accesses the microphone or webcam but it doesn't seem possible. Is this going to be possible using Java, or ActiveX, or some other strategy that I haven't looked at yet? The idea is to do it without a client install, or at least something lightweight and browser and platform independent, (and possibly the moon on a stick as welll ;-))
flash
java
upload
null
null
null
open
looking to scan documents directly to be uploaded to a webpage === I was hoping to do this from a flash plugin, kind of how flash accesses the microphone or webcam but it doesn't seem possible. Is this going to be possible using Java, or ActiveX, or some other strategy that I haven't looked at yet? The idea is to do it without a client install, or at least something lightweight and browser and platform independent, (and possibly the moon on a stick as welll ;-))
0
8,438,125
12/08/2011 21:44:06
430,004
08/24/2010 20:40:09
59
1
Replacing apostrophe with preg_replace in smarty
<meta property="og:image" content="{$Image|regex_replace:"/(div class=+)/i":""}" /> I want to add apostrophes to this so I can replace them with nothing. How would I achieve this?
php
smarty
null
null
null
null
open
Replacing apostrophe with preg_replace in smarty === <meta property="og:image" content="{$Image|regex_replace:"/(div class=+)/i":""}" /> I want to add apostrophes to this so I can replace them with nothing. How would I achieve this?
0
3,140,852
06/29/2010 13:03:11
431,186
05/21/2010 10:26:01
1
0
BlackBerry we req that thing
![alt text][1] [1]: http://C:\Documents and Settings\imran.aslam\Desktop\Messenger Images\Messenger Images we require a code of that design for blackberry development we done the all specific images and place in location but we require the values of that images
blackberry
null
null
null
null
06/29/2010 13:07:12
not a real question
BlackBerry we req that thing === ![alt text][1] [1]: http://C:\Documents and Settings\imran.aslam\Desktop\Messenger Images\Messenger Images we require a code of that design for blackberry development we done the all specific images and place in location but we require the values of that images
1
5,718,816
04/19/2011 15:25:43
711,213
04/16/2011 14:12:01
1
0
implement a dictionary by tries in java
I want to implement a dictionary by tries in java but can't add new node to tries I think that my implementing is wrong . Class NodeTries () { String key ; NodeTries[] nextNodes ; }
java
homework
dictionary
trie
null
04/19/2011 15:34:53
not a real question
implement a dictionary by tries in java === I want to implement a dictionary by tries in java but can't add new node to tries I think that my implementing is wrong . Class NodeTries () { String key ; NodeTries[] nextNodes ; }
1
10,327,387
04/26/2012 04:47:57
1,357,528
04/26/2012 01:07:19
1
0
Given dataset, are there any methods to find its density?
I want to find how dense the data is. Could anyone suggest? Thanks
density
null
null
null
null
05/06/2012 18:31:34
not a real question
Given dataset, are there any methods to find its density? === I want to find how dense the data is. Could anyone suggest? Thanks
1
2,021,099
01/07/2010 14:55:39
243,161
01/04/2010 12:22:37
1
0
Open in a New tab feature on Internet Explorer 8 on "windows 7" 64 bit
I just built a new machine and installed the windows 7 ultimate 64 bit on it. Internet explorer 8 is giving me major pains. whenever I try to open a link in a new tab, it hangs. Although the new tab works fine if I just click on the new tab. It is just the "Ctrl+Click" or "Right Click" and "Open with new tab" that hangs the IE for around 30 seconds or so and then opens the link in a new window. I have already tried out the solutions given here: http://social.answers.microsoft.com/Forums/en-US/InternetExplorer/thread/e312e580-1cbc-496b-8c6b-b69b8535a7bb?prof=required Nothing works. The long batch file solution got pretty close, but it is giving an access denied on the "fixing registry bugs" part. This is my first question at stackoverflow. Help me out guys...
internet-explorer-8
null
null
null
null
08/04/2011 04:20:11
off topic
Open in a New tab feature on Internet Explorer 8 on "windows 7" 64 bit === I just built a new machine and installed the windows 7 ultimate 64 bit on it. Internet explorer 8 is giving me major pains. whenever I try to open a link in a new tab, it hangs. Although the new tab works fine if I just click on the new tab. It is just the "Ctrl+Click" or "Right Click" and "Open with new tab" that hangs the IE for around 30 seconds or so and then opens the link in a new window. I have already tried out the solutions given here: http://social.answers.microsoft.com/Forums/en-US/InternetExplorer/thread/e312e580-1cbc-496b-8c6b-b69b8535a7bb?prof=required Nothing works. The long batch file solution got pretty close, but it is giving an access denied on the "fixing registry bugs" part. This is my first question at stackoverflow. Help me out guys...
2
3,195,160
07/07/2010 13:31:10
373,710
06/22/2010 23:06:31
28
0
Why are there so little versioning file systems?
I did some literature research about <b>versioning file systems</b>. Versioning was already common practice in the very early operating systems such as the influential but almost forgotten <em>Incompatible Timesharing System</em> (ITS) and <em>TENEX</em>. OpenVMS, the successor of TENEX, seems to be still used in special applications and it still supports versioning. I found a number of experimental and historic file systems with versioning (see the [ext3cow FAQ](http://www.ext3cow.com/FAQ.html)). But none of the major operating system (Linux, Windows, Mac OS) support versioning by default. How become operating systems and file systems so retarded that they do not support such a powerful feature that people had almost 40 years ago?! Of course you can hack versioning into your systems somehow but this should be supported to the most basic level, transparent to applications. Just to clarify: Journaling and snapshot facilities (such as Apple's TimeMachine) are <em>not</em> the same. Versioning on file system level means: every process that modifies a file, automatically triggers the creation of a new version that you can directly access afterwords (for instance to undo the process). You can implement this cheaply with copy-on-write. The only modern application of a versioning file system that I found is [versioning in Amazon S3](http://doc.s3.amazonaws.com/betadesign/Versioning.html) which they introduced a few month ago. Why are there so little versioning file systems? What happened to progress of computer systems? Is versioning a bad idea anyway?
filesystems
versioning
null
null
null
07/08/2010 16:44:15
off topic
Why are there so little versioning file systems? === I did some literature research about <b>versioning file systems</b>. Versioning was already common practice in the very early operating systems such as the influential but almost forgotten <em>Incompatible Timesharing System</em> (ITS) and <em>TENEX</em>. OpenVMS, the successor of TENEX, seems to be still used in special applications and it still supports versioning. I found a number of experimental and historic file systems with versioning (see the [ext3cow FAQ](http://www.ext3cow.com/FAQ.html)). But none of the major operating system (Linux, Windows, Mac OS) support versioning by default. How become operating systems and file systems so retarded that they do not support such a powerful feature that people had almost 40 years ago?! Of course you can hack versioning into your systems somehow but this should be supported to the most basic level, transparent to applications. Just to clarify: Journaling and snapshot facilities (such as Apple's TimeMachine) are <em>not</em> the same. Versioning on file system level means: every process that modifies a file, automatically triggers the creation of a new version that you can directly access afterwords (for instance to undo the process). You can implement this cheaply with copy-on-write. The only modern application of a versioning file system that I found is [versioning in Amazon S3](http://doc.s3.amazonaws.com/betadesign/Versioning.html) which they introduced a few month ago. Why are there so little versioning file systems? What happened to progress of computer systems? Is versioning a bad idea anyway?
2
3,873,554
10/06/2010 14:27:54
276,809
02/19/2010 08:50:31
143
0
How to make subdomains on codeigniter
Is there an easy way to create subdomains on codeigniter like api.site.com.? Thanks in advance.
php
.htaccess
mod-rewrite
codeigniter
subdomains
null
open
How to make subdomains on codeigniter === Is there an easy way to create subdomains on codeigniter like api.site.com.? Thanks in advance.
0
11,359,641
07/06/2012 09:36:24
1,336,200
04/16/2012 11:40:19
2
0
batch job to export table to spreadsheet in Rails application
I would like the contents of a table to be exported as spreadsheet. I want this done periodically.Can I configure any batch job plugin to achieve this? Thank You
ruby-on-rails
export
jobs
null
null
07/06/2012 18:24:31
not a real question
batch job to export table to spreadsheet in Rails application === I would like the contents of a table to be exported as spreadsheet. I want this done periodically.Can I configure any batch job plugin to achieve this? Thank You
1
4,088,548
11/03/2010 15:13:26
46,991
12/17/2008 09:16:55
6,530
184
Calling a base-class non-virtual function which has been redefined?
I know some think I shouldn't redefine non-virtual functions from inherited classes, however, what I'm doing now is using that very role-migration concept, and it is fairly special case where it fits quite nicely. What I want is this (oh, and this is C++): class A { void f() { doSomethingA(); } } class B : public A { void f() { A::f(); doSomethingB(); } } However, when I do this, `A::f` gets called with `this == 0`, which obviously results in segfault. Am I doing something wrong, or is this simply not possible? My current option is to resort to static functions and pass the object explicitly, but I'd prefer it this way. Yes, I could call them differently, but that kind of defeats the purpose of making them look similar to the programmer. And I can't make them virtual for various reasons (the most prominent being the role-migration, that I actually want different behavior depending on what I use it as). Any help appreciated
c++
inheritance
null
null
null
null
open
Calling a base-class non-virtual function which has been redefined? === I know some think I shouldn't redefine non-virtual functions from inherited classes, however, what I'm doing now is using that very role-migration concept, and it is fairly special case where it fits quite nicely. What I want is this (oh, and this is C++): class A { void f() { doSomethingA(); } } class B : public A { void f() { A::f(); doSomethingB(); } } However, when I do this, `A::f` gets called with `this == 0`, which obviously results in segfault. Am I doing something wrong, or is this simply not possible? My current option is to resort to static functions and pass the object explicitly, but I'd prefer it this way. Yes, I could call them differently, but that kind of defeats the purpose of making them look similar to the programmer. And I can't make them virtual for various reasons (the most prominent being the role-migration, that I actually want different behavior depending on what I use it as). Any help appreciated
0
1,570,750
10/15/2009 07:18:25
7,581
09/15/2008 14:00:21
2,599
86
wget-like bittorrent client or library?
Is there any bittorrent client or (Java|Python|Ruby|Perl) library that I can use like wget or curl? I would like to use simply as a step in a script, like you would use wget.
bittorrent
null
null
null
null
10/16/2011 16:56:09
too localized
wget-like bittorrent client or library? === Is there any bittorrent client or (Java|Python|Ruby|Perl) library that I can use like wget or curl? I would like to use simply as a step in a script, like you would use wget.
3
5,747,576
04/21/2011 17:21:48
704,840
04/12/2011 20:20:39
6
0
Access an object property dynamicly.
Is it possible to access an object property dynamicly within C#? I can't seem to figured out a way. VS seems to yell at me every time. Here is an example to convery what I am trying to do. So we have two object let's call it car. Car CAR1 = new Car(); Car CAR2 = new Car(); Now say I have CAR1 and CAR2 in an array called myArray; int count = myArray.length. So here is the issue, I want to be able to loop though the array be able to access the object property's. E.g For (int i =0; i < count; i++) { myArry[i].GetProperty; myArry[i].GetProperty2; myArry[i].GetProperty3; } Howerver, the above, VS doesn't. Is there anyway I can accomplish this?
c#
oop
object
properties
null
null
open
Access an object property dynamicly. === Is it possible to access an object property dynamicly within C#? I can't seem to figured out a way. VS seems to yell at me every time. Here is an example to convery what I am trying to do. So we have two object let's call it car. Car CAR1 = new Car(); Car CAR2 = new Car(); Now say I have CAR1 and CAR2 in an array called myArray; int count = myArray.length. So here is the issue, I want to be able to loop though the array be able to access the object property's. E.g For (int i =0; i < count; i++) { myArry[i].GetProperty; myArry[i].GetProperty2; myArry[i].GetProperty3; } Howerver, the above, VS doesn't. Is there anyway I can accomplish this?
0
9,126,852
02/03/2012 10:07:04
1,187,231
02/03/2012 10:03:07
1
0
DirectX Game Screenshots
Software: Visual Basic 2008 My problem: I make a program for taking screenshots from the game, this is the current code that I use: Dim bounds As Rectangle Dim screenshot As System.Drawing.Bitmap Dim graph As Graphics bounds = Screen.PrimaryScreen.Bounds screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb) graph = Graphics.FromImage(screenshot) graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy) PictureBox1.Image = screenshot and it works great when i need to take a desktop screenshot, but when i try take a game screenshot it does not work! I read on the internet and it says that I need to take screenshots from DirectX. The problem is that I never worked with DirectX and I need your help, any help is welcome if it is related to my problem, I would appreciate if you have some kind of example. Thank you!
directx
screenshot
null
null
null
02/05/2012 03:58:54
not a real question
DirectX Game Screenshots === Software: Visual Basic 2008 My problem: I make a program for taking screenshots from the game, this is the current code that I use: Dim bounds As Rectangle Dim screenshot As System.Drawing.Bitmap Dim graph As Graphics bounds = Screen.PrimaryScreen.Bounds screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb) graph = Graphics.FromImage(screenshot) graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy) PictureBox1.Image = screenshot and it works great when i need to take a desktop screenshot, but when i try take a game screenshot it does not work! I read on the internet and it says that I need to take screenshots from DirectX. The problem is that I never worked with DirectX and I need your help, any help is welcome if it is related to my problem, I would appreciate if you have some kind of example. Thank you!
1
7,349,228
09/08/2011 13:58:09
934,958
09/08/2011 13:58:09
1
0
Facebook Denying access to site that is not in violation of any rules
doing a debug on my site I end up with this http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.thestygianrenegade.tk which is strange as there is nothing malicious or against the rules on the site. Now I know it's not a top-level domain block (like co.cc was in the past) because the following link http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.blahblahblah.tk proves that there is no block of that nature. This is preventing me from fixing up the applications and share buttons on my news site and preventing them from working altogether. My question is, who do I talk to (or email) about issues like this and getting a site that was wrongfully blocked, unblocked? There seems to be absolutely NO contact information anywhere on the facebook site to get ahold of someone to appeal this block that shouldn't exist in the first place.
php
facebook-page
null
null
null
09/08/2011 14:05:47
off topic
Facebook Denying access to site that is not in violation of any rules === doing a debug on my site I end up with this http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.thestygianrenegade.tk which is strange as there is nothing malicious or against the rules on the site. Now I know it's not a top-level domain block (like co.cc was in the past) because the following link http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.blahblahblah.tk proves that there is no block of that nature. This is preventing me from fixing up the applications and share buttons on my news site and preventing them from working altogether. My question is, who do I talk to (or email) about issues like this and getting a site that was wrongfully blocked, unblocked? There seems to be absolutely NO contact information anywhere on the facebook site to get ahold of someone to appeal this block that shouldn't exist in the first place.
2
735,589
04/09/2009 19:25:24
23,667
09/30/2008 03:58:53
774
70
ADVICE on billing Query in SQL Server 2000
I need some advice in tackling a query. I can handle this in a front-end application, however, due to design, I have to inplement this in the back-end. I have the following <pre> <code> CREATE TABLE [dbo].[openitems]( [id] [varchar](8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [type] [char](5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [date] [smalldatetime] NULL, [amount] [decimal](9, 2) NULL, [daysOpen] [smallint] NULL, [balance] [decimal](9, 2) NULL ) ON [PRIMARY] insert into openitems values('A12399','INV','2008-12-05',491.96,123) insert into openitems values('A12399','INV','2008-12-12',4911.37,116) insert into openitems values('A12399','INV','2008-12-05',3457.69,109) </pre> </code> The table above have all open invoices for a customer. I need to apply a payment to these invoices starting from the oldest invoice (daysOpen column in the table). So if I have a $550.00 payment, I'll first apply it to the invoice with 123 daysOld, that's $491.96 -$500 (which leaves $8.04 to be applied to the next invoice... and so on), then update that record (balance column in table) to 0.00 and move to the next and apply the remaining. That would be $4911.37 - $8.04, which would leave $4903.33. Since there is no balance left to be applied, the loop exits. The balance column should now read <pre> 0 4903.33 3457.69 </pre> Note: I need to do this for all customers in a table (around 10,000). A customer has an average of about 20 invoices open. Thanks
sql
sql-server2000
billing
null
null
null
open
ADVICE on billing Query in SQL Server 2000 === I need some advice in tackling a query. I can handle this in a front-end application, however, due to design, I have to inplement this in the back-end. I have the following <pre> <code> CREATE TABLE [dbo].[openitems]( [id] [varchar](8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [type] [char](5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [date] [smalldatetime] NULL, [amount] [decimal](9, 2) NULL, [daysOpen] [smallint] NULL, [balance] [decimal](9, 2) NULL ) ON [PRIMARY] insert into openitems values('A12399','INV','2008-12-05',491.96,123) insert into openitems values('A12399','INV','2008-12-12',4911.37,116) insert into openitems values('A12399','INV','2008-12-05',3457.69,109) </pre> </code> The table above have all open invoices for a customer. I need to apply a payment to these invoices starting from the oldest invoice (daysOpen column in the table). So if I have a $550.00 payment, I'll first apply it to the invoice with 123 daysOld, that's $491.96 -$500 (which leaves $8.04 to be applied to the next invoice... and so on), then update that record (balance column in table) to 0.00 and move to the next and apply the remaining. That would be $4911.37 - $8.04, which would leave $4903.33. Since there is no balance left to be applied, the loop exits. The balance column should now read <pre> 0 4903.33 3457.69 </pre> Note: I need to do this for all customers in a table (around 10,000). A customer has an average of about 20 invoices open. Thanks
0
8,534,132
12/16/2011 12:26:52
143,030
07/22/2009 17:14:12
5,615
49
Good structure for a PHP MVC project
I have been researching for nearly a year on how I would like to do my personal MVC library/framework. I have learned a lot and the good people of SO have helped me tremendously. I have noticed that most MVC frameworks will have the `Models` `Views` and `Controllers` folders. In a large project this doesn't make sense to me. In my example let's assume I am building a social network site. It would have many `sections`, `users`, `messaging`, `blogs`, `chat`, `wall`, `groups`, `events`. These are just ideas for an example... So if a larger project like that had all the `Models`, `Views`, and `Controllers` crammed into those **3** folders, it would be chaos. So I am thinking of doing my MVC into sections or `Modules` so that each main section gets it's own folder and then it's own set of `MVC` folders like the demonstration below.... root/ ----/.htaccess ----/index.php ----/assets/ ----/Modules/ ------------/Core/ -----------------/Models/ -----------------/Views/ -----------------/Controllers/ -----------------/Helpers/ -----------/Users/ -----------------/Models/ -----------------/Views/ -----------------/Controllers/ -----------/Messages/ --------------------/Models/ --------------------/Views/ --------------------/Controllers/ ----------/Photos/ -----------------/Models/ -----------------/Views/ -----------------/Controllers/ ----------/ etc.....etc...all the other "Modules" ----/library/ ------------/Database/ ------------/Router/ ------------/Template/ ------------/.....etc...etc ---------- Now I am just looking to ask other's with more experience, does this seem like a good idea, I didn't see it in use too often by other projects which is why I question it. Also the file structure would route everything through `index.php` and all the `Module` folders would get there own name in the URI. So `root/modules/users` would be routed to ` domain.com/users` and things inside the `root/modules/core` would be routed to ` domain.com/` so they are like the main site Any improvements? See anything I am possibly missing to make a good MVC design work with this structure? I appreciate any feedback
php
mvc
oop
null
null
12/16/2011 13:31:26
not constructive
Good structure for a PHP MVC project === I have been researching for nearly a year on how I would like to do my personal MVC library/framework. I have learned a lot and the good people of SO have helped me tremendously. I have noticed that most MVC frameworks will have the `Models` `Views` and `Controllers` folders. In a large project this doesn't make sense to me. In my example let's assume I am building a social network site. It would have many `sections`, `users`, `messaging`, `blogs`, `chat`, `wall`, `groups`, `events`. These are just ideas for an example... So if a larger project like that had all the `Models`, `Views`, and `Controllers` crammed into those **3** folders, it would be chaos. So I am thinking of doing my MVC into sections or `Modules` so that each main section gets it's own folder and then it's own set of `MVC` folders like the demonstration below.... root/ ----/.htaccess ----/index.php ----/assets/ ----/Modules/ ------------/Core/ -----------------/Models/ -----------------/Views/ -----------------/Controllers/ -----------------/Helpers/ -----------/Users/ -----------------/Models/ -----------------/Views/ -----------------/Controllers/ -----------/Messages/ --------------------/Models/ --------------------/Views/ --------------------/Controllers/ ----------/Photos/ -----------------/Models/ -----------------/Views/ -----------------/Controllers/ ----------/ etc.....etc...all the other "Modules" ----/library/ ------------/Database/ ------------/Router/ ------------/Template/ ------------/.....etc...etc ---------- Now I am just looking to ask other's with more experience, does this seem like a good idea, I didn't see it in use too often by other projects which is why I question it. Also the file structure would route everything through `index.php` and all the `Module` folders would get there own name in the URI. So `root/modules/users` would be routed to ` domain.com/users` and things inside the `root/modules/core` would be routed to ` domain.com/` so they are like the main site Any improvements? See anything I am possibly missing to make a good MVC design work with this structure? I appreciate any feedback
4
6,771,484
07/21/2011 05:07:59
385,273
07/07/2010 07:39:55
3,220
248
PHP regex optional non-matching groups?
I'm trying to make a date regex that allows years from 1900 to 2099, with the 19 or 20 optional. I'm almost there, but I can't find a way to allow the 19 or 20 optional part. Here's what I've got: (?:20)(?:19)?[0-9][0-9] Testing results: String preg_match is this ok? ====== ========== =========== 55 yes yes 1955 yes yes 2055 yes yes 201955 yes no Can someone help out?
php
regex
date
year
null
null
open
PHP regex optional non-matching groups? === I'm trying to make a date regex that allows years from 1900 to 2099, with the 19 or 20 optional. I'm almost there, but I can't find a way to allow the 19 or 20 optional part. Here's what I've got: (?:20)(?:19)?[0-9][0-9] Testing results: String preg_match is this ok? ====== ========== =========== 55 yes yes 1955 yes yes 2055 yes yes 201955 yes no Can someone help out?
0
6,770,757
07/21/2011 02:41:48
55,452
01/15/2009 14:57:43
1,624
92
Using multiple WSDLs with Axis2 wsdl2code Maven plugin
I'm creating a client with Maven2 that uses several web services. I'm restricted to using `Axis2` or other framework supporting Apache `HttpClient` as an HTTP conduit because these services require integration with a managed certificate solution based on `HttpClient`. I'm familiar with CXF's code-gen Maven plugin which allows multiple WSDLs to be input during code generation. However, the Axis2 code-gen plugin can process only one WSDL at a time. How can I make Maven run `wsdl2code` for each WSDL during code-gen phase? Do I need multiple profiles for this? The build section of POM looks like this: <build> <plugins> <plugin> <groupId>org.apache.axis2</groupId> <artifactId>axis2-wsdl2code-maven-plugin</artifactId> <version>1.6.0</version> <executions> <execution> <goals> <goal>wsdl2code</goal> </goals> </execution> </executions> <configuration> <unpackClasses>true</unpackClasses> <databindingName>adb</databindingName> <packageName>org.example.stackoverflow.axis2-maven</packageName> <!-- only one of these actually gets used by code generator --> <wsdlFile>src/main/resources/service1.wsdl</wsdlFile> <wsdlFile>src/main/resources/service2.wsdl</wsdlFile> <outputDirectory>target/generated-sources</outputDirectory> <syncMode>sync</syncMode> </configuration> </plugin> </plugins> </build> ### References ### [Maven2 WSDL2Code Plug-in Guide][1] [wsdl2code command line tool][2] [1]: http://axis.apache.org/axis2/java/core/tools/maven-plugins/maven-wsdl2code-plugin.html [2]: http://axis.apache.org/axis2/java/core/tools/CodegenToolReference.html
maven-2
code-generation
axis2
pom
wsdl2code
null
open
Using multiple WSDLs with Axis2 wsdl2code Maven plugin === I'm creating a client with Maven2 that uses several web services. I'm restricted to using `Axis2` or other framework supporting Apache `HttpClient` as an HTTP conduit because these services require integration with a managed certificate solution based on `HttpClient`. I'm familiar with CXF's code-gen Maven plugin which allows multiple WSDLs to be input during code generation. However, the Axis2 code-gen plugin can process only one WSDL at a time. How can I make Maven run `wsdl2code` for each WSDL during code-gen phase? Do I need multiple profiles for this? The build section of POM looks like this: <build> <plugins> <plugin> <groupId>org.apache.axis2</groupId> <artifactId>axis2-wsdl2code-maven-plugin</artifactId> <version>1.6.0</version> <executions> <execution> <goals> <goal>wsdl2code</goal> </goals> </execution> </executions> <configuration> <unpackClasses>true</unpackClasses> <databindingName>adb</databindingName> <packageName>org.example.stackoverflow.axis2-maven</packageName> <!-- only one of these actually gets used by code generator --> <wsdlFile>src/main/resources/service1.wsdl</wsdlFile> <wsdlFile>src/main/resources/service2.wsdl</wsdlFile> <outputDirectory>target/generated-sources</outputDirectory> <syncMode>sync</syncMode> </configuration> </plugin> </plugins> </build> ### References ### [Maven2 WSDL2Code Plug-in Guide][1] [wsdl2code command line tool][2] [1]: http://axis.apache.org/axis2/java/core/tools/maven-plugins/maven-wsdl2code-plugin.html [2]: http://axis.apache.org/axis2/java/core/tools/CodegenToolReference.html
0
4,725,887
01/18/2011 15:30:38
416,626
08/10/2010 21:14:32
100
10
Calculate the difference between two non-adjacent columns, based on a "match column" using Excel VBA
I'm looking for the most efficient way to compare two sets of two columns, thus: Set 1: `A | B | C | 11_22 | 10 | | 33_44 | 20 | | 55_66 | 30 | | 77_88 | 40 | | 99_00 | 50 | |` Set 2: `J | K | 33_44 | 19 | 99_00 | 47 | 77_88 | 40 |` For each match between column A and J, column C should display the difference between the adjacent cells (in this case 33_44, 99_00, and 77_88) in B and K, respectively, with the full amount in column B if no match exists in J `A | B | C 11_22 | 10 | 10 33_44 | 20 | 1 55_66 | 30 | 30 77_88 | 40 | 0 99_00 | 50 | 3` I'm thinking of creating two multi-dimensional arrays containing values in the ranges (A, B) and (J, K), with a nested loop, but am not sure how to get the result back into column C when a match occurs. Creating a third "result array" and outputting that on a fresh sheet would work too.
vba
excel-vba
null
null
null
null
open
Calculate the difference between two non-adjacent columns, based on a "match column" using Excel VBA === I'm looking for the most efficient way to compare two sets of two columns, thus: Set 1: `A | B | C | 11_22 | 10 | | 33_44 | 20 | | 55_66 | 30 | | 77_88 | 40 | | 99_00 | 50 | |` Set 2: `J | K | 33_44 | 19 | 99_00 | 47 | 77_88 | 40 |` For each match between column A and J, column C should display the difference between the adjacent cells (in this case 33_44, 99_00, and 77_88) in B and K, respectively, with the full amount in column B if no match exists in J `A | B | C 11_22 | 10 | 10 33_44 | 20 | 1 55_66 | 30 | 30 77_88 | 40 | 0 99_00 | 50 | 3` I'm thinking of creating two multi-dimensional arrays containing values in the ranges (A, B) and (J, K), with a nested loop, but am not sure how to get the result back into column C when a match occurs. Creating a third "result array" and outputting that on a fresh sheet would work too.
0
4,048,192
10/29/2010 00:35:10
490,763
10/29/2010 00:35:10
1
0
I Can't normal open my page ?
I Can't normal open my page show me all but without css when i refreash work fine ? thx
php
html
css
null
null
10/29/2010 00:38:06
not a real question
I Can't normal open my page ? === I Can't normal open my page show me all but without css when i refreash work fine ? thx
1
6,178,307
05/30/2011 15:47:20
686,849
04/01/2011 02:44:20
164
2
Notifications in Open Ears
HI, Can anyone tell me about the notifications which are used in the Open ears. Thanks, Christy
iphone
ipad
speech-recognition
null
null
05/31/2011 01:53:44
not a real question
Notifications in Open Ears === HI, Can anyone tell me about the notifications which are used in the Open ears. Thanks, Christy
1
11,435,042
07/11/2012 14:35:53
1,518,075
07/11/2012 14:23:37
1
0
how to get if user likes a post or not with Facebook Graph API in iOS
Facebook Graph API let us use this to get all likes of a "post" [facebook requestWithGraphPath:@"post_id/likes" andDelegate:self]; (post id type maybe status, photo, or link etc) post id ,ex: 183039808383895_363838080355846 we also can use this to get all likes of a "comment" [facebook requestWithGraphPath:@"comment_id/likes" andDelegate:self]; comment id ex: 183039808383895_363838080355846_3047357 if we use this, we can get if user likes this "comment" [facebook requestWithGraphPath:@"comment_id?fields=user_likes" andDelegate:self]; the result is { "user_likes": false, "id": "183039808383895_363838080355846_3047357", "created_time": "2012-07-11T14:01:42+0000" } but how do I get if user likes a "post" or not if I use this [facebook requestWithGraphPath:@"post_id?fields=user_likes" andDelegate:self]; but it doesn't work, I got a error.
ios
facebook-graph-api
facebook-like
null
null
null
open
how to get if user likes a post or not with Facebook Graph API in iOS === Facebook Graph API let us use this to get all likes of a "post" [facebook requestWithGraphPath:@"post_id/likes" andDelegate:self]; (post id type maybe status, photo, or link etc) post id ,ex: 183039808383895_363838080355846 we also can use this to get all likes of a "comment" [facebook requestWithGraphPath:@"comment_id/likes" andDelegate:self]; comment id ex: 183039808383895_363838080355846_3047357 if we use this, we can get if user likes this "comment" [facebook requestWithGraphPath:@"comment_id?fields=user_likes" andDelegate:self]; the result is { "user_likes": false, "id": "183039808383895_363838080355846_3047357", "created_time": "2012-07-11T14:01:42+0000" } but how do I get if user likes a "post" or not if I use this [facebook requestWithGraphPath:@"post_id?fields=user_likes" andDelegate:self]; but it doesn't work, I got a error.
0
5,318,951
03/15/2011 22:40:44
661,504
03/15/2011 22:40:44
1
0
Building a loop
*/ import java.text.DecimalFormat; public class Buddy { public static void main(String[] args) { //Declaring and initializing the variables double principle = 200000.0; double interestRate = 0.0575; int term = 360; DecimalFormat decimalPlaces=new DecimalFormat("0.00"); // Calculating the monthly payment: M = P [ i(1 + i)n ] / [ (1 + i)n - 1] double monthlyRate = (interestRate/12); double t = Math.pow((1 + monthlyRate),term); double payment = (principle * monthlyRate * t) / (t-1); //Display the results on computer screen System.out.println("The monthly payment for a mortgage of 200000 is $" + decimalPlaces.format(payment)); } }
java
null
null
null
null
03/15/2011 23:02:28
not a real question
Building a loop === */ import java.text.DecimalFormat; public class Buddy { public static void main(String[] args) { //Declaring and initializing the variables double principle = 200000.0; double interestRate = 0.0575; int term = 360; DecimalFormat decimalPlaces=new DecimalFormat("0.00"); // Calculating the monthly payment: M = P [ i(1 + i)n ] / [ (1 + i)n - 1] double monthlyRate = (interestRate/12); double t = Math.pow((1 + monthlyRate),term); double payment = (principle * monthlyRate * t) / (t-1); //Display the results on computer screen System.out.println("The monthly payment for a mortgage of 200000 is $" + decimalPlaces.format(payment)); } }
1
10,778,791
05/28/2012 02:36:07
1,420,850
05/28/2012 02:28:13
1
0
How to use this class in my code
I saw this natural sorting class that Ian Griffiths created ([http://www.interact-sw.co.uk/iangblog/2007/12/13/natural-sorting][1]) in C#. I wanted to use it to sort a List of objects in my own code by the name of the object (also, how would I do it by a field in an object), how would I do so? Thanks! /// <summary> /// Compares two sequences. /// </summary> /// <typeparam name="T">Type of item in the sequences.</typeparam> /// <remarks> /// Compares elements from the two input sequences in turn. If we /// run out of list before finding unequal elements, then the shorter /// list is deemed to be the lesser list. /// </remarks> public class EnumerableComparer<T> : IComparer<IEnumerable<T>> { /// <summary> /// Create a sequence comparer using the default comparer for T. /// </summary> public EnumerableComparer() { comp = Comparer<T>.Default; } /// <summary> /// Create a sequence comparer, using the specified item comparer /// for T. /// </summary> /// <param name="comparer">Comparer for comparing each pair of /// items from the sequences.</param> public EnumerableComparer(IComparer<T> comparer) { comp = comparer; } /// <summary> /// Object used for comparing each element. /// </summary> private IComparer<T> comp; /// <summary> /// Compare two sequences of T. /// </summary> /// <param name="x">First sequence.</param> /// <param name="y">Second sequence.</param> public int Compare(IEnumerable<T> x, IEnumerable<T> y) { using (IEnumerator<T> leftIt = x.GetEnumerator()) using (IEnumerator<T> rightIt = y.GetEnumerator()) { while (true) { bool left = leftIt.MoveNext(); bool right = rightIt.MoveNext(); if (!(left || right)) return 0; if (!left) return -1; if (!right) return 1; int itemResult = comp.Compare(leftIt.Current, rightIt.Current); if (itemResult != 0) return itemResult; } } } } [1]: http://www.interact-sw.co.uk/iangblog/2007/12/13/natural-sorting
list
sorting
null
null
null
05/28/2012 05:05:04
not a real question
How to use this class in my code === I saw this natural sorting class that Ian Griffiths created ([http://www.interact-sw.co.uk/iangblog/2007/12/13/natural-sorting][1]) in C#. I wanted to use it to sort a List of objects in my own code by the name of the object (also, how would I do it by a field in an object), how would I do so? Thanks! /// <summary> /// Compares two sequences. /// </summary> /// <typeparam name="T">Type of item in the sequences.</typeparam> /// <remarks> /// Compares elements from the two input sequences in turn. If we /// run out of list before finding unequal elements, then the shorter /// list is deemed to be the lesser list. /// </remarks> public class EnumerableComparer<T> : IComparer<IEnumerable<T>> { /// <summary> /// Create a sequence comparer using the default comparer for T. /// </summary> public EnumerableComparer() { comp = Comparer<T>.Default; } /// <summary> /// Create a sequence comparer, using the specified item comparer /// for T. /// </summary> /// <param name="comparer">Comparer for comparing each pair of /// items from the sequences.</param> public EnumerableComparer(IComparer<T> comparer) { comp = comparer; } /// <summary> /// Object used for comparing each element. /// </summary> private IComparer<T> comp; /// <summary> /// Compare two sequences of T. /// </summary> /// <param name="x">First sequence.</param> /// <param name="y">Second sequence.</param> public int Compare(IEnumerable<T> x, IEnumerable<T> y) { using (IEnumerator<T> leftIt = x.GetEnumerator()) using (IEnumerator<T> rightIt = y.GetEnumerator()) { while (true) { bool left = leftIt.MoveNext(); bool right = rightIt.MoveNext(); if (!(left || right)) return 0; if (!left) return -1; if (!right) return 1; int itemResult = comp.Compare(leftIt.Current, rightIt.Current); if (itemResult != 0) return itemResult; } } } } [1]: http://www.interact-sw.co.uk/iangblog/2007/12/13/natural-sorting
1
3,848,256
10/03/2010 02:04:56
239,383
12/28/2009 03:47:20
1
0
How to split up images in OpenCV based on Hough lines?
I'm new to OpenCV and image processing in general. I have photos taken with a camera of food labels for a project I'm working on. I was able to use the cvHoughLines2 function to draw red lines over the lines/bars on the photo. What I want to do now is to chop up the image into several smaller images based on the Hough lines - so that each "line" (e.g. the "calories" line, "protein" line, etc) of the food label is separated into new images. Since I have no idea how to do this, is there someone who could point me somewhere or teach me how to do this? Thanks.
image-processing
opencv
computer-vision
null
null
null
open
How to split up images in OpenCV based on Hough lines? === I'm new to OpenCV and image processing in general. I have photos taken with a camera of food labels for a project I'm working on. I was able to use the cvHoughLines2 function to draw red lines over the lines/bars on the photo. What I want to do now is to chop up the image into several smaller images based on the Hough lines - so that each "line" (e.g. the "calories" line, "protein" line, etc) of the food label is separated into new images. Since I have no idea how to do this, is there someone who could point me somewhere or teach me how to do this? Thanks.
0
8,088,965
11/11/2011 02:24:58
964,292
09/26/2011 02:36:14
1
1
Searching for programming expressions on google
Some users of this site have mistakenly closed the topic "How to google for strings that contain signs such as ()@". The Google search of programming terms is directly relevant to this site as many programmers use Google as they design or code. So I will ask the same kind of question again: How to search for something like ${10} on google? It seems google trims everything and looks for the number 10. I have tried the advanced search and I have enclosed the string in quotes.
google
null
null
null
null
11/11/2011 17:34:34
off topic
Searching for programming expressions on google === Some users of this site have mistakenly closed the topic "How to google for strings that contain signs such as ()@". The Google search of programming terms is directly relevant to this site as many programmers use Google as they design or code. So I will ask the same kind of question again: How to search for something like ${10} on google? It seems google trims everything and looks for the number 10. I have tried the advanced search and I have enclosed the string in quotes.
2
927,631
05/29/2009 19:08:20
99,989
05/02/2009 21:27:09
98
2
Is there a heap class in C++ that supports changing the priority of iterators to elements other than the head?
I have a priority queue of events, but sometimes the event priorities change, so I'd like to maintain iterators from the event requesters into the heap. If the priority changes, I'd like the heap to be adjusted in log(n) time. I will always have exactly one iterator pointing to each element in the heap.
c++
stl
boost
heap
priority-queue
null
open
Is there a heap class in C++ that supports changing the priority of iterators to elements other than the head? === I have a priority queue of events, but sometimes the event priorities change, so I'd like to maintain iterators from the event requesters into the heap. If the priority changes, I'd like the heap to be adjusted in log(n) time. I will always have exactly one iterator pointing to each element in the heap.
0
10,037,311
04/05/2012 23:14:24
466,159
10/04/2010 19:12:06
28
0
Proper and secure way to symmetrically encrypt strings in iOS 3+
I am pretty much a newbie at cryptography but I am trying to encrypt some data and save it in a file in iOS 3 because I do not want the user to just go in and edit the file. What is the proper way to securely (relatively) encrypt the data in iOS 3? Most of the documentations I found online were for iOS 5. Any help would be appreciated! Thanks, Alex
ios
string
encryption
cryptography
null
null
open
Proper and secure way to symmetrically encrypt strings in iOS 3+ === I am pretty much a newbie at cryptography but I am trying to encrypt some data and save it in a file in iOS 3 because I do not want the user to just go in and edit the file. What is the proper way to securely (relatively) encrypt the data in iOS 3? Most of the documentations I found online were for iOS 5. Any help would be appreciated! Thanks, Alex
0
10,599,964
05/15/2012 11:42:19
1,396,031
05/15/2012 11:36:41
1
0
Svn commit in PHP
I have an a script which generate some keys. This script must commit them on svn-server. They are different. Can you help me with some idea? I think about svn php lib and system / exec, but don't know how connect with svn-server and save file there.
php
svn
null
null
null
05/15/2012 18:46:32
not a real question
Svn commit in PHP === I have an a script which generate some keys. This script must commit them on svn-server. They are different. Can you help me with some idea? I think about svn php lib and system / exec, but don't know how connect with svn-server and save file there.
1
5,840,130
04/30/2011 06:51:04
216,021
11/21/2009 09:36:27
962
44
Is SpringSource Tool Suite 2.6 Grails support broken?
I have recently updated my STS from 2.5.2 to 2.6. Since then, each grails project shows an error in the **conf/spring/resources.groovy** file reading:<br><br> `Description Resource Path Location Type Internal compiler error: java.lang.VerifyError: (class: org/codehaus/jdt/groovy/internal/compiler/ast/JDTClassNode, method: initialize signature: ()V) Bad access to protected data at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.createClassNode(JDTResolver.java:461) resources.groovy /GrailsProject/grails-app/conf/spring line 0 Java Problem`<br><br> The `resources.groovy` file is as good as empty (in default state), and if I delete it, the error is shown on the `DataSource.groovy`, so the file itself seems not to be the cause.<br><br>Tthe used groovy compiler version is 1.7.3.<br><br>I have made a clean STS 2.6 install, installed the groovy and grails plugins and got the same error.<br><br>What could be the problem? And is there a solution to this not resulting in downgrading to 2.5.2 again? <br><br>Thank you
spring
plugins
grails
groovy
sts-springsourcetoolsuite
null
open
Is SpringSource Tool Suite 2.6 Grails support broken? === I have recently updated my STS from 2.5.2 to 2.6. Since then, each grails project shows an error in the **conf/spring/resources.groovy** file reading:<br><br> `Description Resource Path Location Type Internal compiler error: java.lang.VerifyError: (class: org/codehaus/jdt/groovy/internal/compiler/ast/JDTClassNode, method: initialize signature: ()V) Bad access to protected data at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.createClassNode(JDTResolver.java:461) resources.groovy /GrailsProject/grails-app/conf/spring line 0 Java Problem`<br><br> The `resources.groovy` file is as good as empty (in default state), and if I delete it, the error is shown on the `DataSource.groovy`, so the file itself seems not to be the cause.<br><br>Tthe used groovy compiler version is 1.7.3.<br><br>I have made a clean STS 2.6 install, installed the groovy and grails plugins and got the same error.<br><br>What could be the problem? And is there a solution to this not resulting in downgrading to 2.5.2 again? <br><br>Thank you
0
2,712,410
04/26/2010 09:45:30
190,702
10/15/2009 15:32:27
750
32
Which framework exceptions should every programmer know about ?
I've recently started a new project in C#, and, as I was coding some exception throw in a function, I figured out I didn't really know which exception I should use. Here are common exceptions that are often thrown in many programs : - [ArgumentException][1] - [ArgumentNullException][2] - [InvalidOperationException][3] Are there any framework exceptions you often use in your programs ? Which exceptions should every .net programmer know about ? When do you use custom exception ? [1]: http://msdn.microsoft.com/en-us/library/system.argumentexception.aspx [2]: http://msdn.microsoft.com/en-us/library/system.argumentnullexception.aspx [3]: http://msdn.microsoft.com/en-us/library/system.invalidoperationexception.aspx
.net
c#
exception
null
null
11/24/2011 04:18:46
not constructive
Which framework exceptions should every programmer know about ? === I've recently started a new project in C#, and, as I was coding some exception throw in a function, I figured out I didn't really know which exception I should use. Here are common exceptions that are often thrown in many programs : - [ArgumentException][1] - [ArgumentNullException][2] - [InvalidOperationException][3] Are there any framework exceptions you often use in your programs ? Which exceptions should every .net programmer know about ? When do you use custom exception ? [1]: http://msdn.microsoft.com/en-us/library/system.argumentexception.aspx [2]: http://msdn.microsoft.com/en-us/library/system.argumentnullexception.aspx [3]: http://msdn.microsoft.com/en-us/library/system.invalidoperationexception.aspx
4
10,299,809
04/24/2012 14:16:18
1,092,130
12/11/2011 10:51:01
8
0
database choice for advices website?
I was wondering what is the best type of database to use in a q&a style site? A site where someone asks a question and the community can comment and answer it, like Yahoo answers. What database and which engine would be the most appropriate? Personally I was thinking about MySQL and MyISAM engine, but I'm no expert. Thanks in advance! :)
mysql
database
myisam
null
null
04/25/2012 14:29:20
not constructive
database choice for advices website? === I was wondering what is the best type of database to use in a q&a style site? A site where someone asks a question and the community can comment and answer it, like Yahoo answers. What database and which engine would be the most appropriate? Personally I was thinking about MySQL and MyISAM engine, but I'm no expert. Thanks in advance! :)
4
4,364,944
12/06/2010 09:33:10
532,043
12/06/2010 09:33:10
1
0
startup setup to serve both programmer and business
I'm so glad to have found this site. I hope I can get insightful advice from you guys, the pros in this field. After months of research and speaking with some programmers, I cannot find the complete (and objective) info I am looking for. My programming skills are very basic that I don't consider it a professional skill, but more of a hobby skill. However, my work is in the marketing industry and we were thinking of an endeavor (an attempt to start our own biz, hooray!) that's web-based-- a b2b startup, but targets a very specific group and by invitational membership (definitely a niche market and for selective use). Marketing potential aside, my concern is the technical. With the little tech knowhow we have, we try to make up for with research. After months of research, we have 1. decided to use php (codeigniter), 2. not to outsource abroad no matter how attractive the cost is and hire 3 people tops to create the site, 3. local people for communication efficiency, supervise-able progress and legal protection. Do you agree with these 3 conclusions? Initially, we were thinking of agreeing to a telecommute arrangement, but I personally prefer they work on-site at our temporary office and do the programming there because my concern is: we are building a business that relies 100% on codes, to operate, shouldn't it make sense that the company and no one else (not even the programmers) have their own copy of the source codes for security purposes. Am I looking at this correctly or am I being paranoid? I know the site isn't creating any earth-shattering technological breakthroughs, but doesn't it make sense that only the company has the raw codes? If this IS the correct practice (office-based), I cannot seem to find standard office protocols for technical-leaning businesses. I have a friend who works for an IT company (not the IT dept, but sales) and what he's shared (observed from their office procedures) were: IT personnel especially cannot use mobile phone/thumb drives/etc in the office. Their work computer (where they do the programming) doesn't have input/output ports (so you can't copy works done) and no internet... so it's basically an isolated machine to do dev work. I was thinking of adopting this practice if we go for office-based, but my concern is the internet access which i think programmers need? Could you please help me with a set-up that can address both concerns can provide programmers with needed resources (ie internet) but at the same time must prevent pirating of whatever the team's working on, raw codes... please do suggest a sensible and effective set-up that won't stifle the programmers and protect us as well... If anyone could share any more advice re project or office protocols, it'll be VERY much appreciated. Thanks in advance! Sorry for the length!
php
security
protocols
startup
null
12/06/2010 12:18:14
off topic
startup setup to serve both programmer and business === I'm so glad to have found this site. I hope I can get insightful advice from you guys, the pros in this field. After months of research and speaking with some programmers, I cannot find the complete (and objective) info I am looking for. My programming skills are very basic that I don't consider it a professional skill, but more of a hobby skill. However, my work is in the marketing industry and we were thinking of an endeavor (an attempt to start our own biz, hooray!) that's web-based-- a b2b startup, but targets a very specific group and by invitational membership (definitely a niche market and for selective use). Marketing potential aside, my concern is the technical. With the little tech knowhow we have, we try to make up for with research. After months of research, we have 1. decided to use php (codeigniter), 2. not to outsource abroad no matter how attractive the cost is and hire 3 people tops to create the site, 3. local people for communication efficiency, supervise-able progress and legal protection. Do you agree with these 3 conclusions? Initially, we were thinking of agreeing to a telecommute arrangement, but I personally prefer they work on-site at our temporary office and do the programming there because my concern is: we are building a business that relies 100% on codes, to operate, shouldn't it make sense that the company and no one else (not even the programmers) have their own copy of the source codes for security purposes. Am I looking at this correctly or am I being paranoid? I know the site isn't creating any earth-shattering technological breakthroughs, but doesn't it make sense that only the company has the raw codes? If this IS the correct practice (office-based), I cannot seem to find standard office protocols for technical-leaning businesses. I have a friend who works for an IT company (not the IT dept, but sales) and what he's shared (observed from their office procedures) were: IT personnel especially cannot use mobile phone/thumb drives/etc in the office. Their work computer (where they do the programming) doesn't have input/output ports (so you can't copy works done) and no internet... so it's basically an isolated machine to do dev work. I was thinking of adopting this practice if we go for office-based, but my concern is the internet access which i think programmers need? Could you please help me with a set-up that can address both concerns can provide programmers with needed resources (ie internet) but at the same time must prevent pirating of whatever the team's working on, raw codes... please do suggest a sensible and effective set-up that won't stifle the programmers and protect us as well... If anyone could share any more advice re project or office protocols, it'll be VERY much appreciated. Thanks in advance! Sorry for the length!
2
11,172,694
06/23/2012 20:21:35
1,276,460
03/18/2012 02:50:54
499
1
Why are the boundaries of my quicksort implementation awry?
I am trying to implement quicksort in python: def partition(ls): if len(ls) == 0: return 0 pivot = ls[0] i = 0 j = 1 while j < len(ls): if ls[j] <= pivot: i += 1 temp = ls[i] ls[i] = ls[j] ls[j] = temp j += 1 ls[0] = ls[i] ls[i] = pivot return i assert(partition([1,2]) == 0) assert(partition([3,2]) == 1) assert(partition([3,2,1,4,5]) == 2) assert(partition([]) == 0) assert(partition([45]) == 0) def sort(ls): if len(ls) == 0: return pivotIndex = partition(ls) sort(ls[0:pivotIndex]) sort(ls[(pivotIndex + 1):len(ls)]) ls = [54,1,3,2,4,3,5,4] sort(ls) print ls Based on my assert statements, I know that my partition algorithm works fine. However, my sort function returns erroneous results. This snippet of code prints [4, 1, 3, 2, 4, 3, 5, 54] What should be the boundaries of the recursive calls to sort? I am aiming to partition the sublist to the left of the pivot and the sublist to the right of the pivot, both of which do not include the pivot itself.
python
algorithm
null
null
null
06/24/2012 00:40:12
too localized
Why are the boundaries of my quicksort implementation awry? === I am trying to implement quicksort in python: def partition(ls): if len(ls) == 0: return 0 pivot = ls[0] i = 0 j = 1 while j < len(ls): if ls[j] <= pivot: i += 1 temp = ls[i] ls[i] = ls[j] ls[j] = temp j += 1 ls[0] = ls[i] ls[i] = pivot return i assert(partition([1,2]) == 0) assert(partition([3,2]) == 1) assert(partition([3,2,1,4,5]) == 2) assert(partition([]) == 0) assert(partition([45]) == 0) def sort(ls): if len(ls) == 0: return pivotIndex = partition(ls) sort(ls[0:pivotIndex]) sort(ls[(pivotIndex + 1):len(ls)]) ls = [54,1,3,2,4,3,5,4] sort(ls) print ls Based on my assert statements, I know that my partition algorithm works fine. However, my sort function returns erroneous results. This snippet of code prints [4, 1, 3, 2, 4, 3, 5, 54] What should be the boundaries of the recursive calls to sort? I am aiming to partition the sublist to the left of the pivot and the sublist to the right of the pivot, both of which do not include the pivot itself.
3
7,369,020
09/10/2011 01:19:30
721,937
04/23/2011 17:20:47
767
4
is it considered stupid/old fashioned to create a form using a table?
I sometimes hear that people don't use table anymore to format their form, is this beginning to be a trend that is left behind? why and why not?
php
html
forms
null
null
09/10/2011 01:44:06
not constructive
is it considered stupid/old fashioned to create a form using a table? === I sometimes hear that people don't use table anymore to format their form, is this beginning to be a trend that is left behind? why and why not?
4
2,660,333
04/17/2010 22:37:38
216,687
11/23/2009 00:16:58
57
2
ls color schemes
What's your favorite color scheme for ls in bash? There's lots of vim color schemes out there, but I'm having trouble finding any for ls. Does anyone know any good websites with sample ls color schemes? If you've made a custom one, attach a screenshot, along with the line to put in ~/.bash_profile. export LSCOLORS=DxGxcxdxCxegedabagacad
ls
color-scheme
bash
themes
null
04/18/2010 01:15:43
off topic
ls color schemes === What's your favorite color scheme for ls in bash? There's lots of vim color schemes out there, but I'm having trouble finding any for ls. Does anyone know any good websites with sample ls color schemes? If you've made a custom one, attach a screenshot, along with the line to put in ~/.bash_profile. export LSCOLORS=DxGxcxdxCxegedabagacad
2
7,447,960
09/16/2011 16:48:57
299,216
03/22/2010 17:11:12
1,207
59
Php - organizing objects and libraries
I've been creating a small number of libraries / classes from scratch in php. I come from a codeigniter background, and I'm trying to make some libraries with similar functionality. I keep running into issues regarding objects. Is the best way to create a super object `$this` somehow? My main issue is that I've created a view object and I run a function called `load` which looks like so: class View { public function __construct() { } public function load($file = NULL, $data = array()) { if($file) { $file .= '.php'; if(file_exists($file)) { // Extract variables BEFORE including the file extract($data); include $file; return TRUE; } else { echo 'View not found'; return FALSE; } } else { return FALSE; } } } Then in my php file, I have at the top `include 'libraries.php';` which looks like: include 'database.php'; include 'view.php'; include 'input.php'; include 'form.php'; $config = array( 'host' => 'localhost', 'username' => 'username', 'password' => 'password', 'database' => 'database' ); $database = new Database($config); $view = new View(); $input = new Input(); $form = new Form(); From the file which I included the libraries, I am able to write something like `$form->value('name');` without errors. However, if I do something like this: `$view->load('folder/index', array('var_name' => 'var_value'));` then from the `folder/index.php` file I can access `$var_name` just fine, but not `$form->value('name');`. I get errors such as `Call to a member function value() on a non-object in ...` My question is how can I organize my libraries and classes in a way that will be reusable. I don't want to use a front loader (an `index.php` file that everything runs through first). This may be an issue with the way I wrote my classes, but I imagine it's a larger issue regarding where things are located etc.
php
codeigniter
object
frameworks
organization
null
open
Php - organizing objects and libraries === I've been creating a small number of libraries / classes from scratch in php. I come from a codeigniter background, and I'm trying to make some libraries with similar functionality. I keep running into issues regarding objects. Is the best way to create a super object `$this` somehow? My main issue is that I've created a view object and I run a function called `load` which looks like so: class View { public function __construct() { } public function load($file = NULL, $data = array()) { if($file) { $file .= '.php'; if(file_exists($file)) { // Extract variables BEFORE including the file extract($data); include $file; return TRUE; } else { echo 'View not found'; return FALSE; } } else { return FALSE; } } } Then in my php file, I have at the top `include 'libraries.php';` which looks like: include 'database.php'; include 'view.php'; include 'input.php'; include 'form.php'; $config = array( 'host' => 'localhost', 'username' => 'username', 'password' => 'password', 'database' => 'database' ); $database = new Database($config); $view = new View(); $input = new Input(); $form = new Form(); From the file which I included the libraries, I am able to write something like `$form->value('name');` without errors. However, if I do something like this: `$view->load('folder/index', array('var_name' => 'var_value'));` then from the `folder/index.php` file I can access `$var_name` just fine, but not `$form->value('name');`. I get errors such as `Call to a member function value() on a non-object in ...` My question is how can I organize my libraries and classes in a way that will be reusable. I don't want to use a front loader (an `index.php` file that everything runs through first). This may be an issue with the way I wrote my classes, but I imagine it's a larger issue regarding where things are located etc.
0
8,036,296
11/07/2011 12:11:06
679,671
03/28/2011 05:08:29
1,226
62
codeigniter custom 404 page not working
In codeigniter routes file there is a setting called $route['404_override'] = 'general/not_found'; So as you can see i have given a method there. The problem is this isnt working properly. From some pages the error 404 is showing the page that ive set in the method but for some pages it is showing the default codeigniter 404 page. So i assume that this is a bug in the framework itself. Have anyone of you faced this before? If so what is the best bypass method available to get all 404 pages return custom page?
php
codeigniter
routing
http-status-code-404
null
null
open
codeigniter custom 404 page not working === In codeigniter routes file there is a setting called $route['404_override'] = 'general/not_found'; So as you can see i have given a method there. The problem is this isnt working properly. From some pages the error 404 is showing the page that ive set in the method but for some pages it is showing the default codeigniter 404 page. So i assume that this is a bug in the framework itself. Have anyone of you faced this before? If so what is the best bypass method available to get all 404 pages return custom page?
0
4,871,770
02/02/2011 07:26:16
559,778
01/01/2011 13:29:40
3
0
I have problem with char in my code,please guide me (c++)
I have problem with char in my code,please guide me (c++) #include <stdio.h> #include <iostream> #include <stdlib.h> #include <conio.h> #include <math.h> using namespace std; enum Operations {SIN1, COS1, TAN1}; void selectenteroperation(char *szInput) { char *szLabels[3] = {"sin", "cos", "tan"}; int i=0; while(strcmp(szInput,szLabels[i])==0) ++i; switch (i) { case SIN1: { cout<<"SIN"; break; } case COS1: { cout<<"COS"; break; } case TAN1: { cout<<"TAN"; break; } default: { cout<<"Wrong"; break; } } } void main() { char *op; cout<<"op?"; cin>>op; if(strcmp(op,"sin")==0) selectenteroperation("sin"); if(strcmp(op,"cos")==0) selectenteroperation("cos"); if(strcmp(op,"tan")==0) selectenteroperation("tan"); getch(); }
c++
null
null
null
null
02/02/2011 17:42:53
not a real question
I have problem with char in my code,please guide me (c++) === I have problem with char in my code,please guide me (c++) #include <stdio.h> #include <iostream> #include <stdlib.h> #include <conio.h> #include <math.h> using namespace std; enum Operations {SIN1, COS1, TAN1}; void selectenteroperation(char *szInput) { char *szLabels[3] = {"sin", "cos", "tan"}; int i=0; while(strcmp(szInput,szLabels[i])==0) ++i; switch (i) { case SIN1: { cout<<"SIN"; break; } case COS1: { cout<<"COS"; break; } case TAN1: { cout<<"TAN"; break; } default: { cout<<"Wrong"; break; } } } void main() { char *op; cout<<"op?"; cin>>op; if(strcmp(op,"sin")==0) selectenteroperation("sin"); if(strcmp(op,"cos")==0) selectenteroperation("cos"); if(strcmp(op,"tan")==0) selectenteroperation("tan"); getch(); }
1
10,948,552
06/08/2012 12:07:24
1,443,853
06/08/2012 06:44:13
1
0
How to show an Image on the screen
Can anyone tell me how to display only a single image using android coding , actually I am new to android programming .
android
null
null
null
null
06/08/2012 12:21:30
not a real question
How to show an Image on the screen === Can anyone tell me how to display only a single image using android coding , actually I am new to android programming .
1
8,681,838
12/30/2011 16:51:32
576,954
01/15/2011 18:53:19
83
7
is it any good to write an internet-based automation system?
i am ordered! to design and implement an automation system for one of government's office, it is mainly a secretariat automation system, and i was thinking of implementing this system as a j2ee web application which will be hosted by apache tomcat and users need to use a browser to access the application. so i googled a bit and i found no similar product that took my strategy. so the question is, is there any down point with my way? any technical issues maybe? thank you and accept my apology for my poor English skills.
java
java-ee
automation
web
null
12/31/2011 00:47:23
not a real question
is it any good to write an internet-based automation system? === i am ordered! to design and implement an automation system for one of government's office, it is mainly a secretariat automation system, and i was thinking of implementing this system as a j2ee web application which will be hosted by apache tomcat and users need to use a browser to access the application. so i googled a bit and i found no similar product that took my strategy. so the question is, is there any down point with my way? any technical issues maybe? thank you and accept my apology for my poor English skills.
1
7,606,426
09/30/2011 05:53:14
972,473
09/30/2011 05:24:34
1
0
My Social Network's Notification System and How To Improve It
I have a couple questions, but here is the background of the questions.<br /> I created a social network for gamers (pseudo-original idea, was at the time of development starting, however) I have a notification system that works like described in the code block below (pretty bad system in my mind, but I was 12 when I designed it) My new ideas include making a table that has a preset title template and a preset message template, and having it control the type output instead of writing 3000 lines just to get the feed displayed. Thanks in advance! Here is the current (old) table structure User Info Table --------------- Table usertb: bigint autoid ... (user info goes here, in new fields) User Notification Table ----------------- Table feedtb: bigint autoid (self explanatory) int abid (person a's usertb autoid, if person a posted on person b's board) text uid (person b's usertb autoid in example ^, or a list of usertb autoids if it show=true and show1=false) tinyint show (flag to determine if the update shows up in the "feed", the equivalent of FB's news feed) tinyint show1 (flag to determine if the update shows up in the "board", the equivalent of FB's profile) int type (determines what kind of update this is, and how it is parsed by the feed/board page) ... and some misc data for linking to different tables containing posts messages/titles, etc. (but I don't think that matters)
php
javascript
mysql
ajax
null
09/30/2011 09:32:29
not a real question
My Social Network's Notification System and How To Improve It === I have a couple questions, but here is the background of the questions.<br /> I created a social network for gamers (pseudo-original idea, was at the time of development starting, however) I have a notification system that works like described in the code block below (pretty bad system in my mind, but I was 12 when I designed it) My new ideas include making a table that has a preset title template and a preset message template, and having it control the type output instead of writing 3000 lines just to get the feed displayed. Thanks in advance! Here is the current (old) table structure User Info Table --------------- Table usertb: bigint autoid ... (user info goes here, in new fields) User Notification Table ----------------- Table feedtb: bigint autoid (self explanatory) int abid (person a's usertb autoid, if person a posted on person b's board) text uid (person b's usertb autoid in example ^, or a list of usertb autoids if it show=true and show1=false) tinyint show (flag to determine if the update shows up in the "feed", the equivalent of FB's news feed) tinyint show1 (flag to determine if the update shows up in the "board", the equivalent of FB's profile) int type (determines what kind of update this is, and how it is parsed by the feed/board page) ... and some misc data for linking to different tables containing posts messages/titles, etc. (but I don't think that matters)
1
4,359,620
12/05/2010 15:54:04
396,335
07/19/2010 07:21:55
898
33
How to query this XML in LINQ?
I find it hard using attributes and nested elements in XML. How should I do this in LINQ if I want to extract only the `Phone` element with the attribute `Type="Mobile"` and print the address in one line? I want to produce an output just like this: 332-899-5678 | 123 Main, St Mercer Island, WA 68042 Please help, below is my sample xml file <Contacts> <Contact> <Name>Patrick Hines</Name> <Phone Type="Home">206-555-0144</Phone> <Phone Type="Work">425-555-0145</Phone> <Phone Type="Mobile">332-899-5678</Phone> <Address> <Street1>123 Main St</Street1> <City>Mercer Island</City> <State>WA</State> <Postal>68042</Postal> </Address> </Contact> </Contacts>
c#
xml
linq
null
null
null
open
How to query this XML in LINQ? === I find it hard using attributes and nested elements in XML. How should I do this in LINQ if I want to extract only the `Phone` element with the attribute `Type="Mobile"` and print the address in one line? I want to produce an output just like this: 332-899-5678 | 123 Main, St Mercer Island, WA 68042 Please help, below is my sample xml file <Contacts> <Contact> <Name>Patrick Hines</Name> <Phone Type="Home">206-555-0144</Phone> <Phone Type="Work">425-555-0145</Phone> <Phone Type="Mobile">332-899-5678</Phone> <Address> <Street1>123 Main St</Street1> <City>Mercer Island</City> <State>WA</State> <Postal>68042</Postal> </Address> </Contact> </Contacts>
0
10,299,451
04/24/2012 13:57:08
346,063
05/20/2010 11:57:51
11,890
924
How to find out if img-tag is left of the caret node in a html editor?
I am using a html editor to edit content. Now i need to make sure a very special kind of element does not get deleted (images with a special class). For the use cases of a non-collapsed selection/range with BACKSPACE, DELETE, CTRL + X/CMD + X i found a solution, but i am still looking for a solution to the case that the selection/range is not collapsed and the next Backspace will delete one of my special images. **How can i detect if the next Backspace/Delete will remove one of those img-tags ?** Example: CARET marks the caret/cursor position. If Backspace will be pushed next the image will get removed. How can i detect this case? <p>Some Text here <img class="my class">CARET some text</p>
javascript
jquery
html
dom
html-editor
null
open
How to find out if img-tag is left of the caret node in a html editor? === I am using a html editor to edit content. Now i need to make sure a very special kind of element does not get deleted (images with a special class). For the use cases of a non-collapsed selection/range with BACKSPACE, DELETE, CTRL + X/CMD + X i found a solution, but i am still looking for a solution to the case that the selection/range is not collapsed and the next Backspace will delete one of my special images. **How can i detect if the next Backspace/Delete will remove one of those img-tags ?** Example: CARET marks the caret/cursor position. If Backspace will be pushed next the image will get removed. How can i detect this case? <p>Some Text here <img class="my class">CARET some text</p>
0
9,467,541
02/27/2012 15:26:38
675,082
03/24/2011 14:35:21
809
10
In ASP.NET does Response.Redirect hinder the Page_Load event of the target URL?
In my ASP.NET Web Forms application I have two pages **MyPage.aspx** and **Login.aspx**. When the user is in **MyPage** and it is required to login clicks on <a href="~/Login.aspx?ref=~/MyPage.aspx">login</a> The user is brought to **Login.aspx**, enters username and password and clicks on the **login button**. The `login_onClick` event handler performs some operation and then myUrl = Request.QueryString["ref"]; Response.Redirect(myUrl); //myUrl = "~/MyPage.aspx" When the page is redirected the `Page_Load` event is not fired (or at least its event handler is not executed). Is it a typical (really odd) behavior of the `Response.Redirect`? If it is the case how can I hinder this behavior, in order to fire `Page_Load`? PS: I tried to put `Response.Cache.SetCacheability(HttpCacheability.NoCache)` before the redirection with no success
redirect
event-handling
pageload
null
null
null
open
In ASP.NET does Response.Redirect hinder the Page_Load event of the target URL? === In my ASP.NET Web Forms application I have two pages **MyPage.aspx** and **Login.aspx**. When the user is in **MyPage** and it is required to login clicks on <a href="~/Login.aspx?ref=~/MyPage.aspx">login</a> The user is brought to **Login.aspx**, enters username and password and clicks on the **login button**. The `login_onClick` event handler performs some operation and then myUrl = Request.QueryString["ref"]; Response.Redirect(myUrl); //myUrl = "~/MyPage.aspx" When the page is redirected the `Page_Load` event is not fired (or at least its event handler is not executed). Is it a typical (really odd) behavior of the `Response.Redirect`? If it is the case how can I hinder this behavior, in order to fire `Page_Load`? PS: I tried to put `Response.Cache.SetCacheability(HttpCacheability.NoCache)` before the redirection with no success
0
10,368,312
04/28/2012 23:02:38
1,010,991
10/24/2011 13:54:56
60
3
How to reduce number of requests to the Datastore
*models.py* class Document(db.Expando): title = db.StringProperty() lastEditedBy = db.ReferenceProperty(DocUser, collection_name = 'documentLastEditedBy') ... class DocUser(db.Model): user = db.UserProperty() name = db.StringProperty() hasWriteAccess= db.BooleanProperty(default = False) isAdmin = db.BooleanProperty(default = False) accessGroups = db.ListProperty(db.Key) ... *main.py* $out = '<table>' for i,d in enumerate(documents): documents = Document.all() out += '<tr><td>%s</td><td>%s</td></tr>' % (d.title, d.lastEditedBy.name) $out = '</table>' When running with 200 Documents and 1 DocUser the script takes approx 5000ms according to AppStats. The culprint is that there is a request to the datastore for each lockup of the lastEditedBy (datastore_v3.Get) taking 6-51ms each. What I'm trying do is to make something that makes possible to show many entities with several properties where some of them are derived from other entities. There will never be a large number of entities (<5000) and since this is more of an admin interface there will never be many simultaneous users. I have tried to optimize by caching the DocUser entities but I am not able to get the DocUser key from the query above without making a new request to the datastore. 1) Does this make sense - is the latency I am experiencing normal? 2) Is there a way to make this work without the additional requests to the datastore?
python
google-app-engine
gae-datastore
null
null
null
open
How to reduce number of requests to the Datastore === *models.py* class Document(db.Expando): title = db.StringProperty() lastEditedBy = db.ReferenceProperty(DocUser, collection_name = 'documentLastEditedBy') ... class DocUser(db.Model): user = db.UserProperty() name = db.StringProperty() hasWriteAccess= db.BooleanProperty(default = False) isAdmin = db.BooleanProperty(default = False) accessGroups = db.ListProperty(db.Key) ... *main.py* $out = '<table>' for i,d in enumerate(documents): documents = Document.all() out += '<tr><td>%s</td><td>%s</td></tr>' % (d.title, d.lastEditedBy.name) $out = '</table>' When running with 200 Documents and 1 DocUser the script takes approx 5000ms according to AppStats. The culprint is that there is a request to the datastore for each lockup of the lastEditedBy (datastore_v3.Get) taking 6-51ms each. What I'm trying do is to make something that makes possible to show many entities with several properties where some of them are derived from other entities. There will never be a large number of entities (<5000) and since this is more of an admin interface there will never be many simultaneous users. I have tried to optimize by caching the DocUser entities but I am not able to get the DocUser key from the query above without making a new request to the datastore. 1) Does this make sense - is the latency I am experiencing normal? 2) Is there a way to make this work without the additional requests to the datastore?
0
3,957,172
10/18/2010 07:15:13
479,046
10/18/2010 07:15:13
1
0
Creating an Online Diagramming Tool.
Recently i have thought of setting myself the task of creating a basic digramming tool that would be web based and would like some input from other programmers and developers with more experience that myself. I have stumbled upon this [Site][1] that offers an amazing piece of software and was wondering how they went about creating such a thing. For example, what languages and library's do you think were used to create a webApp like that. I have been looking at GWT for my project as i do like programming in Java, Would GWT be able to create a basic webapp for diagrams or would a RIA language like adobe flex be a better choice? Thanks for any input. [1]: http://www.creately.com
flex
gwt
diagram
interactive
diagramming
null
open
Creating an Online Diagramming Tool. === Recently i have thought of setting myself the task of creating a basic digramming tool that would be web based and would like some input from other programmers and developers with more experience that myself. I have stumbled upon this [Site][1] that offers an amazing piece of software and was wondering how they went about creating such a thing. For example, what languages and library's do you think were used to create a webApp like that. I have been looking at GWT for my project as i do like programming in Java, Would GWT be able to create a basic webapp for diagrams or would a RIA language like adobe flex be a better choice? Thanks for any input. [1]: http://www.creately.com
0
11,329,978
07/04/2012 13:22:48
1,437,316
06/05/2012 12:06:28
9
0
MATLAB, How to filter a discrete signal?
*Signal processing isn't my field of study but I need to use it. I got no idea how to filter a discrete time-domain signal?* I have a data(fecg`.mat`) that is a `<1x10000 double> matrix` representing the magnitude of a recorded FECG signal. I ploted it against time(0 to 9999): [Image][1] For removing baseline wander I can use a `high-pass filter`. How can I design a proper filter? [1]: http://i.stack.imgur.com/5f5Wn.jpg
matlab
filter
signal-processing
null
null
07/04/2012 15:27:05
off topic
MATLAB, How to filter a discrete signal? === *Signal processing isn't my field of study but I need to use it. I got no idea how to filter a discrete time-domain signal?* I have a data(fecg`.mat`) that is a `<1x10000 double> matrix` representing the magnitude of a recorded FECG signal. I ploted it against time(0 to 9999): [Image][1] For removing baseline wander I can use a `high-pass filter`. How can I design a proper filter? [1]: http://i.stack.imgur.com/5f5Wn.jpg
2
5,873,307
05/03/2011 17:28:22
313,032
04/09/2010 17:25:11
1,093
34
What is causing a negative bias in my super-sampling simulation?
I'm developing a little test program to see if it is feasible to add noise to an ADC to gain oversampled bits. A little theory, before we begin. Nyquist's sampling theorem suggests that an increase in one bit of resolution requires four additional samples, and in general, n more bits requires 2^(n+1) more samples. I'm simulating a perfect 10 bit ADC which returns a value from 0..1023 monotonically and with no noise for an input from 0-2V. To gain more bits, it is necessary to add randomly distributed noise (it doesn't have to be actually random, but it does have to *appear* random, like white noise.) The problem I'm having is although the resolution is increasing, the actual reading is offset by some small negative amount. Here's one sample output for an input of 1 volt (reference is 2 volts, so the count should be exactly half for an monotonic ADC): 10 bits: 512 volts: 1.0 11 bits: 1024 volts: 1.0 12 bits: 2046 volts: 0.9990234375 13 bits: 4093 volts: 0.999267578125 14 bits: 8189 volts: 0.999633789062 15 bits: 16375 volts: 0.999450683594 16 bits: 32753 volts: 0.999542236328 17 bits: 65509 volts: 0.999588012695 18 bits: 131013 volts: 0.999549865723 24 bits: 8384565 volts: 0.999518036842 28 bits: 134152551 volts: 0.999514393508 In fact, no matter how many times I run the simulation I'm always ending up with around ~0.9995, instead of 1; and the last value should be 134,217,728, not 134,152,551, which is about 65,771 out - or around 1/4 of the extra 18 bits of resolution (coincidence? I am diving by 4.) I suspect my PRNG is biased in some way, but I am using the default Mersenne Twister that comes with Python. #!/usr/bin/python # # Demonstrates how oversampling/supersampling with noise can be used # to improve the resolution of an ADC reading. # # Public domain. # import random, sys volts = 1.000 reference = 2.000 noise = 0.01 adc_res = 10 def get_rand_bit(): return random.choice([-1, 1]) def volts_with_noise(): if get_rand_bit() == 1: return volts + (noise * random.random() * get_rand_bit()) else: return volts def sample_adc(v): # Sample ADC with adc_res bits on given voltage. frac = v / reference frac = max(min(frac, 1.0), 0.0) # clip voltage return int(frac * (2 ** adc_res)) def adc_do_no_noise_sample(): return sample_adc(volts) def adc_do_noise_sample(extra_bits_wanted): # The number of extra samples required to gain n bits (according to # Nyquist) is 2^(n+1). So for 1 extra bit, we need to sample 4 times. samples = 2 ** (extra_bits_wanted + 1) print "Sampling ", samples, " times for ", extra_bits_wanted, " extra bits." # Sample the number of times and add the totals. total = 0 for i in range(samples): if i % 100000 == 99999: print float(i * 100) / samples sys.stdout.flush() total += sample_adc(volts_with_noise()) # Divide by two (to cancel out the +1 in 2^(n+1)) and return the integer part. return int(total / 2) def convert_integer_to_volts(val, num_bits): # Get a fraction. frac = float(val) / (2 ** num_bits) # Multiply by the reference. return frac * reference if __name__ == '__main__': # First test: we want a 10 bit sample. _10_bits = adc_do_no_noise_sample() # Next, create additional samples. _11_bits = adc_do_noise_sample(1) _12_bits = adc_do_noise_sample(2) _13_bits = adc_do_noise_sample(3) _14_bits = adc_do_noise_sample(4) _15_bits = adc_do_noise_sample(5) _16_bits = adc_do_noise_sample(6) _17_bits = adc_do_noise_sample(7) _18_bits = adc_do_noise_sample(8) _24_bits = adc_do_noise_sample(14) _28_bits = adc_do_noise_sample(18) # Print results both as integers and voltages. print "10 bits: ", _10_bits, " volts: ", convert_integer_to_volts(_10_bits, 10) print "11 bits: ", _11_bits, " volts: ", convert_integer_to_volts(_11_bits, 11) print "12 bits: ", _12_bits, " volts: ", convert_integer_to_volts(_12_bits, 12) print "13 bits: ", _13_bits, " volts: ", convert_integer_to_volts(_13_bits, 13) print "14 bits: ", _14_bits, " volts: ", convert_integer_to_volts(_14_bits, 14) print "15 bits: ", _15_bits, " volts: ", convert_integer_to_volts(_15_bits, 15) print "16 bits: ", _16_bits, " volts: ", convert_integer_to_volts(_16_bits, 16) print "17 bits: ", _17_bits, " volts: ", convert_integer_to_volts(_17_bits, 17) print "18 bits: ", _18_bits, " volts: ", convert_integer_to_volts(_18_bits, 18) print "24 bits: ", _24_bits, " volts: ", convert_integer_to_volts(_24_bits, 24) print "28 bits: ", _28_bits, " volts: ", convert_integer_to_volts(_28_bits, 28) I'd appreciate any suggestions on this. My plan is eventually to take this to a low cost microcontroller to implement a high resolution ADC. Speed will be fairly important, so I will probably be using an LFSR to generate PRNG bits, which won't be half as good as a Mersenne twister but should be good enough for most uses, and hopefully good enough for this.
python
algorithm
statistics
null
null
null
open
What is causing a negative bias in my super-sampling simulation? === I'm developing a little test program to see if it is feasible to add noise to an ADC to gain oversampled bits. A little theory, before we begin. Nyquist's sampling theorem suggests that an increase in one bit of resolution requires four additional samples, and in general, n more bits requires 2^(n+1) more samples. I'm simulating a perfect 10 bit ADC which returns a value from 0..1023 monotonically and with no noise for an input from 0-2V. To gain more bits, it is necessary to add randomly distributed noise (it doesn't have to be actually random, but it does have to *appear* random, like white noise.) The problem I'm having is although the resolution is increasing, the actual reading is offset by some small negative amount. Here's one sample output for an input of 1 volt (reference is 2 volts, so the count should be exactly half for an monotonic ADC): 10 bits: 512 volts: 1.0 11 bits: 1024 volts: 1.0 12 bits: 2046 volts: 0.9990234375 13 bits: 4093 volts: 0.999267578125 14 bits: 8189 volts: 0.999633789062 15 bits: 16375 volts: 0.999450683594 16 bits: 32753 volts: 0.999542236328 17 bits: 65509 volts: 0.999588012695 18 bits: 131013 volts: 0.999549865723 24 bits: 8384565 volts: 0.999518036842 28 bits: 134152551 volts: 0.999514393508 In fact, no matter how many times I run the simulation I'm always ending up with around ~0.9995, instead of 1; and the last value should be 134,217,728, not 134,152,551, which is about 65,771 out - or around 1/4 of the extra 18 bits of resolution (coincidence? I am diving by 4.) I suspect my PRNG is biased in some way, but I am using the default Mersenne Twister that comes with Python. #!/usr/bin/python # # Demonstrates how oversampling/supersampling with noise can be used # to improve the resolution of an ADC reading. # # Public domain. # import random, sys volts = 1.000 reference = 2.000 noise = 0.01 adc_res = 10 def get_rand_bit(): return random.choice([-1, 1]) def volts_with_noise(): if get_rand_bit() == 1: return volts + (noise * random.random() * get_rand_bit()) else: return volts def sample_adc(v): # Sample ADC with adc_res bits on given voltage. frac = v / reference frac = max(min(frac, 1.0), 0.0) # clip voltage return int(frac * (2 ** adc_res)) def adc_do_no_noise_sample(): return sample_adc(volts) def adc_do_noise_sample(extra_bits_wanted): # The number of extra samples required to gain n bits (according to # Nyquist) is 2^(n+1). So for 1 extra bit, we need to sample 4 times. samples = 2 ** (extra_bits_wanted + 1) print "Sampling ", samples, " times for ", extra_bits_wanted, " extra bits." # Sample the number of times and add the totals. total = 0 for i in range(samples): if i % 100000 == 99999: print float(i * 100) / samples sys.stdout.flush() total += sample_adc(volts_with_noise()) # Divide by two (to cancel out the +1 in 2^(n+1)) and return the integer part. return int(total / 2) def convert_integer_to_volts(val, num_bits): # Get a fraction. frac = float(val) / (2 ** num_bits) # Multiply by the reference. return frac * reference if __name__ == '__main__': # First test: we want a 10 bit sample. _10_bits = adc_do_no_noise_sample() # Next, create additional samples. _11_bits = adc_do_noise_sample(1) _12_bits = adc_do_noise_sample(2) _13_bits = adc_do_noise_sample(3) _14_bits = adc_do_noise_sample(4) _15_bits = adc_do_noise_sample(5) _16_bits = adc_do_noise_sample(6) _17_bits = adc_do_noise_sample(7) _18_bits = adc_do_noise_sample(8) _24_bits = adc_do_noise_sample(14) _28_bits = adc_do_noise_sample(18) # Print results both as integers and voltages. print "10 bits: ", _10_bits, " volts: ", convert_integer_to_volts(_10_bits, 10) print "11 bits: ", _11_bits, " volts: ", convert_integer_to_volts(_11_bits, 11) print "12 bits: ", _12_bits, " volts: ", convert_integer_to_volts(_12_bits, 12) print "13 bits: ", _13_bits, " volts: ", convert_integer_to_volts(_13_bits, 13) print "14 bits: ", _14_bits, " volts: ", convert_integer_to_volts(_14_bits, 14) print "15 bits: ", _15_bits, " volts: ", convert_integer_to_volts(_15_bits, 15) print "16 bits: ", _16_bits, " volts: ", convert_integer_to_volts(_16_bits, 16) print "17 bits: ", _17_bits, " volts: ", convert_integer_to_volts(_17_bits, 17) print "18 bits: ", _18_bits, " volts: ", convert_integer_to_volts(_18_bits, 18) print "24 bits: ", _24_bits, " volts: ", convert_integer_to_volts(_24_bits, 24) print "28 bits: ", _28_bits, " volts: ", convert_integer_to_volts(_28_bits, 28) I'd appreciate any suggestions on this. My plan is eventually to take this to a low cost microcontroller to implement a high resolution ADC. Speed will be fairly important, so I will probably be using an LFSR to generate PRNG bits, which won't be half as good as a Mersenne twister but should be good enough for most uses, and hopefully good enough for this.
0
1,111,376
07/10/2009 19:00:37
13,136
09/16/2008 17:17:38
1,156
109
How-to do unit-testing methods involving file input output?
I'm using C++Test from Parasoft for unit testing C++ code. I came across the following problem. I have a function similar to the next one (pseudocode): bool LoadFileToMem(const std::string& rStrFileName) { if( openfile(rStrFileName) == successfull ) { if( get_file_size() == successfull ) { if( read_entire_file_to_buffer() == successfull ) { return true; } return false; } return false; } return false; } My questions in this case are: Should I use stubs for file system functions? Or should I include specific sample test files for running the unit tests? In my case [std::fstream][1] class is used for file input. Has anyone better suggestions? (Best if done in C++Test but not mandatory) Thank you, Iulian [1]: http://www.cplusplus.com/reference/iostream/fstream/
unit-testing
stub
file
c++
null
null
open
How-to do unit-testing methods involving file input output? === I'm using C++Test from Parasoft for unit testing C++ code. I came across the following problem. I have a function similar to the next one (pseudocode): bool LoadFileToMem(const std::string& rStrFileName) { if( openfile(rStrFileName) == successfull ) { if( get_file_size() == successfull ) { if( read_entire_file_to_buffer() == successfull ) { return true; } return false; } return false; } return false; } My questions in this case are: Should I use stubs for file system functions? Or should I include specific sample test files for running the unit tests? In my case [std::fstream][1] class is used for file input. Has anyone better suggestions? (Best if done in C++Test but not mandatory) Thank you, Iulian [1]: http://www.cplusplus.com/reference/iostream/fstream/
0
7,216,081
08/27/2011 17:14:00
909,784
08/24/2011 14:04:51
1
0
MVC3 HOW TO PASS IN .load function of jquery the parameter include in url
How to pass in .load function of jquery, the parameter include in url. url recived in create.cshtml => http://.../Invoiced/Create/1 InvoicedDetail is a partialView , this contain list of details by id, this id is the parameter in ulr http://.../Invoiced/Create/1, how to cathc this parameter "1" to send in .load function ? thanks. Create.cshtml <p>Details list</p> <div id="InvoicedDetails_content"><div> <script language="javascript" type="text/javascript"> $(document).ready(function () { // parameter = ?; $('#InvoicedDetails_content').load('/InvoicedDetail/Index/' + parameter); }); </script>
jquery
asp.net-mvc-3
null
null
null
null
open
MVC3 HOW TO PASS IN .load function of jquery the parameter include in url === How to pass in .load function of jquery, the parameter include in url. url recived in create.cshtml => http://.../Invoiced/Create/1 InvoicedDetail is a partialView , this contain list of details by id, this id is the parameter in ulr http://.../Invoiced/Create/1, how to cathc this parameter "1" to send in .load function ? thanks. Create.cshtml <p>Details list</p> <div id="InvoicedDetails_content"><div> <script language="javascript" type="text/javascript"> $(document).ready(function () { // parameter = ?; $('#InvoicedDetails_content').load('/InvoicedDetail/Index/' + parameter); }); </script>
0
5,032,752
02/17/2011 18:04:31
621,877
02/17/2011 18:04:31
1
0
video capturing in java
tech 2nd year student i want to capture vider from usb/webcam in java .should anyone gide me
java
null
null
null
null
02/17/2011 18:09:47
not a real question
video capturing in java === tech 2nd year student i want to capture vider from usb/webcam in java .should anyone gide me
1
11,061,366
06/16/2012 06:28:23
1,125,571
01/02/2012 01:14:21
139
0
Using report service with asp.net mvc 2.0
I am a pretty new developer with .net, and now I am wonder how can I print report in asp.net mvc of my project. I want to print report with the data that I queried from my database. Any sharing idea about it please. Thanks.
asp.net-mvc
reporting-services
null
null
null
06/17/2012 16:05:03
not a real question
Using report service with asp.net mvc 2.0 === I am a pretty new developer with .net, and now I am wonder how can I print report in asp.net mvc of my project. I want to print report with the data that I queried from my database. Any sharing idea about it please. Thanks.
1
9,590,076
03/06/2012 18:58:11
1,253,009
03/06/2012 18:51:39
1
0
jTDS Connect URL
I am using jTDS to connect SQL Server 2005 Express. My connect url is jdbc:jtds:sqlserver://127.0.0.1:1433/dbstore;user=myusername,password=mypassword It's not connecting with a "SQL server refusing connection" problem.
jtds
null
null
null
null
03/07/2012 14:15:20
not a real question
jTDS Connect URL === I am using jTDS to connect SQL Server 2005 Express. My connect url is jdbc:jtds:sqlserver://127.0.0.1:1433/dbstore;user=myusername,password=mypassword It's not connecting with a "SQL server refusing connection" problem.
1
1,255,998
08/10/2009 16:57:12
15,053
09/17/2008 05:30:10
189
12
How can I leverage JPA when code is generated?
I have classes for entities like Customer, InternalCustomer, ExternalCustomer (with the appropriate inheritance) generated from an xml schema. I would like to use JPA (suggest specific implementation in your answer if relevant) to persist objects from these classes but I can't annotate them since they are generated and when I change the schema and regenerate, the annotations will be wiped. Can this be done without using annotations or even a persistence.xml file? Also is there a tool in which I can provide the classes (or schema) as input and have it give me the SQL statements to create the DB (or even create it for me?). It would seem like that since I have a schema all the information it needs about creating the DB should be in there. I am not talking about creating indexes, or any tuning of the db but just creating the right tables etc. thanks in advance
jpa
xsd
persistence
null
null
null
open
How can I leverage JPA when code is generated? === I have classes for entities like Customer, InternalCustomer, ExternalCustomer (with the appropriate inheritance) generated from an xml schema. I would like to use JPA (suggest specific implementation in your answer if relevant) to persist objects from these classes but I can't annotate them since they are generated and when I change the schema and regenerate, the annotations will be wiped. Can this be done without using annotations or even a persistence.xml file? Also is there a tool in which I can provide the classes (or schema) as input and have it give me the SQL statements to create the DB (or even create it for me?). It would seem like that since I have a schema all the information it needs about creating the DB should be in there. I am not talking about creating indexes, or any tuning of the db but just creating the right tables etc. thanks in advance
0
2,717,910
04/27/2010 00:19:13
83,889
03/28/2009 01:28:09
5,097
314
In ASP.NET MVC, how do I display a property name as a label splitting on CamelCase
I know that I have seen this before. I can't remember if it was a C4MVC template demo or an input builder thing! I need to know how I can use the convention of CamelCasing my view model properties and having the "CamelCasedProperty" rendered in the label as "Camel Cased Property". This should be handled by the create new view wizard rather than programatically handling this.
asp.net-mvc-2
null
null
null
null
null
open
In ASP.NET MVC, how do I display a property name as a label splitting on CamelCase === I know that I have seen this before. I can't remember if it was a C4MVC template demo or an input builder thing! I need to know how I can use the convention of CamelCasing my view model properties and having the "CamelCasedProperty" rendered in the label as "Camel Cased Property". This should be handled by the create new view wizard rather than programatically handling this.
0
7,279,216
09/02/2011 04:23:15
921,193
08/31/2011 08:27:10
6
0
Best free auto updater c#
what is best free auto update tool for .net desktop applications currently(for this date)? I use ".NET Application Updater Component", but it's made in 2002. ---NOT ClickOnce (it has many limitations )
c#
.net
update
null
null
09/02/2011 05:49:05
not constructive
Best free auto updater c# === what is best free auto update tool for .net desktop applications currently(for this date)? I use ".NET Application Updater Component", but it's made in 2002. ---NOT ClickOnce (it has many limitations )
4
5,214,474
03/07/2011 00:11:07
381,443
07/01/2010 19:10:51
74
3
Simulate User Input in 3rd Party Application
Not sure where to start with this one ... I'm thinking about creating a small little application to automate some repetitive text entry. I would like to be able to define snippets of text, and inject them into other applications when I want. What would be the best way to approach this problem? I have stumbled across UI Automation, as well as SendKeys. Any suggestions? I don't mind if I have to "point out" the input controls for the application (like how Mac's native screenshot tool asks you to click on the window you want to capture). For instance, I could select the snippet of text in this application, then click on my other application's text input box, and that would somehow let the first application get a handle for the input's control to then simulate input. Also, would there be any way to programmatically "submit" that form of controls once filled in? I come from a web design background, so a lot of this native application development is new to me. Sorry if this is a vague question, I'm just not sure where to even start with this ...
c#
windows
interop
input
user-input
null
open
Simulate User Input in 3rd Party Application === Not sure where to start with this one ... I'm thinking about creating a small little application to automate some repetitive text entry. I would like to be able to define snippets of text, and inject them into other applications when I want. What would be the best way to approach this problem? I have stumbled across UI Automation, as well as SendKeys. Any suggestions? I don't mind if I have to "point out" the input controls for the application (like how Mac's native screenshot tool asks you to click on the window you want to capture). For instance, I could select the snippet of text in this application, then click on my other application's text input box, and that would somehow let the first application get a handle for the input's control to then simulate input. Also, would there be any way to programmatically "submit" that form of controls once filled in? I come from a web design background, so a lot of this native application development is new to me. Sorry if this is a vague question, I'm just not sure where to even start with this ...
0
11,732,909
07/31/2012 04:02:08
1,229,834
02/24/2012 03:06:27
15
0
Http xmpp multithread process
I am using a python library called sleekxmpp to imeplement xmpp protocol.<br/> Actually, the whole process is, a client send a http request to me, then I need to send xmpp messages to other clients through my sleekxmpp library.<br/> I need to gather those http request in queue and my sleekxmpp need to longlive listening to the queue and send xmpp message out.<br/> Is there any library in python can help me do that?<br/>
python
multithreading
http
xmpp
null
null
open
Http xmpp multithread process === I am using a python library called sleekxmpp to imeplement xmpp protocol.<br/> Actually, the whole process is, a client send a http request to me, then I need to send xmpp messages to other clients through my sleekxmpp library.<br/> I need to gather those http request in queue and my sleekxmpp need to longlive listening to the queue and send xmpp message out.<br/> Is there any library in python can help me do that?<br/>
0
3,159,908
07/01/2010 16:52:49
312,675
04/09/2010 10:07:04
784
2
How to determine if we are in the first week of the current month
I am writing a little utility function in Python which returns a boolean, indicating whether today is the first week of the month. This is what I have so far: import calendar import time y, m = time.localtime(time.time())[:2] data = calendar.month(y, m) In [24]: type(temp) Out[24]: <type 'str'> In [25]: print temp -------> print(temp) July 2010 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 I want to pack this string into a list of lists, Actually, its only the first row that I want, since it is the first week, but I could generalize the function so that it allows me to check whether we are in the nth week, where 1 < 5 (depending on the month of course) Once I have a list of lists I then intend to check if the current day is an element in the list. Can anyone show how I can get the output from the calender.month() method into a list of lists? Last but not the least, I may be reinventing the wheel here. If there is an inbuilt way of doing this (or amybe a more Pythonic way of doing this, someone please let me know.
python
null
null
null
null
null
open
How to determine if we are in the first week of the current month === I am writing a little utility function in Python which returns a boolean, indicating whether today is the first week of the month. This is what I have so far: import calendar import time y, m = time.localtime(time.time())[:2] data = calendar.month(y, m) In [24]: type(temp) Out[24]: <type 'str'> In [25]: print temp -------> print(temp) July 2010 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 I want to pack this string into a list of lists, Actually, its only the first row that I want, since it is the first week, but I could generalize the function so that it allows me to check whether we are in the nth week, where 1 < 5 (depending on the month of course) Once I have a list of lists I then intend to check if the current day is an element in the list. Can anyone show how I can get the output from the calender.month() method into a list of lists? Last but not the least, I may be reinventing the wheel here. If there is an inbuilt way of doing this (or amybe a more Pythonic way of doing this, someone please let me know.
0
7,575,821
09/27/2011 21:21:18
434,493
08/29/2010 23:58:11
71
0
Postgres 9.1 Replication vs MySQL replication
Since Postgres now has built-in replication, how does it compare to MySQL? What are the PRO/CONs of Postgres vs MySQL related strictly to replication?
mysql
database
postgresql
replication
null
09/28/2011 01:39:12
off topic
Postgres 9.1 Replication vs MySQL replication === Since Postgres now has built-in replication, how does it compare to MySQL? What are the PRO/CONs of Postgres vs MySQL related strictly to replication?
2
6,786,052
07/22/2011 05:34:01
855,281
07/21/2011 06:02:55
1
0
how can i select 1,4,7,10,13,... numbered records from table
ID NAME AGE DEPTNO SALARY ------- -------------------- ---------- ---------- ---------- 1 shasank 25 11 2025 2 raju 27 12 2027 3 son 33 12 2131 6 bali 31 10 2031 4 don 33 11 2132 5 rambo 32 11 2121 7 dimpu 33 12 2314 8 chir 34 10 2123 9 nag 35 10 2213 10 ram 28 13 2141
sql
null
null
null
null
07/22/2011 13:05:20
not a real question
how can i select 1,4,7,10,13,... numbered records from table === ID NAME AGE DEPTNO SALARY ------- -------------------- ---------- ---------- ---------- 1 shasank 25 11 2025 2 raju 27 12 2027 3 son 33 12 2131 6 bali 31 10 2031 4 don 33 11 2132 5 rambo 32 11 2121 7 dimpu 33 12 2314 8 chir 34 10 2123 9 nag 35 10 2213 10 ram 28 13 2141
1