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,235,950
06/04/2011 09:35:37
707,751
04/14/2011 10:26:01
11
10
sign up in android market
I am Md Maidul Islam.I want to sign up a account of android market.I want to store my own project in android market.Can anyone help me what is the actual process.anyone can have better idea.please help me. Thanks and Regards, Md Maidul Islam
android
null
null
null
null
03/30/2012 17:51:34
off topic
sign up in android market === I am Md Maidul Islam.I want to sign up a account of android market.I want to store my own project in android market.Can anyone help me what is the actual process.anyone can have better idea.please help me. Thanks and Regards, Md Maidul Islam
2
11,479,452
07/13/2012 23:06:05
288,928
03/08/2010 15:47:56
16
0
Create a list of lists in LaTeX?
I'm creating a problem bank and each problem is named using a list (e.g., \item Parametric particle trajectory). I'd like to auto-generate a list of problem names from this list and I;d like that list to appear at the beginning of the document. Is there anyway to get LaTeX to do this? I could create a new environment if that's necessary; I'm just not sure how to proceed.
latex
null
null
null
null
07/14/2012 21:06:40
off topic
Create a list of lists in LaTeX? === I'm creating a problem bank and each problem is named using a list (e.g., \item Parametric particle trajectory). I'd like to auto-generate a list of problem names from this list and I;d like that list to appear at the beginning of the document. Is there anyway to get LaTeX to do this? I could create a new environment if that's necessary; I'm just not sure how to proceed.
2
9,746,589
03/17/2012 01:56:57
973,939
09/30/2011 22:30:31
358
4
out of memory errors in Users Import through feed in grails
We have a grails application and we are importing users through CSV feed. User Domain object has huge list of fields (85 total). And we are writing the Import functionality using Hibernate api ... to insert into User table. Right now we are getting out of memory errors if we load like 2000 users since User domain object in memory. Is there any way to optimize the design to remove the out of memory errors. like not loading all columns of User domain on load each column when required. how to reduce the memory consumption?
grails
outofmemoryerror
null
null
null
null
open
out of memory errors in Users Import through feed in grails === We have a grails application and we are importing users through CSV feed. User Domain object has huge list of fields (85 total). And we are writing the Import functionality using Hibernate api ... to insert into User table. Right now we are getting out of memory errors if we load like 2000 users since User domain object in memory. Is there any way to optimize the design to remove the out of memory errors. like not loading all columns of User domain on load each column when required. how to reduce the memory consumption?
0
5,718,008
04/19/2011 14:29:21
466,095
06/11/2010 13:09:37
6
0
what's the best plugins for SOLR integrity?
what's the best plugins for SOLR integrity? acts_as_solr is over-dated. any other ones ? thanks
plugins
solr
null
null
null
06/06/2012 12:28:54
not constructive
what's the best plugins for SOLR integrity? === what's the best plugins for SOLR integrity? acts_as_solr is over-dated. any other ones ? thanks
4
6,096,017
05/23/2011 10:32:34
765,837
05/23/2011 10:32:34
1
0
Zend_Http_Client is removing newlines
I'm trying to fetch a CSV file from a remote server and download it Using Zend_Http_Client The fetched version has all of the newlines removed. <pre> require_once('Zend/Http/Client.php'); $client = new Zend_Http_Client($url); $client->setCookieJar(); $client->setAuth('user', 'pass', Zend_Http_Client :: AUTH_BASIC); if(!empty($params)){ $client->setParameterGet($params); } $client->request(); $request = $client->getLastRequest(); $response = $client->getLastResponse(); echo $response->getRawBody(); </pre> The response is all one line. If I fetch the `$url` with curl it is on separate lines.
php
zend-framework
httpwebrequest
zend-http-client
null
null
open
Zend_Http_Client is removing newlines === I'm trying to fetch a CSV file from a remote server and download it Using Zend_Http_Client The fetched version has all of the newlines removed. <pre> require_once('Zend/Http/Client.php'); $client = new Zend_Http_Client($url); $client->setCookieJar(); $client->setAuth('user', 'pass', Zend_Http_Client :: AUTH_BASIC); if(!empty($params)){ $client->setParameterGet($params); } $client->request(); $request = $client->getLastRequest(); $response = $client->getLastResponse(); echo $response->getRawBody(); </pre> The response is all one line. If I fetch the `$url` with curl it is on separate lines.
0
8,210,821
11/21/2011 11:10:31
587,021
01/24/2011 04:57:23
68
25
Which Cross-mobile-platform Application and UI Framework?
I am building a website in either Rails or DJango, and I also want to write a mobile app for Android and iOS operating systems. (and others, maybe) What are my options? - i.e. is Qt any good? Happy to develop the mobile app in C, C++, Python or Ruby. Thanks for all suggestions
android
ios
qt
frameworks
mobile-application
11/22/2011 11:28:20
not constructive
Which Cross-mobile-platform Application and UI Framework? === I am building a website in either Rails or DJango, and I also want to write a mobile app for Android and iOS operating systems. (and others, maybe) What are my options? - i.e. is Qt any good? Happy to develop the mobile app in C, C++, Python or Ruby. Thanks for all suggestions
4
559,756
02/18/2009 03:43:32
49,611
09/17/2008 14:32:10
259
15
Interface Builder vs. What's Displayed on iPhone
Hello and Thanks for giving this question a gander. It seems that PNG files that I drag/drop into IB do not display in the same manner that they are show in the iPhone simulator. What gives? For example, if I want to drop in a PNG with rounded corners, IB shows hard rectangular corners but when I build to the simulator, I see the rounded edges. I don't understand the purpose of IB for UI if I can't accurately reflect what will be shown for that view.
iphone
interface-builder
cocoa
cocoa-touch
null
null
open
Interface Builder vs. What's Displayed on iPhone === Hello and Thanks for giving this question a gander. It seems that PNG files that I drag/drop into IB do not display in the same manner that they are show in the iPhone simulator. What gives? For example, if I want to drop in a PNG with rounded corners, IB shows hard rectangular corners but when I build to the simulator, I see the rounded edges. I don't understand the purpose of IB for UI if I can't accurately reflect what will be shown for that view.
0
556,445
02/17/2009 11:46:46
28,380
10/15/2008 20:42:02
4,878
247
How can I persuade my designer to give good bug reports?
So we have a small team for a certain project. Developer (Python), designer (html/css/jinja2), content manager. Now, often the designer (html/css/jinja2) (who is quite technically adept in a Windows way) will pick up bugs and report them: > "Ali, I have a problem with text." Should say "Ali, I am having an exception rendering unicode characters" Or another example: > "Ali, I have the error page." Should say what the exception is, when it's happening, etc. Is there any way I can teach him? Note that he is technically adept, a good designer, and does understand the concepts. He just refuses as a first line to express the useful information without painful cross-examination. I am wasting about 7 minutes per report.
bug-reporting
teamwork
teaching
subjective
null
05/08/2012 17:48:25
off topic
How can I persuade my designer to give good bug reports? === So we have a small team for a certain project. Developer (Python), designer (html/css/jinja2), content manager. Now, often the designer (html/css/jinja2) (who is quite technically adept in a Windows way) will pick up bugs and report them: > "Ali, I have a problem with text." Should say "Ali, I am having an exception rendering unicode characters" Or another example: > "Ali, I have the error page." Should say what the exception is, when it's happening, etc. Is there any way I can teach him? Note that he is technically adept, a good designer, and does understand the concepts. He just refuses as a first line to express the useful information without painful cross-examination. I am wasting about 7 minutes per report.
2
9,078,833
01/31/2012 11:34:56
1,180,196
01/31/2012 11:29:54
1
0
Trouble with android db
I'm making a todo list app and now i'm stuck with this problem and I dont know how to fix it. Can anybody help me. This is what i'm getting from LogCat: 01-30 12:12:59.044: W/dalvikvm(30917): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 01-30 12:12:59.114: E/AndroidRuntime(30917): FATAL EXCEPTION: main 01-30 12:12:59.114: E/AndroidRuntime(30917): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.todo/com.todo.Todo}: java.lang.ArrayIndexOutOfBoundsException 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.os.Handler.dispatchMessage(Handler.java:99) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.os.Looper.loop(Looper.java:123) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.main(ActivityThread.java:4627) 01-30 12:12:59.114: E/AndroidRuntime(30917): at java.lang.reflect.Method.invokeNative(Native Method) 01-30 12:12:59.114: E/AndroidRuntime(30917): at java.lang.reflect.Method.invoke(Method.java:521) 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 01-30 12:12:59.114: E/AndroidRuntime(30917): at dalvik.system.NativeStart.main(Native Method) 01-30 12:12:59.114: E/AndroidRuntime(30917): Caused by: java.lang.ArrayIndexOutOfBoundsException 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.todo.DatabaseHelper.GetAllItems(DatabaseHelper.java:140) 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.todo.Todo.setupViews(Todo.java:61) 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.todo.Todo.onCreate(Todo.java:25) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 01-30 12:12:59.114: E/AndroidRuntime(30917): ... 11 more 01-30 12:17:59.188: I/Process(30917): Sending signal. PID: 30917 SIG: 9 and i suppose the problem is here: private Button add,delete,search,exit; private Intent intent; private ListView listView; DatabaseHelper db; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db=new DatabaseHelper(this); db.open(); setupViews(); db.close(); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.main_add_btn: //open activity to add item intent=new Intent(this, InsertItem.class); startActivity(intent); break; case R.id.main_delete_btn: //delete item break; case R.id.main_exit_btn: finish(); break; } } private void setupViews(){ add=(Button) findViewById(R.id.main_add_btn); delete=(Button) findViewById(R.id.main_delete_btn); search=(Button) findViewById(R.id.main_search_btn); exit=(Button) findViewById(R.id.main_exit_btn); add.setOnClickListener(this); delete.setOnClickListener(this); search.setOnClickListener(this); exit.setOnClickListener(this); listView=getListView(); // int l=(int) intent.getLongExtra("userID", -1); Log.v("test","tuja"); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, db.GetAllItems(1)); Log.v("test","tuja2"); setListAdapter(adapter); } } This is my first post so sorry if I messed up something
android
database
listview
null
null
null
open
Trouble with android db === I'm making a todo list app and now i'm stuck with this problem and I dont know how to fix it. Can anybody help me. This is what i'm getting from LogCat: 01-30 12:12:59.044: W/dalvikvm(30917): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 01-30 12:12:59.114: E/AndroidRuntime(30917): FATAL EXCEPTION: main 01-30 12:12:59.114: E/AndroidRuntime(30917): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.todo/com.todo.Todo}: java.lang.ArrayIndexOutOfBoundsException 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.os.Handler.dispatchMessage(Handler.java:99) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.os.Looper.loop(Looper.java:123) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.main(ActivityThread.java:4627) 01-30 12:12:59.114: E/AndroidRuntime(30917): at java.lang.reflect.Method.invokeNative(Native Method) 01-30 12:12:59.114: E/AndroidRuntime(30917): at java.lang.reflect.Method.invoke(Method.java:521) 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 01-30 12:12:59.114: E/AndroidRuntime(30917): at dalvik.system.NativeStart.main(Native Method) 01-30 12:12:59.114: E/AndroidRuntime(30917): Caused by: java.lang.ArrayIndexOutOfBoundsException 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.todo.DatabaseHelper.GetAllItems(DatabaseHelper.java:140) 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.todo.Todo.setupViews(Todo.java:61) 01-30 12:12:59.114: E/AndroidRuntime(30917): at com.todo.Todo.onCreate(Todo.java:25) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 01-30 12:12:59.114: E/AndroidRuntime(30917): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 01-30 12:12:59.114: E/AndroidRuntime(30917): ... 11 more 01-30 12:17:59.188: I/Process(30917): Sending signal. PID: 30917 SIG: 9 and i suppose the problem is here: private Button add,delete,search,exit; private Intent intent; private ListView listView; DatabaseHelper db; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db=new DatabaseHelper(this); db.open(); setupViews(); db.close(); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.main_add_btn: //open activity to add item intent=new Intent(this, InsertItem.class); startActivity(intent); break; case R.id.main_delete_btn: //delete item break; case R.id.main_exit_btn: finish(); break; } } private void setupViews(){ add=(Button) findViewById(R.id.main_add_btn); delete=(Button) findViewById(R.id.main_delete_btn); search=(Button) findViewById(R.id.main_search_btn); exit=(Button) findViewById(R.id.main_exit_btn); add.setOnClickListener(this); delete.setOnClickListener(this); search.setOnClickListener(this); exit.setOnClickListener(this); listView=getListView(); // int l=(int) intent.getLongExtra("userID", -1); Log.v("test","tuja"); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, db.GetAllItems(1)); Log.v("test","tuja2"); setListAdapter(adapter); } } This is my first post so sorry if I messed up something
0
9,513,970
03/01/2012 09:52:38
496,045
11/03/2010 14:41:11
13
0
what does the following shell script do
i came across following shell script as part of makefile in u-boot. what it does and how is it evaluated cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) it is called as PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,\ $(call cc-option,-malignment-traps,))
shell
makefile
null
null
null
03/02/2012 14:01:42
too localized
what does the following shell script do === i came across following shell script as part of makefile in u-boot. what it does and how is it evaluated cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) it is called as PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,\ $(call cc-option,-malignment-traps,))
3
8,949,894
01/21/2012 01:12:18
614,008
02/12/2011 06:40:42
573
23
Is there a good free c++ raytracer tutorial?
I've tried googling but the results I get don't explain it properly, or have completely broken code snippets.
c++
null
null
null
null
01/21/2012 02:03:42
not constructive
Is there a good free c++ raytracer tutorial? === I've tried googling but the results I get don't explain it properly, or have completely broken code snippets.
4
8,373,007
12/04/2011 03:20:26
1,079,679
12/04/2011 03:16:41
1
0
Issue installing Ruby rvm (error while running configure)
ruby-1.9.3-p0 - #configuring *ERROR: Error running ' ./configure --prefix=/Users/davedelich/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/davedelich/.rvm/usr ', please read /Users/davedelich/.rvm/log/ruby-1.9.3-p0/configure.log ERROR: There has been an error while running configure. Halting the installation.* SupremeOverlord:~ davedelich$ cat /Users/davedelich/.rvm/log/ruby-1.9.3-p0/configure.log [2011-12-03 22:09:03] ./configure --prefix=/Users/davedelich/.rvm/rubies/ruby-1.9.3-p0 -- enable-shared --disable-install-doc --with-libyaml-dir=/Users/davedelich/.rvm/usr configure: WARNING: unrecognized options: --with-libyaml-dir checking build system type... x86_64-apple-darwin11.2.0 checking host system type... x86_64-apple-darwin11.2.0 checking target system type... x86_64-apple-darwin11.2.0 checking whether the C compiler works... no configure: error: in `/Users/davedelich/.rvm/src/ruby-1.9.3-p0': configure: error: C compiler cannot create executables See `config.log' for more details
ruby
rvm
null
null
null
12/05/2011 04:11:56
off topic
Issue installing Ruby rvm (error while running configure) === ruby-1.9.3-p0 - #configuring *ERROR: Error running ' ./configure --prefix=/Users/davedelich/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/davedelich/.rvm/usr ', please read /Users/davedelich/.rvm/log/ruby-1.9.3-p0/configure.log ERROR: There has been an error while running configure. Halting the installation.* SupremeOverlord:~ davedelich$ cat /Users/davedelich/.rvm/log/ruby-1.9.3-p0/configure.log [2011-12-03 22:09:03] ./configure --prefix=/Users/davedelich/.rvm/rubies/ruby-1.9.3-p0 -- enable-shared --disable-install-doc --with-libyaml-dir=/Users/davedelich/.rvm/usr configure: WARNING: unrecognized options: --with-libyaml-dir checking build system type... x86_64-apple-darwin11.2.0 checking host system type... x86_64-apple-darwin11.2.0 checking target system type... x86_64-apple-darwin11.2.0 checking whether the C compiler works... no configure: error: in `/Users/davedelich/.rvm/src/ruby-1.9.3-p0': configure: error: C compiler cannot create executables See `config.log' for more details
2
7,085,054
08/16/2011 21:09:16
810,606
06/22/2011 14:59:21
44
0
Cannot properly read the value of a cell
I am trying to read the value of cell A1 as such: Dim myCell As Long myCell = Range("A1").Value The above returns myCell as 0 and
excel
vba
excel-vba
null
null
08/17/2011 00:13:46
not a real question
Cannot properly read the value of a cell === I am trying to read the value of cell A1 as such: Dim myCell As Long myCell = Range("A1").Value The above returns myCell as 0 and
1
896,153
05/22/2009 02:29:31
98,975
04/30/2009 21:33:14
1
0
How to show hidden autofield in django formset
A Django autofield when displayed using a formset is hidden by default. What would be the best way to show it? At the moment, the model is declared as, class MyModel: locid = models.AutoField(primary_key=True) ... When this is rendered using Django formsets, class MyModelForm(ModelForm): class Meta: model = MyModel fields = ('locid', 'name') it shows up on the page as, <input id="id_form-0-locid" type="hidden" value="707" name="form-0-locid"/> Thanks.
python
django
formset
null
null
null
open
How to show hidden autofield in django formset === A Django autofield when displayed using a formset is hidden by default. What would be the best way to show it? At the moment, the model is declared as, class MyModel: locid = models.AutoField(primary_key=True) ... When this is rendered using Django formsets, class MyModelForm(ModelForm): class Meta: model = MyModel fields = ('locid', 'name') it shows up on the page as, <input id="id_form-0-locid" type="hidden" value="707" name="form-0-locid"/> Thanks.
0
8,817,879
01/11/2012 10:39:37
385,559
07/07/2010 13:18:18
1,271
57
Xcode 4 rich text not working.
I have Xcode 4.2. At some point the rich text just stopped working. The only elements that it is selecting are strings, comments and number values. The rest is just written in white (I'm using the Midnight option). I've tried restarting my machine, Xcode and changing my preferences (to Low Key and then back to Midnight). This only is happening on one project and not the others. Any ideas on how to correct this? It is surprising how this makes coding a bit more strenuous on the eyes.
xcode
xcode4.2
rich-text
null
null
null
open
Xcode 4 rich text not working. === I have Xcode 4.2. At some point the rich text just stopped working. The only elements that it is selecting are strings, comments and number values. The rest is just written in white (I'm using the Midnight option). I've tried restarting my machine, Xcode and changing my preferences (to Low Key and then back to Midnight). This only is happening on one project and not the others. Any ideas on how to correct this? It is surprising how this makes coding a bit more strenuous on the eyes.
0
8,341,008
12/01/2011 11:59:22
887,563
08/10/2011 09:14:19
3
0
How can i select the ul li under this if i find a add class to first li which is having achor
Plesae help me out selector how to add a class to li where achor is present achor add class to first li
jquery
null
null
null
null
12/02/2011 04:01:21
not a real question
How can i select the ul li under this if i find a add class to first li which is having achor === Plesae help me out selector how to add a class to li where achor is present achor add class to first li
1
6,867,618
07/29/2011 01:13:37
843,151
07/13/2011 16:57:10
23
5
Why doesn't this compile
#include "base.h" #include <Poco/SharedPtr.h> #include <Poco/AutoPtr.h> #include <vector> using Poco::SharedPtr; using Poco::AutoPtr; namespace kroll { class Value; class KObject; class KMethod; class KList; class StaticBoundObject; class StaticBoundMethod; class StaticBoundList; class GlobalObject; class ScopeMethodDelegate; class Bytes; class VoidPtr; class ValueReleasePolicy; class Logger; class ArgList; template <class C> class KAutoPtr : public AutoPtr<C> { public: KAutoPtr() : AutoPtr() {} KAutoPtr(C* ptr) : AutoPtr(ptr) {} KAutoPtr(C* ptr, bool shared) : AutoPtr(ptr, shared) {} KAutoPtr(const AutoPtr& ptr) : AutoPtr(ptr) {} /*KAutoPtr& operator = (const AutoPtr& ptr) { return assign(ptr); }*/ #ifdef DEBUG //This is used in debug builds as a workaround to release all memory //before VS debugger incorrectly dumps it as memory leak. KObject* release() { KObject* t = _ptr; _ptr = 0; return t; } #endif }; I get the following errors: kroll/libkroll/kroll.h:66: error: expected ',' or '...' before '&' token kroll/libkroll/kroll.h:66: error: ISO C++ forbids declaration of 'AutoPtr' with no type kroll/libkroll/kroll.h: In constructor 'kroll::KAutoPtr<C>::KAutoPtr()': kroll/libkroll/kroll.h:57: error: class 'kroll::KAutoPtr<C>' does not have any field named 'AutoPtr' kroll/libkroll/kroll.h: In constructor 'kroll::KAutoPtr<C>::KAutoPtr(C*)': kroll/libkroll/kroll.h:60: error: class 'kroll::KAutoPtr<C>' does not have any field named 'AutoPtr' kroll/libkroll/kroll.h: In constructor 'kroll::KAutoPtr<C>::KAutoPtr(C*, bool)': kroll/libkroll/kroll.h:63: error: class 'kroll::KAutoPtr<C>' does not have any field named 'AutoPtr' kroll/libkroll/kroll.h: In constructor 'kroll::KAutoPtr<C>::KAutoPtr(int)': kroll/libkroll/kroll.h:66: error: class 'kroll::KAutoPtr<C>' does not have any field named 'AutoPtr' kroll/libkroll/kroll.h:66: error: 'ptr' was not declared in this scope kroll/libkroll/kroll.h: In member function 'kroll::KObject* kroll::KAutoPtr<C>::release()': kroll/libkroll/kroll.h:79: error: '_ptr' was not declared in this scope line 66 is KAutoPtr(const AutoPtr& ptr) : AutoPtr(ptr) I am using the command line i686-apple-darwin10-gcc-4.2.1 to compile the code on MAC OS X 10.6.7 machine.
gcc
compiler-errors
null
null
null
07/29/2011 17:34:20
too localized
Why doesn't this compile === #include "base.h" #include <Poco/SharedPtr.h> #include <Poco/AutoPtr.h> #include <vector> using Poco::SharedPtr; using Poco::AutoPtr; namespace kroll { class Value; class KObject; class KMethod; class KList; class StaticBoundObject; class StaticBoundMethod; class StaticBoundList; class GlobalObject; class ScopeMethodDelegate; class Bytes; class VoidPtr; class ValueReleasePolicy; class Logger; class ArgList; template <class C> class KAutoPtr : public AutoPtr<C> { public: KAutoPtr() : AutoPtr() {} KAutoPtr(C* ptr) : AutoPtr(ptr) {} KAutoPtr(C* ptr, bool shared) : AutoPtr(ptr, shared) {} KAutoPtr(const AutoPtr& ptr) : AutoPtr(ptr) {} /*KAutoPtr& operator = (const AutoPtr& ptr) { return assign(ptr); }*/ #ifdef DEBUG //This is used in debug builds as a workaround to release all memory //before VS debugger incorrectly dumps it as memory leak. KObject* release() { KObject* t = _ptr; _ptr = 0; return t; } #endif }; I get the following errors: kroll/libkroll/kroll.h:66: error: expected ',' or '...' before '&' token kroll/libkroll/kroll.h:66: error: ISO C++ forbids declaration of 'AutoPtr' with no type kroll/libkroll/kroll.h: In constructor 'kroll::KAutoPtr<C>::KAutoPtr()': kroll/libkroll/kroll.h:57: error: class 'kroll::KAutoPtr<C>' does not have any field named 'AutoPtr' kroll/libkroll/kroll.h: In constructor 'kroll::KAutoPtr<C>::KAutoPtr(C*)': kroll/libkroll/kroll.h:60: error: class 'kroll::KAutoPtr<C>' does not have any field named 'AutoPtr' kroll/libkroll/kroll.h: In constructor 'kroll::KAutoPtr<C>::KAutoPtr(C*, bool)': kroll/libkroll/kroll.h:63: error: class 'kroll::KAutoPtr<C>' does not have any field named 'AutoPtr' kroll/libkroll/kroll.h: In constructor 'kroll::KAutoPtr<C>::KAutoPtr(int)': kroll/libkroll/kroll.h:66: error: class 'kroll::KAutoPtr<C>' does not have any field named 'AutoPtr' kroll/libkroll/kroll.h:66: error: 'ptr' was not declared in this scope kroll/libkroll/kroll.h: In member function 'kroll::KObject* kroll::KAutoPtr<C>::release()': kroll/libkroll/kroll.h:79: error: '_ptr' was not declared in this scope line 66 is KAutoPtr(const AutoPtr& ptr) : AutoPtr(ptr) I am using the command line i686-apple-darwin10-gcc-4.2.1 to compile the code on MAC OS X 10.6.7 machine.
3
3,783,169
09/23/2010 23:12:55
113,419
05/27/2009 21:47:45
1,057
25
vb.net scrollable content panel
Is there a control in vb.net that is specifically designed for displaying content larger than the control itself? I know it's possible to code your own using a panel and two scrollbars, but is there an already existing method for this? Thanks for your help
vb.net
controls
null
null
null
null
open
vb.net scrollable content panel === Is there a control in vb.net that is specifically designed for displaying content larger than the control itself? I know it's possible to code your own using a panel and two scrollbars, but is there an already existing method for this? Thanks for your help
0
10,472,031
05/06/2012 16:08:41
1,183,292
02/01/2012 17:12:21
36
1
Custom MVC Framework: How set links in view files
I'm creating a custom MVC framework, and i'm stuck with some urls definition in the view files. I have this piece of code wich let me use SEO Urls: $requestURI = explode('/', $_SERVER['REQUEST_URI']); $scriptName = explode('/', $_SERVER['SCRIPT_NAME']); for( $i = 0; $i < sizeof($scriptName); $i++) { if( $requestURI[$i] == $scriptName[$i]) { unset($requestURI[$i]); } } $command = array_values($requestURI); if( sizeof($command) === 0 OR sizeof($command) === 1) { init_controller_class($config['default_controller'], $config['default_entry']); } elseif( sizeof($command) >= 2) { init_controller_class($command[0], $command[1]); } My view file: <div class="container"> <div class="header"> <ul class="menu"> <li><a href="#">Home</a></li> <li><a href="#">News</a></li> <li><a href="#">Downloads</a></li> <li><a href="#">About µMVC</a></li> </ul> </div> </div> The basic url is http://mvc.localhost:8888/welcome/index, how do i set the urls in this menu? Cause if i insert `<li><a href="welcome/about">About µMVC</a></li>` it will redirect to http://mvc.localhost:8888/welcome/welcome/about and obviusly my script will terminate cause doesn't exists a function welcome with parameter about in the controller welcome. How to eliminate this problem? Hope you could help me. PS: Sorry for my bad english
php
mvc
seo
url-routing
null
05/08/2012 18:12:08
too localized
Custom MVC Framework: How set links in view files === I'm creating a custom MVC framework, and i'm stuck with some urls definition in the view files. I have this piece of code wich let me use SEO Urls: $requestURI = explode('/', $_SERVER['REQUEST_URI']); $scriptName = explode('/', $_SERVER['SCRIPT_NAME']); for( $i = 0; $i < sizeof($scriptName); $i++) { if( $requestURI[$i] == $scriptName[$i]) { unset($requestURI[$i]); } } $command = array_values($requestURI); if( sizeof($command) === 0 OR sizeof($command) === 1) { init_controller_class($config['default_controller'], $config['default_entry']); } elseif( sizeof($command) >= 2) { init_controller_class($command[0], $command[1]); } My view file: <div class="container"> <div class="header"> <ul class="menu"> <li><a href="#">Home</a></li> <li><a href="#">News</a></li> <li><a href="#">Downloads</a></li> <li><a href="#">About µMVC</a></li> </ul> </div> </div> The basic url is http://mvc.localhost:8888/welcome/index, how do i set the urls in this menu? Cause if i insert `<li><a href="welcome/about">About µMVC</a></li>` it will redirect to http://mvc.localhost:8888/welcome/welcome/about and obviusly my script will terminate cause doesn't exists a function welcome with parameter about in the controller welcome. How to eliminate this problem? Hope you could help me. PS: Sorry for my bad english
3
11,195,812
06/25/2012 19:14:47
379,264
06/29/2010 17:19:25
56
5
What are the Pros and Cons of creating a new Database System vs. Altering an existing one?
I have a client who has brought in another developer to work on a separate application which has never been integrated into the much larger application which pretty much runs their entire business model. It is a .net with a MSSQL 2008 R2 database. They are toying with the idea of taking my 30+ table database and grabbing pieces and parts of it to create a completely new database which I will then be expected to change the current system to follow eventually. I'm never opposed to optimization, and the main table for customers certainly can be split into 2 additional tables now as they are proposing. However I can't help but wonder if it doesn't make more sense to take the existing tables and modify them to add/remove fields they want and develop what is essentially a brand new application based off a lot of the datastructure, hooks, and other services I've spent the past 7 years developing. Looking for some experience here from someone who maybe has worked within a large application and how updates are released as time goes on. The other developer is not out for taking over my client in any way. He's in his late 60's, semi-retired, and is doing this as a favor to my client since we're just slammed. He's a great guy and has always been open to suggestions and discussions, so this will be no different, but I trust the community here and want to do what is best for my client and their new application. So either way you suggest is perfectly fine to me. Thanks!
.net
database-design
architecture
null
null
06/26/2012 17:53:08
too localized
What are the Pros and Cons of creating a new Database System vs. Altering an existing one? === I have a client who has brought in another developer to work on a separate application which has never been integrated into the much larger application which pretty much runs their entire business model. It is a .net with a MSSQL 2008 R2 database. They are toying with the idea of taking my 30+ table database and grabbing pieces and parts of it to create a completely new database which I will then be expected to change the current system to follow eventually. I'm never opposed to optimization, and the main table for customers certainly can be split into 2 additional tables now as they are proposing. However I can't help but wonder if it doesn't make more sense to take the existing tables and modify them to add/remove fields they want and develop what is essentially a brand new application based off a lot of the datastructure, hooks, and other services I've spent the past 7 years developing. Looking for some experience here from someone who maybe has worked within a large application and how updates are released as time goes on. The other developer is not out for taking over my client in any way. He's in his late 60's, semi-retired, and is doing this as a favor to my client since we're just slammed. He's a great guy and has always been open to suggestions and discussions, so this will be no different, but I trust the community here and want to do what is best for my client and their new application. So either way you suggest is perfectly fine to me. Thanks!
3
1,170,737
07/23/2009 09:55:56
53,915
01/11/2009 17:05:50
309
4
String parser/seperation in PHP
i have data which i wish to be pasted into a textbox, it will be in the form E.G Ryu Aiter D78:21:87:13 177 /177 1 / 6 Ryu Chronos D78:21:26:21 182 /182 0 / 6 Ryu Hermes D78:21:26:22 201 /201 0 / 6 Ryu Hefaistos D78:31:75:10 136 /136 1 / 2 Ryu Krotos D78:84:96:11 170 /170 1 / 6 Ryu Heros D78:65:51:31 175 /175 2 / 5 Ryu Arachnos D78:13:84:11 185 /185 0 / 5 its splits up like this <br> Name(max 16 chars) <br> Base(max 16 chars) <br> Location(staring D , 12 chars) <br> econ/max econ (int/int) <br> used/Total(int/int) <br> What i wish to do is creat a loop for each Row of text, and then inside that loop chop out each part of the row into variables for each component. as far as ideas on seperating it i know that the : symbol is banned from names and bases. so if i find the first ":" then step back 2 and take the next 12 chars that is my location i know that can be done with a until loop and if(string[x]=':') But how do i loops through rows? And how can i seperate the rest of the data in a row?
php
seperation
null
null
null
null
open
String parser/seperation in PHP === i have data which i wish to be pasted into a textbox, it will be in the form E.G Ryu Aiter D78:21:87:13 177 /177 1 / 6 Ryu Chronos D78:21:26:21 182 /182 0 / 6 Ryu Hermes D78:21:26:22 201 /201 0 / 6 Ryu Hefaistos D78:31:75:10 136 /136 1 / 2 Ryu Krotos D78:84:96:11 170 /170 1 / 6 Ryu Heros D78:65:51:31 175 /175 2 / 5 Ryu Arachnos D78:13:84:11 185 /185 0 / 5 its splits up like this <br> Name(max 16 chars) <br> Base(max 16 chars) <br> Location(staring D , 12 chars) <br> econ/max econ (int/int) <br> used/Total(int/int) <br> What i wish to do is creat a loop for each Row of text, and then inside that loop chop out each part of the row into variables for each component. as far as ideas on seperating it i know that the : symbol is banned from names and bases. so if i find the first ":" then step back 2 and take the next 12 chars that is my location i know that can be done with a until loop and if(string[x]=':') But how do i loops through rows? And how can i seperate the rest of the data in a row?
0
3,486,789
08/15/2010 09:06:20
413,905
08/07/2010 15:52:43
1
0
Image Processing Programming
I wanted to know if there's any way by which we can detect the position of an object in an image using some programming language ? For example : If i have an image of a ball that is updating itself say every 100 milliseconds,is it possible to get the coordinate of the ball through some program,using something like C++ or Java ? Thanks!
c++
c
image
processing
null
null
open
Image Processing Programming === I wanted to know if there's any way by which we can detect the position of an object in an image using some programming language ? For example : If i have an image of a ball that is updating itself say every 100 milliseconds,is it possible to get the coordinate of the ball through some program,using something like C++ or Java ? Thanks!
0
10,141,414
04/13/2012 13:06:14
322,791
04/21/2010 23:46:02
351
12
Drawing lines/points in cocos2d for iPhone is very slow
I am trying to draw coloured landscape around my game which is dynamically changing its shape and color when player moves on. Even simple drawing couses framerate to drop to around 10 FPS. -(void) draw { glPointSize(1); glColor4ub(100,100,100,255); for(int i=0; i<100; i+=1){ for (int j=0; j<100; j++){ ccDrawPoint(ccp(i, j)); } } } What could I do to make these operations work faster?
cocos2d-iphone
null
null
null
null
null
open
Drawing lines/points in cocos2d for iPhone is very slow === I am trying to draw coloured landscape around my game which is dynamically changing its shape and color when player moves on. Even simple drawing couses framerate to drop to around 10 FPS. -(void) draw { glPointSize(1); glColor4ub(100,100,100,255); for(int i=0; i<100; i+=1){ for (int j=0; j<100; j++){ ccDrawPoint(ccp(i, j)); } } } What could I do to make these operations work faster?
0
7,628,569
10/02/2011 19:06:46
504,807
11/11/2010 17:07:49
9
0
Two operators simultaneity over load in c++
I want to represent my object like an array. I mean that the programmer can write in his code `myobject[3]=2` In the back (in myobject code) there isn't array at all, it's only the representing. So I need to overload `[]` and `=` simultaneity. How can it's can be done? thank you, and sorry about my poor English.
c++
operator-overloading
null
null
null
null
open
Two operators simultaneity over load in c++ === I want to represent my object like an array. I mean that the programmer can write in his code `myobject[3]=2` In the back (in myobject code) there isn't array at all, it's only the representing. So I need to overload `[]` and `=` simultaneity. How can it's can be done? thank you, and sorry about my poor English.
0
4,884,598
02/03/2011 09:55:01
601,278
02/03/2011 09:55:01
1
0
Looking for a simple but kind of innovative android application to develop.
I am a beginner and am looking for asimple but kind of innovative application to start with. please suggest as early as possible!
android
null
null
null
null
02/03/2011 10:08:25
not a real question
Looking for a simple but kind of innovative android application to develop. === I am a beginner and am looking for asimple but kind of innovative application to start with. please suggest as early as possible!
1
5,028,413
02/17/2011 11:37:28
617,448
02/15/2011 08:52:49
10
0
if tag vill b varies it should either A or D
<xsl:for-each select ="block4"> <xsl:choose> <xsl:when test="tag[name = '57A']"> <xsl:value-of select="value"/> </xsl:when> <xsl:when test="tag[name = '57D'] "> <xsl:value-of select="value"/> </xsl:when> </xsl:choose>,<xsl:text/> </xsl:for-each> i have written my xslt like this ..it ws not working properly for this xml <tag> <name>57A</name> <value>NORTESMM</value> </tag> some times name tags vill b changing it should b either **57A or 57D** so that i written xslt like above but it ws not generating
xml
xslt
null
null
null
null
open
if tag vill b varies it should either A or D === <xsl:for-each select ="block4"> <xsl:choose> <xsl:when test="tag[name = '57A']"> <xsl:value-of select="value"/> </xsl:when> <xsl:when test="tag[name = '57D'] "> <xsl:value-of select="value"/> </xsl:when> </xsl:choose>,<xsl:text/> </xsl:for-each> i have written my xslt like this ..it ws not working properly for this xml <tag> <name>57A</name> <value>NORTESMM</value> </tag> some times name tags vill b changing it should b either **57A or 57D** so that i written xslt like above but it ws not generating
0
244,038
10/28/2008 16:55:17
7,734
09/15/2008 14:19:11
852
71
How do you deal with Brain Buffer Overflow?
This is probably an old topic, but I just ran into it again, and it sounds like a good area to look for other ideas. The library I am working on has a bug that I am having difficulty isolating. In fact one of the things that happened in the last day or two, was the size got too big. The amount of detail is so large, I can't keep the whole thing in my head. I call this Brain Buffer Overflow. There are many techniques available to help reduce the size of the stuff you need to fit into your head, so there is room for more important stuff. - Breaking things into **functions**, so you deal with the interface, rather than the internal details. - Same thing for **classes**. Hide the dirty implementation behind a class interface, so you don't have to think about the details. - I print source listings and tape them up on the wall, so I have a more global view than what is available, though my 22 inch lcd monitor. What techniques do you use to help keep unneeded stuff out of your brain buffer, so you can deal with larger problems?
complexity
human-factors
null
null
null
11/29/2011 18:45:10
not constructive
How do you deal with Brain Buffer Overflow? === This is probably an old topic, but I just ran into it again, and it sounds like a good area to look for other ideas. The library I am working on has a bug that I am having difficulty isolating. In fact one of the things that happened in the last day or two, was the size got too big. The amount of detail is so large, I can't keep the whole thing in my head. I call this Brain Buffer Overflow. There are many techniques available to help reduce the size of the stuff you need to fit into your head, so there is room for more important stuff. - Breaking things into **functions**, so you deal with the interface, rather than the internal details. - Same thing for **classes**. Hide the dirty implementation behind a class interface, so you don't have to think about the details. - I print source listings and tape them up on the wall, so I have a more global view than what is available, though my 22 inch lcd monitor. What techniques do you use to help keep unneeded stuff out of your brain buffer, so you can deal with larger problems?
4
5,038,745
02/18/2011 07:36:46
353,760
05/29/2010 21:30:18
783
21
Access Query - Compare Multiple User Selections Against Each Other
I'm running into a conceptual problem that I cannot seem to conquer in my mind. Let's say I want a user to enter what they're currently wearing into a database via a form. Throwing 'T-Shirt' and 'Blue' in a new row is incredibly easy. However, let's say I want to compare one users against others, and rank in order from most similar to least. This becomes a huge nightmare when you consider the amount of options available. - Undershirt - Overshirt - Jacket - Scarf/Necklaces - Headwear - Pants - Underwear - Leggings - Socks - Footwear - Accessories As I see it, I could hard-code in the 11 categories above and let a user make selections from drop-drop boxes tailored to each category. Now, let's use an example of 'Undershirt' and 'Overshirt'. Depending on the person, a long-sleeved shirt could be used as either; they're still wearing one. If I make users put values in categories, User A might put it in one and User B might but it in another category. And they wouldn't get compared because of that, separate categories. Now, instead of hard-coding in categories (and thus making a limit of how much a user can enter), I could put each item into its own row and search by User ID. But let's say a person enters in shorts one day, and next throws in jeans and a shirt. How can I make sure that they're compared separately (e.g., dress compared to shorts, dress compared to jeans+shirt) and not (dress compared to shorts+jeans+shirt). As to actually comparing, each item vs. each other could be performed via a 2d lookup table. (Row Dress vs. Column Jeans would net a zero, Row Dress vs. Column Dress would net a one)
sql
database
query
database-design
access
null
open
Access Query - Compare Multiple User Selections Against Each Other === I'm running into a conceptual problem that I cannot seem to conquer in my mind. Let's say I want a user to enter what they're currently wearing into a database via a form. Throwing 'T-Shirt' and 'Blue' in a new row is incredibly easy. However, let's say I want to compare one users against others, and rank in order from most similar to least. This becomes a huge nightmare when you consider the amount of options available. - Undershirt - Overshirt - Jacket - Scarf/Necklaces - Headwear - Pants - Underwear - Leggings - Socks - Footwear - Accessories As I see it, I could hard-code in the 11 categories above and let a user make selections from drop-drop boxes tailored to each category. Now, let's use an example of 'Undershirt' and 'Overshirt'. Depending on the person, a long-sleeved shirt could be used as either; they're still wearing one. If I make users put values in categories, User A might put it in one and User B might but it in another category. And they wouldn't get compared because of that, separate categories. Now, instead of hard-coding in categories (and thus making a limit of how much a user can enter), I could put each item into its own row and search by User ID. But let's say a person enters in shorts one day, and next throws in jeans and a shirt. How can I make sure that they're compared separately (e.g., dress compared to shorts, dress compared to jeans+shirt) and not (dress compared to shorts+jeans+shirt). As to actually comparing, each item vs. each other could be performed via a 2d lookup table. (Row Dress vs. Column Jeans would net a zero, Row Dress vs. Column Dress would net a one)
0
10,798,386
05/29/2012 11:38:11
1,369,403
05/02/2012 07:30:07
20
0
How is this matrix transformation right? (Beginner)
I am stuck on a question because I am not fully sure how the matrix stack works in this case. If someone can give me step by step process that indicates what happens in this example here: The answer is given with the question.![enter image description here][1] [1]: http://i.stack.imgur.com/PDXE6.jpg
c++
opengl
matrix
stack
null
05/29/2012 13:17:50
not a real question
How is this matrix transformation right? (Beginner) === I am stuck on a question because I am not fully sure how the matrix stack works in this case. If someone can give me step by step process that indicates what happens in this example here: The answer is given with the question.![enter image description here][1] [1]: http://i.stack.imgur.com/PDXE6.jpg
1
10,150,232
04/14/2012 01:24:50
984,734
10/07/2011 21:18:27
218
2
How to make a div popout in the middle of the screen and making the rest of the site dark
I just say that in the new vimeo and want to know how this is accomplished This is the the button <a href="/messages/compose?recipient=1667821" class="message btn" data-lightbox="">Send Message</a> There is no onclick() , they get the href value and inserted into the div without refreshing the page..
css
html5
css3
null
null
04/14/2012 12:35:55
not a real question
How to make a div popout in the middle of the screen and making the rest of the site dark === I just say that in the new vimeo and want to know how this is accomplished This is the the button <a href="/messages/compose?recipient=1667821" class="message btn" data-lightbox="">Send Message</a> There is no onclick() , they get the href value and inserted into the div without refreshing the page..
1
6,658,150
07/12/2011 00:05:26
839,859
07/12/2011 00:00:10
1
0
Stop UIWebView from loading a specific image using its 'id'.
Hi I would like to stop UIWebView from loading a specific image, the problem is that the images url changes, BUT its id (id="Header1_headerimg") stays the same. The html on the web page: < img alt="Equestria Daily" height="350px; " id="Header1_headerimg" src="http://4.bp.blogspot.com/-WS5XLbTi47E/ThdWHuLoR4I/AAAAAAAAHT8/cdqXIVfXB9k/s1600/newdefaultbannerappstra.png" style="display: block" width="1100px; "> I want this blocked in UIWebView. No I cannot edit the pages html. Thank you.
iphone
html
c
ios
application
null
open
Stop UIWebView from loading a specific image using its 'id'. === Hi I would like to stop UIWebView from loading a specific image, the problem is that the images url changes, BUT its id (id="Header1_headerimg") stays the same. The html on the web page: < img alt="Equestria Daily" height="350px; " id="Header1_headerimg" src="http://4.bp.blogspot.com/-WS5XLbTi47E/ThdWHuLoR4I/AAAAAAAAHT8/cdqXIVfXB9k/s1600/newdefaultbannerappstra.png" style="display: block" width="1100px; "> I want this blocked in UIWebView. No I cannot edit the pages html. Thank you.
0
11,252,241
06/28/2012 20:18:52
546,661
12/17/2010 23:59:54
12,175
271
Why doesn't this crazy brackety Javascript cause a syntax error?
I was playing around with some Javascript snippets today and noticed that this code would actually run: {{for(var i = 0; i < 3; i++) {{{{ alert(i); }}}}}} You can [try it out for yourself on jsFiddle][1]. Why does this run without any syntax errors? What do the repeated brackets mean? Does Javascript just ignore repeated curly braces? [1]: http://jsfiddle.net/xbdgH/
javascript
null
null
null
null
06/28/2012 21:27:30
too localized
Why doesn't this crazy brackety Javascript cause a syntax error? === I was playing around with some Javascript snippets today and noticed that this code would actually run: {{for(var i = 0; i < 3; i++) {{{{ alert(i); }}}}}} You can [try it out for yourself on jsFiddle][1]. Why does this run without any syntax errors? What do the repeated brackets mean? Does Javascript just ignore repeated curly braces? [1]: http://jsfiddle.net/xbdgH/
3
8,615,622
12/23/2011 11:37:19
188,826
10/13/2009 04:01:36
1,765
18
Double serialization customization
I have the following class: public class SomeClass { public double SomeValue {get;set;} } I need to serialize it by XmlSerializer but I need to multiply the value by 10 during serialization and divide it by 10 during deserialization. Is there any way to implement this custom logic?
c#
.net
null
null
null
null
open
Double serialization customization === I have the following class: public class SomeClass { public double SomeValue {get;set;} } I need to serialize it by XmlSerializer but I need to multiply the value by 10 during serialization and divide it by 10 during deserialization. Is there any way to implement this custom logic?
0
3,853,013
10/04/2010 05:19:02
464,658
10/02/2010 15:19:29
11
2
AVCapture Session
I was wondering if anyone anywhere had an example of an AVCapture session using AVCaptureVideoDataOutput working -- I am using the default CMSampleBuffer from the AVFoundation data output callback method - but when I save it to camera roll it is all black except the last 5 frames which I have to manually scrub to :S any help in regards to my issue would be greatly appreciated. Cheers, Michael
iphone
xcode
avcapturesession
null
null
06/19/2012 12:28:39
not constructive
AVCapture Session === I was wondering if anyone anywhere had an example of an AVCapture session using AVCaptureVideoDataOutput working -- I am using the default CMSampleBuffer from the AVFoundation data output callback method - but when I save it to camera roll it is all black except the last 5 frames which I have to manually scrub to :S any help in regards to my issue would be greatly appreciated. Cheers, Michael
4
9,954,479
03/31/2012 08:56:07
960,761
09/23/2011 09:01:30
37
1
How to delete an image from application programatically
Can any one suggest me I have an option to add an image to my app, I want to have a delete option to delete the added image like we delete the app which is running as multitasking.
iphone
objective-c
xcode
null
null
04/01/2012 07:51:59
not a real question
How to delete an image from application programatically === Can any one suggest me I have an option to add an image to my app, I want to have a delete option to delete the added image like we delete the app which is running as multitasking.
1
7,575,674
09/27/2011 21:05:23
164,431
08/27/2009 18:41:54
133
2
Confusion over generating custom JSON response in Rails
Model description: User, Widget, Purchase User has_many :purchases has_many :widgets, :through => :purchases Widget has_many :purchases has_many :users, :through => :purchases Purchase belongs_to :user belongs_to :widget Hope that makes sense and is correct for the below. Right, in my controller, I have current_user. I wish to render a nested JSON response for use eventually with jquery templates. Like this would be ideal: { "purchases": [ { "quantity": 200, "price": "1.0", "widget": { "name": "Fantastic Widget", "size": "Large" } }, { "quantity": 300, "price": "3.0", "widget": { "name": "Awesome Widget", "size": "Medium" } } ] } This: render :json => current_user.to_json(:include => [:purchases, :widgets]) Will render some current_user details (not really relevant) and then purchases and widgets at the same level. This works (outputs some current user details but thats not my main gripe at the moment): render :json => current_user.to_json({:include => :purchases }) But obviously only outputs purchase data. I cannot get a nested include to work (should it work?) even after looking at this sample: konata.to_json(:include => { :posts => { :include => { :comments => { :only => :body } }, :only => :title } }) From [here][1] and this [existing stackoverflow question][2]. [1]: http://apidock.com/rails/ActiveRecord/Serialization/to_json [2]: http://stackoverflow.com/questions/4653844/json-include-syntax So I've just got myself thoroughly confused. Help appreciated.
ruby-on-rails
json
null
null
null
null
open
Confusion over generating custom JSON response in Rails === Model description: User, Widget, Purchase User has_many :purchases has_many :widgets, :through => :purchases Widget has_many :purchases has_many :users, :through => :purchases Purchase belongs_to :user belongs_to :widget Hope that makes sense and is correct for the below. Right, in my controller, I have current_user. I wish to render a nested JSON response for use eventually with jquery templates. Like this would be ideal: { "purchases": [ { "quantity": 200, "price": "1.0", "widget": { "name": "Fantastic Widget", "size": "Large" } }, { "quantity": 300, "price": "3.0", "widget": { "name": "Awesome Widget", "size": "Medium" } } ] } This: render :json => current_user.to_json(:include => [:purchases, :widgets]) Will render some current_user details (not really relevant) and then purchases and widgets at the same level. This works (outputs some current user details but thats not my main gripe at the moment): render :json => current_user.to_json({:include => :purchases }) But obviously only outputs purchase data. I cannot get a nested include to work (should it work?) even after looking at this sample: konata.to_json(:include => { :posts => { :include => { :comments => { :only => :body } }, :only => :title } }) From [here][1] and this [existing stackoverflow question][2]. [1]: http://apidock.com/rails/ActiveRecord/Serialization/to_json [2]: http://stackoverflow.com/questions/4653844/json-include-syntax So I've just got myself thoroughly confused. Help appreciated.
0
5,868,473
05/03/2011 11:02:30
351,614
05/27/2010 05:42:00
113
3
per client master page separation
On the current project I'm working on we are developing a product that eventually gets used at various different client sites. At the moment the way things are done is that all code for all of the clients is included in the one solution, currently there's only about 5 or so clients so its manageable but I'd like to reorganize this so we can move these bits out to client specific areas. In regards to the actual assemblies for various clients I think we can easily achieve something flexible using MEF or IOC. The area im not sure about is the web side of things. Each client current has their own master page and these master pages are fairly radically different, apart from having the same content areas, the customization is probably not able likely to just be achieved by pure CSS. Is there a way to have a "base" masterpage that would normally get used and then if we want to deploy to client A we can just inject somehow client As master page. Currently this is handled by all of the content pages referring to Master.master as their master page and then there is a generic Master.master, when deploying to client A we rename Master.master to something and rename the specifically tailored master page for client A (ClientA.master) to Master.master and deploy. The down side to all of this is that all of the master pages are kept in the one web project which feels a bit wrong if we are trying to head to a client agnostic main branch, and unless the other master pages are deleted as part of the deployment the client would get a copy of them on their server even though they aren't used and preferrably we'd not like to have one client being able to switch to another clients view etc (not that security wise it would have any effect)
asp.net
dynamic
client
master-pages
null
null
open
per client master page separation === On the current project I'm working on we are developing a product that eventually gets used at various different client sites. At the moment the way things are done is that all code for all of the clients is included in the one solution, currently there's only about 5 or so clients so its manageable but I'd like to reorganize this so we can move these bits out to client specific areas. In regards to the actual assemblies for various clients I think we can easily achieve something flexible using MEF or IOC. The area im not sure about is the web side of things. Each client current has their own master page and these master pages are fairly radically different, apart from having the same content areas, the customization is probably not able likely to just be achieved by pure CSS. Is there a way to have a "base" masterpage that would normally get used and then if we want to deploy to client A we can just inject somehow client As master page. Currently this is handled by all of the content pages referring to Master.master as their master page and then there is a generic Master.master, when deploying to client A we rename Master.master to something and rename the specifically tailored master page for client A (ClientA.master) to Master.master and deploy. The down side to all of this is that all of the master pages are kept in the one web project which feels a bit wrong if we are trying to head to a client agnostic main branch, and unless the other master pages are deleted as part of the deployment the client would get a copy of them on their server even though they aren't used and preferrably we'd not like to have one client being able to switch to another clients view etc (not that security wise it would have any effect)
0
1,474,240
09/24/2009 21:24:38
147,803
07/30/2009 12:57:56
23
2
DataBinding the AJAX Control Toolkit's Rating Control
I'm attempting to use the AJAX Control Toolkit's Rating control in a DataBinding scenario. I have a ReuseRating column in my database that is a tinyint. It can hold values 1 through 5. Every record in the table has the value set to 1 currently. If I do this in my ItemTemplate everything works fine. I get 1 star filled in on my rating control. <act:Rating ID="ReuseRatingRating" runat="server" CurrentRating='<%# Convert.ToInt16(Eval("ReuseRating")) %>' MaxRating="5" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" /> Now I want to DataBind this in my EditTemplate like so. <act:Rating ID="ReuseRatingRating" runat="server" CurrentRating='<%# Convert.ToInt16(Bind("ReuseRating")) %>' MaxRating="5" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" /> Note, that I changed my Eval to a Bind in the CurrentRating property. This throws the following error. > CS0103: The name 'Bind' does not exist > in the current context Can anyone help me out on this one? I've been knocking my head against the wall for a couple of hours now.
ajaxcontroltoolkit
data-binding
null
null
null
null
open
DataBinding the AJAX Control Toolkit's Rating Control === I'm attempting to use the AJAX Control Toolkit's Rating control in a DataBinding scenario. I have a ReuseRating column in my database that is a tinyint. It can hold values 1 through 5. Every record in the table has the value set to 1 currently. If I do this in my ItemTemplate everything works fine. I get 1 star filled in on my rating control. <act:Rating ID="ReuseRatingRating" runat="server" CurrentRating='<%# Convert.ToInt16(Eval("ReuseRating")) %>' MaxRating="5" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" /> Now I want to DataBind this in my EditTemplate like so. <act:Rating ID="ReuseRatingRating" runat="server" CurrentRating='<%# Convert.ToInt16(Bind("ReuseRating")) %>' MaxRating="5" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" /> Note, that I changed my Eval to a Bind in the CurrentRating property. This throws the following error. > CS0103: The name 'Bind' does not exist > in the current context Can anyone help me out on this one? I've been knocking my head against the wall for a couple of hours now.
0
2,905,045
05/25/2010 13:30:30
349,938
05/25/2010 13:09:51
1
0
XML parsing to plist iPhone SDK
Could you, please, help me with parsing of this XML code: <?xml version="1.0" encoding="utf-8"?> <stuff> <parts> <part id='327'> <name>Logitech MX500</name> <serial>618163558491989</serial> <account>ASDALSKD</account> <number>987 789 456</number> <alarm>alarm1</alarm> </part> <part id='846'> <name>Logitech MX510</name> <serial>871351434945431</serial> <account>KJSDAKLJFA</account> <number>454 564 131</number> <alarm>alarm2</alarm> </part> </parts> <info>Information</info> </stuff> And save data to plist file stuff.plist in this format: 327 NSArray Name NSString Logitech MX500 Serial NSString 618163558491989 Account NSString ASDALSKD Number NSString 987 789 456 Alarm NSString alarm1 846 NSArray Name NSString Logitech MX510 Serial NSString 871351434945431 Account NSString KJSDAKLJFA Number NSString 454 564 131 Alarm NSString alarm2
iphone
xml
parsing
save
plist
null
open
XML parsing to plist iPhone SDK === Could you, please, help me with parsing of this XML code: <?xml version="1.0" encoding="utf-8"?> <stuff> <parts> <part id='327'> <name>Logitech MX500</name> <serial>618163558491989</serial> <account>ASDALSKD</account> <number>987 789 456</number> <alarm>alarm1</alarm> </part> <part id='846'> <name>Logitech MX510</name> <serial>871351434945431</serial> <account>KJSDAKLJFA</account> <number>454 564 131</number> <alarm>alarm2</alarm> </part> </parts> <info>Information</info> </stuff> And save data to plist file stuff.plist in this format: 327 NSArray Name NSString Logitech MX500 Serial NSString 618163558491989 Account NSString ASDALSKD Number NSString 987 789 456 Alarm NSString alarm1 846 NSArray Name NSString Logitech MX510 Serial NSString 871351434945431 Account NSString KJSDAKLJFA Number NSString 454 564 131 Alarm NSString alarm2
0
5,542,517
04/04/2011 18:13:41
184,131
10/05/2009 03:12:54
40
0
Extending NHibernate to support aggregate functions
Is it possible to extend NHibernate to add support for aggregate functions that is unique to a database system? I have a handful of queries that use the array_agg() function (and others) in PostgreSQL that I'd like to convert to HQL/ICriteria. Thanks!
nhibernate
postgresql
null
null
null
null
open
Extending NHibernate to support aggregate functions === Is it possible to extend NHibernate to add support for aggregate functions that is unique to a database system? I have a handful of queries that use the array_agg() function (and others) in PostgreSQL that I'd like to convert to HQL/ICriteria. Thanks!
0
2,885,514
05/21/2010 20:56:35
2,469
08/22/2008 12:41:47
9,483
418
What xsd will let an element have itself as a sub element infinitely?
How can I create an xsd to give me this type of xml structure that can go on infinitely? <?xml version="1.0" encoding="utf-8" ?> <SampleXml> <Items> <Item name="SomeName" type="string"> This would be the value </Item> <Item name="SecondName" type="string"> This is the next string </Item> <Item name="AnotherName" type="list"> <Items> <Item name="SubName" type="string"> A string in a sub list </Item> <Item name="SubSubName" type="list"> <Items> <Item name="HowDoI" type="string"> How do I keep this going infinately? </Item> </Items> </Item> </Items> </Item> </Items> </SampleXml> The only solution I have found has been to just repeat in the xsd as many times as I am willing to copy. Like below. <?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="SampleXml"> <xs:complexType> <xs:sequence> <xs:element name="Items"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Item"> <xs:complexType mixed="true"> <xs:sequence minOccurs="0"> <xs:element name="Items"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Item"> <xs:complexType mixed="true"> <xs:sequence minOccurs="0"> <xs:element name="Items"> <xs:complexType> <xs:sequence> <xs:element name="Item"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="type" type="xs:string" use="required" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="type" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="type" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
xml
xsd
null
null
null
null
open
What xsd will let an element have itself as a sub element infinitely? === How can I create an xsd to give me this type of xml structure that can go on infinitely? <?xml version="1.0" encoding="utf-8" ?> <SampleXml> <Items> <Item name="SomeName" type="string"> This would be the value </Item> <Item name="SecondName" type="string"> This is the next string </Item> <Item name="AnotherName" type="list"> <Items> <Item name="SubName" type="string"> A string in a sub list </Item> <Item name="SubSubName" type="list"> <Items> <Item name="HowDoI" type="string"> How do I keep this going infinately? </Item> </Items> </Item> </Items> </Item> </Items> </SampleXml> The only solution I have found has been to just repeat in the xsd as many times as I am willing to copy. Like below. <?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="SampleXml"> <xs:complexType> <xs:sequence> <xs:element name="Items"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Item"> <xs:complexType mixed="true"> <xs:sequence minOccurs="0"> <xs:element name="Items"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Item"> <xs:complexType mixed="true"> <xs:sequence minOccurs="0"> <xs:element name="Items"> <xs:complexType> <xs:sequence> <xs:element name="Item"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="type" type="xs:string" use="required" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="type" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="type" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
0
5,718,487
04/19/2011 15:02:37
706,295
04/13/2011 15:04:05
20
2
ivy or maven? which one to use?
which one is better? Ant-IVY or Maven?.
maven-2
ant
maven
ivy
null
04/19/2011 15:44:57
not constructive
ivy or maven? which one to use? === which one is better? Ant-IVY or Maven?.
4
7,245,062
08/30/2011 14:44:44
912,443
08/25/2011 15:23:05
36
3
PHP, Server-Side Validation, NFL, XML Parsing, Conditional
I have a form that has 17 input fields (all are radio buttons with about 30 options each)... So technically, it seems like an even, much longer form than it really is. The form is actually the upcoming 2011 NFL schedule... I have gone through and done several jQuery things to make the form user-friendly, easy to look at, and basic validation. I should also mention, this schedule and all the information it encompasses has been fed through with SimpleXML and PHP. In other words, I have all of the data in an XML document. Also a noteworthy point, this will eventually need to be tied in with a mySQL database table I have created that keeps track of user's picks. You can see what it looks like here: http://www.thesportinghub.com/lms/make-my-picks Essentially what this form should do (after someone hits submit): 1.) Return an error message if the same team is picked twice. (I want the user to only be able to select a team once throughout all 17 weeks). 2.) Return an error message if a team has been selected after the scheduled time (in EST). 3.) If the user has passed those two aforementioned validations, it will take the current time they hit submit and all of the information and shoot it into a database that can be recalled later. So what is my problem? I need help getting started on this. My logic is there I think... does it seem practical? What do you think I will need to do to make all of this validation work with the XML? My bullet point #1 seems fairly easy... It is #2 (comparing the time submitted vs. Time the game starts from the XML document WHERE the team is selected) that seems complex. I am willing to provide any snippets of code and details regarding what I am trying to build. Any and all help is appreciated! Thanks! Chris
php
xml
validation
foreach
conditional
08/30/2011 21:46:09
not constructive
PHP, Server-Side Validation, NFL, XML Parsing, Conditional === I have a form that has 17 input fields (all are radio buttons with about 30 options each)... So technically, it seems like an even, much longer form than it really is. The form is actually the upcoming 2011 NFL schedule... I have gone through and done several jQuery things to make the form user-friendly, easy to look at, and basic validation. I should also mention, this schedule and all the information it encompasses has been fed through with SimpleXML and PHP. In other words, I have all of the data in an XML document. Also a noteworthy point, this will eventually need to be tied in with a mySQL database table I have created that keeps track of user's picks. You can see what it looks like here: http://www.thesportinghub.com/lms/make-my-picks Essentially what this form should do (after someone hits submit): 1.) Return an error message if the same team is picked twice. (I want the user to only be able to select a team once throughout all 17 weeks). 2.) Return an error message if a team has been selected after the scheduled time (in EST). 3.) If the user has passed those two aforementioned validations, it will take the current time they hit submit and all of the information and shoot it into a database that can be recalled later. So what is my problem? I need help getting started on this. My logic is there I think... does it seem practical? What do you think I will need to do to make all of this validation work with the XML? My bullet point #1 seems fairly easy... It is #2 (comparing the time submitted vs. Time the game starts from the XML document WHERE the team is selected) that seems complex. I am willing to provide any snippets of code and details regarding what I am trying to build. Any and all help is appreciated! Thanks! Chris
4
11,506,869
07/16/2012 14:52:47
1,211,429
02/15/2012 13:29:47
1,468
75
ExtJS Panel always "in front" / always "on top"
Scenario description: I have a border layout with an ExtJS container containing one-to-many windows an a panel (acting as a Taskbar). I want the taskbar to be *always on top*. If a Window is *active* and consequently *in front*, calling [toFront](http://docs.sencha.com/ext-js/4-1/#!/api/Ext.panel.Panel-method-toFront) does not put it in front as expected. The ExtJS [Windows](http://docs.sencha.com/ext-js/4-1/#!/api/Ext.window.Window) which remain in front is within the `center` area of the [Border layout](http://docs.sencha.com/ext-js/4-1/#!/api/Ext.layout.container.Border), whereas the panel acting as taskbar is within the `south` area, as follows: items: [ { xtype: 'maincontainer', id:'maincontainer', region : 'center' }, { xtype: 'launchpanel', id:'launchpanel', region: 'south', collapsible : true, } ], where `maincontainer` and `launchpanel` extend `Ext.container.Container` and `Ext.panel.Panel` respectively. This code is within the main container which is the only item in the ExtJS MVC application's `Viewport`. **How do I get the `launchpanel` to be always in front / on top?**
javascript
extjs
extjs4
extjs4.1
null
null
open
ExtJS Panel always "in front" / always "on top" === Scenario description: I have a border layout with an ExtJS container containing one-to-many windows an a panel (acting as a Taskbar). I want the taskbar to be *always on top*. If a Window is *active* and consequently *in front*, calling [toFront](http://docs.sencha.com/ext-js/4-1/#!/api/Ext.panel.Panel-method-toFront) does not put it in front as expected. The ExtJS [Windows](http://docs.sencha.com/ext-js/4-1/#!/api/Ext.window.Window) which remain in front is within the `center` area of the [Border layout](http://docs.sencha.com/ext-js/4-1/#!/api/Ext.layout.container.Border), whereas the panel acting as taskbar is within the `south` area, as follows: items: [ { xtype: 'maincontainer', id:'maincontainer', region : 'center' }, { xtype: 'launchpanel', id:'launchpanel', region: 'south', collapsible : true, } ], where `maincontainer` and `launchpanel` extend `Ext.container.Container` and `Ext.panel.Panel` respectively. This code is within the main container which is the only item in the ExtJS MVC application's `Viewport`. **How do I get the `launchpanel` to be always in front / on top?**
0
3,680,481
09/09/2010 20:50:06
443,829
09/09/2010 20:50:05
1
0
programmatically executing and terminating a long-running batch process in python
I have been searching for a way to start and terminate a long-running "batch jobs" in python. Right now I'm using "os.system()" to launch a long-running batch job inside each child process. As you might have guessed, "os.system()" spawns a new process inside that child process (grandchild process?), so I cannot kill the batch job from the grand-parent process. To provide some visualization of what I have just described: Main (grandparent) process, with PID = AAAA | |------> child process with PID = BBBB | |------> os.system("some long-running batch file) [grandchild process, with PID = CCCC] So, my problem is I cannot kill the grandchild process from the grandparent... My question is, is there a way to start a long-running batch job inside a child process, and being able to kill that batch job by just terminating the child process? What are the alternatives to os.system() that I can use so that I can kill the batch-job from the main process ? Thanks !!
python
operating-system
batch-file
subprocess
multiprocessing
null
open
programmatically executing and terminating a long-running batch process in python === I have been searching for a way to start and terminate a long-running "batch jobs" in python. Right now I'm using "os.system()" to launch a long-running batch job inside each child process. As you might have guessed, "os.system()" spawns a new process inside that child process (grandchild process?), so I cannot kill the batch job from the grand-parent process. To provide some visualization of what I have just described: Main (grandparent) process, with PID = AAAA | |------> child process with PID = BBBB | |------> os.system("some long-running batch file) [grandchild process, with PID = CCCC] So, my problem is I cannot kill the grandchild process from the grandparent... My question is, is there a way to start a long-running batch job inside a child process, and being able to kill that batch job by just terminating the child process? What are the alternatives to os.system() that I can use so that I can kill the batch-job from the main process ? Thanks !!
0
4,071,811
11/01/2010 18:19:05
89,244
04/09/2009 20:45:09
142
2
How to transform vertical data into horizontal data with SQL?
I have a table "Item" with a number of related items, like so: ID Rel_ID Name --- ------ ---- 1 1 foo 2 1 bar 3 1 zam 4 2 foo2 I'm trying to get a query so items with the same Rel_ID would appear in the same row, like so: Rel_ID Name1 Name2 Name3 ------ ----- ----- ----- 1 foo bar zam 2 foo2 I've tried selecting the table multiple times: SELECT k.Rel_ID, k.name 'Name1', k2.name 'Name2' FROM item k, item k2 WHERE k.Rel_ID = k2.Rel_ID But this fails. Surely there's a transformation or query that could drastically simplify the process, and I'm just missing it because I haven't used SQL in this way before. What am I missing?
sql
mysql
null
null
null
null
open
How to transform vertical data into horizontal data with SQL? === I have a table "Item" with a number of related items, like so: ID Rel_ID Name --- ------ ---- 1 1 foo 2 1 bar 3 1 zam 4 2 foo2 I'm trying to get a query so items with the same Rel_ID would appear in the same row, like so: Rel_ID Name1 Name2 Name3 ------ ----- ----- ----- 1 foo bar zam 2 foo2 I've tried selecting the table multiple times: SELECT k.Rel_ID, k.name 'Name1', k2.name 'Name2' FROM item k, item k2 WHERE k.Rel_ID = k2.Rel_ID But this fails. Surely there's a transformation or query that could drastically simplify the process, and I'm just missing it because I haven't used SQL in this way before. What am I missing?
0
5,267,888
03/11/2011 01:03:58
121,196
06/11/2009 09:33:59
955
6
hibernate change database dynamically for maintenance
I have a java webapp using hibernate over MYSQL db. I need at least an hour of data maintenance daily, hence I need to bring down the db and switch to the backup db. <br/> I don't see an elegant way to switch to another db from my app using hibernate. Is there? <br/> Other totally different ways for database maintenance is welcome.
mysql
database
hibernate
null
null
null
open
hibernate change database dynamically for maintenance === I have a java webapp using hibernate over MYSQL db. I need at least an hour of data maintenance daily, hence I need to bring down the db and switch to the backup db. <br/> I don't see an elegant way to switch to another db from my app using hibernate. Is there? <br/> Other totally different ways for database maintenance is welcome.
0
9,522,002
03/01/2012 18:40:15
942,528
09/13/2011 12:28:52
7
0
Rebol programming language is dead?
I mean Rebol programming language. There is not any updates since February of 2011 year. Where I can read about it's status?
rebol
null
null
null
null
03/01/2012 22:16:11
not constructive
Rebol programming language is dead? === I mean Rebol programming language. There is not any updates since February of 2011 year. Where I can read about it's status?
4
9,370,813
02/21/2012 01:14:59
938,716
09/11/2011 00:29:43
3
0
Read/write example codes for TPipeServer and TPipeClient components
I need IPC between a windows service and a GUI application both written in **Delphi 2010**. I decided to use named pipe for this. I built and installed successfully Russell Libby's TPipeServer and TPipeClient components ([link](http://stackoverflow.com/questions/5132894/russell-libbys-pipes-components)). I followed other answers like [this](http://stackoverflow.com/questions/512366/how-do-i-send-a-string-from-one-instance-of-my-delphi-program-to-another). But my service received only empty messages from the client. After many test I concluded that I was using those components erroneously, so i don't want to post any code here. So I'm looking for a valid example about how these components work in order to **write/read** strings in a named pipe (from client to server and viceversa). Any help is really appreciated, even using other free named pipes components or source codes. Thank you.
delphi
windows-services
ipc
delphi-2010
named-pipes
null
open
Read/write example codes for TPipeServer and TPipeClient components === I need IPC between a windows service and a GUI application both written in **Delphi 2010**. I decided to use named pipe for this. I built and installed successfully Russell Libby's TPipeServer and TPipeClient components ([link](http://stackoverflow.com/questions/5132894/russell-libbys-pipes-components)). I followed other answers like [this](http://stackoverflow.com/questions/512366/how-do-i-send-a-string-from-one-instance-of-my-delphi-program-to-another). But my service received only empty messages from the client. After many test I concluded that I was using those components erroneously, so i don't want to post any code here. So I'm looking for a valid example about how these components work in order to **write/read** strings in a named pipe (from client to server and viceversa). Any help is really appreciated, even using other free named pipes components or source codes. Thank you.
0
8,322,150
11/30/2011 06:48:11
823,117
06/30/2011 13:20:30
6
1
Is there any way to use operator overloading in dynamic C++ object
I want to use operator overloading with dynamic object in C++ how can i do it?
c++
dynamic
operators
operator-overloading
overloading
03/22/2012 00:27:06
not a real question
Is there any way to use operator overloading in dynamic C++ object === I want to use operator overloading with dynamic object in C++ how can i do it?
1
9,533,976
03/02/2012 13:18:39
833,890
07/07/2011 15:51:25
4,847
186
List only files that are unencrypted
First off, I am not a Unix expert by any stretch, so please forgive a little naiveity in my question. I have a requirement to list the unencrypted files in a given directory that potentially contains both encryped and unencrypted files. I cannot reliably identify these files by file extension alone and was hoping someone in the SO community might be able to help me out. I can run: files * | egrep -w 'text|XML' but that will only identify the files that are either text or XML. I could possibly use this if I can't do much better as currently the only other files in the directry are text or XML files but I really wanted to identify all unencrypted files whatever type they may be. Is this possible in a single line command?
shell
unix
solaris
sh
null
null
open
List only files that are unencrypted === First off, I am not a Unix expert by any stretch, so please forgive a little naiveity in my question. I have a requirement to list the unencrypted files in a given directory that potentially contains both encryped and unencrypted files. I cannot reliably identify these files by file extension alone and was hoping someone in the SO community might be able to help me out. I can run: files * | egrep -w 'text|XML' but that will only identify the files that are either text or XML. I could possibly use this if I can't do much better as currently the only other files in the directry are text or XML files but I really wanted to identify all unencrypted files whatever type they may be. Is this possible in a single line command?
0
1,740,282
11/16/2009 05:43:13
139,868
07/17/2009 02:00:39
1
0
Having trouble with uploading in php
I'm a very new programmer going through the O'Reilly book Learning PHP & MySQL 2nd ed. by Michele Davis & Jon Phillips. This is being stored on my home ubuntu server. I'm stuck on ex 11-28 where they want me to upload a picture and move it from tmp to an uploads folder if it meets certain conditions: file size, type, and whether or not it was uploaded. The code is at the link below but with .txt instead of .php. Having a hard time getting it to show up. [The form is here.][2] When I hit the submit button w/o there being a file in the file box, I get the following warning: `Warning: unlink() [function.unlink]: No such file or directory in /home/luna/public_html/learn_php/up_urs.php on line 10` When I submit a file bigger than maxsize I get my error msg: Error. File must be less than 28480 bytes. When I submit a file of the wrong type I get my error msg: You may only upload .gif & .jpg files. When I submit a file that's the right type & size I get the following warning and my OK msg: `Warning: move_uploaded_file(learn_php/uploads/) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/luna/public_html/learn_php/up_urs.php on line 21` `Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php4Mhykl' to 'learn_php/uploads/' in /home/luna/public_html/learn_php/up_urs.php on line 21 Thanks for your upload.` I thought the problem was with permissions but changing the directory learn_php to 777 made no difference so I changed it back to 755. Then I tried changing the path from "uploads" to `"/home/luna/public_html/learn_php/uploads"` & that didn't fix it. I tried to use getcwd() before & after the unlink & `move_uploaded_file` commands but that only told me I was in `learn_php...` I tried uncommenting the `//print_r($_FILES);` but that didn't show me anything after pressing submit. Not sure what to look for now. Thanks for any help :) [1]: http://lunaz.homelinux.net/learn_php/up_urs.txt [2]: http://lunaz.homelinux.net/learn_php/up_urs.php
php
oreilly-book
null
null
null
null
open
Having trouble with uploading in php === I'm a very new programmer going through the O'Reilly book Learning PHP & MySQL 2nd ed. by Michele Davis & Jon Phillips. This is being stored on my home ubuntu server. I'm stuck on ex 11-28 where they want me to upload a picture and move it from tmp to an uploads folder if it meets certain conditions: file size, type, and whether or not it was uploaded. The code is at the link below but with .txt instead of .php. Having a hard time getting it to show up. [The form is here.][2] When I hit the submit button w/o there being a file in the file box, I get the following warning: `Warning: unlink() [function.unlink]: No such file or directory in /home/luna/public_html/learn_php/up_urs.php on line 10` When I submit a file bigger than maxsize I get my error msg: Error. File must be less than 28480 bytes. When I submit a file of the wrong type I get my error msg: You may only upload .gif & .jpg files. When I submit a file that's the right type & size I get the following warning and my OK msg: `Warning: move_uploaded_file(learn_php/uploads/) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/luna/public_html/learn_php/up_urs.php on line 21` `Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php4Mhykl' to 'learn_php/uploads/' in /home/luna/public_html/learn_php/up_urs.php on line 21 Thanks for your upload.` I thought the problem was with permissions but changing the directory learn_php to 777 made no difference so I changed it back to 755. Then I tried changing the path from "uploads" to `"/home/luna/public_html/learn_php/uploads"` & that didn't fix it. I tried to use getcwd() before & after the unlink & `move_uploaded_file` commands but that only told me I was in `learn_php...` I tried uncommenting the `//print_r($_FILES);` but that didn't show me anything after pressing submit. Not sure what to look for now. Thanks for any help :) [1]: http://lunaz.homelinux.net/learn_php/up_urs.txt [2]: http://lunaz.homelinux.net/learn_php/up_urs.php
0
8,651,383
12/28/2011 02:59:49
1,118,051
12/27/2011 17:39:20
1
0
Why does OpenStreetMaps load much slower compared to Google Maps
This occurs for zooming in and zooming out. Is there a way to speed up the loading of (openstreetmap) OSM map images up to Google Maps speed?
google-maps
google
maps
null
null
12/30/2011 04:14:57
not a real question
Why does OpenStreetMaps load much slower compared to Google Maps === This occurs for zooming in and zooming out. Is there a way to speed up the loading of (openstreetmap) OSM map images up to Google Maps speed?
1
528,235
02/09/2009 14:02:09
12,318
09/16/2008 13:58:03
114
17
Backup and Restore SSP on MOSS 2007 fails due to missing .mdf files
I've used the central admin backup facility to backup our Shared Services Provider. The backup location was a drive on a new server. I then try to restore the SSP via central admin on the new server. It fails with an error relating to the fact that it cant find the .mdf files that it requires. It is looking in the location that they were on the original server. Does the backup not take care of moving these .mdf files as part of the backup restore process? Would appreciate anyone's suggestions.
sharepoint
moss
backup
restore
null
null
open
Backup and Restore SSP on MOSS 2007 fails due to missing .mdf files === I've used the central admin backup facility to backup our Shared Services Provider. The backup location was a drive on a new server. I then try to restore the SSP via central admin on the new server. It fails with an error relating to the fact that it cant find the .mdf files that it requires. It is looking in the location that they were on the original server. Does the backup not take care of moving these .mdf files as part of the backup restore process? Would appreciate anyone's suggestions.
0
1,302,622
08/19/2009 21:05:18
61,217
02/01/2009 15:51:25
58
2
To Host Silverlight Application on a Classic ASP page
Is it possible to host a silverlight application on a classic asp page? I see examples where the silverlight application is hosted on a html page, and I do understand that Silverlight is a client side language, but since I need to pass data from the page to the silverlight application, I am not too sure what to do. PS: the silverlight application is also database driven, so it will be connected to the database, and I have searched Google and nothing found, only be able to find Silverlight with ASP.net. Can anyone help me? Thanks
silverlight
asp-classic
asp.net
c#
database
null
open
To Host Silverlight Application on a Classic ASP page === Is it possible to host a silverlight application on a classic asp page? I see examples where the silverlight application is hosted on a html page, and I do understand that Silverlight is a client side language, but since I need to pass data from the page to the silverlight application, I am not too sure what to do. PS: the silverlight application is also database driven, so it will be connected to the database, and I have searched Google and nothing found, only be able to find Silverlight with ASP.net. Can anyone help me? Thanks
0
10,290,967
04/24/2012 02:23:25
1,352,645
04/24/2012 02:03:19
1
0
Python - Pseudo 3D pong (written in 2d)
I'm working on writing a pseudo-3d pong game that involves a 2d paddle and ball bouncing in a "3d" corridor. I say pseudo because the game is actually a 2d window and I'm just using shaded rectangles to give the appearance that it is "moving into the screen." I'm having a lot of difficulty wrapping my head around writing the algorithms that would make the ball collide along walls (that aren't actually there). I am thinking that I need to make the ball's radius and the x and y bounds a function of the z-dimension but I'm not sure where to begin. I am looking to call all of my collision functions in a timerFired function so that the position, bounds, and speed are constantly being readjusted. def timerFired(): delay = 25 # milliseconds canvas.after(delay, timerFired) # pause, then call timerFired again Any online resources, tutorials, or example algorithms would be a lot of help. Below is a link to my current game screen, to better understand the concept. Thanks. http://i.stack.imgur.com/M0Vhs.png
3d
tkinter
pong
collisions
null
04/26/2012 11:54:54
not a real question
Python - Pseudo 3D pong (written in 2d) === I'm working on writing a pseudo-3d pong game that involves a 2d paddle and ball bouncing in a "3d" corridor. I say pseudo because the game is actually a 2d window and I'm just using shaded rectangles to give the appearance that it is "moving into the screen." I'm having a lot of difficulty wrapping my head around writing the algorithms that would make the ball collide along walls (that aren't actually there). I am thinking that I need to make the ball's radius and the x and y bounds a function of the z-dimension but I'm not sure where to begin. I am looking to call all of my collision functions in a timerFired function so that the position, bounds, and speed are constantly being readjusted. def timerFired(): delay = 25 # milliseconds canvas.after(delay, timerFired) # pause, then call timerFired again Any online resources, tutorials, or example algorithms would be a lot of help. Below is a link to my current game screen, to better understand the concept. Thanks. http://i.stack.imgur.com/M0Vhs.png
1
10,543,359
05/10/2012 23:09:38
1,309,066
04/02/2012 21:16:18
55
1
Specifying :class of embedded ruby form
If I would like to assign a class to my embedded ruby form, like so?: <%= form_for(User.new) do |f|, :class => "form-horizontal" %> How could I go about doing it? I keep getting a syntax error. Thanks!
ruby-on-rails-3
null
null
null
null
null
open
Specifying :class of embedded ruby form === If I would like to assign a class to my embedded ruby form, like so?: <%= form_for(User.new) do |f|, :class => "form-horizontal" %> How could I go about doing it? I keep getting a syntax error. Thanks!
0
3,970,779
10/19/2010 17:02:39
427,393
08/22/2010 02:08:25
17
0
Social Search Algorithms
The question is oriented towards a research that I have been conducting since 3 months. What are the social search engines available currently (if any)? What is the future of semantic + social(collective) intelligence collection/distribution engines?
algorithm
search-engine
social-networking
null
null
10/21/2010 01:15:09
off topic
Social Search Algorithms === The question is oriented towards a research that I have been conducting since 3 months. What are the social search engines available currently (if any)? What is the future of semantic + social(collective) intelligence collection/distribution engines?
2
7,802,747
10/18/2011 05:23:02
919,186
08/30/2011 07:24:41
14
0
How to Make graph visualiztion in iphone?
i want to show my social network friends as nodes and branches like this [Graph][1]. With images of friends in inside node circle. How to achieve this in iPhone. Thanks [1]: http://raphaeljs.com/graffle.html
javascript
iphone
treenode
null
null
10/18/2011 17:47:21
not a real question
How to Make graph visualiztion in iphone? === i want to show my social network friends as nodes and branches like this [Graph][1]. With images of friends in inside node circle. How to achieve this in iPhone. Thanks [1]: http://raphaeljs.com/graffle.html
1
2,037,135
01/10/2010 13:36:07
205,463
11/07/2009 06:43:09
46
0
how to fulfill a parameter that passed by reference in c++?
I've created a method which is accept parameter by reference like following : void Func1(QList<int> *a){ (*a) << getDataFromAnotherFunction(); //or (*a).append(getDataFromAnotherFunction()); } QList<int> getDataFromAnotherFunction(){ //we will do something good over here return QList<int> } but the problme is when I want to use the a's data there is no data in it. and it says 0; say I want to count the element in it like following : //for passing a to func1 I use something like that //QList a; //func(&a); //after retruning from func1 now I want to use the result like below : a.size(); //but the answer is 0 how should I pass my parameter to get the correct data? regards.
c++
parameters
null
null
null
null
open
how to fulfill a parameter that passed by reference in c++? === I've created a method which is accept parameter by reference like following : void Func1(QList<int> *a){ (*a) << getDataFromAnotherFunction(); //or (*a).append(getDataFromAnotherFunction()); } QList<int> getDataFromAnotherFunction(){ //we will do something good over here return QList<int> } but the problme is when I want to use the a's data there is no data in it. and it says 0; say I want to count the element in it like following : //for passing a to func1 I use something like that //QList a; //func(&a); //after retruning from func1 now I want to use the result like below : a.size(); //but the answer is 0 how should I pass my parameter to get the correct data? regards.
0
4,256,562
11/23/2010 13:39:55
484,482
10/22/2010 17:14:17
1
0
LINQ with joins and a List<GUI>
Here's the SQL that I used to prototype the LINQ statement. The GUID's in code are List<GUID>. I tried for 3 hours and just don't get it. Could some kind sole who can write LINQ in their sleep help me out. TIA, George SELECT DISTINCT [id] ,[emailAddress] ,[name] ,[emailRunNumber] FROM [emailAddress] join promotionsJoin on promotionsJoin.EmailAddressId = emailAddress.id where promotionsJoin.promotionId in ('09464b57-f3d7-41ec-b0b1-cbc5999824bd', '8bc855b2-2f01-4083-b43a-dab7b7a81ac8') AND emailRunNumber is NULL
linq
linq-to-entities
null
null
null
null
open
LINQ with joins and a List<GUI> === Here's the SQL that I used to prototype the LINQ statement. The GUID's in code are List<GUID>. I tried for 3 hours and just don't get it. Could some kind sole who can write LINQ in their sleep help me out. TIA, George SELECT DISTINCT [id] ,[emailAddress] ,[name] ,[emailRunNumber] FROM [emailAddress] join promotionsJoin on promotionsJoin.EmailAddressId = emailAddress.id where promotionsJoin.promotionId in ('09464b57-f3d7-41ec-b0b1-cbc5999824bd', '8bc855b2-2f01-4083-b43a-dab7b7a81ac8') AND emailRunNumber is NULL
0
10,873,467
06/03/2012 19:54:39
1,431,367
06/01/2012 18:24:12
13
1
PRIME GENERATOR
I was trying to generate prime numbers between 2 given nnumbers m & n (m-n<=100000). t is the number of test cases n and m both are less than or equal to 10^9. when i gave small input i.e m=1,n=100000 it gives correct results but if i take m=999900001 and n=10^9 it just prints all the numbers from m to n. i am unable to debug my code Please help #include<stdio.h> #include<math.h> int main() { long long int a[31623],c[3401]; int t; long long int b[100002][2],k,l,m,n,p; long int i,j; a[0]=0; a[1]=0; for(i=2;i<=31622;i++) a[i]=1; for(i=2;i<=15811;i++) { if(a[i]==1) for(j=2;(i*j)<=31622;j++) { p=i*j; a[p]=0; } } p=0; for(i=2;i<=31622;i++) { if (a[i]==1) { c[p]=i; p++; } } scanf("%d",&t); while(t--) { p=0; scanf("%lld%lld",&m,&n); for(i=0,k=m;i<=(n-m) && k<=n;i++,k++) { b[i][0]=k; b[i][1]=1; } for(i=0;i<n-m;i++) { if( b[i][0]!=0 && b[i][0]!=1) for(j=0;j<3401 && ((i+m)*c[j])<=n;j++) { p=((i+m)*c[j])-m; b[p][1]=0; } } for(i=0;i<=n-m;i++) if(b[i][1]!=0 && b[i][0]!=0 && b[i][0]!=1) printf("%lld\n",b[i][0]); printf("\n"); } return 0; } i think that my code is correct every where except the loop for(i=0;i<n-m;i++) { if( b[i][0]!=0 && b[i][0]!=1) for(j=0;j<3401 && ((i+m)*c[j])<=n;j++) { p=((i+m)*c[j])-m; b[p][1]=0; } }
c
numbers
primes
null
null
06/05/2012 13:03:32
not a real question
PRIME GENERATOR === I was trying to generate prime numbers between 2 given nnumbers m & n (m-n<=100000). t is the number of test cases n and m both are less than or equal to 10^9. when i gave small input i.e m=1,n=100000 it gives correct results but if i take m=999900001 and n=10^9 it just prints all the numbers from m to n. i am unable to debug my code Please help #include<stdio.h> #include<math.h> int main() { long long int a[31623],c[3401]; int t; long long int b[100002][2],k,l,m,n,p; long int i,j; a[0]=0; a[1]=0; for(i=2;i<=31622;i++) a[i]=1; for(i=2;i<=15811;i++) { if(a[i]==1) for(j=2;(i*j)<=31622;j++) { p=i*j; a[p]=0; } } p=0; for(i=2;i<=31622;i++) { if (a[i]==1) { c[p]=i; p++; } } scanf("%d",&t); while(t--) { p=0; scanf("%lld%lld",&m,&n); for(i=0,k=m;i<=(n-m) && k<=n;i++,k++) { b[i][0]=k; b[i][1]=1; } for(i=0;i<n-m;i++) { if( b[i][0]!=0 && b[i][0]!=1) for(j=0;j<3401 && ((i+m)*c[j])<=n;j++) { p=((i+m)*c[j])-m; b[p][1]=0; } } for(i=0;i<=n-m;i++) if(b[i][1]!=0 && b[i][0]!=0 && b[i][0]!=1) printf("%lld\n",b[i][0]); printf("\n"); } return 0; } i think that my code is correct every where except the loop for(i=0;i<n-m;i++) { if( b[i][0]!=0 && b[i][0]!=1) for(j=0;j<3401 && ((i+m)*c[j])<=n;j++) { p=((i+m)*c[j])-m; b[p][1]=0; } }
1
9,442,447
02/25/2012 08:14:22
1,190,122
02/05/2012 02:30:10
57
0
return empty " "
I am new in java and I am working on an assignment and one of the instructions is this: /** Gets the first letter in this puzzle. @return the first letter, or "" if there are no letters. */ I am not sure how to return "". Is it just like, return ""; ?? Thank you
java
return
null
null
null
02/25/2012 16:53:59
too localized
return empty " " === I am new in java and I am working on an assignment and one of the instructions is this: /** Gets the first letter in this puzzle. @return the first letter, or "" if there are no letters. */ I am not sure how to return "". Is it just like, return ""; ?? Thank you
3
5,062,008
02/21/2011 03:35:10
625,654
02/20/2011 21:13:44
1
0
I need help with python 1
# You wrote the following code to add up the contents of a list, # however the code is currently only returning the first value in the # list. Identify and correct the erroneous line. Write one or two # sentences that describe the problem def sumlist(inputlist): listsum =0 for item in inputlist: listsum = listsum + item return listsum # YOUR DESCRIPTION OF THE PROBLEM (in a comment)
python
null
null
null
null
02/21/2011 03:39:53
not a real question
I need help with python 1 === # You wrote the following code to add up the contents of a list, # however the code is currently only returning the first value in the # list. Identify and correct the erroneous line. Write one or two # sentences that describe the problem def sumlist(inputlist): listsum =0 for item in inputlist: listsum = listsum + item return listsum # YOUR DESCRIPTION OF THE PROBLEM (in a comment)
1
9,173,446
02/07/2012 09:00:33
1,194,215
02/07/2012 08:50:55
1
0
jQUery Slideshow
Can anyone help me to implement the following jQuery looped auto slideshow. The steps are as follows: 1.First fadeIn the slideshow image and after that fadein the caption background and lastly fadeIn the caption text. Thanks, Paul
jquery
null
null
null
null
02/08/2012 14:40:10
not a real question
jQUery Slideshow === Can anyone help me to implement the following jQuery looped auto slideshow. The steps are as follows: 1.First fadeIn the slideshow image and after that fadein the caption background and lastly fadeIn the caption text. Thanks, Paul
1
2,048,592
01/12/2010 11:42:23
246,935
01/09/2010 06:20:45
14
0
What is the most interesting SQL Question(TSQL Program included) that you encountered?
Actually I am a newbie in SQL SERVER(only 2 months as of now) and want to learn more and master over it in the upcoming days. So I have asked this question. I believe it will help peoples like me a lot to grow if we follow those that the experienced peoples here have faced or seen so far in their career. Also it will help us in our job or interview Thanks
sql
sql-server
tsql
null
null
01/12/2010 13:21:03
not constructive
What is the most interesting SQL Question(TSQL Program included) that you encountered? === Actually I am a newbie in SQL SERVER(only 2 months as of now) and want to learn more and master over it in the upcoming days. So I have asked this question. I believe it will help peoples like me a lot to grow if we follow those that the experienced peoples here have faced or seen so far in their career. Also it will help us in our job or interview Thanks
4
4,358,151
12/05/2010 09:24:58
120,888
06/10/2009 21:07:48
506
18
How Does the List<> Copy Construcor Function With ReadOnly Lists?
The <a href="http://msdn.microsoft.com/en-us/library/fkbw11z0.aspx">MSDN article</a> doesn't really describe this. List<MyObject> FirstList = new List<MyObject>(); // Add items to FirstList. List<MyObject> SecondList = new List<MyObject>(FirstList.AsReadOnly()); // Is SecondList a read-only collection?
c#
.net
list
collections
constructor
null
open
How Does the List<> Copy Construcor Function With ReadOnly Lists? === The <a href="http://msdn.microsoft.com/en-us/library/fkbw11z0.aspx">MSDN article</a> doesn't really describe this. List<MyObject> FirstList = new List<MyObject>(); // Add items to FirstList. List<MyObject> SecondList = new List<MyObject>(FirstList.AsReadOnly()); // Is SecondList a read-only collection?
0
10,279,400
04/23/2012 11:09:45
742,269
05/06/2011 18:09:55
28
0
Understanding a Python execution using 'top' in Ubuntu
When I'm executing a Python script. The following screen is what shows the 'top' command: ![enter image description here][1] [1]: http://i.stack.imgur.com/stqv5.png Tell me if I'm wrong or not: The screen shows that the Python script execution is taking one entire Core (%CPU: 100%), and the rest cores are using for others executions (actually sleepting)? I'm using a Macbook Pro 10.6 with Intel Core i5. Thnks in advance
python
null
null
null
null
04/23/2012 12:25:51
not a real question
Understanding a Python execution using 'top' in Ubuntu === When I'm executing a Python script. The following screen is what shows the 'top' command: ![enter image description here][1] [1]: http://i.stack.imgur.com/stqv5.png Tell me if I'm wrong or not: The screen shows that the Python script execution is taking one entire Core (%CPU: 100%), and the rest cores are using for others executions (actually sleepting)? I'm using a Macbook Pro 10.6 with Intel Core i5. Thnks in advance
1
10,398,235
05/01/2012 13:19:31
1,261,465
03/10/2012 19:54:30
1
0
Changing Singly Linked List arangemnet
For example i have singly linked list with some objects, this objects has 2 attributes which are age(**int**) and name(**string**). And this lists' objects arranged according to their names(**string**). How can change its order according to objects' age(**int**) **_without using any other linked list_**?
list
ordering
linked
null
null
05/03/2012 08:05:44
not a real question
Changing Singly Linked List arangemnet === For example i have singly linked list with some objects, this objects has 2 attributes which are age(**int**) and name(**string**). And this lists' objects arranged according to their names(**string**). How can change its order according to objects' age(**int**) **_without using any other linked list_**?
1
4,040,226
10/28/2010 06:03:43
94,815
04/23/2009 07:18:49
391
20
Shifting to Java
I'm a C/C++ developer. I am just intrigued why some of my colleagues are shifting to java. They actually have a lot to say why Java is better than C++. This is actually more of a trivial question, but I know for sure it would be a source of enlightenment for many also for novices like me. Knowing only C++ and a little of java, how do you think could you convince a C++ developer to shift to java? If not, why stick to c++? Any opinion is much appreciated.
java
c++
visual-c++
mfc
null
10/28/2010 06:22:58
not constructive
Shifting to Java === I'm a C/C++ developer. I am just intrigued why some of my colleagues are shifting to java. They actually have a lot to say why Java is better than C++. This is actually more of a trivial question, but I know for sure it would be a source of enlightenment for many also for novices like me. Knowing only C++ and a little of java, how do you think could you convince a C++ developer to shift to java? If not, why stick to c++? Any opinion is much appreciated.
4
2,331,636
02/25/2010 04:27:55
73,482
03/04/2009 02:03:12
414
32
real-word use of Mercurial with a Team Foundation Server?
My shop uses TFS & is generally happy with it with the exception of the lack of local repository commits/reverts. I'm starting to use Mercurial locally myself to help manage smaller chunks of changes, then posting them to TFS. I see that Subversion has a 'bridge' component to automagically enable this if the central VCS is Subversion. I have not found one for Team System. This encourages me that other folks have gone down this path with integrating DVCS with CVCS systems. (1) Does anyone know of one? I'm sort of doubting it (quick search didn't find anything). (2) **Is anyone using Mercurial/TFS in this manner?** If so, can you share your experiences. I'm particularly looking for any insights into what issues might come up that aren't obvious regarding commits to TFS after significant activity via Mercurial. It seems like a total win-win so far with just me using if for a few days--but I know enough then to think it's just that easy.
tfs
mercurial
null
null
null
null
open
real-word use of Mercurial with a Team Foundation Server? === My shop uses TFS & is generally happy with it with the exception of the lack of local repository commits/reverts. I'm starting to use Mercurial locally myself to help manage smaller chunks of changes, then posting them to TFS. I see that Subversion has a 'bridge' component to automagically enable this if the central VCS is Subversion. I have not found one for Team System. This encourages me that other folks have gone down this path with integrating DVCS with CVCS systems. (1) Does anyone know of one? I'm sort of doubting it (quick search didn't find anything). (2) **Is anyone using Mercurial/TFS in this manner?** If so, can you share your experiences. I'm particularly looking for any insights into what issues might come up that aren't obvious regarding commits to TFS after significant activity via Mercurial. It seems like a total win-win so far with just me using if for a few days--but I know enough then to think it's just that easy.
0
10,490,509
05/07/2012 23:27:31
1,368,949
05/02/2012 01:10:30
13
0
Garbage value being displayed while freeing a pointer in C
I am not sure why a garbage value is being thrown in the if loop when i try to free dataToWrite. It works fine in else loop. Can anyone help me with this? FILE *readFilePointer = NULL; Message_buf outputMsgBuffer; char fileData[PIPE_BUF]; char *dataToWrite=NULL; readFilePointer = fopen(fileToReadFrom, "r"); if (readFilePointer == NULL) { outputMsgBuffer.messageType=1; dataToWrite=(char *)malloc(strlen(strcat(fileToReadFrom," does not exists!!"))+1); memset(dataToWrite,0,strlen(dataToWrite)); dataToWrite=strcat(fileToReadFrom," does not exists!!"); strcat(outputMsgBuffer.messageText,dataToWrite); memset(dataToWrite,0,strlen(dataToWrite)+1); free(dataToWrite); } else { //outputMsgBuffer.messageText[0] = '\0'; while (fgets(fileData, sizeof(fileData), readFilePointer) != NULL) { dataToWrite=(char *)malloc(sizeof(fileData)); memset(dataToWrite,0,strlen(dataToWrite)); strcpy(dataToWrite,fileData); strcat(outputMsgBuffer.messageText,dataToWrite); free(dataToWrite); } fclose(readFilePointer); } outputMsgBuffer.messageType=1; outputMsgBuffer.messageLength=strlen(outputMsgBuffer.messageText); mesg_send(fd,&outputMsgBuffer); }
c
pointers
null
null
null
05/08/2012 07:31:06
too localized
Garbage value being displayed while freeing a pointer in C === I am not sure why a garbage value is being thrown in the if loop when i try to free dataToWrite. It works fine in else loop. Can anyone help me with this? FILE *readFilePointer = NULL; Message_buf outputMsgBuffer; char fileData[PIPE_BUF]; char *dataToWrite=NULL; readFilePointer = fopen(fileToReadFrom, "r"); if (readFilePointer == NULL) { outputMsgBuffer.messageType=1; dataToWrite=(char *)malloc(strlen(strcat(fileToReadFrom," does not exists!!"))+1); memset(dataToWrite,0,strlen(dataToWrite)); dataToWrite=strcat(fileToReadFrom," does not exists!!"); strcat(outputMsgBuffer.messageText,dataToWrite); memset(dataToWrite,0,strlen(dataToWrite)+1); free(dataToWrite); } else { //outputMsgBuffer.messageText[0] = '\0'; while (fgets(fileData, sizeof(fileData), readFilePointer) != NULL) { dataToWrite=(char *)malloc(sizeof(fileData)); memset(dataToWrite,0,strlen(dataToWrite)); strcpy(dataToWrite,fileData); strcat(outputMsgBuffer.messageText,dataToWrite); free(dataToWrite); } fclose(readFilePointer); } outputMsgBuffer.messageType=1; outputMsgBuffer.messageLength=strlen(outputMsgBuffer.messageText); mesg_send(fd,&outputMsgBuffer); }
3
6,036,502
05/17/2011 20:11:25
744,324
05/08/2011 23:11:19
6
0
Moss2007 working with drop down, show textboxes when option is selected
Currently working moss 2007, and having a issue with drop down. If a 3rd option in a drop down is selected then it should show three text boxes below. I know it has to be work with Jquery, but quite new to the jquery. So if any one could provide me code to above issue would be helpful! Regards SP.Developer
jquery
sharepoint2007
null
null
null
null
open
Moss2007 working with drop down, show textboxes when option is selected === Currently working moss 2007, and having a issue with drop down. If a 3rd option in a drop down is selected then it should show three text boxes below. I know it has to be work with Jquery, but quite new to the jquery. So if any one could provide me code to above issue would be helpful! Regards SP.Developer
0
7,274,448
09/01/2011 17:59:03
899,746
08/18/2011 01:55:37
1
0
SQL for grouping/compressing by time span for a report dynamically
How can I compress / aggregate / group a table with events dynamically over time. I have a table with values and time of occurrence. Something like this: 3 | 2011-02-16 23:21:05.250 2 | 2011-02-16 22:21:05.267 15 | 2011-02-16 22:21:05.155 I need to aggregate the values hourly starting from the first row (latest event). So in this example I want to end up with two rows. 5 15 So if a new value comes in: 6 | 2011-02-16 24:21:05.249 3 | 2011-02-16 23:21:05.250 2 | 2011-02-16 22:21:05.267 15 | 2011-02-16 22:21:05.155 If I would run that query again I end up with: 9 17 It should be easy to change the time span in the query. For example compress over the last 30 seconds. How can I do that in oracle and MS SQL?
sql
oracle
sql-server-2005
sql-server-2008
null
null
open
SQL for grouping/compressing by time span for a report dynamically === How can I compress / aggregate / group a table with events dynamically over time. I have a table with values and time of occurrence. Something like this: 3 | 2011-02-16 23:21:05.250 2 | 2011-02-16 22:21:05.267 15 | 2011-02-16 22:21:05.155 I need to aggregate the values hourly starting from the first row (latest event). So in this example I want to end up with two rows. 5 15 So if a new value comes in: 6 | 2011-02-16 24:21:05.249 3 | 2011-02-16 23:21:05.250 2 | 2011-02-16 22:21:05.267 15 | 2011-02-16 22:21:05.155 If I would run that query again I end up with: 9 17 It should be easy to change the time span in the query. For example compress over the last 30 seconds. How can I do that in oracle and MS SQL?
0
9,940,705
03/30/2012 09:53:01
440,823
09/06/2010 17:23:48
484
9
jquery validation function not working properly
I'm using Rails -3.2.1. In one of my form I'm using jquery validation. My form is below **new_account.html.erb** <%= form_for(@account, :url =>{:action=> "create_account"}) do |f| %> <table width="80%" border="1" align="center" cellpadding="5" cellspacing="5"> <tr> <td width="30%"> <%= f.label :Account_Name, :class => :style1_bold %> </td> <td> <%= f.text_field :account_name, :class => "input_border required ONLY_ALPHABET" %> </td> </tr> <tr> <td> &nbsp; </td> <td> </div> <div class="actions"> <%=f.submit "Add Account" %> <%= link_to "Cancel", home_path, :class=>"style2_link" %> </div> </td> </tr> </table> <% end %> **In application.js** //= require jquery //= require jquery_ujs // require_tree . //= require_directory . jQuery.noConflict(); jQuery(document).ready(function(){ ///////////////////////////////////////////// //// Validatior for only alphabet ///////////////////////////////////////////// jQuery.validator.addMethod("ONLY_ALPHABET",function(value,element){ return this.optional(element) || /^[a-zA-Z ]+$/.test(value); },"Only Alphabet is allowed"); ///////////////////////////////////////////// //// Validation for Create Account ///////////////////////////////////////////// jQuery("#new_account").validate( { rules: { account_account_name: { required: true, ONLY_ALPHABET: true, maxlength: 30 } }, messages: { account_account_name: { required: "Please fill category", ONLY_ALPHABET: "Only Alphabet is allowed", maxlength: "Not more than 30 characters" } } }); }); **On Form submit. It doesn't show my message instead it show jquery default messages.**<br ><br > I include this file **jquery.validate.min.js**
jquery
ruby-on-rails-3
jquery-validate
form-validation
null
null
open
jquery validation function not working properly === I'm using Rails -3.2.1. In one of my form I'm using jquery validation. My form is below **new_account.html.erb** <%= form_for(@account, :url =>{:action=> "create_account"}) do |f| %> <table width="80%" border="1" align="center" cellpadding="5" cellspacing="5"> <tr> <td width="30%"> <%= f.label :Account_Name, :class => :style1_bold %> </td> <td> <%= f.text_field :account_name, :class => "input_border required ONLY_ALPHABET" %> </td> </tr> <tr> <td> &nbsp; </td> <td> </div> <div class="actions"> <%=f.submit "Add Account" %> <%= link_to "Cancel", home_path, :class=>"style2_link" %> </div> </td> </tr> </table> <% end %> **In application.js** //= require jquery //= require jquery_ujs // require_tree . //= require_directory . jQuery.noConflict(); jQuery(document).ready(function(){ ///////////////////////////////////////////// //// Validatior for only alphabet ///////////////////////////////////////////// jQuery.validator.addMethod("ONLY_ALPHABET",function(value,element){ return this.optional(element) || /^[a-zA-Z ]+$/.test(value); },"Only Alphabet is allowed"); ///////////////////////////////////////////// //// Validation for Create Account ///////////////////////////////////////////// jQuery("#new_account").validate( { rules: { account_account_name: { required: true, ONLY_ALPHABET: true, maxlength: 30 } }, messages: { account_account_name: { required: "Please fill category", ONLY_ALPHABET: "Only Alphabet is allowed", maxlength: "Not more than 30 characters" } } }); }); **On Form submit. It doesn't show my message instead it show jquery default messages.**<br ><br > I include this file **jquery.validate.min.js**
0
7,657,607
10/05/2011 06:44:28
390,129
07/13/2010 05:44:22
151
0
document.getElementsByTagName('img') , how to only get png images?
I am trying to only get images with the png attribute from the dom, does anyone know how to this? Thanks in advance Regards
image
dom
null
null
null
null
open
document.getElementsByTagName('img') , how to only get png images? === I am trying to only get images with the png attribute from the dom, does anyone know how to this? Thanks in advance Regards
0
3,577,336
08/26/2010 16:39:30
113,197
05/27/2009 14:20:57
74
8
Does NSLog'ing something alter its retain count? Because I am slowly going insane here.
Further to this question: http://stackoverflow.com/questions/3576724/nsrunloop-is-receiving-a-strange-selector-possible-race-condition-tomfoolery - where it was discovered that a UIGestureRecognizer was being deallocated and then receiving a message, I printed out the address of one of my GRs in order to see if it was the one being reported by zombies. With the print message in the code, I can no longer cause the crash I was originally looking for. Removing the print message, it seems I can cause it again. Since we're dealing with a deallocation/retain/release problem, can anyone tell me if it's possible that printing out this object is causing it to be referenced, thus sparing it from deallocation? And if so, what does that tell me about my original problem? Too many release's? Release too early?
objective-c
nsthread
null
null
null
null
open
Does NSLog'ing something alter its retain count? Because I am slowly going insane here. === Further to this question: http://stackoverflow.com/questions/3576724/nsrunloop-is-receiving-a-strange-selector-possible-race-condition-tomfoolery - where it was discovered that a UIGestureRecognizer was being deallocated and then receiving a message, I printed out the address of one of my GRs in order to see if it was the one being reported by zombies. With the print message in the code, I can no longer cause the crash I was originally looking for. Removing the print message, it seems I can cause it again. Since we're dealing with a deallocation/retain/release problem, can anyone tell me if it's possible that printing out this object is causing it to be referenced, thus sparing it from deallocation? And if so, what does that tell me about my original problem? Too many release's? Release too early?
0
5,442,906
03/26/2011 14:21:56
637,146
02/28/2011 04:34:11
3
2
Dismiss dialog box within asynctask
So I want to dismiss my dialog box after I have completed my asynctask but eclipse tells me that it cannot be resolved. So I try to move it outside of the onCreate() activity so that the asynctask can see it, but the app forcecloses when it is ran. When I look at DDMS it tells me that "System services not available to activites before oncreate". Can someone help me out here. Thank you in advance. private class createUser extends AsyncTask<Void, Void, Integer> { int va = 0; ProgressDialog dialog = ProgressDialog.show(MainActivity.this, "", "Creating User...", true); Toast toast = Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT); @Override protected Integer doInBackground(Void... params) { // TODO Auto-generated method stub if (db.createUser(nameU.getText().toString(), userU.getText() .toString(), emailU.getText().toString(), passU.getText() .toString()) == false) { va = 0; } else { va = 1; } return va; } protected void onPreExecute() { dialog.show(); } protected void onPostExecute(Integer result) { dialog.dismiss(); if (result == 0) { toast.setText("User already exists!"); toast.show(); va = 0; } else { toast.setText("Success"); toast.show(); createU.dismiss(); //cannot be resolve va = 1; } }
android
null
null
null
null
03/27/2011 22:54:26
too localized
Dismiss dialog box within asynctask === So I want to dismiss my dialog box after I have completed my asynctask but eclipse tells me that it cannot be resolved. So I try to move it outside of the onCreate() activity so that the asynctask can see it, but the app forcecloses when it is ran. When I look at DDMS it tells me that "System services not available to activites before oncreate". Can someone help me out here. Thank you in advance. private class createUser extends AsyncTask<Void, Void, Integer> { int va = 0; ProgressDialog dialog = ProgressDialog.show(MainActivity.this, "", "Creating User...", true); Toast toast = Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT); @Override protected Integer doInBackground(Void... params) { // TODO Auto-generated method stub if (db.createUser(nameU.getText().toString(), userU.getText() .toString(), emailU.getText().toString(), passU.getText() .toString()) == false) { va = 0; } else { va = 1; } return va; } protected void onPreExecute() { dialog.show(); } protected void onPostExecute(Integer result) { dialog.dismiss(); if (result == 0) { toast.setText("User already exists!"); toast.show(); va = 0; } else { toast.setText("Success"); toast.show(); createU.dismiss(); //cannot be resolve va = 1; } }
3
4,675,520
01/13/2011 00:17:35
419,116
08/13/2010 02:35:12
2,048
34
How to localize syntax errors in Mathematica?
Is there a trick to localize syntax errors? I occasionally run into this situation when editing existing code. Here's a latest example, do you see an efficient way to find the error? (I found the error already, but not efficiently) http://yaroslavvb.com/upload/save/syntax-error.nb
mathematica
null
null
null
null
null
open
How to localize syntax errors in Mathematica? === Is there a trick to localize syntax errors? I occasionally run into this situation when editing existing code. Here's a latest example, do you see an efficient way to find the error? (I found the error already, but not efficiently) http://yaroslavvb.com/upload/save/syntax-error.nb
0
4,981,805
02/13/2011 01:14:42
336,578
05/09/2010 09:54:53
292
24
Scripting language for data structures
I need some scripting language to use it mainly for keeping data structures. Maybe I will use it for some logic, but not that's not my main goal. It should be easy to integrate with C++ and also easy to use. I want to use it to change parameters at run time for C++ classes. It will help me if it's cross platform because I want to use it on Win and Mac
scripting
null
null
null
null
02/13/2011 01:49:41
not a real question
Scripting language for data structures === I need some scripting language to use it mainly for keeping data structures. Maybe I will use it for some logic, but not that's not my main goal. It should be easy to integrate with C++ and also easy to use. I want to use it to change parameters at run time for C++ classes. It will help me if it's cross platform because I want to use it on Win and Mac
1
7,010,215
08/10/2011 11:41:27
345,936
05/20/2010 09:14:02
112
3
How to generate a QRCode in iphone programatically
Thanks in advance. How can i generate a QRCode in iphone using objective c programmatically.
iphone
null
null
null
null
08/10/2011 16:33:12
not a real question
How to generate a QRCode in iphone programatically === Thanks in advance. How can i generate a QRCode in iphone using objective c programmatically.
1
3,297,732
07/21/2010 09:12:36
397,731
07/21/2010 09:12:36
1
0
Data Warehousing in Real World ebook
Can anyone please tell me where to download the ebook, "Data Warehousing in Real World"? Or if you have one mail me to entertomypalace@gmail.com
data-mining
null
null
null
null
07/21/2010 10:22:32
off topic
Data Warehousing in Real World ebook === Can anyone please tell me where to download the ebook, "Data Warehousing in Real World"? Or if you have one mail me to entertomypalace@gmail.com
2
10,828,158
05/31/2012 05:57:32
1,328,911
04/12/2012 11:04:27
3
0
Extending the expiration of existing token
I want to extend my existing token. I am trying to get an extended access token. In the FB docs, https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=fb_exchange_token&fb_exchange_token=EXISTING_ACCESS_TOKEN But I got same access_token without time extended. How to extend my existing token?
authentication
facebook-graph-api
null
null
null
null
open
Extending the expiration of existing token === I want to extend my existing token. I am trying to get an extended access token. In the FB docs, https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=fb_exchange_token&fb_exchange_token=EXISTING_ACCESS_TOKEN But I got same access_token without time extended. How to extend my existing token?
0
7,153,501
08/22/2011 20:55:35
781,794
06/02/2011 20:14:07
77
5
Android: Send data over GSM radio
I just got a nexus S android device. I was wondering if I can send data over its GSM radio? if possible, how do you do it?
android
gsm
android-networking
null
null
08/22/2011 22:22:32
not a real question
Android: Send data over GSM radio === I just got a nexus S android device. I was wondering if I can send data over its GSM radio? if possible, how do you do it?
1
3,132,526
06/28/2010 12:58:54
378,041
06/28/2010 12:58:54
1
0
events not related to current month
I'm having an issue here and wanted to know if anyone have any idea of how to accomplish this. The best example is here http://arshaw.com/fullcalendar/ if you look at the calendar, notice the last event "4p Repeating Event" lands on "Friday, July 2nd" but shows in June. Is there a way to get rid of this for June?
fullcalendar
null
null
null
null
null
open
events not related to current month === I'm having an issue here and wanted to know if anyone have any idea of how to accomplish this. The best example is here http://arshaw.com/fullcalendar/ if you look at the calendar, notice the last event "4p Repeating Event" lands on "Friday, July 2nd" but shows in June. Is there a way to get rid of this for June?
0
2,056,060
01/13/2010 10:55:02
187,141
10/09/2009 12:23:03
23
1
PHP code polisher - exists anywhere?
Could you please recommend some software that will do PHP code polishing according to pre-defined formatting rules? Thanks!
php
null
null
null
null
null
open
PHP code polisher - exists anywhere? === Could you please recommend some software that will do PHP code polishing according to pre-defined formatting rules? Thanks!
0
2,704,655
04/24/2010 13:43:46
86,729
04/03/2009 13:14:55
679
22
How to model a mutually exclusive relationship in sql server
I have to add functionality to an existing application and I've run into a data situation that I'm not sure how to model. I have an Item table that can me link to any number of tables, and these tables may increase over time. The Item can only me linked to one other table, but the record in the other table may have many items linked to it. My intital thoughts are: Item { ID, Name } LinkedItem { ItemID, LinkedToTableName, LinkedToID } The LinkedToTableName field will then allow me to identify the correct table to link to in my code. I'm not overly happy with this solution, but I can't quite think of anything else. Please help! :) Thanks!
sql
sql-server
database-design
null
null
null
open
How to model a mutually exclusive relationship in sql server === I have to add functionality to an existing application and I've run into a data situation that I'm not sure how to model. I have an Item table that can me link to any number of tables, and these tables may increase over time. The Item can only me linked to one other table, but the record in the other table may have many items linked to it. My intital thoughts are: Item { ID, Name } LinkedItem { ItemID, LinkedToTableName, LinkedToID } The LinkedToTableName field will then allow me to identify the correct table to link to in my code. I'm not overly happy with this solution, but I can't quite think of anything else. Please help! :) Thanks!
0
7,114,965
08/18/2011 22:34:25
460,761
09/28/2010 15:11:41
347
21
Chain of Responsability Logging
I have a abstract class called ChainHandler and many implementations of the ChainHandler. Other programmers will write other implementations of that ChainHandler. My program implements the Chain of Responsability design pattern. Each concrete implementation of the ChainHandler implements a handle method. public abstract void handle(SomeclassA a); If one handler can handle "a", it handles it and the chain stops. If not,"a" is passed to the next Handler until it hits the end of the chain. I want each concrete handler to have a list of all "a"s it was able to handle. But I don't want to make the concrete classes developer to remember to write it to a list on success. Is there a elegant way of doing it? My best idea was the following: 1 - Change the handle method to protected at the concrete classes, make it return a boolean and change the name to innerhandle; 2 - Change the handle method at the abstract class to public and it calls the innerhandle. On success, it adds the object to the list.
java
design-patterns
null
null
null
null
open
Chain of Responsability Logging === I have a abstract class called ChainHandler and many implementations of the ChainHandler. Other programmers will write other implementations of that ChainHandler. My program implements the Chain of Responsability design pattern. Each concrete implementation of the ChainHandler implements a handle method. public abstract void handle(SomeclassA a); If one handler can handle "a", it handles it and the chain stops. If not,"a" is passed to the next Handler until it hits the end of the chain. I want each concrete handler to have a list of all "a"s it was able to handle. But I don't want to make the concrete classes developer to remember to write it to a list on success. Is there a elegant way of doing it? My best idea was the following: 1 - Change the handle method to protected at the concrete classes, make it return a boolean and change the name to innerhandle; 2 - Change the handle method at the abstract class to public and it calls the innerhandle. On success, it adds the object to the list.
0
9,813,423
03/21/2012 21:52:44
1,144,475
01/12/2012 01:31:18
16
0
How can I capitalize an argument in a rake task?
I've got a rake task that renames a bunch of stuff in various files. So, if someone at the cmd terminal writes this rename:namechange[funk] the code below should perform the necessary find/replace. My problem is that I can't get this line to work. args[:new_name.capitalize] Any idea why? namespace :rename do desc 'changes the name of the app' task :changename, :new_name do |task, args| args[:new_name.capitalize] # change any instances of the term "framework" to the new name of the app #for testing, just change these: file_names = ['config/environment.rb'] #['config/environments/test.rb', 'config/environments/production.rb', 'config/environment.rb'] file_names = ['app/helpers/application_helper.rb', 'app/views/pages/home.html.erb', 'rakefile', 'config/application.rb', 'config.ru', 'config/database.yml', 'config/environments/development.rb', 'config/environments/test.rb', 'config/environments/production.rb', 'config/environment.rb', 'config/initializers/secret_token.rb', 'config/initializers/session_store.rb', 'config/routes.rb', 'spec/controllers/pages_controller_spec.rb'] file_names.each do |file_name| text = File.read(file_name) File.open(file_name, "w") { |file| file << text.gsub("Framework", args[:new_name]) } end end end
ruby-on-rails
rake
null
null
null
03/23/2012 11:56:56
too localized
How can I capitalize an argument in a rake task? === I've got a rake task that renames a bunch of stuff in various files. So, if someone at the cmd terminal writes this rename:namechange[funk] the code below should perform the necessary find/replace. My problem is that I can't get this line to work. args[:new_name.capitalize] Any idea why? namespace :rename do desc 'changes the name of the app' task :changename, :new_name do |task, args| args[:new_name.capitalize] # change any instances of the term "framework" to the new name of the app #for testing, just change these: file_names = ['config/environment.rb'] #['config/environments/test.rb', 'config/environments/production.rb', 'config/environment.rb'] file_names = ['app/helpers/application_helper.rb', 'app/views/pages/home.html.erb', 'rakefile', 'config/application.rb', 'config.ru', 'config/database.yml', 'config/environments/development.rb', 'config/environments/test.rb', 'config/environments/production.rb', 'config/environment.rb', 'config/initializers/secret_token.rb', 'config/initializers/session_store.rb', 'config/routes.rb', 'spec/controllers/pages_controller_spec.rb'] file_names.each do |file_name| text = File.read(file_name) File.open(file_name, "w") { |file| file << text.gsub("Framework", args[:new_name]) } end end end
3
6,922,245
08/03/2011 05:55:01
497,208
11/04/2010 13:44:54
196
8
Dollar notation in script languages - why?
Does anyone know, what is the actual reason behind "dollar variable notation" in some of the scripting languages, i.e. PHP or Perl? Python creators did not find `$variable` useful, neither do I. Why does PHP and Perl force me to press shift-4 so often? (OK, in Perl you can somehow explain it with distinguishing `$scalar`, `@array` and `%hash` but still it could be successfully avoided there, type does not need to be explicit)
php
javascript
python
perl
script
08/03/2011 06:56:24
off topic
Dollar notation in script languages - why? === Does anyone know, what is the actual reason behind "dollar variable notation" in some of the scripting languages, i.e. PHP or Perl? Python creators did not find `$variable` useful, neither do I. Why does PHP and Perl force me to press shift-4 so often? (OK, in Perl you can somehow explain it with distinguishing `$scalar`, `@array` and `%hash` but still it could be successfully avoided there, type does not need to be explicit)
2
8,783,346
01/09/2012 02:35:44
445,338
09/11/2010 23:18:54
23
0
Best way to learn software optimization
I want to learn software optimization, especially in Java. I want to be able to write code that's fast, and performs the best possible way. Can you point me to some resources to learn this? Books, tutorials, etc. Thanks.
java
performance
optimization
null
null
01/09/2012 02:44:22
not constructive
Best way to learn software optimization === I want to learn software optimization, especially in Java. I want to be able to write code that's fast, and performs the best possible way. Can you point me to some resources to learn this? Books, tutorials, etc. Thanks.
4
6,477,930
06/25/2011 13:12:10
718,500
04/21/2011 07:40:55
19
0
How to make javascript run on all browser?
I googled for the same but did not find anything which is simple and explanatory. I have javascript on almost all my php pages..which work on mozilla 3.6.18 .. but does not work on Firefox 3.6.16...plus does not work on IE8 as well as chrome.. how can i make javascript compatible for all browsers.. Thanks,
php
javascript
null
null
null
06/25/2011 13:23:36
not a real question
How to make javascript run on all browser? === I googled for the same but did not find anything which is simple and explanatory. I have javascript on almost all my php pages..which work on mozilla 3.6.18 .. but does not work on Firefox 3.6.16...plus does not work on IE8 as well as chrome.. how can i make javascript compatible for all browsers.. Thanks,
1
6,485,981
06/26/2011 18:45:14
816,412
06/26/2011 18:45:14
1
0
Looking for a TI-89 or TI-nSpire : 2D Matrix Convolution program
Is there any TI-89 or TI-nSpire calculator 2D Matrix (circular or not) Convolution program ? If it is not the case : how to implement it in TI-BASIC
c
basic
assembly
null
null
06/27/2011 21:38:04
too localized
Looking for a TI-89 or TI-nSpire : 2D Matrix Convolution program === Is there any TI-89 or TI-nSpire calculator 2D Matrix (circular or not) Convolution program ? If it is not the case : how to implement it in TI-BASIC
3
5,435,321
03/25/2011 16:33:12
677,101
03/25/2011 16:26:33
1
0
How can I efficiently choose 3 points out of 2000 points
I am trying to build a system which will input 1000 3D points and will create all possible triangles (with some distance constraints). What is the fastest way of doing this in C++?
c++
points
null
null
null
03/25/2011 16:38:55
not a real question
How can I efficiently choose 3 points out of 2000 points === I am trying to build a system which will input 1000 3D points and will create all possible triangles (with some distance constraints). What is the fastest way of doing this in C++?
1
4,389,950
12/08/2010 16:43:21
373,524
12/15/2008 00:58:20
165
7
How to map a C array to C#?
My question has to do with trying to call a function written in C from C#. I've looked in a header file that came with the C library to understand the functions as they exist in the C dll. Here's what I see: C code (for a function called "LocGetLocations"): typedef enum { eLocNoError, eLocInvalidCriteria, eLocNoMatch, eLocNoMoreLocations, eLocConnectionError, eLocContextError, eLocMemoryError } tLocGetStatus; typedef void *tLocFindCtx; typedef void *tLocation; PREFIX unsigned int POSTFIX LocGetLocations ( tLocFindCtx pCtx, tLocation *pLoc, unsigned int pNumLocations, tLocGetStatus *pStatus ); In C#, I have this: [DllImport(@"VertexNative\Location.dll")] public static extern uint LocGetLocations(IntPtr findContext, out byte[] locations, uint numberLocations, out int status); The problem is that I don't quite know how to handle the pLoc parameter in C#. I'm bringing it over as a byte array, although I'm not sure if that is correct. The C library's documentation says that that parameter is a pointer to an array of handles. How can I get an array back on the C# side and access its data? The example I was given in C, looks like this: tLocation lLocation[20]; // other stuff LocGetLocations(lCtx, lLocation, 20, &lStatus) Any help would be much appreciated!
c#
c++
interop
pinvoke
marshalling
null
open
How to map a C array to C#? === My question has to do with trying to call a function written in C from C#. I've looked in a header file that came with the C library to understand the functions as they exist in the C dll. Here's what I see: C code (for a function called "LocGetLocations"): typedef enum { eLocNoError, eLocInvalidCriteria, eLocNoMatch, eLocNoMoreLocations, eLocConnectionError, eLocContextError, eLocMemoryError } tLocGetStatus; typedef void *tLocFindCtx; typedef void *tLocation; PREFIX unsigned int POSTFIX LocGetLocations ( tLocFindCtx pCtx, tLocation *pLoc, unsigned int pNumLocations, tLocGetStatus *pStatus ); In C#, I have this: [DllImport(@"VertexNative\Location.dll")] public static extern uint LocGetLocations(IntPtr findContext, out byte[] locations, uint numberLocations, out int status); The problem is that I don't quite know how to handle the pLoc parameter in C#. I'm bringing it over as a byte array, although I'm not sure if that is correct. The C library's documentation says that that parameter is a pointer to an array of handles. How can I get an array back on the C# side and access its data? The example I was given in C, looks like this: tLocation lLocation[20]; // other stuff LocGetLocations(lCtx, lLocation, 20, &lStatus) Any help would be much appreciated!
0
10,346,168
04/27/2012 06:59:08
1,271,581
03/15/2012 13:04:04
3
0
MVVM Light messaging from child to parent
Is it possible to raisepropertychanged for an ObservableCollection from a child viewmodel ? I have a child viewmodel which inserts a new item in a ObservableCollection from a parent ViewModel and I need to raisepropertychanged on that collection for refreshing a list binded to it. What I need is to view in that list the new item already added. Thank you
mvvm-light
null
null
null
null
null
open
MVVM Light messaging from child to parent === Is it possible to raisepropertychanged for an ObservableCollection from a child viewmodel ? I have a child viewmodel which inserts a new item in a ObservableCollection from a parent ViewModel and I need to raisepropertychanged on that collection for refreshing a list binded to it. What I need is to view in that list the new item already added. Thank you
0
9,193,029
02/08/2012 12:08:07
1,182,418
02/01/2012 10:15:46
49
0
Releasing objects
I release objects created by @property directive in dealloc method like this -(void)dealloc { [object release], object = nil; } I have two questions. 1. Is dealloc method the right place for releaseing object generated by @property ? 2. Is it a good practice to set objects to nil ?
objective-c
ios
null
null
null
null
open
Releasing objects === I release objects created by @property directive in dealloc method like this -(void)dealloc { [object release], object = nil; } I have two questions. 1. Is dealloc method the right place for releaseing object generated by @property ? 2. Is it a good practice to set objects to nil ?
0
5,419,516
03/24/2011 12:57:52
307,007
04/01/2010 15:08:39
641
9
HTML table help
I have been trying all morning to replicate the below however I cannot get the alignment correct, it seems that a row will match the height of the biggest td, I need to replicate this as pixel perfect as possible. ![enter image description here][1] [1]: http://i.stack.imgur.com/hDXWH.jpg Below is my HTML, <table cellspacing="0" cellpadding="0" border="0" align="center" style="height: 268px; width: 700px;"> <thead> <tr> <th valign="middle" align="center" style="height: 27px;" scope="col">Information</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Education &amp; Training</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Marketing Services</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Digital Media</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Entertainment</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Business Services</th> </tr> </thead> <tbody> <tr> <td valign="middle" align="center" style="height: 27px;">Academic</td> <td valign="middle" align="center" style="height: 27px;">For-profit schools</td> <td valign="middle" align="center" style="height: 27px;">Agency</td> <td valign="middle" align="center" style="height: 27px;">Internet</td> <td valign="middle" align="center" style="height: 27px;">TV and Radio Broadcasting</td> <td valign="middle" align="center" style="height: 27px;">Business Process Outsourcing</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">STM</td> <td valign="middle" align="center" style="height: 27px;">Educational Technology</td> <td valign="middle" align="center" style="height: 27px;">Digital</td> <td valign="middle" align="center" style="height: 27px;">Mobile Distribution</td> <td valign="middle" align="center" style="height: 27px;">Cinema</td> <td valign="middle" align="center" style="height: 27px;">B2B Services</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Financial</td> <td valign="middle" align="center" style="height: 27px;">Educational Services</td> <td valign="middle" align="center" style="height: 27px;">Market Research</td> <td valign="middle" align="center" style="height: 27px;">Online Gaming</td> <td valign="middle" align="center" style="height: 27px;">Film, TV, Music and Sports Content and Rights</td> <td valign="middle" align="center" style="height: 27px;">SaaS</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Business</td> <td valign="middle" align="center" style="height: 27px;">Professional Training</td> <td valign="middle" align="center" style="height: 27px;">Outdoor</td> <td valign="middle" align="center" style="height: 27px;">Social Media</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Trade</td> <td valign="middle" align="center" style="height: 27px;">Vocational Training</td> <td valign="middle" align="center" style="height: 27px;">Public Relations</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Consumer</td> <td valign="middle" align="center" style="height: 27px;">Sales Promotion</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Professional</td> <td valign="middle" align="center" style="height: 27px;">Direct Marketing</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Lead Generation</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">&nbsp;</td> <td valign="middle" align="center" style="height: 27px;">&nbsp;</td> </tr> </tbody> </table> and my CSS, #left table { border:0 none; } #left th { height:43px; background:url(images/th_bg.jpg) top left repeat-x; font-size:14px; color:#fff; font-family:"Times", "Times New Roman", "Serif"; } #left tbody td { text-align:center; background:#99abb9; border-right:1px solid #fff; width:105px; padding:10px 15px 0px 15px; height:17px; }
html
css
table
null
null
null
open
HTML table help === I have been trying all morning to replicate the below however I cannot get the alignment correct, it seems that a row will match the height of the biggest td, I need to replicate this as pixel perfect as possible. ![enter image description here][1] [1]: http://i.stack.imgur.com/hDXWH.jpg Below is my HTML, <table cellspacing="0" cellpadding="0" border="0" align="center" style="height: 268px; width: 700px;"> <thead> <tr> <th valign="middle" align="center" style="height: 27px;" scope="col">Information</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Education &amp; Training</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Marketing Services</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Digital Media</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Entertainment</th> <th valign="middle" align="center" style="height: 27px;" scope="col">Business Services</th> </tr> </thead> <tbody> <tr> <td valign="middle" align="center" style="height: 27px;">Academic</td> <td valign="middle" align="center" style="height: 27px;">For-profit schools</td> <td valign="middle" align="center" style="height: 27px;">Agency</td> <td valign="middle" align="center" style="height: 27px;">Internet</td> <td valign="middle" align="center" style="height: 27px;">TV and Radio Broadcasting</td> <td valign="middle" align="center" style="height: 27px;">Business Process Outsourcing</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">STM</td> <td valign="middle" align="center" style="height: 27px;">Educational Technology</td> <td valign="middle" align="center" style="height: 27px;">Digital</td> <td valign="middle" align="center" style="height: 27px;">Mobile Distribution</td> <td valign="middle" align="center" style="height: 27px;">Cinema</td> <td valign="middle" align="center" style="height: 27px;">B2B Services</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Financial</td> <td valign="middle" align="center" style="height: 27px;">Educational Services</td> <td valign="middle" align="center" style="height: 27px;">Market Research</td> <td valign="middle" align="center" style="height: 27px;">Online Gaming</td> <td valign="middle" align="center" style="height: 27px;">Film, TV, Music and Sports Content and Rights</td> <td valign="middle" align="center" style="height: 27px;">SaaS</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Business</td> <td valign="middle" align="center" style="height: 27px;">Professional Training</td> <td valign="middle" align="center" style="height: 27px;">Outdoor</td> <td valign="middle" align="center" style="height: 27px;">Social Media</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Trade</td> <td valign="middle" align="center" style="height: 27px;">Vocational Training</td> <td valign="middle" align="center" style="height: 27px;">Public Relations</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Consumer</td> <td valign="middle" align="center" style="height: 27px;">Sales Promotion</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Professional</td> <td valign="middle" align="center" style="height: 27px;">Direct Marketing</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">Lead Generation</td> </tr> <tr> <td valign="middle" align="center" style="height: 27px;">&nbsp;</td> <td valign="middle" align="center" style="height: 27px;">&nbsp;</td> </tr> </tbody> </table> and my CSS, #left table { border:0 none; } #left th { height:43px; background:url(images/th_bg.jpg) top left repeat-x; font-size:14px; color:#fff; font-family:"Times", "Times New Roman", "Serif"; } #left tbody td { text-align:center; background:#99abb9; border-right:1px solid #fff; width:105px; padding:10px 15px 0px 15px; height:17px; }
0
9,474,027
02/27/2012 23:27:28
359,315
08/03/2009 16:18:02
69
1
Center tooltip & hold in place on mouseover?
At this site [videon ][1] I have implemented a tooltip script that shows different images when it's parent image is hovered over. Though the tooltip images are not centered directly over the parent images. Can anyone provide insight on what I need to change to make the tooltip image appeared center over it's parent? [1]: http://ryanspahn.com/Videon-Central-2/about.html
jquery
tooltip
null
null
null
null
open
Center tooltip & hold in place on mouseover? === At this site [videon ][1] I have implemented a tooltip script that shows different images when it's parent image is hovered over. Though the tooltip images are not centered directly over the parent images. Can anyone provide insight on what I need to change to make the tooltip image appeared center over it's parent? [1]: http://ryanspahn.com/Videon-Central-2/about.html
0
10,145,913
04/13/2012 18:00:27
1,250,286
03/05/2012 16:26:24
38
0
PHP variables in WHERE clause, how to?
I have following PHP script. I want to count and print comments for each article. The id for each article can be "recalled" by this: `<?php echo $listing['Listing']['listing_id'];?>` (this return the contentid number) Now, I have this script: <?php $db =& JFactory::getDBO(); $query = "SELECT COUNT(comments) AS totalcount WHERE contentid = ????? "; $db->setQuery($query); $count = $db->loadResult(); echo ($count); ?> I tried to add in WHERE clause this: "... WHERE contentid = {$listing['Listing']['listing_id']}" but $count returns "0" zero. How can I add this variable in the WHERE clause? Thanks in advance!
php
mysql
variables
where-clause
null
null
open
PHP variables in WHERE clause, how to? === I have following PHP script. I want to count and print comments for each article. The id for each article can be "recalled" by this: `<?php echo $listing['Listing']['listing_id'];?>` (this return the contentid number) Now, I have this script: <?php $db =& JFactory::getDBO(); $query = "SELECT COUNT(comments) AS totalcount WHERE contentid = ????? "; $db->setQuery($query); $count = $db->loadResult(); echo ($count); ?> I tried to add in WHERE clause this: "... WHERE contentid = {$listing['Listing']['listing_id']}" but $count returns "0" zero. How can I add this variable in the WHERE clause? Thanks in advance!
0