PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
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
32
30.1k
OpenStatus_id
int64
0
4
11,410,471
07/10/2012 09:36:21
1,509,060
07/07/2012 17:30:26
21
1
Extending visual studio workflow for specific solution
For one of the projects i'm working on, i would like to add some features to visual studio too smooth out the workflow. Adding some button's to open custom tools, or maybe adding some visual studio windows that i can use to change custom settings would be incredibly usefull. Since this is really specific to this project, i do not really want all these things to be there when im working on other solutions. Disabling toolbars and moving around windows each time i switch solution is obviously not convenient :D Is there a way to customize visual studio per solution, and can someone give me some pointers on how to extend visual studio in this way, preferable using managed code? I'm using visual studio 2010.
c#
visual-studio-2010
extensibility
null
null
null
open
Extending visual studio workflow for specific solution === For one of the projects i'm working on, i would like to add some features to visual studio too smooth out the workflow. Adding some button's to open custom tools, or maybe adding some visual studio windows that i can use to change custom settings would be incredibly usefull. Since this is really specific to this project, i do not really want all these things to be there when im working on other solutions. Disabling toolbars and moving around windows each time i switch solution is obviously not convenient :D Is there a way to customize visual studio per solution, and can someone give me some pointers on how to extend visual studio in this way, preferable using managed code? I'm using visual studio 2010.
0
11,410,415
07/10/2012 09:33:11
468,345
10/06/2010 18:50:33
1,318
11
Hide table rows that don't have a certain class
function filterRows(statusName) { $("#mainTable tbody tr."+statusName).hide(); } It hides the rows that have the class called `statusName`. How do I hide only the rows that don't have one?
jquery
null
null
null
null
null
open
Hide table rows that don't have a certain class === function filterRows(statusName) { $("#mainTable tbody tr."+statusName).hide(); } It hides the rows that have the class called `statusName`. How do I hide only the rows that don't have one?
0
11,410,475
07/10/2012 09:36:34
1,457,968
06/15/2012 06:37:18
3
1
N tree data structure in C#
I`m supposed to create a Unbalanced N-tree, the data for this tree i am getting from an XML File, based on this data i have to create tree structure and traverse this tree to get different flows any idea or suggestion for this to go ahead?
c#
tree
xml-parsing
traverse
null
07/11/2012 11:15:43
not a real question
N tree data structure in C# === I`m supposed to create a Unbalanced N-tree, the data for this tree i am getting from an XML File, based on this data i have to create tree structure and traverse this tree to get different flows any idea or suggestion for this to go ahead?
1
11,410,477
07/10/2012 09:36:36
150,246
08/04/2009 10:08:14
609
6
Apply model metadata on complex objects
I have the following scenario public class Foo { public Bar FooBar { get; set; } } public class Bar { [DisplayFormatAttribute(ApplyFormatInEditMode = true, DataFormatString = "{0:d}")] public DateTime BirthDay { get; set; } } Now when I use EditorFor I want to apply the DataFormatString on my DateTime @Html.EditorFor(x => x.FooBar.BirthDay); The above code does not render the date correct using the DisplayFormatAttribute, so how can I solve this?
asp.net-mvc-3
modelmetadata
null
null
null
null
open
Apply model metadata on complex objects === I have the following scenario public class Foo { public Bar FooBar { get; set; } } public class Bar { [DisplayFormatAttribute(ApplyFormatInEditMode = true, DataFormatString = "{0:d}")] public DateTime BirthDay { get; set; } } Now when I use EditorFor I want to apply the DataFormatString on my DateTime @Html.EditorFor(x => x.FooBar.BirthDay); The above code does not render the date correct using the DisplayFormatAttribute, so how can I solve this?
0
11,410,478
07/10/2012 09:36:38
1,230,945
02/24/2012 14:12:31
28
0
Adding MIDlet-attributes to JAD file
I am using J2ME Polish to build an application for nokia s40 phones. When i finished packaging the app, i find out that the manifest attributes: "MicroEdition-Configuration" and "MicroEdition-Profile" which is available in the manifest file is not present in the JAD file i.e MicroEdition-Configuration: CLDC-1.1 MicroEdition-Profile: MIDP-2.0 I am using Netbeans to build my project, don't know where the problem will be coming from, any help?
java-me
j2mepolish
null
null
null
null
open
Adding MIDlet-attributes to JAD file === I am using J2ME Polish to build an application for nokia s40 phones. When i finished packaging the app, i find out that the manifest attributes: "MicroEdition-Configuration" and "MicroEdition-Profile" which is available in the manifest file is not present in the JAD file i.e MicroEdition-Configuration: CLDC-1.1 MicroEdition-Profile: MIDP-2.0 I am using Netbeans to build my project, don't know where the problem will be coming from, any help?
0
11,410,387
07/10/2012 09:31:00
679,540
03/28/2011 02:12:10
31
0
c# combobox problems in setting the list of items
I have 2 combobox here. cb1 and cb2. I need to set like, when cb1.SelectedText = "aa", the list of items in cb2 will be "1,2,3" when cb1.SelectedText = "bb", the list of items in cb2 will be "5,6,7"; how can i do that?
c#
combobox
null
null
null
07/10/2012 15:39:39
not a real question
c# combobox problems in setting the list of items === I have 2 combobox here. cb1 and cb2. I need to set like, when cb1.SelectedText = "aa", the list of items in cb2 will be "1,2,3" when cb1.SelectedText = "bb", the list of items in cb2 will be "5,6,7"; how can i do that?
1
11,410,388
07/10/2012 09:31:16
368,440
06/16/2010 16:10:18
198
16
jetty how to add static resource directories to jetty(more then one)
**Hello** I am currently working on a project where we have to paste (using intelij artifacts ) static directories to on place . my jetty is embedded therefore We want our jetty to have multiply static directories When someone will run the server http://localhost:8282/A http://localhost:8282/B http://localhost:8282/C although A is placed in X/V/A although B is placed in Q/Z/B although C is placed in P/T/C I tried doing: ResourceHandler resource_handler = new ResourceHandler(); resource_handler.setWelcomeFiles(new String[]{"index.html"}); resource_handler.setResourceBase(HTML_SITE); ResourceHandler resource_handler1 = new ResourceHandler(); resource_handler1.setWelcomeFiles(new String[]{"index.html"}); resource_handler1.setResourceBase(HTML_CLIENTZONE_SITE); // deploy engine WebAppContext webapp = new WebAppContext(); String dir = System.getProperty("user.dir"); webapp.setResourceBase(getWebAppPath()); webapp.setContextPath("/"); HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[]{resource_handler,resource_handler1 ,webapp, new DefaultHandler()}); server.setHandler(handlers); with no success
embedded-jetty
null
null
null
null
null
open
jetty how to add static resource directories to jetty(more then one) === **Hello** I am currently working on a project where we have to paste (using intelij artifacts ) static directories to on place . my jetty is embedded therefore We want our jetty to have multiply static directories When someone will run the server http://localhost:8282/A http://localhost:8282/B http://localhost:8282/C although A is placed in X/V/A although B is placed in Q/Z/B although C is placed in P/T/C I tried doing: ResourceHandler resource_handler = new ResourceHandler(); resource_handler.setWelcomeFiles(new String[]{"index.html"}); resource_handler.setResourceBase(HTML_SITE); ResourceHandler resource_handler1 = new ResourceHandler(); resource_handler1.setWelcomeFiles(new String[]{"index.html"}); resource_handler1.setResourceBase(HTML_CLIENTZONE_SITE); // deploy engine WebAppContext webapp = new WebAppContext(); String dir = System.getProperty("user.dir"); webapp.setResourceBase(getWebAppPath()); webapp.setContextPath("/"); HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[]{resource_handler,resource_handler1 ,webapp, new DefaultHandler()}); server.setHandler(handlers); with no success
0
11,410,484
07/10/2012 09:36:51
1,290,495
03/24/2012 20:47:41
103
1
Session expiring for multiple instances even though timer is being updated
I have written a script to implement idle time out for a user. This script needs to work on the following guidelines: 1. Whenever user login, check for cookies. 2. There are 3 cases. Cookie does not exist, cooki exist and valid, cookie exist and invalid. 3. On basis of cookie status, update session expire time and session warning time and session logout. My code to timeout a session works fine but whenever i use 2 or more pages , evene though i have activity on the latest page the previous page expires. Even though the logout value in cookie is increased. ?Here is my code. .. can anyone please suggest what might be gng wrong here. .. Thanks.. var warningFlag = 0; var warningDuration = 10*1000; //10 Seconds var logoutDuration = 15*1000; //15 Seconds var loginTime = new Date(); var logoutTime = loginTime.getTime() + logoutDuration;//loginTime.getTime()+(10*60*1000); //10 minutes var cookieVal = 'logoutTime='+logoutTime; var sessionExpireWarning = loginTime.getTime() + warningDuration; var sessionExpireTime = loginTime.getTime() + logoutDuration; checkPDTUserCookieExpiration(); //Timer to check user event setInterval(function checkIdle() { var currentTime = new Date(); if(currentTime.getTime() >= sessionExpireWarning && warningFlag==0) { $.msgbox('You\'ve been inactive for 10 minutes, are you still there ?',{ buttons : [ {type: 'submit', value:'Yes'} ] }); $.titleAlert("You\'ve been inactive for 10 minutes, are you still there ?!", {stopOnMouseMove: true}); warningFlag=1; } if(currentTime.getTime() >= sessionExpireTime && warningFlag==1) { var url = 'logout.html?reason=timedout'; $(location).attr('href',url); } document.onmousemove = resetTimer; document.onkeypress = resetTimer; },1000); //Check expiration date/time of a cookie function checkPDTUserCookieExpiration(){ var cookiePDT = getCookie('pdtUserSession'); //If no cookie : Fresh session if(!cookiePDT) { setPDTUserCookie(); } else { //If cookie exists var currentTime = new Date(); var cookieExpireTime = cookiePDT.substring(cookiePDT.indexOf('=')+1, cookiePDT.length); if(cookieExpireTime >= currentTime.getTime()) { //Buffer time for logout of a user sessionExpireWarning = parseInt(cookiePDT.substring(cookiePDT.indexOf('=')+1, cookiePDT.length), 10) + warningDuration; sessionExpireTime = cookiePDT.substring(cookiePDT.indexOf('=')+1, cookiePDT.length) + logoutDuration; logoutTime = sessionExpireTime; setPDTUserCookie(); //to update cookie time } else { //if cookie exists and is expired resetTimer; } } } //Create a PDT User Cookie function setPDTUserCookie() { cookieVal = 'logoutTime='+logoutTime; //var date = new Date(logoutTime); alert(date + " % " + logoutTime); document.cookie = 'pdtUserSession=' + cookieVal + '; expires=' + logoutTime + '; path = / ; domain=' + '.manager.myname.domain.com' + '; '; } //Resets the idleTime counter and advance logout time by 15 minutes function resetTimer() { warningFlag =0; var eventDate = new Date(); sessionExpireWarning = eventDate.getTime() + warningDuration; sessionExpireTime = eventDate.getTime() + logoutDuration; logoutTime = eventDate.getTime()+ logoutDuration; setPDTUserCookie(); } //Returns a cookie when found in Cookie Jar function getCookie(c_name){ }
javascript
cookies
timeout
null
null
null
open
Session expiring for multiple instances even though timer is being updated === I have written a script to implement idle time out for a user. This script needs to work on the following guidelines: 1. Whenever user login, check for cookies. 2. There are 3 cases. Cookie does not exist, cooki exist and valid, cookie exist and invalid. 3. On basis of cookie status, update session expire time and session warning time and session logout. My code to timeout a session works fine but whenever i use 2 or more pages , evene though i have activity on the latest page the previous page expires. Even though the logout value in cookie is increased. ?Here is my code. .. can anyone please suggest what might be gng wrong here. .. Thanks.. var warningFlag = 0; var warningDuration = 10*1000; //10 Seconds var logoutDuration = 15*1000; //15 Seconds var loginTime = new Date(); var logoutTime = loginTime.getTime() + logoutDuration;//loginTime.getTime()+(10*60*1000); //10 minutes var cookieVal = 'logoutTime='+logoutTime; var sessionExpireWarning = loginTime.getTime() + warningDuration; var sessionExpireTime = loginTime.getTime() + logoutDuration; checkPDTUserCookieExpiration(); //Timer to check user event setInterval(function checkIdle() { var currentTime = new Date(); if(currentTime.getTime() >= sessionExpireWarning && warningFlag==0) { $.msgbox('You\'ve been inactive for 10 minutes, are you still there ?',{ buttons : [ {type: 'submit', value:'Yes'} ] }); $.titleAlert("You\'ve been inactive for 10 minutes, are you still there ?!", {stopOnMouseMove: true}); warningFlag=1; } if(currentTime.getTime() >= sessionExpireTime && warningFlag==1) { var url = 'logout.html?reason=timedout'; $(location).attr('href',url); } document.onmousemove = resetTimer; document.onkeypress = resetTimer; },1000); //Check expiration date/time of a cookie function checkPDTUserCookieExpiration(){ var cookiePDT = getCookie('pdtUserSession'); //If no cookie : Fresh session if(!cookiePDT) { setPDTUserCookie(); } else { //If cookie exists var currentTime = new Date(); var cookieExpireTime = cookiePDT.substring(cookiePDT.indexOf('=')+1, cookiePDT.length); if(cookieExpireTime >= currentTime.getTime()) { //Buffer time for logout of a user sessionExpireWarning = parseInt(cookiePDT.substring(cookiePDT.indexOf('=')+1, cookiePDT.length), 10) + warningDuration; sessionExpireTime = cookiePDT.substring(cookiePDT.indexOf('=')+1, cookiePDT.length) + logoutDuration; logoutTime = sessionExpireTime; setPDTUserCookie(); //to update cookie time } else { //if cookie exists and is expired resetTimer; } } } //Create a PDT User Cookie function setPDTUserCookie() { cookieVal = 'logoutTime='+logoutTime; //var date = new Date(logoutTime); alert(date + " % " + logoutTime); document.cookie = 'pdtUserSession=' + cookieVal + '; expires=' + logoutTime + '; path = / ; domain=' + '.manager.myname.domain.com' + '; '; } //Resets the idleTime counter and advance logout time by 15 minutes function resetTimer() { warningFlag =0; var eventDate = new Date(); sessionExpireWarning = eventDate.getTime() + warningDuration; sessionExpireTime = eventDate.getTime() + logoutDuration; logoutTime = eventDate.getTime()+ logoutDuration; setPDTUserCookie(); } //Returns a cookie when found in Cookie Jar function getCookie(c_name){ }
0
11,410,485
07/10/2012 09:36:52
1,514,303
07/10/2012 09:17:05
1
0
iPhone restore AudioSession in Play&Record after playing youtube video
I have a problem about managing AudioSession (set as Play&Record category) interruptions in my VoIP app in iOS 5.x. When I have a call in progress, going background and starting youtube app, the audio session begin-interruption occurs and I can put in pause the current call. The problem is when I return to foreground and want to reactive my call (WITHOUT killing youtube app, simply putting it in background previously): no end-interruption callback occurs and even if I force to set active my previous audioSession, it returns error. I check if the audio resources are maybe in use by other process (with AudioSessionGetProperty (kAudioSessionProperty_OtherAudioIsPlaying,...) but they don't. If I kill manually youtube app the end-interruption occurs instead and there's no problem. Since normally no one kills manually the app, how can i restore the audioSession of my call?? I've checked other examples and Viber works correctly and can "intercepts" in some way the end-interruption. Another strange behaviour is that if I set also "allowMixing" category in my AudioSession, it is completely ignored in iOS 5.x (youtube takes control of audio resources) while in iOS 4.x it works as it should (that is I listen in contemporary the audio call and youtube mixed).
ios
youtube
voip
background-process
audiosession
null
open
iPhone restore AudioSession in Play&Record after playing youtube video === I have a problem about managing AudioSession (set as Play&Record category) interruptions in my VoIP app in iOS 5.x. When I have a call in progress, going background and starting youtube app, the audio session begin-interruption occurs and I can put in pause the current call. The problem is when I return to foreground and want to reactive my call (WITHOUT killing youtube app, simply putting it in background previously): no end-interruption callback occurs and even if I force to set active my previous audioSession, it returns error. I check if the audio resources are maybe in use by other process (with AudioSessionGetProperty (kAudioSessionProperty_OtherAudioIsPlaying,...) but they don't. If I kill manually youtube app the end-interruption occurs instead and there's no problem. Since normally no one kills manually the app, how can i restore the audioSession of my call?? I've checked other examples and Viber works correctly and can "intercepts" in some way the end-interruption. Another strange behaviour is that if I set also "allowMixing" category in my AudioSession, it is completely ignored in iOS 5.x (youtube takes control of audio resources) while in iOS 4.x it works as it should (that is I listen in contemporary the audio call and youtube mixed).
0
11,410,486
07/10/2012 09:36:58
1,259,132
03/09/2012 10:56:37
1
0
I need to set autorepair to a mysql table
I have a table which have thousands of data. I want to set auto repair to the table . Will mysql support auto repair ? What is the syntax
mysql
null
null
null
null
null
open
I need to set autorepair to a mysql table === I have a table which have thousands of data. I want to set auto repair to the table . Will mysql support auto repair ? What is the syntax
0
11,372,970
07/07/2012 06:55:58
915,502
08/27/2011 13:09:43
25
1
Map job very slow in Mongo-Hadoop MapReduce
I implemented my mapreduce job in hadoop, taking my input and putting my output in MongoDB thanks to mongo-hadoop plugin. **The problem is that the map jobs are really slow**. I splitted my map job in 16-20 mapper tasks and the same for the reducer. In mongostat I noted that _during map operation there are **40~90 query/s**, while during reduce operation the query/s are **3000~4000**_. MongoDB and Hadoop tmp directory are entirely in a temporary filesystem (tmpfs) in RAM. My machine is an AMD Opteron 16 core with 32 GB of RAM. My map job does something like this: p is the current map input point r <- query mongodb if r then newObject <- create the output object with some (not complex) operation pointContext.write( new Text(newObject), newObject ) else do nothing update p with a query in MongoDB Here's my Hadoop prefs: <!-- Mongo --> <property> <name>mongo.input.split_size</name> <value>4</value> </property> <property> <name>mongo.input.query</name> <value> { visited : false , clusterized : false }</value> </property> <!-- MAP --> <property> <name>mapred.tasktracker.map.tasks.maximum</name> <value>16</value> </property> <property> <name>mapred.map.child.java.opts</name> <value>-Xmx1g</value> </property> <!-- REDUCE --> <property> <name>mapred.tasktracker.reduce.tasks.maximum</name> <value>16</value> </property> <property> <name>mapred.reduce.tasks</name> <value>16</value> </property> <property> <name>mapred.reduce.child.java.opts</name> <value>-Xmx1g</value> </property> <property> <name>mapred.reduce.parallel.copies</name> <value>16</value> </property> I tried different configurations, but the result is always the same. **Is this normal?**
mongodb
hadoop
mapreduce
null
null
null
open
Map job very slow in Mongo-Hadoop MapReduce === I implemented my mapreduce job in hadoop, taking my input and putting my output in MongoDB thanks to mongo-hadoop plugin. **The problem is that the map jobs are really slow**. I splitted my map job in 16-20 mapper tasks and the same for the reducer. In mongostat I noted that _during map operation there are **40~90 query/s**, while during reduce operation the query/s are **3000~4000**_. MongoDB and Hadoop tmp directory are entirely in a temporary filesystem (tmpfs) in RAM. My machine is an AMD Opteron 16 core with 32 GB of RAM. My map job does something like this: p is the current map input point r <- query mongodb if r then newObject <- create the output object with some (not complex) operation pointContext.write( new Text(newObject), newObject ) else do nothing update p with a query in MongoDB Here's my Hadoop prefs: <!-- Mongo --> <property> <name>mongo.input.split_size</name> <value>4</value> </property> <property> <name>mongo.input.query</name> <value> { visited : false , clusterized : false }</value> </property> <!-- MAP --> <property> <name>mapred.tasktracker.map.tasks.maximum</name> <value>16</value> </property> <property> <name>mapred.map.child.java.opts</name> <value>-Xmx1g</value> </property> <!-- REDUCE --> <property> <name>mapred.tasktracker.reduce.tasks.maximum</name> <value>16</value> </property> <property> <name>mapred.reduce.tasks</name> <value>16</value> </property> <property> <name>mapred.reduce.child.java.opts</name> <value>-Xmx1g</value> </property> <property> <name>mapred.reduce.parallel.copies</name> <value>16</value> </property> I tried different configurations, but the result is always the same. **Is this normal?**
0
11,372,972
07/07/2012 06:56:19
1,068,446
11/27/2011 22:59:32
26
1
android xml: reference a menu in multiple places.
I have: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/fp_pitcher" android:title="Pitcher"> <menu> <item android:id="@+id/caught" android:title="Caught"> </item> <item android:id="@+id/not_caught" android:title="Not Caught"> </item> </menu> </item> <item android:id="@+id/fp_catcher" android:title="Catcher"> <menu> <item android:id="@id/caught" android:title="Caught"> </item> <item android:id="@id/not_caught" android:title="Not Caught"> </item> </menu> </item> <item android:id="@+id/fp_firstbaseman" android:title="First Baseman"> <menu> <item android:id="@+id/caught" android:title="Caught"> </item> <item android:id="@+id/not_caught" android:title="Not Caught"> </item> </menu> </item> <!--SNIP, continues for every fielding position. --> So you see this inner menu is the same for each of the outer items. Is there a way I can reference the same menu over and over again? This would save me time later, if I needed to modify the inner menu.
android
xml
contextmenu
null
null
null
open
android xml: reference a menu in multiple places. === I have: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/fp_pitcher" android:title="Pitcher"> <menu> <item android:id="@+id/caught" android:title="Caught"> </item> <item android:id="@+id/not_caught" android:title="Not Caught"> </item> </menu> </item> <item android:id="@+id/fp_catcher" android:title="Catcher"> <menu> <item android:id="@id/caught" android:title="Caught"> </item> <item android:id="@id/not_caught" android:title="Not Caught"> </item> </menu> </item> <item android:id="@+id/fp_firstbaseman" android:title="First Baseman"> <menu> <item android:id="@+id/caught" android:title="Caught"> </item> <item android:id="@+id/not_caught" android:title="Not Caught"> </item> </menu> </item> <!--SNIP, continues for every fielding position. --> So you see this inner menu is the same for each of the outer items. Is there a way I can reference the same menu over and over again? This would save me time later, if I needed to modify the inner menu.
0
11,372,977
07/07/2012 06:57:42
1,318,162
04/06/2012 19:57:04
97
7
How do I use addr2line for Android?
My code (a game using AndEngine with PhysicsBox2DExtension on Android) is crashing and it has been suggested that I use addr2line, but I have absolutely not idea how to do it and the many "tutorials" I've looked at are extraordinarily vague. Perhaps someone could give me step by step instructions? I'm using Windows 7 and Eclipse Indigo. I've downloaded Android NDK r8 and saved it to C:\Program Files (x86)\Android NDK\android-ndk-r8. My project is saved to C:\Users\Reese\workspace\TestGFX5. The stacktrace: 07-06 13:25:27.469: I/DEBUG(19582): #00 pc 00011f74 /system/lib/libc.so 07-06 13:25:27.473: I/DEBUG(19582): #01 pc 0001921e /system/lib/libc.so 07-06 13:25:27.473: I/DEBUG(19582): #02 pc 00026558 /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so 07-06 13:25:27.473: I/DEBUG(19582): #03 pc 00013e7c /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so 07-06 13:25:27.473: I/DEBUG(19582): #04 pc 00016e34 /system/lib/libdvm.so Beyond that, I'm lost. Help please?
android
crash
andengine
addr2line
null
null
open
How do I use addr2line for Android? === My code (a game using AndEngine with PhysicsBox2DExtension on Android) is crashing and it has been suggested that I use addr2line, but I have absolutely not idea how to do it and the many "tutorials" I've looked at are extraordinarily vague. Perhaps someone could give me step by step instructions? I'm using Windows 7 and Eclipse Indigo. I've downloaded Android NDK r8 and saved it to C:\Program Files (x86)\Android NDK\android-ndk-r8. My project is saved to C:\Users\Reese\workspace\TestGFX5. The stacktrace: 07-06 13:25:27.469: I/DEBUG(19582): #00 pc 00011f74 /system/lib/libc.so 07-06 13:25:27.473: I/DEBUG(19582): #01 pc 0001921e /system/lib/libc.so 07-06 13:25:27.473: I/DEBUG(19582): #02 pc 00026558 /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so 07-06 13:25:27.473: I/DEBUG(19582): #03 pc 00013e7c /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so 07-06 13:25:27.473: I/DEBUG(19582): #04 pc 00016e34 /system/lib/libdvm.so Beyond that, I'm lost. Help please?
0
11,372,978
07/07/2012 06:57:59
1,508,311
07/07/2012 05:42:14
1
0
How to check or highlight the pre-selected option in the ModalPopUoExtender with GridView?
I am using Ajax ModalPopUpExtender control to update one column (Status column) in the GridView. Everything works fine. But what I want now is: When I click on one of these status, I want the Ajax ModalPopUp Window to be opened with specifiying the status in the options listed inside the ModalPopUpExtender. For example, if the status is Approved, and I have four options be listed in the ModalPopUpExtender, the Approved option should be checked or highlighted. **So how to do that?** ASP.NET Code: <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" width="900px" CssClass="mGrid" DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound"> <AlternatingRowStyle BackColor="White" ForeColor="#284775" CssClass="alt" /> <HeaderStyle Font-Bold = "True" ForeColor="Black" Height="20px"/> <Columns> <asp:BoundField DataField="ID" HeaderText="No." InsertVisible="False" ReadOnly="True" SortExpression="ID" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /> <asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" /> <asp:BoundField DataField="DivisionShortcut" HeaderText="Division" SortExpression="DivisionShortcut" /> <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" /> <%-- This to make status be opened and edited through the Ajax ModalPopUp Window --%> <asp:TemplateField HeaderText="Status"> <ItemTemplate> <asp:LinkButton runat="server" ID="lnkSuggestionStatus" Text='<%#Eval("Status")%>' OnClick="lnkSuggestionStatus_Click"> </asp:LinkButton> </ItemTemplate> </asp:TemplateField> <%--<asp:HyperLinkField HeaderText="Status" SortExpression="Status" />--%> </Columns> <RowStyle HorizontalAlign="Center" /> </asp:GridView> <asp:Button runat="server" ID="btnModalPopUp" style="display:none" /> <AjaxToolkit:ModalPopUpExtender ID="modalPopUpExtender1" runat="server" TargetControlID="btnModalPopUp" PopupControlID="pnlPopUp" BackgroundCssClass="popUpStyle" PopupDragHandleControlID="panelDragHandle" OkControlID="OKButton"> </AjaxToolkit:ModalPopUpExtender> <asp:HiddenField ID="HiddenField1" runat="server"/> <asp:Panel runat="server" ID="pnlPopUp" CssClass="popUpStyle"> <asp:RadioButtonList ID="StatusList" runat="server" RepeatColumns="1" RepeatDirection="Vertical" RepeatLayout="Table" TextAlign="Right" DataSourceID="SuggestionStatusDataSource" DataTextField="Status" DataValueField="ID"> <asp:ListItem id="option1" runat="server" Value="ACTIONED" /> <asp:ListItem id="option2" runat="server" Value="APPROVED" /> <asp:ListItem id="option3" runat="server" Value="PENDING" /> <asp:ListItem id="option4" runat="server" Value="TRANSFERRED" /> </asp:RadioButtonList> <asp:SqlDataSource ID="SuggestionStatusDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>" SelectCommand="SELECT * FROM [SafetySuggestionsStatus]"></asp:SqlDataSource> <asp:Button ID="confirmButton" runat="server" Text="Confirm" OnClientClick="javascript:return confirm('Are you sure you want to send an email notification about the safety suggestion to the owner?')" OnClick="btnSendStatus_Click" /> <asp:Button ID="OKButton" runat="server" Text="Close" /> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> C# code-behind: protected void lnkSuggestionStatus_Click(object sender, EventArgs e) { LinkButton lnkSuggestionStatus = sender as LinkButton; //var safetySuggestionsId = //get reference to the row selected GridViewRow gvrow = (GridViewRow)lnkSuggestionStatus.NamingContainer; //set the selected index to the selected row so that the selected row will be highlighted GridView1.SelectedIndex = gvrow.RowIndex; //This HiddenField used to store the value of the ID HiddenField1.Value = GridView1.DataKeys[gvrow.RowIndex].Value.ToString(); //ViewState["Username"] = gvrow.Cells[4].Text; //show the modalPopUp modalPopUpExtender1.Show(); } public void btnSendStatus_Click(object sender, EventArgs e) { //get the ID of the selected suggestion/row var statusID = StatusList.SelectedValue; string connString = "Data Source=localhost\\sqlexpress;Initial Catalog=psspdbTest;Integrated Security=True"; //For updating the status of the safety suggestion string updateCommand = "UPDATE SafetySuggestionsLog SET StatusID= @statusID where ID=@SafetySuggestionsID"; using (SqlConnection conn = new SqlConnection(connString)) { conn.Open(); using (SqlCommand cmd = new SqlCommand(updateCommand, conn)) { cmd.Parameters.AddWithValue("@statusID", Convert.ToInt32(statusID)); cmd.Parameters.AddWithValue("@SafetySuggestionsID", Convert.ToInt32(HiddenField1.Value)); cmd.ExecuteNonQuery(); } //reset the value of hiddenfield HiddenField1.Value = "-1"; } GridView1.DataBind(); SendSuggestionStatusToUser(statusID); }
c#
asp.net
sql-server-2008-r2
null
null
null
open
How to check or highlight the pre-selected option in the ModalPopUoExtender with GridView? === I am using Ajax ModalPopUpExtender control to update one column (Status column) in the GridView. Everything works fine. But what I want now is: When I click on one of these status, I want the Ajax ModalPopUp Window to be opened with specifiying the status in the options listed inside the ModalPopUpExtender. For example, if the status is Approved, and I have four options be listed in the ModalPopUpExtender, the Approved option should be checked or highlighted. **So how to do that?** ASP.NET Code: <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" width="900px" CssClass="mGrid" DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound"> <AlternatingRowStyle BackColor="White" ForeColor="#284775" CssClass="alt" /> <HeaderStyle Font-Bold = "True" ForeColor="Black" Height="20px"/> <Columns> <asp:BoundField DataField="ID" HeaderText="No." InsertVisible="False" ReadOnly="True" SortExpression="ID" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /> <asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" /> <asp:BoundField DataField="DivisionShortcut" HeaderText="Division" SortExpression="DivisionShortcut" /> <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" /> <%-- This to make status be opened and edited through the Ajax ModalPopUp Window --%> <asp:TemplateField HeaderText="Status"> <ItemTemplate> <asp:LinkButton runat="server" ID="lnkSuggestionStatus" Text='<%#Eval("Status")%>' OnClick="lnkSuggestionStatus_Click"> </asp:LinkButton> </ItemTemplate> </asp:TemplateField> <%--<asp:HyperLinkField HeaderText="Status" SortExpression="Status" />--%> </Columns> <RowStyle HorizontalAlign="Center" /> </asp:GridView> <asp:Button runat="server" ID="btnModalPopUp" style="display:none" /> <AjaxToolkit:ModalPopUpExtender ID="modalPopUpExtender1" runat="server" TargetControlID="btnModalPopUp" PopupControlID="pnlPopUp" BackgroundCssClass="popUpStyle" PopupDragHandleControlID="panelDragHandle" OkControlID="OKButton"> </AjaxToolkit:ModalPopUpExtender> <asp:HiddenField ID="HiddenField1" runat="server"/> <asp:Panel runat="server" ID="pnlPopUp" CssClass="popUpStyle"> <asp:RadioButtonList ID="StatusList" runat="server" RepeatColumns="1" RepeatDirection="Vertical" RepeatLayout="Table" TextAlign="Right" DataSourceID="SuggestionStatusDataSource" DataTextField="Status" DataValueField="ID"> <asp:ListItem id="option1" runat="server" Value="ACTIONED" /> <asp:ListItem id="option2" runat="server" Value="APPROVED" /> <asp:ListItem id="option3" runat="server" Value="PENDING" /> <asp:ListItem id="option4" runat="server" Value="TRANSFERRED" /> </asp:RadioButtonList> <asp:SqlDataSource ID="SuggestionStatusDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>" SelectCommand="SELECT * FROM [SafetySuggestionsStatus]"></asp:SqlDataSource> <asp:Button ID="confirmButton" runat="server" Text="Confirm" OnClientClick="javascript:return confirm('Are you sure you want to send an email notification about the safety suggestion to the owner?')" OnClick="btnSendStatus_Click" /> <asp:Button ID="OKButton" runat="server" Text="Close" /> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> C# code-behind: protected void lnkSuggestionStatus_Click(object sender, EventArgs e) { LinkButton lnkSuggestionStatus = sender as LinkButton; //var safetySuggestionsId = //get reference to the row selected GridViewRow gvrow = (GridViewRow)lnkSuggestionStatus.NamingContainer; //set the selected index to the selected row so that the selected row will be highlighted GridView1.SelectedIndex = gvrow.RowIndex; //This HiddenField used to store the value of the ID HiddenField1.Value = GridView1.DataKeys[gvrow.RowIndex].Value.ToString(); //ViewState["Username"] = gvrow.Cells[4].Text; //show the modalPopUp modalPopUpExtender1.Show(); } public void btnSendStatus_Click(object sender, EventArgs e) { //get the ID of the selected suggestion/row var statusID = StatusList.SelectedValue; string connString = "Data Source=localhost\\sqlexpress;Initial Catalog=psspdbTest;Integrated Security=True"; //For updating the status of the safety suggestion string updateCommand = "UPDATE SafetySuggestionsLog SET StatusID= @statusID where ID=@SafetySuggestionsID"; using (SqlConnection conn = new SqlConnection(connString)) { conn.Open(); using (SqlCommand cmd = new SqlCommand(updateCommand, conn)) { cmd.Parameters.AddWithValue("@statusID", Convert.ToInt32(statusID)); cmd.Parameters.AddWithValue("@SafetySuggestionsID", Convert.ToInt32(HiddenField1.Value)); cmd.ExecuteNonQuery(); } //reset the value of hiddenfield HiddenField1.Value = "-1"; } GridView1.DataBind(); SendSuggestionStatusToUser(statusID); }
0
11,372,980
07/07/2012 06:58:08
1,508,358
07/07/2012 06:27:53
1
0
Showing value OUTPUT beside range input html5 slider
I have a page layout that I rather not break, and on the particular page ( http://www.evolvedtools.com/hardwareTools.html ) I have a range slider that I have been playing with. I have been looking at some examples where people have been able to constantly display the value of the slider, alongside the handle , as it is being moved. The values are not what's important for now, but rather the implementation in my existing code. I am not willing to restructure my whole page to fit it in. In the code for my page I have commented out the code for a "bubble" solution I picked up on the net. It produces a little container that is supposed to follow the range slider and display a value for it. It doesn't work for me though, and I am not all that surprised, as I guess the implementation is a little bit more difficult in my case than the example..... ( Example: http://css-tricks.com/value-bubbles-for-range-inputs/) I see that it makes use of webkit elements also, which I don't like... **So my question is: Where would I have to go from here to implement such a feature ?** HTML for the page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Hardware Tools</title> <link href="evolvedMobile.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 0px) and (max-width: 650px)" id="stylesheet-650" /> <link href="evolvedTablet.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 651px) and (max-width: 1000px)" id="stylesheet-800" /> <link href="oneColLiqCtr.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 1001px)" id="stylesheet-1920" /> <script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script> <Script type="text/javascript" src="respond.min.js"></Script> <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script> <Script type="text/javascript" src="Javascript Cookie Script.js"></Script> <script type="text/javascript"> function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function MM_effectAppearFade(targetElement, duration, from, to, toggle) { Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle}); } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } </script> <style type="text/css"> body,td,th { font-size: 0.70em; font-family: "Arial Black", Gadget, sans-serif; } </style> </head> <body bgcolor="#000000" onload="MM_preloadImages('images/HomeMainBlank2_03.png','images/HomeButton_03.png','images/ToolingButtonBlank2_07.png','images/BlogBlankM_07.png','images/Script_07.png','images/PluginTheory_05.png','images/flashBack_12.png','images/umlPage_12.png')"> <div class="TabWrapContent" id="wrapperExt"> <div id="homebutton"><a href="index.html" onmouseover="MM_swapImage('homebutton','','images/HomeButton_03.png',1)"onMouseOut="Set_Cookie('homeHardware','TRUE','','','','')"><img src="images/HomeMainBlank2_03.png" alt="HomeMain" name="homebutton" width="138" height="55" border="0" class="AllElements" id="homebutton2" /></a></div> <div id="PluginM"><a href="PluginT.html" onmouseover="MM_swapImage('PluginM','','images/PluginTheory_05.png',1)"onMouseOut="Set_Cookie('PluginFromHardware','TRUE','','','','')"><img src="images/ToolingButtonBlank2_07.png" name="PluginM" width="142" height="55" border="0" class="AllElements" id="PluginM2" /></a></div> <div id="Scripting"><a href="ScriptsT.html" onmouseover="MM_swapImage('Scripting','','images/Script_07.png',1)"onMouseOut="Set_Cookie('ScriptingFromHardware','TRUE','','','','')"><img src="images/BlogBlankM_07.png" name="Scripting" width="135" height="55" border="0" class="AllElements" id="Scripting2" /></a></div> <div id="umlTools"><a href="UmlTools.html" onmouseover="MM_swapImage('umlTools','','images/umlPage_12.png',1)"onMouseOut="Set_Cookie('umlToolsFromHardware','TRUE','','','','')"><img src="images/flashBack_12.png" name="umlTools" width="125" height="55" border="0" class="AllElements" id="umlTools2" /></a></div> </div> </div> <div id="contentWrap"> <div id="wrapperExt2"> <p> </p> <p><span style="font-size:1em;">Hardware Tools</span> is a term I hope will seem pretty self explanatory. This page is meant for descriptions of useful hardware electronic and ergonomical tools. To get a decent workflow going it is increasingly important to multitask, even when doing art or design - work. People have preferences according to their profession or field of interest, but the designer aspect is emphasized here. Also note that I am here referring to more or less mobile solutions for the individual designer.<br /> <br /> Firstly, for me I have slowly come to the conclusion that your workstation(read laptop/pc) and its specs are not going to be the piece of equipment that is most importent to you. With a decent processor, graphics card and installed memory you really can squeeze A LOT out of your mid -range machine. I will take examples from my own setup here to show you what I mean, and the interconnectivity you can acchieve through peripherals. I am talking everything from tuning software, through harware add - on's, to monitors, tablets, cell phones, networks, graphical equipment, etc..<br /> <br />Both at home, at work and on- the- go there is increasing need for efficiency and productivity. But the large workstations are on their way out. Ordinary desktops, desktop monitors and the like have seen their glory days, and efficient computer development reduces the need for large hardware solutions. Computing is being distributed across several pieces of equipment, as opposed to being centered in a core. Mechanically, this can be seen in solutions like the ones where your average laptop has its capacity expanded by establishing an externally housed pci-express card through the laptop's expresscard slot. Storage solutions working on cloud platforms make the need for tactile storage components redundant. This eliminates a lot of permanent hardware- needs for the traveler. And then you have visual aspect with screen real estate being a keyword. As an example here I would like to refer to a brand by the name of <a href="#" onclick="MM_openBrWindow('http://www.displaylink.com','','scrollbars=yes,resizable=yes,width=625,height=625')">DisplayLink</a>. This is a company that develops solutions for USB - connected Display solutions, like portable monitors. They make use of their own graphic adapters in the hardware, so you are not limited to the ordinary 1 extra display per standard workstation. With USB 3.0 making its presence felt, the bandwith will allow these solutions to get even better. This is of course due to the higher bandwidth that the new USB provides. On a regular pc you can connect up to 6 USB displays, and 4 for the Mac. On Windows multipoint server up to 14 displays are supported. This is of course without counting the extra displays supported by your graphics card/s. The ingenious thing about these products is the way they relieve the stress on your main hardware in that they distribute the graphics computing to several instances. This means you do not have to have a powerhouse pc to be productive on more than two displays. The graphics adapters rely on your internal cpu, but do not need much else. Hook up to any HDMI or DVI monitor or projector anywhere instead of dragging things around with you. I strongly suggest checking out their page and their products(DisplayLink), and see which products they have avaiable for your region. <br />I am currently using several DL-3500 chip graphics adapters for 1920x1200 monitors connected to my laptop. They are small and handy and I can take them with me and hook them up anywhere for more screen real estate. The difference between the fluidity of a usb 3.0 monitor setup and a usb 2.0 one is quite noticable. The adapters are really pretty gentle on your processor though, so no big worries there. I know other companies have produced solutions for multiple monitors earlier, but those looking for extensive monitor setup nowadays should test a multi monitor usb 3.0 hub from DisplayLink. And if you are going to the desolute place that doesn't have any kind of stationary monitors available you can always get one of the highly affordable, portable USB displays(Also Displaylink) and put it in you backpack. But we don't have to stop there. Finally good ultra - portable projectors with HD - resolution have started to hit the market, and I mean projectors that both have decent spesifications, are extremely portable and don't have lamps that have to be changed. Brightness, colors and resolution have usually been poor in these kind of devices, but the bar has been raised.<br /> <br />So what else would a nomad designer need ? Well, for one thing touch would be nice! And while we're at it, graphical capabilities would also be something many would crave. So lets have a look at the options. If you are using a internet tablet with touch( Android or ios), you can now use it as an extended desktop. A lot of tablets have something called a ADB composite interface(Android Debug Bridge), which is a way for your computer to interact with your tablets file system. It is also a way of enabling software developers to make applications that let you control your computer from your tablet, not only your tablet from your computer. An example is the software application <a href="#" onclick="MM_openBrWindow('http://www.shapeservices.com/en/products/details.php?product=idisplay&platform=android','','scrollbars=yes,resizable=yes,width=625,height=625')">IDisplay</a> from Shapeservices, which lets you connect your tablet via the composite USB cabel and use your tablet as an extended desktop. The nice thing about this is that you can use input from your tablet(Touch with fingers, stylus pen, keyboard, mouse) to control applications on your computers operative system. While graphically this is mostly for sketching, it can also be used succsessfully in other applications. Also this software enables you to connect through any wireless connection, so you are not limited to the composite cable if you don't have it. Which brings me to the point of networks.<br /> <br />4G wireless modems have hit the market some time ago, but they are not limited to a dongle in the side of your laptop. In fact they can and will feed your whole household with an internet connection if you use it right. Simple as this: Almost all routers use linux software, so the problem has been developing drivers for using the USB 4g dongles with a USB - enabled router. I am currently very successfully using a <a href="#" onclick="MM_openBrWindow('http://www.draytek.com/user/PdInfoDetail.php?Id=121','','scrollbars=yes,resizable=yes,width=625,height=625')">Draytek</a> Vigorfly200 802.11b/g/n router connected to my Netcom 4g dongle, and besides being fast I can take it with me everywhere and (depending on location) still get the same fast speed for everyone to use. If you are streaming or connecting devices wirelessly, this is gold! They have written drivers for 4g dongles, so a firmware update does all the work for you.<br /> <br />But, returning to graphic designer work, there are some options that I feel have completely erased the need for things like the traditional paper - based drawing surface. The reason I am saying this is that these tools are so precise and make the transition from computer to drawing so minimal, that the thought process of designing/programming/sketching becomes a lot more interesting and intuitive. The problem with relatively great products earlier that use a separate mat surface for drawing, separate from the screen, is the hand/eye coordination. I have used one myself and still occasionally do, but there is no question whatsoever that seeing the direct result of your brush stroke without having to move your eyes one way or the other is a better way of interacting with your work. Why drive your car with a remote control if you can sit inside ? Let's go straight to the products, and you can judge for yourself. The king of the hill is as of now the <a href="#" onclick="MM_openBrWindow('http://www.wacom.com/en/Products/Cintiq.aspx','','scrollbars=yes,resizable=yes,width=625,height=625')">Wacom Cintiq 24HD</a>, which lets you draw on a supreme ergonomical- design monitor with detailing and specifications that will satisfy any business. It works also of course as an extended desktop, so again you get increased productivity. I am not going to say more, but take a look for yourself. Of course, these products are kind of pricy, but there are alternatives. Chinese Yiynova produce three notable drawing monitors in <a href="#" onclick="MM_openBrWindow('http://www.amazon.com/Brand-Yiynova-Digitizer-Tablet-Display/dp/B005EDNAPU','','scrollbars=yes,resizable=yes,width=625,height=625')">10"</a>, <a href="#" onclick="MM_openBrWindow('http://www.amazon.com/Yiynova-Monitor-MSP15-Adjustable-Support-Windows/dp/B005EIF3BY','','scrollbars=yes,resizable=yes,width=625,height=625')">15"</a> and <a href="#" onclick="MM_openBrWindow('http://www.amazon.com/Yiynova-Tablet-MSP19-19inch-1440x900/sim/B004CUT6NG/2','','scrollbars=yes,resizable=yes,width=625,height=625')">19"</a>, and while their spesifications are as good as most of the wacom's, the prices are way lower. Again, you have to decide for yourself.<br /> <br />Moving on to add- on products, I would like to mention the standards of EsataP and USB 3.0. If you have a 2 year old mid - range machine, chances are you do not have the new USB 3.0 ports. For quite a while I have been using the esatap ( external sata powered) port on my computer for external harddisk backup. SATA is a computer bus interface for connecting host bus adapters to mass storage devices such as hard disk drives and optical drives. On a lot of laptops or desktops you have the possibility of either installing an esata card or you may have an esataP port on your laptop. What you in fact then have is a combined USB/esata port with speed that nearly rivals the new USB 3.0 standard. Using an esatap cable you can get up to 100 MBytes/s transfer speeds to or from your external drives for now. The port conncets directly to your sata harddrive, so the theoretical speed is 3GBit/s which is 375Mbytes/s, or in practice more like 300MB. If you have one of these ports I strongly suggest you use it. People have made a big deal about the need for shutting down your system before removing your esatap device, but that is completely unneccesary. I will just say <a href="#" onclick="MM_openBrWindow('http://mt-naka.com/hotswap/index_enu.htm','','scrollbars=yes,resizable=yes,width=625,height=625')">HotSwap</a>.<br /> <br />If you have an expresscard 34 or 54 slot you can of course add an expresscard with usb 3.0 port/s, but tests show that the expresscard interface and the 2.5Gbit/s limit of your revision 1.0 or 1.1 pci-e will not give you full USB 3.0 speeds, and even if you had a revision 2.0 or later (5GBit/s), you would still have to have have the ExpressCard 2.0 slot on your machine, as only this makes use of the full bandwith of the USB superspeed(3.0). With the more ordinary ExpressCard 1.0 slot you still get 2.5 GBit/s which is actually very much faster than USB 2.0.<br /> <br /> More to follow.....</p> </div> </div> <div class="slider" input type="range" name="eivi" max="-6" min="2000" step="1" value="0"> <div class="progress" style="width: 3px;"></div> <a class="handle" style="top: 0px;"></a> </div> <!--<div class="output"> <output for="eivi" onforminput="value"></output> </div>--> <script type="text/javascript"> // get handle to the scrollable DIV var wrapperExt2 = $("#wrapperExt2"); // initialize rangeinput $(":range").rangeinput({ // slide the DIV along with the range using jQuery's css() method onSlide: function(ev, step) { wrapperExt2.css({bottom: step}); }, // display progressbar progress: true, // initial value. also sets the DIV's initial scroll position value: 0, // this is called when the slider is clicked. we animate the DIV change: function(e, i) { wrapperExt2.animate({bottom: i}, "fast"); }, // disable drag handle animation when when slider is clicked speed: 0 }); </script> /* <script type="text/javascript"> $(function() { var el, newPoint, newPlace, offset; // Select all range inputs, watch for change $("input[type='range']").change(function() { // Cache this for efficiency el = $(this); // Measure width of range input height = el.height(); // Figure out placement percentage between left and right of input newPoint = (el.val() - el.attr("min")) / (el.attr("max") - el.attr("min")); // Janky value to get pointer to line up better offset = -1.3; // Prevent bubble from going beyond left or right (unsupported browsers) if (newPoint < 0) { newPlace = 0; } else if (newPoint > 1) { newPlace = height; } else { newPlace = width * newPoint + offset; offset -= newPoint; } // Move bubble el .next("output") .css({ top: newPlace, marginLeft: offset + "%" }) .text(el.val()); }) // Fake a change to position bubble at page load .trigger('change'); }); </script> */ <script type="text/javascript"> if (Get_Cookie('homeHardware')) { document.getElementById('homebutton2').src="images/HomeButton_03.png" ; } if (Get_Cookie('PluginFromHardware')) { document.getElementById('PluginM2').src="images/PluginTheory_05.png" ; } if (Get_Cookie('ScriptingFromHardware')) { document.getElementById('Scripting2').src="images/Script_07.png" ; } if (Get_Cookie('umlToolsFromHardware')) { document.getElementById('umlTools2').src="images/umlPage_12.png" ; } </script> </body> </html> CSS ( for the "bubble element"): /*.output { position: absolute; background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#999999)); background-image: -webkit-linear-gradient(top, #444444, #999999); background-image: -moz-linear-gradient(top, #444444, #999999); background-image: -ms-linear-gradient(top, #444444, #999999); background-image: -o-linear-gradient(top, #444444, #999999); width: 30px; height: 40px; text-align: center; color: white; border-radius: 10px; display: inline-block; font: bold 15px/30px Georgia; top: 50%; left: 100%; margin-top: -195px; margin-right: -185px; margin-bottom: 1%; margin-left: -180px; /*bottom: 175%; left: 0; margin-left: -1%; */ } .output:after { content: ""; position: absolute; width: 0; height: 0; border-top: 10px solid #999999; border-left: 5px solid transparent; border-right: 5px solid transparent; top: 100%; left: 50%; margin-left: -5px; margin-top: -1px; } */
html5
null
null
null
null
null
open
Showing value OUTPUT beside range input html5 slider === I have a page layout that I rather not break, and on the particular page ( http://www.evolvedtools.com/hardwareTools.html ) I have a range slider that I have been playing with. I have been looking at some examples where people have been able to constantly display the value of the slider, alongside the handle , as it is being moved. The values are not what's important for now, but rather the implementation in my existing code. I am not willing to restructure my whole page to fit it in. In the code for my page I have commented out the code for a "bubble" solution I picked up on the net. It produces a little container that is supposed to follow the range slider and display a value for it. It doesn't work for me though, and I am not all that surprised, as I guess the implementation is a little bit more difficult in my case than the example..... ( Example: http://css-tricks.com/value-bubbles-for-range-inputs/) I see that it makes use of webkit elements also, which I don't like... **So my question is: Where would I have to go from here to implement such a feature ?** HTML for the page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Hardware Tools</title> <link href="evolvedMobile.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 0px) and (max-width: 650px)" id="stylesheet-650" /> <link href="evolvedTablet.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 651px) and (max-width: 1000px)" id="stylesheet-800" /> <link href="oneColLiqCtr.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 1001px)" id="stylesheet-1920" /> <script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script> <Script type="text/javascript" src="respond.min.js"></Script> <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script> <Script type="text/javascript" src="Javascript Cookie Script.js"></Script> <script type="text/javascript"> function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function MM_effectAppearFade(targetElement, duration, from, to, toggle) { Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle}); } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } </script> <style type="text/css"> body,td,th { font-size: 0.70em; font-family: "Arial Black", Gadget, sans-serif; } </style> </head> <body bgcolor="#000000" onload="MM_preloadImages('images/HomeMainBlank2_03.png','images/HomeButton_03.png','images/ToolingButtonBlank2_07.png','images/BlogBlankM_07.png','images/Script_07.png','images/PluginTheory_05.png','images/flashBack_12.png','images/umlPage_12.png')"> <div class="TabWrapContent" id="wrapperExt"> <div id="homebutton"><a href="index.html" onmouseover="MM_swapImage('homebutton','','images/HomeButton_03.png',1)"onMouseOut="Set_Cookie('homeHardware','TRUE','','','','')"><img src="images/HomeMainBlank2_03.png" alt="HomeMain" name="homebutton" width="138" height="55" border="0" class="AllElements" id="homebutton2" /></a></div> <div id="PluginM"><a href="PluginT.html" onmouseover="MM_swapImage('PluginM','','images/PluginTheory_05.png',1)"onMouseOut="Set_Cookie('PluginFromHardware','TRUE','','','','')"><img src="images/ToolingButtonBlank2_07.png" name="PluginM" width="142" height="55" border="0" class="AllElements" id="PluginM2" /></a></div> <div id="Scripting"><a href="ScriptsT.html" onmouseover="MM_swapImage('Scripting','','images/Script_07.png',1)"onMouseOut="Set_Cookie('ScriptingFromHardware','TRUE','','','','')"><img src="images/BlogBlankM_07.png" name="Scripting" width="135" height="55" border="0" class="AllElements" id="Scripting2" /></a></div> <div id="umlTools"><a href="UmlTools.html" onmouseover="MM_swapImage('umlTools','','images/umlPage_12.png',1)"onMouseOut="Set_Cookie('umlToolsFromHardware','TRUE','','','','')"><img src="images/flashBack_12.png" name="umlTools" width="125" height="55" border="0" class="AllElements" id="umlTools2" /></a></div> </div> </div> <div id="contentWrap"> <div id="wrapperExt2"> <p> </p> <p><span style="font-size:1em;">Hardware Tools</span> is a term I hope will seem pretty self explanatory. This page is meant for descriptions of useful hardware electronic and ergonomical tools. To get a decent workflow going it is increasingly important to multitask, even when doing art or design - work. People have preferences according to their profession or field of interest, but the designer aspect is emphasized here. Also note that I am here referring to more or less mobile solutions for the individual designer.<br /> <br /> Firstly, for me I have slowly come to the conclusion that your workstation(read laptop/pc) and its specs are not going to be the piece of equipment that is most importent to you. With a decent processor, graphics card and installed memory you really can squeeze A LOT out of your mid -range machine. I will take examples from my own setup here to show you what I mean, and the interconnectivity you can acchieve through peripherals. I am talking everything from tuning software, through harware add - on's, to monitors, tablets, cell phones, networks, graphical equipment, etc..<br /> <br />Both at home, at work and on- the- go there is increasing need for efficiency and productivity. But the large workstations are on their way out. Ordinary desktops, desktop monitors and the like have seen their glory days, and efficient computer development reduces the need for large hardware solutions. Computing is being distributed across several pieces of equipment, as opposed to being centered in a core. Mechanically, this can be seen in solutions like the ones where your average laptop has its capacity expanded by establishing an externally housed pci-express card through the laptop's expresscard slot. Storage solutions working on cloud platforms make the need for tactile storage components redundant. This eliminates a lot of permanent hardware- needs for the traveler. And then you have visual aspect with screen real estate being a keyword. As an example here I would like to refer to a brand by the name of <a href="#" onclick="MM_openBrWindow('http://www.displaylink.com','','scrollbars=yes,resizable=yes,width=625,height=625')">DisplayLink</a>. This is a company that develops solutions for USB - connected Display solutions, like portable monitors. They make use of their own graphic adapters in the hardware, so you are not limited to the ordinary 1 extra display per standard workstation. With USB 3.0 making its presence felt, the bandwith will allow these solutions to get even better. This is of course due to the higher bandwidth that the new USB provides. On a regular pc you can connect up to 6 USB displays, and 4 for the Mac. On Windows multipoint server up to 14 displays are supported. This is of course without counting the extra displays supported by your graphics card/s. The ingenious thing about these products is the way they relieve the stress on your main hardware in that they distribute the graphics computing to several instances. This means you do not have to have a powerhouse pc to be productive on more than two displays. The graphics adapters rely on your internal cpu, but do not need much else. Hook up to any HDMI or DVI monitor or projector anywhere instead of dragging things around with you. I strongly suggest checking out their page and their products(DisplayLink), and see which products they have avaiable for your region. <br />I am currently using several DL-3500 chip graphics adapters for 1920x1200 monitors connected to my laptop. They are small and handy and I can take them with me and hook them up anywhere for more screen real estate. The difference between the fluidity of a usb 3.0 monitor setup and a usb 2.0 one is quite noticable. The adapters are really pretty gentle on your processor though, so no big worries there. I know other companies have produced solutions for multiple monitors earlier, but those looking for extensive monitor setup nowadays should test a multi monitor usb 3.0 hub from DisplayLink. And if you are going to the desolute place that doesn't have any kind of stationary monitors available you can always get one of the highly affordable, portable USB displays(Also Displaylink) and put it in you backpack. But we don't have to stop there. Finally good ultra - portable projectors with HD - resolution have started to hit the market, and I mean projectors that both have decent spesifications, are extremely portable and don't have lamps that have to be changed. Brightness, colors and resolution have usually been poor in these kind of devices, but the bar has been raised.<br /> <br />So what else would a nomad designer need ? Well, for one thing touch would be nice! And while we're at it, graphical capabilities would also be something many would crave. So lets have a look at the options. If you are using a internet tablet with touch( Android or ios), you can now use it as an extended desktop. A lot of tablets have something called a ADB composite interface(Android Debug Bridge), which is a way for your computer to interact with your tablets file system. It is also a way of enabling software developers to make applications that let you control your computer from your tablet, not only your tablet from your computer. An example is the software application <a href="#" onclick="MM_openBrWindow('http://www.shapeservices.com/en/products/details.php?product=idisplay&platform=android','','scrollbars=yes,resizable=yes,width=625,height=625')">IDisplay</a> from Shapeservices, which lets you connect your tablet via the composite USB cabel and use your tablet as an extended desktop. The nice thing about this is that you can use input from your tablet(Touch with fingers, stylus pen, keyboard, mouse) to control applications on your computers operative system. While graphically this is mostly for sketching, it can also be used succsessfully in other applications. Also this software enables you to connect through any wireless connection, so you are not limited to the composite cable if you don't have it. Which brings me to the point of networks.<br /> <br />4G wireless modems have hit the market some time ago, but they are not limited to a dongle in the side of your laptop. In fact they can and will feed your whole household with an internet connection if you use it right. Simple as this: Almost all routers use linux software, so the problem has been developing drivers for using the USB 4g dongles with a USB - enabled router. I am currently very successfully using a <a href="#" onclick="MM_openBrWindow('http://www.draytek.com/user/PdInfoDetail.php?Id=121','','scrollbars=yes,resizable=yes,width=625,height=625')">Draytek</a> Vigorfly200 802.11b/g/n router connected to my Netcom 4g dongle, and besides being fast I can take it with me everywhere and (depending on location) still get the same fast speed for everyone to use. If you are streaming or connecting devices wirelessly, this is gold! They have written drivers for 4g dongles, so a firmware update does all the work for you.<br /> <br />But, returning to graphic designer work, there are some options that I feel have completely erased the need for things like the traditional paper - based drawing surface. The reason I am saying this is that these tools are so precise and make the transition from computer to drawing so minimal, that the thought process of designing/programming/sketching becomes a lot more interesting and intuitive. The problem with relatively great products earlier that use a separate mat surface for drawing, separate from the screen, is the hand/eye coordination. I have used one myself and still occasionally do, but there is no question whatsoever that seeing the direct result of your brush stroke without having to move your eyes one way or the other is a better way of interacting with your work. Why drive your car with a remote control if you can sit inside ? Let's go straight to the products, and you can judge for yourself. The king of the hill is as of now the <a href="#" onclick="MM_openBrWindow('http://www.wacom.com/en/Products/Cintiq.aspx','','scrollbars=yes,resizable=yes,width=625,height=625')">Wacom Cintiq 24HD</a>, which lets you draw on a supreme ergonomical- design monitor with detailing and specifications that will satisfy any business. It works also of course as an extended desktop, so again you get increased productivity. I am not going to say more, but take a look for yourself. Of course, these products are kind of pricy, but there are alternatives. Chinese Yiynova produce three notable drawing monitors in <a href="#" onclick="MM_openBrWindow('http://www.amazon.com/Brand-Yiynova-Digitizer-Tablet-Display/dp/B005EDNAPU','','scrollbars=yes,resizable=yes,width=625,height=625')">10"</a>, <a href="#" onclick="MM_openBrWindow('http://www.amazon.com/Yiynova-Monitor-MSP15-Adjustable-Support-Windows/dp/B005EIF3BY','','scrollbars=yes,resizable=yes,width=625,height=625')">15"</a> and <a href="#" onclick="MM_openBrWindow('http://www.amazon.com/Yiynova-Tablet-MSP19-19inch-1440x900/sim/B004CUT6NG/2','','scrollbars=yes,resizable=yes,width=625,height=625')">19"</a>, and while their spesifications are as good as most of the wacom's, the prices are way lower. Again, you have to decide for yourself.<br /> <br />Moving on to add- on products, I would like to mention the standards of EsataP and USB 3.0. If you have a 2 year old mid - range machine, chances are you do not have the new USB 3.0 ports. For quite a while I have been using the esatap ( external sata powered) port on my computer for external harddisk backup. SATA is a computer bus interface for connecting host bus adapters to mass storage devices such as hard disk drives and optical drives. On a lot of laptops or desktops you have the possibility of either installing an esata card or you may have an esataP port on your laptop. What you in fact then have is a combined USB/esata port with speed that nearly rivals the new USB 3.0 standard. Using an esatap cable you can get up to 100 MBytes/s transfer speeds to or from your external drives for now. The port conncets directly to your sata harddrive, so the theoretical speed is 3GBit/s which is 375Mbytes/s, or in practice more like 300MB. If you have one of these ports I strongly suggest you use it. People have made a big deal about the need for shutting down your system before removing your esatap device, but that is completely unneccesary. I will just say <a href="#" onclick="MM_openBrWindow('http://mt-naka.com/hotswap/index_enu.htm','','scrollbars=yes,resizable=yes,width=625,height=625')">HotSwap</a>.<br /> <br />If you have an expresscard 34 or 54 slot you can of course add an expresscard with usb 3.0 port/s, but tests show that the expresscard interface and the 2.5Gbit/s limit of your revision 1.0 or 1.1 pci-e will not give you full USB 3.0 speeds, and even if you had a revision 2.0 or later (5GBit/s), you would still have to have have the ExpressCard 2.0 slot on your machine, as only this makes use of the full bandwith of the USB superspeed(3.0). With the more ordinary ExpressCard 1.0 slot you still get 2.5 GBit/s which is actually very much faster than USB 2.0.<br /> <br /> More to follow.....</p> </div> </div> <div class="slider" input type="range" name="eivi" max="-6" min="2000" step="1" value="0"> <div class="progress" style="width: 3px;"></div> <a class="handle" style="top: 0px;"></a> </div> <!--<div class="output"> <output for="eivi" onforminput="value"></output> </div>--> <script type="text/javascript"> // get handle to the scrollable DIV var wrapperExt2 = $("#wrapperExt2"); // initialize rangeinput $(":range").rangeinput({ // slide the DIV along with the range using jQuery's css() method onSlide: function(ev, step) { wrapperExt2.css({bottom: step}); }, // display progressbar progress: true, // initial value. also sets the DIV's initial scroll position value: 0, // this is called when the slider is clicked. we animate the DIV change: function(e, i) { wrapperExt2.animate({bottom: i}, "fast"); }, // disable drag handle animation when when slider is clicked speed: 0 }); </script> /* <script type="text/javascript"> $(function() { var el, newPoint, newPlace, offset; // Select all range inputs, watch for change $("input[type='range']").change(function() { // Cache this for efficiency el = $(this); // Measure width of range input height = el.height(); // Figure out placement percentage between left and right of input newPoint = (el.val() - el.attr("min")) / (el.attr("max") - el.attr("min")); // Janky value to get pointer to line up better offset = -1.3; // Prevent bubble from going beyond left or right (unsupported browsers) if (newPoint < 0) { newPlace = 0; } else if (newPoint > 1) { newPlace = height; } else { newPlace = width * newPoint + offset; offset -= newPoint; } // Move bubble el .next("output") .css({ top: newPlace, marginLeft: offset + "%" }) .text(el.val()); }) // Fake a change to position bubble at page load .trigger('change'); }); </script> */ <script type="text/javascript"> if (Get_Cookie('homeHardware')) { document.getElementById('homebutton2').src="images/HomeButton_03.png" ; } if (Get_Cookie('PluginFromHardware')) { document.getElementById('PluginM2').src="images/PluginTheory_05.png" ; } if (Get_Cookie('ScriptingFromHardware')) { document.getElementById('Scripting2').src="images/Script_07.png" ; } if (Get_Cookie('umlToolsFromHardware')) { document.getElementById('umlTools2').src="images/umlPage_12.png" ; } </script> </body> </html> CSS ( for the "bubble element"): /*.output { position: absolute; background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#999999)); background-image: -webkit-linear-gradient(top, #444444, #999999); background-image: -moz-linear-gradient(top, #444444, #999999); background-image: -ms-linear-gradient(top, #444444, #999999); background-image: -o-linear-gradient(top, #444444, #999999); width: 30px; height: 40px; text-align: center; color: white; border-radius: 10px; display: inline-block; font: bold 15px/30px Georgia; top: 50%; left: 100%; margin-top: -195px; margin-right: -185px; margin-bottom: 1%; margin-left: -180px; /*bottom: 175%; left: 0; margin-left: -1%; */ } .output:after { content: ""; position: absolute; width: 0; height: 0; border-top: 10px solid #999999; border-left: 5px solid transparent; border-right: 5px solid transparent; top: 100%; left: 50%; margin-left: -5px; margin-top: -1px; } */
0
11,372,981
07/07/2012 06:58:11
1,451,579
06/12/2012 15:08:01
1
0
Whether the Monodroid supports java.lang.reflect namespace methods?
I need to use methods of java.lang.reflect in Monodroid solution. But i can't find this namespace
reflection
mono
monodroid
null
null
null
open
Whether the Monodroid supports java.lang.reflect namespace methods? === I need to use methods of java.lang.reflect in Monodroid solution. But i can't find this namespace
0
11,372,983
07/07/2012 06:58:24
1,132,553
01/05/2012 15:56:29
11
1
pan gesture cause crash in subview?
I create a project as Single View Application with initial ViewController; add subViewController to project. UIImageView with pan gesture are added in both of the view controllers. It works in viewController.m, but when it is added to subViewController and the subview is added as subview into view controller, the program just crash with "Exc_bad_access".. Anyone has some solution? here is my code: ViewController.m #import "ViewController.h" #import "SubViewController.h" //#define SUB @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; #ifdef SUB SubViewController *sb = [[SubViewController alloc] init]; [self.view addSubview:sb.view]; #else UIImageView* img_ = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"monkey_1.png"]]; img_.userInteractionEnabled = YES; UIPanGestureRecognizer *stampPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; [stampPanGesture setMinimumNumberOfTouches:1]; [stampPanGesture setMaximumNumberOfTouches:1]; [img_ addGestureRecognizer:stampPanGesture]; img_.center = self.view.center; [self.view addSubview:img_]; #endif } - (void)handlePan:(UIPanGestureRecognizer *)recognizer { CGPoint translation = [recognizer translationInView:self.view]; recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y); [recognizer setTranslation:CGPointMake(0, 0) inView:self.view]; } SubViewController.m #import "SubViewController.h" @interface SubViewController () @end @implementation SubViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; UIImageView* img_ = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"monkey_1.png"]]; img_.userInteractionEnabled = YES; UIPanGestureRecognizer *stampPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; [stampPanGesture setMinimumNumberOfTouches:1]; [stampPanGesture setMaximumNumberOfTouches:1]; [img_ addGestureRecognizer:stampPanGesture]; img_.center = self.view.center; [self.view addSubview:img_]; } - (void)handlePan:(UIPanGestureRecognizer *)recognizer { CGPoint translation = [recognizer translationInView:self.view]; recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y); [recognizer setTranslation:CGPointMake(0, 0) inView:self.view]; }
iphone
objective-c
ios
xcode
ipad
null
open
pan gesture cause crash in subview? === I create a project as Single View Application with initial ViewController; add subViewController to project. UIImageView with pan gesture are added in both of the view controllers. It works in viewController.m, but when it is added to subViewController and the subview is added as subview into view controller, the program just crash with "Exc_bad_access".. Anyone has some solution? here is my code: ViewController.m #import "ViewController.h" #import "SubViewController.h" //#define SUB @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; #ifdef SUB SubViewController *sb = [[SubViewController alloc] init]; [self.view addSubview:sb.view]; #else UIImageView* img_ = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"monkey_1.png"]]; img_.userInteractionEnabled = YES; UIPanGestureRecognizer *stampPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; [stampPanGesture setMinimumNumberOfTouches:1]; [stampPanGesture setMaximumNumberOfTouches:1]; [img_ addGestureRecognizer:stampPanGesture]; img_.center = self.view.center; [self.view addSubview:img_]; #endif } - (void)handlePan:(UIPanGestureRecognizer *)recognizer { CGPoint translation = [recognizer translationInView:self.view]; recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y); [recognizer setTranslation:CGPointMake(0, 0) inView:self.view]; } SubViewController.m #import "SubViewController.h" @interface SubViewController () @end @implementation SubViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; UIImageView* img_ = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"monkey_1.png"]]; img_.userInteractionEnabled = YES; UIPanGestureRecognizer *stampPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; [stampPanGesture setMinimumNumberOfTouches:1]; [stampPanGesture setMaximumNumberOfTouches:1]; [img_ addGestureRecognizer:stampPanGesture]; img_.center = self.view.center; [self.view addSubview:img_]; } - (void)handlePan:(UIPanGestureRecognizer *)recognizer { CGPoint translation = [recognizer translationInView:self.view]; recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y); [recognizer setTranslation:CGPointMake(0, 0) inView:self.view]; }
0
11,372,945
07/07/2012 06:52:54
599,841
02/02/2011 10:34:12
469
18
Android- facebook sso log-out session clear
Thanks for previous replies, I am using facebook sso to login my app. the login works fine. but whenever i tried to log-out the session i cant able to do that. the session is not cleared. my question is when using the sso, can we able to logout the session. i am new to this topic, please rectify me if i do anything wrong.
android
facebook
phonegap
null
null
null
open
Android- facebook sso log-out session clear === Thanks for previous replies, I am using facebook sso to login my app. the login works fine. but whenever i tried to log-out the session i cant able to do that. the session is not cleared. my question is when using the sso, can we able to logout the session. i am new to this topic, please rectify me if i do anything wrong.
0
11,372,949
07/07/2012 06:53:16
1,508,354
07/07/2012 06:25:49
1
0
How to overwrite the mapview over pdf file in iphone?
I need to insert the .pdf file into app and i need to set gps over it?That pdf file has to work as map?
iphone
null
null
null
null
null
open
How to overwrite the mapview over pdf file in iphone? === I need to insert the .pdf file into app and i need to set gps over it?That pdf file has to work as map?
0
11,372,987
07/07/2012 06:59:16
293,770
03/15/2010 07:18:17
3
0
load two asp.net UserControl on Demand
i want load two user control on demand asp:UpdatePanel ID="UpdatePanel1" runat="server" ContentTemplate asp:Button ID="Button1" runat="server" Text="Button" UseSubmitBehavior="false" OnClick="Button1_Click" / div id='Div_UserControlPlace' enableviewstate="true" runat="server" /div /ContentTemplate Triggers asp:PostBackTrigger ControlID="Button1" / /Triggers /asp:UpdatePanel asp:UpdatePanel ID="UpdatePanel2" runat="server" ContentTemplate asp:Button ID="Button2" runat="server" Text="Button" UseSubmitBehavior="false" OnClick="Button2_Click" / div id='Div_UserControlPlace2' enableviewstate="true" runat="server" /div /ContentTemplate aspx.cs protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Control FeaturedProductUserControl = new Control(); FeaturedProductUserControl = LoadControl("WebUserControl1.ascx"); FeaturedProductUserControl.EnableViewState = true; Div_UserControlPlace.Controls.Add(FeaturedProductUserControl); } protected void Button2_Click(object sender, EventArgs e) { Control FeaturedProductUserControl2 = new Control(); FeaturedProductUserControl2 = LoadControl("WebUserControl2.ascx"); FeaturedProductUserControl2.EnableViewState = true; Div_UserControlPlace2.Controls.Add(FeaturedProductUserControl2); } i load a first user control with click on first button all thing work properly but when i click on other button for load second UserControl first UserControl dis Appear(Remove) And Second User Control Load Thanks IFA_User [1]: http://i.stack.imgur.com/Kndnn.png
asp.net
c#-4.0
usercontrols
web-user-controls
dynamic-usercontrols
null
open
load two asp.net UserControl on Demand === i want load two user control on demand asp:UpdatePanel ID="UpdatePanel1" runat="server" ContentTemplate asp:Button ID="Button1" runat="server" Text="Button" UseSubmitBehavior="false" OnClick="Button1_Click" / div id='Div_UserControlPlace' enableviewstate="true" runat="server" /div /ContentTemplate Triggers asp:PostBackTrigger ControlID="Button1" / /Triggers /asp:UpdatePanel asp:UpdatePanel ID="UpdatePanel2" runat="server" ContentTemplate asp:Button ID="Button2" runat="server" Text="Button" UseSubmitBehavior="false" OnClick="Button2_Click" / div id='Div_UserControlPlace2' enableviewstate="true" runat="server" /div /ContentTemplate aspx.cs protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Control FeaturedProductUserControl = new Control(); FeaturedProductUserControl = LoadControl("WebUserControl1.ascx"); FeaturedProductUserControl.EnableViewState = true; Div_UserControlPlace.Controls.Add(FeaturedProductUserControl); } protected void Button2_Click(object sender, EventArgs e) { Control FeaturedProductUserControl2 = new Control(); FeaturedProductUserControl2 = LoadControl("WebUserControl2.ascx"); FeaturedProductUserControl2.EnableViewState = true; Div_UserControlPlace2.Controls.Add(FeaturedProductUserControl2); } i load a first user control with click on first button all thing work properly but when i click on other button for load second UserControl first UserControl dis Appear(Remove) And Second User Control Load Thanks IFA_User [1]: http://i.stack.imgur.com/Kndnn.png
0
11,372,960
07/07/2012 06:54:15
289,870
03/09/2010 17:35:32
367
15
calling an interactive bash script over ssh
I'm writing a "tool" - a couple of bash scripts - that automate the installation and configuration on each server in a cluster. The "tool" runs from a primary server. It tars and distributes it's self (via SCP) to every other server and untars the copies via "batch" SSH. During set-up the tool issues remote commands such as the following from the primary server: `echo './run_audit.sh' | ssh host4 'bash -s'`. The approach works in many cases, except when there's interactive behavior since standard input is already in use. Is there a way to run remote bash scripts interactively over SSH? As a starting point, consider the following case: `echo 'read -p "enter name:" name; echo "your name is $name"' | ssh host4 'bash -s'` In the case above the prompt never happens, how do I work around that? Thanks in advance.
bash
scripting
ssh
scp
ssh-tunnel
null
open
calling an interactive bash script over ssh === I'm writing a "tool" - a couple of bash scripts - that automate the installation and configuration on each server in a cluster. The "tool" runs from a primary server. It tars and distributes it's self (via SCP) to every other server and untars the copies via "batch" SSH. During set-up the tool issues remote commands such as the following from the primary server: `echo './run_audit.sh' | ssh host4 'bash -s'`. The approach works in many cases, except when there's interactive behavior since standard input is already in use. Is there a way to run remote bash scripts interactively over SSH? As a starting point, consider the following case: `echo 'read -p "enter name:" name; echo "your name is $name"' | ssh host4 'bash -s'` In the case above the prompt never happens, how do I work around that? Thanks in advance.
0
11,372,962
07/07/2012 06:54:49
1,268,216
03/14/2012 06:08:14
1
0
chrome browser issue with asp.net 3.5 website
I have developed one website in asp.net 3.5. It is perfectly running in all browsers but its flickering in chrome. I am not able to find the reason. What I am doing is, I have 5 type of banners(Header,Footer,Silver,Gold and Diamond) and each one is refreshing on different time. I am using update panels. The URL of the website is http://www.allindiaeducationalhub.com. I will be thankfull if anyone help me
asp.net-3.5
null
null
null
null
null
open
chrome browser issue with asp.net 3.5 website === I have developed one website in asp.net 3.5. It is perfectly running in all browsers but its flickering in chrome. I am not able to find the reason. What I am doing is, I have 5 type of banners(Header,Footer,Silver,Gold and Diamond) and each one is refreshing on different time. I am using update panels. The URL of the website is http://www.allindiaeducationalhub.com. I will be thankfull if anyone help me
0
11,372,988
07/07/2012 06:59:38
631,964
02/24/2011 08:47:52
242
7
Load webpage in div on mouse-over effect of link
I am developing a website (using php, html and css). I have a page for "news and events" which contains list of urls. What I want to do is on mouse-over over a link, a small miniature of the corresponding website should be loaded in a div, so that the user knows what type of news the link contains. I have tried code on mouse-over for images and videos, but unable to do the same for webpage. -Thanks in advance !
javascript
div
mouseout
mousehover
null
null
open
Load webpage in div on mouse-over effect of link === I am developing a website (using php, html and css). I have a page for "news and events" which contains list of urls. What I want to do is on mouse-over over a link, a small miniature of the corresponding website should be loaded in a div, so that the user knows what type of news the link contains. I have tried code on mouse-over for images and videos, but unable to do the same for webpage. -Thanks in advance !
0
11,372,991
07/07/2012 07:00:12
1,090,463
12/09/2011 20:23:45
310
9
vTiger installation ; URL /vtigercrm/ not found
I am trying to install vTigercrm-5.4.0.tar.gz file via ftp path.. and I am following the following [tutorial][1] I uploaded the source file. extracted it to http://<mydomain>/admin now, when I try to access > http://mydomain.com/admin or > `http://mydomain/admin/install.php` I get the following error, > The requested URL /admin/ was not found on this server. > > Additionally, a 404 Not Found error was encountered while trying to > use an ErrorDocument to handle the request. I googled so much about the issue, but I am at failure in resolving it, vtiger forums is not helping also regarding this issue,, Can somebodey tell me why this is happening? what is possible solution? Should I have to introduce .httaccess or something else? I am striking my head for last 10 hours, still at failure, please somebody help me [1]: http://www.tmdhosting.com/tutorials/vtiger/vtiger-installation.html
php
apache
.htaccess
vtiger
null
null
open
vTiger installation ; URL /vtigercrm/ not found === I am trying to install vTigercrm-5.4.0.tar.gz file via ftp path.. and I am following the following [tutorial][1] I uploaded the source file. extracted it to http://<mydomain>/admin now, when I try to access > http://mydomain.com/admin or > `http://mydomain/admin/install.php` I get the following error, > The requested URL /admin/ was not found on this server. > > Additionally, a 404 Not Found error was encountered while trying to > use an ErrorDocument to handle the request. I googled so much about the issue, but I am at failure in resolving it, vtiger forums is not helping also regarding this issue,, Can somebodey tell me why this is happening? what is possible solution? Should I have to introduce .httaccess or something else? I am striking my head for last 10 hours, still at failure, please somebody help me [1]: http://www.tmdhosting.com/tutorials/vtiger/vtiger-installation.html
0
11,372,993
07/07/2012 07:00:36
1,508,360
07/07/2012 06:30:02
1
0
creating a command based logger program
i'm currently trying to make a java program which creates and writes a log file. it has 2 classes (one for request, one for worker code). one class has a textfield and allows you to enter a command. command should be like 'log start' or 'log stop'. so request class sends the command as a string, worker class gets the command, parses it and executes instructions (start logging, stop logging. my problem is: application doesn't stop logging when user enters a 'stop' command. well, it doesn't stop after 3 log entries (that's the problem. i want to stop it any time user enters the command) you will understand the problem better when you take a look at the code. i know i'm making a very basic mistake here but somehow currently can't figure it out and want your opinion on this problem. (i showed the problematic are in the code) Thank you. error: Exception in thread "stoplogging" java.lang.ArrayIndexOutOfBoundsException: 1 at Response$ClientProcess$1StopperThread.run(Response.java:109) at java.lang.Thread.run(Unknown Source) Request class: public class Request extends JFrame { private JTextArea consoleArea = new JTextArea(); private JTextField cmd_prompt = new JTextField(); private JLabel cmd_label = new JLabel("Enter command: "); // ********IP PORT TEXTFIELDS & CONNECT BUTTON******* !!!! private DataOutputStream output; private DataInputStream input; public static void main(String[] args) { new Request(); } Socket socket = null; String command; public Request (){ JPanel requestPanel = new JPanel(); requestPanel.setLayout(new BorderLayout()); setTitle("Project_3002_CLIENT"); requestPanel.add(cmd_label, BorderLayout.WEST); requestPanel.add(cmd_prompt, BorderLayout.CENTER); setLayout(new BorderLayout()); add(requestPanel, BorderLayout.NORTH); add(new JScrollPane(consoleArea), BorderLayout.CENTER); Font font = new Font("Courier New", Font.BOLD, 15); cmd_prompt.setFont(font); cmd_prompt.setAlignmentX(LEFT_ALIGNMENT); cmd_prompt.addActionListener(new TextFieldListener()); setSize(600, 270); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); consoleArea.setFont(font); setVisible(true); String ip = "127.0.0.1"; // THIS WILL BE CHANGED (make custom) --extra jframe int port = 4588; // THIS WILL BE CHANGED (make custom) -- extra jframe try { socket = new Socket(ip, port); //IO connection stuff input = new DataInputStream(socket.getInputStream()); output = new DataOutputStream(socket.getOutputStream()); } catch (IOException ex) { consoleArea.append("Connection refused. Please check if the server is running.\n"); } } class SenderThirty implements Runnable{ Thread send30secs; public SenderThirty(){ } public SenderThirty(String send30s){ send30secs = new Thread(this, send30s); send30secs.start(); } @Override public void run() { try { output.writeUTF(command); } catch (IOException e) { e.printStackTrace(); } } } private class TextFieldListener implements ActionListener{ public void actionPerformed(ActionEvent e) { try { command = cmd_prompt.getText(); if (command.contains("start") == true){ Thread sendstart = new Thread(new SenderThirty(), "send"); sendstart.start(); //continue } else if (command.contains("stop") == true){ Thread sendstop = new Thread(new SenderThirty(), "send"); sendstop.start(); //continue } else {consoleArea.append("\nInvalid command\n");} } catch (Exception e1) { consoleArea.append("\nERR!\n"); } } }} Worker class: public class Response { String path = ""; public static void main(String[] args) throws InterruptedException { new Response(); } ServerSocket resp_sock; public Response() throws InterruptedException { int port = 4588; try { resp_sock = new ServerSocket(port); int clientNo = 1; while (true) { Socket socket = resp_sock.accept(); // client's IP address InetAddress client_addr = socket.getInetAddress(); ClientProcess task = new ClientProcess(socket); new Thread(task).start(); clientNo++; } } catch (IOException ex) { JOptionPane.showMessageDialog(null, ex); } } class ClientProcess implements Runnable { private Socket socket; public ClientProcess(Socket socket) { this.socket = socket; } @Override public void run() { try { final DataInputStream input = new DataInputStream(socket.getInputStream());//from client //DataOutputStream output = new DataOutputStream(socket.getOutputStream());//to client while(true){ String prompt = input.readUTF(); String command[] = prompt.split(" "); final Logger logger = Logger.getLogger("MyLog"); FileHandler fh; fh = new FileHandler("C:\\..path..\\logfile.log"); logger.addHandler(fh); SimpleFormatter formatter = new SimpleFormatter(); fh.setFormatter(formatter); class StopperThread implements Runnable{ public StopperThread(){ } @Override public void run() { try { ////////////////////////////////////////***PROBLEM IS IN THIS TRY BLOCK*** String next_prompt; next_prompt = input.readUTF(); String nextCommand[] = next_prompt.split(" "); if(nextCommand[1].equalsIgnoreCase("stop")){ logger.info("STOPPED " + new Date() + " \n"); System.exit(0);} } catch (IOException e) { e.printStackTrace(); } }} if(command[1].equalsIgnoreCase("start")){ try { while(true){ logger.info("RUNNING " + new Date() + " \n"); Thread.sleep(5000); Thread stoplogging = new Thread(new StopperThread(), "stoplogging"); stoplogging.start(); } } catch (SecurityException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } if(command[1].equalsIgnoreCase("stop")){ logger.info("STOPPED " + new Date() + " \n"); } } } catch (IOException ex) { JOptionPane.showMessageDialog(null, ex); } } }}
java
multithreading
sockets
logging
indexoutofboundsexception
null
open
creating a command based logger program === i'm currently trying to make a java program which creates and writes a log file. it has 2 classes (one for request, one for worker code). one class has a textfield and allows you to enter a command. command should be like 'log start' or 'log stop'. so request class sends the command as a string, worker class gets the command, parses it and executes instructions (start logging, stop logging. my problem is: application doesn't stop logging when user enters a 'stop' command. well, it doesn't stop after 3 log entries (that's the problem. i want to stop it any time user enters the command) you will understand the problem better when you take a look at the code. i know i'm making a very basic mistake here but somehow currently can't figure it out and want your opinion on this problem. (i showed the problematic are in the code) Thank you. error: Exception in thread "stoplogging" java.lang.ArrayIndexOutOfBoundsException: 1 at Response$ClientProcess$1StopperThread.run(Response.java:109) at java.lang.Thread.run(Unknown Source) Request class: public class Request extends JFrame { private JTextArea consoleArea = new JTextArea(); private JTextField cmd_prompt = new JTextField(); private JLabel cmd_label = new JLabel("Enter command: "); // ********IP PORT TEXTFIELDS & CONNECT BUTTON******* !!!! private DataOutputStream output; private DataInputStream input; public static void main(String[] args) { new Request(); } Socket socket = null; String command; public Request (){ JPanel requestPanel = new JPanel(); requestPanel.setLayout(new BorderLayout()); setTitle("Project_3002_CLIENT"); requestPanel.add(cmd_label, BorderLayout.WEST); requestPanel.add(cmd_prompt, BorderLayout.CENTER); setLayout(new BorderLayout()); add(requestPanel, BorderLayout.NORTH); add(new JScrollPane(consoleArea), BorderLayout.CENTER); Font font = new Font("Courier New", Font.BOLD, 15); cmd_prompt.setFont(font); cmd_prompt.setAlignmentX(LEFT_ALIGNMENT); cmd_prompt.addActionListener(new TextFieldListener()); setSize(600, 270); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); consoleArea.setFont(font); setVisible(true); String ip = "127.0.0.1"; // THIS WILL BE CHANGED (make custom) --extra jframe int port = 4588; // THIS WILL BE CHANGED (make custom) -- extra jframe try { socket = new Socket(ip, port); //IO connection stuff input = new DataInputStream(socket.getInputStream()); output = new DataOutputStream(socket.getOutputStream()); } catch (IOException ex) { consoleArea.append("Connection refused. Please check if the server is running.\n"); } } class SenderThirty implements Runnable{ Thread send30secs; public SenderThirty(){ } public SenderThirty(String send30s){ send30secs = new Thread(this, send30s); send30secs.start(); } @Override public void run() { try { output.writeUTF(command); } catch (IOException e) { e.printStackTrace(); } } } private class TextFieldListener implements ActionListener{ public void actionPerformed(ActionEvent e) { try { command = cmd_prompt.getText(); if (command.contains("start") == true){ Thread sendstart = new Thread(new SenderThirty(), "send"); sendstart.start(); //continue } else if (command.contains("stop") == true){ Thread sendstop = new Thread(new SenderThirty(), "send"); sendstop.start(); //continue } else {consoleArea.append("\nInvalid command\n");} } catch (Exception e1) { consoleArea.append("\nERR!\n"); } } }} Worker class: public class Response { String path = ""; public static void main(String[] args) throws InterruptedException { new Response(); } ServerSocket resp_sock; public Response() throws InterruptedException { int port = 4588; try { resp_sock = new ServerSocket(port); int clientNo = 1; while (true) { Socket socket = resp_sock.accept(); // client's IP address InetAddress client_addr = socket.getInetAddress(); ClientProcess task = new ClientProcess(socket); new Thread(task).start(); clientNo++; } } catch (IOException ex) { JOptionPane.showMessageDialog(null, ex); } } class ClientProcess implements Runnable { private Socket socket; public ClientProcess(Socket socket) { this.socket = socket; } @Override public void run() { try { final DataInputStream input = new DataInputStream(socket.getInputStream());//from client //DataOutputStream output = new DataOutputStream(socket.getOutputStream());//to client while(true){ String prompt = input.readUTF(); String command[] = prompt.split(" "); final Logger logger = Logger.getLogger("MyLog"); FileHandler fh; fh = new FileHandler("C:\\..path..\\logfile.log"); logger.addHandler(fh); SimpleFormatter formatter = new SimpleFormatter(); fh.setFormatter(formatter); class StopperThread implements Runnable{ public StopperThread(){ } @Override public void run() { try { ////////////////////////////////////////***PROBLEM IS IN THIS TRY BLOCK*** String next_prompt; next_prompt = input.readUTF(); String nextCommand[] = next_prompt.split(" "); if(nextCommand[1].equalsIgnoreCase("stop")){ logger.info("STOPPED " + new Date() + " \n"); System.exit(0);} } catch (IOException e) { e.printStackTrace(); } }} if(command[1].equalsIgnoreCase("start")){ try { while(true){ logger.info("RUNNING " + new Date() + " \n"); Thread.sleep(5000); Thread stoplogging = new Thread(new StopperThread(), "stoplogging"); stoplogging.start(); } } catch (SecurityException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } if(command[1].equalsIgnoreCase("stop")){ logger.info("STOPPED " + new Date() + " \n"); } } } catch (IOException ex) { JOptionPane.showMessageDialog(null, ex); } } }}
0
11,734,330
07/31/2012 06:26:02
1,564,769
07/31/2012 05:33:51
1
0
How to sync combobox and textfield value. i.e how to load different values from store on textfield,while I am changing values on combobox
I am new to EXTjs(and to Stackoverflow as well). I was struggling with this issue and at last decided to ask for help.My question is " How to sync combobox and textfield values. i.e how to load different values from 'store' on textfield,while I am changing values on combobox? " My problem is that while I load values on combobox and I select them my textfield stays empty all the time. I tried "Ext.getCmp().setValue();" it works fine with this ,but I think it is not the best option if I'd have 100 textfields. I want combobox and textfield to be synched with store somehow. Any help is appreciated. Situation in pictures are in links below : [pic one][1] [pic two][2] And my code : **My app.js :** Ext.Loader.setConfig({ enabled: true }); Ext.application({ name: 'work', appFolder: 'app', controllers: [ 'Work' ], launch: function() { Ext.create('Ext.container.Viewport', { //layout: 'fit', items: [ { xtype: 'rightpanel' // gets it from view class } ] }); } }); **My view RightPanel :** Ext.define('work.view.works.RightPanel' ,{ extend: 'Ext.panel.Panel', alias : 'widget.rightpanel', width: 300, title: 'Building navigation', animCollapse:true, collapsible:true, split:true, minSize:400, maxSize:400, margins:'0 5 0 0', //activeTab:1, tabPosition:'bottom', initComponent: function() { this.items= [ { xtype : 'form', items :[ { xtype: 'combobox', fieldLabel: 'BuildingID', queryMode:'local', name:'Bid', displayField:'Bid', valueField:'Bid', id:'Bid', mode :'remote', store:'Work' }, { xtype: 'textfield', fieldLabel: 'Address', name:'Address', displayField:'Address', valueField:'Address', id : 'Address', store:'Work' } ] }]; this.columns = [ {header: 'ID', dataIndex: 'Bid', flex: 1}, {header: 'Texts', dataIndex: 'Address', flex: 1} ]; this.callParent(arguments); } }); **My store :** Ext.define('work.store.Work', { extend: 'Ext.data.Store', model : 'work.model.Work', storeId :'workstore', id:'workstore', autoLoad: true, proxy: { type: 'ajax', limitParam: undefined, startParam: undefined, paramName: undefined, pageParam: undefined, noCache:false, api: { read: 'data/showWork.php' // just a .php file that reads values from database and shows them on combobox }, reader: { type: 'json', root: 'data', successProperty: 'success' } , writer: { type: 'json', root: 'data', encode: true } } }); **My Model class :** Ext.define('work.model.Work', { extend: 'Ext.data.Model', //idProperty: 'WorkID', fields: [{name: 'Bid', type: 'int'}, 'Address'] }); **My Controller :** Ext.define('work.controller.Work', { extend: 'Ext.app.Controller', stores : ['Work'], models : ['Work'], views: [ 'works.RightPanel' // name comes from view class ], init: function() { console.log('Done'); this.control({ 'viewport > rightpanel': { render : this.test } ,'rightpanel combobox[id=Bid]' :{ select : this.change } }); }, change : function(buttons) { var values=this.getStore('Work').collect('Address','Address',false); var win = buttons.up('rightpanel'); // gets the needed widget var form = win.down('combobox'); // gets the needed form var value = form.getValue(); // gets the value console.log("value "+value); } }); [1]: http://imageshack.us/f/43/pic1jv.png/ [2]: http://imageshack.us/photo/my-images/15/pic2ml.png/
mvc
extjs
sencha
sencha-architect
null
null
open
How to sync combobox and textfield value. i.e how to load different values from store on textfield,while I am changing values on combobox === I am new to EXTjs(and to Stackoverflow as well). I was struggling with this issue and at last decided to ask for help.My question is " How to sync combobox and textfield values. i.e how to load different values from 'store' on textfield,while I am changing values on combobox? " My problem is that while I load values on combobox and I select them my textfield stays empty all the time. I tried "Ext.getCmp().setValue();" it works fine with this ,but I think it is not the best option if I'd have 100 textfields. I want combobox and textfield to be synched with store somehow. Any help is appreciated. Situation in pictures are in links below : [pic one][1] [pic two][2] And my code : **My app.js :** Ext.Loader.setConfig({ enabled: true }); Ext.application({ name: 'work', appFolder: 'app', controllers: [ 'Work' ], launch: function() { Ext.create('Ext.container.Viewport', { //layout: 'fit', items: [ { xtype: 'rightpanel' // gets it from view class } ] }); } }); **My view RightPanel :** Ext.define('work.view.works.RightPanel' ,{ extend: 'Ext.panel.Panel', alias : 'widget.rightpanel', width: 300, title: 'Building navigation', animCollapse:true, collapsible:true, split:true, minSize:400, maxSize:400, margins:'0 5 0 0', //activeTab:1, tabPosition:'bottom', initComponent: function() { this.items= [ { xtype : 'form', items :[ { xtype: 'combobox', fieldLabel: 'BuildingID', queryMode:'local', name:'Bid', displayField:'Bid', valueField:'Bid', id:'Bid', mode :'remote', store:'Work' }, { xtype: 'textfield', fieldLabel: 'Address', name:'Address', displayField:'Address', valueField:'Address', id : 'Address', store:'Work' } ] }]; this.columns = [ {header: 'ID', dataIndex: 'Bid', flex: 1}, {header: 'Texts', dataIndex: 'Address', flex: 1} ]; this.callParent(arguments); } }); **My store :** Ext.define('work.store.Work', { extend: 'Ext.data.Store', model : 'work.model.Work', storeId :'workstore', id:'workstore', autoLoad: true, proxy: { type: 'ajax', limitParam: undefined, startParam: undefined, paramName: undefined, pageParam: undefined, noCache:false, api: { read: 'data/showWork.php' // just a .php file that reads values from database and shows them on combobox }, reader: { type: 'json', root: 'data', successProperty: 'success' } , writer: { type: 'json', root: 'data', encode: true } } }); **My Model class :** Ext.define('work.model.Work', { extend: 'Ext.data.Model', //idProperty: 'WorkID', fields: [{name: 'Bid', type: 'int'}, 'Address'] }); **My Controller :** Ext.define('work.controller.Work', { extend: 'Ext.app.Controller', stores : ['Work'], models : ['Work'], views: [ 'works.RightPanel' // name comes from view class ], init: function() { console.log('Done'); this.control({ 'viewport > rightpanel': { render : this.test } ,'rightpanel combobox[id=Bid]' :{ select : this.change } }); }, change : function(buttons) { var values=this.getStore('Work').collect('Address','Address',false); var win = buttons.up('rightpanel'); // gets the needed widget var form = win.down('combobox'); // gets the needed form var value = form.getValue(); // gets the value console.log("value "+value); } }); [1]: http://imageshack.us/f/43/pic1jv.png/ [2]: http://imageshack.us/photo/my-images/15/pic2ml.png/
0
11,734,331
07/31/2012 06:26:06
161,287
08/22/2009 14:44:25
2,794
45
How can I switch authorized facebook user with Facebook Android SDK?
I have successfully implemented authorization with facebook in my native android app. Now I have following problem: User logout from my app and I call facebook sdk logout method. But when user presses login button it automatically redirects back to my app without showing "Already authorized" window, so he cannot switch to another user. Is that normal behavior or I've made something wrong? How can I solve this issue?
android
facebook
facebook-graph-api
facebook-android-sdk
null
null
open
How can I switch authorized facebook user with Facebook Android SDK? === I have successfully implemented authorization with facebook in my native android app. Now I have following problem: User logout from my app and I call facebook sdk logout method. But when user presses login button it automatically redirects back to my app without showing "Already authorized" window, so he cannot switch to another user. Is that normal behavior or I've made something wrong? How can I solve this issue?
0
11,734,341
07/31/2012 06:26:55
1,323,697
04/10/2012 09:40:56
191
0
PDFNet trying to add a text not working
I am basically trying out PDFNet and tweaking one of the samples of PDFNet. Here is the code: PDFNet.Initialize(); // Relative path to the folder containing test files. string input_path = "../../../../TestFiles/"; string output_path = "../../../../TestFiles/Output/"; PDFDoc doc = new PDFDoc(input_path + "form1.pdf"); for (int index = 1; index <= doc.GetPageCount(); index++) { Page page = doc.GetPage(index); ElementBuilder eb = new ElementBuilder(); // ElementBuilder is used to build new Element objects eb.Reset(); // Reset GState to default ElementWriter writer = new ElementWriter(); // ElementWriter is used to write Elements to the page writer.Begin(page); // Begin writing a block of text string data = "Page " + index; Element element = eb.CreateTextRun(data, Font.Create(doc, Font.StandardType1Font.e_times_roman, true), 100.0); element.SetTextMatrix(10, 0, 0, 10, 100, 100); GState gstate = element.GetGState(); gstate.SetTextRenderMode(GState.TextRenderingMode.e_stroke_text); gstate.SetStrokeColorSpace(pdftron.PDF.ColorSpace.CreateDeviceRGB()); gstate.SetStrokeColor(new pdftron.PDF.ColorPt(1, 0, 0)); writer.WriteElement(element); writer.End(); writer.Dispose(); // save changes to the current page } doc.Save(output_path + "element_builder.pdf", SDFDoc.SaveOptions.e_linearized); doc.Close(); But problem is, no text is added to `element_builder.pdf`. It is just copied as it is and looks same as `form1.pdf`. Can anybody help me out? This is the link to PDFNet http://www.pdftron.com/pdfnet/downloads.html I am using 64 bit version for .Net 4.0
c#
.net
pdf
null
null
null
open
PDFNet trying to add a text not working === I am basically trying out PDFNet and tweaking one of the samples of PDFNet. Here is the code: PDFNet.Initialize(); // Relative path to the folder containing test files. string input_path = "../../../../TestFiles/"; string output_path = "../../../../TestFiles/Output/"; PDFDoc doc = new PDFDoc(input_path + "form1.pdf"); for (int index = 1; index <= doc.GetPageCount(); index++) { Page page = doc.GetPage(index); ElementBuilder eb = new ElementBuilder(); // ElementBuilder is used to build new Element objects eb.Reset(); // Reset GState to default ElementWriter writer = new ElementWriter(); // ElementWriter is used to write Elements to the page writer.Begin(page); // Begin writing a block of text string data = "Page " + index; Element element = eb.CreateTextRun(data, Font.Create(doc, Font.StandardType1Font.e_times_roman, true), 100.0); element.SetTextMatrix(10, 0, 0, 10, 100, 100); GState gstate = element.GetGState(); gstate.SetTextRenderMode(GState.TextRenderingMode.e_stroke_text); gstate.SetStrokeColorSpace(pdftron.PDF.ColorSpace.CreateDeviceRGB()); gstate.SetStrokeColor(new pdftron.PDF.ColorPt(1, 0, 0)); writer.WriteElement(element); writer.End(); writer.Dispose(); // save changes to the current page } doc.Save(output_path + "element_builder.pdf", SDFDoc.SaveOptions.e_linearized); doc.Close(); But problem is, no text is added to `element_builder.pdf`. It is just copied as it is and looks same as `form1.pdf`. Can anybody help me out? This is the link to PDFNet http://www.pdftron.com/pdfnet/downloads.html I am using 64 bit version for .Net 4.0
0
11,734,346
07/31/2012 06:27:31
1,564,845
07/31/2012 06:14:11
1
0
Need to user-to-user data in the database. How to avoid a disaster?
In my requirements, every user on the website can see a score attached to other users. It gets calculated based of their profile parameters. My score to someone else will be one, but their score to me will be another one. What I have done so far Table in the MySQL database like so: ___UserID1___|___UserID2___|___Score___|___Last_Uopdated___ 1 | 2 | 45 | 1235686744 2 | 1 | 24 | 1235645332 When a user views someones page, my score class is checking if the record for this pair exists in the database and if not, calculates it and records it. This works fine, because no one will look at absolutely every user page on the site. Now I need to pull users and sort them based on score. SO I thought, I can create a cronjob, and run it every night, so it will update scores in the database and create them for every pair of user both ways. Well, problem is I am planing a system for over 500,000 users and I am worried, it will bring my database down and create huge database. So for 500,000 we are talking about 250 billion records... :/ Does anyone know any other way of creating this feature? May be calculation on the fly... or any other way?
php
sql
null
null
null
null
open
Need to user-to-user data in the database. How to avoid a disaster? === In my requirements, every user on the website can see a score attached to other users. It gets calculated based of their profile parameters. My score to someone else will be one, but their score to me will be another one. What I have done so far Table in the MySQL database like so: ___UserID1___|___UserID2___|___Score___|___Last_Uopdated___ 1 | 2 | 45 | 1235686744 2 | 1 | 24 | 1235645332 When a user views someones page, my score class is checking if the record for this pair exists in the database and if not, calculates it and records it. This works fine, because no one will look at absolutely every user page on the site. Now I need to pull users and sort them based on score. SO I thought, I can create a cronjob, and run it every night, so it will update scores in the database and create them for every pair of user both ways. Well, problem is I am planing a system for over 500,000 users and I am worried, it will bring my database down and create huge database. So for 500,000 we are talking about 250 billion records... :/ Does anyone know any other way of creating this feature? May be calculation on the fly... or any other way?
0
11,734,349
07/31/2012 06:27:44
61,320
02/02/2009 00:22:23
2,493
34
How do we select multiple columns in a sum()/group by query?
I have a requirement to pull a total # of product quantity from an Access DB, but include the vendor name, id number, description, etc... along with the sum of quantity. I have a query like this: SELECT [Vendor Name], SUM([Quantity]) AS Total FROM [SalesDB] WHERE [Vendor No] IN (1,2,3,4,5,6,7,8) AND [Item Description] = 'bolts' Group By [Vendor Name] Works great... except I need to pull more columns in the query, something like this: SELECT [Vendor Name], [Vendor No], [Item No], [Item Description], [Item Cost], [Quantity], SUM([Quantity]) AS Total FROM [SalesDB] WHERE [Vendor No] IN (1,2,3,4,5,6,7,8) AND [Item Description] = 'bolts' Group By [Vendor Name] Doesn't work, throws an aggregate error So instead do something like so: SELECT [Vendor Name], [Vendor No], [Item No], [Item Description], [Item Cost], [Quantity], SUM([Quantity]) AS Total FROM [SalesDB] WHERE [Vendor No] IN (1,2,3,4,5,6,7,8) AND [Item Description] = 'bolts' Group By [Vendor Name], [Vendor No], [Item No], [Item Description], [Item Cost], [Quantity] Which runs but changes the results too much. What's the appropriate way to handle this query?
sql
query
ms-access-2007
null
null
null
open
How do we select multiple columns in a sum()/group by query? === I have a requirement to pull a total # of product quantity from an Access DB, but include the vendor name, id number, description, etc... along with the sum of quantity. I have a query like this: SELECT [Vendor Name], SUM([Quantity]) AS Total FROM [SalesDB] WHERE [Vendor No] IN (1,2,3,4,5,6,7,8) AND [Item Description] = 'bolts' Group By [Vendor Name] Works great... except I need to pull more columns in the query, something like this: SELECT [Vendor Name], [Vendor No], [Item No], [Item Description], [Item Cost], [Quantity], SUM([Quantity]) AS Total FROM [SalesDB] WHERE [Vendor No] IN (1,2,3,4,5,6,7,8) AND [Item Description] = 'bolts' Group By [Vendor Name] Doesn't work, throws an aggregate error So instead do something like so: SELECT [Vendor Name], [Vendor No], [Item No], [Item Description], [Item Cost], [Quantity], SUM([Quantity]) AS Total FROM [SalesDB] WHERE [Vendor No] IN (1,2,3,4,5,6,7,8) AND [Item Description] = 'bolts' Group By [Vendor Name], [Vendor No], [Item No], [Item Description], [Item Cost], [Quantity] Which runs but changes the results too much. What's the appropriate way to handle this query?
0
11,734,316
07/31/2012 06:25:14
1,536,854
07/19/2012 05:36:49
1
0
How to add File of different version to SVN?
I have my repository in below format. /svn/project/trunk/file1,file2,dir1,dir2 (file & directory under trunk), /svn/project/branches, /svn/project/tags, I have created one branch for trunk with head revision as V1 (/svn/project/branches/v1/file1,file2,dir1,dir2 ) .this is the one am using with my working copy. Now i want to upgrade my application it means the dir2 folder am using will be different in the upgraded version.let say file1,file2,dir1,dir2 these are the file am using.when i upgrade my project the dir2 will get change but other files will be same.it means the upgraded version also will have same directory dir2 and files name under this dir2 will be same between the old and upgraded version but content of the file will be different.How i can revision my file? Please advice....
svn
null
null
null
null
null
open
How to add File of different version to SVN? === I have my repository in below format. /svn/project/trunk/file1,file2,dir1,dir2 (file & directory under trunk), /svn/project/branches, /svn/project/tags, I have created one branch for trunk with head revision as V1 (/svn/project/branches/v1/file1,file2,dir1,dir2 ) .this is the one am using with my working copy. Now i want to upgrade my application it means the dir2 folder am using will be different in the upgraded version.let say file1,file2,dir1,dir2 these are the file am using.when i upgrade my project the dir2 will get change but other files will be same.it means the upgraded version also will have same directory dir2 and files name under this dir2 will be same between the old and upgraded version but content of the file will be different.How i can revision my file? Please advice....
0
11,734,317
07/31/2012 06:25:16
1,553,244
07/26/2012 01:35:19
1
0
How to analyse the source code of Blender
I am a beginner of Blender, my professor asked me to read the source code of Blender 2.6 and study how blender implements the material and texture block. After i have downloaded the source code, i find it is impossible for me to read whole source code, especially without detailed comment and professional manual. Is there anybody can give me some advice or offer me some learning material? For example, i am confused by how multiple layers of texture are compounded by using different blend type, like mix, add, subtract or overlay. How does blender implement these functionality?
blender
blender-2.50
null
null
null
null
open
How to analyse the source code of Blender === I am a beginner of Blender, my professor asked me to read the source code of Blender 2.6 and study how blender implements the material and texture block. After i have downloaded the source code, i find it is impossible for me to read whole source code, especially without detailed comment and professional manual. Is there anybody can give me some advice or offer me some learning material? For example, i am confused by how multiple layers of texture are compounded by using different blend type, like mix, add, subtract or overlay. How does blender implement these functionality?
0
11,734,352
07/31/2012 06:28:15
1,006,513
10/21/2011 06:01:05
6
0
buildbot scheduler not work
I expected the buildbot trigger the builder when it detected a new revision had been commited to svn, but it failed. Only when the Periodic scheduler is added can the builder be triggered, but it's not my expectation. According to the log, 2012-07-30 23:51:33-0400 [-] SVNPoller: polling 2012-07-30 23:51:33-0400 [-] SVNPoller: _process_changes 11 .. 12 2012-07-30 23:51:33-0400 [-] Adding change revision 12 2012-07-30 23:51:34-0400 [-] SVNPoller: finished polling None new commit is detected, but builder is not triggered. Following is my configure file: c = BuildmasterConfig = {} from buildbot.buildslave import BuildSlave c['slaves'] = [BuildSlave("example-slave", "pass")] c['slavePortnum'] = 9989 INTERVAL = 30 from buildbot.changes.svnpoller import SVNPoller, split_file_branches svn_url = 'file:///data/subREPOS/project' c['change_source'] = [] c['change_source'].append(SVNPoller(svnurl = svn_url, split_file=split_file_branches, pollinterval=INTERVAL)) from buildbot.schedulers.basic import Scheduler from buildbot.scheduler import Periodic c['schedulers'] = [] c['schedulers'].append(Scheduler(name="General", branch=None, treeStableTimer=3, builderNames=["testbuilder"])) c['schedulers'].append(Periodic("Periodic", ['testbuilder', ], INTERVAL)) from buildbot.process.factory import BuildFactory from buildbot.steps.source import SVN from buildbot.steps.shell import ShellCommand, Compile factory = BuildFactory() factory.addStep(ShellCommand(command=["ls"])) factory.addStep(SVN(svn_url, None, 'incremental',workdir='sourcedir' )) factory.addStep(Compile(workdir="sourcedir", command=["make"])) from buildbot.config import BuilderConfig c['builders'] = [] c['builders'].append( BuilderConfig(name="testbuilder", slavenames=["example-slave"], factory=factory))
scheduler
buildbot
null
null
null
null
open
buildbot scheduler not work === I expected the buildbot trigger the builder when it detected a new revision had been commited to svn, but it failed. Only when the Periodic scheduler is added can the builder be triggered, but it's not my expectation. According to the log, 2012-07-30 23:51:33-0400 [-] SVNPoller: polling 2012-07-30 23:51:33-0400 [-] SVNPoller: _process_changes 11 .. 12 2012-07-30 23:51:33-0400 [-] Adding change revision 12 2012-07-30 23:51:34-0400 [-] SVNPoller: finished polling None new commit is detected, but builder is not triggered. Following is my configure file: c = BuildmasterConfig = {} from buildbot.buildslave import BuildSlave c['slaves'] = [BuildSlave("example-slave", "pass")] c['slavePortnum'] = 9989 INTERVAL = 30 from buildbot.changes.svnpoller import SVNPoller, split_file_branches svn_url = 'file:///data/subREPOS/project' c['change_source'] = [] c['change_source'].append(SVNPoller(svnurl = svn_url, split_file=split_file_branches, pollinterval=INTERVAL)) from buildbot.schedulers.basic import Scheduler from buildbot.scheduler import Periodic c['schedulers'] = [] c['schedulers'].append(Scheduler(name="General", branch=None, treeStableTimer=3, builderNames=["testbuilder"])) c['schedulers'].append(Periodic("Periodic", ['testbuilder', ], INTERVAL)) from buildbot.process.factory import BuildFactory from buildbot.steps.source import SVN from buildbot.steps.shell import ShellCommand, Compile factory = BuildFactory() factory.addStep(ShellCommand(command=["ls"])) factory.addStep(SVN(svn_url, None, 'incremental',workdir='sourcedir' )) factory.addStep(Compile(workdir="sourcedir", command=["make"])) from buildbot.config import BuilderConfig c['builders'] = [] c['builders'].append( BuilderConfig(name="testbuilder", slavenames=["example-slave"], factory=factory))
0
11,734,356
07/31/2012 06:28:35
1,175,510
01/28/2012 17:16:35
128
4
file not found in APV PDF Viewer in android
i m trying to re construct the .so file of APV PDF Viewer in cygwin but it display error of not found #include "fitz.h" #include "mupdf.h" this files r not in project. when i remove it it display so many errors
android
jni
pdf-viewer
null
null
null
open
file not found in APV PDF Viewer in android === i m trying to re construct the .so file of APV PDF Viewer in cygwin but it display error of not found #include "fitz.h" #include "mupdf.h" this files r not in project. when i remove it it display so many errors
0
11,734,358
07/31/2012 06:28:48
1,519,849
07/12/2012 06:22:10
19
0
How to create a popup within another popup
Can we create a popup within a popup. I have a thumbnail image and when i click on it, it popup with large image using fancy box. Now i want in such a ways that, when i hover over a point in the large image it should popup another image over it. How to make this possible. If anyone have example with a link then it would be more helpful. Thanks in advance!
jquery
fancybox
null
null
null
null
open
How to create a popup within another popup === Can we create a popup within a popup. I have a thumbnail image and when i click on it, it popup with large image using fancy box. Now i want in such a ways that, when i hover over a point in the large image it should popup another image over it. How to make this possible. If anyone have example with a link then it would be more helpful. Thanks in advance!
0
11,349,799
07/05/2012 17:52:49
1,503,785
07/05/2012 11:08:15
1
0
Required Help for Writing SQL Query
I have two tables below. Item Table This Item Table contains ItemId and Total Quantity > **ItemID TotalItems** 1 10 2 10 3 10 OrderHistory Table This Order history table contains ItemId and OrderId > **orderId** **ItemID** 11 1 12 1 13 2 14 2 15 3 I want to get result which contains ItemID and total Items Used for example for Item Id 1 , there are two order in orderhistory so I want result like below Remaining Items( Formula : Total Items from ItemTable - count of Same ItemId from Orderhistory table) Final output : **ItemId Remaining Items** 1 8 2 8 3 9 4 10 so How to write SQL Query for that.
sql
null
null
null
null
null
open
Required Help for Writing SQL Query === I have two tables below. Item Table This Item Table contains ItemId and Total Quantity > **ItemID TotalItems** 1 10 2 10 3 10 OrderHistory Table This Order history table contains ItemId and OrderId > **orderId** **ItemID** 11 1 12 1 13 2 14 2 15 3 I want to get result which contains ItemID and total Items Used for example for Item Id 1 , there are two order in orderhistory so I want result like below Remaining Items( Formula : Total Items from ItemTable - count of Same ItemId from Orderhistory table) Final output : **ItemId Remaining Items** 1 8 2 8 3 9 4 10 so How to write SQL Query for that.
0
11,349,800
07/05/2012 17:52:55
778,249
05/31/2011 19:27:04
22
1
xslt passing position as a parameter is producing strange results?
I have an xml file which looks like this: <section> <title> title of section </title> <table> <title> title of table</title> <tableData columns = 2> <column width ="50"/> <column width ="100"/> <tableHead> <row> <entry>column 1</entry> </row> <row> <entry>column 2</entry> </row> </tableHead> <tableBody> <row> <entry>text</entry> <entry>abc</entry> </row> <row> <entry>text</entry> <entry>dbe</entry> </row> <row> <entry>text</entry> <entry>fgh</entry> </row> </tableBody> </table> </section> I need to process each entry in tableHead/row/entry and spit it out in some format that also includes the columnWidth. So, my output must look like {"name":"column 1", "width":"50px"},{"name":"column 2", "width":"100px"} My transform looks like this <xsl:template match="//table/tableHead/row/entry"> <xsl:text>{"name": "</xsl:text><xsl:value-of select"."/> <xsl:text>", "width":"</xsl:text> <xsl:call-template name="get_column_width"> <xsl:with-param name ="rowNum"> <xsl:value-of sellect"position()"/> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template name ="get_column_width"> <xsl:param-name="rowNum"> <xsl:value-of select="../../../columnWidth[$rowNum]/@width"/> <xsl:text>px"}</xsl:text> </xsl:template> Strangely, this produces {"name":"column 1", "width":"50 100px"},{"name":"column 2", "width":"50 100px"} However, when I output only the rowNum parameter I get exactly what I expect: {"name":"column 1", "width":1px"},{"name":"column 2", "width":"2px"} So, rowNum is 1 and 2 so the select statement will use columnWidth[1] and columnWidth[2], but for whatever reason it just outputs both of them. I tried using columnWidth[1] in the select and it outputs 50 as I would expect. columnWidth[2] outputs 100. I'm really confused here. Using preceding-sibling gave the same result. Is there something wrong with my template matching? Unfortunately changing the xml format is not an option.
xml
xslt
xpath
position
null
null
open
xslt passing position as a parameter is producing strange results? === I have an xml file which looks like this: <section> <title> title of section </title> <table> <title> title of table</title> <tableData columns = 2> <column width ="50"/> <column width ="100"/> <tableHead> <row> <entry>column 1</entry> </row> <row> <entry>column 2</entry> </row> </tableHead> <tableBody> <row> <entry>text</entry> <entry>abc</entry> </row> <row> <entry>text</entry> <entry>dbe</entry> </row> <row> <entry>text</entry> <entry>fgh</entry> </row> </tableBody> </table> </section> I need to process each entry in tableHead/row/entry and spit it out in some format that also includes the columnWidth. So, my output must look like {"name":"column 1", "width":"50px"},{"name":"column 2", "width":"100px"} My transform looks like this <xsl:template match="//table/tableHead/row/entry"> <xsl:text>{"name": "</xsl:text><xsl:value-of select"."/> <xsl:text>", "width":"</xsl:text> <xsl:call-template name="get_column_width"> <xsl:with-param name ="rowNum"> <xsl:value-of sellect"position()"/> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template name ="get_column_width"> <xsl:param-name="rowNum"> <xsl:value-of select="../../../columnWidth[$rowNum]/@width"/> <xsl:text>px"}</xsl:text> </xsl:template> Strangely, this produces {"name":"column 1", "width":"50 100px"},{"name":"column 2", "width":"50 100px"} However, when I output only the rowNum parameter I get exactly what I expect: {"name":"column 1", "width":1px"},{"name":"column 2", "width":"2px"} So, rowNum is 1 and 2 so the select statement will use columnWidth[1] and columnWidth[2], but for whatever reason it just outputs both of them. I tried using columnWidth[1] in the select and it outputs 50 as I would expect. columnWidth[2] outputs 100. I'm really confused here. Using preceding-sibling gave the same result. Is there something wrong with my template matching? Unfortunately changing the xml format is not an option.
0
11,349,740
07/05/2012 17:48:47
500,944
11/08/2010 17:16:58
3,757
123
Storing maps for tile-based 2D game engine
We have a (potentially large) side-scrolling 2D world with lots of repeated tiles (e.g. terrain, walls, water, etc.) For example, there are large "hills" which can be very high, but are rendered using the same small piece of "rock" texture. I would like to optimize the storage and rendering of this world (it's better to draw one large quad and apply the same repeated texture to it than draw a lot of small adjacent quads separately). What is a good way to do that? Currently I see a two potential solutions: 1. Allow the map designer to specify "chunks" (large rectangles of repeated tiles) manually 2. Allow the map designer to design the map on a tile-by-tile basis and then compute the chunks automatically (what is a good algorithm to do this?) If you have worked on a similar game, would love to hear your particular solution.
algorithm
graphics
2d
null
null
null
open
Storing maps for tile-based 2D game engine === We have a (potentially large) side-scrolling 2D world with lots of repeated tiles (e.g. terrain, walls, water, etc.) For example, there are large "hills" which can be very high, but are rendered using the same small piece of "rock" texture. I would like to optimize the storage and rendering of this world (it's better to draw one large quad and apply the same repeated texture to it than draw a lot of small adjacent quads separately). What is a good way to do that? Currently I see a two potential solutions: 1. Allow the map designer to specify "chunks" (large rectangles of repeated tiles) manually 2. Allow the map designer to design the map on a tile-by-tile basis and then compute the chunks automatically (what is a good algorithm to do this?) If you have worked on a similar game, would love to hear your particular solution.
0
11,349,741
07/05/2012 17:48:48
392,803
07/15/2010 14:17:32
60
0
"group by" like command in R with min as aggregate function and multiple columns
I have a frame with many columns c1 c2 c3 c4 ... c30 d I want to aggregate by and find all rows unique in c1..30 and then get the min(d) for that row. In sql this would be a group by c1, ..., c30. d is of type date. I have found some solutions here in stack but none seem to work for 1) so many columns 2) do a min instead of sum. Any input would be great.
r
aggregate-functions
aggregate
null
null
null
open
"group by" like command in R with min as aggregate function and multiple columns === I have a frame with many columns c1 c2 c3 c4 ... c30 d I want to aggregate by and find all rows unique in c1..30 and then get the min(d) for that row. In sql this would be a group by c1, ..., c30. d is of type date. I have found some solutions here in stack but none seem to work for 1) so many columns 2) do a min instead of sum. Any input would be great.
0
11,349,808
07/05/2012 17:53:12
599,346
02/02/2011 01:57:34
1,086
67
Using OpenStreetMap API, getting errors on the jar file? NoClassDefFoundError
I am trying to create an application to test how to use `OpenStreetMaps` API but when I insert the jar file I get errors saying `NoClassDefFoundError` stack trace 07-05 13:35:43.875: E/AndroidRuntime(9235): FATAL EXCEPTION: main 07-05 13:35:43.875: E/AndroidRuntime(9235): java.lang.ExceptionInInitializerError 07-05 13:35:43.875: E/AndroidRuntime(9235): at com.example.osm.test.MainActivity.onCreate(MainActivity.java:16) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.Activity.performCreate(Activity.java:5008) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread.access$600(ActivityThread.java:130) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.os.Handler.dispatchMessage(Handler.java:99) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.os.Looper.loop(Looper.java:137) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread.main(ActivityThread.java:4745) 07-05 13:35:43.875: E/AndroidRuntime(9235): at java.lang.reflect.Method.invokeNative(Native Method) 07-05 13:35:43.875: E/AndroidRuntime(9235): at java.lang.reflect.Method.invoke(Method.java:511) 07-05 13:35:43.875: E/AndroidRuntime(9235): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 07-05 13:35:43.875: E/AndroidRuntime(9235): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 07-05 13:35:43.875: E/AndroidRuntime(9235): at dalvik.system.NativeStart.main(Native Method) 07-05 13:35:43.875: E/AndroidRuntime(9235): Caused by: java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory 07-05 13:35:43.875: E/AndroidRuntime(9235): at org.osmdroid.views.MapView.<clinit>(MapView.java:64) 07-05 13:35:43.875: E/AndroidRuntime(9235): ... 15 more my Activity is as simple as this public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MapView mapView = new MapView(this,256); //fails mapView.setClickable(true); mapView.setBuiltInZoomControls(true); setContentView(mapView); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } it fails as soon as it trys to create the mapview, is there another jar file I am suppose to have? currently I have `osmdroid-android-3.0.8.jar`, `osmdroid-packager-3.0.8.jar` and `osmdroid-third-party-3.0.8.jar` though i probably dont need the last 2 to actually create the map. any help would be great
android
openstreetmap
null
null
null
null
open
Using OpenStreetMap API, getting errors on the jar file? NoClassDefFoundError === I am trying to create an application to test how to use `OpenStreetMaps` API but when I insert the jar file I get errors saying `NoClassDefFoundError` stack trace 07-05 13:35:43.875: E/AndroidRuntime(9235): FATAL EXCEPTION: main 07-05 13:35:43.875: E/AndroidRuntime(9235): java.lang.ExceptionInInitializerError 07-05 13:35:43.875: E/AndroidRuntime(9235): at com.example.osm.test.MainActivity.onCreate(MainActivity.java:16) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.Activity.performCreate(Activity.java:5008) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread.access$600(ActivityThread.java:130) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.os.Handler.dispatchMessage(Handler.java:99) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.os.Looper.loop(Looper.java:137) 07-05 13:35:43.875: E/AndroidRuntime(9235): at android.app.ActivityThread.main(ActivityThread.java:4745) 07-05 13:35:43.875: E/AndroidRuntime(9235): at java.lang.reflect.Method.invokeNative(Native Method) 07-05 13:35:43.875: E/AndroidRuntime(9235): at java.lang.reflect.Method.invoke(Method.java:511) 07-05 13:35:43.875: E/AndroidRuntime(9235): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 07-05 13:35:43.875: E/AndroidRuntime(9235): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 07-05 13:35:43.875: E/AndroidRuntime(9235): at dalvik.system.NativeStart.main(Native Method) 07-05 13:35:43.875: E/AndroidRuntime(9235): Caused by: java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory 07-05 13:35:43.875: E/AndroidRuntime(9235): at org.osmdroid.views.MapView.<clinit>(MapView.java:64) 07-05 13:35:43.875: E/AndroidRuntime(9235): ... 15 more my Activity is as simple as this public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MapView mapView = new MapView(this,256); //fails mapView.setClickable(true); mapView.setBuiltInZoomControls(true); setContentView(mapView); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } it fails as soon as it trys to create the mapview, is there another jar file I am suppose to have? currently I have `osmdroid-android-3.0.8.jar`, `osmdroid-packager-3.0.8.jar` and `osmdroid-third-party-3.0.8.jar` though i probably dont need the last 2 to actually create the map. any help would be great
0
11,349,812
07/05/2012 17:53:25
830,279
07/05/2011 19:04:51
1
0
Pseudo Class Hover won't work in JavaScript ImageSwap
Experts; I have a photo retouching portfolio page that has thumbnail images swapping out the main viewer image. The main viewer image is a sprite that has a Before & After section, showing the original image before it was retouched, and after the retouch. The sprite is loaded into the main viewer div as a background image, set up to reposition as the mouse hovers to show the Before and After sections of the sprite. When the page initially loads, the main viewer behaves as it should, showing the Before & After position shift on hover. But once a new image is loaded into the viewer, by way of a thumbnail selection, the hover action stops working. I've been at it for a couple of hours now and can't resolve the problem. An example of the main viewr sprite can be seen here: http://www.triadimedia.com/frame_01.jpg . All styles & scripts are contained in the page, which is here: http://www.triadimedia.com/pfolio_photo_retouch.php . Any help would be hugely appreciated. Thanks. Cayce
javascript
css
null
null
null
null
open
Pseudo Class Hover won't work in JavaScript ImageSwap === Experts; I have a photo retouching portfolio page that has thumbnail images swapping out the main viewer image. The main viewer image is a sprite that has a Before & After section, showing the original image before it was retouched, and after the retouch. The sprite is loaded into the main viewer div as a background image, set up to reposition as the mouse hovers to show the Before and After sections of the sprite. When the page initially loads, the main viewer behaves as it should, showing the Before & After position shift on hover. But once a new image is loaded into the viewer, by way of a thumbnail selection, the hover action stops working. I've been at it for a couple of hours now and can't resolve the problem. An example of the main viewr sprite can be seen here: http://www.triadimedia.com/frame_01.jpg . All styles & scripts are contained in the page, which is here: http://www.triadimedia.com/pfolio_photo_retouch.php . Any help would be hugely appreciated. Thanks. Cayce
0
11,349,813
07/05/2012 17:53:28
1,059,832
11/22/2011 13:04:21
92
2
How do I copy an import spec from excel to access?
I have an import specification already mapped out in MS Excel. When I try to copy and paste this into the "Advanced Text File Import" wizard in MS Access, however, it will validate the input with no error only to provide one when I get to the last step. Has anyone encountered this problem, and do they have a fix for it? I could manually enter the spec, but this would be very time consuming as there are 200+ fields. Thanks.
excel
ms-access
null
null
null
null
open
How do I copy an import spec from excel to access? === I have an import specification already mapped out in MS Excel. When I try to copy and paste this into the "Advanced Text File Import" wizard in MS Access, however, it will validate the input with no error only to provide one when I get to the last step. Has anyone encountered this problem, and do they have a fix for it? I could manually enter the spec, but this would be very time consuming as there are 200+ fields. Thanks.
0
11,471,819
07/13/2012 13:49:15
1,068,536
11/28/2011 01:07:15
139
15
Filtering an Array problems
I'm trying to filter an array of customs objects by the first letter of a property called "name". To achieve this I made an Array of first letters: _lettersArray = [NSArray arrayWithObjects:@"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", @"J", @"K", @"L", @"M", @"N", @"O", @"P", @"Q", @"R", @"S", @"T", @"U", @"V", @"W", @"X", @"Y", @"Z", nil]; I want to save the results in a NSDictionary where the key is the First letter and the object an Array of objects with the first letter of the property name the key: for (NSString* letter in _lettersArray) { NSPredicate* letterPredicate = [NSPredicate predicateWithFormat:@"name beginswith[c] '%@'", letter]; NSArray* itemsLetter = [_items filteredArrayUsingPredicate:letterPredicate]; [_letters setObject:itemsLetter forKey:letter]; } But when this algorithm ends the _letters dictionary have all the keys but the objects are empty arrays. I have tried to change the NSPredicate* letterPredicate = [NSPredicate predicateWithFormat:@"name beginswith[c] '%@'", letter]; for NSPredicate* letterPredicate = [NSPredicate predicateWithFormat:@"name beginswith[c] 'B'"]; And all works fine(Of course it gives me only the objects that starts with B). What I'm doing wrong? For me it's clear that the problem is in the predicate instruction. I have see that _lettersArray is fine and it is and I tried to use `[letter characterAtIndex:0]` instead of letter but gives me the same result... An NSLog of the predicate sentence gives me the exact sentence formation that I do manually and works!
ios
sorting
nsarray
nspredicate
null
null
open
Filtering an Array problems === I'm trying to filter an array of customs objects by the first letter of a property called "name". To achieve this I made an Array of first letters: _lettersArray = [NSArray arrayWithObjects:@"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", @"J", @"K", @"L", @"M", @"N", @"O", @"P", @"Q", @"R", @"S", @"T", @"U", @"V", @"W", @"X", @"Y", @"Z", nil]; I want to save the results in a NSDictionary where the key is the First letter and the object an Array of objects with the first letter of the property name the key: for (NSString* letter in _lettersArray) { NSPredicate* letterPredicate = [NSPredicate predicateWithFormat:@"name beginswith[c] '%@'", letter]; NSArray* itemsLetter = [_items filteredArrayUsingPredicate:letterPredicate]; [_letters setObject:itemsLetter forKey:letter]; } But when this algorithm ends the _letters dictionary have all the keys but the objects are empty arrays. I have tried to change the NSPredicate* letterPredicate = [NSPredicate predicateWithFormat:@"name beginswith[c] '%@'", letter]; for NSPredicate* letterPredicate = [NSPredicate predicateWithFormat:@"name beginswith[c] 'B'"]; And all works fine(Of course it gives me only the objects that starts with B). What I'm doing wrong? For me it's clear that the problem is in the predicate instruction. I have see that _lettersArray is fine and it is and I tried to use `[letter characterAtIndex:0]` instead of letter but gives me the same result... An NSLog of the predicate sentence gives me the exact sentence formation that I do manually and works!
0
11,471,826
07/13/2012 13:49:42
1,523,687
07/13/2012 13:32:31
1
0
Check if file exist in folder javascript .ajax
I tried using the code below but it only works if i am checking for file in the root folder (e.g. url: "filename.html")... If i want to check for files that are in folders (e.g. url: "folder/filename.html") like the code below, it will always success and alert me "File found" even when the folder is empty or the folder doesn't have that file. $.ajax({ type: "GET", async: false, url: "folder/filename.html", cache: false, success: function () { alert("File found"); }, error: function (xhr, status, error) { if (xhr.status == 404) { alert("xhr: File Not Found"); } alert("Error: File Not Found"); } });
javascript
jquery-ajax
null
null
null
null
open
Check if file exist in folder javascript .ajax === I tried using the code below but it only works if i am checking for file in the root folder (e.g. url: "filename.html")... If i want to check for files that are in folders (e.g. url: "folder/filename.html") like the code below, it will always success and alert me "File found" even when the folder is empty or the folder doesn't have that file. $.ajax({ type: "GET", async: false, url: "folder/filename.html", cache: false, success: function () { alert("File found"); }, error: function (xhr, status, error) { if (xhr.status == 404) { alert("xhr: File Not Found"); } alert("Error: File Not Found"); } });
0
11,471,827
07/13/2012 13:49:46
1,072,106
11/29/2011 19:59:29
421
25
Looking for a library/framework to stream live video from OS X to Wowza server (RTMP)
I already know I can stream a video file via FFMPEG to my wowza server but what I need to be able to do is stream live video (For example from the built in webcam or other attached cameras) to the server. One method I considered was saving the video to short ~10sec files and then using FFMPEG to stream those up to the wowza server but I face 2 issues with that. First, how can I insure there will be no breaks in the feed when I switch to the next video clip to stream. Two, how do I set it up to record in 10 second chunks without missing anything in between. Thanks!
osx
rtmp
wowza
null
null
null
open
Looking for a library/framework to stream live video from OS X to Wowza server (RTMP) === I already know I can stream a video file via FFMPEG to my wowza server but what I need to be able to do is stream live video (For example from the built in webcam or other attached cameras) to the server. One method I considered was saving the video to short ~10sec files and then using FFMPEG to stream those up to the wowza server but I face 2 issues with that. First, how can I insure there will be no breaks in the feed when I switch to the next video clip to stream. Two, how do I set it up to record in 10 second chunks without missing anything in between. Thanks!
0
11,471,831
07/13/2012 13:49:50
628,080
02/22/2011 09:52:39
140
0
Java - PDF outputstream
Hi all and thanks for taking the time to answer my question. I'm trying to send an array of bytes to the client so that his browser can reconstruct in e PDF file. Below is my code: OutputStream out = response.getPortletOutputStream(); response.setProperty("Content-Disposition", "attachment; filename=" + fileName + ".pdf"); response.setContentType("application/pdf"); out.write(pdfInvoice); out.flush(); out.close(); We're working with Liferay Portlets but that should not make a difference. pdfInvoice is the byte array. Nothing happens when this code executes. Can you spot what's wrong? Thanks in advance!
java
file-io
pdf-generation
liferay
null
null
open
Java - PDF outputstream === Hi all and thanks for taking the time to answer my question. I'm trying to send an array of bytes to the client so that his browser can reconstruct in e PDF file. Below is my code: OutputStream out = response.getPortletOutputStream(); response.setProperty("Content-Disposition", "attachment; filename=" + fileName + ".pdf"); response.setContentType("application/pdf"); out.write(pdfInvoice); out.flush(); out.close(); We're working with Liferay Portlets but that should not make a difference. pdfInvoice is the byte array. Nothing happens when this code executes. Can you spot what's wrong? Thanks in advance!
0
11,471,838
07/13/2012 13:50:24
1,523,676
07/13/2012 13:27:42
1
0
Ajax, JavaScript, PHP/HTML and variables
Ok... so I have a game I'm developing and I'm running into a scope problem I think... It starts in my js file fired by a click on the card the player wants to play: <code> It starts in my js file: function playCard(playerId, card){ $.post("support_files/Blades_functions.php", { method:'playCardFromHand', playerID:playerId, cardName:card },function(data){ var attr = new Array(); attr = data.split("/"); alert(data); $("#playerAttackPower").html(attr[0]); $("#playerDefensePower").html(attr[1]); $("#playerHealth").html(attr[2]); $("#playerAttackMod").html(attr[3]); $("#playerChargeCounters").html(attr[4]); $("#playerSpecialAttackCounters").html(attr[5]); }); } Then into my php file function playCardFromHand(){ $weapons = new WeaponCards(); // this is basically a class with variables(card objects) (my answer to php not having enums really) $player = $theGame->gamePlayers[$_POST['playerID']]; // this is the variable ($theGame) that I declare in my main php file with all the markup on it. I'm including my functions file in my main file so the variable should be visible... I've tried using "global" keyword as well and that didn't do anything different... $cardName = $_POST['cardName']; $card = $weapons->$cardName; $card->applyCard($player); echo $player->getAttack()."/".$player->getDefense()."/".$player->getLife()."/".$player->getAttackMultiplier()."/".$player->getChargeCounters()."/".$player->getSpecAttackCounters(); } </code> So my problem is that the $player variable is null so nothing is displayed. Basically, as you can see in the callback on the js function, I'm just parsing out the string and updating the player's stats on the main php page. So is this a scope thing? Is there some way to make PHP persist that $theGame variable, which is an object itself, so that I can access/modify it in my functions file? Any ideas would be most helpful... I've tried using the global keyword, as I said... tried making the variables in the $theGame object public, tried making them private and using getters and setters... I've had a separate problem with that actually, can't seem to get my functions to work on my objects in general, have just been making my variables public and accessing them directly instead of using the getters and setters. Anyway. Please help! I'm so frustrated!!! lol Thanks, Jon
php
javascript
ajax
scope
null
null
open
Ajax, JavaScript, PHP/HTML and variables === Ok... so I have a game I'm developing and I'm running into a scope problem I think... It starts in my js file fired by a click on the card the player wants to play: <code> It starts in my js file: function playCard(playerId, card){ $.post("support_files/Blades_functions.php", { method:'playCardFromHand', playerID:playerId, cardName:card },function(data){ var attr = new Array(); attr = data.split("/"); alert(data); $("#playerAttackPower").html(attr[0]); $("#playerDefensePower").html(attr[1]); $("#playerHealth").html(attr[2]); $("#playerAttackMod").html(attr[3]); $("#playerChargeCounters").html(attr[4]); $("#playerSpecialAttackCounters").html(attr[5]); }); } Then into my php file function playCardFromHand(){ $weapons = new WeaponCards(); // this is basically a class with variables(card objects) (my answer to php not having enums really) $player = $theGame->gamePlayers[$_POST['playerID']]; // this is the variable ($theGame) that I declare in my main php file with all the markup on it. I'm including my functions file in my main file so the variable should be visible... I've tried using "global" keyword as well and that didn't do anything different... $cardName = $_POST['cardName']; $card = $weapons->$cardName; $card->applyCard($player); echo $player->getAttack()."/".$player->getDefense()."/".$player->getLife()."/".$player->getAttackMultiplier()."/".$player->getChargeCounters()."/".$player->getSpecAttackCounters(); } </code> So my problem is that the $player variable is null so nothing is displayed. Basically, as you can see in the callback on the js function, I'm just parsing out the string and updating the player's stats on the main php page. So is this a scope thing? Is there some way to make PHP persist that $theGame variable, which is an object itself, so that I can access/modify it in my functions file? Any ideas would be most helpful... I've tried using the global keyword, as I said... tried making the variables in the $theGame object public, tried making them private and using getters and setters... I've had a separate problem with that actually, can't seem to get my functions to work on my objects in general, have just been making my variables public and accessing them directly instead of using the getters and setters. Anyway. Please help! I'm so frustrated!!! lol Thanks, Jon
0
11,471,843
07/13/2012 13:50:34
1,130,964
01/04/2012 22:36:35
10
0
Huge font in html email for outlook
I'm designing an email newsletter in html for multiple email clients, so far it works in every client except for outlook... The font gets so large that the tables etc break. I've already given the css inline everywhere and added some css tricks for outlook, I'm out of solutions for this one. This is the code; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="format-detection" content="telephone=yes"> <meta name="viewport" content="width=600,initial-scale = 2.3,user-scalable=no"> <title>Untitled Document</title> <style type="text/css"> /* Client-specific Styles */ #outlook a{padding:0;} body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} body{-webkit-text-size-adjust:none; -ms-text-size-adjust:none;} p { margin: 1em 0; } h1, h2, h3, h4, h5, h6 { color: black !important; line-height: 100% !important; } h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: blue !important; } h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active { color: red !important; } h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited { color: purple !important; } table td { border-collapse:collapse; } .yshortcuts, .yshortcuts a, .yshortcuts a:link,.yshortcuts a:visited, .yshortcuts a:hover, .yshortcuts a span { color: black; text-decoration: none !important; border-bottom: none !important; background: none !important;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } .ExternalClass{display:inline-block; line-height: 131%}; .ExternalClass {width: 100%;} .ReadMsgBody{width: 100%;} table td { border-collapse: collapse; } body { margin: 0; padding: 0; width: 100%; overflow-y: hidden; background-color: #000000; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica; vertical-align: top; border-spacing: 0px; color: #ffffff; } p { margin-bottom: 10px; margin-left: 35px; margin-right: 35px; } .container { width: 600px; background-color: #000; margin: 0 auto; } a:link { color: #ffffff; text-decoration: underline; } a:visited { color: #6E6C64; text-decoration: underline; } a:hover, a:active, a:focus { text-decoration: none; } </style> </head> <body margin="0" padding="0" width="100%" style="overflow-y:hidden; background-color:#000000; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; font-family:Helvetica; vertical-align:top; border-spacing:0px; font-size:1em;"> <table class="container" width="600px" background-color="#000000" margin="0 auto" cellpadding="0" cellspacing="0"> <tr width="600px"> <td style="line-height:10px;"><img src="http://mediabunker.com/email/header.png" align="absbottom"></td> </tr> <tr bgcolor="#f8f8f8" width="600px"> <td style="font-family:Helvetica; font-size:1em;"> <h1 align="center" style="color:#000000;">Need apps? We build ‘em.</h1> <p style="margin-bottom:10px; color:#575757; margin-left:35px; margin-right:35px; font-size:1em;">Het gebruik van applicaties, oftewel apps, is namelijk booming! Steeds meer merken en bedrijven zien het gemak van een app in. Het is de ideale optie voor het versterken van uw merk, zowel extern als intern, of het opzetten van een geheel nieuw product. Ook de enorme groei in gebruik van mobiele apparaten zorgt er voor dat een sterk merk niet meer kan achter blijven.</p> <p style="margin-bottom:10px; color:#575757; margin-left:35px; margin-right:35px; font-size:1em;">Mocht u geïnteresseerd zijn in onze service, van op maat gemaakte applicaties en backend oplossingen, neem dan gerust contact met ons op. U bent van harte welkom voor een kop koffie bij ons in de Suikersilo's, tijdens een verkennend gesprek of een demonstratie van de mogelijkheden van apps voor mobiel, tablets, tv en het web.</p> <p style="margin-bottom:10px; color:#575757; margin-left:35px; margin-right:35px; margin-bottom:60px; font-size:1em;">Alvast bedankt en hopelijk tot ziens.</p> </td> </tr> <tr width="600px"> <td><img src="http://mediabunker.com/email/title.png" align="absbottom"></td> </tr> <tr bgcolor="#232323" width="600px"> <td style="font-family:Helvetica; font-size:1em;"> <table height="auto" border="0" cellpadding="5px" margin-top="0" align="center" style="color:#fff;"> <tr align="center"> <td align="center"><img src="http://mediabunker.com/email/apple.png"/></td> <td align="center"><img src="http://mediabunker.com/email/android.png" /></td> </tr> <tr> <td align="center" style="font-family:Helvetica; font-size:1em;">Apple iOS de kracht achter<br /> de iPhone, iPod en iPad.</td> <td align="center" style="font-family:Helvetica; font-size:1em;">Android is met Google, HTC en<br /> Samsung, het meest gebruikte<br /> mobiele besturingssysteem.</td> </tr> <tr> <td align="center"><img src="http://mediabunker.com/email/windows.png" /></td> <td align="center"><img src="http://mediabunker.com/email/html.png" /></td> </tr> <tr> <td align="center" style="font-family:Helvetica; font-size:1em;">Together Microsoft and Nokia<br /> support conventional users <br /> with Windows Phone.</td> <td align="center" style="font-family:Helvetica; font-size:1em;">Looking for other platforms<br /> like BlackBerry, Samsung <br /> Bada or HTML5 &amp; CSS3?<br /> We can build it!</td> </tr> </table> </td> </tr> <tr width="600px"> <td><img src="http://mediabunker.com/email/actie.png" align="absbottom"></td> </tr> <tr width="600px"> <td> <table border="0" HALIGN="center" style="margin-bottom:30px; margin-top:20px;"> <tr align="center"> <td align="center" width="189px" style="font-family:Helvetica; font-size:1em;"><font color="white">Suikersilo-West 23 <br />1165 MP Halfweg</font></td> <td align="center" width="189px" style="font-family:Helvetica; font-size:1em;"><a href="tel:0031238200140">Tel +31 23 820 0140</a><br> <a href="mailto:[email protected]">[email protected]</a></td> <td align="center" width="189px" style="font-family:Helvetica; font-size:1em;"><a href="http://mediabunker.com">www.mediabunker.com</a><br> <a href="http://twitter.com/mediabunker">twitter.com/mediabunker</a></td> </tr> </table> </td> </tr> </table> </body> </html> And the online version fwiw; http://mediabunker.com/email/email.html And a quick upload of a screenshot someone sent me, this is the newest outlook version I think. http://i49.tinypic.com/5xlbmw.png
html
email
fonts
outlook
size
null
open
Huge font in html email for outlook === I'm designing an email newsletter in html for multiple email clients, so far it works in every client except for outlook... The font gets so large that the tables etc break. I've already given the css inline everywhere and added some css tricks for outlook, I'm out of solutions for this one. This is the code; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="format-detection" content="telephone=yes"> <meta name="viewport" content="width=600,initial-scale = 2.3,user-scalable=no"> <title>Untitled Document</title> <style type="text/css"> /* Client-specific Styles */ #outlook a{padding:0;} body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} body{-webkit-text-size-adjust:none; -ms-text-size-adjust:none;} p { margin: 1em 0; } h1, h2, h3, h4, h5, h6 { color: black !important; line-height: 100% !important; } h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: blue !important; } h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active { color: red !important; } h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited { color: purple !important; } table td { border-collapse:collapse; } .yshortcuts, .yshortcuts a, .yshortcuts a:link,.yshortcuts a:visited, .yshortcuts a:hover, .yshortcuts a span { color: black; text-decoration: none !important; border-bottom: none !important; background: none !important;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } .ExternalClass{display:inline-block; line-height: 131%}; .ExternalClass {width: 100%;} .ReadMsgBody{width: 100%;} table td { border-collapse: collapse; } body { margin: 0; padding: 0; width: 100%; overflow-y: hidden; background-color: #000000; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica; vertical-align: top; border-spacing: 0px; color: #ffffff; } p { margin-bottom: 10px; margin-left: 35px; margin-right: 35px; } .container { width: 600px; background-color: #000; margin: 0 auto; } a:link { color: #ffffff; text-decoration: underline; } a:visited { color: #6E6C64; text-decoration: underline; } a:hover, a:active, a:focus { text-decoration: none; } </style> </head> <body margin="0" padding="0" width="100%" style="overflow-y:hidden; background-color:#000000; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; font-family:Helvetica; vertical-align:top; border-spacing:0px; font-size:1em;"> <table class="container" width="600px" background-color="#000000" margin="0 auto" cellpadding="0" cellspacing="0"> <tr width="600px"> <td style="line-height:10px;"><img src="http://mediabunker.com/email/header.png" align="absbottom"></td> </tr> <tr bgcolor="#f8f8f8" width="600px"> <td style="font-family:Helvetica; font-size:1em;"> <h1 align="center" style="color:#000000;">Need apps? We build ‘em.</h1> <p style="margin-bottom:10px; color:#575757; margin-left:35px; margin-right:35px; font-size:1em;">Het gebruik van applicaties, oftewel apps, is namelijk booming! Steeds meer merken en bedrijven zien het gemak van een app in. Het is de ideale optie voor het versterken van uw merk, zowel extern als intern, of het opzetten van een geheel nieuw product. Ook de enorme groei in gebruik van mobiele apparaten zorgt er voor dat een sterk merk niet meer kan achter blijven.</p> <p style="margin-bottom:10px; color:#575757; margin-left:35px; margin-right:35px; font-size:1em;">Mocht u geïnteresseerd zijn in onze service, van op maat gemaakte applicaties en backend oplossingen, neem dan gerust contact met ons op. U bent van harte welkom voor een kop koffie bij ons in de Suikersilo's, tijdens een verkennend gesprek of een demonstratie van de mogelijkheden van apps voor mobiel, tablets, tv en het web.</p> <p style="margin-bottom:10px; color:#575757; margin-left:35px; margin-right:35px; margin-bottom:60px; font-size:1em;">Alvast bedankt en hopelijk tot ziens.</p> </td> </tr> <tr width="600px"> <td><img src="http://mediabunker.com/email/title.png" align="absbottom"></td> </tr> <tr bgcolor="#232323" width="600px"> <td style="font-family:Helvetica; font-size:1em;"> <table height="auto" border="0" cellpadding="5px" margin-top="0" align="center" style="color:#fff;"> <tr align="center"> <td align="center"><img src="http://mediabunker.com/email/apple.png"/></td> <td align="center"><img src="http://mediabunker.com/email/android.png" /></td> </tr> <tr> <td align="center" style="font-family:Helvetica; font-size:1em;">Apple iOS de kracht achter<br /> de iPhone, iPod en iPad.</td> <td align="center" style="font-family:Helvetica; font-size:1em;">Android is met Google, HTC en<br /> Samsung, het meest gebruikte<br /> mobiele besturingssysteem.</td> </tr> <tr> <td align="center"><img src="http://mediabunker.com/email/windows.png" /></td> <td align="center"><img src="http://mediabunker.com/email/html.png" /></td> </tr> <tr> <td align="center" style="font-family:Helvetica; font-size:1em;">Together Microsoft and Nokia<br /> support conventional users <br /> with Windows Phone.</td> <td align="center" style="font-family:Helvetica; font-size:1em;">Looking for other platforms<br /> like BlackBerry, Samsung <br /> Bada or HTML5 &amp; CSS3?<br /> We can build it!</td> </tr> </table> </td> </tr> <tr width="600px"> <td><img src="http://mediabunker.com/email/actie.png" align="absbottom"></td> </tr> <tr width="600px"> <td> <table border="0" HALIGN="center" style="margin-bottom:30px; margin-top:20px;"> <tr align="center"> <td align="center" width="189px" style="font-family:Helvetica; font-size:1em;"><font color="white">Suikersilo-West 23 <br />1165 MP Halfweg</font></td> <td align="center" width="189px" style="font-family:Helvetica; font-size:1em;"><a href="tel:0031238200140">Tel +31 23 820 0140</a><br> <a href="mailto:[email protected]">[email protected]</a></td> <td align="center" width="189px" style="font-family:Helvetica; font-size:1em;"><a href="http://mediabunker.com">www.mediabunker.com</a><br> <a href="http://twitter.com/mediabunker">twitter.com/mediabunker</a></td> </tr> </table> </td> </tr> </table> </body> </html> And the online version fwiw; http://mediabunker.com/email/email.html And a quick upload of a screenshot someone sent me, this is the newest outlook version I think. http://i49.tinypic.com/5xlbmw.png
0
11,471,844
07/13/2012 13:50:36
86,798
04/03/2009 16:05:26
46
1
Git: reviewing changes to a branch
When performing a code review my approach is to use meld to view the changes to the branch: **Step 1**. Using git log to find the sha1's of the first and last commits on the branch <pre> git log --graph --oneline --all </pre> This will give something like: <pre> * fffffff Another commit to HEAD * eeeeeee A commit to HEAD | * ddddddd The last commit on branch MY_AWESOME_CHANGE | * ccccccc Some work | * bbbbbbb First commit on branch MY_AWESOME_CHANGE |/ * aaaaaaa Updated comments to explain aggregation of External Data </pre> **Step 2**. Use git difftool to launch meld to view the changes <pre> git difftool aaaaaaa ddddddd </pre> My question is: Is there a better way to go about step 1? The following question provides a way to find the branch start point: [finding-a-branch-point-with-git](http://stackoverflow.com/questions/1527234/finding-a-branch-point-with-git). I can then use "git log" to find the sha1 for the last commit on the branch: <pre> git log -1 MY_AWESOME_BRANCH </pre> But it seems overkill and I wonder if I'm missing something simpler.
git
null
null
null
null
null
open
Git: reviewing changes to a branch === When performing a code review my approach is to use meld to view the changes to the branch: **Step 1**. Using git log to find the sha1's of the first and last commits on the branch <pre> git log --graph --oneline --all </pre> This will give something like: <pre> * fffffff Another commit to HEAD * eeeeeee A commit to HEAD | * ddddddd The last commit on branch MY_AWESOME_CHANGE | * ccccccc Some work | * bbbbbbb First commit on branch MY_AWESOME_CHANGE |/ * aaaaaaa Updated comments to explain aggregation of External Data </pre> **Step 2**. Use git difftool to launch meld to view the changes <pre> git difftool aaaaaaa ddddddd </pre> My question is: Is there a better way to go about step 1? The following question provides a way to find the branch start point: [finding-a-branch-point-with-git](http://stackoverflow.com/questions/1527234/finding-a-branch-point-with-git). I can then use "git log" to find the sha1 for the last commit on the branch: <pre> git log -1 MY_AWESOME_BRANCH </pre> But it seems overkill and I wonder if I'm missing something simpler.
0
11,471,846
07/13/2012 13:50:40
1,503,476
07/05/2012 09:13:18
1
2
What's the best framework to build a seo optimized ajax page?
I am about to start a new web project that will be heavily using ajax requests (through jQuery) to pull content. Basically there will be one main page and all the content will be pulled when needed through ajax. I found on google that by using escaped fragments the website will be indexed (https://developers.google.com/webmasters/ajax-crawling/docs/getting-started). But will this be as good as building a conventional website with pretty (speaking) urls? Also I was wondering which js-framework you guys could recommend to build this website. So far I have been looking at http://backbonejs.org/ and http://sammyjs.org/ but haven't decided
javascript
jquery
ajax
frameworks
seo
07/14/2012 05:10:37
not constructive
What's the best framework to build a seo optimized ajax page? === I am about to start a new web project that will be heavily using ajax requests (through jQuery) to pull content. Basically there will be one main page and all the content will be pulled when needed through ajax. I found on google that by using escaped fragments the website will be indexed (https://developers.google.com/webmasters/ajax-crawling/docs/getting-started). But will this be as good as building a conventional website with pretty (speaking) urls? Also I was wondering which js-framework you guys could recommend to build this website. So far I have been looking at http://backbonejs.org/ and http://sammyjs.org/ but haven't decided
4
11,594,312
07/21/2012 17:23:44
1,542,949
07/21/2012 16:49:34
1
0
Storing objects in an Sqlite3 database using C# and WinRT
following this guide <a href="http://wp.qmatteoq.com/using-sqlite-in-your-windows-8-metro-style-applications/">here</a> i have defined a custom class (lets just call it MyClass), and using the sqlite release for WinRT (windows 8/metro apps) and the sqlite-net API obtained from the NuGet package manager within Visual Studio 2012 have been able to create a database file that is meant to store instances of MyClass SQLiteAsyncConnection conn = new SQLiteAsyncConnection("MyClassDB"); await conn.CreateTableAsync<MyClass>(); However MyClass contains arrays (of other custom classes and string arrays) and other "more complex" types than just text and numbers, and even though they are clearly defined in the MyClass definition, they are not being created as accepted fields in the database file (i checked using an sqlite database browser, and by opening the file in notepad, and found just the string and number fields of MyClass) How do i get the database to store instances of these other types/classes that are present in MyClass, or, assuming that that sort of thing isnt supported, what alternative solution could i use? some of the properties of MyClass will be used for queries etc in the program. i would be most grateful for any help
c#
sqlite
windows-8
microsoft-metro
winrt
null
open
Storing objects in an Sqlite3 database using C# and WinRT === following this guide <a href="http://wp.qmatteoq.com/using-sqlite-in-your-windows-8-metro-style-applications/">here</a> i have defined a custom class (lets just call it MyClass), and using the sqlite release for WinRT (windows 8/metro apps) and the sqlite-net API obtained from the NuGet package manager within Visual Studio 2012 have been able to create a database file that is meant to store instances of MyClass SQLiteAsyncConnection conn = new SQLiteAsyncConnection("MyClassDB"); await conn.CreateTableAsync<MyClass>(); However MyClass contains arrays (of other custom classes and string arrays) and other "more complex" types than just text and numbers, and even though they are clearly defined in the MyClass definition, they are not being created as accepted fields in the database file (i checked using an sqlite database browser, and by opening the file in notepad, and found just the string and number fields of MyClass) How do i get the database to store instances of these other types/classes that are present in MyClass, or, assuming that that sort of thing isnt supported, what alternative solution could i use? some of the properties of MyClass will be used for queries etc in the program. i would be most grateful for any help
0
11,594,269
07/21/2012 17:18:16
139,090
07/15/2009 23:55:19
181
12
Structuring a Nested Loop for Table Creation
I've got the looping thing for table rows down pretty much, but when I want to create header `<th>` rows, I am at a loss. For instance, I can traverse down to grab the "Auto Brand" and make a table containing the brand name and specifics in ONE normal table row from the first member, but getting the nested loop to keep going for all "sibling" arrays is driving me bonkers. I can't go the simple route and just use the array name as it isn't "human friendly" Imagine the following: a - r: [{ country: "Italy", id: "194", type: "sports", style: { doors: "2", layout: "rwd" }, model: { name: "Alfa Romeo", marque: "Spider", slug: "alfa-romeo-spider", id: "59" }, url: "http://www.alfaromeo.it" }, { country: "Italy", id: "195", type: "sports", style: { doors: "2", layout: "rwd" }, model: { name: "Alfa Romeo", marque: "Graduate", slug: "alfa-romeo-graduate", id: "60" }, url: "http://www.alfaromeo.it" }], packard: [{ country: "USA", id: "200", type: "sedan", style: { doors: "4", layout: "rwd" }, model: { name: "Packard", marque: "Phantom", slug: "packard-phantom", id: "80" }, url: "http://www.packard.com" }, { country: "USA", id: "220", type: "coupe", style: { doors: "2", layout: "rwd" }, model: { name: "Packard", marque: "626", slug: "packard-626", id: "305" }, url: "http://www.packard.it" }],[...] So, I need to basically traverse down to the first "model.name" instance, grab that value and slam it into the table header or caption... whatever. Then I need to run another loop to just grab the country[value], type[value], model.marque[value] and put those into rows for every member of the array and close the table... ad nauseam. I am trying to somehow, in the loop, grab that initial model.name[value], hold it, then loop over all the siblings and put the rows together.... i just figure if I do this, I am declaring (and constructing) the header/caption for every row which is obviously not desired. I thank you Traversal Masters and Mistresses for any insight you can provide. I am getting old, and my brain has been melted from the heatwave as of late.
jquery
json
loops
traversal
nested-loops
null
open
Structuring a Nested Loop for Table Creation === I've got the looping thing for table rows down pretty much, but when I want to create header `<th>` rows, I am at a loss. For instance, I can traverse down to grab the "Auto Brand" and make a table containing the brand name and specifics in ONE normal table row from the first member, but getting the nested loop to keep going for all "sibling" arrays is driving me bonkers. I can't go the simple route and just use the array name as it isn't "human friendly" Imagine the following: a - r: [{ country: "Italy", id: "194", type: "sports", style: { doors: "2", layout: "rwd" }, model: { name: "Alfa Romeo", marque: "Spider", slug: "alfa-romeo-spider", id: "59" }, url: "http://www.alfaromeo.it" }, { country: "Italy", id: "195", type: "sports", style: { doors: "2", layout: "rwd" }, model: { name: "Alfa Romeo", marque: "Graduate", slug: "alfa-romeo-graduate", id: "60" }, url: "http://www.alfaromeo.it" }], packard: [{ country: "USA", id: "200", type: "sedan", style: { doors: "4", layout: "rwd" }, model: { name: "Packard", marque: "Phantom", slug: "packard-phantom", id: "80" }, url: "http://www.packard.com" }, { country: "USA", id: "220", type: "coupe", style: { doors: "2", layout: "rwd" }, model: { name: "Packard", marque: "626", slug: "packard-626", id: "305" }, url: "http://www.packard.it" }],[...] So, I need to basically traverse down to the first "model.name" instance, grab that value and slam it into the table header or caption... whatever. Then I need to run another loop to just grab the country[value], type[value], model.marque[value] and put those into rows for every member of the array and close the table... ad nauseam. I am trying to somehow, in the loop, grab that initial model.name[value], hold it, then loop over all the siblings and put the rows together.... i just figure if I do this, I am declaring (and constructing) the header/caption for every row which is obviously not desired. I thank you Traversal Masters and Mistresses for any insight you can provide. I am getting old, and my brain has been melted from the heatwave as of late.
0
11,594,314
07/21/2012 17:23:55
571,828
01/11/2011 20:07:37
299
4
shutdowning a fixed size thread pool
I use `Executors.newFixedThreadPool` to generate a thread pool, and want to shutdown it when the job queue is empty and no thread is working. How should I do that?
java
concurrency
null
null
null
null
open
shutdowning a fixed size thread pool === I use `Executors.newFixedThreadPool` to generate a thread pool, and want to shutdown it when the job queue is empty and no thread is working. How should I do that?
0
11,594,319
07/21/2012 17:24:10
301,159
03/24/2010 19:33:13
386
0
Whay can't i open gmail.com using SimpleTest?
Using [simpletest][1] i'm able to open any page. But i'm not able to open gmail.com or anything related to google. I can open using cUrl. what should i do to open gmail.com using simpletest. The code i'm trying is below require_once('simpletest/browser.php'); $headers = array( "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4", "Accept: text/xml,application/xml,application/xhtml +xml,text/html;q=0.9,text/plain;q=0.8,imag e/png,*/*;q=0.5", "Accept-Language: en-gb,en;q=0.5", "Accept-Encoding: text", # No gzip, it only clutters your code! "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Date: ".date(DATE_RFC822) ); $browser = &new SimpleBrowser(); $browser->addHeader$headers); $html = $browser->get('http://gmail.com/'); echo '$html; [1]: http://simpletest.org/
php
simpletest
headless-browser
null
null
null
open
Whay can't i open gmail.com using SimpleTest? === Using [simpletest][1] i'm able to open any page. But i'm not able to open gmail.com or anything related to google. I can open using cUrl. what should i do to open gmail.com using simpletest. The code i'm trying is below require_once('simpletest/browser.php'); $headers = array( "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4", "Accept: text/xml,application/xml,application/xhtml +xml,text/html;q=0.9,text/plain;q=0.8,imag e/png,*/*;q=0.5", "Accept-Language: en-gb,en;q=0.5", "Accept-Encoding: text", # No gzip, it only clutters your code! "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Date: ".date(DATE_RFC822) ); $browser = &new SimpleBrowser(); $browser->addHeader$headers); $html = $browser->get('http://gmail.com/'); echo '$html; [1]: http://simpletest.org/
0
11,594,320
07/21/2012 17:24:11
1,378,184
05/06/2012 15:01:14
1
0
SSH Terminal in Browser in Ruby
I've taken a look at the Net-SSH gem, but it doesn't seem to support the in browser aspect. Before I start integrating that gem with javascript and a full user interface, I just wanted to ask the community if there are any libraries that have done this for me already. Feel free to suggest libraries outside of ruby. Any and all suggestions welcome.
ruby
ssh
null
null
null
null
open
SSH Terminal in Browser in Ruby === I've taken a look at the Net-SSH gem, but it doesn't seem to support the in browser aspect. Before I start integrating that gem with javascript and a full user interface, I just wanted to ask the community if there are any libraries that have done this for me already. Feel free to suggest libraries outside of ruby. Any and all suggestions welcome.
0
11,594,321
07/21/2012 17:24:14
1,348,516
04/21/2012 15:53:59
50
0
Using Jquery UI to drag and update Lists and extract line item ID for update
I am trying to build a team picker application that allows you drag the players who are not into teams into teams. I am using JQUERY UI sortable with "connectWith". So far I can drag the players from the players list into separate teams, however I want to be able to fire an update for each individual player when they are moved between teams. I have created a jsfiddle: http://jsfiddle.net/dXmpG/ When the "player" is dragged from the players list to the team list the script alerts the name of the two lists however what I would like to be able to get is the id of the line item that has been moved so that I can send an update similar to: myupdatescript.php?Player=[li item id]&FirstList=Players&SecondList=Team1 Is there anyway of extracting the id of the line item that is getting moved?
jquery
jquery-ui
jquery-ui-sortable
null
null
null
open
Using Jquery UI to drag and update Lists and extract line item ID for update === I am trying to build a team picker application that allows you drag the players who are not into teams into teams. I am using JQUERY UI sortable with "connectWith". So far I can drag the players from the players list into separate teams, however I want to be able to fire an update for each individual player when they are moved between teams. I have created a jsfiddle: http://jsfiddle.net/dXmpG/ When the "player" is dragged from the players list to the team list the script alerts the name of the two lists however what I would like to be able to get is the id of the line item that has been moved so that I can send an update similar to: myupdatescript.php?Player=[li item id]&FirstList=Players&SecondList=Team1 Is there anyway of extracting the id of the line item that is getting moved?
0
11,594,327
07/21/2012 17:25:00
1,188,874
02/04/2012 04:27:11
60
0
How to find the coordinates for Navigation
I have added an ImageMap Control and I am using it for navigation. My question is how will find out the coordinates for my hotspots if my image should provide for than single-page navigation. `for example` I want first x% area to navigate to `facebook.com` on clicking then some area should navigate to `stackoverflow.com`. So how can I find the exacts coordites like top, left, corner etc to make my ImageMap click-able for right targets? Thanks in advance.
c#
asp.net
imagemap
null
null
null
open
How to find the coordinates for Navigation === I have added an ImageMap Control and I am using it for navigation. My question is how will find out the coordinates for my hotspots if my image should provide for than single-page navigation. `for example` I want first x% area to navigate to `facebook.com` on clicking then some area should navigate to `stackoverflow.com`. So how can I find the exacts coordites like top, left, corner etc to make my ImageMap click-able for right targets? Thanks in advance.
0
11,594,328
07/21/2012 17:25:07
1,364,030
04/29/2012 10:26:17
1
0
Facebook change getAccessToken method?
I had worked a lot with the facebook sdk, i had a lot of problems but this just came up, i had scripts that were working, but when i create a new app of facebook and try to use : $facebook->getUser(), or $facebook->api('/me'); they don't work, is there something that i'm missing in creating apps on facebook? they changed something? Thanks.
facebook
facebook-graph-api
sdk
null
null
07/24/2012 03:02:03
too localized
Facebook change getAccessToken method? === I had worked a lot with the facebook sdk, i had a lot of problems but this just came up, i had scripts that were working, but when i create a new app of facebook and try to use : $facebook->getUser(), or $facebook->api('/me'); they don't work, is there something that i'm missing in creating apps on facebook? they changed something? Thanks.
3
11,594,334
07/21/2012 17:25:32
1,526,573
07/15/2012 06:55:10
17
0
How to optimize CSS code?
How should I go about optimizing CSS code? There's various CSS3 lines, like -moz- and -webkit-, border-top-left-radius, etc.. I believe bigger CSS files increase page load time significantly. And another question: I've written quite some code, however some of it is left unused. I have over 2000 lines of CSS code, and I bet around 200-300 lines could be removed, perhaps even more. Is it worth revising all the code? It would take quite some time...
css
optimization
css3
null
null
null
open
How to optimize CSS code? === How should I go about optimizing CSS code? There's various CSS3 lines, like -moz- and -webkit-, border-top-left-radius, etc.. I believe bigger CSS files increase page load time significantly. And another question: I've written quite some code, however some of it is left unused. I have over 2000 lines of CSS code, and I bet around 200-300 lines could be removed, perhaps even more. Is it worth revising all the code? It would take quite some time...
0
11,713,697
07/29/2012 22:58:42
283,296
02/28/2010 23:05:44
2,089
7
Converting an indexed image in uint32 to double
I read the following [in the documentation][1] of `im2double` > **Class Support:** > > > Intensity and truecolor images can be uint8, uint16, double, logical, > single**, or int16. Indexed images can be **uint8**, **uint16**, **double** or > **logical**. Binary input images must be logical. The output image is > double I am working on a 64 bit machine (i.e. MATLAB uses **8 bytes** to represent variables of type double). I have an indexed image of type **uint32** and I believe I should be able to convert it to type **double**, but `im2double` doesn't seem to support it, i.e. I get the following error: Error using im2double Expected input number 1, Image, to be one of these types: double, logical, uint8, uint16, int16, single Instead its type was uint32. So, how can I convert a matrix (an indexed image) of type `uint32` to `double`? This is all on **MATLAB 2012a** [1]: http://www.mathworks.com/help/releases/R2011b/toolbox/images/ref/im2double.html
matlab
null
null
null
null
null
open
Converting an indexed image in uint32 to double === I read the following [in the documentation][1] of `im2double` > **Class Support:** > > > Intensity and truecolor images can be uint8, uint16, double, logical, > single**, or int16. Indexed images can be **uint8**, **uint16**, **double** or > **logical**. Binary input images must be logical. The output image is > double I am working on a 64 bit machine (i.e. MATLAB uses **8 bytes** to represent variables of type double). I have an indexed image of type **uint32** and I believe I should be able to convert it to type **double**, but `im2double` doesn't seem to support it, i.e. I get the following error: Error using im2double Expected input number 1, Image, to be one of these types: double, logical, uint8, uint16, int16, single Instead its type was uint32. So, how can I convert a matrix (an indexed image) of type `uint32` to `double`? This is all on **MATLAB 2012a** [1]: http://www.mathworks.com/help/releases/R2011b/toolbox/images/ref/im2double.html
0
11,713,703
07/29/2012 22:59:48
1,048,466
11/15/2011 21:06:43
228
1
Writing my own api, help please
I have been writing my own api for my site, the api will only allow a consumer to read basic information. Somebody suggested to me that I gave the consumer a public and private API key. The private API key would be for server side scripts such as php so the public can't view it and use it in a wrong way, and then a public key would be for languages such as javascript. For the public api key they told me I would have to check the original source of the request and match it to a url in my database. But the way I was going to check the URL the request was coming from was by checking the refer, but I know that the referrer can be changed, so this wouldn't be a good idea. I'm looking for a way to check the referring URL properly which is very reliable. Or could anyone suggest to me a difference way of doing this API?
api
referrer
api-key
refer
null
null
open
Writing my own api, help please === I have been writing my own api for my site, the api will only allow a consumer to read basic information. Somebody suggested to me that I gave the consumer a public and private API key. The private API key would be for server side scripts such as php so the public can't view it and use it in a wrong way, and then a public key would be for languages such as javascript. For the public api key they told me I would have to check the original source of the request and match it to a url in my database. But the way I was going to check the URL the request was coming from was by checking the refer, but I know that the referrer can be changed, so this wouldn't be a good idea. I'm looking for a way to check the referring URL properly which is very reliable. Or could anyone suggest to me a difference way of doing this API?
0
11,713,705
07/29/2012 22:59:53
407,495
07/31/2010 14:40:59
86
2
What when mysqldump becomes utterly slow
Currently my database is almost 20 GB big and still growing. I'm taking a daily backup with mysqldump and it's getting really slow. So slow that in the meanwhile new connections stack up and eventually cause this error: SQLSTATE[HY000] [1040] Too many connections (I could improve the amount of connections that's accepted but that won't do anything because the connections are still just frozen, waiting for the backup to complete, which will lead to timeout) I've been reading up on some options to improve the speed and this is what I've found: 1. option --quick (Will probably help) 2. option --single-transaction (Will prevent tables from being locked, but may cause database to become incorrect) 3. Master-Slave replication (Probably the best thing I could do, one problem, I have only one server available) The master-slave replication really sounds like it's the best option since I can stop the slave from updating, take the backup, and let it resume syncing. The problem is I only have one fysical machine to work with. I know that I can set up multiple mysql instances on this one server. The question is: Is it wise to do so? The slave is really only used to generate that backup file (which will be copied to a different disk on the network) so that the master can stay live.
mysql
database-replication
database-backups
backup-strategies
null
null
open
What when mysqldump becomes utterly slow === Currently my database is almost 20 GB big and still growing. I'm taking a daily backup with mysqldump and it's getting really slow. So slow that in the meanwhile new connections stack up and eventually cause this error: SQLSTATE[HY000] [1040] Too many connections (I could improve the amount of connections that's accepted but that won't do anything because the connections are still just frozen, waiting for the backup to complete, which will lead to timeout) I've been reading up on some options to improve the speed and this is what I've found: 1. option --quick (Will probably help) 2. option --single-transaction (Will prevent tables from being locked, but may cause database to become incorrect) 3. Master-Slave replication (Probably the best thing I could do, one problem, I have only one server available) The master-slave replication really sounds like it's the best option since I can stop the slave from updating, take the backup, and let it resume syncing. The problem is I only have one fysical machine to work with. I know that I can set up multiple mysql instances on this one server. The question is: Is it wise to do so? The slave is really only used to generate that backup file (which will be copied to a different disk on the network) so that the master can stay live.
0
11,713,699
07/29/2012 22:58:58
928,156
09/05/2011 02:31:38
36
1
pointer substrings arrays
Im trying to copy part of a string to another string using pointers. My resulting string starts to copy at the correct place though it doesn't stop after exceeding the count. Also the string isn't copy from the source string rather than from the result parameter #include <stdio.h> char *getSub(const char *orig, int start, int count, char *res); int main(void) { const char orig[] = "one two three"; char res[] = "123456789012345678"; printf("%s\n",getSub(orig, 4, 3, res)); return 0; } char *getSub(const char *orig, int start, int count, char *res) { const char *sCopy = orig; while (*orig) { if (start >= (orig - sourceCopy)) && (res-sCopy < c)) { *res++ = *orig++; } else *orig++; } return res; }
arrays
pointers
substrings
null
null
null
open
pointer substrings arrays === Im trying to copy part of a string to another string using pointers. My resulting string starts to copy at the correct place though it doesn't stop after exceeding the count. Also the string isn't copy from the source string rather than from the result parameter #include <stdio.h> char *getSub(const char *orig, int start, int count, char *res); int main(void) { const char orig[] = "one two three"; char res[] = "123456789012345678"; printf("%s\n",getSub(orig, 4, 3, res)); return 0; } char *getSub(const char *orig, int start, int count, char *res) { const char *sCopy = orig; while (*orig) { if (start >= (orig - sourceCopy)) && (res-sCopy < c)) { *res++ = *orig++; } else *orig++; } return res; }
0
11,713,701
07/29/2012 22:59:43
1,313,611
04/04/2012 18:46:39
455
18
How to debug C extensions for Python on Windows
I have a <a href='http://stackoverflow.com/questions/11657958/catching-a-segfault-in-python-pyodbc-cursor-fetch-causes-python-to-crash'>problem</a> with a segfault in pyodbc and would like to debug it in Windows XP x86. However, the information online seems primarily a Linux-centric. What is the best way to go about this?
python
c
windows
debugging
gdb
null
open
How to debug C extensions for Python on Windows === I have a <a href='http://stackoverflow.com/questions/11657958/catching-a-segfault-in-python-pyodbc-cursor-fetch-causes-python-to-crash'>problem</a> with a segfault in pyodbc and would like to debug it in Windows XP x86. However, the information online seems primarily a Linux-centric. What is the best way to go about this?
0
11,713,706
07/29/2012 23:00:05
359,248
06/05/2010 14:57:24
123
4
Custom view class or UIView class in Xcode
I drag an image view into storyboard, create new class files called "MyImageView" subclassing UIImageView, and set the custom class to the view in its identity inspector. Then I ctrl-drag the image view into controller file, the generated code are: @property (weak, nonatomic) IBOutlet MyImageView *imageView; Then Xcode flags an error which force me to change MyImageView to UIImageView, I do it accordingly and the warning goes away. But I don't understand here. I think the class should be MyImageView. Any idea?
xcode
uiimageview
null
null
null
null
open
Custom view class or UIView class in Xcode === I drag an image view into storyboard, create new class files called "MyImageView" subclassing UIImageView, and set the custom class to the view in its identity inspector. Then I ctrl-drag the image view into controller file, the generated code are: @property (weak, nonatomic) IBOutlet MyImageView *imageView; Then Xcode flags an error which force me to change MyImageView to UIImageView, I do it accordingly and the warning goes away. But I don't understand here. I think the class should be MyImageView. Any idea?
0
11,713,695
07/29/2012 22:58:06
932,307
09/07/2011 08:34:52
596
74
Read a file from Amazon EBS
I want to download a file from one of the EBS volumes I created on Amazon Elastic block storage. Mostly it is advisable to used `ServletContext#getResource()` and its counterpart `ServletContext#getResourceAsStream()` as well advised [here][1]. **But in this case is the following code advisable** `InputStream in = new FileInputStream(new File(FOLDER_PATH_ON_AMAZON_EBS + "/" + folder + "/" + fileName));` [1]: http://stackoverflow.com/a/2308388/932307
java
amazon-ec2
amazon-web-services
amazon-ebs
servlet-3.0
null
open
Read a file from Amazon EBS === I want to download a file from one of the EBS volumes I created on Amazon Elastic block storage. Mostly it is advisable to used `ServletContext#getResource()` and its counterpart `ServletContext#getResourceAsStream()` as well advised [here][1]. **But in this case is the following code advisable** `InputStream in = new FileInputStream(new File(FOLDER_PATH_ON_AMAZON_EBS + "/" + folder + "/" + fileName));` [1]: http://stackoverflow.com/a/2308388/932307
0
11,713,696
07/29/2012 22:58:32
388,174
07/09/2010 22:25:22
76
1
Android MediaPlayer streaming stops on network change
I am streaming audio using MediaPlayer on Android. When the device moves from Wi-Fi to the cell network or vice-versa, the MediaPlayer stops playback. Typically there are a few seconds-worth of audio in the buffer, so playback does not cease immediately. Ideally I would like to pick up the stream for uninterrupted playback, but I cannot see how to do it. I am working with both mp3 files hosted on the server and a live broadcast stream.
android
audio
streaming
null
null
null
open
Android MediaPlayer streaming stops on network change === I am streaming audio using MediaPlayer on Android. When the device moves from Wi-Fi to the cell network or vice-versa, the MediaPlayer stops playback. Typically there are a few seconds-worth of audio in the buffer, so playback does not cease immediately. Ideally I would like to pick up the stream for uninterrupted playback, but I cannot see how to do it. I am working with both mp3 files hosted on the server and a live broadcast stream.
0
11,401,333
07/09/2012 18:58:18
1,072,846
11/30/2011 07:34:39
163
14
How can I implement delegation for a view controller presented by a segue?
In my main view controller, an NSTimer calls the function below after a specified delay: -(void)showAdView{ [self performSegueWithIdentifier:@"ShowAdSegue" sender:nil]; } This modally presents `MyAdViewController`, and I'd like the `MyAdViewController` class to have a `MyAdViewControllerDelegate` protocol, so that I can implement an `adViewDidFinish` function in my main view controller. Is it possible to do that without creating a new instance of `MyAdViewController` in the main view controller?
ios
uiviewcontroller
uistoryboard
segue
null
null
open
How can I implement delegation for a view controller presented by a segue? === In my main view controller, an NSTimer calls the function below after a specified delay: -(void)showAdView{ [self performSegueWithIdentifier:@"ShowAdSegue" sender:nil]; } This modally presents `MyAdViewController`, and I'd like the `MyAdViewController` class to have a `MyAdViewControllerDelegate` protocol, so that I can implement an `adViewDidFinish` function in my main view controller. Is it possible to do that without creating a new instance of `MyAdViewController` in the main view controller?
0
11,401,344
07/09/2012 18:58:47
1,512,849
07/09/2012 18:41:19
1
0
Facing Login Error for some user ids
I trying to use login using facebook in my website. I used exactly the same code given in developers.facebook.com website. window.fbAsyncInit = function () { FB.init({ appId: 'app_id', status: true, cookie: true, xfbml: true }); }; (function (d) { var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) { return; } js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; ref.parentNode.insertBefore(js, ref); } (document)); When i was testing my website.....I was able to login with my Facebook User Id and it worked...then i tried it with my friends it worked for some and didnt work for others...then i created an another account in facebook and tried with that it didnt work...Does anyone have any answer....or knows what exactly happens.
login
facebook-login
null
null
null
null
open
Facing Login Error for some user ids === I trying to use login using facebook in my website. I used exactly the same code given in developers.facebook.com website. window.fbAsyncInit = function () { FB.init({ appId: 'app_id', status: true, cookie: true, xfbml: true }); }; (function (d) { var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) { return; } js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; ref.parentNode.insertBefore(js, ref); } (document)); When i was testing my website.....I was able to login with my Facebook User Id and it worked...then i tried it with my friends it worked for some and didnt work for others...then i created an another account in facebook and tried with that it didnt work...Does anyone have any answer....or knows what exactly happens.
0
9,221,017
02/10/2012 00:21:09
994,179
10/13/2011 19:13:15
311
3
Work around for global variable size limit in visual c
#define ACOUNT 2000 #define BCOUNT 9000 #define CCOUNT 195 struct s_ptx { int pvCount[ACOUNT][BCOUNT][CCOUNT]; } ptx; This produces a VStudio 2010 Visual C (compiling under 64bit) error #C2148: error C2148: total size of array must not exceed 0x7fffffff bytes I know I could dynamically allocate the pvCount 3d array, but then I'd have to do a zillion alloc's and free's. I have 192 gig of memory, so I'm trying to find a compiler switch or option that allows something of this size.
c
size
malloc
global-variables
limit
null
open
Work around for global variable size limit in visual c === #define ACOUNT 2000 #define BCOUNT 9000 #define CCOUNT 195 struct s_ptx { int pvCount[ACOUNT][BCOUNT][CCOUNT]; } ptx; This produces a VStudio 2010 Visual C (compiling under 64bit) error #C2148: error C2148: total size of array must not exceed 0x7fffffff bytes I know I could dynamically allocate the pvCount 3d array, but then I'd have to do a zillion alloc's and free's. I have 192 gig of memory, so I'm trying to find a compiler switch or option that allows something of this size.
0
9,221,018
02/10/2012 00:21:13
177,567
09/23/2009 04:30:08
814
42
How to view CORS Websocket requests using Firebug?
Using Firebug, is there a way to view Websocket request/response pairs made to a Cross-Origin Resource Sharing (CORS) server?
firebug
websocket
cors
null
null
null
open
How to view CORS Websocket requests using Firebug? === Using Firebug, is there a way to view Websocket request/response pairs made to a Cross-Origin Resource Sharing (CORS) server?
0
11,401,354
07/09/2012 18:59:15
1,512,879
07/09/2012 18:54:11
1
0
Application Request Routing and IIS Application Pools
I am deploying Application Request Routing and the deployment guide says it recommends to disable Application Pool recycling and idle time out. However, I am not sure I understand why this is recommended - if I don't disable them, what is the likely consequence, is it simply speed (i.e. the pool has to reload so it might be slow) or could it actually cause errors / a connection to fail/drop etc. The reason for not wanting to just blindly follow the guide, is ARR is only reverse proxying part of the system, other applications will still be running and be served from the Default App Pool.
iis
null
null
null
null
null
open
Application Request Routing and IIS Application Pools === I am deploying Application Request Routing and the deployment guide says it recommends to disable Application Pool recycling and idle time out. However, I am not sure I understand why this is recommended - if I don't disable them, what is the likely consequence, is it simply speed (i.e. the pool has to reload so it might be slow) or could it actually cause errors / a connection to fail/drop etc. The reason for not wanting to just blindly follow the guide, is ARR is only reverse proxying part of the system, other applications will still be running and be served from the Default App Pool.
0
11,401,335
07/09/2012 18:58:24
1,255,834
03/07/2012 22:26:19
43
0
Graphviz Graph creation noobie Image from java
I would like to run my java program, which needs to make a bunch of images of graphs. I have a website, but I do not want the graphviz program to be run everytime someone visits the page, so I am running a scheduled server side java program, that will make the graphs, so that the web page just pics up the images. Now I can't seem to figure it out. I am using spring to query a database to generate info for my graph, and then I make a .dot file. Using a simple text writer. I put the whole graphviz program on my server, how would I go about getting an image from this .dot file. I have done my research and I need to make a $ -Tpng graphic.dot -o graphic.png type call, but that is a terminal call. And I cant seem to figure it out. Should I be using something like Grappa? How should I go about doing this problem? Should I try to ope the exe and pass that line of code in as a parameter, furthermore where will the image file be created?
java
graphviz
null
null
null
null
open
Graphviz Graph creation noobie Image from java === I would like to run my java program, which needs to make a bunch of images of graphs. I have a website, but I do not want the graphviz program to be run everytime someone visits the page, so I am running a scheduled server side java program, that will make the graphs, so that the web page just pics up the images. Now I can't seem to figure it out. I am using spring to query a database to generate info for my graph, and then I make a .dot file. Using a simple text writer. I put the whole graphviz program on my server, how would I go about getting an image from this .dot file. I have done my research and I need to make a $ -Tpng graphic.dot -o graphic.png type call, but that is a terminal call. And I cant seem to figure it out. Should I be using something like Grappa? How should I go about doing this problem? Should I try to ope the exe and pass that line of code in as a parameter, furthermore where will the image file be created?
0
11,401,336
07/09/2012 18:58:27
1,512,835
07/09/2012 18:37:02
1
0
Python regex ordering issue
I have been running into a problem with python's re module. This is the simplest version of the issue import re print re.findall('a|ab','aab') # ['a', 'a'] print re.findall('ab|a','aab') # ['a', 'ab'] I generate regexes at runtime from a text file and cannot be certain that they will be in the correct order. Is there any way around this issue?
python
regex
null
null
null
null
open
Python regex ordering issue === I have been running into a problem with python's re module. This is the simplest version of the issue import re print re.findall('a|ab','aab') # ['a', 'a'] print re.findall('ab|a','aab') # ['a', 'ab'] I generate regexes at runtime from a text file and cannot be certain that they will be in the correct order. Is there any way around this issue?
0
11,658,358
07/25/2012 20:47:52
1,492,582
06/30/2012 05:05:27
18
0
Setting up a custom error page
My hosting provider allows me to setup custom error pages (ex. http://domain.com/error.php) but every time I go unto a page that doesn't exist (404) it redirects it to the error.php page. I noticed on other larger websites, that when you go to a page that doesn't exist, it keeps you on that page but displays the error. I don't want it redirecting to the error.php page.
redirect
error-handling
website
null
null
null
open
Setting up a custom error page === My hosting provider allows me to setup custom error pages (ex. http://domain.com/error.php) but every time I go unto a page that doesn't exist (404) it redirects it to the error.php page. I noticed on other larger websites, that when you go to a page that doesn't exist, it keeps you on that page but displays the error. I don't want it redirecting to the error.php page.
0
11,660,318
07/25/2012 23:41:27
170,365
09/08/2009 18:48:04
2,562
13
How can I hook on scripts and CSS into <head>?
The thing with the module I am making is that it kind of generates a javascript snippet, so I cannot use an action to just hook that into the <head> section of the HTML since the action requires that I have a JS file (correct me if I am wrong). What are some ways for me to put a JavaScript snippet into the <head> tag? I was thinking of using a block, but I am not sure what the block should be appended after and I have to consider that this will work with all themes.
magento
null
null
null
null
null
open
How can I hook on scripts and CSS into <head>? === The thing with the module I am making is that it kind of generates a javascript snippet, so I cannot use an action to just hook that into the <head> section of the HTML since the action requires that I have a JS file (correct me if I am wrong). What are some ways for me to put a JavaScript snippet into the <head> tag? I was thinking of using a block, but I am not sure what the block should be appended after and I have to consider that this will work with all themes.
0
11,660,323
07/25/2012 23:41:37
1,171,266
01/26/2012 12:39:48
21
1
Rails 3 - Issue with storing floats
I am creating a 3D map and I have the x, y, and z values for each point, the current database I am get the data from has the values like so: x = -8.851079259998058e16 y = 4.236944396687888e16 z = -4.451352534647966e16 I have tried to make a database migration like so: class CreateMapPoints < ActiveRecord::Migration def change create_table :map_points do |t| t.float :x t.float :y t.float :z t.timestamps end end end However when I import the data into this new table and run the following in `rails console`, I get strange results: 1.9.2-p290 :002 > MapPoint.first MapPoint Load (0.6ms) SELECT `map_points`.* FROM `map_points` LIMIT 1 => #<MapPoint id: 1, x: -88510800000000000.0, y: 42369400000000000.0, z: -44513500000000000.0, created_at: nil, updated_at: nil> The x, y and z are missing the point after the first digit. Could someone advise on what I am doing incorrect here? Any help would be appreciated. Thanks Tony
mysql
ruby
ruby-on-rails-3
floating-point
migration
null
open
Rails 3 - Issue with storing floats === I am creating a 3D map and I have the x, y, and z values for each point, the current database I am get the data from has the values like so: x = -8.851079259998058e16 y = 4.236944396687888e16 z = -4.451352534647966e16 I have tried to make a database migration like so: class CreateMapPoints < ActiveRecord::Migration def change create_table :map_points do |t| t.float :x t.float :y t.float :z t.timestamps end end end However when I import the data into this new table and run the following in `rails console`, I get strange results: 1.9.2-p290 :002 > MapPoint.first MapPoint Load (0.6ms) SELECT `map_points`.* FROM `map_points` LIMIT 1 => #<MapPoint id: 1, x: -88510800000000000.0, y: 42369400000000000.0, z: -44513500000000000.0, created_at: nil, updated_at: nil> The x, y and z are missing the point after the first digit. Could someone advise on what I am doing incorrect here? Any help would be appreciated. Thanks Tony
0
11,660,314
07/25/2012 23:41:08
1,152,980
01/17/2012 01:13:04
129
3
How to change Id & class names in Sublime Text2 across all open html/css/javascript files?
I want to know how (if it is possible) to select an Id (or other attribute) in Sublime Text2 and change it and have all changes be reflected in every attribute in every open window or in a "project" across multiple files.
sublimetext2
null
null
null
null
null
open
How to change Id & class names in Sublime Text2 across all open html/css/javascript files? === I want to know how (if it is possible) to select an Id (or other attribute) in Sublime Text2 and change it and have all changes be reflected in every attribute in every open window or in a "project" across multiple files.
0
11,660,317
07/25/2012 23:41:24
114,855
05/30/2009 17:50:20
454
13
Facebook Not Sending HTTP Referer to Canvas App?
This one's got me stumped. I'm setting up a dev version version of my app and for some reason the iframe is not receiving the HTTP referrer header. The app I'm working on relies on that header being sent. Can you think of any reason why the iframe wouldn't be receiving it? The app (no referer): http://apps.facebook.com/colinlocaltms A link to Canvas URL (has StackOverflow as the referer - expected since you're clicking the link): http://secret-lake-4762.herokuapp.com/ Thanks! Colin
facebook
iframe
facebook-canvas
null
null
null
open
Facebook Not Sending HTTP Referer to Canvas App? === This one's got me stumped. I'm setting up a dev version version of my app and for some reason the iframe is not receiving the HTTP referrer header. The app I'm working on relies on that header being sent. Can you think of any reason why the iframe wouldn't be receiving it? The app (no referer): http://apps.facebook.com/colinlocaltms A link to Canvas URL (has StackOverflow as the referer - expected since you're clicking the link): http://secret-lake-4762.herokuapp.com/ Thanks! Colin
0
11,659,678
07/25/2012 22:33:22
1,317,981
04/06/2012 17:40:27
397
13
How can I implement an infinite set class?
I'm designing a class library for discrete mathematics, and I can't think of a way to implement an [infinite set](http://en.wikipedia.org/wiki/Infinite_set). What I have so far is: I have an abstract base class, Set, which implements the interface ISet<T>. For finite sets, I derive a class FiniteSet<T>, which implements each set method. I can then use it like this: FiniteSet<int> set1 = new FiniteSet<int>(1, 2, 3); FiniteSet<int> set2 = new FiniteSet<int>(3, 4, 5); Console.WriteLine(set1); //{1, 2, 3} Console.WriteLine(set2); //{3, 4, 5} set1.UnionWith(set2); Console.WriteLine(set1); //{1, 2, 3, 4, 5} Now I want to represent an infinite set. I had the idea of deriving another abstract class from set, InfiniteSet, and then developers using the library would have to derive from InfiniteSet to implement their own classes. I'd supply commonly used sets, such as N, Z, Q, and R. But I have no idea how I'd implement methods like Subset and GetEnumerator - I'm even starting to think it's impossible. How do you enumerate an infinite set in a practical way, so that you can intersect/union it with another infinite set? How can you check, in code, that N is a subset of R? And as for the issue of cardinality.. Well, that's properly a separate question. All this leads me to the conclusion that my idea for implementing an infinite set is properly the wrong way to go. I'd very much appreciate your input :).
c#
set
set-theory
null
null
null
open
How can I implement an infinite set class? === I'm designing a class library for discrete mathematics, and I can't think of a way to implement an [infinite set](http://en.wikipedia.org/wiki/Infinite_set). What I have so far is: I have an abstract base class, Set, which implements the interface ISet<T>. For finite sets, I derive a class FiniteSet<T>, which implements each set method. I can then use it like this: FiniteSet<int> set1 = new FiniteSet<int>(1, 2, 3); FiniteSet<int> set2 = new FiniteSet<int>(3, 4, 5); Console.WriteLine(set1); //{1, 2, 3} Console.WriteLine(set2); //{3, 4, 5} set1.UnionWith(set2); Console.WriteLine(set1); //{1, 2, 3, 4, 5} Now I want to represent an infinite set. I had the idea of deriving another abstract class from set, InfiniteSet, and then developers using the library would have to derive from InfiniteSet to implement their own classes. I'd supply commonly used sets, such as N, Z, Q, and R. But I have no idea how I'd implement methods like Subset and GetEnumerator - I'm even starting to think it's impossible. How do you enumerate an infinite set in a practical way, so that you can intersect/union it with another infinite set? How can you check, in code, that N is a subset of R? And as for the issue of cardinality.. Well, that's properly a separate question. All this leads me to the conclusion that my idea for implementing an infinite set is properly the wrong way to go. I'd very much appreciate your input :).
0
11,567,689
07/19/2012 19:10:22
1,171,509
01/26/2012 14:51:12
51
6
Is it possible to monitor all network traffic in a Safari Extension?
Since the newer versions of Safari (I'm running version 5.2) seem to have removed the "Activity" viewer from the "Window" menu, I would like to write an extension to have this feature back. However, in order to do that I think that I will need to be able to see what URLs are being requested in that window/tab. For Chrome, there is a ["webRequest" API] that does this, but I can't seem to find what I'm looking for to do this in Safari. Would someone please tell me if this is possible, and if so, where should I look next? Thanks in advance. ["webRequest" API]:http://code.google.com/chrome/extensions/trunk/webRequest.html
safari-extension
null
null
null
null
null
open
Is it possible to monitor all network traffic in a Safari Extension? === Since the newer versions of Safari (I'm running version 5.2) seem to have removed the "Activity" viewer from the "Window" menu, I would like to write an extension to have this feature back. However, in order to do that I think that I will need to be able to see what URLs are being requested in that window/tab. For Chrome, there is a ["webRequest" API] that does this, but I can't seem to find what I'm looking for to do this in Safari. Would someone please tell me if this is possible, and if so, where should I look next? Thanks in advance. ["webRequest" API]:http://code.google.com/chrome/extensions/trunk/webRequest.html
0
11,567,698
07/19/2012 19:11:08
1,536,557
07/19/2012 02:16:22
1
0
Fixing line endigns in git
when i push the files which i modified arent showing the correct difference with the files in the github. What i mean actually is Am using windows 7 as operating system and the files i pulled from git hub are unix line endings. After i edit the files and push them to repo , on github its hard to find out what changes i made for my collaborator . I tried fixing them manually using "Edit->EOL conversion -> unix " in notepad++ . For some files it is working and some arent working. I need some one who can help me to make the file line endings to default settings like unix or make them as they are which mean when am downloading they are unix and want them in unix line endings. I tried dream weaver preferences also but it did not work. help me guys please *this is my first question over stack overflow if am bad at explanation please ignore . Thanks in advance
php
git
github
null
null
null
open
Fixing line endigns in git === when i push the files which i modified arent showing the correct difference with the files in the github. What i mean actually is Am using windows 7 as operating system and the files i pulled from git hub are unix line endings. After i edit the files and push them to repo , on github its hard to find out what changes i made for my collaborator . I tried fixing them manually using "Edit->EOL conversion -> unix " in notepad++ . For some files it is working and some arent working. I need some one who can help me to make the file line endings to default settings like unix or make them as they are which mean when am downloading they are unix and want them in unix line endings. I tried dream weaver preferences also but it did not work. help me guys please *this is my first question over stack overflow if am bad at explanation please ignore . Thanks in advance
0
11,567,699
07/19/2012 19:11:09
1,521,251
07/12/2012 15:26:21
1
0
Trying to save an image in mysql database using netbeans program
I'm building a food menu program and in that the user will insert the category code,category name and browse for a suitable image which will be stored in the database as BLOB and click save. But I get an exception in my program such as this. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?,?,?)' at line 1 this is my coding.. package Frames; import Methods.DB_Con; import com.mysql.jdbc.Connection; import com.mysql.jdbc.PreparedStatement; import com.mysql.jdbc.Statement; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.util.Random; import javax.swing.JFileChooser; import javax.swing.JOptionPane; /** * * @author ASHAN */ public class AddCategory extends javax.swing.JFrame { String filename = null; int s = 0; byte[] cat_image = null; /** Creates new form AddMenu */ public AddCategory() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jLabel12 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); codetext = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); cat_name = new javax.swing.JTextField(); jButton3 = new javax.swing.JButton(); jTextField2 = new javax.swing.JTextField(); jButton4 = new javax.swing.JButton(); jDesktopPane1 = new javax.swing.JDesktopPane(); jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel12.setFont(new java.awt.Font("Tahoma", 0, 36)); jLabel12.setForeground(new java.awt.Color(255, 0, 0)); jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel12.setText("Add Category"); jLabel12.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, new java.awt.Color(0, 153, 255), null, null)); jButton1.setText("Browse for Image"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Generate Code"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Category Name"); jButton3.setText("Save"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton4.setText("Back"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jLabel2.setBounds(0, 0, 150, 130); jDesktopPane1.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(216, 216, 216) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(229, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addGroup(layout.createSequentialGroup() .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) .addGap(138, 138, 138) .addComponent(codetext, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) .addGap(138, 138, 138) .addComponent(cat_name, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))) .addGap(299, 299, 299)) .addGroup(layout.createSequentialGroup() .addGap(194, 194, 194) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(55, 55, 55) .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(271, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) .addGap(138, 138, 138) .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE) .addGap(76, 76, 76) .addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(76, 76, 76)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(58, 58, 58) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton2) .addComponent(codetext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cat_name, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(73, 73, 73) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton1) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 125, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton3) .addComponent(jButton4)) .addGap(42, 42, 42)) .addGroup(layout.createSequentialGroup() .addGap(251, 251, 251) .addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(107, Short.MAX_VALUE)) ); pack(); }// </editor-fold> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser chooser = new JFileChooser(); chooser.showOpenDialog(null); File f = chooser.getSelectedFile(); filename = f.getAbsolutePath(); jTextField2.setText(filename); try { File image = new File(filename); FileInputStream fis = new FileInputStream(image); ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte buf[] = new byte[1024]; for (int readNum; (readNum = fis.read(buf)) != -1;) { bos.write(buf, 0, readNum); } cat_image = bos.toByteArray(); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { Random rand = new Random(); int n = rand.nextInt(90000) + 10000; codetext.setText(Integer.toString(n)); } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { try { Connection con = DB_Con.getConnection(); String sql = "insert into category (cat_code,cat_name,cat_image) values (?,?,?)"; PreparedStatement st = (PreparedStatement) con.prepareStatement(sql); //int code=Integer.parseInt(codetext.getText()); // st.setInt(1, code); st.setString(1, codetext.getText()); st.setString(2, cat_name.getText()); st.setBytes(3, cat_image); st.execute(sql); st.close(); JOptionPane.showMessageDialog(null, "Details Successfully Added"); } catch (Exception e) { // JOptionPane.showMessageDialog(null, e); System.out.println(e); } } private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { AddMenuMain am = new AddMenuMain(); am.setVisible(true); this.setVisible(false); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new AddCategory().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JTextField cat_name; private javax.swing.JTextField codetext; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JDesktopPane jDesktopPane1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel2; private javax.swing.JTextField jTextField2; // End of variables declaration } There are no errors in my coding. can some one help me please.
mysql
image
null
null
null
null
open
Trying to save an image in mysql database using netbeans program === I'm building a food menu program and in that the user will insert the category code,category name and browse for a suitable image which will be stored in the database as BLOB and click save. But I get an exception in my program such as this. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?,?,?)' at line 1 this is my coding.. package Frames; import Methods.DB_Con; import com.mysql.jdbc.Connection; import com.mysql.jdbc.PreparedStatement; import com.mysql.jdbc.Statement; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.util.Random; import javax.swing.JFileChooser; import javax.swing.JOptionPane; /** * * @author ASHAN */ public class AddCategory extends javax.swing.JFrame { String filename = null; int s = 0; byte[] cat_image = null; /** Creates new form AddMenu */ public AddCategory() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jLabel12 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); codetext = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); cat_name = new javax.swing.JTextField(); jButton3 = new javax.swing.JButton(); jTextField2 = new javax.swing.JTextField(); jButton4 = new javax.swing.JButton(); jDesktopPane1 = new javax.swing.JDesktopPane(); jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel12.setFont(new java.awt.Font("Tahoma", 0, 36)); jLabel12.setForeground(new java.awt.Color(255, 0, 0)); jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel12.setText("Add Category"); jLabel12.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, new java.awt.Color(0, 153, 255), null, null)); jButton1.setText("Browse for Image"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Generate Code"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Category Name"); jButton3.setText("Save"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton4.setText("Back"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jLabel2.setBounds(0, 0, 150, 130); jDesktopPane1.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(216, 216, 216) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(229, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addGroup(layout.createSequentialGroup() .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) .addGap(138, 138, 138) .addComponent(codetext, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) .addGap(138, 138, 138) .addComponent(cat_name, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))) .addGap(299, 299, 299)) .addGroup(layout.createSequentialGroup() .addGap(194, 194, 194) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(55, 55, 55) .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(271, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) .addGap(138, 138, 138) .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE) .addGap(76, 76, 76) .addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(76, 76, 76)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(58, 58, 58) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton2) .addComponent(codetext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cat_name, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(73, 73, 73) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton1) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 125, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton3) .addComponent(jButton4)) .addGap(42, 42, 42)) .addGroup(layout.createSequentialGroup() .addGap(251, 251, 251) .addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(107, Short.MAX_VALUE)) ); pack(); }// </editor-fold> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser chooser = new JFileChooser(); chooser.showOpenDialog(null); File f = chooser.getSelectedFile(); filename = f.getAbsolutePath(); jTextField2.setText(filename); try { File image = new File(filename); FileInputStream fis = new FileInputStream(image); ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte buf[] = new byte[1024]; for (int readNum; (readNum = fis.read(buf)) != -1;) { bos.write(buf, 0, readNum); } cat_image = bos.toByteArray(); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { Random rand = new Random(); int n = rand.nextInt(90000) + 10000; codetext.setText(Integer.toString(n)); } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { try { Connection con = DB_Con.getConnection(); String sql = "insert into category (cat_code,cat_name,cat_image) values (?,?,?)"; PreparedStatement st = (PreparedStatement) con.prepareStatement(sql); //int code=Integer.parseInt(codetext.getText()); // st.setInt(1, code); st.setString(1, codetext.getText()); st.setString(2, cat_name.getText()); st.setBytes(3, cat_image); st.execute(sql); st.close(); JOptionPane.showMessageDialog(null, "Details Successfully Added"); } catch (Exception e) { // JOptionPane.showMessageDialog(null, e); System.out.println(e); } } private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { AddMenuMain am = new AddMenuMain(); am.setVisible(true); this.setVisible(false); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new AddCategory().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JTextField cat_name; private javax.swing.JTextField codetext; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JDesktopPane jDesktopPane1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel2; private javax.swing.JTextField jTextField2; // End of variables declaration } There are no errors in my coding. can some one help me please.
0
11,567,692
07/19/2012 19:10:39
622,096
02/17/2011 20:40:01
256
5
Unable to get a new line using \n in Confirmation Box
Below is my code btnDelete.Attributes.Add("onclick", "{return ConfirmAction('You are about to Delete Order . Please Note \r\n 1. Order no longer can be retrieved \r\n 2. Changes to the order are not saved. \r\n Are you sure you wish to continue to Delete?')};"); I would like the Confirmation box to display the message with Yes and Cancel button as below: You are about to Delete Order . Please Note: 1.Order no longer can be retrieved 2.Changes to the order are not saved Are you sure you wish to continue to Delete? I tried "\n" , '\n' , and "\r\n" but still unable to insert lines.
c#
javascript
null
null
null
null
open
Unable to get a new line using \n in Confirmation Box === Below is my code btnDelete.Attributes.Add("onclick", "{return ConfirmAction('You are about to Delete Order . Please Note \r\n 1. Order no longer can be retrieved \r\n 2. Changes to the order are not saved. \r\n Are you sure you wish to continue to Delete?')};"); I would like the Confirmation box to display the message with Yes and Cancel button as below: You are about to Delete Order . Please Note: 1.Order no longer can be retrieved 2.Changes to the order are not saved Are you sure you wish to continue to Delete? I tried "\n" , '\n' , and "\r\n" but still unable to insert lines.
0
11,567,697
07/19/2012 19:11:07
1,073,616
11/30/2011 15:00:46
27
0
Program to visualize logic flow
I work in an enterprise system and we just received an old COBOL file full of business rules. It's a large collection of IF ELSE statements that assign a value to a variable. Is there a program where I can enter all these IF ELSE logic statements and see the overall flow at the end? Thanks!
java
cobol
flow
visualize
null
null
open
Program to visualize logic flow === I work in an enterprise system and we just received an old COBOL file full of business rules. It's a large collection of IF ELSE statements that assign a value to a variable. Is there a program where I can enter all these IF ELSE logic statements and see the overall flow at the end? Thanks!
0
11,567,706
07/19/2012 19:11:41
923,871
09/01/2011 16:46:18
48
7
Multiple saga mapping of a single message
I need to map one message to multiple saga instances. how can i do it? i thought to an utility service that receives that message and sends copies of it to all saga instances. But this solution requires the knowledge from this service of all sagaIds.
nservicebus
saga
null
null
null
null
open
Multiple saga mapping of a single message === I need to map one message to multiple saga instances. how can i do it? i thought to an utility service that receives that message and sends copies of it to all saga instances. But this solution requires the knowledge from this service of all sagaIds.
0
11,567,707
07/19/2012 19:11:43
1,538,877
07/19/2012 19:04:45
1
0
CSSHttpRequest - javascript does not work transferred
I generate full html+css+javascript page, and paste it on other host via CSSHttpRequest. But javascript not working on pasted page(http://learnit.by/test/).
javascript
cross-domain
null
null
null
null
open
CSSHttpRequest - javascript does not work transferred === I generate full html+css+javascript page, and paste it on other host via CSSHttpRequest. But javascript not working on pasted page(http://learnit.by/test/).
0
11,567,682
07/19/2012 19:09:36
1,538,857
07/19/2012 18:56:55
1
0
A SEIMPLE tutorial for Wt (c++ web development)
Is there any simple Wt Web Toolkit tutorial? I could find the tutorials on the documentation page, but they are more confusing than helpful. Maybe there is a step-by-step guide like w3schools.com has for PHP.
c++
c
web
wt
null
07/20/2012 00:44:35
off topic
A SEIMPLE tutorial for Wt (c++ web development) === Is there any simple Wt Web Toolkit tutorial? I could find the tutorials on the documentation page, but they are more confusing than helpful. Maybe there is a step-by-step guide like w3schools.com has for PHP.
2
11,567,716
07/19/2012 19:12:20
833,786
07/07/2011 14:57:32
5
0
iOS UIImagePicker didFinishPickingMediaWithInfo Vs editingInfo
I am trying to create an app, which can take photos from camera and can also pic images from gallery. But the problem I am having is, When I chose to take picture from Camera it works fine, I'm using - (void) imagePickerController: (UIImagePickerController *) pickerr didFinishPickingMediaWithInfo: (NSDictionary *) info; But when I go for the gallery to pic an images, using - (void)imagePickerController:(UIImagePickerController *)pickerr didFinishPickingImage:(UIImage *) image editingInfo:(NSDictionary *)editingInfo; the above method is executed and the pic I have selected is saved again. If I comment the first method then I am able to show the selected image in UIImageView. What should be changed, so that both can work perfectly. Thanks.
ios
uiimagepickercontroller
null
null
null
null
open
iOS UIImagePicker didFinishPickingMediaWithInfo Vs editingInfo === I am trying to create an app, which can take photos from camera and can also pic images from gallery. But the problem I am having is, When I chose to take picture from Camera it works fine, I'm using - (void) imagePickerController: (UIImagePickerController *) pickerr didFinishPickingMediaWithInfo: (NSDictionary *) info; But when I go for the gallery to pic an images, using - (void)imagePickerController:(UIImagePickerController *)pickerr didFinishPickingImage:(UIImage *) image editingInfo:(NSDictionary *)editingInfo; the above method is executed and the pic I have selected is saved again. If I comment the first method then I am able to show the selected image in UIImageView. What should be changed, so that both can work perfectly. Thanks.
0
11,349,816
07/05/2012 17:53:41
1,469,797
06/20/2012 15:45:25
1
0
How to make Inline expression in javascript wait before executing
I have an expression `<%= GetAddPinScript() %>` that evaluates a method in my code-behind file. The method generates javascript which it then returns: `AddPushpin('data', 'more data', numbers, numbers, 'no');` The key here is that `'no'` is a variable inserted by the code-behind method and helps the rest of my javascript determine if some content should display or not.(basically a bool) The problem I'm having is that the method in my code-behind needs a variable(`result` in the below code) that is sent through an ajax call **before** the expression is evaluated in order to determine the correct variable to generate in the javascript -- but the expression always evaluates on the page load. So how can I prevent the expression from being evaluated before the ajax call is made? Javascript function displayGeneralInfo(specifics) { var callback = AddQueryString(window.location.href, "action", "displayResults"); $.ajax({ url: callback, type: "POST", async: false, data: { specifics: specifics } }); <%= GetAddPinScript() %> } and the AddPushpin function function AddPushpin(name, description, latitude, longitude, selected) { // Add a pin to the map var center = new Microsoft.Maps.Location(latitude, longitude); var pin = new Microsoft.Maps.Pushpin(center, null); if(selected !== null || selected!="") { if(selected == "yes") { infoboxOptions = new Microsoft.Maps.Infobox(center, { width: 285, height: 170, visible:true, actions:[{label: 'Associate', eventHandler: associate}] }); map.entities.push(infoboxOptions); } } map.entities.push(pin); } and the code-behind snippet public string GetAddPinScript() { foreach (Location location in foo(x => !string.IsNullOrWhiteSpace(x.Longitude) && !string.IsNullOrWhiteSpace(x.Latitude))) { selected = "no"; if (!result.IsNullOrEmpty()) { if (location.MapPinDescription.IndexOf(result) > 0) selected = "yes"; } pins.Add(string.Format("AddPushpin('{0}', '{1}', {2}, {3}, '{4}');", location.etc1("'", @"\'"), location.etc2("'", @"\'"), location.etc3, location.etc4, selected)); string retVal = string.Join("\n", pins.ToArray()); return retVal;
c#
javascript
asp.net
ajax
eval
null
open
How to make Inline expression in javascript wait before executing === I have an expression `<%= GetAddPinScript() %>` that evaluates a method in my code-behind file. The method generates javascript which it then returns: `AddPushpin('data', 'more data', numbers, numbers, 'no');` The key here is that `'no'` is a variable inserted by the code-behind method and helps the rest of my javascript determine if some content should display or not.(basically a bool) The problem I'm having is that the method in my code-behind needs a variable(`result` in the below code) that is sent through an ajax call **before** the expression is evaluated in order to determine the correct variable to generate in the javascript -- but the expression always evaluates on the page load. So how can I prevent the expression from being evaluated before the ajax call is made? Javascript function displayGeneralInfo(specifics) { var callback = AddQueryString(window.location.href, "action", "displayResults"); $.ajax({ url: callback, type: "POST", async: false, data: { specifics: specifics } }); <%= GetAddPinScript() %> } and the AddPushpin function function AddPushpin(name, description, latitude, longitude, selected) { // Add a pin to the map var center = new Microsoft.Maps.Location(latitude, longitude); var pin = new Microsoft.Maps.Pushpin(center, null); if(selected !== null || selected!="") { if(selected == "yes") { infoboxOptions = new Microsoft.Maps.Infobox(center, { width: 285, height: 170, visible:true, actions:[{label: 'Associate', eventHandler: associate}] }); map.entities.push(infoboxOptions); } } map.entities.push(pin); } and the code-behind snippet public string GetAddPinScript() { foreach (Location location in foo(x => !string.IsNullOrWhiteSpace(x.Longitude) && !string.IsNullOrWhiteSpace(x.Latitude))) { selected = "no"; if (!result.IsNullOrEmpty()) { if (location.MapPinDescription.IndexOf(result) > 0) selected = "yes"; } pins.Add(string.Format("AddPushpin('{0}', '{1}', {2}, {3}, '{4}');", location.etc1("'", @"\'"), location.etc2("'", @"\'"), location.etc3, location.etc4, selected)); string retVal = string.Join("\n", pins.ToArray()); return retVal;
0
11,349,825
07/05/2012 17:54:26
795,607
06/13/2011 08:25:05
49
1
Cordova(Phonegap) 1.9 on Android can not load external files
I've read many posts concerning this topic. I have just downloaded phonegap 1.9.0 and its android tool set yesterday(4 July 2012). I have put in cordova.xml, my accessorigin: <access origin="http://images.bootkidz.co.uk"/> Then put this basic HTML component: <img src="http://images.bootkidz.co.uk/uk-flag-official-colours.gif"> I don't see the picture in my html page. I am running my app inside Android 2.2 emulator. Could anyone help me out? Thanks Simo
android
phonegap
cordova
null
null
null
open
Cordova(Phonegap) 1.9 on Android can not load external files === I've read many posts concerning this topic. I have just downloaded phonegap 1.9.0 and its android tool set yesterday(4 July 2012). I have put in cordova.xml, my accessorigin: <access origin="http://images.bootkidz.co.uk"/> Then put this basic HTML component: <img src="http://images.bootkidz.co.uk/uk-flag-official-colours.gif"> I don't see the picture in my html page. I am running my app inside Android 2.2 emulator. Could anyone help me out? Thanks Simo
0
11,349,828
07/05/2012 17:54:41
1,313,779
04/04/2012 20:13:16
13
2
Android - Segmented Circle Buttons
I'm trying to create a button which looks something like this: ![sAMPLE](http://s11.postimage.org/m0pcmdrdr/wave_fancy_button_base.jpg) With each third acting as a separate button. I'm looking for advice on how to implement this. I've read a few posts about circular buttons, but this is a slightly different issue, as the buttons themselves are rather irregular shapes. Thanks in advance.
android
button
circle
null
null
null
open
Android - Segmented Circle Buttons === I'm trying to create a button which looks something like this: ![sAMPLE](http://s11.postimage.org/m0pcmdrdr/wave_fancy_button_base.jpg) With each third acting as a separate button. I'm looking for advice on how to implement this. I've read a few posts about circular buttons, but this is a slightly different issue, as the buttons themselves are rather irregular shapes. Thanks in advance.
0
11,349,733
07/05/2012 17:48:24
1,504,784
07/05/2012 17:39:26
1
0
Excel VBA database search procedure
I am currently working on a part database, and I would like to put a search bar on my main worksheet page for the user to search by part number. I have around 35 worksheets each with a different part type, and each sheet has a list of all respective part numbers of parts I deal with in a Column, as well as other information about each part in the other columns. I would like the user to be able to enter a part number on the main page on a search bar and the program would bring the user to the correct row anywhere in the workbook with it highlighted. It doesn't seem to difficult I am just new to VBA and don't know too much syntax. Thanks in advance for your help!
search
excel-vba
null
null
null
null
open
Excel VBA database search procedure === I am currently working on a part database, and I would like to put a search bar on my main worksheet page for the user to search by part number. I have around 35 worksheets each with a different part type, and each sheet has a list of all respective part numbers of parts I deal with in a Column, as well as other information about each part in the other columns. I would like the user to be able to enter a part number on the main page on a search bar and the program would bring the user to the correct row anywhere in the workbook with it highlighted. It doesn't seem to difficult I am just new to VBA and don't know too much syntax. Thanks in advance for your help!
0
11,349,775
07/05/2012 17:51:03
583,781
01/21/2011 00:17:01
187
2
How can a javascript variable that I just displayed immediately error out as undefined?
I have some simple javascript code that looks like this: var divLink = $(this).attr("href"); alert(divLink); if ($(divlink).is(":visible")) $(divLink).hide("blind", { direction: "vertical" }, 1000); It throws this error on line 3: Uncaught ReferenceError: divlink is not defined I put in line two just to see what was in the variable divLink. It returns: The page at mysite.com says: #categories_settings Once I click "OK" on the dialog box, it throws the error. How can this be?
javascript
jquery
null
null
null
null
open
How can a javascript variable that I just displayed immediately error out as undefined? === I have some simple javascript code that looks like this: var divLink = $(this).attr("href"); alert(divLink); if ($(divlink).is(":visible")) $(divLink).hide("blind", { direction: "vertical" }, 1000); It throws this error on line 3: Uncaught ReferenceError: divlink is not defined I put in line two just to see what was in the variable divLink. It returns: The page at mysite.com says: #categories_settings Once I click "OK" on the dialog box, it throws the error. How can this be?
0
11,349,832
07/05/2012 17:55:02
867,248
07/28/2011 10:31:36
63
3
System.Security.Cryptography.ProtectedMemory in WinRT
`System.Security.Cryptography.ProtectedMemory` is not available in WinRT. Is that functionality made available somewhere else?
windows-8
winrt
null
null
null
null
open
System.Security.Cryptography.ProtectedMemory in WinRT === `System.Security.Cryptography.ProtectedMemory` is not available in WinRT. Is that functionality made available somewhere else?
0
11,349,835
07/05/2012 17:55:18
381,274
07/01/2010 16:06:50
75
4
Jquery animate from display none doesn't work first time
I have a little block that I want to animate. But I want it to start from a hidden position, like this: <span class="add_sit" style="height:18px; display:none"><input name="situacao"></span> <img src="plus-circle-blue.png" class="picto" id="lnk_add_sit"> <script> $(function(){ $('#lnk_add_sit').css('cursor','pointer').click(function(e) { e.preventDefault(); $('.add_sit').animate({width:'toggle'}, 'fast'); }); }); </script> This does not animate at first click, only shows the element. At second click, animates the element and changes to display:nome, at third click animates and changes to display:inline-block; and so on. Only the first won't work. How to solve this?
jquery
animate
null
null
null
null
open
Jquery animate from display none doesn't work first time === I have a little block that I want to animate. But I want it to start from a hidden position, like this: <span class="add_sit" style="height:18px; display:none"><input name="situacao"></span> <img src="plus-circle-blue.png" class="picto" id="lnk_add_sit"> <script> $(function(){ $('#lnk_add_sit').css('cursor','pointer').click(function(e) { e.preventDefault(); $('.add_sit').animate({width:'toggle'}, 'fast'); }); }); </script> This does not animate at first click, only shows the element. At second click, animates the element and changes to display:nome, at third click animates and changes to display:inline-block; and so on. Only the first won't work. How to solve this?
0
11,430,139
07/11/2012 10:00:39
1,222,982
02/21/2012 09:28:26
140
4
android : has any view something like hidden value?
I wonder, has any standart view (imageview, imagebutton, textview, button etc) something like hidden value ?? so i need set each item this value and then, for example, get it from view in onclick event.
android
view
hidden
null
null
null
open
android : has any view something like hidden value? === I wonder, has any standart view (imageview, imagebutton, textview, button etc) something like hidden value ?? so i need set each item this value and then, for example, get it from view in onclick event.
0
11,430,276
07/11/2012 10:07:51
1,517,342
07/11/2012 09:40:32
1
0
Concurrency on sqlite database using python
There is a list of data that I want to deal with. However I need to process the data with multiple instances to increase efficiency. Each time each instance shall take out one item, delete it from the list and process it with some procedures. First I tried to store the list in a sqlite database, but sqlite allows multiple read-locks which means multiple instances might get the same item from the database. Is there any way that makes each instance will get an unique item to process? I could use other data structure (other database or just file) if needed. By the way, is there a way to check whether a DELETE operation is successful or not, after executing cursor.execute(delete_query)?
python
database
sqlite
concurrency
locking
null
open
Concurrency on sqlite database using python === There is a list of data that I want to deal with. However I need to process the data with multiple instances to increase efficiency. Each time each instance shall take out one item, delete it from the list and process it with some procedures. First I tried to store the list in a sqlite database, but sqlite allows multiple read-locks which means multiple instances might get the same item from the database. Is there any way that makes each instance will get an unique item to process? I could use other data structure (other database or just file) if needed. By the way, is there a way to check whether a DELETE operation is successful or not, after executing cursor.execute(delete_query)?
0
11,430,277
07/11/2012 10:07:52
1,501,634
07/04/2012 12:57:26
1
0
access to extended class in symfony 1.4
so... I basically follow the [practical symfony book][1], and encountered following problem. I have properly (i guess) installed sfGuardPlugin, built the models, sqls etc, created user and tried to log in with the username and password entered. i got the following error message: > `Fatal error: Call to undefined method sfGuardUserPeer::retrieveByUsername() in /***/plugins/sfGuardPlugin/lib/validator/sfGuardValidatorUser.class.php on line 53` it looks quite weird to me, because the problematic part of sfGuardValidatorUser class looks like this: // user exists? if ($user = sfGuardUserPeer::retrieveByUsername($username)) { // password is ok? if ($user->getIsActive() && $user->checkPassword($password)) { return array_merge($values, array('user' => $user)); } } while sfGuardUserPeer has just the empty class: class sfGuardUserPeer extends PluginsfGuardUserPeer { } that extends PluginsfGuardUserPeer, so i checked it out too: class PluginsfGuardUserPeer extends BasesfGuardUserPeer { public static function retrieveByUsername($username, $isActive = true) { $c = new Criteria(); $c->add(self::USERNAME, $username); $c->add(self::IS_ACTIVE, $isActive); return self::doSelectOne($c); } } that's the missing function! so - what is wrong? why doesn't it work? i have already tried all the solutions found with google, but none of them work :/ [1]: http://www.symfony-project.org/jobeet/1_4/Propel/en/13
php
symfony-1.4
propel
sfguard
null
null
open
access to extended class in symfony 1.4 === so... I basically follow the [practical symfony book][1], and encountered following problem. I have properly (i guess) installed sfGuardPlugin, built the models, sqls etc, created user and tried to log in with the username and password entered. i got the following error message: > `Fatal error: Call to undefined method sfGuardUserPeer::retrieveByUsername() in /***/plugins/sfGuardPlugin/lib/validator/sfGuardValidatorUser.class.php on line 53` it looks quite weird to me, because the problematic part of sfGuardValidatorUser class looks like this: // user exists? if ($user = sfGuardUserPeer::retrieveByUsername($username)) { // password is ok? if ($user->getIsActive() && $user->checkPassword($password)) { return array_merge($values, array('user' => $user)); } } while sfGuardUserPeer has just the empty class: class sfGuardUserPeer extends PluginsfGuardUserPeer { } that extends PluginsfGuardUserPeer, so i checked it out too: class PluginsfGuardUserPeer extends BasesfGuardUserPeer { public static function retrieveByUsername($username, $isActive = true) { $c = new Criteria(); $c->add(self::USERNAME, $username); $c->add(self::IS_ACTIVE, $isActive); return self::doSelectOne($c); } } that's the missing function! so - what is wrong? why doesn't it work? i have already tried all the solutions found with google, but none of them work :/ [1]: http://www.symfony-project.org/jobeet/1_4/Propel/en/13
0
11,430,279
07/11/2012 10:07:59
373,191
06/22/2010 13:06:30
341
30
Prevent XCode 4 from enabling assistent doing debug?
Every time I debug my code in XCode 4 and I have several breakpoints, XCode 4 eventually will turn on the assistant and start displaying the breakpoints in the second split panel. I find it pretty annoying and would really like to disable it. Is is possible? Any thoughts?
xcode4
null
null
null
null
null
open
Prevent XCode 4 from enabling assistent doing debug? === Every time I debug my code in XCode 4 and I have several breakpoints, XCode 4 eventually will turn on the assistant and start displaying the breakpoints in the second split panel. I find it pretty annoying and would really like to disable it. Is is possible? Any thoughts?
0