PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
11,734,230
07/31/2012 06:18:25
1,555,234
07/26/2012 15:34:07
1
0
Searching in the NSArray
I'm implementing a Search Bar and Search Display Controller to filter the NSArray that I parsed from HTML. The data in my array is like in the following format. "<Book:twRxQxBihF> {\n bookAuthor = Testing;\n bookTitle = \"IOS Development\";\n}", "<Book:kxUTu3rcX5> {\n bookAuthor = Testing;\n bookTitle = \"Android Development\";\n}", ..... My project is about the mobile library and I want to filter the book by Author or Title As of now I have the NSArray called parseResults to store the data that I parsed and another NSArray filteredResults to store the final result. I'm pretty new to IOS development and I'm pretty confused with the searching with the scope. Sorry for my bad english.
iphone
objective-c
nsarray
null
null
null
open
Searching in the NSArray === I'm implementing a Search Bar and Search Display Controller to filter the NSArray that I parsed from HTML. The data in my array is like in the following format. "<Book:twRxQxBihF> {\n bookAuthor = Testing;\n bookTitle = \"IOS Development\";\n}", "<Book:kxUTu3rcX5> {\n bookAuthor = Testing;\n bookTitle = \"Android Development\";\n}", ..... My project is about the mobile library and I want to filter the book by Author or Title As of now I have the NSArray called parseResults to store the data that I parsed and another NSArray filteredResults to store the final result. I'm pretty new to IOS development and I'm pretty confused with the searching with the scope. Sorry for my bad english.
0
11,734,232
07/31/2012 06:18:30
1,564,834
07/31/2012 06:07:53
1
0
uiscrollview crashes after a while
I have this scroll to show a 3 steps uiscroll view, it works but it slows down and crashes after a while in testing. Please if anyone knows is the problem in this part of the code or it might be in the other parts of the code for the other view controllers? And please show me how can I add pagecontrol for my scroll view @interface StepsViewController : UIViewController @property (strong, nonatomic) IBOutlet UIButton *button; @property (strong, nonatomic) IBOutlet UIScrollView *scroll; @end /////////////////////////////// @interface StepsViewController () @end @implementation StepsViewController @synthesize button; @synthesize scroll; - (void)viewDidLoad { [super viewDidLoad]; //create a UIscrollView programmatically CGRect scrollViewFrame = CGRectMake(0, 0, 320, 400); UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:scrollViewFrame]; [self.view addSubview:scrollView]; //[scrollView addSubview:button]; CGSize scrollViewContentSize = CGSizeMake(960, 400); [scrollView setContentSize:scrollViewContentSize]; [self.view bringSubviewToFront:button]; UIImageView *starImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, -65, 320, 490)]; starImgView.image = [UIImage imageNamed:@"step1.png"]; [scrollView addSubview:starImgView]; UIImageView *starImgView1 = [[UIImageView alloc] initWithFrame:CGRectMake(320, -65, 320, 490)]; starImgView1.image = [UIImage imageNamed:@"step2.png"]; [scrollView addSubview:starImgView1]; UIImageView *starImgView2 = [[UIImageView alloc] initWithFrame:CGRectMake(640, -65, 320, 490)]; starImgView2.image = [UIImage imageNamed:@"step3.png"]; [scrollView addSubview:starImgView2]; [scrollView setPagingEnabled:YES]; } - (void)viewDidUnload { //[self setButton:nil]; [self setScroll:nil]; //[self setPageControl:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } @end
uiscrollview
uipagecontrol
null
null
null
null
open
uiscrollview crashes after a while === I have this scroll to show a 3 steps uiscroll view, it works but it slows down and crashes after a while in testing. Please if anyone knows is the problem in this part of the code or it might be in the other parts of the code for the other view controllers? And please show me how can I add pagecontrol for my scroll view @interface StepsViewController : UIViewController @property (strong, nonatomic) IBOutlet UIButton *button; @property (strong, nonatomic) IBOutlet UIScrollView *scroll; @end /////////////////////////////// @interface StepsViewController () @end @implementation StepsViewController @synthesize button; @synthesize scroll; - (void)viewDidLoad { [super viewDidLoad]; //create a UIscrollView programmatically CGRect scrollViewFrame = CGRectMake(0, 0, 320, 400); UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:scrollViewFrame]; [self.view addSubview:scrollView]; //[scrollView addSubview:button]; CGSize scrollViewContentSize = CGSizeMake(960, 400); [scrollView setContentSize:scrollViewContentSize]; [self.view bringSubviewToFront:button]; UIImageView *starImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, -65, 320, 490)]; starImgView.image = [UIImage imageNamed:@"step1.png"]; [scrollView addSubview:starImgView]; UIImageView *starImgView1 = [[UIImageView alloc] initWithFrame:CGRectMake(320, -65, 320, 490)]; starImgView1.image = [UIImage imageNamed:@"step2.png"]; [scrollView addSubview:starImgView1]; UIImageView *starImgView2 = [[UIImageView alloc] initWithFrame:CGRectMake(640, -65, 320, 490)]; starImgView2.image = [UIImage imageNamed:@"step3.png"]; [scrollView addSubview:starImgView2]; [scrollView setPagingEnabled:YES]; } - (void)viewDidUnload { //[self setButton:nil]; [self setScroll:nil]; //[self setPageControl:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } @end
0
11,734,235
07/31/2012 06:18:40
586,712
01/23/2011 21:40:34
151
5
jQuery - iterate through links, open
Is it possible to have a bookmarklet to open all URLs on a page containing some unique href? (like *aggregator/h* or something, preferably not complicated regex). I'm looking at jQuery.each + window.open (Firefox is set to have all new windows open in tabs, popupblocker disabled) but can't figure out how to do the if statement.
javascript
jquery
null
null
null
null
open
jQuery - iterate through links, open === Is it possible to have a bookmarklet to open all URLs on a page containing some unique href? (like *aggregator/h* or something, preferably not complicated regex). I'm looking at jQuery.each + window.open (Firefox is set to have all new windows open in tabs, popupblocker disabled) but can't figure out how to do the if statement.
0
11,734,238
07/31/2012 06:19:10
422,859
08/17/2010 12:53:24
412
1
Vertical Action Bar for Android
I want to display the Action Bar Vertically in my App. I have found few examples for the Horizontal One, but not any for the Vertical One. Can anyone please give me any example for the Vertical Action Bar. Thanks, David Brown
android
android-actionbar
vertical
null
null
null
open
Vertical Action Bar for Android === I want to display the Action Bar Vertically in my App. I have found few examples for the Horizontal One, but not any for the Vertical One. Can anyone please give me any example for the Vertical Action Bar. Thanks, David Brown
0
11,734,178
07/31/2012 06:13:46
1,564,821
07/31/2012 05:59:15
1
0
How to move an image upward like a curtain get scrolled upward using android animation?
I have used 2 images through framlayout.The second image is a a image of curtain and is completely above the 1st image.I want when I click on a button, the 2nd image should move upward as a curtain moves in a opera theater so that the 1st image can be viewed.Please advice me with proper coding and guidance. Thanks Raam
android-animation
null
null
null
null
null
open
How to move an image upward like a curtain get scrolled upward using android animation? === I have used 2 images through framlayout.The second image is a a image of curtain and is completely above the 1st image.I want when I click on a button, the 2nd image should move upward as a curtain moves in a opera theater so that the 1st image can be viewed.Please advice me with proper coding and guidance. Thanks Raam
0
11,734,179
07/31/2012 06:13:55
1,117,701
12/27/2011 13:30:17
16
3
How do i create tag cloud in Drupal 7?
I have found Drupal [Tagadelic][1] module. As of now, [its][2] not suitable for Drupal 7. Could you please any one tell me How do i create tag cloud in Drupal 7? [1]: http://drupal.org/project/tagadelic [2]: http://drupal.org/node/1129342
drupal-7
null
null
null
null
null
open
How do i create tag cloud in Drupal 7? === I have found Drupal [Tagadelic][1] module. As of now, [its][2] not suitable for Drupal 7. Could you please any one tell me How do i create tag cloud in Drupal 7? [1]: http://drupal.org/project/tagadelic [2]: http://drupal.org/node/1129342
0
11,734,248
07/31/2012 06:19:58
1,357,195
04/25/2012 20:41:11
25
0
how to append data to an xml file using jdom and java
i was wondering if someone could help append data to an xml file. below, i have code where it grabs data from another xml file, does some logic changing, and writes the changes to a new output file. however, looking through the api http://www.jdom.org/docs/apidocs/org/jdom2/output/XMLOutputter.html im having trouble understanding which method does appending. it seems like all of them creates a new xml file doc/overwrites an existing one if it exists. im trying to append tags to the new file as i loop. for(int i = 0; i < itemList.size(); i++){ //get the specific item node Element item = (Element)itemList.get(i); //there are some non item nodes so need this check if(item.getName().equals("item")){ //do some logic changing to the tags //System.out.println(item.getValue()); //System.out.println(item.getChild("Q").getValue()); //System.out.println(item.getChild("A").getValue()); boolean exists = (new File("/Users/davidyu/Desktop/file2.xml")).exists(); //if file exists if(exists){ System.out.println("in here1"); xmlOutput.????? } else{ System.out.println("in here2"); xmlOutput.output(doc, new FileWriter("/Users/davidyu/Desktop/file2.xml")); } } what im basically trying to do, is write a new item tag into the file after every loop iteration. that item tag should contain the new childNodes "Q" and "A". how can i do this? thank you.
java
xml
jdom
null
null
null
open
how to append data to an xml file using jdom and java === i was wondering if someone could help append data to an xml file. below, i have code where it grabs data from another xml file, does some logic changing, and writes the changes to a new output file. however, looking through the api http://www.jdom.org/docs/apidocs/org/jdom2/output/XMLOutputter.html im having trouble understanding which method does appending. it seems like all of them creates a new xml file doc/overwrites an existing one if it exists. im trying to append tags to the new file as i loop. for(int i = 0; i < itemList.size(); i++){ //get the specific item node Element item = (Element)itemList.get(i); //there are some non item nodes so need this check if(item.getName().equals("item")){ //do some logic changing to the tags //System.out.println(item.getValue()); //System.out.println(item.getChild("Q").getValue()); //System.out.println(item.getChild("A").getValue()); boolean exists = (new File("/Users/davidyu/Desktop/file2.xml")).exists(); //if file exists if(exists){ System.out.println("in here1"); xmlOutput.????? } else{ System.out.println("in here2"); xmlOutput.output(doc, new FileWriter("/Users/davidyu/Desktop/file2.xml")); } } what im basically trying to do, is write a new item tag into the file after every loop iteration. that item tag should contain the new childNodes "Q" and "A". how can i do this? thank you.
0
11,327,359
07/04/2012 10:35:12
1,173,588
01/27/2012 13:48:00
362
26
google map auto update location but not user set zoom
I am auto updating google maps every x seconds in jquery/javascript. Auto updating maps with current location also changes the zoom level. But i want to achieve this: If user has manually changed zoom level, then auto update of map should keep/persist the user-set zoom level. function calcRoute(user) { if(user) { start = document.getElementById("start_location").value; } end = document.getElementById("end_location").value; var request = { origin:start, destination:end, travelMode: google.maps.DirectionsTravelMode.WALKING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); $('#txt_dur').text(response.routes[0].legs[0].duration.text); $('#txt_dist').text(response.routes[0].legs[0].distance.text); } }); //if(userZoom==true) // map.setZoom(current_zoom); } function autoUpdate() { navigator.geolocation.getCurrentPosition(function(position) { var newPoint = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); start = newPoint.toString(); calcRoute(false); }); setTimeout(autoUpdate, 5000); } autoUpdate(); I will prefer standard google map events like zoom_changed instead of creating custom events for user zoom. Any directions on this subject?
jquery
google-maps
google-maps-mobile
null
null
null
open
google map auto update location but not user set zoom === I am auto updating google maps every x seconds in jquery/javascript. Auto updating maps with current location also changes the zoom level. But i want to achieve this: If user has manually changed zoom level, then auto update of map should keep/persist the user-set zoom level. function calcRoute(user) { if(user) { start = document.getElementById("start_location").value; } end = document.getElementById("end_location").value; var request = { origin:start, destination:end, travelMode: google.maps.DirectionsTravelMode.WALKING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); $('#txt_dur').text(response.routes[0].legs[0].duration.text); $('#txt_dist').text(response.routes[0].legs[0].distance.text); } }); //if(userZoom==true) // map.setZoom(current_zoom); } function autoUpdate() { navigator.geolocation.getCurrentPosition(function(position) { var newPoint = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); start = newPoint.toString(); calcRoute(false); }); setTimeout(autoUpdate, 5000); } autoUpdate(); I will prefer standard google map events like zoom_changed instead of creating custom events for user zoom. Any directions on this subject?
0
11,327,361
07/04/2012 10:35:12
848,454
07/17/2011 07:05:42
48
2
Eclipse, How to add all dependencies of one project to another
I have a project in Eclipse which I built using Maven and it has hundreds of JARs as reference libraries. Is there a way to include all these reference libraries to another project?
eclipse
dependencies
null
null
null
null
open
Eclipse, How to add all dependencies of one project to another === I have a project in Eclipse which I built using Maven and it has hundreds of JARs as reference libraries. Is there a way to include all these reference libraries to another project?
0
11,327,326
07/04/2012 10:33:05
1,438,289
06/05/2012 20:22:16
1
0
Stage3D causes fullscreen (Stage)Video to lag/jitter
I'm having some serious problems with flash at the moment. I have a swf loaded that uses Stage3D, displaying 3D content. When I overlay a video player, on full screen size, it will cause massive lag/jitter in the video content. The video content is loaded locally so there is no streaming to take into account. This only happens on some machines but considering the project this cannot be neglected. I have since recoded my project to remove any form of loading i was doing with a Loader and just directly put the file path into the netstream and have then attached the netstream to StageVideo. But the problem still persists and I am at my wits end. I even set Stage3D to invisible during video playback. It's a complete horror to debug because it's simply not a problem on my machine, but out of 10 people 4 of them have reported this problem and we can't release our product like this. Any help to resolve this would be greatly valued and appreciated. Regards, Kevin
actionscript-3
video
netstream
stage3d
null
null
open
Stage3D causes fullscreen (Stage)Video to lag/jitter === I'm having some serious problems with flash at the moment. I have a swf loaded that uses Stage3D, displaying 3D content. When I overlay a video player, on full screen size, it will cause massive lag/jitter in the video content. The video content is loaded locally so there is no streaming to take into account. This only happens on some machines but considering the project this cannot be neglected. I have since recoded my project to remove any form of loading i was doing with a Loader and just directly put the file path into the netstream and have then attached the netstream to StageVideo. But the problem still persists and I am at my wits end. I even set Stage3D to invisible during video playback. It's a complete horror to debug because it's simply not a problem on my machine, but out of 10 people 4 of them have reported this problem and we can't release our product like this. Any help to resolve this would be greatly valued and appreciated. Regards, Kevin
0
11,327,328
07/04/2012 10:33:17
893,829
08/14/2011 12:03:52
1
0
Project in Eclipse contains only a .project file
I have several projects in Perforce that I need to maintain in Eclipse. I did a successful import the first time, but I've since removed all projects from the workspace and deleted the Perforce files from the P4 folder. I'm not very familiar with Perforce so I'm not sure why whenever I try to re-import those projects, all I get is a .project file instead of the whole package. Any help would be appreciated. Thanks.
eclipse
perforce
null
null
null
null
open
Project in Eclipse contains only a .project file === I have several projects in Perforce that I need to maintain in Eclipse. I did a successful import the first time, but I've since removed all projects from the workspace and deleted the Perforce files from the P4 folder. I'm not very familiar with Perforce so I'm not sure why whenever I try to re-import those projects, all I get is a .project file instead of the whole package. Any help would be appreciated. Thanks.
0
11,327,330
07/04/2012 10:33:45
1,293,055
03/26/2012 12:55:04
105
0
c++ thread issue
I'm trying to create a thread in c++ with this code: pthread_t mythread; void* f (void*) = MyClass::myfunction; pthread_create(&mythread, NULL, &f, NULL); It's not working. Any idea what's wrong ? myfunction is of type: void* MyClass::myfunction(void* argv); The error returned is: > error: declaration of ‘void* Class::f(void*)’ has ‘extern’ and is > initialized > > error: invalid pure specifier (only ‘= 0’ is allowed) before ‘::’ > token > > error: function ‘void* Class::f(void*)’ is initialized like a variable
c++
multithreading
null
null
null
null
open
c++ thread issue === I'm trying to create a thread in c++ with this code: pthread_t mythread; void* f (void*) = MyClass::myfunction; pthread_create(&mythread, NULL, &f, NULL); It's not working. Any idea what's wrong ? myfunction is of type: void* MyClass::myfunction(void* argv); The error returned is: > error: declaration of ‘void* Class::f(void*)’ has ‘extern’ and is > initialized > > error: invalid pure specifier (only ‘= 0’ is allowed) before ‘::’ > token > > error: function ‘void* Class::f(void*)’ is initialized like a variable
0
11,327,350
07/04/2012 10:34:46
206,903
11/09/2009 13:42:37
191
0
R - hclust, and ordering the subtrees by similarity
I am using the hclust function via the heatmap.2 function to generate a dendrogram of my data. In the hclust? it says : In hierarchical cluster displays, a decision is needed at each merge to specify which subtree should go on the left and which on the right....The algorithm used in hclust is to order the subtree so that the tighter cluster is on the left (the last, i.e., most recent, merge of the left subtree is at a lower value than the last merge of the right subtree). I would like to get a different decision algorithm, in which the decision preserves similarity between a subtree and its 'uncle' subtree - In the sense that If I merged two trees that are 'red' and 'blue', and then did another merge between 'red+blue' to 'blue', then the blue will be next to the blue. This will result in a more pleasing to the eye figure, and also will more clearly show properties of the clustering. (I know that one would hope that 'blue' would go with 'blue' to begin with, but with high-dimensional data, things are not so simple). Is there any way to achieve this?
r
cluster-analysis
null
null
null
null
open
R - hclust, and ordering the subtrees by similarity === I am using the hclust function via the heatmap.2 function to generate a dendrogram of my data. In the hclust? it says : In hierarchical cluster displays, a decision is needed at each merge to specify which subtree should go on the left and which on the right....The algorithm used in hclust is to order the subtree so that the tighter cluster is on the left (the last, i.e., most recent, merge of the left subtree is at a lower value than the last merge of the right subtree). I would like to get a different decision algorithm, in which the decision preserves similarity between a subtree and its 'uncle' subtree - In the sense that If I merged two trees that are 'red' and 'blue', and then did another merge between 'red+blue' to 'blue', then the blue will be next to the blue. This will result in a more pleasing to the eye figure, and also will more clearly show properties of the clustering. (I know that one would hope that 'blue' would go with 'blue' to begin with, but with high-dimensional data, things are not so simple). Is there any way to achieve this?
0
11,327,373
07/04/2012 10:35:38
357,261
06/03/2010 08:59:33
990
0
Why every time uploaded file count is one for this HttpFileCollection?
Though i am not uploading any file it is giving file count one. Please let me know where i am wrong. i am doing this for radupload telerik control actually the radupload count throws always 0 RadUpload1.UploadedFiles.Count that is why i had to implement the following solution HttpFileCollection hfc = Request.Files; if (hfc.Count == 0) { errMessage = "Please upload a file "; } <telerik:RadUpload ID="RadUpload1" InitialFileInputsCount="1" MaxFileInputsCount="1" Localization-Select="Browse" runat="server" TargetFolder="~/SlideImages" InputSize="42" OverwriteExistingFiles="True" Skin="Office2010Silver" controlobjectsvisibility="None" MaxFileSize="1000"> </telerik:RadUpload>
asp.net
null
null
null
null
null
open
Why every time uploaded file count is one for this HttpFileCollection? === Though i am not uploading any file it is giving file count one. Please let me know where i am wrong. i am doing this for radupload telerik control actually the radupload count throws always 0 RadUpload1.UploadedFiles.Count that is why i had to implement the following solution HttpFileCollection hfc = Request.Files; if (hfc.Count == 0) { errMessage = "Please upload a file "; } <telerik:RadUpload ID="RadUpload1" InitialFileInputsCount="1" MaxFileInputsCount="1" Localization-Select="Browse" runat="server" TargetFolder="~/SlideImages" InputSize="42" OverwriteExistingFiles="True" Skin="Office2010Silver" controlobjectsvisibility="None" MaxFileSize="1000"> </telerik:RadUpload>
0
11,327,374
07/04/2012 10:35:43
1,485,267
06/27/2012 10:09:00
1
0
Amazon Dynamodb Exception error
when we are calling dynamodb with http rest api it is giving this error <UnknownOperationException/> Can i know what is the problem? what are all the required things we need to append in the dynamodb url?? http://dynamodb.us-east-1.amazonaws.com/?aws_access_key=XXXXXXXXXXXXXXXX&aws_secret_access_key=ZZZZZZZZZZZZZZZZZZZZZZ Do we need to append anything more parameters with this url please let me know?? **http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/UsingJSON.html#JSONMajorExample**
amazon-dynamodb
null
null
null
null
null
open
Amazon Dynamodb Exception error === when we are calling dynamodb with http rest api it is giving this error <UnknownOperationException/> Can i know what is the problem? what are all the required things we need to append in the dynamodb url?? http://dynamodb.us-east-1.amazonaws.com/?aws_access_key=XXXXXXXXXXXXXXXX&aws_secret_access_key=ZZZZZZZZZZZZZZZZZZZZZZ Do we need to append anything more parameters with this url please let me know?? **http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/UsingJSON.html#JSONMajorExample**
0
11,327,375
07/04/2012 10:35:47
1,430,587
06/01/2012 11:33:35
10
0
Dragable div Jquery UI
I want to be able to drag the main wrapper by pushing the header div. The main wrapper div that i want to drag is #popupContact The header div is called #popupHeaderGradient. Now im using Jquery UI and I got it to work with $('#popupHeaderGradient').draggable(); But this only allows me to move the header element. I want it to drag the whole main wrapper by dragging on the header element. Please help!
javascript
jquery
jquery-ui
null
null
null
open
Dragable div Jquery UI === I want to be able to drag the main wrapper by pushing the header div. The main wrapper div that i want to drag is #popupContact The header div is called #popupHeaderGradient. Now im using Jquery UI and I got it to work with $('#popupHeaderGradient').draggable(); But this only allows me to move the header element. I want it to drag the whole main wrapper by dragging on the header element. Please help!
0
11,327,377
07/04/2012 10:36:03
1,014,272
10/26/2011 09:27:03
13
0
Outputting Input from Line-In Input on iOS
I have a project where I need to output through the device's speakers the input that comes in through either a line-in input, or an accessory connected to the 30-pin connector. Whilst working on the line-in input, I'm finding it hard to detect whether there is input from line-in, and how to get the input from this source and then replay the buffer through the speaker. Trying to get the property of kAudioSessionProperty_InputSource(s) for example is returning nothing.
iphone
objective-c
ios
core-audio
audiotoolbox
null
open
Outputting Input from Line-In Input on iOS === I have a project where I need to output through the device's speakers the input that comes in through either a line-in input, or an accessory connected to the 30-pin connector. Whilst working on the line-in input, I'm finding it hard to detect whether there is input from line-in, and how to get the input from this source and then replay the buffer through the speaker. Trying to get the property of kAudioSessionProperty_InputSource(s) for example is returning nothing.
0
11,443,250
07/11/2012 23:52:19
950,792
09/18/2011 00:42:40
16
2
PHP - split arrays if value 2 is higher than 1 (
I have worked hard this night to figure out how to split my arrays into a lot of arrays, defined by a value in the array I could have this value $array = array ( array ("Apple", 10), array("Ball", 5) ); Then I want Apple to have 10 arrays where the value is "Apple", and Ball to have 5 arrays where the value is "Ball" Then I came up with this, but the output seems pretty strange.. $newarray = array(); foreach($array as $val): for($i = 1; $i <= $val[1]; $i++): $newarray[$i] = $val[0]; endfor; endforeach; print_r($newarray); // Array ( [0] => Ball [1] => Ball [2] => Ball [3] => Ball [4] => Ball [5] => Ball [6] => Apple [7] => Apple [8] => Apple [9] => Apple [10] => Apple ) Hope you guys understand my question, and hope some one can figure it out. In advance, thanks.
php
arrays
splitting
null
null
null
open
PHP - split arrays if value 2 is higher than 1 ( === I have worked hard this night to figure out how to split my arrays into a lot of arrays, defined by a value in the array I could have this value $array = array ( array ("Apple", 10), array("Ball", 5) ); Then I want Apple to have 10 arrays where the value is "Apple", and Ball to have 5 arrays where the value is "Ball" Then I came up with this, but the output seems pretty strange.. $newarray = array(); foreach($array as $val): for($i = 1; $i <= $val[1]; $i++): $newarray[$i] = $val[0]; endfor; endforeach; print_r($newarray); // Array ( [0] => Ball [1] => Ball [2] => Ball [3] => Ball [4] => Ball [5] => Ball [6] => Apple [7] => Apple [8] => Apple [9] => Apple [10] => Apple ) Hope you guys understand my question, and hope some one can figure it out. In advance, thanks.
0
11,443,255
07/11/2012 23:53:08
709,537
04/15/2011 09:15:58
690
26
Accessing a RESTful service with Flash
There are a lot of blogs and questions on stackoverflow around this issue, but I could not find a definite answer to the question: Can a flash application to access a REST service be built (by some customer of my RESTful service), so that 1. at least GET, POST, PUT, DELETE requests can be issued 1. Basic authentication is possible 1. HTTPS works 1. the vast majority of currently installed flash versions will work ? In terms of 1. I read that all requests are converted to POST, but converted back to GET if there's an empty HTTP body. Regarding 2. I read that it only works for POST requests, although http://helpx.adobe.com/flash-player/kb/authorization-header-request-flash-player.html does not give that impression, at least it's quiet about that point. If 1. and/or 2. do not work, it would mean a lot of workarounds on the server side. Which has been hinted at by some of the posters on these issues, although some or all of the limitations apply only to `URLLoader`, and not to `Socket`, according to others. If that is the case, and Socket can be used by the majority of installed flash plugins out there, it seems by now there would be some library around that wraps away all the limitations and offers some `URLLoaderUnlimited` class or so.
flash
rest
basic-authentication
null
null
null
open
Accessing a RESTful service with Flash === There are a lot of blogs and questions on stackoverflow around this issue, but I could not find a definite answer to the question: Can a flash application to access a REST service be built (by some customer of my RESTful service), so that 1. at least GET, POST, PUT, DELETE requests can be issued 1. Basic authentication is possible 1. HTTPS works 1. the vast majority of currently installed flash versions will work ? In terms of 1. I read that all requests are converted to POST, but converted back to GET if there's an empty HTTP body. Regarding 2. I read that it only works for POST requests, although http://helpx.adobe.com/flash-player/kb/authorization-header-request-flash-player.html does not give that impression, at least it's quiet about that point. If 1. and/or 2. do not work, it would mean a lot of workarounds on the server side. Which has been hinted at by some of the posters on these issues, although some or all of the limitations apply only to `URLLoader`, and not to `Socket`, according to others. If that is the case, and Socket can be used by the majority of installed flash plugins out there, it seems by now there would be some library around that wraps away all the limitations and offers some `URLLoaderUnlimited` class or so.
0
11,443,262
07/11/2012 23:54:09
1,068,283
11/27/2011 20:16:07
357
11
ActionBarSherlock: java.lang.NoClassDefFoundError: com.actionbarsherlock.R$styleable
I am trying to build a tiny sample application with ActionBarSherlock 4.1 using Eclipse Indigo and ADT r20. I created a new Android project with a blank activity, copied actionbarsherlock.jar to libs and referenced it in the build path. The app builds successfully, but upon starting on either the emulator (using 2.2) or the device (using 4.0.4), it crashes with the error: java.lang.NoClassDefFoundError: com.actionbarsherlock.R$styleable at com.actionbarsherlock.view.MenuInflater$MenuState.readItem(MenuInflater.java:328) ... I am not using proguard. I have tried cleaning the ActionBarSherlock project, copying the new jar into my sample project's libs, and then cleaning my sample project. My MainActivity.java is quite simple: package com.example.lrn; import com.actionbarsherlock.app.SherlockActivity; import com.actionbarsherlock.view.Menu; import android.os.Bundle; public class MainActivity extends SherlockActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { getSupportMenuInflater().inflate(R.menu.activity_main, menu); return true; } } The menu has but a single item: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_settings" android:title="@string/menu_settings" android:orderInCategory="100" android:showAsAction="ifRoom" /> </menu> And the AndroidManifest.xml is also just about as Eclipse created it: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.lrn" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> At this point I really have no idea what I may have missed.
android
eclipse
actionbarsherlock
noclassdeffounderror
null
null
open
ActionBarSherlock: java.lang.NoClassDefFoundError: com.actionbarsherlock.R$styleable === I am trying to build a tiny sample application with ActionBarSherlock 4.1 using Eclipse Indigo and ADT r20. I created a new Android project with a blank activity, copied actionbarsherlock.jar to libs and referenced it in the build path. The app builds successfully, but upon starting on either the emulator (using 2.2) or the device (using 4.0.4), it crashes with the error: java.lang.NoClassDefFoundError: com.actionbarsherlock.R$styleable at com.actionbarsherlock.view.MenuInflater$MenuState.readItem(MenuInflater.java:328) ... I am not using proguard. I have tried cleaning the ActionBarSherlock project, copying the new jar into my sample project's libs, and then cleaning my sample project. My MainActivity.java is quite simple: package com.example.lrn; import com.actionbarsherlock.app.SherlockActivity; import com.actionbarsherlock.view.Menu; import android.os.Bundle; public class MainActivity extends SherlockActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { getSupportMenuInflater().inflate(R.menu.activity_main, menu); return true; } } The menu has but a single item: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_settings" android:title="@string/menu_settings" android:orderInCategory="100" android:showAsAction="ifRoom" /> </menu> And the AndroidManifest.xml is also just about as Eclipse created it: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.lrn" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> At this point I really have no idea what I may have missed.
0
11,594,184
07/21/2012 17:07:24
1,227,469
02/23/2012 04:44:34
87
3
Getting a list of window WIds in QT
I'm writing a library in QT which will take screenshots of arbitrary external windows. I know how to take the screenshot using `QScreen::grabWindow()`, but this takes as an argument a `WId`, and I would like to know if there is a way to get a list of `WId`s for all windows on the screen and/or desktop (or something similar, such as getting a `WId` for a specific window using a title name), via QT. I am aware that I can do this in a platform dependent way, such as `EnumWindows` in Windows, but I was hoping to keep it cross-platform within QT if possible.
c++
qt
screenshot
null
null
null
open
Getting a list of window WIds in QT === I'm writing a library in QT which will take screenshots of arbitrary external windows. I know how to take the screenshot using `QScreen::grabWindow()`, but this takes as an argument a `WId`, and I would like to know if there is a way to get a list of `WId`s for all windows on the screen and/or desktop (or something similar, such as getting a `WId` for a specific window using a title name), via QT. I am aware that I can do this in a platform dependent way, such as `EnumWindows` in Windows, but I was hoping to keep it cross-platform within QT if possible.
0
11,594,189
07/21/2012 17:07:46
1,527,429
07/15/2012 20:29:05
32
0
Magento: backup options
I have a question regarding the Magento options found under: Admin Panel -> System -> Tools -> Backups What is the difference between "System Backup", "Database and Media Backup", and "Database Backup". I think I can figure out the difference between 2 and 3, 2 being that the files from uploaded images and similar uploaded content which is not stored in the database is also backed up, but what could be the difference betweeen 1 and 2? Thanks, John Goche
magento
backup
database-backups
backup-strategies
null
null
open
Magento: backup options === I have a question regarding the Magento options found under: Admin Panel -> System -> Tools -> Backups What is the difference between "System Backup", "Database and Media Backup", and "Database Backup". I think I can figure out the difference between 2 and 3, 2 being that the files from uploaded images and similar uploaded content which is not stored in the database is also backed up, but what could be the difference betweeen 1 and 2? Thanks, John Goche
0
11,594,193
07/21/2012 17:08:15
765,357
05/23/2011 02:39:48
1,227
41
Could not locate clojure/contrib/string__init.class or clojure/contrib/string.clj on classpath
I am using a method from the contrib.string libraries but lein is having trouble finding the library. In my project.clj I have `:dependencies [[org.clojure/clojure "1.4.0"]]` inside of `defproject` and then `(use '[clojure.string :only (join)]) (use '[clojure.contrib.string :only (as-str)])` inside of `src/file.clj` Do I need to add another dependency to include contrib? I have found examples of 1.2, but there seems to have been a shift and the documentation is, well, lacking.
clojure
leiningen
null
null
null
null
open
Could not locate clojure/contrib/string__init.class or clojure/contrib/string.clj on classpath === I am using a method from the contrib.string libraries but lein is having trouble finding the library. In my project.clj I have `:dependencies [[org.clojure/clojure "1.4.0"]]` inside of `defproject` and then `(use '[clojure.string :only (join)]) (use '[clojure.contrib.string :only (as-str)])` inside of `src/file.clj` Do I need to add another dependency to include contrib? I have found examples of 1.2, but there seems to have been a shift and the documentation is, well, lacking.
0
11,594,196
07/21/2012 17:08:27
1,103,757
12/17/2011 18:09:38
17
0
Get keyboard keyPress in windows service (vb)
I am working on a windows service application that required to get the barcode reader characters and saving the value in database, I have tried some methods like this one: http://www.codeproject.com/Articles/7294/Processing-Global-Mouse-and-Keyboard-Hooks-in-C But they not working in the windows service app, does anyone knows how can I get the keyboard/barcode reader characters in the windows service? Appreciate the help in advance, Regards,
windows-services
keyboard
barcode
keypress
vb
null
open
Get keyboard keyPress in windows service (vb) === I am working on a windows service application that required to get the barcode reader characters and saving the value in database, I have tried some methods like this one: http://www.codeproject.com/Articles/7294/Processing-Global-Mouse-and-Keyboard-Hooks-in-C But they not working in the windows service app, does anyone knows how can I get the keyboard/barcode reader characters in the windows service? Appreciate the help in advance, Regards,
0
11,594,197
07/21/2012 17:08:32
1,134,200
01/06/2012 11:41:10
1
0
PHP mail form isn't carrying variables values
I have a PHP code to capture variables off of my html form and send me an email. For some reason this isn't working. <?php $nome = $_POST["nome"]; $subject = "My subject"; $email = $_POST["email"]; $headers = "From:" . $email; $mensagem = $_POST["mensagem"]; mail('[email protected]', $subject, $message, $headers); ?> It sends an email, but it doesn't carry any of the variables.IE: it shows an empty FROM)
php
null
null
null
null
null
open
PHP mail form isn't carrying variables values === I have a PHP code to capture variables off of my html form and send me an email. For some reason this isn't working. <?php $nome = $_POST["nome"]; $subject = "My subject"; $email = $_POST["email"]; $headers = "From:" . $email; $mensagem = $_POST["mensagem"]; mail('[email protected]', $subject, $message, $headers); ?> It sends an email, but it doesn't carry any of the variables.IE: it shows an empty FROM)
0
11,593,808
07/21/2012 16:15:34
1,539,099
07/19/2012 20:51:28
6
2
Rails: how to output pretty html?
I use SASS as views engine with built-in prettyfying option in `config/application.rb`: Slim::Engine.set_default_options :pretty => true Nevertheless, not only usage of `rdiscount` for posts rendering breaks all that beauty, but typical commands do that, e.g.: title = "#{t "title.main"} - #{(yield :title) || "#{t "title.default"}"}" == stylesheet_link_tag "application", :media => "all" turns into <title>Some title</title><link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" /> In additon, some examples of tags indentation: <body> <header> <h1>... </header> <div class="content"><div class="posts"><article> <div class="title"> <h3>...</h3> <h2>...</h2> </div> <div class="entry"><p>...</p> <p>...</p> </div> </article><article> <div class="title"> <h3>...</h3> <h2>...</h2> </div> <div class="entry"><p>...</p> <p>...</p> </div> </article><article> Maybe there is some `after_filter` or whatever exist to prettify `responce.body` after all? That `:pretty => true` will be disabled then because it does only a half of the work.
ruby-on-rails
ruby-on-rails-3
template-engine
null
null
null
open
Rails: how to output pretty html? === I use SASS as views engine with built-in prettyfying option in `config/application.rb`: Slim::Engine.set_default_options :pretty => true Nevertheless, not only usage of `rdiscount` for posts rendering breaks all that beauty, but typical commands do that, e.g.: title = "#{t "title.main"} - #{(yield :title) || "#{t "title.default"}"}" == stylesheet_link_tag "application", :media => "all" turns into <title>Some title</title><link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" /> In additon, some examples of tags indentation: <body> <header> <h1>... </header> <div class="content"><div class="posts"><article> <div class="title"> <h3>...</h3> <h2>...</h2> </div> <div class="entry"><p>...</p> <p>...</p> </div> </article><article> <div class="title"> <h3>...</h3> <h2>...</h2> </div> <div class="entry"><p>...</p> <p>...</p> </div> </article><article> Maybe there is some `after_filter` or whatever exist to prettify `responce.body` after all? That `:pretty => true` will be disabled then because it does only a half of the work.
0
11,594,201
07/21/2012 17:09:24
1,347,925
04/21/2012 06:08:22
1
1
How to perform data that not include in query using fusion charts free in codeigniter?
I want to perform data that have been query in my web database in codeigniter using fusion charts free,, example, i want to show data per month in a year, and in my query when i execute it the data just get january and february.. My purpose is, although march until december is not include in the query result, i still can show it in zero value,, but i don't understand how to do it ?? this is my code.. Thank You.. controller function grafikSuratMasuk() { $graph_swfFile = base_url().'public/flash/Column3D.swf' ; $graph_width = '700' ; $graph_height = '300' ; //Surat Masuk Eksternal $query_eks = $this->main_dashboard_model->getTotalSMEksPerBulanTahun(); $total_eks = count($this->main_dashboard_model->getTotalSuratMasukEksternal()); $i = 0 ; foreach ($query_eks->result() as $p) { //Konversi Nama Bulan if($p->bulan=='01'){$p->bulan='Januari';} else if($p->bulan=='02'){$p->bulan='Februari';} else if($p->bulan=='03'){$p->bulan='Maret';} else if($p->bulan=='04'){$p->bulan='April';} else if($p->bulan=='05'){$p->bulan='Mei';} else if($p->bulan=='06'){$p->bulan='Juni';} else if($p->bulan=='07'){$p->bulan='Juli';} else if($p->bulan=='08'){$p->bulan='Agustus';} else if($p->bulan=='09'){$p->bulan='September';} else if($p->bulan=='10'){$p->bulan='Oktober';} else if($p->bulan=='11'){$p->bulan='Nopember';} else {$p->bulan='Desember';} $arrData_eks[$i][1] = $p->bulan; $arrData_eks[$i][2] = (($p->total_surat_masuk_eksternal/$total_eks)*100); $i++ ; } $strXML = "<graph bgColor='999999,FFFFFF' bgAlpha='50' borderColor='E74759' borderThickness='3' borderAlpha='50' showBorder='1' labelDisplay='Stagger' staggerLines='n' borderThickness='2' borderColor='1D' bgAlpha='100,60,100' caption='' subcaption=''". "xAxisName='Bulan' yAxisName='Total Surat Masuk Eksternal(%)' outCnvBaseFont='Arial' yAxisMinValue='0' yAxisMaxValue='100' numberSuffix='%' rotateNames='0'". "formatNumberScale='0' decimalPrecision='2'>"; //Convert data to XML and append foreach ($arrData_eks as $arSubData_eks) { $strXML .= "<set name='" . $arSubData_eks[1] . "' value='" . $arSubData_eks[2] . "' color='".getFCColor()."' />"; } //Close <chart> element $strXML .= "</graph>"; $data['graph_sm_eks'] = renderChart($graph_swfFile, "surat_masuk_eksternal", $strXML, "sm_eks" , $graph_width, $graph_height,'0', '1'); $data['isicontent']='propinsi/grafik_data/grafik_surat_masuk'; $this->load->view('template/template',$data); }
php
sql
codeigniter
fusioncharts
null
null
open
How to perform data that not include in query using fusion charts free in codeigniter? === I want to perform data that have been query in my web database in codeigniter using fusion charts free,, example, i want to show data per month in a year, and in my query when i execute it the data just get january and february.. My purpose is, although march until december is not include in the query result, i still can show it in zero value,, but i don't understand how to do it ?? this is my code.. Thank You.. controller function grafikSuratMasuk() { $graph_swfFile = base_url().'public/flash/Column3D.swf' ; $graph_width = '700' ; $graph_height = '300' ; //Surat Masuk Eksternal $query_eks = $this->main_dashboard_model->getTotalSMEksPerBulanTahun(); $total_eks = count($this->main_dashboard_model->getTotalSuratMasukEksternal()); $i = 0 ; foreach ($query_eks->result() as $p) { //Konversi Nama Bulan if($p->bulan=='01'){$p->bulan='Januari';} else if($p->bulan=='02'){$p->bulan='Februari';} else if($p->bulan=='03'){$p->bulan='Maret';} else if($p->bulan=='04'){$p->bulan='April';} else if($p->bulan=='05'){$p->bulan='Mei';} else if($p->bulan=='06'){$p->bulan='Juni';} else if($p->bulan=='07'){$p->bulan='Juli';} else if($p->bulan=='08'){$p->bulan='Agustus';} else if($p->bulan=='09'){$p->bulan='September';} else if($p->bulan=='10'){$p->bulan='Oktober';} else if($p->bulan=='11'){$p->bulan='Nopember';} else {$p->bulan='Desember';} $arrData_eks[$i][1] = $p->bulan; $arrData_eks[$i][2] = (($p->total_surat_masuk_eksternal/$total_eks)*100); $i++ ; } $strXML = "<graph bgColor='999999,FFFFFF' bgAlpha='50' borderColor='E74759' borderThickness='3' borderAlpha='50' showBorder='1' labelDisplay='Stagger' staggerLines='n' borderThickness='2' borderColor='1D' bgAlpha='100,60,100' caption='' subcaption=''". "xAxisName='Bulan' yAxisName='Total Surat Masuk Eksternal(%)' outCnvBaseFont='Arial' yAxisMinValue='0' yAxisMaxValue='100' numberSuffix='%' rotateNames='0'". "formatNumberScale='0' decimalPrecision='2'>"; //Convert data to XML and append foreach ($arrData_eks as $arSubData_eks) { $strXML .= "<set name='" . $arSubData_eks[1] . "' value='" . $arSubData_eks[2] . "' color='".getFCColor()."' />"; } //Close <chart> element $strXML .= "</graph>"; $data['graph_sm_eks'] = renderChart($graph_swfFile, "surat_masuk_eksternal", $strXML, "sm_eks" , $graph_width, $graph_height,'0', '1'); $data['isicontent']='propinsi/grafik_data/grafik_surat_masuk'; $this->load->view('template/template',$data); }
0
11,594,205
07/21/2012 17:10:03
1,229,087
02/23/2012 18:20:55
1
0
accordion jumpy webkit bug
Using CSS transitions to animate a accordion list results in a jumpy behavior in WebKit browsers (Chrome 20, Safari 5) as you can see in this JSFiddle: http://jsfiddle.net/Qp5Jn/2/ When switching from one hovered element to another the element(s) below jump up 1px on transition start and down again afterwards. Seems like the two transitions are not triggered at the same time. <ul> <li>One</li> <li>Two</li> <li>Three</li> </ul> <style> li { height: 30px; border: 1px solid red; -webkit-transition: height 0.5s ease-in; -moz-transition: height 0.5s ease-in; } li:hover { height: 100px; }​ </style> In other browsers everything works fine (even Internet Explorer).
javascript
css
webkit
transition
null
null
open
accordion jumpy webkit bug === Using CSS transitions to animate a accordion list results in a jumpy behavior in WebKit browsers (Chrome 20, Safari 5) as you can see in this JSFiddle: http://jsfiddle.net/Qp5Jn/2/ When switching from one hovered element to another the element(s) below jump up 1px on transition start and down again afterwards. Seems like the two transitions are not triggered at the same time. <ul> <li>One</li> <li>Two</li> <li>Three</li> </ul> <style> li { height: 30px; border: 1px solid red; -webkit-transition: height 0.5s ease-in; -moz-transition: height 0.5s ease-in; } li:hover { height: 100px; }​ </style> In other browsers everything works fine (even Internet Explorer).
0
11,401,092
07/09/2012 18:41:35
1,333,876
04/14/2012 22:51:07
9
0
Cache.Get always returns null
I am experimenting with caching data and keep failing. As you can see in the code below, I call upon a web service to return an array called 'categories'. This call is successful and I get information back. Right after populating the dropdown list with the results, I use an Insert to store the information to cache. Upon page refresh (I guess I should say anything other than a postback), I check the cache to see if the information is there. It never is. Scratching my head on this one... if (! IsPostBack) { //See if the results have been cached. With arrays and checking for null, you have to //check the array itself before its elements can be checked. string[] saveCatList = Cache.Get("Categories" + Session["sessionID"]) as string[]; if (saveCatList == null || string.IsNullOrEmpty(saveCatList[0])) { WBDEMOReference.getcatlist_itemcategories[] categories; strResult = callWebServ.getcatlist(Session["sessionID"].ToString(), out strResultText, out dNumOfCat, out categories); for (int i = 0; i < categories.Length; i++) { //ddCat is the ID number of the category drop down list ddCat.Items.Add(new ListItem(categories[i].categorydesc.ToString(), categories[i].categorynumber.ToString())); } //Store the array into cache. 'Cache.Remove' will remove the cache for that key Cache.Insert("Categories" + Session["sessionID"], categories, null, DateTime.Now.AddMinutes(5), System.Web.Caching.Cache.NoSlidingExpiration); } }
c#
null
null
null
null
null
open
Cache.Get always returns null === I am experimenting with caching data and keep failing. As you can see in the code below, I call upon a web service to return an array called 'categories'. This call is successful and I get information back. Right after populating the dropdown list with the results, I use an Insert to store the information to cache. Upon page refresh (I guess I should say anything other than a postback), I check the cache to see if the information is there. It never is. Scratching my head on this one... if (! IsPostBack) { //See if the results have been cached. With arrays and checking for null, you have to //check the array itself before its elements can be checked. string[] saveCatList = Cache.Get("Categories" + Session["sessionID"]) as string[]; if (saveCatList == null || string.IsNullOrEmpty(saveCatList[0])) { WBDEMOReference.getcatlist_itemcategories[] categories; strResult = callWebServ.getcatlist(Session["sessionID"].ToString(), out strResultText, out dNumOfCat, out categories); for (int i = 0; i < categories.Length; i++) { //ddCat is the ID number of the category drop down list ddCat.Items.Add(new ListItem(categories[i].categorydesc.ToString(), categories[i].categorynumber.ToString())); } //Store the array into cache. 'Cache.Remove' will remove the cache for that key Cache.Insert("Categories" + Session["sessionID"], categories, null, DateTime.Now.AddMinutes(5), System.Web.Caching.Cache.NoSlidingExpiration); } }
0
11,401,095
07/09/2012 18:41:54
1,512,821
07/09/2012 18:29:34
1
0
using union in c
I'm trying to understand/use union in c in linux environment, suppose I have the following union union test { int one; long two; } so If I'm going to write test.one to network fd then extra zeros will be written to the fd as the union chose the biggest one which is two, can some one please show me how to overcome this? and i can get even worse with union of structures. appreciate your help
c
union
null
null
null
null
open
using union in c === I'm trying to understand/use union in c in linux environment, suppose I have the following union union test { int one; long two; } so If I'm going to write test.one to network fd then extra zeros will be written to the fd as the union chose the biggest one which is two, can some one please show me how to overcome this? and i can get even worse with union of structures. appreciate your help
0
11,401,058
07/09/2012 18:39:08
834,925
07/08/2011 07:19:22
1,032
46
how to distinguish items when the array is a combination of two arrays?
I have an Iphone application in which i am trying to load the two arrays in to the same table.for that i combined two arrays and make another array.and load it from that array.that is working fine.My problem i need to make different cell images for these two array items.and also the detail text label is defferent for ` NSMutableArray *dataArray=[[NSMutableArray alloc] init]; NSMutableArray *dataArray1=[[NSMutableArray alloc] init]; NSDictionary *news=[dict objectForKey:@"news"]; NSDictionary *deals=[dict objectForKey:@"deals"]; NSLog(@"%@",[news classForCoder]); NSLog(@"%@",news); for(NSDictionary *key in news) { if([key isKindOfClass:[NSDictionary class]]) { [dataArray addObject:key]; } } for(NSDictionary *key in deals) { if([key isKindOfClass:[NSDictionary class]]) { [dataArray1 addObject:key]; } } self.newsarray = [[dataArray arrayByAddingObjectsFromArray:dataArray1] mutableCopy]; self.newssarray=dataArray; [self.mTableView reloadData]; ` i need to change the cell image for the array elements from the two arrays.if the element is from first then the cell image is this else the other?can anybody show me the code snippet to achieve that?
iphone
ios
ipad
null
null
null
open
how to distinguish items when the array is a combination of two arrays? === I have an Iphone application in which i am trying to load the two arrays in to the same table.for that i combined two arrays and make another array.and load it from that array.that is working fine.My problem i need to make different cell images for these two array items.and also the detail text label is defferent for ` NSMutableArray *dataArray=[[NSMutableArray alloc] init]; NSMutableArray *dataArray1=[[NSMutableArray alloc] init]; NSDictionary *news=[dict objectForKey:@"news"]; NSDictionary *deals=[dict objectForKey:@"deals"]; NSLog(@"%@",[news classForCoder]); NSLog(@"%@",news); for(NSDictionary *key in news) { if([key isKindOfClass:[NSDictionary class]]) { [dataArray addObject:key]; } } for(NSDictionary *key in deals) { if([key isKindOfClass:[NSDictionary class]]) { [dataArray1 addObject:key]; } } self.newsarray = [[dataArray arrayByAddingObjectsFromArray:dataArray1] mutableCopy]; self.newssarray=dataArray; [self.mTableView reloadData]; ` i need to change the cell image for the array elements from the two arrays.if the element is from first then the cell image is this else the other?can anybody show me the code snippet to achieve that?
0
11,401,098
07/09/2012 18:42:18
841,714
07/12/2011 22:50:21
71
1
How do I properly terminate a MonoTouch application?
I am using the following code, but even after I call it, my app is still in the iOS task manager (double-click on the Home button). UIApplication.SharedApplication.PerformSelector(new MonoTouch.ObjCRuntime.Selector("terminateWithSuccess"), null, 0f); When I delete the app from the task manager (hold on app in the task manager for 2-seconds then press the red minus sign), it disappears from the task manager as it should. If I terminate it using the code above, why is it still in the task manager? How do I programmatically kill it hard so that it disappears from the task manager?
monotouch
terminate
null
null
null
null
open
How do I properly terminate a MonoTouch application? === I am using the following code, but even after I call it, my app is still in the iOS task manager (double-click on the Home button). UIApplication.SharedApplication.PerformSelector(new MonoTouch.ObjCRuntime.Selector("terminateWithSuccess"), null, 0f); When I delete the app from the task manager (hold on app in the task manager for 2-seconds then press the red minus sign), it disappears from the task manager as it should. If I terminate it using the code above, why is it still in the task manager? How do I programmatically kill it hard so that it disappears from the task manager?
0
11,401,099
07/09/2012 18:42:19
944,131
09/14/2011 08:12:39
665
44
Java-Gearman-Service - Handle GearmanJobEventCallback<T>::onEvent and byte[] in GearmanFunction
i'm using Gearman to distribute different tasks and therefore i'm using [java-gearman-service][1] for implementing clients and workers. however, i'm not able to figure out the data i receive in - [`GearmanJobEventCallback<T>::onEvent`][2] and - [`GearmanFunction::work`][3] `GearmanJobEventCallback<T>::onEvent`: how can i convert the `event.getData()` byte array to the data i need? e.g. status or returned data? when i send status(3,10) it returns a byte array [51,0,49,48] - well that's not very useful to my client. unserializing with ObjectInputStream doesn't seem to be successful. Same with the returned data of the work method, how can i "decode" that? how can i "decode" the `data` argument (byte array) from the `work` method in `GearmanFunction` ? Any input will be greatly appreciated! [1]: http://java-gearman-service.googlecode.com/ [2]: http://java-gearman-service.googlecode.com/svn/javadoc/org/gearman/GearmanJobEventCallback.html#onEvent%28A,%20org.gearman.GearmanJobEvent%29 [3]: http://java-gearman-service.googlecode.com/svn/javadoc/org/gearman/GearmanFunction.html#work%28java.lang.String,%20byte%5B%5D,%20org.gearman.GearmanFunctionCallback%29
java
callback
client
gearman
worker
null
open
Java-Gearman-Service - Handle GearmanJobEventCallback<T>::onEvent and byte[] in GearmanFunction === i'm using Gearman to distribute different tasks and therefore i'm using [java-gearman-service][1] for implementing clients and workers. however, i'm not able to figure out the data i receive in - [`GearmanJobEventCallback<T>::onEvent`][2] and - [`GearmanFunction::work`][3] `GearmanJobEventCallback<T>::onEvent`: how can i convert the `event.getData()` byte array to the data i need? e.g. status or returned data? when i send status(3,10) it returns a byte array [51,0,49,48] - well that's not very useful to my client. unserializing with ObjectInputStream doesn't seem to be successful. Same with the returned data of the work method, how can i "decode" that? how can i "decode" the `data` argument (byte array) from the `work` method in `GearmanFunction` ? Any input will be greatly appreciated! [1]: http://java-gearman-service.googlecode.com/ [2]: http://java-gearman-service.googlecode.com/svn/javadoc/org/gearman/GearmanJobEventCallback.html#onEvent%28A,%20org.gearman.GearmanJobEvent%29 [3]: http://java-gearman-service.googlecode.com/svn/javadoc/org/gearman/GearmanFunction.html#work%28java.lang.String,%20byte%5B%5D,%20org.gearman.GearmanFunctionCallback%29
0
11,401,101
07/09/2012 18:42:25
1,186,009
02/02/2012 19:46:14
313
0
Missing Index - Non-clustered index from Execution Plan SQL Server 2008
![enter image description here][1] [1]: http://i.stack.imgur.com/ce315.jpg As you can see I have a three-field foreign key on my tblClaims` table. The `id` of this table is a sequential integer. When running a particular query I noticed that the query too far too long to run. So I included the execution plan and was told that `missing index: create nonclustered index on patientid, admissiondate, dischargedate` I'm tempted to do <br/> `create nonclustered index ix_tblClaims on tblClaims (patientID asc, admissiondate asc, dischargedate asc)` I've read some stuff here and there about multi-column indexes or indexing each column differently. Is it correct that only one index will be used if I follow the indexing each column separately method?
sql-server
sql-server-2008
indexing
null
null
null
open
Missing Index - Non-clustered index from Execution Plan SQL Server 2008 === ![enter image description here][1] [1]: http://i.stack.imgur.com/ce315.jpg As you can see I have a three-field foreign key on my tblClaims` table. The `id` of this table is a sequential integer. When running a particular query I noticed that the query too far too long to run. So I included the execution plan and was told that `missing index: create nonclustered index on patientid, admissiondate, dischargedate` I'm tempted to do <br/> `create nonclustered index ix_tblClaims on tblClaims (patientID asc, admissiondate asc, dischargedate asc)` I've read some stuff here and there about multi-column indexes or indexing each column differently. Is it correct that only one index will be used if I follow the indexing each column separately method?
0
11,401,108
07/09/2012 18:42:56
48,611
12/23/2008 11:04:56
862
30
Can I use Facebook OAuth to secure my RESTful web service?
I'm writing a mobile phone app that allows users to register via Facebook. Once registered, users can then access personalised information via a RESTful web service I will host. I've seen various mobile apps that appear to use a similar set-up but only present Facebook (or Twitter) OAuth authentication to their users. I'm wondering how this is done? I thought that, to secure this web service, I could use HTTP Basic authentication over HTTPS with the user's Facebook OAuth access token as their password. Is this secure? How do other apps handle security when they only register users via Facebook?
web-services
security
rest
mobile
oauth
null
open
Can I use Facebook OAuth to secure my RESTful web service? === I'm writing a mobile phone app that allows users to register via Facebook. Once registered, users can then access personalised information via a RESTful web service I will host. I've seen various mobile apps that appear to use a similar set-up but only present Facebook (or Twitter) OAuth authentication to their users. I'm wondering how this is done? I thought that, to secure this web service, I could use HTTP Basic authentication over HTTPS with the user's Facebook OAuth access token as their password. Is this secure? How do other apps handle security when they only register users via Facebook?
0
11,401,109
07/09/2012 18:43:05
1,396,114
05/15/2012 12:09:23
11
0
After compile cvblob library there was an error when in execution
I had a problem, i try to build cvblobslib with visual studio ultimate 2010 (windows 7), in compiling there is no errors but in execution i have the error: "unable to start program visual c++ c:\\debug\cvblobslib.lib the specified file is an unreconized or unsupported binary format" can you help me?
visual-studio-2010
image-processing
opencv
null
null
null
open
After compile cvblob library there was an error when in execution === I had a problem, i try to build cvblobslib with visual studio ultimate 2010 (windows 7), in compiling there is no errors but in execution i have the error: "unable to start program visual c++ c:\\debug\cvblobslib.lib the specified file is an unreconized or unsupported binary format" can you help me?
0
11,401,110
07/09/2012 18:43:11
1,207,827
02/13/2012 21:46:57
8
0
How do I clear a column name in datagridview
I am naming each column in a datagridview using a right-click menu with all the names the user can use. As each name is used, I have disabled the right-click menu item for each name as it is selected so that the user cannot name two columns the same. To do this, I am using a simple if statement to see if that column name exists: if (MyDataGridView.Columns["ColName"] != null) { ColName.Enabled = false; } However, if the user wants to re-name a column, I am having trouble "un-naming" the column, as the above if statement returns true for both names after I re-name the column. **Is there a way to clear a column name so that a column doesn't have multiple names associated with it?**
c#
datagridview
columnname
null
null
null
open
How do I clear a column name in datagridview === I am naming each column in a datagridview using a right-click menu with all the names the user can use. As each name is used, I have disabled the right-click menu item for each name as it is selected so that the user cannot name two columns the same. To do this, I am using a simple if statement to see if that column name exists: if (MyDataGridView.Columns["ColName"] != null) { ColName.Enabled = false; } However, if the user wants to re-name a column, I am having trouble "un-naming" the column, as the above if statement returns true for both names after I re-name the column. **Is there a way to clear a column name so that a column doesn't have multiple names associated with it?**
0
11,401,111
07/09/2012 18:43:15
547,794
12/19/2010 16:18:00
730
12
Using Partial View on 2 Differently Typed Views
I have a Partial view that I would like to use on 2 different Stronly-Typed views. The data being passed is just a simple ID integer, but when I try to render the data on View #2 I get an "The model item passed into the dictionary is of type `'CMESurvey.ViewModels.SurveyParticipantViewModel'`, but this dictionary requires a model item of type `'CMESurvey.Models.SurveyProgramModel'`. Here is the partial view code that errors: @Html.Partial("SurveyProgramSubNav", new {ProgramId = Model.ProgramId}) This code is in a differently strong typed from my Partial View Strong Type: @model CMESurvey.Models.SurveyProgramModel for the partial view, and: @model CMESurvey.ViewModels.SurveyParticipantViewModel For the view that I'm having trouble with. Any help is appreciated.
c#
asp.net-mvc-3
entity-framework
razor
null
null
open
Using Partial View on 2 Differently Typed Views === I have a Partial view that I would like to use on 2 different Stronly-Typed views. The data being passed is just a simple ID integer, but when I try to render the data on View #2 I get an "The model item passed into the dictionary is of type `'CMESurvey.ViewModels.SurveyParticipantViewModel'`, but this dictionary requires a model item of type `'CMESurvey.Models.SurveyProgramModel'`. Here is the partial view code that errors: @Html.Partial("SurveyProgramSubNav", new {ProgramId = Model.ProgramId}) This code is in a differently strong typed from my Partial View Strong Type: @model CMESurvey.Models.SurveyProgramModel for the partial view, and: @model CMESurvey.ViewModels.SurveyParticipantViewModel For the view that I'm having trouble with. Any help is appreciated.
0
11,401,112
07/09/2012 18:43:15
734,895
05/02/2011 18:11:12
70
1
Radio Buttons in IE performing change functions, but not showing up as checked jquery
I am adding/removing classes based on whether or not something is checked, and it works fine in firefox, but IE will not show the value of the checkboxes. The change/click events fire, but the radio button doesn't actually show the selection, and this causes the validation to fail. Any idea what is happening? Here is the code for the js function that changes the css: function CheckHandlingUnit() { var flag = true; //Material Number if ($("#ContentPlaceHolder2_MatNum_TB").val() == "") { $("#ContentPlaceHolder2_MatNum_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_MatNum_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_MatNum_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_MatNum_TB").removeClass("TBDecoRed"); } //Description if ($("#ContentPlaceHolder2_Des_TB").val() == "") { $("#ContentPlaceHolder2_Des_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_Des_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_Des_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_Des_TB").removeClass("TBDecoRed"); } //Material Type if ($("#ContentPlaceHolder2_MatType_DD").val() == "1") { $("#ContentPlaceHolder2_MatType_DD").addClass("TBDecoRed"); $("#ContentPlaceHolder2_MatType_DD").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_MatType_DD").addClass("TBDecoNone"); $("#ContentPlaceHolder2_MatType_DD").removeClass("TBDecoRed"); } //Inventory Classification if ($("#ContentPlaceHolder2_Inv_DD").val() == "1") { $("#ContentPlaceHolder2_Inv_DD").addClass("TBDecoRed"); $("#ContentPlaceHolder2_Inv_DD").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_Inv_DD").addClass("TBDecoNone"); $("#ContentPlaceHolder2_Inv_DD").removeClass("TBDecoRed"); } //Shelf Life if ($("#ContentPlaceHolder2_SLife_TB").val() == "" && !$("#ContentPlaceHolder2_Unlimit_CB").is(":checked")) { $("#ContentPlaceHolder2_SLife_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_SLife_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_SLife_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_SLife_TB").removeClass("TBDecoRed"); } //Charge Number if ($("#ContentPlaceHolder2_Charge_TB").val() == "") { $("#ContentPlaceHolder2_Charge_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_Charge_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_Charge_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_Charge_TB").removeClass("TBDecoRed"); } //Quantity if ($("#ContentPlaceHolder2_Quan_TB").val() == "") { $("#ContentPlaceHolder2_Quan_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_Quan_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_Quan_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_Quan_TB").removeClass("TBDecoRed"); } //Serialized Radio Button if (!($("#ContentPlaceHolder2_Seri_RB_0").is(':checked')) && !($("#ContentPlaceHolder2_Seri_RB_1").is(':checked'))) { $("#seriVal").show(); flag = false; } else { $("#seriVal").hide(); } //Moisture Sensitive Radio Button if (!($("#ContentPlaceHolder2_Moist_RB_0").is(':checked')) && !($("#ContentPlaceHolder2_Moist_RB_1").is(':checked'))) { $("#moistureVal").show(); flag = false; } else { $("#moistureVal").hide(); } //Hazardous Radio Button if (!($("#ContentPlaceHolder2_Haz_RB_0").is(':checked')) && !($("#ContentPlaceHolder2_Haz_RB_1").is(':checked'))) { $("#hazardVal").show(); flag = false; } else { $("#hazardVal").hide(); } //Packaging Requirement if (!$("#ContentPlaceHolder2_PackingReq_CBL_0").is(':checked') && !$("#ContentPlaceHolder2_PackingReq_CBL_1").is(':checked') && !$("#ContentPlaceHolder2_PackingReq_CBL_2").is(':checked') && !$("#ContentPlaceHolder2_PackingReq_CBL_3").is(':checked') && !$("#ContentPlaceHolder2_PackingReq_CBL_4").is(':checked')) { $("#packageVal").show(); flag = false; } else{ $("#packageVal").hide(); } //package Other if ($("#ContentPlaceHolder2_PackingReq_CBL_2").is(':checked') && $("#ContentPlaceHolder2_OtherPkgRequirent_TB").val() == "") { $("#ContentPlaceHolder2_OtherPkgRequirent_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_OtherPkgRequirent_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_OtherPkgRequirent_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_OtherPkgRequirent_TB").removeClass("TBDecoRed"); } //Hazardous Material if ($("#ContentPlaceHolder2_Haz_RB_0").is(':checked') && $("#ContentPlaceHolder2_MSDS_TB").val() == "") { $("#ContentPlaceHolder2_MSDS_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_MSDS_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_MSDS_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_MSDS_TB").removeClass("TBDecoRed"); } //File upload if ($("#ContentPlaceHolder2_Haz_RB_0").is(':checked') && $("#ContentPlaceHolder2_MSDSFileUpload").val() == "") { flag = false; $("#ContentPlaceHolder2_MSDSFileUpload").addClass("FileUploadRed"); $("#ContentPlaceHolder2_MSDSFileUpload").removeClass("TBDecoNone"); } else { $("#ContentPlaceHolder2_MSDSFileUpload").addClass("TBDecoNone"); $("#ContentPlaceHolder2_MSDSFileUpload").removeClass("FileUploadRed"); } return flag; }
javascript
jquery
internet-explorer
null
null
null
open
Radio Buttons in IE performing change functions, but not showing up as checked jquery === I am adding/removing classes based on whether or not something is checked, and it works fine in firefox, but IE will not show the value of the checkboxes. The change/click events fire, but the radio button doesn't actually show the selection, and this causes the validation to fail. Any idea what is happening? Here is the code for the js function that changes the css: function CheckHandlingUnit() { var flag = true; //Material Number if ($("#ContentPlaceHolder2_MatNum_TB").val() == "") { $("#ContentPlaceHolder2_MatNum_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_MatNum_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_MatNum_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_MatNum_TB").removeClass("TBDecoRed"); } //Description if ($("#ContentPlaceHolder2_Des_TB").val() == "") { $("#ContentPlaceHolder2_Des_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_Des_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_Des_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_Des_TB").removeClass("TBDecoRed"); } //Material Type if ($("#ContentPlaceHolder2_MatType_DD").val() == "1") { $("#ContentPlaceHolder2_MatType_DD").addClass("TBDecoRed"); $("#ContentPlaceHolder2_MatType_DD").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_MatType_DD").addClass("TBDecoNone"); $("#ContentPlaceHolder2_MatType_DD").removeClass("TBDecoRed"); } //Inventory Classification if ($("#ContentPlaceHolder2_Inv_DD").val() == "1") { $("#ContentPlaceHolder2_Inv_DD").addClass("TBDecoRed"); $("#ContentPlaceHolder2_Inv_DD").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_Inv_DD").addClass("TBDecoNone"); $("#ContentPlaceHolder2_Inv_DD").removeClass("TBDecoRed"); } //Shelf Life if ($("#ContentPlaceHolder2_SLife_TB").val() == "" && !$("#ContentPlaceHolder2_Unlimit_CB").is(":checked")) { $("#ContentPlaceHolder2_SLife_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_SLife_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_SLife_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_SLife_TB").removeClass("TBDecoRed"); } //Charge Number if ($("#ContentPlaceHolder2_Charge_TB").val() == "") { $("#ContentPlaceHolder2_Charge_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_Charge_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_Charge_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_Charge_TB").removeClass("TBDecoRed"); } //Quantity if ($("#ContentPlaceHolder2_Quan_TB").val() == "") { $("#ContentPlaceHolder2_Quan_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_Quan_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_Quan_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_Quan_TB").removeClass("TBDecoRed"); } //Serialized Radio Button if (!($("#ContentPlaceHolder2_Seri_RB_0").is(':checked')) && !($("#ContentPlaceHolder2_Seri_RB_1").is(':checked'))) { $("#seriVal").show(); flag = false; } else { $("#seriVal").hide(); } //Moisture Sensitive Radio Button if (!($("#ContentPlaceHolder2_Moist_RB_0").is(':checked')) && !($("#ContentPlaceHolder2_Moist_RB_1").is(':checked'))) { $("#moistureVal").show(); flag = false; } else { $("#moistureVal").hide(); } //Hazardous Radio Button if (!($("#ContentPlaceHolder2_Haz_RB_0").is(':checked')) && !($("#ContentPlaceHolder2_Haz_RB_1").is(':checked'))) { $("#hazardVal").show(); flag = false; } else { $("#hazardVal").hide(); } //Packaging Requirement if (!$("#ContentPlaceHolder2_PackingReq_CBL_0").is(':checked') && !$("#ContentPlaceHolder2_PackingReq_CBL_1").is(':checked') && !$("#ContentPlaceHolder2_PackingReq_CBL_2").is(':checked') && !$("#ContentPlaceHolder2_PackingReq_CBL_3").is(':checked') && !$("#ContentPlaceHolder2_PackingReq_CBL_4").is(':checked')) { $("#packageVal").show(); flag = false; } else{ $("#packageVal").hide(); } //package Other if ($("#ContentPlaceHolder2_PackingReq_CBL_2").is(':checked') && $("#ContentPlaceHolder2_OtherPkgRequirent_TB").val() == "") { $("#ContentPlaceHolder2_OtherPkgRequirent_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_OtherPkgRequirent_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_OtherPkgRequirent_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_OtherPkgRequirent_TB").removeClass("TBDecoRed"); } //Hazardous Material if ($("#ContentPlaceHolder2_Haz_RB_0").is(':checked') && $("#ContentPlaceHolder2_MSDS_TB").val() == "") { $("#ContentPlaceHolder2_MSDS_TB").addClass("TBDecoRed"); $("#ContentPlaceHolder2_MSDS_TB").removeClass("TBDecoNone"); flag = false; } else { $("#ContentPlaceHolder2_MSDS_TB").addClass("TBDecoNone"); $("#ContentPlaceHolder2_MSDS_TB").removeClass("TBDecoRed"); } //File upload if ($("#ContentPlaceHolder2_Haz_RB_0").is(':checked') && $("#ContentPlaceHolder2_MSDSFileUpload").val() == "") { flag = false; $("#ContentPlaceHolder2_MSDSFileUpload").addClass("FileUploadRed"); $("#ContentPlaceHolder2_MSDSFileUpload").removeClass("TBDecoNone"); } else { $("#ContentPlaceHolder2_MSDSFileUpload").addClass("TBDecoNone"); $("#ContentPlaceHolder2_MSDSFileUpload").removeClass("FileUploadRed"); } return flag; }
0
11,401,113
07/09/2012 18:43:15
1,325,849
04/11/2012 06:46:04
139
14
Java - Synchronized Object/Block
I am looking for clarification about synchronized blocks. Consider this class - public class A{ Map map; public getValue(String key){ return map.get(key); } public remove(String key){ synchronized(map){ map.remove(key); } } } A is a singleton. getValue is heavily accessed throughout the app by multiple threads. I am adding a new method, remove, that removes a key from the map. If remove is implemented as above, 1. When a thread is in the synchronized block of the remove method, I assume it will acquire a lock on the map object. Does that mean other threads trying to access the map via the getValue method will be blocked? (I'd like them to.) 2. When no thread is in the synchronized block of remove method, will threads accessing the getValue method function as usual i.e. not block each other? (I'd like that too). I want the getValue threads to block only if there is a thread performing the remove operation.
java
synchronization
null
null
null
null
open
Java - Synchronized Object/Block === I am looking for clarification about synchronized blocks. Consider this class - public class A{ Map map; public getValue(String key){ return map.get(key); } public remove(String key){ synchronized(map){ map.remove(key); } } } A is a singleton. getValue is heavily accessed throughout the app by multiple threads. I am adding a new method, remove, that removes a key from the map. If remove is implemented as above, 1. When a thread is in the synchronized block of the remove method, I assume it will acquire a lock on the map object. Does that mean other threads trying to access the map via the getValue method will be blocked? (I'd like them to.) 2. When no thread is in the synchronized block of remove method, will threads accessing the getValue method function as usual i.e. not block each other? (I'd like that too). I want the getValue threads to block only if there is a thread performing the remove operation.
0
11,401,114
07/09/2012 18:43:17
1,205,914
02/13/2012 02:16:32
86
2
Servlets not being included in the maven project
Can some one help me with this problem. jetty is not able to find my servlet. :( I am getting the following error- ![enter image description here][1] This is my directory structure - ![enter image description here][2] This is my Web.xml - <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> <servlet> <servlet-name>loginSer</servlet-name> <display-name>loginSer</display-name> <description></description> <servlet-class>launchpad.servlets.loginSer</servlet-class> </servlet> <servlet-mapping> <servlet-name>loginSer</servlet-name> <url-pattern>/loginSer</url-pattern> </servlet-mapping> </web-app> [1]: http://i.stack.imgur.com/EUnaJ.png [2]: http://i.stack.imgur.com/udHTJ.png
java
jsp
servlets
maven
jetty
null
open
Servlets not being included in the maven project === Can some one help me with this problem. jetty is not able to find my servlet. :( I am getting the following error- ![enter image description here][1] This is my directory structure - ![enter image description here][2] This is my Web.xml - <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> <servlet> <servlet-name>loginSer</servlet-name> <display-name>loginSer</display-name> <description></description> <servlet-class>launchpad.servlets.loginSer</servlet-class> </servlet> <servlet-mapping> <servlet-name>loginSer</servlet-name> <url-pattern>/loginSer</url-pattern> </servlet-mapping> </web-app> [1]: http://i.stack.imgur.com/EUnaJ.png [2]: http://i.stack.imgur.com/udHTJ.png
0
11,401,115
07/09/2012 18:43:27
1,052,979
11/18/2011 02:00:36
16
2
Displaying a video stream in QLabel with PySide
Can anybody point me in the right direction on how to create a new QMovie "provider" in PySide? I have a video stream that I want to display as simply as possible (no audio, just a sequence of frames with an unknown and variable framerate). This example (http://qt.gitorious.org/pyside/pysid...movie/movie.py) seems perfect except that my video is coming from an unconventional source. It's not a file but a network stream in a format that is not standardized. I can easily write code that receives each frame and my idea is to create a "QMovie provider" so that I can just display this stream on a label like in the example above. My first thought was to just subclass QMovie and overwrite a few functions there but I started having second thoughts about that when reading the documentation (http://www.pyside.org/docs/pyside/Py...e.QtGui.QMovie) since I don't know what I should do about the "device" my instance would be reading from. I noticed in the aforementioned documentation that QMovie uses QImageReader so my next thought was to extend that class and have it read frames from my stream. That poses similar questions however, for example, what should I do with the "supportedImageFormats()" function? I've been experimenting with just directly updating the image on my QLabel every time I receive a new frame but then I've been getting the error "QPixmap: It is not safe to use pixmaps outside the GUI thread". So basically I'm a little stumped and would really appreciate any pointers or tutorials on how to get a QLabel to display my video stream in a PySide application. Kind regards, Stefan Freyr.
python
pyqt
pyside
qpixmap
qlabel
null
open
Displaying a video stream in QLabel with PySide === Can anybody point me in the right direction on how to create a new QMovie "provider" in PySide? I have a video stream that I want to display as simply as possible (no audio, just a sequence of frames with an unknown and variable framerate). This example (http://qt.gitorious.org/pyside/pysid...movie/movie.py) seems perfect except that my video is coming from an unconventional source. It's not a file but a network stream in a format that is not standardized. I can easily write code that receives each frame and my idea is to create a "QMovie provider" so that I can just display this stream on a label like in the example above. My first thought was to just subclass QMovie and overwrite a few functions there but I started having second thoughts about that when reading the documentation (http://www.pyside.org/docs/pyside/Py...e.QtGui.QMovie) since I don't know what I should do about the "device" my instance would be reading from. I noticed in the aforementioned documentation that QMovie uses QImageReader so my next thought was to extend that class and have it read frames from my stream. That poses similar questions however, for example, what should I do with the "supportedImageFormats()" function? I've been experimenting with just directly updating the image on my QLabel every time I receive a new frame but then I've been getting the error "QPixmap: It is not safe to use pixmaps outside the GUI thread". So basically I'm a little stumped and would really appreciate any pointers or tutorials on how to get a QLabel to display my video stream in a PySide application. Kind regards, Stefan Freyr.
0
11,401,116
07/09/2012 18:43:32
1,486,911
06/27/2012 21:05:38
38
4
Creating a log view for application status
I would like to add a view to my app for data logging, where my application would write a log of all of its activities. Is there a built-in function for this? Or should I just create a UITextView and output all of my info there ? Thanks
objective-c
logging
null
null
null
null
open
Creating a log view for application status === I would like to add a view to my app for data logging, where my application would write a log of all of its activities. Is there a built-in function for this? Or should I just create a UITextView and output all of my info there ? Thanks
0
11,401,117
07/09/2012 18:43:51
1,016,958
10/27/2011 16:48:40
44
1
Rails: mass assignment false negative and redirection
Based on a previous Q&A on StackOverlfow, I added the following to application.rb: config.active_record.whitelist_attributes = false as I was getting errors of the type Can't mass-assign protected attributes After I did that, it seemed as if everything was working fine. I am now getting that same error, but it's a false negative. Note that even though I am getting an error, the column is actually updated. Here's the debugger output: Started PUT "/categories/5" for 127.0.0.1 at 2012-07-09 11:26:40 -0700 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"SifcfX29c+mGRIJXvUWGnZ8mBelMm4uZloYsoO317SY=", "admin_selections"=>{"admin1"=>"56", "admin2"=>"55", "admin3"=>"", "admin4"=>"", "admin5"=>"", "admin6"=>"", "admin7"=>"", "admin8"=>""}, "category"=>{"update_admins_field"=>"1"}, "commit"=>"Update Category", "id"=>"5"} Category Load (0.2ms) SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 5 LIMIT 1 (0.1ms) BEGIN (0.2ms) UPDATE `categories` SET `admins` = '[\"56\",\"55\",\"\"]', `updated_at` = '2012-07-09 18:26:40' WHERE `categories`.`id` = 5 (1.3ms) COMMIT (0.1ms) BEGIN (0.1ms) ROLLBACK Completed 500 Internal Server Error in 5ms ActiveModel::MassAssignmentSecurity::Error (Can't mass-assign protected attributes: utf8, _method, authenticity_token, category, commit, action, controller, id): app/controllers/categories_controller.rb:74:in `block in update' app/controllers/categories_controller.rb:62:in `update' It seems as if the MySQL code is properly generated, but then there's a rollback and 500 error. Here's the relevant code from categories_controller.rb: def update @category = Category.find(params[:id]) respond_to do |format| #this is line 62 if params[:category][:update_admins_field] params['admins'] = return_admins_json (params) if @category.update_attribute(:admins,params['admins']) format.html { redirect_to @category, notice: 'Category was successfully updated.' } #line 66 format.json { head :no_content } end else format.html { redirect_to @category, notice: 'Category was not successfully updated.' } format.json { head :no_content } end if @category.update_attributes(params) #line 74 format.html { redirect_to @category, notice: 'Category was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @category.errors, status: :unprocessable_entity } end end end Why is it getting to line 74? should't the user have been redirected at line 66? Why am I also getting an error when the update takes place?
ruby-on-rails
variable-assignment
null
null
null
null
open
Rails: mass assignment false negative and redirection === Based on a previous Q&A on StackOverlfow, I added the following to application.rb: config.active_record.whitelist_attributes = false as I was getting errors of the type Can't mass-assign protected attributes After I did that, it seemed as if everything was working fine. I am now getting that same error, but it's a false negative. Note that even though I am getting an error, the column is actually updated. Here's the debugger output: Started PUT "/categories/5" for 127.0.0.1 at 2012-07-09 11:26:40 -0700 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"SifcfX29c+mGRIJXvUWGnZ8mBelMm4uZloYsoO317SY=", "admin_selections"=>{"admin1"=>"56", "admin2"=>"55", "admin3"=>"", "admin4"=>"", "admin5"=>"", "admin6"=>"", "admin7"=>"", "admin8"=>""}, "category"=>{"update_admins_field"=>"1"}, "commit"=>"Update Category", "id"=>"5"} Category Load (0.2ms) SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 5 LIMIT 1 (0.1ms) BEGIN (0.2ms) UPDATE `categories` SET `admins` = '[\"56\",\"55\",\"\"]', `updated_at` = '2012-07-09 18:26:40' WHERE `categories`.`id` = 5 (1.3ms) COMMIT (0.1ms) BEGIN (0.1ms) ROLLBACK Completed 500 Internal Server Error in 5ms ActiveModel::MassAssignmentSecurity::Error (Can't mass-assign protected attributes: utf8, _method, authenticity_token, category, commit, action, controller, id): app/controllers/categories_controller.rb:74:in `block in update' app/controllers/categories_controller.rb:62:in `update' It seems as if the MySQL code is properly generated, but then there's a rollback and 500 error. Here's the relevant code from categories_controller.rb: def update @category = Category.find(params[:id]) respond_to do |format| #this is line 62 if params[:category][:update_admins_field] params['admins'] = return_admins_json (params) if @category.update_attribute(:admins,params['admins']) format.html { redirect_to @category, notice: 'Category was successfully updated.' } #line 66 format.json { head :no_content } end else format.html { redirect_to @category, notice: 'Category was not successfully updated.' } format.json { head :no_content } end if @category.update_attributes(params) #line 74 format.html { redirect_to @category, notice: 'Category was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @category.errors, status: :unprocessable_entity } end end end Why is it getting to line 74? should't the user have been redirected at line 66? Why am I also getting an error when the update takes place?
0
11,262,121
06/29/2012 12:50:42
1,115,901
12/26/2011 05:42:19
28
3
add search history from google play to my app in android
I am making an app like android market where all free app will be available to downloads, but there is a search option too for finding the apps on my server. I wants user to show a list of searches he made earlier from google play or android market. please help me, i can get the history from browser but not able to get from play. Any help would greatly appreciated.
android
search
history
market
null
null
open
add search history from google play to my app in android === I am making an app like android market where all free app will be available to downloads, but there is a search option too for finding the apps on my server. I wants user to show a list of searches he made earlier from google play or android market. please help me, i can get the history from browser but not able to get from play. Any help would greatly appreciated.
0
11,262,124
06/29/2012 12:50:52
1,441,889
06/07/2012 09:59:23
16
0
how to fix a iframe sub-page height inherit?
<iframe id="filehandler" style="border: 0; width: 100%; height:1000%" scrolling="no" src="loadindex.php" onload='adjustMyFrameSize();' name="content-part"></iframe> </div> this source loadindex.php containing a another sub page its not a iframe but the page having more contents this page height takes only source loadindex.php heighthow fix the height inherit.
php
javascript
jquery
html
null
null
open
how to fix a iframe sub-page height inherit? === <iframe id="filehandler" style="border: 0; width: 100%; height:1000%" scrolling="no" src="loadindex.php" onload='adjustMyFrameSize();' name="content-part"></iframe> </div> this source loadindex.php containing a another sub page its not a iframe but the page having more contents this page height takes only source loadindex.php heighthow fix the height inherit.
0
11,261,750
06/29/2012 12:25:55
613,326
02/11/2011 16:09:38
47
1
Create a global available array by the size of an updown
I am trying to create a static global array called "series". But the number of strings inside it should depend on a nummericUpDown counter. I have tried a lot of variations, resulting in a lot of error variations. My code looks like this, near the top of my code i have: public partial class Form1 : Form { static string[] series; So after i have made the array global with that i want to set its size. As a nummericUpDown can go up and down, i erase array first (causing errors) Later i want to fill it with { "M1","M2","M3" ......etc} How should i write this code that it will work ? private void numericUpDown1_ValueChanged_1(object sender, EventArgs e) { if (numericUpDown1.Value < 1) { numericUpDown1.Value = 1; } int i; series[0] = "x"; if (series.Length > 0) { Array.Clear(series, 0, series.Length); } for (i = 0; i < numericUpDown1.Value; i++) { series[i] = "M" + i.ToString(); } }
c#
arrays
visual-studio-2010
null
null
null
open
Create a global available array by the size of an updown === I am trying to create a static global array called "series". But the number of strings inside it should depend on a nummericUpDown counter. I have tried a lot of variations, resulting in a lot of error variations. My code looks like this, near the top of my code i have: public partial class Form1 : Form { static string[] series; So after i have made the array global with that i want to set its size. As a nummericUpDown can go up and down, i erase array first (causing errors) Later i want to fill it with { "M1","M2","M3" ......etc} How should i write this code that it will work ? private void numericUpDown1_ValueChanged_1(object sender, EventArgs e) { if (numericUpDown1.Value < 1) { numericUpDown1.Value = 1; } int i; series[0] = "x"; if (series.Length > 0) { Array.Clear(series, 0, series.Length); } for (i = 0; i < numericUpDown1.Value; i++) { series[i] = "M" + i.ToString(); } }
0
11,261,752
06/29/2012 12:25:57
955,289
09/20/2011 17:09:01
84
1
How to only email report with data, not when empty - Report Builder 3.0
I am not the designer for these reports, so please bear with me for this question. Our DBA has set up an automated email with an Excel attachment for the results based on a SQL query that I wrote. The email is sent everyday, regardless of whether or not it has data in it. I would like the report only to be email if there is data in the report. Is there a setting for this criteria in Report Builder 3.0? Thanks in advance!
sql
sql-server
sql-server-2008
reporting-services
null
null
open
How to only email report with data, not when empty - Report Builder 3.0 === I am not the designer for these reports, so please bear with me for this question. Our DBA has set up an automated email with an Excel attachment for the results based on a SQL query that I wrote. The email is sent everyday, regardless of whether or not it has data in it. I would like the report only to be email if there is data in the report. Is there a setting for this criteria in Report Builder 3.0? Thanks in advance!
0
11,262,147
06/29/2012 12:52:27
1,266,515
03/13/2012 13:00:43
160
7
How to apply jQuery slide down on a button when user hovers over a div element?
I have a view in which I there is a repeater control wrapped with a div. I would like to slide down a button when a user hovers over this div. How would I acheive this using jQuery slide down?? Thanks
jquery
asp.net
html
css3
slidedown
null
open
How to apply jQuery slide down on a button when user hovers over a div element? === I have a view in which I there is a repeater control wrapped with a div. I would like to slide down a button when a user hovers over this div. How would I acheive this using jQuery slide down?? Thanks
0
11,262,148
06/29/2012 12:52:29
1,065,516
11/25/2011 11:19:02
1
1
Apache rewrite to other directory, if file exists there
My directories look like this: /assets /images /2011 /2012 /images-hq /2011 /2012 In the html file every image has a tag like: <img src="/assets/images/2012/example.jpg" /> I want to check, if the same image exists in the images-hq folder, and if it is there, i want to send that image to the user. Example: /assets/images/2012/example.jpg to /assets/images-hq/2012/example.jpg **IF** /assets/images-hq/2012/example.jpg exists, if not, just serve the original.
apache
mod-rewrite
rewrite
exists
null
null
open
Apache rewrite to other directory, if file exists there === My directories look like this: /assets /images /2011 /2012 /images-hq /2011 /2012 In the html file every image has a tag like: <img src="/assets/images/2012/example.jpg" /> I want to check, if the same image exists in the images-hq folder, and if it is there, i want to send that image to the user. Example: /assets/images/2012/example.jpg to /assets/images-hq/2012/example.jpg **IF** /assets/images-hq/2012/example.jpg exists, if not, just serve the original.
0
11,261,399
06/29/2012 12:00:40
1,082,004
12/05/2011 17:22:00
505
13
Function for converting dataframe column
R often understands data frame columns in a "wrong" format or you just have to change the column class from factor to character in order to modify it. I have been changing the column class in following way previously: set.seed(1) df <- data.frame(x = 1:10, y = rep(1:2, 5), k = rnorm(10, 5,2), z = rep(c(2010, 2012, 2011, 2010, 1999), 2), j = c(rep(c("a", "b", "c"), 3), "d")) x <- c("y", "z") for(i in 1:length(x)){ df[,x[i]] <- factor(df[,x[i]])} And back to numeric: x <- 1:5 for(i in 1:length(x)){ df[,x[i]] <- as.numeric(as.character(df[,x[i]]))} # Character cannot become numeric It occurred to me that maybe there is a better way doing this. I found [this question][1], which is almost exactly what I need: convert.magic <- function(obj,types){ out <- lapply(1:length(obj),FUN = function(i){FUN1 <- switch(types[i], character = as.character, numeric = as.numeric, factor = as.factor); FUN1(obj[,i])}) names(out) <- colnames(obj) as.data.frame(out) } However, for this function vector type has to be specified for each column: convert.magic(df, rep("factor",5)) x <- c("y", "z") convert.magic(df, x) # Error in FUN(1:5[[1L]], ...) : could not find function "FUN1" Could somebody help me and rebuild this function so that it works with column names and numbers, please? I am afraid that this would be too advanced for me... [1]: http://stackoverflow.com/questions/7680959/convert-type-of-multiple-columns-of-a-dataframe-at-once
r
function
type-conversion
null
null
null
open
Function for converting dataframe column === R often understands data frame columns in a "wrong" format or you just have to change the column class from factor to character in order to modify it. I have been changing the column class in following way previously: set.seed(1) df <- data.frame(x = 1:10, y = rep(1:2, 5), k = rnorm(10, 5,2), z = rep(c(2010, 2012, 2011, 2010, 1999), 2), j = c(rep(c("a", "b", "c"), 3), "d")) x <- c("y", "z") for(i in 1:length(x)){ df[,x[i]] <- factor(df[,x[i]])} And back to numeric: x <- 1:5 for(i in 1:length(x)){ df[,x[i]] <- as.numeric(as.character(df[,x[i]]))} # Character cannot become numeric It occurred to me that maybe there is a better way doing this. I found [this question][1], which is almost exactly what I need: convert.magic <- function(obj,types){ out <- lapply(1:length(obj),FUN = function(i){FUN1 <- switch(types[i], character = as.character, numeric = as.numeric, factor = as.factor); FUN1(obj[,i])}) names(out) <- colnames(obj) as.data.frame(out) } However, for this function vector type has to be specified for each column: convert.magic(df, rep("factor",5)) x <- c("y", "z") convert.magic(df, x) # Error in FUN(1:5[[1L]], ...) : could not find function "FUN1" Could somebody help me and rebuild this function so that it works with column names and numbers, please? I am afraid that this would be too advanced for me... [1]: http://stackoverflow.com/questions/7680959/convert-type-of-multiple-columns-of-a-dataframe-at-once
0
11,261,400
06/29/2012 12:00:52
802,050
06/16/2011 18:09:43
1,183
4
How i can ensure certificate(myAppCertificate.crt) i am importing to cacert already exists in cacert file or not?.
How i can ensure certificate(myAppCertificate.crt) i am importing to cacert already exists in cacert file or not?. For information i am importing the certificate with keytool -import -alias myAppca -file myAppCertificate.crt -keystore cacerts -v For testing purpose i tried to add the already existing certficate again in cacert file, but it did not give me any exception/warning that certificate already exist. **Is there a way i can confirm whether certificate alreay exist or not before actually importing this?**
java
ssl
https
ssl-certificate
null
null
open
How i can ensure certificate(myAppCertificate.crt) i am importing to cacert already exists in cacert file or not?. === How i can ensure certificate(myAppCertificate.crt) i am importing to cacert already exists in cacert file or not?. For information i am importing the certificate with keytool -import -alias myAppca -file myAppCertificate.crt -keystore cacerts -v For testing purpose i tried to add the already existing certficate again in cacert file, but it did not give me any exception/warning that certificate already exist. **Is there a way i can confirm whether certificate alreay exist or not before actually importing this?**
0
11,226,567
06/27/2012 12:47:01
1,138,204
01/09/2012 07:49:35
156
2
Set the border radius of the content border in Window
I want to have a Window that the border radius of the content border of the window is 5 . Exactly like the picture : ![enter image description here][1] [1]: http://i.stack.imgur.com/YpCOb.png How can I do this With C# and WPF ? Is there any way to do this with Windows API ? thanks
c#
wpf
winforms
winapi
window
null
open
Set the border radius of the content border in Window === I want to have a Window that the border radius of the content border of the window is 5 . Exactly like the picture : ![enter image description here][1] [1]: http://i.stack.imgur.com/YpCOb.png How can I do this With C# and WPF ? Is there any way to do this with Windows API ? thanks
0
11,226,189
06/27/2012 12:27:20
1,374,985
05/04/2012 12:50:12
8
0
trouble wih validation inside of asp wizard
I have a group of 5 textboxes and I am using an asp:wizard. I want to check to see if all of the textboxes are empty I want to fire a label named lblItemBlock. Nothing I have tried has worked so far and so i tried cutting it down even smaller to test. I made the label visible on the page and on the active step tried to set the visible property to false. and for whatever reason it does not work here is what I have: protected void OnActiveStepChanged(object sender, EventArgs e) { if (Wizard1.ActiveStepIndex == Wizard1.WizardSteps.IndexOf(this.WizardStep3)) { lblItemBlock.Visible = false; } }
c#
null
null
null
null
null
open
trouble wih validation inside of asp wizard === I have a group of 5 textboxes and I am using an asp:wizard. I want to check to see if all of the textboxes are empty I want to fire a label named lblItemBlock. Nothing I have tried has worked so far and so i tried cutting it down even smaller to test. I made the label visible on the page and on the active step tried to set the visible property to false. and for whatever reason it does not work here is what I have: protected void OnActiveStepChanged(object sender, EventArgs e) { if (Wizard1.ActiveStepIndex == Wizard1.WizardSteps.IndexOf(this.WizardStep3)) { lblItemBlock.Visible = false; } }
0
11,226,577
06/27/2012 12:47:38
1,485,673
06/27/2012 12:42:31
1
0
Multiparted upload to S3 with with AWS SDK - retry and parallel
I am using the AWS SDK (PHP) to move files to and from my S3 bucket. I am using multiparting with initiate_multipart_upload() and upload_part() and so on. It basically works. BUT, for very large files (of, say, > 400MB) I cannot successfully upload all of the parts to S3. Basically, some of the parts are not OK. So I would like to ask y'all the following questions: [1] Will $s3->batch()->send() [after $s3->batch()->upload_part()] "do" retrying of failed parts? Or do I have to do it myself? [2] If yes to [1], is the retrying using $s3->max_retries ? [3] Will $s3->batch()->send() [after $s3->batch()->upload_part()] "do" paralleling of the parts. I mean, sending multiple parts at the same time? Or do I have to do it myself? I've been looking at the API docs - and I've even been fishing around the source on GitHub - but I can't seem to find the answers to these questions. Thanks a lot, Daniel PS. See also http://aws.typepad.com/aws/2010/11/amazon-s3-multipart-upload.html
php
parallel-processing
amazon-web-services
multipart
retry
null
open
Multiparted upload to S3 with with AWS SDK - retry and parallel === I am using the AWS SDK (PHP) to move files to and from my S3 bucket. I am using multiparting with initiate_multipart_upload() and upload_part() and so on. It basically works. BUT, for very large files (of, say, > 400MB) I cannot successfully upload all of the parts to S3. Basically, some of the parts are not OK. So I would like to ask y'all the following questions: [1] Will $s3->batch()->send() [after $s3->batch()->upload_part()] "do" retrying of failed parts? Or do I have to do it myself? [2] If yes to [1], is the retrying using $s3->max_retries ? [3] Will $s3->batch()->send() [after $s3->batch()->upload_part()] "do" paralleling of the parts. I mean, sending multiple parts at the same time? Or do I have to do it myself? I've been looking at the API docs - and I've even been fishing around the source on GitHub - but I can't seem to find the answers to these questions. Thanks a lot, Daniel PS. See also http://aws.typepad.com/aws/2010/11/amazon-s3-multipart-upload.html
0
11,226,564
06/27/2012 12:46:59
782,390
06/03/2011 08:38:35
75
11
Value Binding On Select With Static Options
is it possible use the value binding on a select that contains static options like this? <select data-bind="value: optionValue"> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> </select> Actually the bind is writing the value, if I select an option the value will change, but I am not able to read it when the select is initialized. When the page is loaded the first option is always setted.
javascript
knockout.js
null
null
null
null
open
Value Binding On Select With Static Options === is it possible use the value binding on a select that contains static options like this? <select data-bind="value: optionValue"> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> </select> Actually the bind is writing the value, if I select an option the value will change, but I am not able to read it when the select is initialized. When the page is loaded the first option is always setted.
0
11,226,580
06/27/2012 12:47:49
1,485,641
06/27/2012 12:31:02
1
0
Set a cell value and keep it editable in inline editing
I have to change a cell value by code and keep it editable. With this code, I can change the value of the other cell, but the cell 'paidHour' change to a non-editable state. How to make it editable again? editoptions: { dataEvents: [{ type: 'keyup', fn: function (e) { var rowId = $(e.target).closest("tr.jqgrow").attr("id"); var total = parseInt(e.target.value, 10); var paidWeek = parseInt($("#List").getCell(rowId, 'paidWeek'), 10); var addHourBank = 0; if (total >= paidWeek) { addHourBank += (total - paidWeek); total = paidWeek; } $("#List").setCell(rowId, 'paidHour', total);
javascript
jquery
jqgrid
null
null
null
open
Set a cell value and keep it editable in inline editing === I have to change a cell value by code and keep it editable. With this code, I can change the value of the other cell, but the cell 'paidHour' change to a non-editable state. How to make it editable again? editoptions: { dataEvents: [{ type: 'keyup', fn: function (e) { var rowId = $(e.target).closest("tr.jqgrow").attr("id"); var total = parseInt(e.target.value, 10); var paidWeek = parseInt($("#List").getCell(rowId, 'paidWeek'), 10); var addHourBank = 0; if (total >= paidWeek) { addHourBank += (total - paidWeek); total = paidWeek; } $("#List").setCell(rowId, 'paidHour', total);
0
11,226,584
06/27/2012 12:48:07
1,407,560
05/21/2012 09:45:15
63
1
Whats is the difference between nested method call and delegates?
consider following: **1st APPROACH:** public void f3() { f2(); f1(); } and this ... **2nd APPROACH:** class Sample { public delegate void MyDelegate(string s); MyDelegate obj; public Sample() { obj += new MyDelegate(input); obj+=new MyDelegate(something); obj += new MyDelegate(someStaticMethod); } } When i call f3() it will call the functions listed inside it ... same would happen when i will invoke a delegate ... so whats the use of delegate to handle some event when i can use 1st approach ... **the 1st approach too encapsulates the method call..**
c#
function
c#-4.0
delegates
null
null
open
Whats is the difference between nested method call and delegates? === consider following: **1st APPROACH:** public void f3() { f2(); f1(); } and this ... **2nd APPROACH:** class Sample { public delegate void MyDelegate(string s); MyDelegate obj; public Sample() { obj += new MyDelegate(input); obj+=new MyDelegate(something); obj += new MyDelegate(someStaticMethod); } } When i call f3() it will call the functions listed inside it ... same would happen when i will invoke a delegate ... so whats the use of delegate to handle some event when i can use 1st approach ... **the 1st approach too encapsulates the method call..**
0
11,226,590
06/27/2012 12:48:34
1,447,670
06/10/2012 18:23:12
6
0
How to load webforms in a windows based installer?
I want to know how to load an webpage into a installer just like the below example: i.minus.com/iipJcW7d1yxL3.png (I can't able to post images because of my reputation). How this can be done? And, which installer in the market supports this feature? I have tried NSIS and SetupFactory, but can't found it. Also is it possible that if someone doesn't fill out the field(s) mentioned in webpage, the "Next" button remain disable? Any help would be much appreciated.
iframe
installer
setup
webpage
null
null
open
How to load webforms in a windows based installer? === I want to know how to load an webpage into a installer just like the below example: i.minus.com/iipJcW7d1yxL3.png (I can't able to post images because of my reputation). How this can be done? And, which installer in the market supports this feature? I have tried NSIS and SetupFactory, but can't found it. Also is it possible that if someone doesn't fill out the field(s) mentioned in webpage, the "Next" button remain disable? Any help would be much appreciated.
0
11,226,592
06/27/2012 12:48:35
296,516
03/18/2010 12:56:50
411
5
can't overlaying a SurfaceView in Android
Say I have such structure of RelativeLayouts. rl1 - is the layout I'm later adding a surfaceview to. rlOptions - is an options layout that needs to appear from time to time, overlaying rl1. ![enter image description here][1] At first it works fine, yet if I the image of ivOptions or make rlOptionv invisible and then visible again, it gets drawn UNDER the surfaceview, instead of overlaying it, as it did before. Any ideas how to fix that? Thanks! [1]: http://i.stack.imgur.com/6ehbE.png
android
null
null
null
null
null
open
can't overlaying a SurfaceView in Android === Say I have such structure of RelativeLayouts. rl1 - is the layout I'm later adding a surfaceview to. rlOptions - is an options layout that needs to appear from time to time, overlaying rl1. ![enter image description here][1] At first it works fine, yet if I the image of ivOptions or make rlOptionv invisible and then visible again, it gets drawn UNDER the surfaceview, instead of overlaying it, as it did before. Any ideas how to fix that? Thanks! [1]: http://i.stack.imgur.com/6ehbE.png
0
11,226,595
06/27/2012 12:48:41
598,368
02/01/2011 12:34:43
334
6
How to reduce audio file size in IOS
I am doing an application which get songs from mediapicker and saving it to my application.i want to reduce the size of file,but i got a sample named "AACConverter",i test the application but it is not reducing the file size.could any one help me in solving this problem.
ios
aac
mpmediapickercontroller
null
null
null
open
How to reduce audio file size in IOS === I am doing an application which get songs from mediapicker and saving it to my application.i want to reduce the size of file,but i got a sample named "AACConverter",i test the application but it is not reducing the file size.could any one help me in solving this problem.
0
11,349,438
07/05/2012 17:27:27
1,218,040
02/18/2012 12:22:57
30
2
Cant get my user database to sort.
I have a user database which I want the admin to be able view users. I want the admin to be able to sort the users by different fields. (E.g first name or surname). My problem: Is that it wont sort. Im trying to do it using a drop down box and a submit button. I have have tried the Sql in phpMyAdmin to make sure the statement is correct which it is. I have also added a or die to make sure its not a mysql error. Im getting no errors its just not sorting. I have also tried echoing out the drop down to make sure the right value is being added to the variable. code: HTML drop down <form action="View_users.php" enctype="multipart/form-data" name="sort" id="sort" method="post" align="right"> <label> <select name="sortdropdown" id="sortdropdown"> <option value="<?php echo $sortby; ?>"><?php echo $sortby; ?></option> <option value="name">First Name</option> <option value="surname">Surname</option> <option value="email">Email</option> <option value="signupdate">Date</option> </select> </label> <label> <input type="submit" name="button" id="button" value="Sort" /> </label> </form> logic: $sortby = ""; if (!isset($_POST['sortdropdown'])) { $sortby = "surnname"; }else{ $sortby = mysql_real_escape_string($_POST['sortdropdown']); } // This block grabs the whole list for viewing $product_list = ""; $counter = 0; $sql = mysql_query("SELECT * FROM users ORDER BY '$sortby' ASC") or die(mysql_error()); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { while($row = mysql_fetch_array($sql)){ $counter++; $id = $row["id"]; $email = $row["email"]; $name = $row["name"]; $surname = $row["surname"]; $lastlogin = $row["lastlogin"]; $signupdate = $row["signupdate"]; if (is_float($counter/2)) {$class = "#CCCCCC"; } else {$class = "white";} $product_list .= '<tr bgcolor="'.$class.'"> <td>'.$surname.'</td> <td>'.$name.'</td> <td>'.$email .'</td> <td><a href="user.php?id=' . $id . '">View More</a></td></tr>'; } } else { $product_list = "There are no users in the system yet"; } Thanks
php
mysql
null
null
null
null
open
Cant get my user database to sort. === I have a user database which I want the admin to be able view users. I want the admin to be able to sort the users by different fields. (E.g first name or surname). My problem: Is that it wont sort. Im trying to do it using a drop down box and a submit button. I have have tried the Sql in phpMyAdmin to make sure the statement is correct which it is. I have also added a or die to make sure its not a mysql error. Im getting no errors its just not sorting. I have also tried echoing out the drop down to make sure the right value is being added to the variable. code: HTML drop down <form action="View_users.php" enctype="multipart/form-data" name="sort" id="sort" method="post" align="right"> <label> <select name="sortdropdown" id="sortdropdown"> <option value="<?php echo $sortby; ?>"><?php echo $sortby; ?></option> <option value="name">First Name</option> <option value="surname">Surname</option> <option value="email">Email</option> <option value="signupdate">Date</option> </select> </label> <label> <input type="submit" name="button" id="button" value="Sort" /> </label> </form> logic: $sortby = ""; if (!isset($_POST['sortdropdown'])) { $sortby = "surnname"; }else{ $sortby = mysql_real_escape_string($_POST['sortdropdown']); } // This block grabs the whole list for viewing $product_list = ""; $counter = 0; $sql = mysql_query("SELECT * FROM users ORDER BY '$sortby' ASC") or die(mysql_error()); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { while($row = mysql_fetch_array($sql)){ $counter++; $id = $row["id"]; $email = $row["email"]; $name = $row["name"]; $surname = $row["surname"]; $lastlogin = $row["lastlogin"]; $signupdate = $row["signupdate"]; if (is_float($counter/2)) {$class = "#CCCCCC"; } else {$class = "white";} $product_list .= '<tr bgcolor="'.$class.'"> <td>'.$surname.'</td> <td>'.$name.'</td> <td>'.$email .'</td> <td><a href="user.php?id=' . $id . '">View More</a></td></tr>'; } } else { $product_list = "There are no users in the system yet"; } Thanks
0
11,349,439
07/05/2012 17:27:29
888,787
08/10/2011 21:24:52
149
5
Uiscrolview costum pagination size
first take a look on this picture from localScope app : ![localScope][1] i have 2 (simple?) questions : 1. how can i paginate my icons like this? 2. how can i detect witch icon is " selected " thank you. [1]: http://i.stack.imgur.com/CS1VQ.png
ios
uiscrollview
pagination
null
null
null
open
Uiscrolview costum pagination size === first take a look on this picture from localScope app : ![localScope][1] i have 2 (simple?) questions : 1. how can i paginate my icons like this? 2. how can i detect witch icon is " selected " thank you. [1]: http://i.stack.imgur.com/CS1VQ.png
0
11,349,391
07/05/2012 17:24:27
1,048,676
11/16/2011 00:05:26
596
14
Determine if there was a mySQL error with PHP
All, If I run a query like the following: $qry = "Select wrong_column from table_name"; $result = mysql_query($qry); If wrong_column doesn't exist then I'll get a mySQL error. In PHP, how can I determine if there was an error from mySQL? If there was an error I'd like it to stop further processing but if there wasn't an error I'd like to get the mySQL results like this: $resultset = mysql_fetch_array($result); Would doing something like this work? if(!mysql_error()){ $resultset = mysql_fetch_array($result); } Any advice on how to do this would be appreciated. Thanks in advance!
php
mysql
null
null
null
null
open
Determine if there was a mySQL error with PHP === All, If I run a query like the following: $qry = "Select wrong_column from table_name"; $result = mysql_query($qry); If wrong_column doesn't exist then I'll get a mySQL error. In PHP, how can I determine if there was an error from mySQL? If there was an error I'd like it to stop further processing but if there wasn't an error I'd like to get the mySQL results like this: $resultset = mysql_fetch_array($result); Would doing something like this work? if(!mysql_error()){ $resultset = mysql_fetch_array($result); } Any advice on how to do this would be appreciated. Thanks in advance!
0
11,349,412
07/05/2012 17:25:54
1,345,589
04/20/2012 04:14:34
11
0
Images not displayed
I wanted to try a code that could compare 2 images pixel by pixel, so I came across a JS for the same on the link http://tcorral.github.com/IM.js/ . I also downloaded the examples to better understand the code. However, in all the examples I have downloaded the images do not load at all. I have tried all possible fixes that I am aware of, but to no avail. I don't know what I am missing and why the images are not loading. I have not tweaked the code at all. I just downloaded it and wanted to tweak it, but before I could tweak it I came across this problem wherein the images are not getting displayed. Please help!
javascript
html
html5
null
null
null
open
Images not displayed === I wanted to try a code that could compare 2 images pixel by pixel, so I came across a JS for the same on the link http://tcorral.github.com/IM.js/ . I also downloaded the examples to better understand the code. However, in all the examples I have downloaded the images do not load at all. I have tried all possible fixes that I am aware of, but to no avail. I don't know what I am missing and why the images are not loading. I have not tweaked the code at all. I just downloaded it and wanted to tweak it, but before I could tweak it I came across this problem wherein the images are not getting displayed. Please help!
0
11,349,446
07/05/2012 17:27:59
209,591
11/12/2009 13:17:52
1,197
38
targeting iphone4 with responsive design (css media queries) as if lower res.
This must have been answered before, but I can't find a related question. I've designed a responsive site, with css media queries going all the way down to correctly display on 320 wide. Want I want is the iPhone4 (640 x 960) when in landscape mode (640 wide) to adhere to media queries as if it's display-width = 320 pixels instead. Rationale: even though the iphone has more pixels, I do want to display a simplified layout to those user, similar to users of non high-density phones. Any way to do this, by specifying some meta-tag for these high-pixel density phones for example? Of course, I could define separate media-queries for iphone 4 and the like with `min-device-pixel-ratio: 2` but this leads to separate css media queries (one for low and one for high pixel density) which essentially have the same logic, which doesn't seem very DRY to me( http://en.wikipedia.org/wiki/Don%27t_repeat_yourself ) Strange thing is: the new Ipad 3 , with pixel density 2, DOES correctly render the way I want, i.e: it mimics (at least as css media queries are concerned) a device with half the resolution.
iphone
css
responsive-design
media-queries
null
null
open
targeting iphone4 with responsive design (css media queries) as if lower res. === This must have been answered before, but I can't find a related question. I've designed a responsive site, with css media queries going all the way down to correctly display on 320 wide. Want I want is the iPhone4 (640 x 960) when in landscape mode (640 wide) to adhere to media queries as if it's display-width = 320 pixels instead. Rationale: even though the iphone has more pixels, I do want to display a simplified layout to those user, similar to users of non high-density phones. Any way to do this, by specifying some meta-tag for these high-pixel density phones for example? Of course, I could define separate media-queries for iphone 4 and the like with `min-device-pixel-ratio: 2` but this leads to separate css media queries (one for low and one for high pixel density) which essentially have the same logic, which doesn't seem very DRY to me( http://en.wikipedia.org/wiki/Don%27t_repeat_yourself ) Strange thing is: the new Ipad 3 , with pixel density 2, DOES correctly render the way I want, i.e: it mimics (at least as css media queries are concerned) a device with half the resolution.
0
11,349,451
07/05/2012 17:28:14
352,191
05/27/2010 16:55:38
449
8
Is there a way to test/validate production.rb (or any environment file)
I had a problem in a UAT environment because there was a configuration problem in `config/environments/uat.rb` Is there a way to test/validate environment files like uat.rb or production.rb to catch errors before deploying? Loading the files with require in rspec might be a problem because it might affect other tests, not sure about this. Thanks,
ruby-on-rails
null
null
null
null
null
open
Is there a way to test/validate production.rb (or any environment file) === I had a problem in a UAT environment because there was a configuration problem in `config/environments/uat.rb` Is there a way to test/validate environment files like uat.rb or production.rb to catch errors before deploying? Loading the files with require in rspec might be a problem because it might affect other tests, not sure about this. Thanks,
0
11,349,452
07/05/2012 17:28:15
443,602
09/09/2010 15:54:43
1,474
48
Can one get all of the identities of a block insert of records?
Considering the following TSQL: INSERT INTO Address(Street1, City, State, ZipCode) SELECT Street1, City, StateCode, ZipCode FROM Contact The Address has an identity column that is automatically set. Is there a way to get a list of the identities of Address records newly inserted? I know there is @@IDENTITY, but that just returns the last identity.
sql-server-2008
tsql
null
null
null
null
open
Can one get all of the identities of a block insert of records? === Considering the following TSQL: INSERT INTO Address(Street1, City, State, ZipCode) SELECT Street1, City, StateCode, ZipCode FROM Contact The Address has an identity column that is automatically set. Is there a way to get a list of the identities of Address records newly inserted? I know there is @@IDENTITY, but that just returns the last identity.
0
11,346,010
07/05/2012 14:05:13
634,710
02/25/2011 18:54:41
1,745
9
form submission and file upload using classic asp
I have classic asp form which has some input textboxes and dropdowns. It also has a fileupload control. all inputs are enclosed in one form I want to upload the file as well as submit the data to database. Can I do both database insertion as well as fileupload using classic asp on one button click ? How can I upload the file using classic asp. do I need to add some attribute to form element ? Regards, Asif Hameed
asp.net
asp-classic
null
null
null
null
open
form submission and file upload using classic asp === I have classic asp form which has some input textboxes and dropdowns. It also has a fileupload control. all inputs are enclosed in one form I want to upload the file as well as submit the data to database. Can I do both database insertion as well as fileupload using classic asp on one button click ? How can I upload the file using classic asp. do I need to add some attribute to form element ? Regards, Asif Hameed
0
11,423,379
07/10/2012 23:17:09
1,516,236
07/10/2012 23:09:51
1
0
HTML, divs are not floating left
My divs simply wont float left, they line up vertically one the screen. I want them to be right next to each other. I have a feeling the max-width stuff isn't working. I had this working at one point but not anymore apparently. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>TV Shows</title> <style type="text/css"> .coverGroup { display: block; max-width: 297px; height: 179px; float: left; overflow: hidden; } .coverImage img { border:5px solid #ddd; } .coverImage:hover img { border: 5px solid #555; } </style> </head> <body> <span style="font-size:20px;">Click on the show of your choice</span> <br /> <div class="coverImage"> <a href="/1/american-dad!" title="American Dad!"> <img height="179" width="287" src="/1/wp-content/uploads/2012/07/Episodes1.png"/> </a> </div> <div class="coverImage"> <a href="/1/family-guy" title="Family Guy"> <img height="179" width="287" src="/1/wp-content/uploads/2012/07/500px-Family_Guy_Logo.svg1_-300x179.png"/> </a> </div> </body> </html>
html
div
floating
null
null
null
open
HTML, divs are not floating left === My divs simply wont float left, they line up vertically one the screen. I want them to be right next to each other. I have a feeling the max-width stuff isn't working. I had this working at one point but not anymore apparently. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>TV Shows</title> <style type="text/css"> .coverGroup { display: block; max-width: 297px; height: 179px; float: left; overflow: hidden; } .coverImage img { border:5px solid #ddd; } .coverImage:hover img { border: 5px solid #555; } </style> </head> <body> <span style="font-size:20px;">Click on the show of your choice</span> <br /> <div class="coverImage"> <a href="/1/american-dad!" title="American Dad!"> <img height="179" width="287" src="/1/wp-content/uploads/2012/07/Episodes1.png"/> </a> </div> <div class="coverImage"> <a href="/1/family-guy" title="Family Guy"> <img height="179" width="287" src="/1/wp-content/uploads/2012/07/500px-Family_Guy_Logo.svg1_-300x179.png"/> </a> </div> </body> </html>
0
11,423,380
07/10/2012 23:17:11
365,496
06/13/2010 02:51:57
12,571
454
Why are redudant class name qualifiers allowed?
I came across some code like this: struct A { A() {} A(int) {} }; struct B : A { void init(int i); }; void B::init(int i) { A::A(i); } int main() { B b; b.init(2); } This compiled and ran using VC11 beta with no errors or warnings with /W4. The apparent intent is for calling B::init to reinitialize the B's A base subobject. I believe it actually parses as a variable declaration for a new variable named `i` with type `A`. Compiling with clang produces diagnostics: ConsoleApplication1.cpp:11:14: warning: declaration shadows a local variable A::A(i); ^ ConsoleApplication1.cpp:10:22: note: previous declaration is here void B::init(int i) { ^ ConsoleApplication1.cpp:11:14: error: redefinition of 'i' with a different type A::A(i); ^ ConsoleApplication1.cpp:10:22: note: previous definition is here void B::init(int i) { ^ It seems curious that the type can be referred to with the redundant class qualification. Also, `A::A(i)` appears to be parsed differently by VS11 and clang/gcc. If I do `A::A(b)` clang and gcc create a variable `b` of type `A` using the default constructor. VS11 errors out on that saying `b` is an unknown identifier. VS11 appears to parse `A::A(i)` as the creation of a temporary `A` using the constructor `A::A(int)` with `i` as the parameter. When the redundant qualifier is eliminated VS parses the source as a variable declaration like clang and gcc do, and produces a similar error about shadowing the variable `i`. This difference in parsing explains why VS11 will choke on more than a single extra qualifier; `A::A::A::A(i)`, and why, given that clang and gcc can accept one extra qualifier, any number more than one extra has the same result as one extra. Here's another example with the redundant qualifiers in a different context. All compiler seem to parse this as a temporary construction: class Foo {}; void bar(Foo const &) {} int main() { bar(Foo::Foo()); } 1. Why are redundant qualifiers allowed at all? 1. There are some contexts where constructors can be referred to, such as the syntax for inheriting constructors (`class D : B { using B::B; };`) but VS seems to be allowing it anywhere. Is VS wrong and are clang and gcc right in how redundant qualifiers are parsed? 1. I know VS is still a fair bit behind in terms of standards compliance, but I do find it a bit surprising that modern, actively developed compilers could be so divergent, in this case resolving a redundant qualifier as the name of a constructor (even though constructors don't have names) vs. resolving redundant qualifiers simply to the type, resulting in VS constructing a temporary where the others declare a variable. Are there still many differences this severe? 1. Clearly redundant qualifiers should be avoided in portable code. Is there a good way to prevent this construct from being used?
c++
language-lawyer
null
null
null
null
open
Why are redudant class name qualifiers allowed? === I came across some code like this: struct A { A() {} A(int) {} }; struct B : A { void init(int i); }; void B::init(int i) { A::A(i); } int main() { B b; b.init(2); } This compiled and ran using VC11 beta with no errors or warnings with /W4. The apparent intent is for calling B::init to reinitialize the B's A base subobject. I believe it actually parses as a variable declaration for a new variable named `i` with type `A`. Compiling with clang produces diagnostics: ConsoleApplication1.cpp:11:14: warning: declaration shadows a local variable A::A(i); ^ ConsoleApplication1.cpp:10:22: note: previous declaration is here void B::init(int i) { ^ ConsoleApplication1.cpp:11:14: error: redefinition of 'i' with a different type A::A(i); ^ ConsoleApplication1.cpp:10:22: note: previous definition is here void B::init(int i) { ^ It seems curious that the type can be referred to with the redundant class qualification. Also, `A::A(i)` appears to be parsed differently by VS11 and clang/gcc. If I do `A::A(b)` clang and gcc create a variable `b` of type `A` using the default constructor. VS11 errors out on that saying `b` is an unknown identifier. VS11 appears to parse `A::A(i)` as the creation of a temporary `A` using the constructor `A::A(int)` with `i` as the parameter. When the redundant qualifier is eliminated VS parses the source as a variable declaration like clang and gcc do, and produces a similar error about shadowing the variable `i`. This difference in parsing explains why VS11 will choke on more than a single extra qualifier; `A::A::A::A(i)`, and why, given that clang and gcc can accept one extra qualifier, any number more than one extra has the same result as one extra. Here's another example with the redundant qualifiers in a different context. All compiler seem to parse this as a temporary construction: class Foo {}; void bar(Foo const &) {} int main() { bar(Foo::Foo()); } 1. Why are redundant qualifiers allowed at all? 1. There are some contexts where constructors can be referred to, such as the syntax for inheriting constructors (`class D : B { using B::B; };`) but VS seems to be allowing it anywhere. Is VS wrong and are clang and gcc right in how redundant qualifiers are parsed? 1. I know VS is still a fair bit behind in terms of standards compliance, but I do find it a bit surprising that modern, actively developed compilers could be so divergent, in this case resolving a redundant qualifier as the name of a constructor (even though constructors don't have names) vs. resolving redundant qualifiers simply to the type, resulting in VS constructing a temporary where the others declare a variable. Are there still many differences this severe? 1. Clearly redundant qualifiers should be avoided in portable code. Is there a good way to prevent this construct from being used?
0
11,423,381
07/10/2012 23:17:17
656,982
03/12/2011 21:25:44
56
0
Processing LineString from KML File - Coordinates - Bad Rendering in SQL + C#
I have a simple KML File that contains 1 linestring (the real file has thousands). I am having a problem with the coordinates as google earth draws the single line string as two lines. Whereas my conversion to SQL Server Spatial and in the end C# code will only draw one line. <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"> <Document> <name>Test.kmz</name> <Style id="styleOSR"> <LineStyle id="lineStyleOSR"> <color>ff0f00ff</color> <width>2</width> </LineStyle> </Style> <Folder> <name>TEST</name> <description> </description> <Folder> <name>TEST</name> <Placemark> <name>OSR 0038</name> <styleUrl>#styleOSR</styleUrl> <LineString> <tessellate>1</tessellate> <altitudeMode>relativeToGround</altitudeMode> <coordinates> 68.208,86.306,0 70.926,86.203,0 72.984,86.106,0 75.029,85.98900000000002,0 76.32599999999999,85.917,0 78.40300000000001,85.768,0 81.10299999999999,85.639,0 83.143,85.556,0 84.80200000000001,85.5,0 86.80200000000001,85.41800000000001,0 88.486,85.346,0 89.98,85.29600000000001,0 92.313,85.229,0 94.155,85.155,0 95.839,85.102,0 97.27300000000001,85.02800000000001,0 98.568,84.95999999999999,0 99.444,84.911,0 102.918,84.664,0 103.943,84.57800000000002,0 105.302,84.485,0 106.759,84.369,0 107.709,84.295,0 108.939,84.194,0 109.727,84.11,0 110.959,83.965,0 111.974,83.824,0 112.843,83.67400000000002,0 113.723,83.512,0 114.558,83.321,0 115.258,83.151,0 115.793,83.014,0 116.582,82.74,0 117.171,82.539,0 117.755,82.298,0 119.1,82.087,0 119.984,81.595,0 121.004,81.115,0 121.898,80.643,0 122.639,80.206,0 123.408,79.759,0 125.188,78.99,0 125.679,78.133,0 -29.60900000000001,39.993,0 -29.613,40.033,0 -29.58,40.079,0 -29.588,40.106,0 </coordinates> </LineString> </Placemark> </Folder> </Folder> </Document> </kml> My problem is that if I load this in google earth it draws two seperate lines on the earth. This is infact what I want to do. You can see two red lines on the picture below, two independant lines! ![enter image description here][1] But when I process the linestring and then render the line from SQL Server geometry I get one line So parsing this line of coordinates and putting into SQL Server gives me ![enter image description here][2] LINESTRING (68.208 86.306, 70.926 86.203, 72.984 86.106, 75.029 85.989000000000019, 76.326 85.917, 78.403 85.768, 81.103 85.639, 83.143 85.556, 84.802 85.5, 86.802 85.418, 88.486 85.346, 89.98 85.296, 92.313 85.229, 94.155 85.155, 95.839 85.102, 97.27300000000001 85.028, 98.568 84.96, 99.444 84.911, 102.918 84.664, 103.943 84.578000000000017, 105.302 84.485, 106.759 84.369, 107.709 84.295, 108.939 84.194, 109.727 84.11, 110.959 83.965, 111.974 83.824, 112.843 83.674000000000021, 113.723 83.512, 114.558 83.321, 115.258 83.151, 115.793 83.014, 116.582 82.74, 117.171 82.539, 117.755 82.298, 119.1 82.087, 119.984 81.595, 121.004 81.115, 121.898 80.643, 122.639 80.206, 123.408 79.759, 125.188 78.99, 125.679 78.133, **-29.609000000000009 39.993, -29.613 40.033, -29.58 40.079, -29.588 40.106**) The issue is the last 4 coordinates contains these values -29.609000000000009 39.993, -29.613 40.033, -29.58 40.079, -29.588 40.106 Now Google Earth seems to know that the coordinates are different from each other and ***does not render a single line*** but splits it into two lines. So my question is how do the same? Remember I have lots of these and I am wanting to put them on a Google Map as a custom layer - here is my issue - strange lines on my map. ![enter image description here][3] Here is how google earth actually renders the full KML file. ![enter image description here][4] If anyone is interested in seeing the original KML file then you can get it from here [KML File][5] This is for my Earthquake Site in New Zealand to show techtonic plates on a map. [http://canterburyquakelive.co.nz][6] cheers chris [1]: http://i.stack.imgur.com/lpj46.png [2]: http://i.stack.imgur.com/Ggcaq.png [3]: http://i.stack.imgur.com/aW4Ex.png [4]: http://i.stack.imgur.com/JarKT.png [5]: http://static.canterburyquakelive.co.nz/KML/PlateBoundaries.kml [6]: http://canterburyquakelive.co.nz
google
coordinates
kml
spatial
null
null
open
Processing LineString from KML File - Coordinates - Bad Rendering in SQL + C# === I have a simple KML File that contains 1 linestring (the real file has thousands). I am having a problem with the coordinates as google earth draws the single line string as two lines. Whereas my conversion to SQL Server Spatial and in the end C# code will only draw one line. <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"> <Document> <name>Test.kmz</name> <Style id="styleOSR"> <LineStyle id="lineStyleOSR"> <color>ff0f00ff</color> <width>2</width> </LineStyle> </Style> <Folder> <name>TEST</name> <description> </description> <Folder> <name>TEST</name> <Placemark> <name>OSR 0038</name> <styleUrl>#styleOSR</styleUrl> <LineString> <tessellate>1</tessellate> <altitudeMode>relativeToGround</altitudeMode> <coordinates> 68.208,86.306,0 70.926,86.203,0 72.984,86.106,0 75.029,85.98900000000002,0 76.32599999999999,85.917,0 78.40300000000001,85.768,0 81.10299999999999,85.639,0 83.143,85.556,0 84.80200000000001,85.5,0 86.80200000000001,85.41800000000001,0 88.486,85.346,0 89.98,85.29600000000001,0 92.313,85.229,0 94.155,85.155,0 95.839,85.102,0 97.27300000000001,85.02800000000001,0 98.568,84.95999999999999,0 99.444,84.911,0 102.918,84.664,0 103.943,84.57800000000002,0 105.302,84.485,0 106.759,84.369,0 107.709,84.295,0 108.939,84.194,0 109.727,84.11,0 110.959,83.965,0 111.974,83.824,0 112.843,83.67400000000002,0 113.723,83.512,0 114.558,83.321,0 115.258,83.151,0 115.793,83.014,0 116.582,82.74,0 117.171,82.539,0 117.755,82.298,0 119.1,82.087,0 119.984,81.595,0 121.004,81.115,0 121.898,80.643,0 122.639,80.206,0 123.408,79.759,0 125.188,78.99,0 125.679,78.133,0 -29.60900000000001,39.993,0 -29.613,40.033,0 -29.58,40.079,0 -29.588,40.106,0 </coordinates> </LineString> </Placemark> </Folder> </Folder> </Document> </kml> My problem is that if I load this in google earth it draws two seperate lines on the earth. This is infact what I want to do. You can see two red lines on the picture below, two independant lines! ![enter image description here][1] But when I process the linestring and then render the line from SQL Server geometry I get one line So parsing this line of coordinates and putting into SQL Server gives me ![enter image description here][2] LINESTRING (68.208 86.306, 70.926 86.203, 72.984 86.106, 75.029 85.989000000000019, 76.326 85.917, 78.403 85.768, 81.103 85.639, 83.143 85.556, 84.802 85.5, 86.802 85.418, 88.486 85.346, 89.98 85.296, 92.313 85.229, 94.155 85.155, 95.839 85.102, 97.27300000000001 85.028, 98.568 84.96, 99.444 84.911, 102.918 84.664, 103.943 84.578000000000017, 105.302 84.485, 106.759 84.369, 107.709 84.295, 108.939 84.194, 109.727 84.11, 110.959 83.965, 111.974 83.824, 112.843 83.674000000000021, 113.723 83.512, 114.558 83.321, 115.258 83.151, 115.793 83.014, 116.582 82.74, 117.171 82.539, 117.755 82.298, 119.1 82.087, 119.984 81.595, 121.004 81.115, 121.898 80.643, 122.639 80.206, 123.408 79.759, 125.188 78.99, 125.679 78.133, **-29.609000000000009 39.993, -29.613 40.033, -29.58 40.079, -29.588 40.106**) The issue is the last 4 coordinates contains these values -29.609000000000009 39.993, -29.613 40.033, -29.58 40.079, -29.588 40.106 Now Google Earth seems to know that the coordinates are different from each other and ***does not render a single line*** but splits it into two lines. So my question is how do the same? Remember I have lots of these and I am wanting to put them on a Google Map as a custom layer - here is my issue - strange lines on my map. ![enter image description here][3] Here is how google earth actually renders the full KML file. ![enter image description here][4] If anyone is interested in seeing the original KML file then you can get it from here [KML File][5] This is for my Earthquake Site in New Zealand to show techtonic plates on a map. [http://canterburyquakelive.co.nz][6] cheers chris [1]: http://i.stack.imgur.com/lpj46.png [2]: http://i.stack.imgur.com/Ggcaq.png [3]: http://i.stack.imgur.com/aW4Ex.png [4]: http://i.stack.imgur.com/JarKT.png [5]: http://static.canterburyquakelive.co.nz/KML/PlateBoundaries.kml [6]: http://canterburyquakelive.co.nz
0
11,423,384
07/10/2012 23:17:51
413,414
08/06/2010 19:26:52
2,173
53
Strategy for using git-svn with submodules
I would like to use Git locally, with submodules, and be able to push/pull from SVN (The company I'm at uses SVN, and a switchover to Git is nowhere in the near future). I know git-svn doesn't support this, but I'd like to be able to trick it with perhaps a shell script. Any ideas?
git
svn
git-submodules
null
null
null
open
Strategy for using git-svn with submodules === I would like to use Git locally, with submodules, and be able to push/pull from SVN (The company I'm at uses SVN, and a switchover to Git is nowhere in the near future). I know git-svn doesn't support this, but I'd like to be able to trick it with perhaps a shell script. Any ideas?
0
11,423,387
07/10/2012 23:18:07
1,243,034
03/01/2012 15:27:52
67
4
Multiple Trait construction error in Scala
could someone please help me understand the error here? I think I understand anonymous class construction with traits in Scala. However, when I try to apply more than one trait I get an error expecting ";" or essential end of statement. The same problem seems to apply if I declare a class this way as well (with multiple traits that require anonymous implementation lines of code ? Line Test 3 fails below. Thank you. class TestTraits trait A {def x:Int} trait B {def y:Int} object TestTraits { def main(args: Array[String]): Unit = { val test1 = new TestTraits with A {def x=22} //OK val test2 = new TestTraits with B {def y=33} //OK val test3 = new TestTraits with A {def x=22} with B {def y=33} //Errors: - ';' expected but 'with' } }
scala
anonymous-class
null
null
null
null
open
Multiple Trait construction error in Scala === could someone please help me understand the error here? I think I understand anonymous class construction with traits in Scala. However, when I try to apply more than one trait I get an error expecting ";" or essential end of statement. The same problem seems to apply if I declare a class this way as well (with multiple traits that require anonymous implementation lines of code ? Line Test 3 fails below. Thank you. class TestTraits trait A {def x:Int} trait B {def y:Int} object TestTraits { def main(args: Array[String]): Unit = { val test1 = new TestTraits with A {def x=22} //OK val test2 = new TestTraits with B {def y=33} //OK val test3 = new TestTraits with A {def x=22} with B {def y=33} //Errors: - ';' expected but 'with' } }
0
11,423,373
07/10/2012 23:16:19
1,516,229
07/10/2012 23:05:08
1
0
error message:wait_fences: failed to receive reply: 10004003
I do have the same error message:wait_fences: failed to receive reply: 10004003 and here is what my code looks like. What am I doing wrong? - (IBAction)car:(UIButton *) sender { NSString * title1 = [sender titleForState:UIControlStateNormal]; _mylabel.text = title1; UIAlertView *prompt = [[UIAlertView alloc] initWithTitle:@"Expense Amount in $:" message:@"\n\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Enter", nil]; _textField = [[UITextField alloc] initWithFrame:CGRectMake(12, 50, 260, 25)]; [_textField setBackgroundColor:[UIColor whiteColor]]; [_textField setPlaceholder:@"Amount"]; [prompt addSubview:_textField]; _textField.keyboardType = UIKeyboardTypeNumberPad; // show the dialog box [prompt show]; // set cursor and show keyboard [_textField becomeFirstResponder]; }
objective-c
null
null
null
null
07/12/2012 02:08:39
not a real question
error message:wait_fences: failed to receive reply: 10004003 === I do have the same error message:wait_fences: failed to receive reply: 10004003 and here is what my code looks like. What am I doing wrong? - (IBAction)car:(UIButton *) sender { NSString * title1 = [sender titleForState:UIControlStateNormal]; _mylabel.text = title1; UIAlertView *prompt = [[UIAlertView alloc] initWithTitle:@"Expense Amount in $:" message:@"\n\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Enter", nil]; _textField = [[UITextField alloc] initWithFrame:CGRectMake(12, 50, 260, 25)]; [_textField setBackgroundColor:[UIColor whiteColor]]; [_textField setPlaceholder:@"Amount"]; [prompt addSubview:_textField]; _textField.keyboardType = UIKeyboardTypeNumberPad; // show the dialog box [prompt show]; // set cursor and show keyboard [_textField becomeFirstResponder]; }
1
11,423,388
07/10/2012 23:18:13
1,335,129
04/15/2012 21:53:46
96
1
How to make sure client stays connected to WCF service in WPV MVVM app?
I have a WPF application, with a 'Login' window, where the user needs to specify a Username and Password. The WPF application then needs to connect to a WCF service using these credentials, and stay connected to the service during its lifetime, because it receives callback notifications from the service via an ICallback interface. This is the idea ([link to larger image](http://s14.postimage.org/r2gbc9uvz/SO_Question_2.png)): ![This is the idea:](http://s14.postimage.org/r2gbc9uvz/SO_Question_2.png) ***Questions:*** 1. Should the credentials (username & password) information be fed through the Login ViewModel to a static service factory ? 2. Once the service client manages to connect to the WCF service - the Login window should close, and the MainWindow should be shown. How would the main window now know about the service client that the Login window has created ? how would the MainWindow be able to display notifications, once the arrive from the service ? 3. Should the login window pass the service client on to the MainWindow ? this seems like bad coding to me... 4. Say the WCF service goes down for some reason. I would like for the MainWindow to be able to show it (maybe using a red led image). How would the information about a disconnection be passed on from the service factory to the main window's view ? should the view hook to an event in the client ? 5. How would one go on to perform an 'auto-reconnect' to the WCF service in case it disconnects (maybe was taken down for maintenance) ? Anyone who could answer any of the questions would help me a lot...
wpf
wcf
mvvm
client
null
null
open
How to make sure client stays connected to WCF service in WPV MVVM app? === I have a WPF application, with a 'Login' window, where the user needs to specify a Username and Password. The WPF application then needs to connect to a WCF service using these credentials, and stay connected to the service during its lifetime, because it receives callback notifications from the service via an ICallback interface. This is the idea ([link to larger image](http://s14.postimage.org/r2gbc9uvz/SO_Question_2.png)): ![This is the idea:](http://s14.postimage.org/r2gbc9uvz/SO_Question_2.png) ***Questions:*** 1. Should the credentials (username & password) information be fed through the Login ViewModel to a static service factory ? 2. Once the service client manages to connect to the WCF service - the Login window should close, and the MainWindow should be shown. How would the main window now know about the service client that the Login window has created ? how would the MainWindow be able to display notifications, once the arrive from the service ? 3. Should the login window pass the service client on to the MainWindow ? this seems like bad coding to me... 4. Say the WCF service goes down for some reason. I would like for the MainWindow to be able to show it (maybe using a red led image). How would the information about a disconnection be passed on from the service factory to the main window's view ? should the view hook to an event in the client ? 5. How would one go on to perform an 'auto-reconnect' to the WCF service in case it disconnects (maybe was taken down for maintenance) ? Anyone who could answer any of the questions would help me a lot...
0
11,423,390
07/10/2012 23:18:24
1,505,527
07/06/2012 01:32:46
6
0
open/close link button
I need to make my nav link open and close a panel without reloading the main page. I have it to the point were I can open and close the panel by clicking the link, then clicking a close icon without reloading but I want to figure out how to open and close with the nav link instead of the close icon. http://fiddle.jshell.net/S2Pfp/ not a fan of jquery so if possible with just css that would be best. If that's the only option then i'll use it. Thanks!
panel
close
null
null
null
null
open
open/close link button === I need to make my nav link open and close a panel without reloading the main page. I have it to the point were I can open and close the panel by clicking the link, then clicking a close icon without reloading but I want to figure out how to open and close with the nav link instead of the close icon. http://fiddle.jshell.net/S2Pfp/ not a fan of jquery so if possible with just css that would be best. If that's the only option then i'll use it. Thanks!
0
11,423,393
07/10/2012 23:18:41
1,048,566
11/15/2011 22:18:11
118
13
Spritely (jquery plugin) rewind sprite on given frame
I just downloaded the spritely jQuery plugin: http://spritely.net/ I would like to tell the plugin that at frame 11 (last frame of the animation) I would like to reverse the animation. Here's my code: $('#logo').sprite({ fps: 17, no_of_frames: 12, on_frame: { 11: function(obj) { rewind: true } } }); the **rewind: true** functions works if placed as an option next to fps, no_of_frames etc. But I need it only initialized when at frame 11. How can this be achieved? Many thanks!
jquery
jquery-plugins
null
null
null
null
open
Spritely (jquery plugin) rewind sprite on given frame === I just downloaded the spritely jQuery plugin: http://spritely.net/ I would like to tell the plugin that at frame 11 (last frame of the animation) I would like to reverse the animation. Here's my code: $('#logo').sprite({ fps: 17, no_of_frames: 12, on_frame: { 11: function(obj) { rewind: true } } }); the **rewind: true** functions works if placed as an option next to fps, no_of_frames etc. But I need it only initialized when at frame 11. How can this be achieved? Many thanks!
0
11,423,394
07/10/2012 23:18:48
1,487,171
06/28/2012 00:03:58
5
0
SQL - Advance Comparison between 2 tables using "IS LIKE"
Ok this is going to get a bit chaotic so please try to stay with me.. I got a table of information kind of like this... Table Name: Customers _____________________________ ID | CompanyName | FirstName | LastName | Phone ------------------------------- 1 | Joes | Joe | James | 1233334444 2 | Kennys | Kenny | Johnson | 2222334555 3 | Kellys | Kelly | Gibson | 5454445445 4 | Ricks #1 | Rick | Lawson | 4545334222 5 | Johns #1 | Johny B | James | 4545222211 6 | Johns #2 | Johny | James | 4545222211 7 | Johns #3 | Johny | James | 4545222211 8 | Ricks #2 | Rick A | Lawson | 4545334222 I need to know how to create an SQL statement that finds all the duplicate records, adds them up, then displays the total amount of duplicates found with the first company name found. *HERE's THE CATCH - As you see from the table above, sometimes they put their initials with their name (Example - ID5 and ID6 are the same exact person, but he put his middle initial in ID5, you can see the same with ID4 and ID7) I need the SQL statement to base the comparison off first matching the lastname, then doing a "IS LIKE" on the first name and company name "kind-of-thing" to make sure that they are being counted as they should be. For Example - I should get a result similar to... Table Name: TableResults _____________________________ ID | CompanyName | FirstName | LastName | Phone | Count ------------------------------- 4 | Ricks #1 | Rick | Lawson | 4545334222 | 2 5 | Johns #1 | Johny B | James | 4545222211 | 3 Is this even possible?
sql-server
query
null
null
null
null
open
SQL - Advance Comparison between 2 tables using "IS LIKE" === Ok this is going to get a bit chaotic so please try to stay with me.. I got a table of information kind of like this... Table Name: Customers _____________________________ ID | CompanyName | FirstName | LastName | Phone ------------------------------- 1 | Joes | Joe | James | 1233334444 2 | Kennys | Kenny | Johnson | 2222334555 3 | Kellys | Kelly | Gibson | 5454445445 4 | Ricks #1 | Rick | Lawson | 4545334222 5 | Johns #1 | Johny B | James | 4545222211 6 | Johns #2 | Johny | James | 4545222211 7 | Johns #3 | Johny | James | 4545222211 8 | Ricks #2 | Rick A | Lawson | 4545334222 I need to know how to create an SQL statement that finds all the duplicate records, adds them up, then displays the total amount of duplicates found with the first company name found. *HERE's THE CATCH - As you see from the table above, sometimes they put their initials with their name (Example - ID5 and ID6 are the same exact person, but he put his middle initial in ID5, you can see the same with ID4 and ID7) I need the SQL statement to base the comparison off first matching the lastname, then doing a "IS LIKE" on the first name and company name "kind-of-thing" to make sure that they are being counted as they should be. For Example - I should get a result similar to... Table Name: TableResults _____________________________ ID | CompanyName | FirstName | LastName | Phone | Count ------------------------------- 4 | Ricks #1 | Rick | Lawson | 4545334222 | 2 5 | Johns #1 | Johny B | James | 4545222211 | 3 Is this even possible?
0
11,423,395
07/10/2012 23:18:48
911,359
08/25/2011 06:42:32
67
2
Google play receipt verification failing
I do purchase receipt verification from server for android in app purchases. I noticed that since market is changed to Google Play, all of my public key verifications are failing. I've not changed my public key. Is anyone getting the same issue?
android
in-app-purchase
android-market
google-play
null
null
open
Google play receipt verification failing === I do purchase receipt verification from server for android in app purchases. I noticed that since market is changed to Google Play, all of my public key verifications are failing. I've not changed my public key. Is anyone getting the same issue?
0
11,423,397
07/10/2012 23:18:56
1,516,220
07/10/2012 22:59:18
1
0
My jquery drop menu is acting crazy
Hello everyone, I am building a drop menu for my web site and i want to use jquery Its neally working the way i want it to but. I keep getting the shutter effect on the second ul with no effect on the first level.. I know i'm close and missing something obvious. I have included all the css for the menu in the same page for this post Here it is `<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"xml:lang="en" lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="jquery-1.7.2.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('ul#nav li').hover(function() { //When trigger is clicked... var me = this; //Following events are applied to the subnav itself (moving subnav up and down) $(me).find('ul.subnav').slideDown('slow').show(); //Drop down the subnav on click $(me).click(function() { }, function(){ $(me).find('ul.subnav').slideUp('slow'); //When the mouse hovers out of the subnav, move it back up }); }); $('#nav ul ul li:has(ul)').addClass("parent"); $('#nav ul ul li:has(ul)').hover(function(){ $(this).addClass('hoverParent'); $('ul li', this).toggle("fast"); },function(){ $(this).removeClass('hoverParent'); }); }); </script> <!--<link href="style.css" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="style.css"/>--> <style> * { padding: 0px; margin: 0px; } #nav { width: 960px; height: 30px; background-color: #333333; } ul.nav { margin-left: 0px; padding-left: 0px; list-style: none; overflow: visible; } ul.nav li { float: left; position: relative; } ul.nav a { width: 8em; display: block; padding: 5px; text-decoration:none; color: #FFF; text-align: center; } ul.nav li a:hover { color: #33ff66; } .parent { background-image: url("images/arrow-select.png"); background-repeat: no-repeat; background-position: right center; }.parent2 { background-image: url("images/arrow-select.png"); background-repeat: no-repeat; background-position: right center; } .hoverParent { background-image: url("images/arrow.png"); background-repeat: no-repeat; background-position: right center; } div#nav ul ul li { text-decoration: none; color: white; text-align: center; background-color: #333333; border: 1px solid #666 ; border-top-color: #999999; list-style: none; } div#nav ul ul ul { position: absolute; top: 0; left: 100%; } div#nav ul ul { position: absolute; z-index: 500; } div#nav ul ul {display: none;} div#nav ul li:hover ul{display: block;} div#nav ul ul, div#nav ul li:hover ul ul, div#nav ul ul li:hover ul ul {display: none;} div#nav ul li:hover ul, div#nav ul ul li:hover ul, div#nav ul ul ul li:hover ul { display: block; } </style> </head> <body> <div id="nav"> <ul class="nav"> <li><a href="#">Home</a></li> <li><a href="#">Surf Boards</a> <ul class="subnav"> <li ><a href="#">Long Boards</a> <ul class="subnav"> <li ><a href="#">Hard Boards</a></li> <li><a href="#">Soft Boards</a></li> </ul> </li> <li><a href="#">Template 2</a></li> <li><a href="#">Template 3</a></li> </ul></li> <li><a href="reviews.html">Clothing</a> <ul class="subnav"> <li><a href="#">Shorts</a></li> <li><a href="#">Shirts</a></li> <li><a href="#">Hoodies</a></li> </ul> </li> <li><a href="reviews.html">Accessories</a> <ul class="subnav"> <li><a href="#">Stickers</a></li> <li><a href="#">Board Combs</a></li> <li><a href="#">Leg Ropes</a></li> </ul> </li> <li><a href="reviews.html">Events</a> <ul class="subnav"> <li><a href="#">ASAP</a></li> <li><a href="#">Indigenous</a></li> <li><a href="#">International</a></li> </ul> </li> <li><a href="reviews.html">Contact Us</a></li> </ul> </div> </body> </html>`
jquery
css
null
null
null
null
open
My jquery drop menu is acting crazy === Hello everyone, I am building a drop menu for my web site and i want to use jquery Its neally working the way i want it to but. I keep getting the shutter effect on the second ul with no effect on the first level.. I know i'm close and missing something obvious. I have included all the css for the menu in the same page for this post Here it is `<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"xml:lang="en" lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="jquery-1.7.2.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('ul#nav li').hover(function() { //When trigger is clicked... var me = this; //Following events are applied to the subnav itself (moving subnav up and down) $(me).find('ul.subnav').slideDown('slow').show(); //Drop down the subnav on click $(me).click(function() { }, function(){ $(me).find('ul.subnav').slideUp('slow'); //When the mouse hovers out of the subnav, move it back up }); }); $('#nav ul ul li:has(ul)').addClass("parent"); $('#nav ul ul li:has(ul)').hover(function(){ $(this).addClass('hoverParent'); $('ul li', this).toggle("fast"); },function(){ $(this).removeClass('hoverParent'); }); }); </script> <!--<link href="style.css" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="style.css"/>--> <style> * { padding: 0px; margin: 0px; } #nav { width: 960px; height: 30px; background-color: #333333; } ul.nav { margin-left: 0px; padding-left: 0px; list-style: none; overflow: visible; } ul.nav li { float: left; position: relative; } ul.nav a { width: 8em; display: block; padding: 5px; text-decoration:none; color: #FFF; text-align: center; } ul.nav li a:hover { color: #33ff66; } .parent { background-image: url("images/arrow-select.png"); background-repeat: no-repeat; background-position: right center; }.parent2 { background-image: url("images/arrow-select.png"); background-repeat: no-repeat; background-position: right center; } .hoverParent { background-image: url("images/arrow.png"); background-repeat: no-repeat; background-position: right center; } div#nav ul ul li { text-decoration: none; color: white; text-align: center; background-color: #333333; border: 1px solid #666 ; border-top-color: #999999; list-style: none; } div#nav ul ul ul { position: absolute; top: 0; left: 100%; } div#nav ul ul { position: absolute; z-index: 500; } div#nav ul ul {display: none;} div#nav ul li:hover ul{display: block;} div#nav ul ul, div#nav ul li:hover ul ul, div#nav ul ul li:hover ul ul {display: none;} div#nav ul li:hover ul, div#nav ul ul li:hover ul, div#nav ul ul ul li:hover ul { display: block; } </style> </head> <body> <div id="nav"> <ul class="nav"> <li><a href="#">Home</a></li> <li><a href="#">Surf Boards</a> <ul class="subnav"> <li ><a href="#">Long Boards</a> <ul class="subnav"> <li ><a href="#">Hard Boards</a></li> <li><a href="#">Soft Boards</a></li> </ul> </li> <li><a href="#">Template 2</a></li> <li><a href="#">Template 3</a></li> </ul></li> <li><a href="reviews.html">Clothing</a> <ul class="subnav"> <li><a href="#">Shorts</a></li> <li><a href="#">Shirts</a></li> <li><a href="#">Hoodies</a></li> </ul> </li> <li><a href="reviews.html">Accessories</a> <ul class="subnav"> <li><a href="#">Stickers</a></li> <li><a href="#">Board Combs</a></li> <li><a href="#">Leg Ropes</a></li> </ul> </li> <li><a href="reviews.html">Events</a> <ul class="subnav"> <li><a href="#">ASAP</a></li> <li><a href="#">Indigenous</a></li> <li><a href="#">International</a></li> </ul> </li> <li><a href="reviews.html">Contact Us</a></li> </ul> </div> </body> </html>`
0
11,423,399
07/10/2012 23:19:03
1,287,170
03/22/2012 23:35:45
6
0
Reportlab platypus - disable table splitting
I'm making a dynamically generated report in python using Reportlab's Platypus. I have multiple tables that are generated, most only have between 10 and 20 rows. Right now they are being automatically being split at the end of my page, but I would much rather have them stay together on the same page. I have tried setting splitByRow to False upon Table instantiation, but that raises a "Not Implemented" error. Also, I am not allowed make any changes to the reportLab python files, although I can see the code. Maybe I can subclass Table and disable split somehow? What's the easiest way to disable flowable splitting? Thanks!
python
table
split
reportlab
platypus
null
open
Reportlab platypus - disable table splitting === I'm making a dynamically generated report in python using Reportlab's Platypus. I have multiple tables that are generated, most only have between 10 and 20 rows. Right now they are being automatically being split at the end of my page, but I would much rather have them stay together on the same page. I have tried setting splitByRow to False upon Table instantiation, but that raises a "Not Implemented" error. Also, I am not allowed make any changes to the reportLab python files, although I can see the code. Maybe I can subclass Table and disable split somehow? What's the easiest way to disable flowable splitting? Thanks!
0
11,423,400
07/10/2012 23:19:17
902,012
08/19/2011 07:41:02
293
2
Best SQL Type for Variable Value
I have a table that holds PDF's with meta data, it also has 10 anonymous rows in it. These rows can be used to hold any C# Data Type as each user may use it for a different reason. There are a standard set of information on each record, for example PDF Path Data, Description, etc. And then 10 rows called "Key1, key2, key3". The reason for these is the user can rename them on my webpage and store their own data to do with the uploaded PDF File. (They may have information like Customer Name, Publisher Name, Cost, ect) I want to keep these values open to almost any data type.. The question I have, is what SQL datatype should I use? I dont mind having a Character Limit.. But I need to know the most efficient way to store it.. It would be simple to just do Varchar(100) and convert the value in c# as required.
c#
sql
sql-server
null
null
null
open
Best SQL Type for Variable Value === I have a table that holds PDF's with meta data, it also has 10 anonymous rows in it. These rows can be used to hold any C# Data Type as each user may use it for a different reason. There are a standard set of information on each record, for example PDF Path Data, Description, etc. And then 10 rows called "Key1, key2, key3". The reason for these is the user can rename them on my webpage and store their own data to do with the uploaded PDF File. (They may have information like Customer Name, Publisher Name, Cost, ect) I want to keep these values open to almost any data type.. The question I have, is what SQL datatype should I use? I dont mind having a Character Limit.. But I need to know the most efficient way to store it.. It would be simple to just do Varchar(100) and convert the value in c# as required.
0
11,693,052
07/27/2012 17:50:33
379,888
06/30/2010 09:47:17
1,821
46
How to add all of the websites Google has indexed to a Google Custom Search
I want to add all of the websites indexed by Google in a Google custom search. If I try to add sites manually from the Google custom search, it would take more than my life to include all of them.Is there any way I can do that with any trick? Thanks in advance.
html
google
google-search
google-search-api
google-custom-search
null
open
How to add all of the websites Google has indexed to a Google Custom Search === I want to add all of the websites indexed by Google in a Google custom search. If I try to add sites manually from the Google custom search, it would take more than my life to include all of them.Is there any way I can do that with any trick? Thanks in advance.
0
11,693,055
07/27/2012 17:50:37
498,007
11/05/2010 04:47:21
59
1
AS3: Force Save an Xml File
I want to know if there's a way to force users to save an xml file at a certain location. i.e. they can't choose where to save the file. I want it to always be saved in the same location as the swf file. ----- Thanks in advance for your help.
xml
actionscript-3
flash
save
swf
null
open
AS3: Force Save an Xml File === I want to know if there's a way to force users to save an xml file at a certain location. i.e. they can't choose where to save the file. I want it to always be saved in the same location as the swf file. ----- Thanks in advance for your help.
0
11,693,056
07/27/2012 17:50:38
1,011,713
10/24/2011 21:30:19
135
0
Image not showing up on Jquery Prepend
I have the following function that prepends a modal and display box with a gif loader when my user logs into Facebook. function loadFacebookconnect(){$("#modalwait").prepend("<div class='modal-backdrop id='modal-backdropid'></div><div class='modal hide fade in' id='myModal' style='display: block; '><div class='modal-body'><p style='font-size: 28px; padding: 30px;text-align: center;'><img style='padding-right:8px; vertical-align: text-bottom;' src='imgurl.gif'>Loading...</p></div> </div>");} I call this function as I mentioned when the user authenticated with Facebook: FB.Event.subscribe('auth.login', function(response) { loadFacebookconnect(); window.location.reload(); }); My simple problem is that my image won't load when I authenticate with FB. The modal shows up and so does the text but no image. I know there's nothing wrong with the image or the CSS because when I call it regularly as shown below, it works perfectly and the image shows up. <button onclick="loadFacebookconnect()">Try it</button> Any help is greatly appreciated and I know this problem may seem trivial but the image loader is very important as my initial graph calls do tend to take several seconds. I also looked at several SO questions such as, http://stackoverflow.com/questions/9524458/why-does-my-image-not-show-up-when-i-use-javascript-innerhtml-to-call-it but couldn't find the solution.
javascript
jquery
null
null
null
null
open
Image not showing up on Jquery Prepend === I have the following function that prepends a modal and display box with a gif loader when my user logs into Facebook. function loadFacebookconnect(){$("#modalwait").prepend("<div class='modal-backdrop id='modal-backdropid'></div><div class='modal hide fade in' id='myModal' style='display: block; '><div class='modal-body'><p style='font-size: 28px; padding: 30px;text-align: center;'><img style='padding-right:8px; vertical-align: text-bottom;' src='imgurl.gif'>Loading...</p></div> </div>");} I call this function as I mentioned when the user authenticated with Facebook: FB.Event.subscribe('auth.login', function(response) { loadFacebookconnect(); window.location.reload(); }); My simple problem is that my image won't load when I authenticate with FB. The modal shows up and so does the text but no image. I know there's nothing wrong with the image or the CSS because when I call it regularly as shown below, it works perfectly and the image shows up. <button onclick="loadFacebookconnect()">Try it</button> Any help is greatly appreciated and I know this problem may seem trivial but the image loader is very important as my initial graph calls do tend to take several seconds. I also looked at several SO questions such as, http://stackoverflow.com/questions/9524458/why-does-my-image-not-show-up-when-i-use-javascript-innerhtml-to-call-it but couldn't find the solution.
0
11,693,059
07/27/2012 17:50:55
470,925
10/09/2010 15:31:28
384
4
Android Dev: Is it possible to develop on top of/customize the Contacts App?
This is a pretty niche question, I'm sure, but basically what I'd like to know is whether it's possible for a new app to modify the existing Contacts app in Android. For a (very) simple example, consider an app that allows you to color your girlfriend's contact slot pink, or highlight all of your family members. Simple things like that, to change the appearance of individual contacts. Note that I do not want to create a new Contacts app. This is obviously possible and has been done. I simply would like to alter, or perhaps customize, the existing native Android Contacts App.
android
contacts
android-contacts
null
null
null
open
Android Dev: Is it possible to develop on top of/customize the Contacts App? === This is a pretty niche question, I'm sure, but basically what I'd like to know is whether it's possible for a new app to modify the existing Contacts app in Android. For a (very) simple example, consider an app that allows you to color your girlfriend's contact slot pink, or highlight all of your family members. Simple things like that, to change the appearance of individual contacts. Note that I do not want to create a new Contacts app. This is obviously possible and has been done. I simply would like to alter, or perhaps customize, the existing native Android Contacts App.
0
11,693,062
07/27/2012 17:51:27
1,481,372
06/26/2012 00:32:44
31
0
Long insert query
I want to insert about 12500 lines into my database for a map for a game server. this is my script generates the query sql = "INSERT INTO `legends`.`map` (`x`, `y`, `land`, `collision`, `impedance`, `effect`) VALUES " for (y=0;y<ig.game.collisionMap.data.length;y++){ for (x=0;x<ig.game.collisionMap.data[y].length;x++){ if (x==0&&y==0){ comma="" }else{ comma="," } sql=sql+comma+"("+x*55+","+y*55+",'kesmai',"+ig.game.collisionMap.data[y][x]+","+ig.game.backgroundMaps[0].data[y][x]+", '0')"; } } console.log(sql) The output is y=86 x=145 My client side script has access to the data for the maps so I was just pasting the output to phpMyAdmin to run the query. The problem I hit (which I expected) was my php script can only run 30 seconds this is my error. Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\apps\phpmyadmin3.4.10.1\libraries\session.inc.php on line 92 I am running a WAMP server and I tried to edit my php.ini file here ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI max_execution_time = 0 ; Maximum amount of time each script may spend parsing request data. It's a good ; idea to limit this time on productions servers in order to eliminate unexpectedly ; long running scripts. ; Note: This directive is hardcoded to -1 for the CLI SAPI ; Default Value: -1 (Unlimited) ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) ; http://php.net/max-input-time max_input_time = -1 no luck so far... Any suggestions on how to run a long query such as this>? I was considering temporarily putting it in my server script which runs in node.js
php
javascript
mysql
node.js
wamp
null
open
Long insert query === I want to insert about 12500 lines into my database for a map for a game server. this is my script generates the query sql = "INSERT INTO `legends`.`map` (`x`, `y`, `land`, `collision`, `impedance`, `effect`) VALUES " for (y=0;y<ig.game.collisionMap.data.length;y++){ for (x=0;x<ig.game.collisionMap.data[y].length;x++){ if (x==0&&y==0){ comma="" }else{ comma="," } sql=sql+comma+"("+x*55+","+y*55+",'kesmai',"+ig.game.collisionMap.data[y][x]+","+ig.game.backgroundMaps[0].data[y][x]+", '0')"; } } console.log(sql) The output is y=86 x=145 My client side script has access to the data for the maps so I was just pasting the output to phpMyAdmin to run the query. The problem I hit (which I expected) was my php script can only run 30 seconds this is my error. Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\apps\phpmyadmin3.4.10.1\libraries\session.inc.php on line 92 I am running a WAMP server and I tried to edit my php.ini file here ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI max_execution_time = 0 ; Maximum amount of time each script may spend parsing request data. It's a good ; idea to limit this time on productions servers in order to eliminate unexpectedly ; long running scripts. ; Note: This directive is hardcoded to -1 for the CLI SAPI ; Default Value: -1 (Unlimited) ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) ; http://php.net/max-input-time max_input_time = -1 no luck so far... Any suggestions on how to run a long query such as this>? I was considering temporarily putting it in my server script which runs in node.js
0
11,692,285
07/27/2012 16:56:26
1,013,896
10/26/2011 03:29:16
8
0
Automate Multiple SCP Transfers in Python w/o Keys
I need to copy two programs from one server to another after compiling using an automated non-interactive python script. Keys are not an option as this script is for multiple users on company servers and both keys and passwords are required. Passwords are not being stored in the program, but are being asked once at the start of the program using getpass(), and then used for both SCP transfers so that the user doesn't have to enter their password for each scp call. I'm using os.system to call scp: os.system("/usr/bin/scp %s %s@server:directory" %(prg, uname)) os.system("/usr/bin/scp %s %s@server:directory2" %(prg2, uname)) scp is defined for another program, thus /usr/bin/scp. prg/prg2 is the program's location and uname is the users username on the remote server(s). I tried piping the password, like [described here][1], however it did not work. I can't install sshpass, expect, paramiko, or fabric, and I can't use rsync b/c it isn't installed on the receiving server. Is there anything that I can do to automate this? [1]: http://serverfault.com/a/318482
python
script
ssh
automation
scp
null
open
Automate Multiple SCP Transfers in Python w/o Keys === I need to copy two programs from one server to another after compiling using an automated non-interactive python script. Keys are not an option as this script is for multiple users on company servers and both keys and passwords are required. Passwords are not being stored in the program, but are being asked once at the start of the program using getpass(), and then used for both SCP transfers so that the user doesn't have to enter their password for each scp call. I'm using os.system to call scp: os.system("/usr/bin/scp %s %s@server:directory" %(prg, uname)) os.system("/usr/bin/scp %s %s@server:directory2" %(prg2, uname)) scp is defined for another program, thus /usr/bin/scp. prg/prg2 is the program's location and uname is the users username on the remote server(s). I tried piping the password, like [described here][1], however it did not work. I can't install sshpass, expect, paramiko, or fabric, and I can't use rsync b/c it isn't installed on the receiving server. Is there anything that I can do to automate this? [1]: http://serverfault.com/a/318482
0
11,693,030
07/27/2012 17:49:05
1,131,073
01/05/2012 00:03:26
56
3
Should I be using a function pointer? C++ and Objective-C
I am writing a Cocoa application that uses a C++ library that I am also writing. I want the C++ library to be able to call a draw method in the Cocoa application. *Specifics* - to put it into context, I am running OpenNi skeletal tracking and recording the skeletal data. At each new frame, I want to tell the Objective-C code that it can/should draw the data to screen. The OpenNI tracking code is called by (and has a handle to) a control object SkeletalModuleControl. The only object the Objective-C code interacts with is this control class. My thoughts are that it would be best to create callDraw and registerDraw methods in the control class. The Objective-C code would register its draw method (or multiple draw methods?) and the callDraw would call the registered draw methods (if any).
c++
objective-c
function-pointers
member-function-pointers
null
null
open
Should I be using a function pointer? C++ and Objective-C === I am writing a Cocoa application that uses a C++ library that I am also writing. I want the C++ library to be able to call a draw method in the Cocoa application. *Specifics* - to put it into context, I am running OpenNi skeletal tracking and recording the skeletal data. At each new frame, I want to tell the Objective-C code that it can/should draw the data to screen. The OpenNI tracking code is called by (and has a handle to) a control object SkeletalModuleControl. The only object the Objective-C code interacts with is this control class. My thoughts are that it would be best to create callDraw and registerDraw methods in the control class. The Objective-C code would register its draw method (or multiple draw methods?) and the callDraw would call the registered draw methods (if any).
0
11,693,031
07/27/2012 17:49:09
429,280
08/24/2010 08:16:29
67
0
Setting BaseURL for Codeigniter
I set my baseurl to : http://localhost/codeigniter/ in the `application/config/config.php file` as asked by the installation instructions on this page : http://codeigniter.com/user_guide/installation/index.html. I was following the first tutorial on this page : http://codeigniter.com/user_guide/tutorial/static_pages.html . However, when I type in the url : `http://localhost/codeigniter/index.php/pages/view` , I get the error of : Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhost 7/27/2012 11:14:39 PM Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 I found the following contents in `.htaccess` file : Deny from all I am totally new to `codeigniter` framework. Can someone help me out ?? Thanks and Regards.
php
codeigniter
null
null
null
null
open
Setting BaseURL for Codeigniter === I set my baseurl to : http://localhost/codeigniter/ in the `application/config/config.php file` as asked by the installation instructions on this page : http://codeigniter.com/user_guide/installation/index.html. I was following the first tutorial on this page : http://codeigniter.com/user_guide/tutorial/static_pages.html . However, when I type in the url : `http://localhost/codeigniter/index.php/pages/view` , I get the error of : Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhost 7/27/2012 11:14:39 PM Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 I found the following contents in `.htaccess` file : Deny from all I am totally new to `codeigniter` framework. Can someone help me out ?? Thanks and Regards.
0
11,693,032
07/27/2012 17:49:12
582,084
01/19/2011 20:43:58
1
1
does find_under_expand_skip not work on mac sublime?
does find_under_expand_skip not work on mac sublime? Hi I have been trying this on and off for the last week. I use the "find_under_expand" all the time and when I heard out the ability to skip certain variables it made total sense but I haven't been able to get this to work. any thoughts? cheers Will
sublimetext2
null
null
null
null
null
open
does find_under_expand_skip not work on mac sublime? === does find_under_expand_skip not work on mac sublime? Hi I have been trying this on and off for the last week. I use the "find_under_expand" all the time and when I heard out the ability to skip certain variables it made total sense but I haven't been able to get this to work. any thoughts? cheers Will
0
11,693,065
07/27/2012 17:52:00
1,274,954
03/16/2012 20:57:56
58
4
Fast way to get and update disk space usage?
I need to monitor the network disk space usage and generate report listing directories and their sizes per user.<br/> There are directories containing over 1000 files with each one 20mb big.<br/> Speed is the key as the report needs to be updated frequently.<br/> My Python script walks given directory and store each dir and file info into a dictionary of lists.<br/> Post-process of the dictionary is swift. I/O is the bottleneck. With current script, a 35TB directory takes roughly 5-6 hours to scan. I've tried the plain *os.walk* & *stat*, suprocessing *du*, *find -type f -printf*. ###os.walk and du### They both drill down to the bottom and stat every dirs, files. While this is required for the initial run, subsequent updates take hits from unnecessarily stat'ing unmodified directories and files. And I can't set the max-depth since I need to know what's changed in subdirs, if anything's been changed. ###find -type f### This will look for files only. Not much of difference from above. At least this doesn't stat directories (directory info are gathered from residing files). No noticeable improvement in speed. I had hoped to use directory's *modified time* to check whether something's been changed inside. If so, dive in, else skip. But *mtime* only updates for created, deleted, renamed items in the directory. So is there no other way than this brute-forcing through all the dirs and files?
python
unix
diskspace
null
null
null
open
Fast way to get and update disk space usage? === I need to monitor the network disk space usage and generate report listing directories and their sizes per user.<br/> There are directories containing over 1000 files with each one 20mb big.<br/> Speed is the key as the report needs to be updated frequently.<br/> My Python script walks given directory and store each dir and file info into a dictionary of lists.<br/> Post-process of the dictionary is swift. I/O is the bottleneck. With current script, a 35TB directory takes roughly 5-6 hours to scan. I've tried the plain *os.walk* & *stat*, suprocessing *du*, *find -type f -printf*. ###os.walk and du### They both drill down to the bottom and stat every dirs, files. While this is required for the initial run, subsequent updates take hits from unnecessarily stat'ing unmodified directories and files. And I can't set the max-depth since I need to know what's changed in subdirs, if anything's been changed. ###find -type f### This will look for files only. Not much of difference from above. At least this doesn't stat directories (directory info are gathered from residing files). No noticeable improvement in speed. I had hoped to use directory's *modified time* to check whether something's been changed inside. If so, dive in, else skip. But *mtime* only updates for created, deleted, renamed items in the directory. So is there no other way than this brute-forcing through all the dirs and files?
0
11,298,131
07/02/2012 17:10:22
1,075,924
12/01/2011 16:58:29
361
16
Apache Mod_rewrite to change directories
I have been all over trying to figure this out. I apologize if this is a repeat question but I can't seem to find the appropriate solution. What I'm trying to accomplish is the following: Given the URL `dev-<sub>.example.com/resources/path/to/resource`, where `sub` varies, go to `/var/www/devEx_<sub>/override/resources/path/to/resource` if it yields a file or `/var/www/devEx_<sub>/main/resources/path/to/resource` otherwise (I can handle the 404s). I can figure out a solution where I manually add each individual `sub` but I cannot figure out how to do it with a wildcard or backreference. I've tried messing with `VirtualDocumentRoot` but I can never get the `devEx_<sub>` portion to show up in the `DOCUMENT_ROOT` for checking the resource. I tried using a solution similar to this [ http://stackoverflow.com/questions/4069898/mod-rewrite-regex-too-many-redirects/4075369#4075369 ] but it always messes with the `REQUEST_URI`. I've tried using something like this in the past: RewriteCond $1 (^resources/.*) RewriteCond %{DOCUMENT_ROOT}/override%{REQUEST_URI} -f RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/path1%{REQUEST_URI} [QSA,L] RewriteCond $1 (^resources/.*) RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/main%{REQUEST_URI} [QSA,L] Also, I would really love to understand using Apache / Mod_rewrite more so, if you have suggestions for a good technical guide or tutorial that would have helped me with this or some debugging techniques (since I have no idea how to debug these rewrite rules), I would greatly appreciate the knowledge so please share!
apache
mod-rewrite
null
null
null
null
open
Apache Mod_rewrite to change directories === I have been all over trying to figure this out. I apologize if this is a repeat question but I can't seem to find the appropriate solution. What I'm trying to accomplish is the following: Given the URL `dev-<sub>.example.com/resources/path/to/resource`, where `sub` varies, go to `/var/www/devEx_<sub>/override/resources/path/to/resource` if it yields a file or `/var/www/devEx_<sub>/main/resources/path/to/resource` otherwise (I can handle the 404s). I can figure out a solution where I manually add each individual `sub` but I cannot figure out how to do it with a wildcard or backreference. I've tried messing with `VirtualDocumentRoot` but I can never get the `devEx_<sub>` portion to show up in the `DOCUMENT_ROOT` for checking the resource. I tried using a solution similar to this [ http://stackoverflow.com/questions/4069898/mod-rewrite-regex-too-many-redirects/4075369#4075369 ] but it always messes with the `REQUEST_URI`. I've tried using something like this in the past: RewriteCond $1 (^resources/.*) RewriteCond %{DOCUMENT_ROOT}/override%{REQUEST_URI} -f RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/path1%{REQUEST_URI} [QSA,L] RewriteCond $1 (^resources/.*) RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/main%{REQUEST_URI} [QSA,L] Also, I would really love to understand using Apache / Mod_rewrite more so, if you have suggestions for a good technical guide or tutorial that would have helped me with this or some debugging techniques (since I have no idea how to debug these rewrite rules), I would greatly appreciate the knowledge so please share!
0
11,298,134
07/02/2012 17:10:59
639,877
03/01/2011 18:23:35
115
2
User Authorization with CanCan
Im using CanCan for authorization in my app. I currently have all of each users information stored at /users/2 or users/3 or /users/4 and so on. My problem is that when a user logs in they can just amend the URL and see other users sensitive content. How can I use CanCan to prevent a user (say users/2) from seeing (users/3) ? I tried placing `authorize! :view, @user, :message => 'Not authorized as an administrator.'` in my users_controller => show action but that is not working.. Thanks! Models class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user (not logged in) if user.has_role? :admin can :manage, :all can :access, :rails_admin can :dashboard else can :manage, User, :user_id => user.id end Controllers class ApplicationController < ActionController::Base protect_from_forgery rescue_from CanCan::AccessDenied do |exception| redirect_to root_path, :alert => exception.message end class UsersController < ApplicationController before_filter :authenticate_user! def show authorize! :view, @user, :message => 'Not authorized as an administrator.' @user = User.find(params[:id]) end
ruby-on-rails
ruby-on-rails-3
ruby-on-rails-3.1
authorization
cancan
null
open
User Authorization with CanCan === Im using CanCan for authorization in my app. I currently have all of each users information stored at /users/2 or users/3 or /users/4 and so on. My problem is that when a user logs in they can just amend the URL and see other users sensitive content. How can I use CanCan to prevent a user (say users/2) from seeing (users/3) ? I tried placing `authorize! :view, @user, :message => 'Not authorized as an administrator.'` in my users_controller => show action but that is not working.. Thanks! Models class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user (not logged in) if user.has_role? :admin can :manage, :all can :access, :rails_admin can :dashboard else can :manage, User, :user_id => user.id end Controllers class ApplicationController < ActionController::Base protect_from_forgery rescue_from CanCan::AccessDenied do |exception| redirect_to root_path, :alert => exception.message end class UsersController < ApplicationController before_filter :authenticate_user! def show authorize! :view, @user, :message => 'Not authorized as an administrator.' @user = User.find(params[:id]) end
0
11,298,138
07/02/2012 17:11:08
1,496,626
07/02/2012 16:30:28
1
0
How to scale images for cocos2d game to iPhone/iPad (with and without Retina)
I'm working on a game in cocos2d (1.0.1), my artist sent me psd project files, all 3200x1800 resolution 300ppi. I'm supposed to make it for iPad and iPhone with and without Retina display. I realised I don't know nothing about graphics. What is the best way to prepare images for iPhone and iPad (both hd and sd). Should I scale it to 480x320? Should I use apps like Texture Packer? How to do it properly without any loss?
image
cocos2d
texture
retina
packer
null
open
How to scale images for cocos2d game to iPhone/iPad (with and without Retina) === I'm working on a game in cocos2d (1.0.1), my artist sent me psd project files, all 3200x1800 resolution 300ppi. I'm supposed to make it for iPad and iPhone with and without Retina display. I realised I don't know nothing about graphics. What is the best way to prepare images for iPhone and iPad (both hd and sd). Should I scale it to 480x320? Should I use apps like Texture Packer? How to do it properly without any loss?
0
11,298,141
07/02/2012 17:11:28
329,931
04/30/2010 16:45:22
367
14
How to mix jQuery and a UiInstance for generating GUIs
I've got a fairly basic dialog form worked out using the GUI builder. However I would like to put a slider widget in the form. (don't ask!) The jQuery UI lib has a slider, but it seems that in order to get all the jQuery scripts and css loaded into the template, I have to switch to the HTML service instead of UI service for page generation. At the moment I have my Gui builder form working ok, running something like this; function doGet(e) { var app = UiApp.createApplication(); app.add(app.loadComponent("DocEditorGui")); return app; } and I have a jQuery slider in a html page that I can pull in like this; function doGet(e) { return HtmlService.createHtmlOutputFromFile('mySliderWidget'); } However using an HTML file seems to be incompatible with the app.createHTML() HTML type widget, in that nothing is displayed if I pass the HTMLoutput contents. The HTML is definitely processed, as Logger.log shows the correct jQuery and html. var t = HtmlService.createHtmlOutputFromFile('mySliderWidget'); var widgetHTML = container.createHTML(t.getContent()); widgetHTML.setStyleAttribute("background", "green"); Logger.log( t.getContent() ); vPanel.add(widgetHTML ); However presumably this is getting caught by caja also, because the effect appears to be stripping out all of the id tags for jQuery. The HTML is added, its all broken for jQuery. Is there an example for this use-case, or am I way too early to be trying things like this? As an test-case, this jQUery slider example; http://pastebin.com/bnY7PhCL runs in the caja playground here; http://code.google.com/p/google-caja/wiki/CajaPlayground but does not run under HTML widget as above.
google-apps-script
null
null
null
null
null
open
How to mix jQuery and a UiInstance for generating GUIs === I've got a fairly basic dialog form worked out using the GUI builder. However I would like to put a slider widget in the form. (don't ask!) The jQuery UI lib has a slider, but it seems that in order to get all the jQuery scripts and css loaded into the template, I have to switch to the HTML service instead of UI service for page generation. At the moment I have my Gui builder form working ok, running something like this; function doGet(e) { var app = UiApp.createApplication(); app.add(app.loadComponent("DocEditorGui")); return app; } and I have a jQuery slider in a html page that I can pull in like this; function doGet(e) { return HtmlService.createHtmlOutputFromFile('mySliderWidget'); } However using an HTML file seems to be incompatible with the app.createHTML() HTML type widget, in that nothing is displayed if I pass the HTMLoutput contents. The HTML is definitely processed, as Logger.log shows the correct jQuery and html. var t = HtmlService.createHtmlOutputFromFile('mySliderWidget'); var widgetHTML = container.createHTML(t.getContent()); widgetHTML.setStyleAttribute("background", "green"); Logger.log( t.getContent() ); vPanel.add(widgetHTML ); However presumably this is getting caught by caja also, because the effect appears to be stripping out all of the id tags for jQuery. The HTML is added, its all broken for jQuery. Is there an example for this use-case, or am I way too early to be trying things like this? As an test-case, this jQUery slider example; http://pastebin.com/bnY7PhCL runs in the caja playground here; http://code.google.com/p/google-caja/wiki/CajaPlayground but does not run under HTML widget as above.
0
11,298,144
07/02/2012 17:11:33
1,068,329
11/27/2011 20:57:16
6
0
fatal error cannot open sdl.obj visual C++ 2010
I have downloaded the SDL for visual C++ on the sdl website, followed instructions on http://www.sdltutorials.com/sdl-tutorial-basics?CommentsPage=3#Comments Including setting the project properties Library dependencies, setting include and lib directory. It still comes up with SDL.obj cannot be opened. I tried changing the security on it to full access for all users even "ublocked" the sdl.obj file in windows 8. Please help?
visual-studio-2010
sdl
null
null
null
null
open
fatal error cannot open sdl.obj visual C++ 2010 === I have downloaded the SDL for visual C++ on the sdl website, followed instructions on http://www.sdltutorials.com/sdl-tutorial-basics?CommentsPage=3#Comments Including setting the project properties Library dependencies, setting include and lib directory. It still comes up with SDL.obj cannot be opened. I tried changing the security on it to full access for all users even "ublocked" the sdl.obj file in windows 8. Please help?
0
11,298,145
07/02/2012 17:11:42
1,233,359
02/26/2012 04:07:14
43
3
Spring MVC and tiles -- how to set non-boolean "true/false" to checkbox
I have a web application with back end table has a column called `type` and another column called `value`. `type` indicates the components type (textfield, combobox, checkbox..etc), `value` is the actual value of the component, both columns are VARCHAR2. The challenge is, when the type is `combobox`, then the `value` of the component is either `true` or `false` in String. And I have no privilege to modify the database attribute. Then when I put a checkbox on the front end: <field:checkbox field="enableEditing.setting" id="systemsetting_${formSettings.enableEditing.name}" z="user-managed"/> I get the following exception: Attribute 'value' is required when binding to non-boolean values even I make a `value` attribute in the `checkbox.tagx`, <field:checkbox field="enableEditing.setting" id="systemsetting_${formSettings.enableEditing.name}" value="${formSettings.enableEditing.setting}" z="user-managed"/> I still have the same exception. It seems like if the field is not a `boolean` type, then there is no way to make the checkbox work. But I know I must break something, so please enlighten me and thanks in advance.
jsp
spring-mvc
tags
jstl
tiles
null
open
Spring MVC and tiles -- how to set non-boolean "true/false" to checkbox === I have a web application with back end table has a column called `type` and another column called `value`. `type` indicates the components type (textfield, combobox, checkbox..etc), `value` is the actual value of the component, both columns are VARCHAR2. The challenge is, when the type is `combobox`, then the `value` of the component is either `true` or `false` in String. And I have no privilege to modify the database attribute. Then when I put a checkbox on the front end: <field:checkbox field="enableEditing.setting" id="systemsetting_${formSettings.enableEditing.name}" z="user-managed"/> I get the following exception: Attribute 'value' is required when binding to non-boolean values even I make a `value` attribute in the `checkbox.tagx`, <field:checkbox field="enableEditing.setting" id="systemsetting_${formSettings.enableEditing.name}" value="${formSettings.enableEditing.setting}" z="user-managed"/> I still have the same exception. It seems like if the field is not a `boolean` type, then there is no way to make the checkbox work. But I know I must break something, so please enlighten me and thanks in advance.
0
11,298,146
07/02/2012 17:11:45
1,005,787
10/20/2011 18:04:11
155
4
Creating custom objects inherit NSObject class
Using different frameworks in my projects I have often faced with custom elements which created as class inherit from NSObject (correct me if something is wrong). What are the main rules of creating such UI elements?
iphone
objective-c
ios
nsobject
null
null
open
Creating custom objects inherit NSObject class === Using different frameworks in my projects I have often faced with custom elements which created as class inherit from NSObject (correct me if something is wrong). What are the main rules of creating such UI elements?
0