PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
47
30.1k
OpenStatus_id
int64
0
4
11,360,022
07/06/2012 09:59:58
1,469,928
06/20/2012 16:38:23
1
0
transmit accelerometer data from android to a laptop
I'm looking to build an app that sends the phones accelerometer data to a laptop. The goal is to control and steer a car. I do not want to use bluetooth. How would I go about this? are sockets the way to go?
android
sockets
null
null
null
07/10/2012 16:20:30
not a real question
transmit accelerometer data from android to a laptop === I'm looking to build an app that sends the phones accelerometer data to a laptop. The goal is to control and steer a car. I do not want to use bluetooth. How would I go about this? are sockets the way to go?
1
9,318,932
02/16/2012 20:57:19
1,214,805
02/16/2012 20:50:36
1
0
Using php to display xml that is formatted with css
Spinning wheels here... I have a php file that I'm trying to output some xml. The xml is formatted with css. I can get the xml to display using FILE_GET_CONTENTS, but the xml is unformatted. The xml file points to a css style-sheet I created, but no luck. Is this not possible? I have the css stylesheet on the same directory as the xml file to keep things simple. Any help would be appreciated.
php
css
xml
null
null
02/23/2012 23:29:50
too localized
Using php to display xml that is formatted with css === Spinning wheels here... I have a php file that I'm trying to output some xml. The xml is formatted with css. I can get the xml to display using FILE_GET_CONTENTS, but the xml is unformatted. The xml file points to a css style-sheet I created, but no luck. Is this not possible? I have the css stylesheet on the same directory as the xml file to keep things simple. Any help would be appreciated.
3
1,617,469
10/24/2009 09:21:08
71,772
02/27/2009 08:35:52
8
6
How to extend a Textfield that is allready on the stage in Flash (AS3) ?
I'm looking for a way to extend a TextField that's allready on the stage in Flash (AS3) something like this: public class ChildTextField extends TextField { //code for childTextField comes here } I've placed a TextField with instance name 'thetextfield' on the stage. Now I would like to tell flash this textfield is of type ChildTextField. So in my Document Class I declare that textfield as a ChildTextField: public class DocumentClass extends Sprite() { public var thetextfield : ChildTextField; } This throws a Type Coercion failed Error. Is it possible to change the class that is used for a textfield in the Flash IDE like you can do with library symbols?
flash
actionscript-3
textfield
null
null
null
open
How to extend a Textfield that is allready on the stage in Flash (AS3) ? === I'm looking for a way to extend a TextField that's allready on the stage in Flash (AS3) something like this: public class ChildTextField extends TextField { //code for childTextField comes here } I've placed a TextField with instance name 'thetextfield' on the stage. Now I would like to tell flash this textfield is of type ChildTextField. So in my Document Class I declare that textfield as a ChildTextField: public class DocumentClass extends Sprite() { public var thetextfield : ChildTextField; } This throws a Type Coercion failed Error. Is it possible to change the class that is used for a textfield in the Flash IDE like you can do with library symbols?
0
8,410,153
12/07/2011 03:47:21
1,024,973
11/02/2011 05:14:28
27
0
Setting a Breakpoint in GDB
I have a function that returns a pointer: static void *find_fit(size_t asize); I would like to set a breakpoint in gdb, but when I type this function name, I get one of these errors: break *find_fit Function "*find_fit" not defined or break find_fit Function "find_fit" not defined I can easily set break point on a function that returns something other than a pointer, but when the function does return a pointer, gdb doesn't seem to want to break on it. Anybody see what is going on? Thanks!
gdb
null
null
null
null
null
open
Setting a Breakpoint in GDB === I have a function that returns a pointer: static void *find_fit(size_t asize); I would like to set a breakpoint in gdb, but when I type this function name, I get one of these errors: break *find_fit Function "*find_fit" not defined or break find_fit Function "find_fit" not defined I can easily set break point on a function that returns something other than a pointer, but when the function does return a pointer, gdb doesn't seem to want to break on it. Anybody see what is going on? Thanks!
0
7,543,465
09/25/2011 03:31:49
365,426
06/12/2010 22:33:10
24
0
Creating a UILabel and issues with inheritance
To create an UILabel programmaticaly, code: UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 100, 200, 100)]; I wanted to create a label programmaticaly and google gave me the above code. But the apple docs dont even mention InitWithFrame method in the UILabel class reference? Yes I am aware that UILabel inherits from UIView. I checked UIView and yes the method is there, but isnt it silly to keep having to jump from document to document up the inhertiance tree? What if there was another method which was way up the inheritance tree which we needed to use. Are we really expected to keep going up into the inheritance tree? Further how can we even be sure that a certain method will work with a certain class? many thanks
class
inheritance
uiview
sdk
null
null
open
Creating a UILabel and issues with inheritance === To create an UILabel programmaticaly, code: UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 100, 200, 100)]; I wanted to create a label programmaticaly and google gave me the above code. But the apple docs dont even mention InitWithFrame method in the UILabel class reference? Yes I am aware that UILabel inherits from UIView. I checked UIView and yes the method is there, but isnt it silly to keep having to jump from document to document up the inhertiance tree? What if there was another method which was way up the inheritance tree which we needed to use. Are we really expected to keep going up into the inheritance tree? Further how can we even be sure that a certain method will work with a certain class? many thanks
0
11,744,685
07/31/2012 16:21:57
1,087,300
12/08/2011 08:13:41
158
14
What is the best way to create json/xml response web service using java
What is the best way to create json/xml response web service using java
java
android
webservice-client
null
null
08/01/2012 02:56:23
not a real question
What is the best way to create json/xml response web service using java === What is the best way to create json/xml response web service using java
1
3,181,820
07/05/2010 19:47:52
149,213
08/02/2009 06:52:51
38
3
Computing the colors of the Olympic flag
Let's say you are helping setting up the Olympics on an alien planet. You are in charge of making the Olympic flag. The Olympic flag would have 6 colors. The flags of every country on the planet must have one of the six colors on the Olympic flag. You already know the colors on a flag. How would you compute the colors on the Olympic flag? The flag colors are contained in an array of arrays.
puzzle
challenge
challenges
algorithms
null
07/05/2010 22:33:55
not a real question
Computing the colors of the Olympic flag === Let's say you are helping setting up the Olympics on an alien planet. You are in charge of making the Olympic flag. The Olympic flag would have 6 colors. The flags of every country on the planet must have one of the six colors on the Olympic flag. You already know the colors on a flag. How would you compute the colors on the Olympic flag? The flag colors are contained in an array of arrays.
1
5,004,633
02/15/2011 14:06:26
564,083
01/05/2011 14:46:43
301
47
How to manually create a file with a . dot prefix in windows for example .htaccess
So I went to create a .htaccess file manually this morning, only to discover it seems impossible through the windows UI. I get a "you must type a filename message". There has to be a way to create files with . as a prefix in windows. Now, mind you the software I'm using that generates the file has no problem. I want to know how I can do this manually. ![enter image description here][1] [1]: http://i.stack.imgur.com/R0tlR.jpg
windows
filenames
null
null
null
02/15/2011 19:56:13
off topic
How to manually create a file with a . dot prefix in windows for example .htaccess === So I went to create a .htaccess file manually this morning, only to discover it seems impossible through the windows UI. I get a "you must type a filename message". There has to be a way to create files with . as a prefix in windows. Now, mind you the software I'm using that generates the file has no problem. I want to know how I can do this manually. ![enter image description here][1] [1]: http://i.stack.imgur.com/R0tlR.jpg
2
9,731,675
03/16/2012 03:58:43
1,181,847
02/01/2012 03:46:45
127
0
Red Black trees tutorial needed?
Where can I find a good video tutorial on insertion and deletion in Red Black Trees? I saw an MIT video but it did not include deletion. I saw also some other videos in you tube, but they were pretty confusing. Can someone please help me? Thanks
red-black-tree
null
null
null
null
05/19/2012 02:45:25
not constructive
Red Black trees tutorial needed? === Where can I find a good video tutorial on insertion and deletion in Red Black Trees? I saw an MIT video but it did not include deletion. I saw also some other videos in you tube, but they were pretty confusing. Can someone please help me? Thanks
4
1,097,370
07/08/2009 10:59:35
42,404
12/02/2008 10:36:59
4,494
244
How on earth is this rails query working?
I have just optimised some Ruby code that was in a controller method, replacing it with a direct database query. The replacement appears to work and is much faster. Thing is, I've no idea how Rails managed to figure out the correct query to use! The purpose of the query is to work out tag counts for Place models within a certain distance of a given latitude and longitude. The distance part is handled by the *GeoKit* plugin (which basically adds convenience methods to add the appropriate trigonometry calculations to the select), and the tagging part is done by the *acts_as_taggable_on_steroids* plugin, which uses a polymorphic association. Below is the original code: places = Place.find(:all, :origin=>latlng, :order=>'distance asc', :within=>distance, :limit=>200) tag_counts = MyTag.tagcounts(places) deep_tag_counts=Array.new() tag_counts.each do |tag| count=Place.find_tagged_with(tag.name,:origin=>latlng, :order=>'distance asc', :within=>distance, :limit=>200).size deep_tag_counts<<{:name=>tag.name,:count=>count} end where the MyTag class implements this: def MyTag.tagcounts(places) alltags = places.collect {|p| p.tags}.flatten.sort_by(&:name) lasttag=nil; tagcount=0; result=Array.new alltags.each do |tag| unless (lasttag==nil || lasttag.name==tag.name) result << MyTag.new(lasttag,tagcount) tagcount=0 end tagcount=tagcount+1 lasttag=tag end unless lasttag==nil then result << MyTag.new(lasttag,tagcount) end result end This was my (very ugly) first attempt as I originally found it difficult to come up with the right rails incantations to get this done in SQL. The new replacement is this single line: deep_tag_counts=Place.find(:all,:select=>'name,count(*) as count',:origin=>latlng,:within=>distance,:joins=>:tags, :group=>:tag_id) Which results in an SQL query like this: SELECT name,count(*) as count, (ACOS(least(1,COS(0.897378837271255)*COS(-0.0153398733287034)*COS(RADIANS(places.lat))*COS(RADIANS(places.lng))+ COS(0.897378837271255)*SIN(-0.0153398733287034)*COS(RADIANS(places.lat))*SIN(RADIANS(places.lng))+ SIN(0.897378837271255)*SIN(RADIANS(places.lat))))*3963.19) AS distance FROM `places` INNER JOIN `taggings` ON (`places`.`id` = `taggings`.`taggable_id` AND `taggings`.`taggable_type` = 'Place') INNER JOIN `tags` ON (`tags`.`id` = `taggings`.`tag_id`) WHERE (places.lat>50.693170735732 AND places.lat<52.1388692642679 AND places.lng>-2.03785525810908 AND places.lng<0.280035258109084 AND (ACOS(least(1,COS(0.897378837271255)*COS(-0.0153398733287034)*COS(RADIANS(places.lat))*COS(RADIANS(places.lng))+ COS(0.897378837271255)*SIN(-0.0153398733287034)*COS(RADIANS(places.lat))*SIN(RADIANS(places.lng))+ SIN(0.897378837271255)*SIN(RADIANS(places.lat))))*3963.19) <= 50) GROUP BY tag_id Ignoring the trig (which is from GeoKit, and results from the :within and :origin parameters), what I can't figure out about this is how on earth Rails was able to figure out from the instruction to join 'tags', that it had to involve 'taggings' in the JOIN (which it does, as there is no direct way to join the places and tags tables), and also that it had to use the polymorphic stuff. In other words, how the heck did it (correctly) come up with this bit: INNER JOIN `taggings` ON (`places`.`id` = `taggings`.`taggable_id` AND `taggings`.`taggable_type` = 'Place') INNER JOIN `tags` ON (`tags`.`id` = `taggings`.`tag_id`) ...given that I never mentioned the taggings table in the code! Digging into the taggable plugin, the only clue that Rails has seems to be this: class Tag < ActiveRecord::Base has_many :taggings, :dependent=>:destroy ... end Anybody able to give some insight into the magic going on under the hood here?
ruby-on-rails
null
null
null
null
null
open
How on earth is this rails query working? === I have just optimised some Ruby code that was in a controller method, replacing it with a direct database query. The replacement appears to work and is much faster. Thing is, I've no idea how Rails managed to figure out the correct query to use! The purpose of the query is to work out tag counts for Place models within a certain distance of a given latitude and longitude. The distance part is handled by the *GeoKit* plugin (which basically adds convenience methods to add the appropriate trigonometry calculations to the select), and the tagging part is done by the *acts_as_taggable_on_steroids* plugin, which uses a polymorphic association. Below is the original code: places = Place.find(:all, :origin=>latlng, :order=>'distance asc', :within=>distance, :limit=>200) tag_counts = MyTag.tagcounts(places) deep_tag_counts=Array.new() tag_counts.each do |tag| count=Place.find_tagged_with(tag.name,:origin=>latlng, :order=>'distance asc', :within=>distance, :limit=>200).size deep_tag_counts<<{:name=>tag.name,:count=>count} end where the MyTag class implements this: def MyTag.tagcounts(places) alltags = places.collect {|p| p.tags}.flatten.sort_by(&:name) lasttag=nil; tagcount=0; result=Array.new alltags.each do |tag| unless (lasttag==nil || lasttag.name==tag.name) result << MyTag.new(lasttag,tagcount) tagcount=0 end tagcount=tagcount+1 lasttag=tag end unless lasttag==nil then result << MyTag.new(lasttag,tagcount) end result end This was my (very ugly) first attempt as I originally found it difficult to come up with the right rails incantations to get this done in SQL. The new replacement is this single line: deep_tag_counts=Place.find(:all,:select=>'name,count(*) as count',:origin=>latlng,:within=>distance,:joins=>:tags, :group=>:tag_id) Which results in an SQL query like this: SELECT name,count(*) as count, (ACOS(least(1,COS(0.897378837271255)*COS(-0.0153398733287034)*COS(RADIANS(places.lat))*COS(RADIANS(places.lng))+ COS(0.897378837271255)*SIN(-0.0153398733287034)*COS(RADIANS(places.lat))*SIN(RADIANS(places.lng))+ SIN(0.897378837271255)*SIN(RADIANS(places.lat))))*3963.19) AS distance FROM `places` INNER JOIN `taggings` ON (`places`.`id` = `taggings`.`taggable_id` AND `taggings`.`taggable_type` = 'Place') INNER JOIN `tags` ON (`tags`.`id` = `taggings`.`tag_id`) WHERE (places.lat>50.693170735732 AND places.lat<52.1388692642679 AND places.lng>-2.03785525810908 AND places.lng<0.280035258109084 AND (ACOS(least(1,COS(0.897378837271255)*COS(-0.0153398733287034)*COS(RADIANS(places.lat))*COS(RADIANS(places.lng))+ COS(0.897378837271255)*SIN(-0.0153398733287034)*COS(RADIANS(places.lat))*SIN(RADIANS(places.lng))+ SIN(0.897378837271255)*SIN(RADIANS(places.lat))))*3963.19) <= 50) GROUP BY tag_id Ignoring the trig (which is from GeoKit, and results from the :within and :origin parameters), what I can't figure out about this is how on earth Rails was able to figure out from the instruction to join 'tags', that it had to involve 'taggings' in the JOIN (which it does, as there is no direct way to join the places and tags tables), and also that it had to use the polymorphic stuff. In other words, how the heck did it (correctly) come up with this bit: INNER JOIN `taggings` ON (`places`.`id` = `taggings`.`taggable_id` AND `taggings`.`taggable_type` = 'Place') INNER JOIN `tags` ON (`tags`.`id` = `taggings`.`tag_id`) ...given that I never mentioned the taggings table in the code! Digging into the taggable plugin, the only clue that Rails has seems to be this: class Tag < ActiveRecord::Base has_many :taggings, :dependent=>:destroy ... end Anybody able to give some insight into the magic going on under the hood here?
0
9,004,938
01/25/2012 15:08:35
1,003,361
10/19/2011 14:29:44
1
0
ADFS 2.0 Not sending singout cleanup message
I am using FederatedPassiveSignInStatus control in my claim aware application which is federated with ADFS 2.0 , application can signout completely(i.e. getting cleanup message) only when I send singout request twice . I tried sending signout request by other means (hyperlink & buttons ) but again there is no difference.
adfs
null
null
null
null
null
open
ADFS 2.0 Not sending singout cleanup message === I am using FederatedPassiveSignInStatus control in my claim aware application which is federated with ADFS 2.0 , application can signout completely(i.e. getting cleanup message) only when I send singout request twice . I tried sending signout request by other means (hyperlink & buttons ) but again there is no difference.
0
2,493,331
03/22/2010 15:13:32
133,858
07/06/2009 19:27:55
555
48
What is best practice with SQLite and Android ?
What is considered "**best practice**" when executing queries on a sql-lite db within an android app. Is it safe to run inserts, deletes and select queries from an AsyncTasl's doInBackground ? Or should I use the UI Thread ? I suppose that db queries can be "heavy" and should not use the UI thread as it can lock up the app - resulting in an ANR. If i have several asynctask, should they share a connection or should they open a connection each ? Any best practices in this area on android?
android
sqlite3
database
null
null
null
open
What is best practice with SQLite and Android ? === What is considered "**best practice**" when executing queries on a sql-lite db within an android app. Is it safe to run inserts, deletes and select queries from an AsyncTasl's doInBackground ? Or should I use the UI Thread ? I suppose that db queries can be "heavy" and should not use the UI thread as it can lock up the app - resulting in an ANR. If i have several asynctask, should they share a connection or should they open a connection each ? Any best practices in this area on android?
0
5,386,655
03/22/2011 04:04:11
300,913
03/24/2010 14:56:10
195
4
Texas Hold'em: Beginner Java Programmer Code Review
I am teaching myself Java and am hoping the StackOverFlow community would assist me in a 'beginners' code review? I tried to find a Java Users Group in Orlando but the only one listed does not seem active. I have been a programmer for 12 years, mainly ERP software and C development and am looking to make a career/specialty change to Java. I've read it countless times if you want to learn a new language you need to write code, then write some more code and then finally write more code. So I've written some code! I love poker, so I have written a small Texas Hold'em program. Here is the overview of what it does: 1) Asks the user for the number of players 2) Create a deck of cards 3) Shuffle 4) Cut the deck 5) Deal players hole cards 6) Burns a card 7) Deals flop 8) Burns a card 9) Deals turn 10) Burns a card 11) Deals river 12) Prints the deck to console to show random deck was used 13) Prints the 'board' 14) Prints burn cards 15) Printers players cards 16) Evaluates the value of each players hand (Royal flush, full house, etc...) There are 6 .java files (see below for links). I used an interface, created my own comparators, even implemented some try/catch blocks (although Im still learning how to use these properly). [TexasHoldEm.java](http://pastebin.com/3CXQg9Yz) [Player.java](http://pastebin.com/rDGwn9r7) [HandEval.java](http://pastebin.com/eA9L2vXv) [Deck.java](http://pastebin.com/fC7wwMcd) [Card.java](http://pastebin.com/a8P7jweg) [Board.java](http://pastebin.com/Rh7wH8Ea) If anyone would mind please take a look at these small program and let me know 'how it looks', what I can do better and/or differently. Please explain the how's and why as elementary as you see fit, like I mentioned Im a beginner.
java
code-review
null
null
null
03/22/2011 04:17:27
off topic
Texas Hold'em: Beginner Java Programmer Code Review === I am teaching myself Java and am hoping the StackOverFlow community would assist me in a 'beginners' code review? I tried to find a Java Users Group in Orlando but the only one listed does not seem active. I have been a programmer for 12 years, mainly ERP software and C development and am looking to make a career/specialty change to Java. I've read it countless times if you want to learn a new language you need to write code, then write some more code and then finally write more code. So I've written some code! I love poker, so I have written a small Texas Hold'em program. Here is the overview of what it does: 1) Asks the user for the number of players 2) Create a deck of cards 3) Shuffle 4) Cut the deck 5) Deal players hole cards 6) Burns a card 7) Deals flop 8) Burns a card 9) Deals turn 10) Burns a card 11) Deals river 12) Prints the deck to console to show random deck was used 13) Prints the 'board' 14) Prints burn cards 15) Printers players cards 16) Evaluates the value of each players hand (Royal flush, full house, etc...) There are 6 .java files (see below for links). I used an interface, created my own comparators, even implemented some try/catch blocks (although Im still learning how to use these properly). [TexasHoldEm.java](http://pastebin.com/3CXQg9Yz) [Player.java](http://pastebin.com/rDGwn9r7) [HandEval.java](http://pastebin.com/eA9L2vXv) [Deck.java](http://pastebin.com/fC7wwMcd) [Card.java](http://pastebin.com/a8P7jweg) [Board.java](http://pastebin.com/Rh7wH8Ea) If anyone would mind please take a look at these small program and let me know 'how it looks', what I can do better and/or differently. Please explain the how's and why as elementary as you see fit, like I mentioned Im a beginner.
2
10,591,304
05/14/2012 21:25:46
971,904
09/29/2011 20:01:02
217
1
Not getting correct feature report
I have asked a similar question previously, but 1. no one answered and 2. it is a bit different. I have managed to get the correct file Path and created a handler by using CreateFile. I have then tried to use the HidD_GetFeature() function, but when I print out the report, it is all in symbols - not letters, numbers or readable sign. Does anyone know why it is doing that?? Here's my code: /*****************************Mainframe.cpp**************************************/ #include"DeviceManager.h" int main() { int iQuit; DeviceManager deviceManager; //deviceManager.ListAllDevices(); deviceManager.GetDevice("8888", "0308"); std::cin >> iQuit; return 0; } /***********************************DeviceManager.h***************************/ #include <windows.h> //#include <hidsdi.h> #include <setupapi.h> #include <iostream> #include <cfgmgr32.h> #include <tchar.h> #include <devpkey.h> extern "C"{ #include <hidsdi.h> } //#pragma comment (lib, "setupapi.lib") class DeviceManager { public: DeviceManager(); ~DeviceManager(); void ListAllDevices(); void GetDevice(std::string vid, std::string pid); HANDLE PSMove; byte reportBuffer[57]; GUID guid; private: HDEVINFO deviceInfoSet; //A list of all the devices SP_DEVINFO_DATA deviceInfoData; //A device from deviceInfoSet SP_DEVICE_INTERFACE_DATA deviceInterfaceData; SP_DEVICE_INTERFACE_DETAIL_DATA deviceInterfaceDetailedData; }; /********************************DeviceManager.cpp*********************************/ #include"DeviceManager.h" DeviceManager::DeviceManager() { HidD_GetHidGuid(&guid); deviceInfoSet = SetupDiGetClassDevs(&guid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE); //Gets all Devices } DeviceManager::~DeviceManager() { } void DeviceManager::ListAllDevices() { DWORD deviceIndex = 0; deviceInfoData.cbSize = sizeof(deviceInfoData); while(SetupDiEnumDeviceInfo(deviceInfoSet, deviceIndex, &deviceInfoData)) { deviceInfoData.cbSize = sizeof(deviceInfoData); ULONG tcharSize; CM_Get_Device_ID_Size(&tcharSize, deviceInfoData.DevInst, 0); TCHAR* deviceIDBuffer = new TCHAR[tcharSize]; //the device ID will be stored in this array, so the tcharSize needs to be big enough to hold all the info. //Or we can use MAX_DEVICE_ID_LEN, which is 200 CM_Get_Device_ID(deviceInfoData.DevInst, deviceIDBuffer, MAX_PATH, 0); //gets the devices ID - a long string that looks like a file path. /* //SetupDiGetDevicePropertyKeys(deviceInfoSet, &deviceInfoData, &devicePropertyKey, NULL, 0, 0); if( deviceIDBuffer[8]=='8' && deviceIDBuffer[9]=='8' && deviceIDBuffer[10]=='8' && deviceIDBuffer[11]=='8' && //VID deviceIDBuffer[17]=='0' && deviceIDBuffer[18]=='3' && deviceIDBuffer[19]=='0' && deviceIDBuffer[20]=='8') //PID { std::cout << deviceIDBuffer << "\t<-- Playstation Move" << std::endl; } else { std::cout << deviceIDBuffer << std::endl; }*/ std::cout << deviceIDBuffer << std::endl; deviceIndex++; } } void DeviceManager::GetDevice(std::string vid, std::string pid) { DWORD deviceIndex = 0; deviceInfoData.cbSize = sizeof(deviceInfoData); while(SetupDiEnumDeviceInfo(deviceInfoSet, deviceIndex, &deviceInfoData)) { deviceInfoData.cbSize = sizeof(deviceInfoData); ULONG IDSize; CM_Get_Device_ID_Size(&IDSize, deviceInfoData.DevInst, 0); TCHAR* deviceID = new TCHAR[IDSize]; CM_Get_Device_ID(deviceInfoData.DevInst, deviceID, MAX_PATH, 0); if( deviceID[8]==vid.at(0) && deviceID[9]==vid.at(1) && deviceID[10]==vid.at(2) && deviceID[11]==vid.at(3) && //VID deviceID[17]==pid.at(0) && deviceID[18]==pid.at(1) && deviceID[19]==pid.at(2) && deviceID[20]==pid.at(3)) //PID { DWORD deviceInterfaceIndex = 0; deviceInterfaceData.cbSize = sizeof(deviceInterfaceData); //HDEVINFO deviceInterfaceSet = SetupDiGetClassDevs(&guid, NULL, NULL, DIGCF_DEVICEINTERFACE); if(SetupDiEnumDeviceInterfaces(deviceInfoSet, &deviceInfoData, &guid, deviceInterfaceIndex, &deviceInterfaceData)) { deviceInterfaceData.cbSize = sizeof(deviceInterfaceData); deviceInterfaceDetailedData.cbSize = sizeof(deviceInterfaceDetailedData); DWORD requiredSize; SetupDiGetDeviceInterfaceDetail(deviceInfoSet, &deviceInterfaceData, NULL, 0, &requiredSize, &deviceInfoData); //Gets the size SetupDiGetDeviceInterfaceDetail(deviceInfoSet, &deviceInterfaceData, &deviceInterfaceDetailedData, requiredSize, NULL, NULL); //Sets the deviceInterfaceDetailedData //std::cout << deviceInterfaceDetailedData.DevicePath << std::endl; PSMove = CreateFile(deviceInterfaceDetailedData.DevicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); reportBuffer[0] = 0; ULONG reportBufferLength = sizeof(reportBuffer); HidD_GetFeature(PSMove, &reportBuffer, reportBufferLength); std::cout << reportBuffer << std::endl; //deviceInterfaceIndex++; } break; } deviceIndex++; } }
c++
device
hid
wdk
null
null
open
Not getting correct feature report === I have asked a similar question previously, but 1. no one answered and 2. it is a bit different. I have managed to get the correct file Path and created a handler by using CreateFile. I have then tried to use the HidD_GetFeature() function, but when I print out the report, it is all in symbols - not letters, numbers or readable sign. Does anyone know why it is doing that?? Here's my code: /*****************************Mainframe.cpp**************************************/ #include"DeviceManager.h" int main() { int iQuit; DeviceManager deviceManager; //deviceManager.ListAllDevices(); deviceManager.GetDevice("8888", "0308"); std::cin >> iQuit; return 0; } /***********************************DeviceManager.h***************************/ #include <windows.h> //#include <hidsdi.h> #include <setupapi.h> #include <iostream> #include <cfgmgr32.h> #include <tchar.h> #include <devpkey.h> extern "C"{ #include <hidsdi.h> } //#pragma comment (lib, "setupapi.lib") class DeviceManager { public: DeviceManager(); ~DeviceManager(); void ListAllDevices(); void GetDevice(std::string vid, std::string pid); HANDLE PSMove; byte reportBuffer[57]; GUID guid; private: HDEVINFO deviceInfoSet; //A list of all the devices SP_DEVINFO_DATA deviceInfoData; //A device from deviceInfoSet SP_DEVICE_INTERFACE_DATA deviceInterfaceData; SP_DEVICE_INTERFACE_DETAIL_DATA deviceInterfaceDetailedData; }; /********************************DeviceManager.cpp*********************************/ #include"DeviceManager.h" DeviceManager::DeviceManager() { HidD_GetHidGuid(&guid); deviceInfoSet = SetupDiGetClassDevs(&guid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE); //Gets all Devices } DeviceManager::~DeviceManager() { } void DeviceManager::ListAllDevices() { DWORD deviceIndex = 0; deviceInfoData.cbSize = sizeof(deviceInfoData); while(SetupDiEnumDeviceInfo(deviceInfoSet, deviceIndex, &deviceInfoData)) { deviceInfoData.cbSize = sizeof(deviceInfoData); ULONG tcharSize; CM_Get_Device_ID_Size(&tcharSize, deviceInfoData.DevInst, 0); TCHAR* deviceIDBuffer = new TCHAR[tcharSize]; //the device ID will be stored in this array, so the tcharSize needs to be big enough to hold all the info. //Or we can use MAX_DEVICE_ID_LEN, which is 200 CM_Get_Device_ID(deviceInfoData.DevInst, deviceIDBuffer, MAX_PATH, 0); //gets the devices ID - a long string that looks like a file path. /* //SetupDiGetDevicePropertyKeys(deviceInfoSet, &deviceInfoData, &devicePropertyKey, NULL, 0, 0); if( deviceIDBuffer[8]=='8' && deviceIDBuffer[9]=='8' && deviceIDBuffer[10]=='8' && deviceIDBuffer[11]=='8' && //VID deviceIDBuffer[17]=='0' && deviceIDBuffer[18]=='3' && deviceIDBuffer[19]=='0' && deviceIDBuffer[20]=='8') //PID { std::cout << deviceIDBuffer << "\t<-- Playstation Move" << std::endl; } else { std::cout << deviceIDBuffer << std::endl; }*/ std::cout << deviceIDBuffer << std::endl; deviceIndex++; } } void DeviceManager::GetDevice(std::string vid, std::string pid) { DWORD deviceIndex = 0; deviceInfoData.cbSize = sizeof(deviceInfoData); while(SetupDiEnumDeviceInfo(deviceInfoSet, deviceIndex, &deviceInfoData)) { deviceInfoData.cbSize = sizeof(deviceInfoData); ULONG IDSize; CM_Get_Device_ID_Size(&IDSize, deviceInfoData.DevInst, 0); TCHAR* deviceID = new TCHAR[IDSize]; CM_Get_Device_ID(deviceInfoData.DevInst, deviceID, MAX_PATH, 0); if( deviceID[8]==vid.at(0) && deviceID[9]==vid.at(1) && deviceID[10]==vid.at(2) && deviceID[11]==vid.at(3) && //VID deviceID[17]==pid.at(0) && deviceID[18]==pid.at(1) && deviceID[19]==pid.at(2) && deviceID[20]==pid.at(3)) //PID { DWORD deviceInterfaceIndex = 0; deviceInterfaceData.cbSize = sizeof(deviceInterfaceData); //HDEVINFO deviceInterfaceSet = SetupDiGetClassDevs(&guid, NULL, NULL, DIGCF_DEVICEINTERFACE); if(SetupDiEnumDeviceInterfaces(deviceInfoSet, &deviceInfoData, &guid, deviceInterfaceIndex, &deviceInterfaceData)) { deviceInterfaceData.cbSize = sizeof(deviceInterfaceData); deviceInterfaceDetailedData.cbSize = sizeof(deviceInterfaceDetailedData); DWORD requiredSize; SetupDiGetDeviceInterfaceDetail(deviceInfoSet, &deviceInterfaceData, NULL, 0, &requiredSize, &deviceInfoData); //Gets the size SetupDiGetDeviceInterfaceDetail(deviceInfoSet, &deviceInterfaceData, &deviceInterfaceDetailedData, requiredSize, NULL, NULL); //Sets the deviceInterfaceDetailedData //std::cout << deviceInterfaceDetailedData.DevicePath << std::endl; PSMove = CreateFile(deviceInterfaceDetailedData.DevicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); reportBuffer[0] = 0; ULONG reportBufferLength = sizeof(reportBuffer); HidD_GetFeature(PSMove, &reportBuffer, reportBufferLength); std::cout << reportBuffer << std::endl; //deviceInterfaceIndex++; } break; } deviceIndex++; } }
0
8,296,933
11/28/2011 14:02:19
622,875
02/18/2011 09:30:41
529
36
SplitIOPerSec Peformance counter always remain Zero
I am working on application which fetch Performance counter from application hosted on azure portal and i got values of all counter except **SplitIOPerSec** , it shows me always **Zero** What should be reason for that and what it indicates? , I have used following WMI query to fetch it SELECT SplitIOPerSec FROM win32_perfformatteddata_perfdisk_physicaldisk
azure
performancecounter
null
null
null
null
open
SplitIOPerSec Peformance counter always remain Zero === I am working on application which fetch Performance counter from application hosted on azure portal and i got values of all counter except **SplitIOPerSec** , it shows me always **Zero** What should be reason for that and what it indicates? , I have used following WMI query to fetch it SELECT SplitIOPerSec FROM win32_perfformatteddata_perfdisk_physicaldisk
0
10,267,645
04/22/2012 11:42:16
1,207,116
02/13/2012 15:28:37
1
0
How to think when designing data model for many users / high load
I know I don't have the best title for this question but the problem is as follows. I have a website (no, I don't like to call it an WebAPP, whatever happened to plain old websites?) that is starting get fairly popular. It runs on Nginx + php/fpm + mysql on a *nix system. Currently, I have everything pertaining to objects stored in mysql e.g. users + stuff that users operate on and so on. The user object itself is holding a lot of counters like "followers", "times_done_this_or_that" etc etc for performance. This works OK. It's not uber nice design, I know, and herein lie my question. I should also mention that I have a very very crude way of hanling vistors online, view counters etc that all gets stored/written to the database as they happen. With a million or so pageviews a day, this is starting to take its toll. So my question is whether or not to consider moving over to a new architecture altogether and if so, is it wise to consider a completely "counter free" object model and keep counters in Redis or MongoDB?? I'm considering Django as framework since it seems very nicely structured and I'm getting tired of the shortcomings of PHP, but again, I'm more of a "do first, get it working, then start worrying" type of person, and as such I get stuff out there to the user fast, and it gets used, but the design suffers of course. SO, any suggestions on this badly formed question is very welcome :) Thanks.
design
data-modeling
null
null
null
null
open
How to think when designing data model for many users / high load === I know I don't have the best title for this question but the problem is as follows. I have a website (no, I don't like to call it an WebAPP, whatever happened to plain old websites?) that is starting get fairly popular. It runs on Nginx + php/fpm + mysql on a *nix system. Currently, I have everything pertaining to objects stored in mysql e.g. users + stuff that users operate on and so on. The user object itself is holding a lot of counters like "followers", "times_done_this_or_that" etc etc for performance. This works OK. It's not uber nice design, I know, and herein lie my question. I should also mention that I have a very very crude way of hanling vistors online, view counters etc that all gets stored/written to the database as they happen. With a million or so pageviews a day, this is starting to take its toll. So my question is whether or not to consider moving over to a new architecture altogether and if so, is it wise to consider a completely "counter free" object model and keep counters in Redis or MongoDB?? I'm considering Django as framework since it seems very nicely structured and I'm getting tired of the shortcomings of PHP, but again, I'm more of a "do first, get it working, then start worrying" type of person, and as such I get stuff out there to the user fast, and it gets used, but the design suffers of course. SO, any suggestions on this badly formed question is very welcome :) Thanks.
0
2,361,345
03/02/2010 06:43:03
185,610
10/07/2009 12:43:59
214
13
Find IP address in iphone
I want to find IP address in an application. I am able to find it. But, problem is, it works fins in iphone os 2.0 or so. But, in iphone os 3.0 it is giving me warning. > warning: no '+currentHost' method found > > warning: (Messages without a matching method signature I am using this code, and it works fine with os version 2.0. -(NSString*)getAddress { char iphone_ip[255]; strcpy(iphone_ip,"127.0.0.1"); // if everything fails NSHost* myhost = [NSHost currentHost]; if (myhost) { NSString *ad = [myhost address]; if (ad) strcpy(iphone_ip,[ad cStringUsingEncoding: NSISOLatin1StringEncoding]); } return [NSString stringWithFormat:@"%s",iphone_ip]; } How to find IP address in iphone os 3.0 or greater os version? Thanks in advance.
iphone
ip-address
nshost
null
null
null
open
Find IP address in iphone === I want to find IP address in an application. I am able to find it. But, problem is, it works fins in iphone os 2.0 or so. But, in iphone os 3.0 it is giving me warning. > warning: no '+currentHost' method found > > warning: (Messages without a matching method signature I am using this code, and it works fine with os version 2.0. -(NSString*)getAddress { char iphone_ip[255]; strcpy(iphone_ip,"127.0.0.1"); // if everything fails NSHost* myhost = [NSHost currentHost]; if (myhost) { NSString *ad = [myhost address]; if (ad) strcpy(iphone_ip,[ad cStringUsingEncoding: NSISOLatin1StringEncoding]); } return [NSString stringWithFormat:@"%s",iphone_ip]; } How to find IP address in iphone os 3.0 or greater os version? Thanks in advance.
0
3,704,576
09/13/2010 21:31:00
446,794
09/13/2010 21:31:00
1
0
SDL: FPS problems with simple bitmap
I am currently working on a game in SDL which has destructible terrain. At the moment the terrain is one large (5000*500, for testing) bitmap which is randomly generated. Each frame the main surface is cleared and the terrain bitmap is blitted into it. The current resolution is 1200 * 700, so when I was testing 1200 * 500 pixels were visible at most of the points. Now the problem is: The FPS are already dropping! I thought one simple bitmap shouldn't show any effect - but I am already falling down to ~24 FPS with this! - Why is blitting & drawing a bitmap of that size so slow? - Am I taking a false approach at destructible terrain? - How have games like Worms done this? The FPS seem really high although there's definitely a lot of pixels drawn in there
graphics
sdl
null
null
null
null
open
SDL: FPS problems with simple bitmap === I am currently working on a game in SDL which has destructible terrain. At the moment the terrain is one large (5000*500, for testing) bitmap which is randomly generated. Each frame the main surface is cleared and the terrain bitmap is blitted into it. The current resolution is 1200 * 700, so when I was testing 1200 * 500 pixels were visible at most of the points. Now the problem is: The FPS are already dropping! I thought one simple bitmap shouldn't show any effect - but I am already falling down to ~24 FPS with this! - Why is blitting & drawing a bitmap of that size so slow? - Am I taking a false approach at destructible terrain? - How have games like Worms done this? The FPS seem really high although there's definitely a lot of pixels drawn in there
0
6,184,147
05/31/2011 07:13:58
381,800
07/02/2010 07:00:48
200
3
PHP to Mysql Line break Question
I am having hard time getting a form submitted textarea where people put in line breaks when they hit enter on their address..For example. <input type="textarea" name="address"> I am using this to get the post $address = mysql_real_escape_string(trim($_POST['address'])); They are entering 123 test <return>city,state. Then after they submit, in the mysql database the address is showing 123 testnrcity state So how can I handle this? Thanks!
php
mysql
line-breaks
null
null
null
open
PHP to Mysql Line break Question === I am having hard time getting a form submitted textarea where people put in line breaks when they hit enter on their address..For example. <input type="textarea" name="address"> I am using this to get the post $address = mysql_real_escape_string(trim($_POST['address'])); They are entering 123 test <return>city,state. Then after they submit, in the mysql database the address is showing 123 testnrcity state So how can I handle this? Thanks!
0
3,371,214
07/30/2010 12:03:47
388,350
07/10/2010 07:54:46
362
19
In Vb.Net How to know if the file hasnt been changed for x seconds?
I am programming something which involves certain files changing every second. How if the files arent changed for, say, 10 seconds it means that some error has occured somewhere, externeally. So, I want the user to know about it. How can I implement this?
vb.net
null
null
null
null
null
open
In Vb.Net How to know if the file hasnt been changed for x seconds? === I am programming something which involves certain files changing every second. How if the files arent changed for, say, 10 seconds it means that some error has occured somewhere, externeally. So, I want the user to know about it. How can I implement this?
0
11,647,276
07/25/2012 10:01:07
1,533,899
07/18/2012 07:06:16
1
0
Swipe Gesture inside ListView - Android
I am a newbie for Android. I got a tutorial on how to implement the listView here: http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/ I implemented those, Its working fine. I need to implement a viewSwitcher for the same. Like When I swipe the song, I need to get some options like play, add to queue etc., Pls go through that tutorial and pls help. I'm struggling almost from 3 weeks. Hope someone will help me.
android
swipe
android-2.1
viewswitcher
null
07/26/2012 18:38:37
not a real question
Swipe Gesture inside ListView - Android === I am a newbie for Android. I got a tutorial on how to implement the listView here: http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/ I implemented those, Its working fine. I need to implement a viewSwitcher for the same. Like When I swipe the song, I need to get some options like play, add to queue etc., Pls go through that tutorial and pls help. I'm struggling almost from 3 weeks. Hope someone will help me.
1
7,627,049
10/02/2011 14:46:25
197,831
10/28/2009 05:02:38
876
59
How to check whether the path is relative or absolute in java
I am developing a tool, which takes a path of an xml file, Now that path can be either relative or absolute. Now, Inside the code, when i have only a string, is there a way to identify, that the path is absolute or relative. Currently i am using a flag to identify whether the path is relative or absolute, but i need to get rid of that. Regards.
java
null
null
null
null
null
open
How to check whether the path is relative or absolute in java === I am developing a tool, which takes a path of an xml file, Now that path can be either relative or absolute. Now, Inside the code, when i have only a string, is there a way to identify, that the path is absolute or relative. Currently i am using a flag to identify whether the path is relative or absolute, but i need to get rid of that. Regards.
0
2,451,091
03/15/2010 23:07:27
171,523
09/10/2009 15:34:09
75
2
JSON Learning books with .net
I am planning to learn JSON with .net looking for good book. I know we can get lot of online resource which i am refering to. But i would like to read the book that way i can will cover all the topics and know more on JSON.
json
books
null
null
null
09/27/2011 14:05:34
not constructive
JSON Learning books with .net === I am planning to learn JSON with .net looking for good book. I know we can get lot of online resource which i am refering to. But i would like to read the book that way i can will cover all the topics and know more on JSON.
4
10,244,159
04/20/2012 10:07:41
1,191,614
02/06/2012 05:38:38
49
6
how to broadcast a message to specific user using Openfire?
How to broadcast a message to specific user using [Openfire][1]. **Scenario:** i want to broadcast a message to only that user whose credit balance is less then 100. I have looked at [broadcast][2] and [message of the day(MOTD)][3] plug-in of [Openfire][4]. Broadcast plug-in used to send a broadcast message to all and to particular group.and MOTD plug in is used to send a message to everyone when user comes online. I searched on net but didn't get anything. Any suggestion and advice will be appreciated . thanks [1]: http://www.igniterealtime.org/projects/openfire/ [2]: http://www.igniterealtime.org/projects/openfire/plugins.jsp [3]: http://www.igniterealtime.org/projects/openfire/plugins.jsp [4]: http://www.igniterealtime.org/projects/openfire/
broadcast
openfire
null
null
null
null
open
how to broadcast a message to specific user using Openfire? === How to broadcast a message to specific user using [Openfire][1]. **Scenario:** i want to broadcast a message to only that user whose credit balance is less then 100. I have looked at [broadcast][2] and [message of the day(MOTD)][3] plug-in of [Openfire][4]. Broadcast plug-in used to send a broadcast message to all and to particular group.and MOTD plug in is used to send a message to everyone when user comes online. I searched on net but didn't get anything. Any suggestion and advice will be appreciated . thanks [1]: http://www.igniterealtime.org/projects/openfire/ [2]: http://www.igniterealtime.org/projects/openfire/plugins.jsp [3]: http://www.igniterealtime.org/projects/openfire/plugins.jsp [4]: http://www.igniterealtime.org/projects/openfire/
0
11,382,125
07/08/2012 09:38:16
181,421
09/29/2009 21:11:35
572
4
SSIS. Stop running after 10pm
I have an SSIS package with a for loop. I would like to keep the value "10pm" in my sql database, and I want the loop the check every time if it's after this value of "10pm" (or whatever i decide to put in the database). If the time now is after 10pm, then stop looping. Thanks.
sql
sql-server
ssis
null
null
07/09/2012 17:50:06
not a real question
SSIS. Stop running after 10pm === I have an SSIS package with a for loop. I would like to keep the value "10pm" in my sql database, and I want the loop the check every time if it's after this value of "10pm" (or whatever i decide to put in the database). If the time now is after 10pm, then stop looping. Thanks.
1
11,457,808
07/12/2012 17:59:49
1,521,596
07/12/2012 17:46:54
1
0
Photoshop layer save as own canvas
Hi i just wondered if you were able to answer a quick photoshop question of mine. i have tried looking on google and cant seem to find what i am looking for. The best way i can describe my question is this... So i have an image say 1000x1000px i am working on and i want to save 1 single layer, this part is fine, however i want this layer to be saved on its own canvas at the size of the image (not the size of the 1000x1000px canvas), so my image is 100x100px for example, i want the layer to save at that size rather than that 1000x1000px, i'm not sure if this is possible, but would be a great help if you could get back to me with an answer, if infact you know. Thanks.
photoshop
null
null
null
null
07/12/2012 19:37:41
off topic
Photoshop layer save as own canvas === Hi i just wondered if you were able to answer a quick photoshop question of mine. i have tried looking on google and cant seem to find what i am looking for. The best way i can describe my question is this... So i have an image say 1000x1000px i am working on and i want to save 1 single layer, this part is fine, however i want this layer to be saved on its own canvas at the size of the image (not the size of the 1000x1000px canvas), so my image is 100x100px for example, i want the layer to save at that size rather than that 1000x1000px, i'm not sure if this is possible, but would be a great help if you could get back to me with an answer, if infact you know. Thanks.
2
7,870,792
10/24/2011 02:24:18
994,461
10/13/2011 22:35:41
6
0
.htaccess Rewrite Rule Problems
can anyone help me with htaccess rewrite? I have now links like: <code>http://site.com/all_users.php?uid=cv19143939y</code> but i want something like this <code>http://site.com/profile/cv19143939y</code> Im try with this <code> RewriteEngine on RewriteRule ^profile/([0-9]+) all_users.php?uid=$1 [L] </code> and this <code>RewriteRule ^profile/$1 all_users.php?uid=$1 [L]</code> but simple dont work..
.htaccess
rewrite
null
null
null
02/05/2012 04:22:54
off topic
.htaccess Rewrite Rule Problems === can anyone help me with htaccess rewrite? I have now links like: <code>http://site.com/all_users.php?uid=cv19143939y</code> but i want something like this <code>http://site.com/profile/cv19143939y</code> Im try with this <code> RewriteEngine on RewriteRule ^profile/([0-9]+) all_users.php?uid=$1 [L] </code> and this <code>RewriteRule ^profile/$1 all_users.php?uid=$1 [L]</code> but simple dont work..
2
10,500,708
05/08/2012 14:34:19
988,871
10/11/2011 05:35:56
145
11
How to create this toolbar programmatically
I am really having a hard time creating a `UIToolBar` programmatically. This is what I would like to create. ![enter image description here][1] [1]: http://i.stack.imgur.com/xR6FM.png But till now, I feel I have not approached it in the right way. I have tried adding a barbuttonitem to it, but I cant create the effect as shown in the png. How should I go about it. Help needed.
iphone
ios
uitoolbar
null
null
05/15/2012 16:51:35
not a real question
How to create this toolbar programmatically === I am really having a hard time creating a `UIToolBar` programmatically. This is what I would like to create. ![enter image description here][1] [1]: http://i.stack.imgur.com/xR6FM.png But till now, I feel I have not approached it in the right way. I have tried adding a barbuttonitem to it, but I cant create the effect as shown in the png. How should I go about it. Help needed.
1
10,279,631
04/23/2012 11:27:12
1,068,663
11/28/2011 03:46:36
11
0
Contacts sort in Japanese in android ICS
Contacts with full-width English alphabets are sorted above Japanese contacts when phone language is Japanese and half-width, full-width english characters are sorted in seperate sections. In case of English both half-width and full-width are grouped under same section. Is this behaviour proper? How to correct this if its wrong? Thanks in advance.
android
sorting
japanese
null
null
05/10/2012 21:20:55
not a real question
Contacts sort in Japanese in android ICS === Contacts with full-width English alphabets are sorted above Japanese contacts when phone language is Japanese and half-width, full-width english characters are sorted in seperate sections. In case of English both half-width and full-width are grouped under same section. Is this behaviour proper? How to correct this if its wrong? Thanks in advance.
1
1,828,733
12/01/2009 20:34:27
42,471
12/02/2008 15:04:36
383
30
DataGridView CellFormatting event preventing form painting
I am using C#, Winforms, and .Net 3.5 My form has a custom `DataGridView` (double-buffered to prevent flickering during my cellformatting events, [as seen here][1]). When I perform a database search, I bind the resulting dataset to the `datagridview`. I handle the `CellFormatting` event to paint rows a certain color, depending on their data. My DataGridView code: resultsGridView.DataSource = results.DefaultViewManager.DataSet.Tables[0]; resultsGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.AliceBlue; resultsGridView.BorderStyle = BorderStyle.Fixed3D; resultsGridView.CellFormatting += new DataGridViewCellFormattingEventHandler(resultsGridView_CellFormatting); My CellFormatting code: void resultsGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { int rowIndex = e.RowIndex; DataGridViewRow therow = resultsGridView.Rows[rowIndex]; if ((bool)therow.Cells["Sealed"].Value == true) { therow.DefaultCellStyle.BackColor = Color.Pink; } if (therow.Cells["Database"].Value as string == "PNG") { therow.DefaultCellStyle.BackColor = Color.LightGreen; } } Everything works great except that, when I handle the CellFormatting, the whole form's Paint event seems to be turned off. The cursor stops blinking in the textbox, and the form's menustrip looks like this: ![Menu bar picture][2] The top is before a search, the bottom after. The menubar won't redraw until I mouse over where the menuitems are, and then the last item to be highlighted will stay that way when I move the mouse out of the menubar. Moving the form seems to cause it to repaint, but then the problem remains. Commenting out the `resultsGridView.CellFormatting` line in the datagridview code completely fixes the problem. Am I painting the cells wrong, or is there something else I need to handle? [1]: http://stackoverflow.com/questions/118528/horrible-redraw-performance-of-the-datagridview-on-one-of-my-two-screens [2]: http://img213.imageshack.us/img213/2430/menubar.jpg
c#
datagridview
winforms
paint
events
null
open
DataGridView CellFormatting event preventing form painting === I am using C#, Winforms, and .Net 3.5 My form has a custom `DataGridView` (double-buffered to prevent flickering during my cellformatting events, [as seen here][1]). When I perform a database search, I bind the resulting dataset to the `datagridview`. I handle the `CellFormatting` event to paint rows a certain color, depending on their data. My DataGridView code: resultsGridView.DataSource = results.DefaultViewManager.DataSet.Tables[0]; resultsGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.AliceBlue; resultsGridView.BorderStyle = BorderStyle.Fixed3D; resultsGridView.CellFormatting += new DataGridViewCellFormattingEventHandler(resultsGridView_CellFormatting); My CellFormatting code: void resultsGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { int rowIndex = e.RowIndex; DataGridViewRow therow = resultsGridView.Rows[rowIndex]; if ((bool)therow.Cells["Sealed"].Value == true) { therow.DefaultCellStyle.BackColor = Color.Pink; } if (therow.Cells["Database"].Value as string == "PNG") { therow.DefaultCellStyle.BackColor = Color.LightGreen; } } Everything works great except that, when I handle the CellFormatting, the whole form's Paint event seems to be turned off. The cursor stops blinking in the textbox, and the form's menustrip looks like this: ![Menu bar picture][2] The top is before a search, the bottom after. The menubar won't redraw until I mouse over where the menuitems are, and then the last item to be highlighted will stay that way when I move the mouse out of the menubar. Moving the form seems to cause it to repaint, but then the problem remains. Commenting out the `resultsGridView.CellFormatting` line in the datagridview code completely fixes the problem. Am I painting the cells wrong, or is there something else I need to handle? [1]: http://stackoverflow.com/questions/118528/horrible-redraw-performance-of-the-datagridview-on-one-of-my-two-screens [2]: http://img213.imageshack.us/img213/2430/menubar.jpg
0
8,831,915
01/12/2012 08:20:33
1,145,000
01/12/2012 08:14:26
1
0
I am the only admin and my page access abilities are gone, I can nolonger manage my page - why?
My facebook page is not showing up as Use Facebook as "..........." I am and have been the only admin so surely I cant be booted. I cant update it or edit it, very frustrating! HELP ME PLEASE!
facebook
admin
null
null
null
01/12/2012 09:41:40
off topic
I am the only admin and my page access abilities are gone, I can nolonger manage my page - why? === My facebook page is not showing up as Use Facebook as "..........." I am and have been the only admin so surely I cant be booted. I cant update it or edit it, very frustrating! HELP ME PLEASE!
2
3,920,911
10/13/2010 05:03:45
240,364
12/29/2009 18:20:55
483
25
use batik-rasterizer without GTK
i'm using the [Apache Batik SVG Rasterizer Library][1] in python, but when i try to convert a svg into png i get this error Gtk-WARNING **: cannot open display: How can i do to don't use GTK to convert the SVG file [1]: http://xmlgraphics.apache.org/batik/tools/rasterizer.html Thanks and sorry for my english!
python
django
svg
rasterizing
null
10/05/2011 10:47:13
too localized
use batik-rasterizer without GTK === i'm using the [Apache Batik SVG Rasterizer Library][1] in python, but when i try to convert a svg into png i get this error Gtk-WARNING **: cannot open display: How can i do to don't use GTK to convert the SVG file [1]: http://xmlgraphics.apache.org/batik/tools/rasterizer.html Thanks and sorry for my english!
3
9,065,507
01/30/2012 14:37:09
400,440
02/10/2010 22:28:12
836
17
How to format Time Stored in DB2 as hhmmss
I have time Stored in Db2 Field as hhmmss(41634) . I want to format this in SQL to HH:MM:SS. I have tried many thing like substr for ex: select substr(fieldTME,1,1) as HOUR, substr(fieldTME,2,2) as Minute, substr(fieldTME,4,2) as Second from tbl1 where filed2 ='80404454' with the above sql iam able to get 4 as hour 16 as minute 34 as seconds . But if the time is value is stored as (102333).The above sql does not work. Can i format the hour,minute and second in SQL as hh:mms:ss
sql
db2
null
null
null
02/20/2012 21:46:52
too localized
How to format Time Stored in DB2 as hhmmss === I have time Stored in Db2 Field as hhmmss(41634) . I want to format this in SQL to HH:MM:SS. I have tried many thing like substr for ex: select substr(fieldTME,1,1) as HOUR, substr(fieldTME,2,2) as Minute, substr(fieldTME,4,2) as Second from tbl1 where filed2 ='80404454' with the above sql iam able to get 4 as hour 16 as minute 34 as seconds . But if the time is value is stored as (102333).The above sql does not work. Can i format the hour,minute and second in SQL as hh:mms:ss
3
8,042,855
11/07/2011 21:29:13
745,402
05/09/2011 15:18:47
22
0
C# Custom Sort by a enum or list
I need to build a sorter class for a List<T>. I would like the sort rule or priority to be: > SFC = 1 SSG = 2 SGT = 3 CPL = 4 SPC = 5 ETC... So when I sort I will get these in the correct order by rank first then by lastname. List<Person> person = new List<Person>(); person.Rank person.LastName person.FirstName ETC... Please lead me to an article or instruction. Thanks
c#
asp.net
sorting
null
null
null
open
C# Custom Sort by a enum or list === I need to build a sorter class for a List<T>. I would like the sort rule or priority to be: > SFC = 1 SSG = 2 SGT = 3 CPL = 4 SPC = 5 ETC... So when I sort I will get these in the correct order by rank first then by lastname. List<Person> person = new List<Person>(); person.Rank person.LastName person.FirstName ETC... Please lead me to an article or instruction. Thanks
0
1,005,826
06/17/2009 08:36:56
120,444
06/10/2009 10:39:36
803
28
Patterns for Safety Critical Systems
What are good resources describing architecture and design patterns for developing safety-critical systems?
safetycritical
patterns
architecture
null
null
07/31/2012 11:56:58
not constructive
Patterns for Safety Critical Systems === What are good resources describing architecture and design patterns for developing safety-critical systems?
4
400,083
12/30/2008 11:44:46
39,880
11/22/2008 07:12:51
8
2
Asp.net MVC
We are preparing to develop an enterprise Human Resource Project using ASP.NET. our team interesting to start using MVC instead of WebForms but We are worry about this. We are not sure that is suitable solution for an enterprise project. Thanks
asp.net
mvc
ajax
null
null
null
open
Asp.net MVC === We are preparing to develop an enterprise Human Resource Project using ASP.NET. our team interesting to start using MVC instead of WebForms but We are worry about this. We are not sure that is suitable solution for an enterprise project. Thanks
0
4,575,525
01/01/2011 20:03:07
525,865
10/15/2010 23:31:26
40
2
[PHP] repetitive use of a function: how to perform this - with an array
First of all-many season-greetings and a happy new year to all of you! Have a great time!! The following code is a solution that returns the labels and values in a formatted array ready for input to mysql. Very nice;-) <?php $dom = new DOMDocument(); @$dom->loadHTMLFile('http://schulen.bildung-rp.de/gehezu/startseite/einzelanzeige.html?tx_wfqbe_pi1%5buid%5d=60119'); $divElement = $dom->getElementById('wfqbeResults'); $innerHTML= ''; $children = $divElement->childNodes; foreach ($children as $child) { $innerHTML = $child->ownerDocument->saveXML( $child ); $doc = new DOMDocument(); $doc->loadHTML($innerHTML); //$divElementNew = $dom->getElementsByTagName('td'); $divElementNew = $dom->getElementsByTagname('td'); /*** the array to return ***/ $out = array(); foreach ($divElementNew as $item) { /*** add node value to the out array ***/ $out[] = $item->nodeValue; } echo '<pre>'; print_r($out); echo '</pre>'; } ?> That bit of code works very fine and it performs an operation that i intend to call upon multiple times. Therefore it makes sense to wrap it in a function. We can name it whatever we want- Let us just name it "multiload". I tried to do this with the following code - but this does not run... I am still not sure where to put the uid - inside or outside the function... <?php function multiload ($uid) { /*...*/ // $uid = '60119'; $dom = new DOMDocument(); $dom->loadHTMLFile('basic-url ' . $uid); } multiload ('60089'); multiload ('60152'); multiload ('60242'); /*...*/ $divElement = $dom->getElementById('wfqbeResults'); $innerHTML= ''; $children = $divElement->childNodes; foreach ($children as $child) { $innerHTML = $child->ownerDocument->saveXML( $child ); $doc = new DOMDocument(); $doc->loadHTML($innerHTML); //$divElementNew = $dom->getElementsByTagName('td'); $divElementNew = $dom->getElementsByTagname('td'); /*** the array to return ***/ $out = array(); foreach ($divElementNew as $item) { /*** add node value to the out array ***/ $out[] = $item->nodeValue; } echo '<pre>'; print_r($out); echo '</pre>'; }?> Where to put the following lines multicall('60089'); multicall('60152'); multicall('60242'); /*...*/ This is still repetitive, so we can put the numbers in an array - can ´t we! Then we can loop through the array. $numbers = array ('60089', '60152', '60242' /*...*/); foreach ($numbers as $number) { doStuff($number); } But the question is - how to and where to put the loop!? Can anybody give me a starting point... BTW - if i have to be more descriptive i am trying to explain more - just let me know... it is no problem to explain more greetings
php
function
null
null
null
null
open
[PHP] repetitive use of a function: how to perform this - with an array === First of all-many season-greetings and a happy new year to all of you! Have a great time!! The following code is a solution that returns the labels and values in a formatted array ready for input to mysql. Very nice;-) <?php $dom = new DOMDocument(); @$dom->loadHTMLFile('http://schulen.bildung-rp.de/gehezu/startseite/einzelanzeige.html?tx_wfqbe_pi1%5buid%5d=60119'); $divElement = $dom->getElementById('wfqbeResults'); $innerHTML= ''; $children = $divElement->childNodes; foreach ($children as $child) { $innerHTML = $child->ownerDocument->saveXML( $child ); $doc = new DOMDocument(); $doc->loadHTML($innerHTML); //$divElementNew = $dom->getElementsByTagName('td'); $divElementNew = $dom->getElementsByTagname('td'); /*** the array to return ***/ $out = array(); foreach ($divElementNew as $item) { /*** add node value to the out array ***/ $out[] = $item->nodeValue; } echo '<pre>'; print_r($out); echo '</pre>'; } ?> That bit of code works very fine and it performs an operation that i intend to call upon multiple times. Therefore it makes sense to wrap it in a function. We can name it whatever we want- Let us just name it "multiload". I tried to do this with the following code - but this does not run... I am still not sure where to put the uid - inside or outside the function... <?php function multiload ($uid) { /*...*/ // $uid = '60119'; $dom = new DOMDocument(); $dom->loadHTMLFile('basic-url ' . $uid); } multiload ('60089'); multiload ('60152'); multiload ('60242'); /*...*/ $divElement = $dom->getElementById('wfqbeResults'); $innerHTML= ''; $children = $divElement->childNodes; foreach ($children as $child) { $innerHTML = $child->ownerDocument->saveXML( $child ); $doc = new DOMDocument(); $doc->loadHTML($innerHTML); //$divElementNew = $dom->getElementsByTagName('td'); $divElementNew = $dom->getElementsByTagname('td'); /*** the array to return ***/ $out = array(); foreach ($divElementNew as $item) { /*** add node value to the out array ***/ $out[] = $item->nodeValue; } echo '<pre>'; print_r($out); echo '</pre>'; }?> Where to put the following lines multicall('60089'); multicall('60152'); multicall('60242'); /*...*/ This is still repetitive, so we can put the numbers in an array - can ´t we! Then we can loop through the array. $numbers = array ('60089', '60152', '60242' /*...*/); foreach ($numbers as $number) { doStuff($number); } But the question is - how to and where to put the loop!? Can anybody give me a starting point... BTW - if i have to be more descriptive i am trying to explain more - just let me know... it is no problem to explain more greetings
0
1,689,989
11/06/2009 19:59:16
89,771
04/11/2009 14:41:25
3,059
245
Database Design for Betting Community
I'm creating a online community for a soccer betting game available in my country. I've a pretty good idea how the whole system should work but I'm having some trouble figuring out the ideal database design and I need some help with it. The usual work flow should be something like this: 1. Everyone is welcome to register as a member; each member should have a name, email address and password. 2. **Each week a new betting contest is opened, each contest has a fixed set of "questions"** (in this case each "question" is basically in the form of "Home Team - Visiting Team"). 3. Each member is free to **cast his prognostic in the form of "1 X 2"** (1: Home Wins, X: Draw, 2: Visiting Wins; **for each "question"**) on all the **open** contests available together with an amount of money (see point 5). **Only one prognostic per contest is allowed**. 4. On the end of each week all the contests are closed and a **real bet is placed based on all the individual bets and the performance of each member** ([see also this related question][1]). The placed bet should be publicly available for everyone to see. 5. When the result of all matches is known it should be possible to "attach" (sorry, I'm missing the word) the amount of money of the prize (if the community gets lucky, of course). **The prize should then be proportionally divided by the amount each team member placed on the bet**. 6. Each member can at any given time deposit or withdraw a variable amount of money to / from his account, there should also be a **transactions page where all the deposits, prizes and withdraws are presented**. Bonus Question: Since I'm still pretty much green at "SEO friendly" URLs I would also be interested in learning **how would you name all the segments involved in this system**. I would very much appreciate any help in the design of a DB schema that can accommodate this whole scenario. **PS: I'll open up a bounty for this question, I'm currently having some issues with my Internet connection so I might take some time to read / comment on your answers.** Thanks in advance! [1]: http://stackoverflow.com/questions/1597519/algorithm-for-finding-good-reliable-players
database
database-design
schema
sqlite
php
null
open
Database Design for Betting Community === I'm creating a online community for a soccer betting game available in my country. I've a pretty good idea how the whole system should work but I'm having some trouble figuring out the ideal database design and I need some help with it. The usual work flow should be something like this: 1. Everyone is welcome to register as a member; each member should have a name, email address and password. 2. **Each week a new betting contest is opened, each contest has a fixed set of "questions"** (in this case each "question" is basically in the form of "Home Team - Visiting Team"). 3. Each member is free to **cast his prognostic in the form of "1 X 2"** (1: Home Wins, X: Draw, 2: Visiting Wins; **for each "question"**) on all the **open** contests available together with an amount of money (see point 5). **Only one prognostic per contest is allowed**. 4. On the end of each week all the contests are closed and a **real bet is placed based on all the individual bets and the performance of each member** ([see also this related question][1]). The placed bet should be publicly available for everyone to see. 5. When the result of all matches is known it should be possible to "attach" (sorry, I'm missing the word) the amount of money of the prize (if the community gets lucky, of course). **The prize should then be proportionally divided by the amount each team member placed on the bet**. 6. Each member can at any given time deposit or withdraw a variable amount of money to / from his account, there should also be a **transactions page where all the deposits, prizes and withdraws are presented**. Bonus Question: Since I'm still pretty much green at "SEO friendly" URLs I would also be interested in learning **how would you name all the segments involved in this system**. I would very much appreciate any help in the design of a DB schema that can accommodate this whole scenario. **PS: I'll open up a bounty for this question, I'm currently having some issues with my Internet connection so I might take some time to read / comment on your answers.** Thanks in advance! [1]: http://stackoverflow.com/questions/1597519/algorithm-for-finding-good-reliable-players
0
8,422,803
12/07/2011 21:26:56
545,132
12/16/2010 17:55:49
425
11
-pg flags with GNU assembler
I am writing some assembly code and assembling them using GNU assembler. I have realized that there is no way to compile with -pg flags so that I can profile. Is there any other way or any other assembler through which I can profile? Thanks
assembly
gnu
null
null
null
null
open
-pg flags with GNU assembler === I am writing some assembly code and assembling them using GNU assembler. I have realized that there is no way to compile with -pg flags so that I can profile. Is there any other way or any other assembler through which I can profile? Thanks
0
1,490,867
09/29/2009 06:22:17
42,372
12/02/2008 08:12:04
169
3
what is the shortcut key for opening a resource in RAD 6.0? Ctrl + Shift + R !?
This may be a basic question, but I'm still looking for the answer. I've been using Eclipse IDE for a long time and I know the shortcut ket 'Ctrl + Shift + R' which will open the resources dialog box. Recently I switched to RAD 6.0 IDE (as per project need), and I could not use the shortcut 'Ctrl + Shift + R' in RAD 6.0. The shortcut 'Ctrl + Shift + L' which lists all the keyboard shortcuts, is also not working in my RAD 6.0. I want to know whether RAD 6.0 does not support these shortcuts keys or is there any other shortcut available for opening a resource in RAD 6.0?
ide
rad
keyboard-shortcuts
null
null
null
open
what is the shortcut key for opening a resource in RAD 6.0? Ctrl + Shift + R !? === This may be a basic question, but I'm still looking for the answer. I've been using Eclipse IDE for a long time and I know the shortcut ket 'Ctrl + Shift + R' which will open the resources dialog box. Recently I switched to RAD 6.0 IDE (as per project need), and I could not use the shortcut 'Ctrl + Shift + R' in RAD 6.0. The shortcut 'Ctrl + Shift + L' which lists all the keyboard shortcuts, is also not working in my RAD 6.0. I want to know whether RAD 6.0 does not support these shortcuts keys or is there any other shortcut available for opening a resource in RAD 6.0?
0
8,713,429
01/03/2012 14:05:42
862,240
06/01/2010 13:08:06
1
1
vCalendar Meeting Requests
We have been using vcalendar for a while now. Recently after upgrading to outlook 2007 from 2003 when I double click to open the .ics file when it opens, I have a To: field at the top and a Send Update button to the left instead of Send. I assume this is because it sees it as an existing meeting rather than a new appointment. Any idea??? In case it helps, here's what I get in Notepad from the .ics file: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN CALSCALE:GREGORIAN METHOD:PUBLISH BEGIN:VEVENT DTSTART;TZID=US/Central:20071214T210000Z DTEND;TZID=US/Central:20071214T230000Z SUMMARY:Test From TPN LOCATION:TBD ORGANIZER:MAILTO:test@dev.com ATTENDEE;CN=Orchard,Dominic;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:client@dev.com DESCRIPTION:This is a test from TPN UID:tpn1456-33432 SEQUENCE:0 DTSTAMP:20071207T151700 PRIORITY:5 X-MICROSOFT-CDO-IMPORTANCE:1 CLASS:PUBLIC BEGIN:VALARM TRIGGER:-PT15M ACTION:DISPLAY DESCRIPTION:Reminder END:VALARM END:VEVENT END:VCALENDAR
outlook
vcalendar
null
null
null
01/06/2012 02:44:42
off topic
vCalendar Meeting Requests === We have been using vcalendar for a while now. Recently after upgrading to outlook 2007 from 2003 when I double click to open the .ics file when it opens, I have a To: field at the top and a Send Update button to the left instead of Send. I assume this is because it sees it as an existing meeting rather than a new appointment. Any idea??? In case it helps, here's what I get in Notepad from the .ics file: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN CALSCALE:GREGORIAN METHOD:PUBLISH BEGIN:VEVENT DTSTART;TZID=US/Central:20071214T210000Z DTEND;TZID=US/Central:20071214T230000Z SUMMARY:Test From TPN LOCATION:TBD ORGANIZER:MAILTO:test@dev.com ATTENDEE;CN=Orchard,Dominic;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:client@dev.com DESCRIPTION:This is a test from TPN UID:tpn1456-33432 SEQUENCE:0 DTSTAMP:20071207T151700 PRIORITY:5 X-MICROSOFT-CDO-IMPORTANCE:1 CLASS:PUBLIC BEGIN:VALARM TRIGGER:-PT15M ACTION:DISPLAY DESCRIPTION:Reminder END:VALARM END:VEVENT END:VCALENDAR
2
10,085,582
04/10/2012 08:43:36
1,315,427
04/05/2012 13:37:36
11
0
fancybox IFrame print
I would like to print whatever is displayed in the fancybox IFrame popup. How to do it? Currently print just prints everything underneath which is not what I want.
jquery
iframe
printing
fancybox
null
null
open
fancybox IFrame print === I would like to print whatever is displayed in the fancybox IFrame popup. How to do it? Currently print just prints everything underneath which is not what I want.
0
6,967,233
08/06/2011 13:49:00
269,776
02/09/2010 19:42:24
388
10
Similar image Search using API
I would like to write a program that retrieve and download all similar images of a certain image from Bing Image search. Is that possible using Bing API? Thanks!
api
search
bing
null
null
06/27/2012 16:02:55
not a real question
Similar image Search using API === I would like to write a program that retrieve and download all similar images of a certain image from Bing Image search. Is that possible using Bing API? Thanks!
1
10,801,181
05/29/2012 14:28:26
189,992
10/14/2009 16:20:35
1,850
159
Hibernate manytomany @JoinTable + @SecondaryTable duplicate entries
I have a relation of type `@ManyToMany` with a `@JoinTable` association. The thing is that the entity in the relation has its own table, but a couple of properties should go to the association table. Adding the `@SecondaryTable` duplicate. @Entity @Table(name = "A") class A { @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "A_B", joinColumns = {@JoinColumn(name = "A_ID")}, inverseJoinColumns = {@JoinColumn(name = "B_ID")}) private List<B> bs = new ArrayList<B>(); } @Entity @Table(name = "B") @SecondaryTable(name = "A_B", pkJoinColumns = { @PrimaryKeyJoinColumn(columnDefinition = "B_ID", name = "B_ID")}) class B { @Column(table = "A_B") private int a1; @Column(table = "A_B) private int a2; @ManyToMany(mappedBy = "A_ID", fetch = FetchType.LAZY) private List<A> as = new ArrayList<A>(); } This when saving `A` entities the `B` are duplicated in a way where: A_ID B_ID a1 a2 1 0 1 1 1 1 0 0
hibernate
hibernate-mapping
null
null
null
null
open
Hibernate manytomany @JoinTable + @SecondaryTable duplicate entries === I have a relation of type `@ManyToMany` with a `@JoinTable` association. The thing is that the entity in the relation has its own table, but a couple of properties should go to the association table. Adding the `@SecondaryTable` duplicate. @Entity @Table(name = "A") class A { @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "A_B", joinColumns = {@JoinColumn(name = "A_ID")}, inverseJoinColumns = {@JoinColumn(name = "B_ID")}) private List<B> bs = new ArrayList<B>(); } @Entity @Table(name = "B") @SecondaryTable(name = "A_B", pkJoinColumns = { @PrimaryKeyJoinColumn(columnDefinition = "B_ID", name = "B_ID")}) class B { @Column(table = "A_B") private int a1; @Column(table = "A_B) private int a2; @ManyToMany(mappedBy = "A_ID", fetch = FetchType.LAZY) private List<A> as = new ArrayList<A>(); } This when saving `A` entities the `B` are duplicated in a way where: A_ID B_ID a1 a2 1 0 1 1 1 1 0 0
0
10,085,039
04/10/2012 07:49:29
1,234,019
02/26/2012 16:05:38
28
0
PostgreSql 'PDOException' with message 'could not find driver'
pdo is working fine with mysql but with pgsql its giving error `'PDOException' with message 'could not find driver'` I've installed `php5-pgsql` package which also includes `pdo_pgsql` http://packages.debian.org/sid/php5-pgsql > This package provides a module for PostgreSQL database connections directly from PHP scripts. It also includes the pdo_pgsql module for use with the PHP Data Object extension. my dsn is `pgsql:dbname=DB;host=192.168.0.2` I am using Ubuntu 10.04
php5
postgresql
ubuntu
pdo
null
07/20/2012 16:40:21
too localized
PostgreSql 'PDOException' with message 'could not find driver' === pdo is working fine with mysql but with pgsql its giving error `'PDOException' with message 'could not find driver'` I've installed `php5-pgsql` package which also includes `pdo_pgsql` http://packages.debian.org/sid/php5-pgsql > This package provides a module for PostgreSQL database connections directly from PHP scripts. It also includes the pdo_pgsql module for use with the PHP Data Object extension. my dsn is `pgsql:dbname=DB;host=192.168.0.2` I am using Ubuntu 10.04
3
3,592,764
08/28/2010 22:36:41
23,903
09/16/2008 16:05:24
13,773
336
Language Simplicity: Spec vs. Code?
I often see people commenting that what they want is a simple language, with a simple specification and not too many excess features, odd rules and multiple ways of doing things. I've never understood this except when the opposite is taken to the extreme. Isn't a more meaningful measure of language complexity the complexity of the code needed to do common programming tasks? For example, if a language has a huge specification, a lot of different abstractions and complexity management tools and tons of features for library writers, it might be regarded as a complicated language. However, if those features are useful and allow code to be written that is terser, more straightforward, more readable, less syntactically noisy and DRYer than other languages, and allows libraries with simpler, more user-friendly APIs to be written, doesn't that count towards the simplicity of the language in a practical sense? As a concrete example (please treat this only as an example and don't let this question evolve into a flamewar about delegates), let's use delegates. Of course, noone really **needs** delegates. They can be emulated with more general features like classes/interfaces or function pointers. They also add bloat to the language specification. However, they allow code written in the language to be terser, more straightforward and less syntactically noisy, in other words simpler, than if delegates are Greenspunned using other language features. Shouldn't that count as a net simplicity win?
language-agnostic
programming-languages
language-design
null
null
08/29/2010 16:02:23
not a real question
Language Simplicity: Spec vs. Code? === I often see people commenting that what they want is a simple language, with a simple specification and not too many excess features, odd rules and multiple ways of doing things. I've never understood this except when the opposite is taken to the extreme. Isn't a more meaningful measure of language complexity the complexity of the code needed to do common programming tasks? For example, if a language has a huge specification, a lot of different abstractions and complexity management tools and tons of features for library writers, it might be regarded as a complicated language. However, if those features are useful and allow code to be written that is terser, more straightforward, more readable, less syntactically noisy and DRYer than other languages, and allows libraries with simpler, more user-friendly APIs to be written, doesn't that count towards the simplicity of the language in a practical sense? As a concrete example (please treat this only as an example and don't let this question evolve into a flamewar about delegates), let's use delegates. Of course, noone really **needs** delegates. They can be emulated with more general features like classes/interfaces or function pointers. They also add bloat to the language specification. However, they allow code written in the language to be terser, more straightforward and less syntactically noisy, in other words simpler, than if delegates are Greenspunned using other language features. Shouldn't that count as a net simplicity win?
1
866,347
05/14/2009 23:17:21
270
08/04/2008 10:21:45
2,880
140
Regex to match www.example.com only if http:// not present
I have the following regex that isn't working. I want to match the string 'www.example.com' but not the string 'http://www.example.com' (or 'anythingwww.example.com' for that matter): /\bwww\.\w.\w/ig This is used in JavaScript like this: text = text.replace(/\bwww\.\w.\w/ig, 'http://$&'); I know the second part of the regex doesn't work correctly either, but it is the http:// part that is confusing me. It will currently match 'http://www.example.com' resulting in output of 'http://htpp://www.example.com'.
regex
null
null
null
null
null
open
Regex to match www.example.com only if http:// not present === I have the following regex that isn't working. I want to match the string 'www.example.com' but not the string 'http://www.example.com' (or 'anythingwww.example.com' for that matter): /\bwww\.\w.\w/ig This is used in JavaScript like this: text = text.replace(/\bwww\.\w.\w/ig, 'http://$&'); I know the second part of the regex doesn't work correctly either, but it is the http:// part that is confusing me. It will currently match 'http://www.example.com' resulting in output of 'http://htpp://www.example.com'.
0
9,372,707
02/21/2012 05:35:35
1,151,433
01/16/2012 07:57:49
177
2
Where to start with java web project?
I have been working on android But havent worked on java web based project. I have to work on a java project which takes the data from a webpage , render its latex code and insert it in database at server. I have no idea where to start with .If someone could direct me a way to startup?
java
mysql
latex
web
null
02/21/2012 06:35:09
not constructive
Where to start with java web project? === I have been working on android But havent worked on java web based project. I have to work on a java project which takes the data from a webpage , render its latex code and insert it in database at server. I have no idea where to start with .If someone could direct me a way to startup?
4
91,616
09/18/2008 10:58:48
17,398
09/18/2008 08:22:42
11
5
Easiest cross platform widget toolkit?
What is the **easiest** cross platform widget toolkit? that minimally covers Windows, osx, and Linux with a c interface?
c
gui
null
null
null
null
open
Easiest cross platform widget toolkit? === What is the **easiest** cross platform widget toolkit? that minimally covers Windows, osx, and Linux with a c interface?
0
11,479,167
07/13/2012 22:26:53
1,040,718
11/10/2011 22:42:51
503
26
Creating a 2-D matrix in Javascript
I'm using Google Visualization API to create a table. In order to setup the head of the column, this is valid matrix: var rows = [['Id', 'Site', 'Site Code', 'TC 10', 'TC9x Test', 'Tc9x Build', 'Oracle Autotest', 'Database', 'Baseline', 'push_windows', 'push_unix', 'license', 'tcx', 'eng', 'perforce_proxy', 'volume_server', 'Windows Ref Unit Location', 'Unix Ref Unit Location', 'Windows RTE Location', 'Unix RTE Location', 'Windows Toolbox Location', 'Unix Toolbox Location', 'UGII License File', 'UGS License Server', 'Unix Dev Units', 'Unix Devop Path', 'Perforce Proxy Path', 'Primary Contact', 'Secondary Contact', 'Num Users']]; I understand `rows` is a 1xn matrix (which is valid). Now, I have to change my code, and load the columns from the database. Now, suppose all my columns are stores in `columns`, an array. How could I create similar matrix as show in `rows` above? I wrote the following code: var rows = [[]]; for(var i = 0; i < columns.length; i++){ rows[0][i] = columns[i]; } However, I'm getting the following error: Not a valid 2D array.
javascript
html
null
null
null
null
open
Creating a 2-D matrix in Javascript === I'm using Google Visualization API to create a table. In order to setup the head of the column, this is valid matrix: var rows = [['Id', 'Site', 'Site Code', 'TC 10', 'TC9x Test', 'Tc9x Build', 'Oracle Autotest', 'Database', 'Baseline', 'push_windows', 'push_unix', 'license', 'tcx', 'eng', 'perforce_proxy', 'volume_server', 'Windows Ref Unit Location', 'Unix Ref Unit Location', 'Windows RTE Location', 'Unix RTE Location', 'Windows Toolbox Location', 'Unix Toolbox Location', 'UGII License File', 'UGS License Server', 'Unix Dev Units', 'Unix Devop Path', 'Perforce Proxy Path', 'Primary Contact', 'Secondary Contact', 'Num Users']]; I understand `rows` is a 1xn matrix (which is valid). Now, I have to change my code, and load the columns from the database. Now, suppose all my columns are stores in `columns`, an array. How could I create similar matrix as show in `rows` above? I wrote the following code: var rows = [[]]; for(var i = 0; i < columns.length; i++){ rows[0][i] = columns[i]; } However, I'm getting the following error: Not a valid 2D array.
0
7,396,868
09/13/2011 04:38:08
700,195
04/09/2011 18:28:05
201
6
How do programming languages/libraries communicate with hardware?
so I was looking into if there was any way to get around the XNA/Silverlight lockdown Microsoft has set up for the Windows Phone 7, as so maybe I could use SFML(.net binding) for application development and other libraries I've come to know. *I found none.....* Now all I'm wondering is why the windows phone and other similar devices don't allow some languages and unmanaged libraries such as OpenGL to be used, especially since I just found out about *platform invocation/ external linkage/ other bilingual techniques.* To understand this I guess I need to undersand the relationship between a language and a machines hardware: **How does a c/c++ library like OpenGL communicate with the screen/graphics card ?** *bonus question:* XNA doesn't use OpenGL/DirectX so is it an entirely independent graphics API?
c#
c++
api
windows-phone-7
programming-languages
09/13/2011 10:47:15
not constructive
How do programming languages/libraries communicate with hardware? === so I was looking into if there was any way to get around the XNA/Silverlight lockdown Microsoft has set up for the Windows Phone 7, as so maybe I could use SFML(.net binding) for application development and other libraries I've come to know. *I found none.....* Now all I'm wondering is why the windows phone and other similar devices don't allow some languages and unmanaged libraries such as OpenGL to be used, especially since I just found out about *platform invocation/ external linkage/ other bilingual techniques.* To understand this I guess I need to undersand the relationship between a language and a machines hardware: **How does a c/c++ library like OpenGL communicate with the screen/graphics card ?** *bonus question:* XNA doesn't use OpenGL/DirectX so is it an entirely independent graphics API?
4
9,693,964
03/13/2012 23:50:11
1,184,321
02/02/2012 05:07:44
37
0
Web hosting for a complete beginner
This is my first time using their service or any webhosting service to be completely honest and I need some help on how to get started. they emailed me a lot of information but I can't figure out how to go and upload the django code to their server. I think it has something to do with activating the develoment server but I'm not really sure. Anyone that has used them as a host before or has any general help for me would be greatly appreciated. I did send an email to their support but I haven't recieved back yet assuming they are in Europe and are all sleeping which is fine with me but I'd like to try and get this process going. Using djangoeurope.com if that helps at all.
python
django
web-hosting
null
null
03/14/2012 00:28:38
off topic
Web hosting for a complete beginner === This is my first time using their service or any webhosting service to be completely honest and I need some help on how to get started. they emailed me a lot of information but I can't figure out how to go and upload the django code to their server. I think it has something to do with activating the develoment server but I'm not really sure. Anyone that has used them as a host before or has any general help for me would be greatly appreciated. I did send an email to their support but I haven't recieved back yet assuming they are in Europe and are all sleeping which is fine with me but I'd like to try and get this process going. Using djangoeurope.com if that helps at all.
2
9,718,488
03/15/2012 11:10:42
891,725
08/12/2011 12:00:57
36
2
How to add Controls in GridView in Android
I have a data in my GridView control like: Country State City India U.P. Kanpur India M.P. Gwalior Now the problem is I want to add selection in GridView by Radio Button or any other control like: Country State City Choose India U.P. Kanpur Yes|No India M.P. Gwalior Yes|No and lastly save the data with their selection.
android
sqlite
gridview
null
null
null
open
How to add Controls in GridView in Android === I have a data in my GridView control like: Country State City India U.P. Kanpur India M.P. Gwalior Now the problem is I want to add selection in GridView by Radio Button or any other control like: Country State City Choose India U.P. Kanpur Yes|No India M.P. Gwalior Yes|No and lastly save the data with their selection.
0
2,891,124
05/23/2010 08:47:38
327,425
04/28/2010 02:07:27
13
2
Getting sectionNameKeyPath to work with CoreData/UITableViewController
1. In my AppDelegate I create an NSFetchedResultsController with sectionNameKeyPath set to @"group". 2. In viewWillAppear in my TableViewController I performFetch, then call a method called findGroups. 3. findGroups does some complicated analysis of the entire dataset to identify groups, then sets the "group" transient property on each object to the correct string value. I can see with NSLog that these are all set correctly and in coherent groups. But, tinker as I may, my cells are shown in a single section with the title of the first group. Any ideas?
iphone-sdk-3.0
uitableviewcontroller
null
null
null
null
open
Getting sectionNameKeyPath to work with CoreData/UITableViewController === 1. In my AppDelegate I create an NSFetchedResultsController with sectionNameKeyPath set to @"group". 2. In viewWillAppear in my TableViewController I performFetch, then call a method called findGroups. 3. findGroups does some complicated analysis of the entire dataset to identify groups, then sets the "group" transient property on each object to the correct string value. I can see with NSLog that these are all set correctly and in coherent groups. But, tinker as I may, my cells are shown in a single section with the title of the first group. Any ideas?
0
6,381,740
06/17/2011 05:33:36
196,886
10/26/2009 20:27:35
338
11
New to Jersey -- Getting Unsupported Media Type at Resource
I'm new to Jersey and REST so please pardon if my question is too stupid. I have a simple resource called Places, and it should support a `GET` operation which returns some point of interest based on the input variable. Here are the input string and the class: Error: HTTP 415 - Unsupported Media Type Input URL: http://localhost:8080/RESTGO/rest/places?latitude=2&longitude=3&radius=3&types=food Class: @Path("/places") public class Places { @GET @Produces(MediaType.APPLICATION_JSON) public JSONObject getPlaces(@QueryParam("latitude") double latitude, @QueryParam("longitude") double longitude, @QueryParam("radius") int radius, @QueryParam("types") String types, @DefaultValue("true") boolean sensor) { GooglePlacesClient google = new GooglePlacesClient(); JSONObject json = null; try { String response = google.performPlacesSearch(latitude, longitude, radius, types, sensor); json = new JSONObject(response); } catch (Exception e) { e.printStackTrace(); } return json; } }
json
rest
jax-ws
jersey
null
null
open
New to Jersey -- Getting Unsupported Media Type at Resource === I'm new to Jersey and REST so please pardon if my question is too stupid. I have a simple resource called Places, and it should support a `GET` operation which returns some point of interest based on the input variable. Here are the input string and the class: Error: HTTP 415 - Unsupported Media Type Input URL: http://localhost:8080/RESTGO/rest/places?latitude=2&longitude=3&radius=3&types=food Class: @Path("/places") public class Places { @GET @Produces(MediaType.APPLICATION_JSON) public JSONObject getPlaces(@QueryParam("latitude") double latitude, @QueryParam("longitude") double longitude, @QueryParam("radius") int radius, @QueryParam("types") String types, @DefaultValue("true") boolean sensor) { GooglePlacesClient google = new GooglePlacesClient(); JSONObject json = null; try { String response = google.performPlacesSearch(latitude, longitude, radius, types, sensor); json = new JSONObject(response); } catch (Exception e) { e.printStackTrace(); } return json; } }
0
8,890,371
01/17/2012 06:02:44
116,158
06/02/2009 18:35:57
635
71
Why people are using HTML5/Jquery for ipad app development instead of Objc?
I have thought many time that why people are using HTML 5 or jquery for ipad app development and i have asked many guys who know HTML 5 what could be the benefits using upon objc even UIKIT have much capability then HTML 5 coz of its home on ipad.I have search lot on web but not get any answer so guys again i need you.I want to know why clients are leaning towards preferring web language instead of objective c for development.Is this the ending of xcode UI and objective era.Does browser having much more memory capability or it have strong other skill that it is heavier then UIKIT.Can any body tell what is basic benefits to use web over objc and disadvantage of web language over objc. I hope i am not boring you. Thanks, Balraj.
jquery
html5
mobile
ios5
null
01/17/2012 06:16:36
off topic
Why people are using HTML5/Jquery for ipad app development instead of Objc? === I have thought many time that why people are using HTML 5 or jquery for ipad app development and i have asked many guys who know HTML 5 what could be the benefits using upon objc even UIKIT have much capability then HTML 5 coz of its home on ipad.I have search lot on web but not get any answer so guys again i need you.I want to know why clients are leaning towards preferring web language instead of objective c for development.Is this the ending of xcode UI and objective era.Does browser having much more memory capability or it have strong other skill that it is heavier then UIKIT.Can any body tell what is basic benefits to use web over objc and disadvantage of web language over objc. I hope i am not boring you. Thanks, Balraj.
2
2,561,183
04/01/2010 14:41:46
279,531
02/23/2010 14:20:17
73
11
Best way to code a webservice in weblogic?
I am new to Weblogic and J2ee. I need to build a webservice that simply runs a query on the backend database (DB2 zOS) and returns the results. Being new to this I have a few questions. 1) What is the best way to build the webservice? 2) How do I connect to the database with weblogic. 3) Is there a way to cache the data returned so that the next request for the same data is pulled from cache? I googled for this but there seems to be many way to handle this. I am looking for the best way that can handle a high volume of requests. Any links to sample code would be helpful. - Thanks
java-ee
weblogic
null
null
null
null
open
Best way to code a webservice in weblogic? === I am new to Weblogic and J2ee. I need to build a webservice that simply runs a query on the backend database (DB2 zOS) and returns the results. Being new to this I have a few questions. 1) What is the best way to build the webservice? 2) How do I connect to the database with weblogic. 3) Is there a way to cache the data returned so that the next request for the same data is pulled from cache? I googled for this but there seems to be many way to handle this. I am looking for the best way that can handle a high volume of requests. Any links to sample code would be helpful. - Thanks
0
6,778,780
07/21/2011 15:39:15
856,318
07/21/2011 15:39:15
1
0
windows 7 multiple network connections
I'm using windows 7 and I have 2 networks one wireless with internet connection and one wired with no internet connection. The computer is connected to booth. The problem is that although in network and sharing center it shows that the wireless connection has internet it also shows that the computer is not connected to the internet. If I only connect with the wireless I have internet connection, but when connecting to the wired one it just can't access the internet anymore. And also on the wired network I have a printer that I want to share, but I can't see it if the wireless is also connected. I suppose that there is a setting for default connection. What I want is to be able to connect to the internet over the wireless network and also to see the shared printer over the wired network. thank you!!
windows
networking
wireless
internet-connection
null
07/21/2011 16:22:52
off topic
windows 7 multiple network connections === I'm using windows 7 and I have 2 networks one wireless with internet connection and one wired with no internet connection. The computer is connected to booth. The problem is that although in network and sharing center it shows that the wireless connection has internet it also shows that the computer is not connected to the internet. If I only connect with the wireless I have internet connection, but when connecting to the wired one it just can't access the internet anymore. And also on the wired network I have a printer that I want to share, but I can't see it if the wireless is also connected. I suppose that there is a setting for default connection. What I want is to be able to connect to the internet over the wireless network and also to see the shared printer over the wired network. thank you!!
2
8,196,155
11/19/2011 18:15:55
974,925
10/01/2011 22:21:06
34
0
AS3 - Protected function error
Since I put the "info.text = " into the function an unknown error comes up. Can someone please explain me what is wrong? > protected function completeHandler(event:Event):void { > if (currentVersion != updateVersion) > { > info.text = "Available..." > } else{ > info.text = "Latest..." > } > } Thanks.
actionscript-3
null
null
null
null
11/22/2011 21:30:43
too localized
AS3 - Protected function error === Since I put the "info.text = " into the function an unknown error comes up. Can someone please explain me what is wrong? > protected function completeHandler(event:Event):void { > if (currentVersion != updateVersion) > { > info.text = "Available..." > } else{ > info.text = "Latest..." > } > } Thanks.
3
2,732,622
04/28/2010 19:43:12
226,619
12/07/2009 19:32:55
54
4
Using fixtures with factory_girl
When building the following factory: Factory.define :user do |f| f.sequence(:name) { |n| "foo#{n}" } f.resume_type_id { ResumeType.first.id } end `ResumeType.first` returns **nil** and I get an error. `ResumeType` records are loaded via fixtures. I checked using the console and the entries are there, the table is not empty. I've found a similar example in the factory_girl mailing list, and it's supposed to work. What am I missing? Do I have to somehow tell factory_girl to set up the fixtures before running the tests?
ruby-on-rails
factorygirl
fixtures
factory
unit-testing
null
open
Using fixtures with factory_girl === When building the following factory: Factory.define :user do |f| f.sequence(:name) { |n| "foo#{n}" } f.resume_type_id { ResumeType.first.id } end `ResumeType.first` returns **nil** and I get an error. `ResumeType` records are loaded via fixtures. I checked using the console and the entries are there, the table is not empty. I've found a similar example in the factory_girl mailing list, and it's supposed to work. What am I missing? Do I have to somehow tell factory_girl to set up the fixtures before running the tests?
0
9,271,249
02/14/2012 03:19:50
1,186,741
02/03/2012 04:52:42
30
0
Editing not functioning for jquery rows
I have a problem editing the data inside the rows after creating them. I tried using the `$(this).parent().parent().edit()` to edit the records but it seems not workable. The source code is as follows: $(document).ready(function() { $('#btnAdd').live('click', function() { var name = $('#txtName').val(); var name2 = $('#txtName2').val(); $("#tbNames tr:last").after("<tr><td>" + name + "</td><td>" + name2 + "</td><td><img src='delete.gif' class='delete' height='15' /></td><td><img src='edit.gif' class='edit' height='15' /></td></tr>"); }); $('#tbNames td img.delete').live('click', function() { $(this).parent().parent().remove(); }); $('#tbNames td img.edit').live('click', function() { $(this).parent().parent().edit(); }); //$("#submit_app").button(); //Commented this line $("#submit_app").click(function() { var skipFirstRow = 0; //Skip first row $("#tbNames tr").each(function() { if (skipFirstRow++ == 0) return; var skipLastColumn = 0; $(this).children("td").each(function() { if (skipLastColumn++ == 2) return; alert($(this).html()); }); }); var reclist = $("#txtName").val(); console.log(reclist); }); }); <input id="txtName" type="text" /> <input id="txtName2" type="text" /> <input id="btnAdd" type="button" value="Add" /> <table id="tbNames" border="1" > <tr> <th>Name</b></th> <th>Name2</b></th> <th>Delete</b></th> </tr> <tr> <td>Bingo</td> <td>Tingo</td> <td><img src="Delete.gif" height="15" class="delete" /></td> <td><img src="edit.gif" height="15" class="edit" /></td> </tr> </table> <input id="insert_data" type="button" style="height: 35px; width: 225px" value="Retrieve Default User" /> <input id="submit_app" type="button" style="height: 35px; width: 225px" value="Add New User" /> Please advise if I have miss any coding.
javascript
jquery
null
null
null
02/15/2012 03:57:35
too localized
Editing not functioning for jquery rows === I have a problem editing the data inside the rows after creating them. I tried using the `$(this).parent().parent().edit()` to edit the records but it seems not workable. The source code is as follows: $(document).ready(function() { $('#btnAdd').live('click', function() { var name = $('#txtName').val(); var name2 = $('#txtName2').val(); $("#tbNames tr:last").after("<tr><td>" + name + "</td><td>" + name2 + "</td><td><img src='delete.gif' class='delete' height='15' /></td><td><img src='edit.gif' class='edit' height='15' /></td></tr>"); }); $('#tbNames td img.delete').live('click', function() { $(this).parent().parent().remove(); }); $('#tbNames td img.edit').live('click', function() { $(this).parent().parent().edit(); }); //$("#submit_app").button(); //Commented this line $("#submit_app").click(function() { var skipFirstRow = 0; //Skip first row $("#tbNames tr").each(function() { if (skipFirstRow++ == 0) return; var skipLastColumn = 0; $(this).children("td").each(function() { if (skipLastColumn++ == 2) return; alert($(this).html()); }); }); var reclist = $("#txtName").val(); console.log(reclist); }); }); <input id="txtName" type="text" /> <input id="txtName2" type="text" /> <input id="btnAdd" type="button" value="Add" /> <table id="tbNames" border="1" > <tr> <th>Name</b></th> <th>Name2</b></th> <th>Delete</b></th> </tr> <tr> <td>Bingo</td> <td>Tingo</td> <td><img src="Delete.gif" height="15" class="delete" /></td> <td><img src="edit.gif" height="15" class="edit" /></td> </tr> </table> <input id="insert_data" type="button" style="height: 35px; width: 225px" value="Retrieve Default User" /> <input id="submit_app" type="button" style="height: 35px; width: 225px" value="Add New User" /> Please advise if I have miss any coding.
3
5,556,183
04/05/2011 17:51:22
34,537
11/05/2008 03:00:23
8,485
153
Make C++ crash without casting?
What are possible ways to make C/C++ crash **without using cast?** I know using ptrs that have been free/delete'd. Using null ptr (if applicable) i also wrote a short example where a function uses a string and returns sz.c_str(). sz is now out of scope and the return it returns causes undefined behavior. How else could C++ crash/do incorrect things when casting is not involved?
c++
c
null
null
null
04/07/2011 01:09:16
not a real question
Make C++ crash without casting? === What are possible ways to make C/C++ crash **without using cast?** I know using ptrs that have been free/delete'd. Using null ptr (if applicable) i also wrote a short example where a function uses a string and returns sz.c_str(). sz is now out of scope and the return it returns causes undefined behavior. How else could C++ crash/do incorrect things when casting is not involved?
1
4,815,474
01/27/2011 11:02:04
401,025
07/24/2010 11:40:35
1,750
75
If you have developed an app for mobile devices, which line did you take?
Developing mobile apps is a challenging job. Customers want to be present not only on iPhone and iPad but maybe on Android and other **mobile platforms** like Windows Phone 7, Blackberry and Symbian, too. It costs a lot of money to keep this apps up to date on **different platforms**. Besides the developer has to dig in different sdk's and learn different languages. I thought about having just **one app**, that is rendered in a mobile browser like webkit, which is a standart for rendering web content. Of course there are constraints like the use of camera or specific hardware for advanced rendering. But I think this will change over time. **How do you challange that? Do you re-use your code? Could mobile web be an alternative?**
iphone
android
blackberry
windows-phone-7
webkit
01/28/2011 10:37:19
off topic
If you have developed an app for mobile devices, which line did you take? === Developing mobile apps is a challenging job. Customers want to be present not only on iPhone and iPad but maybe on Android and other **mobile platforms** like Windows Phone 7, Blackberry and Symbian, too. It costs a lot of money to keep this apps up to date on **different platforms**. Besides the developer has to dig in different sdk's and learn different languages. I thought about having just **one app**, that is rendered in a mobile browser like webkit, which is a standart for rendering web content. Of course there are constraints like the use of camera or specific hardware for advanced rendering. But I think this will change over time. **How do you challange that? Do you re-use your code? Could mobile web be an alternative?**
2
2,083,819
01/18/2010 03:56:58
119,973
06/09/2009 16:41:23
103
0
trying to show a total from mysql in php
I am trying to get the qunt with are int and add them all up and show a total $qunt = 0; $result = mysql_query("SELECT * FROM properties_items WHERE user_propid='$view' ORDER BY id DESC") or die (mysql_error()); while ($row = mysql_fetch_array($result)) { $itemid = $row['itemid']; $qunt = $row['qunt']; $qunt++; } echo $qunt;
php
mysql
null
null
null
null
open
trying to show a total from mysql in php === I am trying to get the qunt with are int and add them all up and show a total $qunt = 0; $result = mysql_query("SELECT * FROM properties_items WHERE user_propid='$view' ORDER BY id DESC") or die (mysql_error()); while ($row = mysql_fetch_array($result)) { $itemid = $row['itemid']; $qunt = $row['qunt']; $qunt++; } echo $qunt;
0
10,158,119
04/14/2012 23:09:15
1,183,424
02/01/2012 18:21:03
50
0
Android creating a Spotify like slider menu
I am making an app that should implement a slider menu like the one in Spotify (where you slide the triangle in the middle to show the current playing song). The problem is I can't seem to figure out a decent method of doing this. I tried it with a Facebook like menu I found [here](http://www.dreamincode.net/forums/topic/270319-how-to-create-a-slide-in-menulist-like-in-facebook-app/). However that just provides me with 2 linear layouts which are placed next to each other and are basically stretched or unstretched when expanding the menu. This gives some layout issues when expanding/collapsing (all items are placed below each other in the linearlayout when expanding and are quietly moved into the right place when collapsing the menu again). In Spotify on the other hand it seems as if the layouts are on top of each other when the menu is expanded. This seems like a much cleaner way. However I have no idea on how to tackle this and Google doesn't really provide a lot of answers. Physically sliding the menu up isn't necessary, just getting the layouts on top of each other with some sliding animation on clicking the menu button. Sorry for the long post, it seemed necessary to specify the question.
android
menu
slider
null
null
null
open
Android creating a Spotify like slider menu === I am making an app that should implement a slider menu like the one in Spotify (where you slide the triangle in the middle to show the current playing song). The problem is I can't seem to figure out a decent method of doing this. I tried it with a Facebook like menu I found [here](http://www.dreamincode.net/forums/topic/270319-how-to-create-a-slide-in-menulist-like-in-facebook-app/). However that just provides me with 2 linear layouts which are placed next to each other and are basically stretched or unstretched when expanding the menu. This gives some layout issues when expanding/collapsing (all items are placed below each other in the linearlayout when expanding and are quietly moved into the right place when collapsing the menu again). In Spotify on the other hand it seems as if the layouts are on top of each other when the menu is expanded. This seems like a much cleaner way. However I have no idea on how to tackle this and Google doesn't really provide a lot of answers. Physically sliding the menu up isn't necessary, just getting the layouts on top of each other with some sliding animation on clicking the menu button. Sorry for the long post, it seemed necessary to specify the question.
0
7,820,204
10/19/2011 10:54:29
972,480
09/30/2011 05:34:17
21
0
Creating textbox, datapicker, radio button in View(MVC)
I just want to create some controls in cshtml file, Is it a best practice to add them in js file? Please guide me with exact syntax to create a textbox, radio button and a datepicker, button etc. Thanks, Adarsh
javascript
asp.net-mvc-3
razor
null
null
10/21/2011 09:22:38
not a real question
Creating textbox, datapicker, radio button in View(MVC) === I just want to create some controls in cshtml file, Is it a best practice to add them in js file? Please guide me with exact syntax to create a textbox, radio button and a datepicker, button etc. Thanks, Adarsh
1
6,072,987
05/20/2011 13:56:42
762,853
05/20/2011 13:56:42
1
0
How can I perform a clear of a DIV
I have this code and I would like the paragraph that follows to be left aligned and below: <div class="content_hdr clearfix"> <div class="clearfix content_hdr_heading">System Test</div> <div class="content_hdr_intro"> <p> Some text </p></div> </div> .clearfix:after{ clear: both; content: "."; display: block; height: 0; visibility: hidden; } div.content_hdr_heading { float: left; background: #ff9999; } I created this [fiddle][1] Hope someone can help. [1]: http://jsfiddle.net/HmkMj/
css
null
null
null
null
null
open
How can I perform a clear of a DIV === I have this code and I would like the paragraph that follows to be left aligned and below: <div class="content_hdr clearfix"> <div class="clearfix content_hdr_heading">System Test</div> <div class="content_hdr_intro"> <p> Some text </p></div> </div> .clearfix:after{ clear: both; content: "."; display: block; height: 0; visibility: hidden; } div.content_hdr_heading { float: left; background: #ff9999; } I created this [fiddle][1] Hope someone can help. [1]: http://jsfiddle.net/HmkMj/
0
9,341,420
02/18/2012 13:05:02
1,163,295
01/22/2012 09:42:45
1
0
How to build a graphic studio for programming
I am not a professional programmer, and this is my first post here.I would like to build a environment to develop software.The whole idea is to combine tools,specifically text editors and compilers for a variety of programming languages(specifically will support c,c++,haskell,sml,pascal,F#,OCaml,java,fortran,c#,perl,Delphi,ruby-on-rails,parallel programming).I want to host this environment to a server(a Dell cluster) which will give access to people who will have specific usernames and passwords.I also want to add some other features like a settings menu and messenger which will give the opportunity to the logged in users to communicate if they have added the other person as a friend in their contact list(something like msn).Moreover,I want also the users to have a file explorer in order to see all the files and directories they have created.The whole environment will give authorized access to 400 - 500 people approximately.The dell cluster is running redhat.My questions is what am I going to need to build such thing.By what,I mean what programming languages and knowledge should I have to build something like that.For your convenience I am going to write again numbered the things I want: 1) Free Open Source Compilers for specific programming languages 2) Free Open Source text editors. 3) Settings Menu for this environment 4) Messenger 6) terminal 5) build an easy to use graphics user interface My question : What am I going to need from programming tools ,such as knowledge and programming languages. If my question is general please be lenient as much as possible before you close the thread. Thanks for your time and parience. P.S.: If there is anything you can't understand to my question please feel free to ask.
development-environment
null
null
null
null
02/19/2012 12:50:27
not constructive
How to build a graphic studio for programming === I am not a professional programmer, and this is my first post here.I would like to build a environment to develop software.The whole idea is to combine tools,specifically text editors and compilers for a variety of programming languages(specifically will support c,c++,haskell,sml,pascal,F#,OCaml,java,fortran,c#,perl,Delphi,ruby-on-rails,parallel programming).I want to host this environment to a server(a Dell cluster) which will give access to people who will have specific usernames and passwords.I also want to add some other features like a settings menu and messenger which will give the opportunity to the logged in users to communicate if they have added the other person as a friend in their contact list(something like msn).Moreover,I want also the users to have a file explorer in order to see all the files and directories they have created.The whole environment will give authorized access to 400 - 500 people approximately.The dell cluster is running redhat.My questions is what am I going to need to build such thing.By what,I mean what programming languages and knowledge should I have to build something like that.For your convenience I am going to write again numbered the things I want: 1) Free Open Source Compilers for specific programming languages 2) Free Open Source text editors. 3) Settings Menu for this environment 4) Messenger 6) terminal 5) build an easy to use graphics user interface My question : What am I going to need from programming tools ,such as knowledge and programming languages. If my question is general please be lenient as much as possible before you close the thread. Thanks for your time and parience. P.S.: If there is anything you can't understand to my question please feel free to ask.
4
3,050,984
06/16/2010 05:50:38
300,097
03/23/2010 16:15:26
55
0
javascript event e.which?
What is the functionality of javascript event e.which? Please brief with example.
javascript
javascript-events
null
null
null
null
open
javascript event e.which? === What is the functionality of javascript event e.which? Please brief with example.
0
5,763,810
04/23/2011 11:07:42
710,689
04/15/2011 23:57:59
5
0
is python good for web development and chatting server?
as the title sugests, i am asking if python is good for web development. i am a php developer and i do everything of mine in php. but as you know. php is not good at all for chatting and php also have nothing to deal with audio and vedio recodrding. so i am planing to create online audio recorder and video chatting server but there nothing in php that can help to do this. and people were telling me that python is good for that. now is it really posible to create some kind of powerful web backends using python??? and if yes, how do we install the python libraries on the web server??? and if you know a good websites for tutorials that are related to audio and video in python please suggest them to me couz i have been looking for the past 5 hours on the net to found a good tutorial and they were all about creating desktop apps. and another thing, if i have a code that works on desktop computers writen in python, can the same code work on website??? any help and any answer will be more than appreciated!
python
web
development
pyaudio
null
04/23/2011 11:16:49
not constructive
is python good for web development and chatting server? === as the title sugests, i am asking if python is good for web development. i am a php developer and i do everything of mine in php. but as you know. php is not good at all for chatting and php also have nothing to deal with audio and vedio recodrding. so i am planing to create online audio recorder and video chatting server but there nothing in php that can help to do this. and people were telling me that python is good for that. now is it really posible to create some kind of powerful web backends using python??? and if yes, how do we install the python libraries on the web server??? and if you know a good websites for tutorials that are related to audio and video in python please suggest them to me couz i have been looking for the past 5 hours on the net to found a good tutorial and they were all about creating desktop apps. and another thing, if i have a code that works on desktop computers writen in python, can the same code work on website??? any help and any answer will be more than appreciated!
4
8,276,979
11/26/2011 07:27:09
1,066,665
11/26/2011 07:22:25
1
0
How to create WEB DAV url on MS sever 2003
I have to create WEB DAV url. I have searched on google and follow steps but I cant create url . Please suggest me how to create web dav url Thanks.
c#
asp.net
null
null
null
11/27/2011 06:49:59
not a real question
How to create WEB DAV url on MS sever 2003 === I have to create WEB DAV url. I have searched on google and follow steps but I cant create url . Please suggest me how to create web dav url Thanks.
1
9,170,565
02/07/2012 03:21:00
895,803
08/16/2011 00:26:36
36
2
How to re enumerate the Mac USB Bus or have HID Manager rescan for connected HID devices?
We currently have a custom kext module that prevents our devices from being attached to the Mac HID driver. This is for some of our older software that communicates directly to our devices using libUSB. We now need to programmatically be able to remove our kext modules and then re enumerate the usb bus so that our currently connected HID devices are detected and attached to the HID driver. Is there a way to re enumerate the usb bus programmatically using a script or c or objective-c? Maybe even a way to have the HID Manager rescan the bus?
osx
usb
null
null
null
null
open
How to re enumerate the Mac USB Bus or have HID Manager rescan for connected HID devices? === We currently have a custom kext module that prevents our devices from being attached to the Mac HID driver. This is for some of our older software that communicates directly to our devices using libUSB. We now need to programmatically be able to remove our kext modules and then re enumerate the usb bus so that our currently connected HID devices are detected and attached to the HID driver. Is there a way to re enumerate the usb bus programmatically using a script or c or objective-c? Maybe even a way to have the HID Manager rescan the bus?
0
6,134,408
05/26/2011 06:11:05
770,765
05/26/2011 06:11:05
1
0
what can and cannot be done programmatically on non-jailbroken iDevices?
I'd like an overview of what is available to an app programmer coding for a non-jailbroken device running a recent version of iOS, in terms of accessing information about (1) the state of the iDevice itself and (2) the 3rd party apps installed, and also what his app can affect in these two. I hope the import of my question is clear: instead of asking whether: can my app look at the file system? can it invoke an app? can it take a screenshot of the 3rd home screen? etc. etc. I'd like the bigger picture so I can answer (or find the answers to) specific questions myself. Also any changes in these respects as iOS version 4 has evolved would be useful. Please keep in mind that the (hypothetical) app would be submitted to the App Store so it should adhere to whatever guidelines have been set by Apple (i.e. something that is technically possible but "frowned upon" or disallowed is out). Practical insight from experienced app developers and/or good online references would be appreciated. Thanks!
iphone-sdk-4.0
ios4
null
null
null
05/26/2011 07:10:28
not a real question
what can and cannot be done programmatically on non-jailbroken iDevices? === I'd like an overview of what is available to an app programmer coding for a non-jailbroken device running a recent version of iOS, in terms of accessing information about (1) the state of the iDevice itself and (2) the 3rd party apps installed, and also what his app can affect in these two. I hope the import of my question is clear: instead of asking whether: can my app look at the file system? can it invoke an app? can it take a screenshot of the 3rd home screen? etc. etc. I'd like the bigger picture so I can answer (or find the answers to) specific questions myself. Also any changes in these respects as iOS version 4 has evolved would be useful. Please keep in mind that the (hypothetical) app would be submitted to the App Store so it should adhere to whatever guidelines have been set by Apple (i.e. something that is technically possible but "frowned upon" or disallowed is out). Practical insight from experienced app developers and/or good online references would be appreciated. Thanks!
1
4,332,645
12/02/2010 07:23:18
402,104
07/26/2010 09:44:19
21
1
Reuse linux code on MAC OS
Is it possible to reuse the c code written for linux in MAC OSX. The code is using libusb library. I have found libusb lib for MAC OSX. But after installing it also getting error. Please help.
osx
libusb
null
null
null
12/05/2010 07:06:45
not a real question
Reuse linux code on MAC OS === Is it possible to reuse the c code written for linux in MAC OSX. The code is using libusb library. I have found libusb lib for MAC OSX. But after installing it also getting error. Please help.
1
3,783,579
09/24/2010 01:16:54
398,749
07/22/2010 05:48:45
225
17
'else' statement in list comprehensions
I've got a variable that could either be a string or a tuple (I don't know ahead of time) and I need to work with it as a list. Essentially, I want to transform the following into a list comprehension. variable = 'id' final = [] if isinstance(variable, str): final.append(variable) elif isinstance(variable, tuple): final = list(variable) I was thinking something along the lines of the following (which gives me a syntax error). final = [var for var in variable if isinstance(variable, tuple) else variable] I've seen this [question][1] but it's not the same because the asker could use the `for` loop at the end; mine only applies if it's a tuple. **NOTE:** I would like the list comprehension to work if I use `isinstance(variable, list)` as well as the `tuple` one. [1]: http://stackoverflow.com/questions/2951701/is-it-possible-to-use-else-in-a-python-list-comprehension
python
list-comprehension
null
null
null
null
open
'else' statement in list comprehensions === I've got a variable that could either be a string or a tuple (I don't know ahead of time) and I need to work with it as a list. Essentially, I want to transform the following into a list comprehension. variable = 'id' final = [] if isinstance(variable, str): final.append(variable) elif isinstance(variable, tuple): final = list(variable) I was thinking something along the lines of the following (which gives me a syntax error). final = [var for var in variable if isinstance(variable, tuple) else variable] I've seen this [question][1] but it's not the same because the asker could use the `for` loop at the end; mine only applies if it's a tuple. **NOTE:** I would like the list comprehension to work if I use `isinstance(variable, list)` as well as the `tuple` one. [1]: http://stackoverflow.com/questions/2951701/is-it-possible-to-use-else-in-a-python-list-comprehension
0
5,826,237
04/28/2011 23:27:26
622,378
02/18/2011 00:35:52
246
2
Im trying to understand subversion / git
I am trying to understand and learn how to use subversion or git. Which do you recommend? It seem so complicated and confusing. I do a lot of PHP web development projects. I have a habit backing up project folders like project_name_version_date What is the best way to learn for beginner? How do you upload updated project from local machine to live website to a different server, how that be done from subversion / git? and reupload to new version again? Can 2 or 3 people work on the same project at the same time? do they load the code files from the server? wouldn't it conflict each other... like they had removed the class objects, functions, etc.
php
web-development
svn
git
null
04/29/2011 08:39:37
not a real question
Im trying to understand subversion / git === I am trying to understand and learn how to use subversion or git. Which do you recommend? It seem so complicated and confusing. I do a lot of PHP web development projects. I have a habit backing up project folders like project_name_version_date What is the best way to learn for beginner? How do you upload updated project from local machine to live website to a different server, how that be done from subversion / git? and reupload to new version again? Can 2 or 3 people work on the same project at the same time? do they load the code files from the server? wouldn't it conflict each other... like they had removed the class objects, functions, etc.
1
5,860,084
05/02/2011 17:08:14
544,079
12/15/2010 23:39:20
120
1
divs in html newsletters
Can we use divs in html email news letters or is it customary to do everything with tables?
html
null
null
null
null
05/03/2011 10:09:19
not a real question
divs in html newsletters === Can we use divs in html email news letters or is it customary to do everything with tables?
1
11,252,711
06/28/2012 20:53:04
1,489,675
06/28/2012 20:16:29
1
0
installing two qmail on same linux
I want to installing two or more qmail on same linux server.Is this possible? If it's possible how can I do that? Actually I want to send mails from the different domain names and different IP addresses.For instance; xxx@a.com > 11.11.11.11 xxx@b.com > 22.22.22.22 xxx@c.com > 33.33.33.33 If it's not possible, what's your recommendation? Thanks,
linux
qmail
null
null
null
06/29/2012 22:34:59
off topic
installing two qmail on same linux === I want to installing two or more qmail on same linux server.Is this possible? If it's possible how can I do that? Actually I want to send mails from the different domain names and different IP addresses.For instance; xxx@a.com > 11.11.11.11 xxx@b.com > 22.22.22.22 xxx@c.com > 33.33.33.33 If it's not possible, what's your recommendation? Thanks,
2
4,118,458
11/07/2010 15:52:44
386,208
07/08/2010 03:22:03
25
1
How to tuning informix database performance
I want to how to do following general step: 1. where to find slow SQL 2. how to dubug sql (include function) 3. how to create index properly 4. when using "update stasitices" , when should I use HIGH or LOW , and why ? Guys , I am going to write a paper about this topic , any help is welcomed. best wishes
performance
informix
null
null
null
null
open
How to tuning informix database performance === I want to how to do following general step: 1. where to find slow SQL 2. how to dubug sql (include function) 3. how to create index properly 4. when using "update stasitices" , when should I use HIGH or LOW , and why ? Guys , I am going to write a paper about this topic , any help is welcomed. best wishes
0
3,941,214
10/15/2010 10:03:17
169,277
09/06/2009 14:30:11
1,695
180
Looking the best way to start jboss
I'm trying find out, how to start jboss with cron job at a particular time. What I'm doing at the moment is setup a cron, then inside jboss startinstance script I put sleep 700 seconds untill jboss starts. Is there a better way to actually know when jboss has successfully started and then continue with the flow after, instead of sleeping for a certain amount of time? Did anyone do something similar?
linux
bash
unix
deployment
jboss
04/18/2012 16:07:28
not constructive
Looking the best way to start jboss === I'm trying find out, how to start jboss with cron job at a particular time. What I'm doing at the moment is setup a cron, then inside jboss startinstance script I put sleep 700 seconds untill jboss starts. Is there a better way to actually know when jboss has successfully started and then continue with the flow after, instead of sleeping for a certain amount of time? Did anyone do something similar?
4
8,772,784
01/07/2012 20:18:52
1,136,375
12/19/2010 18:18:58
1
0
HTML code for Newsletter
I am doing a project and I need to create a newsletter for it. I search in Google for code examples how to create a newsletter using HTML but I couldn't find anything. Can anyone help me with posting some code how to create a newsletter using html ? I am using CodeIgniter for my project. Any idea ? Thank you.
html
newsletter
null
null
null
01/09/2012 10:27:04
not a real question
HTML code for Newsletter === I am doing a project and I need to create a newsletter for it. I search in Google for code examples how to create a newsletter using HTML but I couldn't find anything. Can anyone help me with posting some code how to create a newsletter using html ? I am using CodeIgniter for my project. Any idea ? Thank you.
1
9,505,035
02/29/2012 19:01:53
796,490
06/13/2011 19:19:17
420
22
Resetting password where User set up to have hashed_password
In my Rails app, I set up my users table to have a string for `email` and `:hashed_password`. However I want to provide the option to reset the password. Using Railscast 274, I have everything set up, but the actual password isn't changing to what I reset it as. I thought maybe I'd have to change `:password` to `:hashed_password` in my User model where I handle validations but `:password` works elsewhere so I ruled it out. Can someone help me figure this out? **Here's my `User` model:** class User < ActiveRecord::Base attr_accessor :password attr_accessible :email, :password, :password_confirmation before_save :encrypt_new_password before_create { generate_token(:auth_token) } before_validation :downcase_email has_one :profile, :dependent => :destroy accepts_nested_attributes_for :profile validates :email, :uniqueness => true, :length => { :within => 5..50 }, :format => { :with => /^[^@][\w.-]+@[\w.-]+[.][a-z]{2,4}$/i } validates :password, :confirmation => true, :length => { :within => 4..20 }, :presence => true, :if => :password_required? def self.authenticate(email, password) user = find_by_email(email) return user if user && user.authenticated?(password) end def authenticated?(password) self.hashed_password == encrypt(password) end def send_password_reset generate_token(:password_reset_token) self.password_reset_sent_at = Time.zone.now save! UserMailer.password_reset(self).deliver end def generate_token(column) begin self[column] = SecureRandom.hex end while User.exists?(column => self[column]) end end **My `password_resets_controller`:** class PasswordResetsController < ApplicationController layout "password_reset" def new end def create user = User.find_by_email(params[:email]) if user user.send_password_reset redirect_to new_password_reset_path, :notice => "Check your email for password reset instructions." else redirect_to new_password_reset_path, :notice => "Sorry, we couldn't find that email. Please try again." end end def edit @user = User.find_by_password_reset_token!(params[:id]) session[:user_id] = @user.id end def update @user = User.find_by_password_reset_token!(params[:id]) if @user.password_reset_sent_at < 2.hours.ago redirect_to new_password_reset_path, :alert => "Your password reset link has expired." elsif @user.update_attributes(params[:user]) redirect_to profile_path(@user), :notice => "Great news: Your password has been reset." else render :edit end end end **My password_reset form code:** <%= form_for @user, :url => password_reset_path(params[:id]) do |f| %> <% if @user.errors.any? %> <div id="error_messages"> <% for message in @user.errors.full_messages %> <li class="error"><%= message %></li> <% end %> </div> <% end %> <p class="label"><label for="password">New Password:</label></p> <p><%= password_field_tag :password, nil, :autofocus => true, :autocomplete => 'off', :placeholder => 'Enter a new password' %></p> <p class="label"><label for="password_confirmation">Confirm Password:</label></p> <p><%= password_field_tag :password_confirmation, nil, :autofocus => false, :autocomplete => 'off', :placeholder => 'Reenter your new password' %></p> <%= submit_tag 'Update Password', :class => 'button orange' %> <% end %> **My `users_controller` update action:** def update @user = current_user if @user.update_attributes(params[:user]) redirect_to settings_path, :notice => 'Updated user information successfully.' else render :action => 'edit' end end
ruby-on-rails-3
authentication
null
null
null
null
open
Resetting password where User set up to have hashed_password === In my Rails app, I set up my users table to have a string for `email` and `:hashed_password`. However I want to provide the option to reset the password. Using Railscast 274, I have everything set up, but the actual password isn't changing to what I reset it as. I thought maybe I'd have to change `:password` to `:hashed_password` in my User model where I handle validations but `:password` works elsewhere so I ruled it out. Can someone help me figure this out? **Here's my `User` model:** class User < ActiveRecord::Base attr_accessor :password attr_accessible :email, :password, :password_confirmation before_save :encrypt_new_password before_create { generate_token(:auth_token) } before_validation :downcase_email has_one :profile, :dependent => :destroy accepts_nested_attributes_for :profile validates :email, :uniqueness => true, :length => { :within => 5..50 }, :format => { :with => /^[^@][\w.-]+@[\w.-]+[.][a-z]{2,4}$/i } validates :password, :confirmation => true, :length => { :within => 4..20 }, :presence => true, :if => :password_required? def self.authenticate(email, password) user = find_by_email(email) return user if user && user.authenticated?(password) end def authenticated?(password) self.hashed_password == encrypt(password) end def send_password_reset generate_token(:password_reset_token) self.password_reset_sent_at = Time.zone.now save! UserMailer.password_reset(self).deliver end def generate_token(column) begin self[column] = SecureRandom.hex end while User.exists?(column => self[column]) end end **My `password_resets_controller`:** class PasswordResetsController < ApplicationController layout "password_reset" def new end def create user = User.find_by_email(params[:email]) if user user.send_password_reset redirect_to new_password_reset_path, :notice => "Check your email for password reset instructions." else redirect_to new_password_reset_path, :notice => "Sorry, we couldn't find that email. Please try again." end end def edit @user = User.find_by_password_reset_token!(params[:id]) session[:user_id] = @user.id end def update @user = User.find_by_password_reset_token!(params[:id]) if @user.password_reset_sent_at < 2.hours.ago redirect_to new_password_reset_path, :alert => "Your password reset link has expired." elsif @user.update_attributes(params[:user]) redirect_to profile_path(@user), :notice => "Great news: Your password has been reset." else render :edit end end end **My password_reset form code:** <%= form_for @user, :url => password_reset_path(params[:id]) do |f| %> <% if @user.errors.any? %> <div id="error_messages"> <% for message in @user.errors.full_messages %> <li class="error"><%= message %></li> <% end %> </div> <% end %> <p class="label"><label for="password">New Password:</label></p> <p><%= password_field_tag :password, nil, :autofocus => true, :autocomplete => 'off', :placeholder => 'Enter a new password' %></p> <p class="label"><label for="password_confirmation">Confirm Password:</label></p> <p><%= password_field_tag :password_confirmation, nil, :autofocus => false, :autocomplete => 'off', :placeholder => 'Reenter your new password' %></p> <%= submit_tag 'Update Password', :class => 'button orange' %> <% end %> **My `users_controller` update action:** def update @user = current_user if @user.update_attributes(params[:user]) redirect_to settings_path, :notice => 'Updated user information successfully.' else render :action => 'edit' end end
0
7,480,912
09/20/2011 06:18:02
905,784
08/22/2011 11:36:31
1
0
Related Javascript
I have 2 radio buttons named yes or no and 2 drop down menus named country and state when i click on yes option they should enabled otherwise they should be in a disabled state? and advance thanks
javascript
null
null
null
null
09/20/2011 19:22:25
not a real question
Related Javascript === I have 2 radio buttons named yes or no and 2 drop down menus named country and state when i click on yes option they should enabled otherwise they should be in a disabled state? and advance thanks
1
6,487,231
06/26/2011 22:49:13
816,524
03/11/2010 23:19:12
1
0
Showing data in a UITableView added as a subview
I´m trying to display a UITableView as a subview of a UIView. When I trigger the action below, the view is shown but contain no data. - (IBAction)youwin { UITableView *HSView = [[UITableView alloc] initWithFrame:CGRectMake(200,200,500,600)] ; [self.view addSubview:HSView]; } It looks like the code in the HSView.m file is not triggerd. The HSView.h is imported into the main controller. What am I missing?
iphone
uitableview
null
null
null
null
open
Showing data in a UITableView added as a subview === I´m trying to display a UITableView as a subview of a UIView. When I trigger the action below, the view is shown but contain no data. - (IBAction)youwin { UITableView *HSView = [[UITableView alloc] initWithFrame:CGRectMake(200,200,500,600)] ; [self.view addSubview:HSView]; } It looks like the code in the HSView.m file is not triggerd. The HSView.h is imported into the main controller. What am I missing?
0
7,702,004
10/09/2011 07:16:51
898,390
08/17/2011 10:00:27
164
5
Does Java have all the PHP features?
To make my question clearer, I figured out that Java doesn't have a JSON class. Are there many PHP functions that doesn't exist in Java?
java
null
null
null
null
10/09/2011 07:59:29
not constructive
Does Java have all the PHP features? === To make my question clearer, I figured out that Java doesn't have a JSON class. Are there many PHP functions that doesn't exist in Java?
4
4,638,296
01/09/2011 08:18:50
508,056
10/25/2010 22:50:23
281
0
jQuery equivalent of body onLoad
Is it allowed to use `<body onLoad="myfunc()">` along with jQuery's `document.ready()` handlers? I can't find a way to achieve the same functionality of the `<body onLoad>` with jQuery. An example of a use case would be a facebook application. An Iframe facebook app requires the use of the `FB.Canvas.setSize` function which resize the iframe. I would need to fire it up only when all elements on the page are finished loaded. Thanks! Joel
javascript
jquery
null
null
null
null
open
jQuery equivalent of body onLoad === Is it allowed to use `<body onLoad="myfunc()">` along with jQuery's `document.ready()` handlers? I can't find a way to achieve the same functionality of the `<body onLoad>` with jQuery. An example of a use case would be a facebook application. An Iframe facebook app requires the use of the `FB.Canvas.setSize` function which resize the iframe. I would need to fire it up only when all elements on the page are finished loaded. Thanks! Joel
0
2,167,351
01/30/2010 09:02:39
452,521
09/18/2008 15:03:11
2,597
54
Create instance of an unknown generic class Type-object at runtime?
*(I'm sure this has been answered already, I searched but couldn't find it)* I need to create an instance of several generic types during runtime. That is, I have a variable named `i` that holds a number between 0-4, and I need to create an instance of `Action<>`, `Action<T1>`, `Action<T1, T2>`, `Action<T1, T2, T3>` or `Action<T1, T2, T3, T4>` depending on what the number is (the real case is not as simple so that it really is between 0-4 and I can just use a switch statement).
c#
.net
null
null
null
null
open
Create instance of an unknown generic class Type-object at runtime? === *(I'm sure this has been answered already, I searched but couldn't find it)* I need to create an instance of several generic types during runtime. That is, I have a variable named `i` that holds a number between 0-4, and I need to create an instance of `Action<>`, `Action<T1>`, `Action<T1, T2>`, `Action<T1, T2, T3>` or `Action<T1, T2, T3, T4>` depending on what the number is (the real case is not as simple so that it really is between 0-4 and I can just use a switch statement).
0
3,710,771
09/14/2010 16:15:44
329,858
04/30/2010 15:11:50
22
0
Deciding on a strategy for paginating Book listings without SQL
I have an `ArrayList` of `Book`s pulled from different `Merchant`s and sorted in Java, depending on user preferences, according to price or customer reviews: List<Book> books = new ArrayList<Book>(); This requires me to keep a large chunk of data in memory stored as Java objects at all times. Now that I need to paginate this data into listings that span multiple web pages and allow a user to click on a numbered page link to hop to that segment of the data, what's the best way to do this? My idea was to have maybe **25 book listings per page** and rather than use hyperlinks that submit the form data as a `GET` request of URL parameters, **the page number hyperlinks would simply resubmit the form**, passing the requested page number as an additional form `POST` parameter. <input type="hidden" id="pageNumber" value="0"> <a href="#" onClick="pageNumber=5; this.form.submit()">Page 5</a> In that case page 5 would simply be a set of 25 records starting at the 125th (5 * 25) record in the `ArrayList` and ending at the 149th record in the `ArrayList`. Is there a better way to do this?
java
pagination
arraylist
null
null
null
open
Deciding on a strategy for paginating Book listings without SQL === I have an `ArrayList` of `Book`s pulled from different `Merchant`s and sorted in Java, depending on user preferences, according to price or customer reviews: List<Book> books = new ArrayList<Book>(); This requires me to keep a large chunk of data in memory stored as Java objects at all times. Now that I need to paginate this data into listings that span multiple web pages and allow a user to click on a numbered page link to hop to that segment of the data, what's the best way to do this? My idea was to have maybe **25 book listings per page** and rather than use hyperlinks that submit the form data as a `GET` request of URL parameters, **the page number hyperlinks would simply resubmit the form**, passing the requested page number as an additional form `POST` parameter. <input type="hidden" id="pageNumber" value="0"> <a href="#" onClick="pageNumber=5; this.form.submit()">Page 5</a> In that case page 5 would simply be a set of 25 records starting at the 125th (5 * 25) record in the `ArrayList` and ending at the 149th record in the `ArrayList`. Is there a better way to do this?
0
11,468,077
07/13/2012 09:49:45
1,379,703
05/07/2012 12:14:49
6
0
Dropdown Menu to open up when there isn't enough room on the screen - HTML/CSS/Javascript
I have a drop-down that is in the middle of the document. When the drop-down shows up on the bottom of the screen, I want the drop-down to go up instead of down. When the drop-down shows up on the top of the screen, I want the drop-down to go down. The drop-down is designed in HTML/CSS. I need the Javascript/jQuery code to make this work. Any help will be much appreciated. Thank you! –
javascript
jquery
html5
css3
null
null
open
Dropdown Menu to open up when there isn't enough room on the screen - HTML/CSS/Javascript === I have a drop-down that is in the middle of the document. When the drop-down shows up on the bottom of the screen, I want the drop-down to go up instead of down. When the drop-down shows up on the top of the screen, I want the drop-down to go down. The drop-down is designed in HTML/CSS. I need the Javascript/jQuery code to make this work. Any help will be much appreciated. Thank you! –
0
2,475,427
03/19/2010 06:36:25
291,240
03/11/2010 06:52:33
1
0
Combine TabBar and Navigation Bar how to pushViewController?
I drag a TabBar controller into "MainWindow.xib", then put a Navigation controller into TabBar controller, So one of my tab page is navigation page. I set the root view of Navigation Controller (NavRootviewController.h / .m) Give me one way to call -pushViewController: animated: ?
iphone
null
null
null
null
06/10/2012 19:38:53
too localized
Combine TabBar and Navigation Bar how to pushViewController? === I drag a TabBar controller into "MainWindow.xib", then put a Navigation controller into TabBar controller, So one of my tab page is navigation page. I set the root view of Navigation Controller (NavRootviewController.h / .m) Give me one way to call -pushViewController: animated: ?
3
7,360,213
09/09/2011 10:20:39
835,292
07/08/2011 11:47:50
117
3
Data synchronization between two database
Ok this is what I want. A web service runing on then net. It continuously gathers data from the net and stores it on the database. It also provides the data stored to the client on request. I want to keep a Repository of datas as object for fastest service On the client side there is a windows service it call the web service and synchronization its local database to there server. Web service has very small buffer limit. it can only transfer less then 200 records per shot. this is not even good enough for data collected in a day. Nope. You cant copy the database files. The database structure are very different and one is in sql and other is access. How do i use the repository for recent data update/or full database sync with this limitation. Given the data is being updated on a hourly baisis. And there will be huge data that will be needed to be trunsfer. Sync by date or other group is not possible with the size limitation. Paging can be done but dont know how as the repository keeps changing, and how do i take chunk of data from the middle of table of sql database... Sorry for the long histroy...but needed to be told.... Better ideas or Imporovement of this idea will be take as the right answere... Thanks a lot in advance...
sql
web-services
data
synchronization
windowservice
null
open
Data synchronization between two database === Ok this is what I want. A web service runing on then net. It continuously gathers data from the net and stores it on the database. It also provides the data stored to the client on request. I want to keep a Repository of datas as object for fastest service On the client side there is a windows service it call the web service and synchronization its local database to there server. Web service has very small buffer limit. it can only transfer less then 200 records per shot. this is not even good enough for data collected in a day. Nope. You cant copy the database files. The database structure are very different and one is in sql and other is access. How do i use the repository for recent data update/or full database sync with this limitation. Given the data is being updated on a hourly baisis. And there will be huge data that will be needed to be trunsfer. Sync by date or other group is not possible with the size limitation. Paging can be done but dont know how as the repository keeps changing, and how do i take chunk of data from the middle of table of sql database... Sorry for the long histroy...but needed to be told.... Better ideas or Imporovement of this idea will be take as the right answere... Thanks a lot in advance...
0
4,685,450
01/13/2011 21:25:36
476,142
10/14/2010 18:22:00
19
2
Why the result of 1/3=0 in java?
I was writing this code in java. public static void main(String d[]){ double g=1/3; System.out.printf("%.2f",g); } the result is zero and how to solve this problem?
java
null
null
null
null
null
open
Why the result of 1/3=0 in java? === I was writing this code in java. public static void main(String d[]){ double g=1/3; System.out.printf("%.2f",g); } the result is zero and how to solve this problem?
0
10,615,339
05/16/2012 09:09:54
1,396,678
05/15/2012 16:18:24
1
0
C# how to Open excel file if it exists, create excel file if it doesnt?
I'm making program that works with excel files, i need it to try open existing excel file or create new excel file if it doesn't exist for read and write options. Not using OleDb. So the thing is when i click button1 it tries to create new excel file even if I all ready have that file in directory any ideas how to fix this ? hers my code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace test2 { public partial class Form1 : Form { Microsoft.Office.Interop.Excel.Application oXL; Microsoft.Office.Interop.Excel._Workbook oWB; Microsoft.Office.Interop.Excel._Worksheet oSheet; Microsoft.Office.Interop.Excel.Range oRng; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { FileInfo fi = new FileInfo(@"C:\Users\User\Desktop\data.xls"); if (!fi.Exists) { oXL = new Microsoft.Office.Interop.Excel.Application(); oXL.Visible = true; oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(System.Reflection.Missing.Value)); oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.ActiveSheet; oSheet.Cells[1, 1] = "First Name"; oSheet.Cells[1, 2] = "Last Name"; oSheet.Cells[1, 3] = "Full Name"; oSheet.Cells[1, 4] = "Age"; oSheet.get_Range("A1", "D1").Font.Bold = true; oSheet.get_Range("A1", "D1").VerticalAlignment = Microsoft.Office.Interop.Excel.XlVAlign.xlVAlignCenter; } else { Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application(); string myPath = (@"C:\Users\User\Desktop\data.xlsx"); excelApp.Workbooks.Open(myPath); excelApp.Visible = true; } } private void Form1_Load(object sender, EventArgs e) { } } } all so I would be grate if someone could give me a code exsampe for save and close excel file without asking it to user. User inputs data in textbox1 than click button1 and it automaticly saves and closes excel document without poping up anything from excel. Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application(); string myPath = (@"C:\Users\User\Desktop\data.xlsx"); excelApp.Workbooks.Open(myPath); excelApp.Visible = false; int rowIndex = 2; int colIndex = 2; excelApp.Cells[rowIndex, colIndex] = textBox1.Text; //how do I save workbook? //how do I colose Workbook? Thanks in advance ;)
c#
null
null
null
null
null
open
C# how to Open excel file if it exists, create excel file if it doesnt? === I'm making program that works with excel files, i need it to try open existing excel file or create new excel file if it doesn't exist for read and write options. Not using OleDb. So the thing is when i click button1 it tries to create new excel file even if I all ready have that file in directory any ideas how to fix this ? hers my code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace test2 { public partial class Form1 : Form { Microsoft.Office.Interop.Excel.Application oXL; Microsoft.Office.Interop.Excel._Workbook oWB; Microsoft.Office.Interop.Excel._Worksheet oSheet; Microsoft.Office.Interop.Excel.Range oRng; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { FileInfo fi = new FileInfo(@"C:\Users\User\Desktop\data.xls"); if (!fi.Exists) { oXL = new Microsoft.Office.Interop.Excel.Application(); oXL.Visible = true; oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(System.Reflection.Missing.Value)); oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.ActiveSheet; oSheet.Cells[1, 1] = "First Name"; oSheet.Cells[1, 2] = "Last Name"; oSheet.Cells[1, 3] = "Full Name"; oSheet.Cells[1, 4] = "Age"; oSheet.get_Range("A1", "D1").Font.Bold = true; oSheet.get_Range("A1", "D1").VerticalAlignment = Microsoft.Office.Interop.Excel.XlVAlign.xlVAlignCenter; } else { Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application(); string myPath = (@"C:\Users\User\Desktop\data.xlsx"); excelApp.Workbooks.Open(myPath); excelApp.Visible = true; } } private void Form1_Load(object sender, EventArgs e) { } } } all so I would be grate if someone could give me a code exsampe for save and close excel file without asking it to user. User inputs data in textbox1 than click button1 and it automaticly saves and closes excel document without poping up anything from excel. Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application(); string myPath = (@"C:\Users\User\Desktop\data.xlsx"); excelApp.Workbooks.Open(myPath); excelApp.Visible = false; int rowIndex = 2; int colIndex = 2; excelApp.Cells[rowIndex, colIndex] = textBox1.Text; //how do I save workbook? //how do I colose Workbook? Thanks in advance ;)
0
10,996,821
06/12/2012 12:39:07
1,451,233
06/12/2012 12:35:36
1
0
Javascript App (like Wordpress) in linkedin
I am a beginner and I'm trying to write an app that, like the wordpress one, will post pictures or maybe visiting cards on my linkedin profile. This is my first experience with Javascript and online apps and I don't understand how to integrate my app in linkedin. Where should I host my app and how can I integrate it in my linkedin profile? PS Sorry for my bad english.
javascript
wordpress
api
application
linkedin
06/13/2012 14:17:53
not a real question
Javascript App (like Wordpress) in linkedin === I am a beginner and I'm trying to write an app that, like the wordpress one, will post pictures or maybe visiting cards on my linkedin profile. This is my first experience with Javascript and online apps and I don't understand how to integrate my app in linkedin. Where should I host my app and how can I integrate it in my linkedin profile? PS Sorry for my bad english.
1
8,689,047
12/31/2011 15:57:44
566,434
01/07/2011 05:01:06
11
1
What's a good front-end technology for use with GAE?
I'm building a web application on the App Engine. I'm stuck between using <ol> <li>Struts</li> <li>Spring MVC or</li> <li>Stripes</li> </ol> for the display technology. My application will have some ajax stuff in it. Has anyone got any experience with any of these frameworks on GAE? My main concerns are how well these integrate with GAE and the availability of tutorials/support for these.
java
google-app-engine
null
null
null
12/31/2011 18:10:22
not constructive
What's a good front-end technology for use with GAE? === I'm building a web application on the App Engine. I'm stuck between using <ol> <li>Struts</li> <li>Spring MVC or</li> <li>Stripes</li> </ol> for the display technology. My application will have some ajax stuff in it. Has anyone got any experience with any of these frameworks on GAE? My main concerns are how well these integrate with GAE and the availability of tutorials/support for these.
4
9,443,083
02/25/2012 10:09:36
138,040
07/14/2009 12:30:24
349
9
Apply increment operator to a function
Is there a case where this would be valid C++ code? int main() { int k = 0; ++f(k); }
c++
null
null
null
null
03/31/2012 06:52:20
too localized
Apply increment operator to a function === Is there a case where this would be valid C++ code? int main() { int k = 0; ++f(k); }
3
10,286,375
04/23/2012 18:45:59
229,144
12/10/2009 21:01:34
852
25
Developing for google
I am developing a web page for my latest project. A bit late it struck me that I have to prepare it for google as well. I guess I can guess the answer, but I don't like guessing... When the user clicks the link I use jQuery to get new content and add it to the page dynamically. Is google crawling the .js part in some way? Or is it only links that I can see when doing view source that it uses? Can the robot-files find those files I am fetching using .js?
javascript
jquery
html
google
dynamic
04/25/2012 03:29:08
off topic
Developing for google === I am developing a web page for my latest project. A bit late it struck me that I have to prepare it for google as well. I guess I can guess the answer, but I don't like guessing... When the user clicks the link I use jQuery to get new content and add it to the page dynamically. Is google crawling the .js part in some way? Or is it only links that I can see when doing view source that it uses? Can the robot-files find those files I am fetching using .js?
2
9,429,524
02/24/2012 10:55:45
342,999
05/17/2010 11:51:25
329
18
Mysql one to many relation data retrival
I have tables like **tbl_biodata:** id : int value=>1 name : varchar(50) value => mike ... **tbl_biodata_education** first row--- id : int value=>1 biodata_id : foreignkey to tbl_biodata.id value => 1 level : varchar(50) value => bachelor year : int(4) value => 2006 second row--- id : int value=>2 biodata_id : foreignkey to tbl_biodata.id value => 1 level : varchar(50) value => masters year : int(4) value => 2010 I have to export data such that the biodata won't repeat more than one time and all the repeated education from tbl_biodata_education lists as bachelor 2006, masters 2010 The final table would be: id name => mike education => bachelor 2006, masters 2010
mysql
null
null
null
null
null
open
Mysql one to many relation data retrival === I have tables like **tbl_biodata:** id : int value=>1 name : varchar(50) value => mike ... **tbl_biodata_education** first row--- id : int value=>1 biodata_id : foreignkey to tbl_biodata.id value => 1 level : varchar(50) value => bachelor year : int(4) value => 2006 second row--- id : int value=>2 biodata_id : foreignkey to tbl_biodata.id value => 1 level : varchar(50) value => masters year : int(4) value => 2010 I have to export data such that the biodata won't repeat more than one time and all the repeated education from tbl_biodata_education lists as bachelor 2006, masters 2010 The final table would be: id name => mike education => bachelor 2006, masters 2010
0
2,783,784
05/06/2010 19:17:38
55,900
01/16/2009 16:38:08
171
6
Creating controls in ASP with dynamic ID's
I'm creating a chat widget that will be dropped into CommunityServer. The widget works great, but I just discovered that if I drop two of these widgets onto the same page, only one of them works! And I'm quite certain the reason is because the chat window is defined in ASP, and now there are two instances of the chat window, with the same ID, on the same page. I am doing this with straight ASP & Javascript (not by choice), so my chat window is defined as: `<telerik:RadListBox ID="rlbMessages" runat="server" >` (don't mind that it's a telerik control). So I was hoping I could do something like this: `<telerik:RadListBox ID="<%= rlbMessages + chatRoomID %>" runat="server" >` But from what I've gathered, apparently you can't assign ID's this way? What is the alternative?
asp
javascript
controls
null
null
null
open
Creating controls in ASP with dynamic ID's === I'm creating a chat widget that will be dropped into CommunityServer. The widget works great, but I just discovered that if I drop two of these widgets onto the same page, only one of them works! And I'm quite certain the reason is because the chat window is defined in ASP, and now there are two instances of the chat window, with the same ID, on the same page. I am doing this with straight ASP & Javascript (not by choice), so my chat window is defined as: `<telerik:RadListBox ID="rlbMessages" runat="server" >` (don't mind that it's a telerik control). So I was hoping I could do something like this: `<telerik:RadListBox ID="<%= rlbMessages + chatRoomID %>" runat="server" >` But from what I've gathered, apparently you can't assign ID's this way? What is the alternative?
0
4,289,108
11/26/2010 23:09:01
521,870
11/26/2010 23:09:01
1
0
How to make an android tablet into an interactive restaurant menu?
I'm looking for a solution to turn a 10inch Android 2.x tablet into an interactive restaurant menu for a restaurant with a lot of foreign dishes. The idea is to start by showing the basic menu, and every item on the menu can be clicked on to show detailed ingredients and background information on the origin of the dish, either on a new screen or as a fold-out. I was thinking about building it in html/php/sql and using firefox in kiosk mode, but there may be better solutions. Requirements: - adding video must be possible - intuitive to use by costumers - easy to construct/customize by a windows sysadmin who never used Android and can't program (now you know the reason why I thought of a website-like contraption) - Budget is a factor, buying an existing android app is an option, hiring you as a programmer isn't. - if at all possible: easy to change menu items by the restaurant owner
android
menu
interactive
null
null
11/27/2010 01:09:06
off topic
How to make an android tablet into an interactive restaurant menu? === I'm looking for a solution to turn a 10inch Android 2.x tablet into an interactive restaurant menu for a restaurant with a lot of foreign dishes. The idea is to start by showing the basic menu, and every item on the menu can be clicked on to show detailed ingredients and background information on the origin of the dish, either on a new screen or as a fold-out. I was thinking about building it in html/php/sql and using firefox in kiosk mode, but there may be better solutions. Requirements: - adding video must be possible - intuitive to use by costumers - easy to construct/customize by a windows sysadmin who never used Android and can't program (now you know the reason why I thought of a website-like contraption) - Budget is a factor, buying an existing android app is an option, hiring you as a programmer isn't. - if at all possible: easy to change menu items by the restaurant owner
2