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,660,687
07/26/2012 00:27:17
1,553,100
07/25/2012 23:39:12
1
0
multiple SQLite select query in javascript
In a phonegap app, users will be able to identify flowers by color, habitat, or bloom season. But not necessarily all three. Some users may search just by season. Or color and habitat. The table looks like: ----------------------------------------------------------- id | name | color | spring | summer | fall | habitat 1 | spiderwort | blue | T | T | F | p 2 | coneflower | yellow | F | T | F | p 3 | trillum | white | T | F | F | w 4 | wood poppy | yellow | T | F | F| w 5 | aster | pink | F | T | T | p -------------------------------------------------------- Is there a better way to handle the SELECT queries than using a bunch of IF statements based on which of the one, two or three search criteria the users makes? $.mobile.flowerDb.transaction(function(t){ if (xcolor!="" && xhabitat!=""){ t.executeSql('SELECT * FROM flowersTable WHERE color=? AND habitat=?' ,[xcolor, xhabitat], function(t,results){ .... Any thoughts on this greatly appreciated.
javascript
sqlite
multiple-select
null
null
null
open
multiple SQLite select query in javascript === In a phonegap app, users will be able to identify flowers by color, habitat, or bloom season. But not necessarily all three. Some users may search just by season. Or color and habitat. The table looks like: ----------------------------------------------------------- id | name | color | spring | summer | fall | habitat 1 | spiderwort | blue | T | T | F | p 2 | coneflower | yellow | F | T | F | p 3 | trillum | white | T | F | F | w 4 | wood poppy | yellow | T | F | F| w 5 | aster | pink | F | T | T | p -------------------------------------------------------- Is there a better way to handle the SELECT queries than using a bunch of IF statements based on which of the one, two or three search criteria the users makes? $.mobile.flowerDb.transaction(function(t){ if (xcolor!="" && xhabitat!=""){ t.executeSql('SELECT * FROM flowersTable WHERE color=? AND habitat=?' ,[xcolor, xhabitat], function(t,results){ .... Any thoughts on this greatly appreciated.
0
11,660,688
07/26/2012 00:27:22
975,947
10/03/2011 01:18:29
172
3
Grab results from mysql and apply each result to variable and finally output
So what I'm trying to do is: Run this query:`SELECT FW_ArtSrcLink FROM FW_ArtSrc WHERE OneSet =1` which outputs two results:![img1][1] [1]: http://i.stack.imgur.com/UmsOf.png I want to append the two results to the `$result` var and interiate through the results (being 2 - as shown in the picture) as `$r`, then output the parts of `$r` thus being # Source of Article Info--> $SrcTitle=$newsStory[$i]->title; $SrcLink=$newsStory[$i]->link; # Actual News Article Info --> $title=$newsStory[$i]->title; $desc=$newsStory[$i]->description; Full code looking like below which currently is ONLY pulling from the second result from *sports.yahoo.com/tennis/rss.xml*: ## Loop through results from mysql try{ #connection string // $dbconn = new PDO('mysql:host=localhost;port=3306;dbname=mydatabase',array(PDO::ATTR_PERSISTENT => true)); $dbconn = new PDO('mysql:host=localhost;port=3306;dbname=mydatabase','myuser','mypass',array(PDO::ATTR_PERSISTENT => true)); $q = $dbconn->prepare("SELECT FW_ArtSrcLink FROM FW_ArtSrc WHERE OneSet=1"); #call stored proc $q->execute(); #get the rows into an array $result = $q->fetchAll(); $newsStory[] = array(); foreach($result as $r){ $xmlUrl = $r['FW_ArtSrcLink']; $ConvertToXml = simplexml_load_file($xmlUrl); # -> Setup XML $newsStory = $ConvertToXml->channel->item; } # -----> Load News Stories for($i = 0;$i<sizeof($newsStory); $i++){ # Source of Article Info--> $SrcTitle=$newsStory[$i]->title; $SrcLink=$newsStory[$i]->link; # Actual News Article Info --> $title=$newsStory[$i]->title; $desc=$newsStory[$i]->description; # Output Results ------------> echo '<hr>'; echo '<strong>'.'Title:'.$title.'</strong>'.'(via: <a href=\''.$SrcLink.'\'>'.$SrcTitle.'</a>'.'<br />'; //echo 'Link:'.$link.'<br />'; echo 'Description'.$desc.'<br>'; ##echo 'count '.count($result); echo '<hr>'; } } // try What am I doing wrong here?
php
mysql
xml
foreach
null
null
open
Grab results from mysql and apply each result to variable and finally output === So what I'm trying to do is: Run this query:`SELECT FW_ArtSrcLink FROM FW_ArtSrc WHERE OneSet =1` which outputs two results:![img1][1] [1]: http://i.stack.imgur.com/UmsOf.png I want to append the two results to the `$result` var and interiate through the results (being 2 - as shown in the picture) as `$r`, then output the parts of `$r` thus being # Source of Article Info--> $SrcTitle=$newsStory[$i]->title; $SrcLink=$newsStory[$i]->link; # Actual News Article Info --> $title=$newsStory[$i]->title; $desc=$newsStory[$i]->description; Full code looking like below which currently is ONLY pulling from the second result from *sports.yahoo.com/tennis/rss.xml*: ## Loop through results from mysql try{ #connection string // $dbconn = new PDO('mysql:host=localhost;port=3306;dbname=mydatabase',array(PDO::ATTR_PERSISTENT => true)); $dbconn = new PDO('mysql:host=localhost;port=3306;dbname=mydatabase','myuser','mypass',array(PDO::ATTR_PERSISTENT => true)); $q = $dbconn->prepare("SELECT FW_ArtSrcLink FROM FW_ArtSrc WHERE OneSet=1"); #call stored proc $q->execute(); #get the rows into an array $result = $q->fetchAll(); $newsStory[] = array(); foreach($result as $r){ $xmlUrl = $r['FW_ArtSrcLink']; $ConvertToXml = simplexml_load_file($xmlUrl); # -> Setup XML $newsStory = $ConvertToXml->channel->item; } # -----> Load News Stories for($i = 0;$i<sizeof($newsStory); $i++){ # Source of Article Info--> $SrcTitle=$newsStory[$i]->title; $SrcLink=$newsStory[$i]->link; # Actual News Article Info --> $title=$newsStory[$i]->title; $desc=$newsStory[$i]->description; # Output Results ------------> echo '<hr>'; echo '<strong>'.'Title:'.$title.'</strong>'.'(via: <a href=\''.$SrcLink.'\'>'.$SrcTitle.'</a>'.'<br />'; //echo 'Link:'.$link.'<br />'; echo 'Description'.$desc.'<br>'; ##echo 'count '.count($result); echo '<hr>'; } } // try What am I doing wrong here?
0
11,660,691
07/26/2012 00:27:43
1,389,823
05/11/2012 15:44:43
1
0
Unable to post a form due to ValidationSummary errors on form fields that are hidden dynamically through javaScript.
ASP.NET MVC 3 application. I am trying to post form that has some dynamic fields which appear and disappear using JavaScript. I am using IValidatableObject for doing server side validation on some of these dynamic fields. When these fields are visible and I post the form, validation works fine and it gives appropriate error message in the ValidationSummary and posts back. Now while these error messages are there and I hide these fields using document.getElementById("schoolNotListed").style.display = "none"; and I try to post the form again, it pops up the ValidationSummary error each time. The control doesn't reach the controller neither does it reach the Validate() function in the viewmodel. It is some client side validation the is preventing form to post. Is there a way I can skip or disable this Validation for these fields that are now hidden through javaScript. Or can I clear the ModelState through javaScript ? If you have some suggestions as to how to approach it differently ? Thanks
asp.net-mvc
asp.net-mvc-3
modelstate
validationsummary
ivalidatableobject
null
open
Unable to post a form due to ValidationSummary errors on form fields that are hidden dynamically through javaScript. === ASP.NET MVC 3 application. I am trying to post form that has some dynamic fields which appear and disappear using JavaScript. I am using IValidatableObject for doing server side validation on some of these dynamic fields. When these fields are visible and I post the form, validation works fine and it gives appropriate error message in the ValidationSummary and posts back. Now while these error messages are there and I hide these fields using document.getElementById("schoolNotListed").style.display = "none"; and I try to post the form again, it pops up the ValidationSummary error each time. The control doesn't reach the controller neither does it reach the Validate() function in the viewmodel. It is some client side validation the is preventing form to post. Is there a way I can skip or disable this Validation for these fields that are now hidden through javaScript. Or can I clear the ModelState through javaScript ? If you have some suggestions as to how to approach it differently ? Thanks
0
11,660,695
07/26/2012 00:28:06
1,553,138
07/26/2012 00:13:05
1
0
MVC Radio Button Design Options
I am creating an MVC mobile application. One of my screens contains radio buttons for a user to select the length of their hair, their eye colour and etc. The current styling is incredibly bulky, with each item taking up a whole row. What other styling options do I have at my disposal? Here is a screenshot so you can see how much room it's taking up. http://i.imgur.com/PgRr1.png
asp.net
mvc
razor
radio-button
styling
null
open
MVC Radio Button Design Options === I am creating an MVC mobile application. One of my screens contains radio buttons for a user to select the length of their hair, their eye colour and etc. The current styling is incredibly bulky, with each item taking up a whole row. What other styling options do I have at my disposal? Here is a screenshot so you can see how much room it's taking up. http://i.imgur.com/PgRr1.png
0
11,628,481
07/24/2012 10:01:06
1,355,820
04/25/2012 09:43:37
40
1
iPhone:Create video from images
I am trying to create video from png images which has no audio file. I have implemented following code but my images are not running smoothly. - (void)viewDidLoad { totalImages = 121; counter=1; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } -(void)viewDidAppear:(BOOL)animated { levelTimer = [NSTimer scheduledTimerWithTimeInterval:0.40 target: self selector: @selector(levelTimerCallback:) userInfo: nil repeats: YES]; } - (void)levelTimerCallback:(NSTimer *)timer { if(counter <= totalImages) { NSString *fileName = [NSString stringWithFormat:@"image_iphone_%d",counter]; NSLog(@"filenameEasy:%@",fileName); NSString *fileLocation = [[NSBundle mainBundle] pathForResource:fileName ofType:@"png"]; UIImage *imageName = [[UIImage alloc] initWithContentsOfFile:fileLocation]; imgV.image = imageName; counter++; NSLog(@"counter:%d",counter); [imageName release]; [self viewDidAppear:NO]; } } If you have any idea plz share it. thanx in advance.
iphone
objective-c
uiimageview
null
null
null
open
iPhone:Create video from images === I am trying to create video from png images which has no audio file. I have implemented following code but my images are not running smoothly. - (void)viewDidLoad { totalImages = 121; counter=1; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } -(void)viewDidAppear:(BOOL)animated { levelTimer = [NSTimer scheduledTimerWithTimeInterval:0.40 target: self selector: @selector(levelTimerCallback:) userInfo: nil repeats: YES]; } - (void)levelTimerCallback:(NSTimer *)timer { if(counter <= totalImages) { NSString *fileName = [NSString stringWithFormat:@"image_iphone_%d",counter]; NSLog(@"filenameEasy:%@",fileName); NSString *fileLocation = [[NSBundle mainBundle] pathForResource:fileName ofType:@"png"]; UIImage *imageName = [[UIImage alloc] initWithContentsOfFile:fileLocation]; imgV.image = imageName; counter++; NSLog(@"counter:%d",counter); [imageName release]; [self viewDidAppear:NO]; } } If you have any idea plz share it. thanx in advance.
0
11,628,484
07/24/2012 10:01:26
1,430,562
06/01/2012 11:19:51
7
1
Showing a div using jquery and retrieve data from ape server
My question is: How could i make a div which is visible in the bottom right corner of the screen for 10 secs? This div would trigger an ape-server inline push which is triggered by a php script. I would like to try post data with php to an ape server and then echo this data using jquery with a div that is displayed for x seconds. I have no doubts how would i begin or how could i make that to work!
php
jquery
post
ape
null
null
open
Showing a div using jquery and retrieve data from ape server === My question is: How could i make a div which is visible in the bottom right corner of the screen for 10 secs? This div would trigger an ape-server inline push which is triggered by a php script. I would like to try post data with php to an ape server and then echo this data using jquery with a div that is displayed for x seconds. I have no doubts how would i begin or how could i make that to work!
0
11,628,427
07/24/2012 09:58:32
1,523,078
07/13/2012 08:54:32
35
2
Objective C: making point Larger through long press
Is it possible to make a larger point in painting through long press? Because I want to make my line much bigger when I do the long press gesture and use that point to make a line in touches move. I hope this make sense, and this is my code. -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event//upon moving { UITouch *touch = [touches anyObject]; previousPoint2 = previousPoint1; previousPoint1 = currentTouch; currentTouch = [touch locationInView:self.view]; CGPoint mid1 = midPoint(previousPoint2, previousPoint1); CGPoint mid2 = midPoint(currentTouch, previousPoint1); UIGraphicsBeginImageContext(CGSizeMake(1024, 768)); [imgDraw.image drawInRect:CGRectMake(0, 0, 1024, 768)]; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineCap(context,kCGLineCapRound); CGContextSetLineWidth(context, slider.value); CGContextSetBlendMode(context, blendMode); CGContextSetRGBStrokeColor(context,red, green, blue, 1); CGContextBeginPath(context); CGContextMoveToPoint(context, mid1.x, mid1.y);//Computation CGContextAddQuadCurveToPoint(context, previousPoint1.x, previousPoint1.y, mid2.x, mid2.y); CGContextStrokePath(context); imgDraw.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsGetCurrentContext(); } Now how do I insert my long press here?
objective-c
ios
iphone-sdk-4.0
core-graphics
paint
null
open
Objective C: making point Larger through long press === Is it possible to make a larger point in painting through long press? Because I want to make my line much bigger when I do the long press gesture and use that point to make a line in touches move. I hope this make sense, and this is my code. -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event//upon moving { UITouch *touch = [touches anyObject]; previousPoint2 = previousPoint1; previousPoint1 = currentTouch; currentTouch = [touch locationInView:self.view]; CGPoint mid1 = midPoint(previousPoint2, previousPoint1); CGPoint mid2 = midPoint(currentTouch, previousPoint1); UIGraphicsBeginImageContext(CGSizeMake(1024, 768)); [imgDraw.image drawInRect:CGRectMake(0, 0, 1024, 768)]; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineCap(context,kCGLineCapRound); CGContextSetLineWidth(context, slider.value); CGContextSetBlendMode(context, blendMode); CGContextSetRGBStrokeColor(context,red, green, blue, 1); CGContextBeginPath(context); CGContextMoveToPoint(context, mid1.x, mid1.y);//Computation CGContextAddQuadCurveToPoint(context, previousPoint1.x, previousPoint1.y, mid2.x, mid2.y); CGContextStrokePath(context); imgDraw.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsGetCurrentContext(); } Now how do I insert my long press here?
0
11,628,455
07/24/2012 10:00:01
225,264
12/05/2009 04:30:46
205
1
Where to download apk files
Hi what is the best site to download apk files for my android phone? I tried with https://play.google.com/store?hl=en&tab=w8 but it is directly installing to my device, instead of install I want to download that apk to my computer. Any site is there to search and download apks to my computer? Thanks
android
apk
null
null
null
07/24/2012 10:40:58
off topic
Where to download apk files === Hi what is the best site to download apk files for my android phone? I tried with https://play.google.com/store?hl=en&tab=w8 but it is directly installing to my device, instead of install I want to download that apk to my computer. Any site is there to search and download apks to my computer? Thanks
2
11,628,489
07/24/2012 10:02:08
1,544,282
07/22/2012 17:33:29
3
0
emberjs - how to mark active menu item using router infrastructure
I'd trying to create navigation tabs (taken from [Twitter Bootstrap][1]): <ul class="nav nav-tabs"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Profile</a></li> <li><a href="#">Messages</a></li> </ul> Active tab is marked with **class="active"**. There is great example of static navbar and Router/Outlet feature: http://jsfiddle.net/schawaska/pfbva/ But I can't understand what is the right way to create dynamic navbar/menu/tab view. As far as I understand it is possible to use class bindings in each menu item: classNameBindings: ['isActive:active'] But where is the right place to switch isActive attributes ? [1]: http://twitter.github.com/bootstrap/components.html#navs
emberjs
null
null
null
null
null
open
emberjs - how to mark active menu item using router infrastructure === I'd trying to create navigation tabs (taken from [Twitter Bootstrap][1]): <ul class="nav nav-tabs"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Profile</a></li> <li><a href="#">Messages</a></li> </ul> Active tab is marked with **class="active"**. There is great example of static navbar and Router/Outlet feature: http://jsfiddle.net/schawaska/pfbva/ But I can't understand what is the right way to create dynamic navbar/menu/tab view. As far as I understand it is possible to use class bindings in each menu item: classNameBindings: ['isActive:active'] But where is the right place to switch isActive attributes ? [1]: http://twitter.github.com/bootstrap/components.html#navs
0
11,628,493
07/24/2012 10:02:23
1,532,539
07/17/2012 17:23:04
3
0
EGit : How to prevent fast-forward merge?
The company I work for gave me the project of moving their java project from CVS to Git. For several reasons, they don't want to use another tool than Eclipse. So we're stuck with EGit. I searched a lot to find a workflow adapted to our project. This one seemed quite relevant and used by many people : http://nvie.com/posts/a-successful-git-branching-model/ The problem is that when we tried to see how it could work with EGit using commits, branches & merges, a lot of fast-forward merge happened. The problem with fast-forward merges is that it makes you *loose* the starting point of the branch. The client we work for wants to be able to choose which features will be in the next release and which will not be. That is one of the main reasons we want to move from CVS to Git, because there seemed to be no easy way in CVS to find which files were modified due to feature #1 and which files were modified for feature #2. In git, we can make branches for feature #1 & #2 and find which files were modified for these features. But, due to fast-forward, it is like going back to CVS, we are not able to know which is feature#1 and which is feature #2. **So is there any way to prevent fast foward merge ?** We tried to put these configurations in Eclipse : [core] mergeoptions = --no-ff [merge] ff = false But it did not prevent EGit from doing fast-forward merge. If this feature is not implemented with JGit/EGit, would there be any other way to have a workflow using Egit that follows what the client want (ability to choose features for release). Using the command line would probably solve the problem, but if it is possible to keep it in Eclipse, that would be nice. Thank you
eclipse
git
merge
egit
null
null
open
EGit : How to prevent fast-forward merge? === The company I work for gave me the project of moving their java project from CVS to Git. For several reasons, they don't want to use another tool than Eclipse. So we're stuck with EGit. I searched a lot to find a workflow adapted to our project. This one seemed quite relevant and used by many people : http://nvie.com/posts/a-successful-git-branching-model/ The problem is that when we tried to see how it could work with EGit using commits, branches & merges, a lot of fast-forward merge happened. The problem with fast-forward merges is that it makes you *loose* the starting point of the branch. The client we work for wants to be able to choose which features will be in the next release and which will not be. That is one of the main reasons we want to move from CVS to Git, because there seemed to be no easy way in CVS to find which files were modified due to feature #1 and which files were modified for feature #2. In git, we can make branches for feature #1 & #2 and find which files were modified for these features. But, due to fast-forward, it is like going back to CVS, we are not able to know which is feature#1 and which is feature #2. **So is there any way to prevent fast foward merge ?** We tried to put these configurations in Eclipse : [core] mergeoptions = --no-ff [merge] ff = false But it did not prevent EGit from doing fast-forward merge. If this feature is not implemented with JGit/EGit, would there be any other way to have a workflow using Egit that follows what the client want (ability to choose features for release). Using the command line would probably solve the problem, but if it is possible to keep it in Eclipse, that would be nice. Thank you
0
11,628,496
07/24/2012 10:02:35
1,468,492
06/20/2012 07:52:20
8
0
Facebook signed_request in my web page
Is possible to access to the signed_request data in my web page? (out of Facebook enviroment)
facebook
login
oauth
null
null
null
open
Facebook signed_request in my web page === Is possible to access to the signed_request data in my web page? (out of Facebook enviroment)
0
11,628,499
07/24/2012 10:02:41
1,526,474
07/15/2012 04:37:15
17
0
Copyright issue with apple
I am working on a game and it seems very boring with the existing icons and music.. I was wondering if I am allowed to use some movie characters and music like james bond or south park.. If I am not allowed to use them, what should I do? I am not a designer so I always get images from google..
ios
apple
copyright
null
null
07/24/2012 13:14:28
off topic
Copyright issue with apple === I am working on a game and it seems very boring with the existing icons and music.. I was wondering if I am allowed to use some movie characters and music like james bond or south park.. If I am not allowed to use them, what should I do? I am not a designer so I always get images from google..
2
11,628,500
07/24/2012 10:02:45
1,548,215
07/24/2012 09:33:41
1
0
iPhone Contact App's "Contact View/Edit View" XCODE
I'm actually making an app in which there is a table view (listing all the courses) Clicking on one of it will show the details of that course. (detail view) Now what I want to make is, the Edit Mode of that detail view.. and i want to give it a feel like iphone's native app :P when i look into contact's app, when i click "Edit" in a contact, it doesn't seems to change the WHOLE view controller, but just hide/show the old/new fields and buttons.. if its not a new view controller (for the edit), then how is it working exactly? if its a new view controller, then i guess, its pretty simple, pushing the view controller into the navigation stack..
iphone
xcode
application
controller
contact
null
open
iPhone Contact App's "Contact View/Edit View" XCODE === I'm actually making an app in which there is a table view (listing all the courses) Clicking on one of it will show the details of that course. (detail view) Now what I want to make is, the Edit Mode of that detail view.. and i want to give it a feel like iphone's native app :P when i look into contact's app, when i click "Edit" in a contact, it doesn't seems to change the WHOLE view controller, but just hide/show the old/new fields and buttons.. if its not a new view controller (for the edit), then how is it working exactly? if its a new view controller, then i guess, its pretty simple, pushing the view controller into the navigation stack..
0
11,628,501
07/24/2012 10:02:47
1,547,889
07/24/2012 07:30:34
1
0
Any suggestions for a good Enterprise Search Engine?
I am looking out for a good Commercial Enterprise Search Engine which can help me fulfil the following criteria: a. Boolean search. b. Case insensitive match c. Exact word match. d. Phrase search. e. Synonyms search. f. Fuzzy Search. Allows user to search even for misspelled words. g. Word rooting search. Allow to search for different tense for the search word. Like searching for "Run" should also return "Running", "Runner", etc. h. Concept Search. Allows users to search for concept based words, such as searching for WWW should also return documents including World Wide Web, etc. i. Keyword Search. **Additional Requirements:** Exclude inactive content Search based on access rights Search-As-You-Type feature available. ------------------------------------------------------------------- Any suggestions are more than welcome! Thanks in advance!
windows
search-engine
criteria
enterprise
suggestions
07/27/2012 02:25:16
off topic
Any suggestions for a good Enterprise Search Engine? === I am looking out for a good Commercial Enterprise Search Engine which can help me fulfil the following criteria: a. Boolean search. b. Case insensitive match c. Exact word match. d. Phrase search. e. Synonyms search. f. Fuzzy Search. Allows user to search even for misspelled words. g. Word rooting search. Allow to search for different tense for the search word. Like searching for "Run" should also return "Running", "Runner", etc. h. Concept Search. Allows users to search for concept based words, such as searching for WWW should also return documents including World Wide Web, etc. i. Keyword Search. **Additional Requirements:** Exclude inactive content Search based on access rights Search-As-You-Type feature available. ------------------------------------------------------------------- Any suggestions are more than welcome! Thanks in advance!
2
11,567,968
07/19/2012 19:31:37
75,801
03/09/2009 19:46:51
5,776
261
How can I have a prototype.js Template encode HTML entities?
If I have a [prototype.js Template](http://prototypejs.org/api/template) which generates HTML code from a JavaScript object, how can I have it automatically escape HTML entities in the JavaScript object's data so that the HTML doesn't break? Sample JavaScript code: var data = { name: 'Josh', url: 'http://josh.gitlin.name/', statement: 'I\'m a JavaScript and PHP developer. Find me on Stack Overflow and say "hi"!' } var template = new Template( '<div><label>Name: <input name=\"name\" value=\"#{name}\"></label></div>'+ '<div><label>URL: <input name=\"url\" value=\"#{url}\"></label></div>'+ '<div><label>Personal Statement: <input name=\"statement\" value=\"#{statement}\"></label></div>' ); $('test').update(template.evaluate(data)); [JSFiddle code for the above](http://jsfiddle.net/HtRmS/) The above code produces a malformed `<input>` tag because `data.statement` contains a quotation mark `"`. How can I have the `Template` automatically escape HTML entities in the above example without modifying the `data` object nor cloning the `data` object? ​
javascript
prototypejs
html-entities
null
null
null
open
How can I have a prototype.js Template encode HTML entities? === If I have a [prototype.js Template](http://prototypejs.org/api/template) which generates HTML code from a JavaScript object, how can I have it automatically escape HTML entities in the JavaScript object's data so that the HTML doesn't break? Sample JavaScript code: var data = { name: 'Josh', url: 'http://josh.gitlin.name/', statement: 'I\'m a JavaScript and PHP developer. Find me on Stack Overflow and say "hi"!' } var template = new Template( '<div><label>Name: <input name=\"name\" value=\"#{name}\"></label></div>'+ '<div><label>URL: <input name=\"url\" value=\"#{url}\"></label></div>'+ '<div><label>Personal Statement: <input name=\"statement\" value=\"#{statement}\"></label></div>' ); $('test').update(template.evaluate(data)); [JSFiddle code for the above](http://jsfiddle.net/HtRmS/) The above code produces a malformed `<input>` tag because `data.statement` contains a quotation mark `"`. How can I have the `Template` automatically escape HTML entities in the above example without modifying the `data` object nor cloning the `data` object? ​
0
11,567,969
07/19/2012 19:31:41
1,538,918
07/19/2012 19:25:23
1
0
How to flip Twitter Bootstrap's Tooltips
I am using Twitter's Bootstrap to implement tooltips. Currently, the tooltips appear above the link. I would like the tooltip to appear underneath the link. How would I go about doing this?
javascript
css
twitter
bootstrap
tooltips
null
open
How to flip Twitter Bootstrap's Tooltips === I am using Twitter's Bootstrap to implement tooltips. Currently, the tooltips appear above the link. I would like the tooltip to appear underneath the link. How would I go about doing this?
0
11,567,976
07/19/2012 19:32:14
1,538,922
07/19/2012 19:26:57
1
0
Encode video for javafx 2.2 beta
I would like to encode a video in linux (using avconf or ffmpeg?), but when I try the flv or libx264 codecs, javafx 2.2 (for linux also) fails to decode it. Can anyone help me to figure out the avconf parameters? Thank you. Marc.
linux
video
encoding
javafx-2
null
null
open
Encode video for javafx 2.2 beta === I would like to encode a video in linux (using avconf or ffmpeg?), but when I try the flv or libx264 codecs, javafx 2.2 (for linux also) fails to decode it. Can anyone help me to figure out the avconf parameters? Thank you. Marc.
0
11,566,638
07/19/2012 17:58:18
1,390,135
05/11/2012 19:00:27
64
0
Waitforpagetoload error?
In my selenium webdriver code I'm trying to get my page to wait for it to load before it starts finding elements and driving them(entering text into username and password) I tried using `driver.waitforpagetoload();` but it returned this error Error 1 'OpenQA.Selenium.IWebDriver' does not contain a definition for 'waitforpagetoload' and no extension method 'waitforpagetoload' accepting a first argument of type 'OpenQA.Selenium.IWebDriver' could be found (are you missing a using directive or an assembly reference?) What type of reference to I need to add? (coding in c#)
c#-4.0
selenium
webdriver
null
null
null
open
Waitforpagetoload error? === In my selenium webdriver code I'm trying to get my page to wait for it to load before it starts finding elements and driving them(entering text into username and password) I tried using `driver.waitforpagetoload();` but it returned this error Error 1 'OpenQA.Selenium.IWebDriver' does not contain a definition for 'waitforpagetoload' and no extension method 'waitforpagetoload' accepting a first argument of type 'OpenQA.Selenium.IWebDriver' could be found (are you missing a using directive or an assembly reference?) What type of reference to I need to add? (coding in c#)
0
11,567,979
07/19/2012 19:32:31
743,522
05/08/2011 00:46:48
181
2
Making an object that evaluates to false in an if statement
So I want to do this because I think it is the most idiomatic way to do errors. For example: User < ActiveRecord::Base def add_email? ... #in the case that it does have an error MyErrorObjectThatEvaluatesToFalse.new("The email is already taken") end def is_valid_user? ... MyErrorObjectThatEvaluatesToFalse.new("Username is not set") ... end end ... SomeController ... if error = user.add_email? render_error_msg(error.message) and return elsif error = user.is_valid_user? render_error_msg(error.message) and return end ... end Is there a way to do something like this or has some else found a way to handle errors that is better than the current rails way of indirectly getting the message with a combination of user.valid? and user.errors? Thanks!
ruby-on-rails
ruby
if-statement
null
null
null
open
Making an object that evaluates to false in an if statement === So I want to do this because I think it is the most idiomatic way to do errors. For example: User < ActiveRecord::Base def add_email? ... #in the case that it does have an error MyErrorObjectThatEvaluatesToFalse.new("The email is already taken") end def is_valid_user? ... MyErrorObjectThatEvaluatesToFalse.new("Username is not set") ... end end ... SomeController ... if error = user.add_email? render_error_msg(error.message) and return elsif error = user.is_valid_user? render_error_msg(error.message) and return end ... end Is there a way to do something like this or has some else found a way to handle errors that is better than the current rails way of indirectly getting the message with a combination of user.valid? and user.errors? Thanks!
0
11,567,989
07/19/2012 19:33:22
820,393
06/29/2011 04:54:25
34
2
running java program on unix from windows
Problem: I am developing a tool that does some file operations in Unix environment. but my development environment being Windows, how can I test what i am doing. I mean is there any way I can simulate my program in Unix environment only for testing purpose.
java
windows
unix
null
null
null
open
running java program on unix from windows === Problem: I am developing a tool that does some file operations in Unix environment. but my development environment being Windows, how can I test what i am doing. I mean is there any way I can simulate my program in Unix environment only for testing purpose.
0
11,567,992
07/19/2012 19:33:34
945,672
09/14/2011 22:54:51
64
2
concurrent consumers yet ensure order
I have a JMS Queue that is populated at a very high rate ( > 100,000/sec ). It can happen that there can be multiple messages pertaining to the same entity every second as well. ( several updates to entity , with each update as a different message. ) On the other end, I have one consumer that processes this message and sends it to other applications. Now, the whole set up is slowing down since the consumer is not able to cope up the rate of incoming messages. Since, there is an SLA on the rate at which consumer processes messages, I have been toying with the idea of having multiple consumers acting in parallel to speed up the process. So, what Im thinking to do is - Multiple consumers acting independently on the queue. - Each consumer is free to grab any message. - After grabbing a message, make sure its the latest version of the entity. For this, part, I can check with the application that processes this entity. - if its not latest, bump the version up and try again. I have been looking up the Integration patterns, JMS docs so far without success. I would welcome ideas to tackle this problem in a more elegant way along with any known APIs, patterns in Java world.
java
jms
eai
enterprise-integration
null
null
open
concurrent consumers yet ensure order === I have a JMS Queue that is populated at a very high rate ( > 100,000/sec ). It can happen that there can be multiple messages pertaining to the same entity every second as well. ( several updates to entity , with each update as a different message. ) On the other end, I have one consumer that processes this message and sends it to other applications. Now, the whole set up is slowing down since the consumer is not able to cope up the rate of incoming messages. Since, there is an SLA on the rate at which consumer processes messages, I have been toying with the idea of having multiple consumers acting in parallel to speed up the process. So, what Im thinking to do is - Multiple consumers acting independently on the queue. - Each consumer is free to grab any message. - After grabbing a message, make sure its the latest version of the entity. For this, part, I can check with the application that processes this entity. - if its not latest, bump the version up and try again. I have been looking up the Integration patterns, JMS docs so far without success. I would welcome ideas to tackle this problem in a more elegant way along with any known APIs, patterns in Java world.
0
11,350,948
07/05/2012 19:09:32
575,152
01/14/2011 02:18:12
151
2
How do I read a file from disk without getting escaped characters in Haskell
I'm writing an application in Haskell in which as part of my persistence system, I am converting my data structures to JSON format and then writing them to disk. Later, I want to load them by reading the file and running it through a JSON parser to reconstitute the objects. However, something goes wrong in the read portion that prevents the JSON module from parsing the string. First, I am using Text.JSON (json-0.5) for my work. The datatype that I am writing to file is called the `WorkoutEvent`, and I have verified that it encodes and decodes to JSON perfectly using this command: decode $ encode evt :: Result WorkoutEvent So, with that in mind, I create a bunch of events and write them to a file, and the resulting file looks like this (when I open it in my text editor): {"type":"AddWorkout","data":{"uuid":"473b7964-8197-49ac-be3b-2b3804f1fbb5","date":"2012-03-30","workout_type":"Pushups","description":"","sets":[6]}} {"type":"AddWorkout","data":{"uuid":"9f83363a-5298-4778-9c80-7dfa0d2ea6f9","date":"2012-04-02","workout_type":"Pushups","description":"","sets":[6,6]}} {"type":"AddWorkout","data":{"uuid":"a60806a0-efd6-4647-bc62-a48298ce55cd","date":"2012-04-04","workout_type":"Pushups","description":"","sets":[]}} And so on and so forth. Each line in the file represents one full object that I have serialized. Then I load up the file using readFile and I see no problems: *Main> f <- readFile "/home/savanni/Documents/workouts.json-stream" *Main> take 50 f "{\"type\":\"AddWorkout\",\"data\":{\"uuid\":\"473b7964-8197" *Main> putStrLn $ take 50 f {"type":"AddWorkout","data":{"uuid":"473b7964-8197 So far, so good. The catch comes when I try to decode the data: *Main> decode f :: Result [WorkoutEvent] Error "Invalid tokens at end of JSON string: \"{\\\"type\\\":\\\"A\"" If I say `putStrLn f` I see the output and see that there are no \ sequences anywhere in the output. If I just enter `f` at the command line, I see escape sequences as above, but I never see any multiple-\ escape sequences anywhere. So, in the end, how exactly am I supposed to read JSON data from a file using the Text.JSON module?
json
haskell
null
null
null
null
open
How do I read a file from disk without getting escaped characters in Haskell === I'm writing an application in Haskell in which as part of my persistence system, I am converting my data structures to JSON format and then writing them to disk. Later, I want to load them by reading the file and running it through a JSON parser to reconstitute the objects. However, something goes wrong in the read portion that prevents the JSON module from parsing the string. First, I am using Text.JSON (json-0.5) for my work. The datatype that I am writing to file is called the `WorkoutEvent`, and I have verified that it encodes and decodes to JSON perfectly using this command: decode $ encode evt :: Result WorkoutEvent So, with that in mind, I create a bunch of events and write them to a file, and the resulting file looks like this (when I open it in my text editor): {"type":"AddWorkout","data":{"uuid":"473b7964-8197-49ac-be3b-2b3804f1fbb5","date":"2012-03-30","workout_type":"Pushups","description":"","sets":[6]}} {"type":"AddWorkout","data":{"uuid":"9f83363a-5298-4778-9c80-7dfa0d2ea6f9","date":"2012-04-02","workout_type":"Pushups","description":"","sets":[6,6]}} {"type":"AddWorkout","data":{"uuid":"a60806a0-efd6-4647-bc62-a48298ce55cd","date":"2012-04-04","workout_type":"Pushups","description":"","sets":[]}} And so on and so forth. Each line in the file represents one full object that I have serialized. Then I load up the file using readFile and I see no problems: *Main> f <- readFile "/home/savanni/Documents/workouts.json-stream" *Main> take 50 f "{\"type\":\"AddWorkout\",\"data\":{\"uuid\":\"473b7964-8197" *Main> putStrLn $ take 50 f {"type":"AddWorkout","data":{"uuid":"473b7964-8197 So far, so good. The catch comes when I try to decode the data: *Main> decode f :: Result [WorkoutEvent] Error "Invalid tokens at end of JSON string: \"{\\\"type\\\":\\\"A\"" If I say `putStrLn f` I see the output and see that there are no \ sequences anywhere in the output. If I just enter `f` at the command line, I see escape sequences as above, but I never see any multiple-\ escape sequences anywhere. So, in the end, how exactly am I supposed to read JSON data from a file using the Text.JSON module?
0
11,350,949
07/05/2012 19:09:32
214,044
11/18/2009 19:49:15
146
2
Remove users with Duplicate Email in ASP.NET membership provider
I'm looking for the most efficient way to remove users with duplicate emails in my asp.net MVC2 website that is using the default membership provider. We launched this site and did not set unique emails to true, now that I am trying to implement a Forgot Username/Password feature I've come to realize over 100 users have re-registered as they forgot their password and there was no forgot password feature. This is a problem as I need to have the user enter their email to send them their username and password reset email. This fails since multiple users share an email. I wish I had noticed the unique email option in the web.config before launch, would have saved a huge hassle. :( I would like to delete all these accounts easily without having to do it manually 1 by 1, and I will then contact them and let them know their duplicate account has been created. Whats the best way to go about doing this? Some users have registered with the same email up to 5 times.
c#
asp.net-mvc
asp.net-mvc-2
null
null
null
open
Remove users with Duplicate Email in ASP.NET membership provider === I'm looking for the most efficient way to remove users with duplicate emails in my asp.net MVC2 website that is using the default membership provider. We launched this site and did not set unique emails to true, now that I am trying to implement a Forgot Username/Password feature I've come to realize over 100 users have re-registered as they forgot their password and there was no forgot password feature. This is a problem as I need to have the user enter their email to send them their username and password reset email. This fails since multiple users share an email. I wish I had noticed the unique email option in the web.config before launch, would have saved a huge hassle. :( I would like to delete all these accounts easily without having to do it manually 1 by 1, and I will then contact them and let them know their duplicate account has been created. Whats the best way to go about doing this? Some users have registered with the same email up to 5 times.
0
11,350,950
07/05/2012 19:09:40
1,301,568
03/29/2012 18:12:53
26
0
Trouble generate header file for JNI
I compiled HelloWorld.c successfully. I changed to the directory where HelloWorld.class is. And I typed javah -jni HelloWorld to get header file. I have following error message. What is the problem? I am developing Android app using Mac OSX. error: cannot access HelloWorld bad class file: ./HelloWorld.class class file contains wrong class: Test.HelloWorld Please remove or make sure it appears in the correct subdirectory of the classpath. com.sun.tools.javac.util.Abort javadoc: error - fatal error 2 errors
jni
null
null
null
null
null
open
Trouble generate header file for JNI === I compiled HelloWorld.c successfully. I changed to the directory where HelloWorld.class is. And I typed javah -jni HelloWorld to get header file. I have following error message. What is the problem? I am developing Android app using Mac OSX. error: cannot access HelloWorld bad class file: ./HelloWorld.class class file contains wrong class: Test.HelloWorld Please remove or make sure it appears in the correct subdirectory of the classpath. com.sun.tools.javac.util.Abort javadoc: error - fatal error 2 errors
0
11,350,939
07/05/2012 19:08:50
801,835
06/16/2011 15:47:56
21
0
Apache forwarding http to https
I am working with Proxypass and trying to set it up to forward from an http:// to https:// The following is set up in my httpd-vhots config file <VirtualHost *:80> ProxyPass /foo https://example.com SSLProxyEngine On ProxyPassReverse /foo https://example.com CacheDisable * ProxyRequests Off </VirtualHost> This prompts me to log in on my base site, "localhost", which does not have SSL running. If run on Mozzilla, only browser that this occurs on, I can exit out and it takes me to the proper site. So broard overview of what I want: Go from basic unsecure site, when forwarding to site/foo, I want to be prompted to log into https://example.com. Any idea what I can do?
apache
ssl
null
null
null
null
open
Apache forwarding http to https === I am working with Proxypass and trying to set it up to forward from an http:// to https:// The following is set up in my httpd-vhots config file <VirtualHost *:80> ProxyPass /foo https://example.com SSLProxyEngine On ProxyPassReverse /foo https://example.com CacheDisable * ProxyRequests Off </VirtualHost> This prompts me to log in on my base site, "localhost", which does not have SSL running. If run on Mozzilla, only browser that this occurs on, I can exit out and it takes me to the proper site. So broard overview of what I want: Go from basic unsecure site, when forwarding to site/foo, I want to be prompted to log into https://example.com. Any idea what I can do?
0
11,350,941
07/05/2012 19:09:02
879,780
08/05/2011 02:58:54
9
1
How to add (document).ready to an existing jquery function file
I have a jquery function file with function with AJAX functions in it. Now I need to add **(document).ready** function to the same file. My question is should I add this function outside of the existing function() block or keep it inside.
jquery
null
null
null
null
null
open
How to add (document).ready to an existing jquery function file === I have a jquery function file with function with AJAX functions in it. Now I need to add **(document).ready** function to the same file. My question is should I add this function outside of the existing function() block or keep it inside.
0
11,350,906
07/05/2012 19:06:20
1,484,056
06/26/2012 21:44:58
5
0
How can i improve this file check code
How can i improve below code. In a nutshell, this code: searches for a file --> if not found wait for sometime to be created -> do something on it. -------------------------------------------------- filename=`command to search and get file name` if [filename is empty] { sleep for 10 sec filename=`command to search and get file name`; } if [ filename is not empty ] then process the file here; else send a mail saying file could not be found; fi --------------------------------------
unix
null
null
null
null
07/27/2012 00:47:52
not a real question
How can i improve this file check code === How can i improve below code. In a nutshell, this code: searches for a file --> if not found wait for sometime to be created -> do something on it. -------------------------------------------------- filename=`command to search and get file name` if [filename is empty] { sleep for 10 sec filename=`command to search and get file name`; } if [ filename is not empty ] then process the file here; else send a mail saying file could not be found; fi --------------------------------------
1
11,350,907
07/05/2012 19:06:22
9,193
09/15/2008 18:01:24
3,093
45
What's the difference between timer and rbtimer in uWSGI?
I'm looking to add simple repeating tasks to my current application and I'm looking at the uwsgi signals api and there are two decorators `@timer` and `@rbtimer`. I've tried looking through the doc and even the python source at least but it appears it's probably more low level than that somewhere in the c implementation. I'm familiar with the concept of a red-black tree but I'm not sure how that would relate to timers. If someone could clear things up or point me to the doc I might have missed I'd appreciate it.
python
timer
uwsgi
null
null
null
open
What's the difference between timer and rbtimer in uWSGI? === I'm looking to add simple repeating tasks to my current application and I'm looking at the uwsgi signals api and there are two decorators `@timer` and `@rbtimer`. I've tried looking through the doc and even the python source at least but it appears it's probably more low level than that somewhere in the c implementation. I'm familiar with the concept of a red-black tree but I'm not sure how that would relate to timers. If someone could clear things up or point me to the doc I might have missed I'd appreciate it.
0
11,350,972
07/05/2012 19:11:04
412,082
08/05/2010 14:54:00
2,145
13
extracting data from a weird looking object in R script
In my R script... I have an object `t` which is something that looks like this: > t m convInfo data call dataClasses control FALSE FALSE FALSE FALSE FALSE FALSE I'm trying to test if that first item is FALSE rather than TRUE. How can I extract that out? I tried `t$m` but that didn't work.
r
na
null
null
null
null
open
extracting data from a weird looking object in R script === In my R script... I have an object `t` which is something that looks like this: > t m convInfo data call dataClasses control FALSE FALSE FALSE FALSE FALSE FALSE I'm trying to test if that first item is FALSE rather than TRUE. How can I extract that out? I tried `t$m` but that didn't work.
0
11,350,973
07/05/2012 19:11:16
848,311
07/17/2011 02:13:17
123
0
How to force an NSWindow to be opened on the Desktop only?
I have a status bar app that has some windows but if i'm on fullscreen in an app the window is opened in front of it. How can i force the window to be opened on the Desktop?
objective-c
xcode
osx
cocoa
window
null
open
How to force an NSWindow to be opened on the Desktop only? === I have a status bar app that has some windows but if i'm on fullscreen in an app the window is opened in front of it. How can i force the window to be opened on the Desktop?
0
11,571,941
07/20/2012 02:14:09
751,796
05/13/2011 05:21:27
1,572
65
Cocos2d - Moving objects in a curved path with different velocities
I'm trying to develop a game where cars move along roads and stop according to the signal of the traffic lights. They've got different velocities. Sometimes cars need to decelerate in order to not hit the leading car. They need to stop at the red lights. They have to make turns and etc. This is all relatively easy when working with straight intersecting roads. But how can I move a car/cars along a curved path? So far it was easy because I was just using either x or y of a car's position. But this time it's not the case, both coordinates seem to be necessary for moving it ahead. With straight roads I can just give a car an arbitrary speed and it will move along x or y axis with that speed. But how can I determine the velocity, if both coordinates have to be taken into account? Acceleration and decelerations are also mistery to me in this case. Thanks ahead.
cocos2d-iphone
curve
null
null
null
null
open
Cocos2d - Moving objects in a curved path with different velocities === I'm trying to develop a game where cars move along roads and stop according to the signal of the traffic lights. They've got different velocities. Sometimes cars need to decelerate in order to not hit the leading car. They need to stop at the red lights. They have to make turns and etc. This is all relatively easy when working with straight intersecting roads. But how can I move a car/cars along a curved path? So far it was easy because I was just using either x or y of a car's position. But this time it's not the case, both coordinates seem to be necessary for moving it ahead. With straight roads I can just give a car an arbitrary speed and it will move along x or y axis with that speed. But how can I determine the velocity, if both coordinates have to be taken into account? Acceleration and decelerations are also mistery to me in this case. Thanks ahead.
0
11,571,169
07/20/2012 00:17:40
1,336,843
04/16/2012 16:52:49
1
0
Unexpected T_EXIT
I got a parse error (unexpected T_EXIT) on line 1 when I run this code (it's in a file used for AJAX): <?php if(empty($_POST['nickname']) || !isset($_POST['password'])) die('{"result": "error", "message": "Ouch"}'); // [...] ?> if, however, I put a char between the first 2 line (like a space after "&lt;?php" or a tab before "if"), it works fine. I don't understand, it never happened to me before. I checked the file in hexa mode to see if there were some strange and undesired invisible character but everything seems normal. Does somebody already have this error or know how to solve it ? Thanks in advance.
php
null
null
null
null
null
open
Unexpected T_EXIT === I got a parse error (unexpected T_EXIT) on line 1 when I run this code (it's in a file used for AJAX): <?php if(empty($_POST['nickname']) || !isset($_POST['password'])) die('{"result": "error", "message": "Ouch"}'); // [...] ?> if, however, I put a char between the first 2 line (like a space after "&lt;?php" or a tab before "if"), it works fine. I don't understand, it never happened to me before. I checked the file in hexa mode to see if there were some strange and undesired invisible character but everything seems normal. Does somebody already have this error or know how to solve it ? Thanks in advance.
0
11,571,948
07/20/2012 02:15:13
1,419,891
05/27/2012 07:50:53
11
1
NSMutableAttributedStrings - objectAtIndex:effectiveRange:: Out of bounds
I'm trying to add some fancy text to a label, but I've run into some problems with the NSMutableAttributedString class. I was trying to achieve four this: 1. Change font, 2. Underline range, 3. Change range color, 4. Superscript range. This code: - (void)applicationDidFinishLaunching:(NSNotification*)aNotification { NSMutableAttributedString* display = [[NSMutableAttributedString alloc] initWithString:@"Hello world!"]; NSUInteger length = [[display string]length] - 1; NSRange wholeRange = NSMakeRange(0, length); NSRange helloRange = NSMakeRange(0, 4); NSRange worldRange = NSMakeRange(6, length); [display addAttribute:NSFontAttributeName value:monoSpaced range:wholeRange]; [display addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInt:1] range:helloRange]; [display addAttribute:NSForegroundColorAttributeName value:[NSColor greenColor] range:helloRange]; [display addAttribute:NSSuperscriptAttributeName value:[NSNumber numberWithInt:1] range:worldRange]; //@synthesize textLabel; is in this file. [textLabel setAttributedStringValue:display]; } Gives me this error: NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds I've even just tried `NSMakeRange(0,1)`, but no dice.
objective-c
osx
nsattributedstring
null
null
null
open
NSMutableAttributedStrings - objectAtIndex:effectiveRange:: Out of bounds === I'm trying to add some fancy text to a label, but I've run into some problems with the NSMutableAttributedString class. I was trying to achieve four this: 1. Change font, 2. Underline range, 3. Change range color, 4. Superscript range. This code: - (void)applicationDidFinishLaunching:(NSNotification*)aNotification { NSMutableAttributedString* display = [[NSMutableAttributedString alloc] initWithString:@"Hello world!"]; NSUInteger length = [[display string]length] - 1; NSRange wholeRange = NSMakeRange(0, length); NSRange helloRange = NSMakeRange(0, 4); NSRange worldRange = NSMakeRange(6, length); [display addAttribute:NSFontAttributeName value:monoSpaced range:wholeRange]; [display addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInt:1] range:helloRange]; [display addAttribute:NSForegroundColorAttributeName value:[NSColor greenColor] range:helloRange]; [display addAttribute:NSSuperscriptAttributeName value:[NSNumber numberWithInt:1] range:worldRange]; //@synthesize textLabel; is in this file. [textLabel setAttributedStringValue:display]; } Gives me this error: NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds I've even just tried `NSMakeRange(0,1)`, but no dice.
0
11,571,951
07/20/2012 02:15:48
1,086,578
12/07/2011 21:46:47
1
0
lua string.upper not working with accented characters?
I'm trying to convert some French text to upper case in lua, it is not converting the accented characters. Any idea why? test script: > print('échelle') print(string.upper('échelle')) print('ÉCHELLE') print(string.lower('ÉCHELLE')) output: > échelle éCHELLE ÉCHELLE Échelle
lua
null
null
null
null
null
open
lua string.upper not working with accented characters? === I'm trying to convert some French text to upper case in lua, it is not converting the accented characters. Any idea why? test script: > print('échelle') print(string.upper('échelle')) print('ÉCHELLE') print(string.lower('ÉCHELLE')) output: > échelle éCHELLE ÉCHELLE Échelle
0
11,571,953
07/20/2012 02:16:11
851,835
07/19/2011 11:19:09
336
0
On using std::vector<class type Foo> as raw array Foo []
I know that vectors are guaranteed to have the same underlying memory layout as arrays. So for POD (plain-old-data) type like `int`, `vector<int> a` can be used as `SomeCFun(&a[0], a.size())` when `a` is non-empty. I'd like to know that when the element type is (complex) Class type, does the trick still work safely?
c++
stl
null
null
null
null
open
On using std::vector<class type Foo> as raw array Foo [] === I know that vectors are guaranteed to have the same underlying memory layout as arrays. So for POD (plain-old-data) type like `int`, `vector<int> a` can be used as `SomeCFun(&a[0], a.size())` when `a` is non-empty. I'd like to know that when the element type is (complex) Class type, does the trick still work safely?
0
11,571,954
07/20/2012 02:16:11
720,816
04/22/2011 16:44:22
70
5
Easiest way to make Rails RESTful routes for this setup
I want to have the following routes resolve: splunk/ocd/:some_number splunk/ord/:some_number I want these to be handled by the `ocd`, `ord` functions in `SplunkController`. What's the easiest way to create these routes?
ruby-on-rails
url-routing
null
null
null
null
open
Easiest way to make Rails RESTful routes for this setup === I want to have the following routes resolve: splunk/ocd/:some_number splunk/ord/:some_number I want these to be handled by the `ocd`, `ord` functions in `SplunkController`. What's the easiest way to create these routes?
0
11,571,955
07/20/2012 02:16:13
737,455
05/04/2011 06:48:55
1,362
76
How can I print the contents of a org.squeryl.dsl.Group?
Using Squeryl ORM and Scala. For the first time I did a JOIN statement that used grouping. Admittedly, I can't figure out how to start iterating through the contents. Here's the JOIN: join(DB.jobs, DB.users.leftOuter, DB.clients.leftOuter, DB.projects.leftOuter)((j,u,c,p) => where((j.teamId === teamId) and (j.startTime > yesterdayBegin)) groupBy(j.userId) on(j.userId === u.map(_.id), j.clientId === c.map(_.id), j.projectId === p.map(_.id))) How do I print out its contents? I tried: Job.teamTimeline( teamId(request) ).map{ user => Map( "name" -> user._1.map(_.name).getOrElse("Pending") )} But got the compiler error: value _1 is not a member of org.squeryl.dsl.Group[Option[org.squeryl.PrimitiveTypeMode.LongType]]
scala
squeryl
null
null
null
null
open
How can I print the contents of a org.squeryl.dsl.Group? === Using Squeryl ORM and Scala. For the first time I did a JOIN statement that used grouping. Admittedly, I can't figure out how to start iterating through the contents. Here's the JOIN: join(DB.jobs, DB.users.leftOuter, DB.clients.leftOuter, DB.projects.leftOuter)((j,u,c,p) => where((j.teamId === teamId) and (j.startTime > yesterdayBegin)) groupBy(j.userId) on(j.userId === u.map(_.id), j.clientId === c.map(_.id), j.projectId === p.map(_.id))) How do I print out its contents? I tried: Job.teamTimeline( teamId(request) ).map{ user => Map( "name" -> user._1.map(_.name).getOrElse("Pending") )} But got the compiler error: value _1 is not a member of org.squeryl.dsl.Group[Option[org.squeryl.PrimitiveTypeMode.LongType]]
0
11,571,964
07/20/2012 02:17:57
547,453
12/19/2010 04:00:55
38
0
Java abstract method with object as input parameter
I can make this code work without an object as input parameter for the abstract method. For example, if I make the input parameter for the printInformation() method in person and emp as printInformation(int x) it works. The moment I make the input parameter as an object for printInformation() method as shown below, it throws an error > emp is not abstract and does not override abstract method > printInformation(person) in person class emp extends person{ ^ abstract class person{ abstract void printInformation(person p); } class emp extends person{ emp(){ System.out.println("This is a emp constructor"); } void printInformation(emp e){ System.out.println("This is an emp");} } class entity{ public static void main(String args[]){ emp employeeObject = new emp(); employeeObject.printInformation(employeeObject); } }
java
abstract
null
null
null
null
open
Java abstract method with object as input parameter === I can make this code work without an object as input parameter for the abstract method. For example, if I make the input parameter for the printInformation() method in person and emp as printInformation(int x) it works. The moment I make the input parameter as an object for printInformation() method as shown below, it throws an error > emp is not abstract and does not override abstract method > printInformation(person) in person class emp extends person{ ^ abstract class person{ abstract void printInformation(person p); } class emp extends person{ emp(){ System.out.println("This is a emp constructor"); } void printInformation(emp e){ System.out.println("This is an emp");} } class entity{ public static void main(String args[]){ emp employeeObject = new emp(); employeeObject.printInformation(employeeObject); } }
0
11,571,966
07/20/2012 02:18:00
868,488
07/28/2011 23:52:02
187
6
glm::mix returning invalid quaternion
I am trying to implement skeletal animation into my game engine and I have a problem with the interpolation. Each frame, I want to interpolate between frames and thus I have code similar to this: <!-- language: c++ --> // This is the soon-to-be-interpolated joint Joint &finalJoint = finalSkeleton.joints[i]; // These are our existing joints const Joint &joint0 = skeleton0.joints[i]; const Joint &joint1 = skeleton1.joints[i]; // Interpolate finalJoint.position = glm::lerp(joint0.position, joint1.position, interpolate); finalJoint.orientation = glm::mix(joint0.orientation, joint1.orientation, interpolate); The final line is the problem. The orientation of `finalJoint` will sometimes be `(-1.#IND, -1.#IND, -1.#IND, -1.#IND)`. These are some example values and what they result in (note that `interpolation` is `0.4` in all three cases): * `joint0.orientation = (0.707107, 0.000242, 0.707107, 0.0)`<br /> `joint1.orientation = (0.707107, 0.000242, 0.707107, 0.0)`<br /> `finalJoint = (-1.#IND, -1.#IND, -1.#IND, -1.#IND)` **(Incorrect)** * `joint0.orientation = (-0.451596, -0.61858, -0.262811, -0.586814)`<br /> `joint1.orientation = (-0.451596, -0.61858, -0.262811, -0.586814)`<br /> `finalJoint = (-0.451596, -0.61858, -0.262811, -0.586814)` **(Correct)** * `joint0.orientation = (0.449636, 0.6195, 0.26294, 0.58729)`<br /> `joint1.orientation = (0.449636, 0.6195, 0.26294, 0.58729)`<br /> `finalJoint = (-1.#IND, -1.#IND, -1.#IND, -1.#IND)` **(Incorrect)** *(Yes, I am aware that it's interpolating between the same values.)* I have not yet grasped exactly how quaternions work, but this just seems strange to me.
c++
opengl
quaternion
null
null
null
open
glm::mix returning invalid quaternion === I am trying to implement skeletal animation into my game engine and I have a problem with the interpolation. Each frame, I want to interpolate between frames and thus I have code similar to this: <!-- language: c++ --> // This is the soon-to-be-interpolated joint Joint &finalJoint = finalSkeleton.joints[i]; // These are our existing joints const Joint &joint0 = skeleton0.joints[i]; const Joint &joint1 = skeleton1.joints[i]; // Interpolate finalJoint.position = glm::lerp(joint0.position, joint1.position, interpolate); finalJoint.orientation = glm::mix(joint0.orientation, joint1.orientation, interpolate); The final line is the problem. The orientation of `finalJoint` will sometimes be `(-1.#IND, -1.#IND, -1.#IND, -1.#IND)`. These are some example values and what they result in (note that `interpolation` is `0.4` in all three cases): * `joint0.orientation = (0.707107, 0.000242, 0.707107, 0.0)`<br /> `joint1.orientation = (0.707107, 0.000242, 0.707107, 0.0)`<br /> `finalJoint = (-1.#IND, -1.#IND, -1.#IND, -1.#IND)` **(Incorrect)** * `joint0.orientation = (-0.451596, -0.61858, -0.262811, -0.586814)`<br /> `joint1.orientation = (-0.451596, -0.61858, -0.262811, -0.586814)`<br /> `finalJoint = (-0.451596, -0.61858, -0.262811, -0.586814)` **(Correct)** * `joint0.orientation = (0.449636, 0.6195, 0.26294, 0.58729)`<br /> `joint1.orientation = (0.449636, 0.6195, 0.26294, 0.58729)`<br /> `finalJoint = (-1.#IND, -1.#IND, -1.#IND, -1.#IND)` **(Incorrect)** *(Yes, I am aware that it's interpolating between the same values.)* I have not yet grasped exactly how quaternions work, but this just seems strange to me.
0
11,373,492
07/07/2012 08:26:15
1,385,119
05/09/2012 16:15:57
35
4
c++ split string by double newline
I have been trying to split a string by double newlines (`"\n\n"`). input_string = "firstline\nsecondline\n\nthirdline\nfourthline"; size_t current; size_t next = std::string::npos; do { current = next + 1; next = input_string.find_first_of("\n\n", current); cout << "[" << input_string.substr(current, next - current) << "]" << endl; } while (next != std::string::npos); gives me the output [firstline] [secondline] [] [thirdline] [fourthline] which is obviously not what I wanted. I need to get something like [first line second line] [third line fourthline] I have also tried `boost::split` but it gives me the same result. What am I missing?
c++
string
split
null
null
null
open
c++ split string by double newline === I have been trying to split a string by double newlines (`"\n\n"`). input_string = "firstline\nsecondline\n\nthirdline\nfourthline"; size_t current; size_t next = std::string::npos; do { current = next + 1; next = input_string.find_first_of("\n\n", current); cout << "[" << input_string.substr(current, next - current) << "]" << endl; } while (next != std::string::npos); gives me the output [firstline] [secondline] [] [thirdline] [fourthline] which is obviously not what I wanted. I need to get something like [first line second line] [third line fourthline] I have also tried `boost::split` but it gives me the same result. What am I missing?
0
11,373,495
07/07/2012 08:27:00
1,508,430
07/07/2012 08:05:21
1
0
Countdown submit form button (disabled) after 24h
I need to have a submit button in a form to be (disabled) after 24h from `$timexx` The submit button need to contain when enabled ( HH:MM:SS -- CONFIRM) After 24h disabled (not clickable) and contains following text (conformation time expired) It needs to countdown from `$timexx` witch php inputs in format example( 2012-07-06 20:04:01) (YYYY-MM-DD 20:04:01) <style> .countdown { width: 70px; } </style> <script> var tminus = 5; function countdown(){ if (tminus >= 0.1){ tminus = tminus - 0.1; tminus = Math.round(tminus*100)/100 if (!(Math.round(tminus*100) % 100)){ tminus = tminus + ".0"; } }else { tminus = "Submit"; } if (tminus != "Submit"){ document.countdown_form.countdown.disabled = false; }else{ document.countdown_form.countdown.disabled = true; } document.getElementById("countdown").value=tminus; setTimeout("countdown();", 100); } </script> </head> <body> <form name="countdown_form"> <input type="submit" id="countdown" class="countdown" onClick="alert('Clicked');"disabled> </form> <script language="javascript"> <!-- countdown(); //--> </script> </body> Thank you for your quick replys! ;)
java
php
jquery
html
null
null
open
Countdown submit form button (disabled) after 24h === I need to have a submit button in a form to be (disabled) after 24h from `$timexx` The submit button need to contain when enabled ( HH:MM:SS -- CONFIRM) After 24h disabled (not clickable) and contains following text (conformation time expired) It needs to countdown from `$timexx` witch php inputs in format example( 2012-07-06 20:04:01) (YYYY-MM-DD 20:04:01) <style> .countdown { width: 70px; } </style> <script> var tminus = 5; function countdown(){ if (tminus >= 0.1){ tminus = tminus - 0.1; tminus = Math.round(tminus*100)/100 if (!(Math.round(tminus*100) % 100)){ tminus = tminus + ".0"; } }else { tminus = "Submit"; } if (tminus != "Submit"){ document.countdown_form.countdown.disabled = false; }else{ document.countdown_form.countdown.disabled = true; } document.getElementById("countdown").value=tminus; setTimeout("countdown();", 100); } </script> </head> <body> <form name="countdown_form"> <input type="submit" id="countdown" class="countdown" onClick="alert('Clicked');"disabled> </form> <script language="javascript"> <!-- countdown(); //--> </script> </body> Thank you for your quick replys! ;)
0
11,373,498
07/07/2012 08:27:22
999,337
10/17/2011 14:21:41
187
18
Drop Down List unexpected behaviour
I have this unexpected behaviour with an ASP.NET web forms DropDownList. I am adding ListItems to a drop down list, and all looks well. Except that the value in the ddl (which in my case is the Id) is never set, it is replaced by the text from the ListItem. <asp:DropDownList ID="ddl1" runat="server"> </asp:DropDownList> private void Populate() { List<ListItem> list = new List<ListItem>(); foreach (var item in GetItems()) { list.Add(new ListItem(item.name, item.id.ToString())); //in the drop down list the ListItem.Value is being replaced //by ListItem.Text when it is added to the ddl } ddl1.DataSource = list; ddl1.DataBind(); ddl1.Items.Add(new ListItem("Make a selection")); } private List<Stuff> GetItems() { List<Stuff> list = new List<Stuff>(); list.Add(new Stuff{ name = "bill", id = 1}); list.Add(new Stuff{ name = "james", id = 2}); return list; } private struct Stuff { public string name; public int id; } Any ideas if this is what is meant to happen? And if it is how do I store both a name and an Id in the ddl?
c#
asp.net
drop-down-menu
asp.net-webforms
null
null
open
Drop Down List unexpected behaviour === I have this unexpected behaviour with an ASP.NET web forms DropDownList. I am adding ListItems to a drop down list, and all looks well. Except that the value in the ddl (which in my case is the Id) is never set, it is replaced by the text from the ListItem. <asp:DropDownList ID="ddl1" runat="server"> </asp:DropDownList> private void Populate() { List<ListItem> list = new List<ListItem>(); foreach (var item in GetItems()) { list.Add(new ListItem(item.name, item.id.ToString())); //in the drop down list the ListItem.Value is being replaced //by ListItem.Text when it is added to the ddl } ddl1.DataSource = list; ddl1.DataBind(); ddl1.Items.Add(new ListItem("Make a selection")); } private List<Stuff> GetItems() { List<Stuff> list = new List<Stuff>(); list.Add(new Stuff{ name = "bill", id = 1}); list.Add(new Stuff{ name = "james", id = 2}); return list; } private struct Stuff { public string name; public int id; } Any ideas if this is what is meant to happen? And if it is how do I store both a name and an Id in the ddl?
0
11,373,504
07/07/2012 08:28:41
906,042
08/22/2011 14:22:42
538
26
Content doesn't get repainted on first window maximize.
I have the following code in the windows expose event which draws a circle on the screen: cairo_t *cr; cr = gdk_cairo_create (widget->window); cr = gdk_cairo_create (GDK_DRAWABLE(drawing_area->window)); int width, height; gtk_window_get_size(GTK_WINDOW(widget), &width, &height); cairo_set_line_width(cr, 9); cairo_set_source_rgb(cr, 0.69, 0.19, 0); cairo_arc(cr, width/2, height/2, (width < height ? width : height) / 2 - 10, 0, 2 * M_PI); cairo_stroke_preserve(cr); cairo_set_source_rgb(cr, 0.3, 0.4, 0.6); cairo_fill(cr); cairo_destroy(cr); The first time I maximize the window it goes away, however on successive size changes of the window e.g. de-maximze it and maximize it again the circle appears. I am wondering why it does this only on the first the window gets maximized and how can I fix it. Thanks.
c
events
gtk
cairo
null
null
open
Content doesn't get repainted on first window maximize. === I have the following code in the windows expose event which draws a circle on the screen: cairo_t *cr; cr = gdk_cairo_create (widget->window); cr = gdk_cairo_create (GDK_DRAWABLE(drawing_area->window)); int width, height; gtk_window_get_size(GTK_WINDOW(widget), &width, &height); cairo_set_line_width(cr, 9); cairo_set_source_rgb(cr, 0.69, 0.19, 0); cairo_arc(cr, width/2, height/2, (width < height ? width : height) / 2 - 10, 0, 2 * M_PI); cairo_stroke_preserve(cr); cairo_set_source_rgb(cr, 0.3, 0.4, 0.6); cairo_fill(cr); cairo_destroy(cr); The first time I maximize the window it goes away, however on successive size changes of the window e.g. de-maximze it and maximize it again the circle appears. I am wondering why it does this only on the first the window gets maximized and how can I fix it. Thanks.
0
11,373,505
07/07/2012 08:29:02
204,693
11/06/2009 10:30:18
2,516
96
Getting the last modified date of a file in C
I want to get the last modified date of a file in C. Almost all sources I found use something along this snippet: char *get_last_modified(char *file) { struct tm *clock; struct stat attr; stat(file, &attr); clock = gmtime(&(attr.st_mtime)); return asctime(clock); } But the `attr` doesn't even have a field `st_mtime`, only `st_mtimespec`. Yet, when using this my Eclipse tells me that `passing argument 1 of 'gmtime' from incompatible pointer type` on the line `clock = gmtime(&(attr.st_mtimespec));` What am I doing wrong? PS: I'm developing on OSX Snow Leopard, Eclipse CDT and using GCC as Cross-Platform compiler
c
date
file-io
compiler-errors
null
null
open
Getting the last modified date of a file in C === I want to get the last modified date of a file in C. Almost all sources I found use something along this snippet: char *get_last_modified(char *file) { struct tm *clock; struct stat attr; stat(file, &attr); clock = gmtime(&(attr.st_mtime)); return asctime(clock); } But the `attr` doesn't even have a field `st_mtime`, only `st_mtimespec`. Yet, when using this my Eclipse tells me that `passing argument 1 of 'gmtime' from incompatible pointer type` on the line `clock = gmtime(&(attr.st_mtimespec));` What am I doing wrong? PS: I'm developing on OSX Snow Leopard, Eclipse CDT and using GCC as Cross-Platform compiler
0
11,373,506
07/07/2012 08:29:07
1,071,420
11/29/2011 13:54:21
10
0
How To Create Social Graph DataSet From FaceBook
Hi i'm doing a project in my collge, i want to build a social graph from facebook, i want only the connections between users(friendship) so i can build a Graph. i read facebook api and everything.. but it says that it doesnet allow to get friends of freins a bit problem... does any onw have any suggetions on how to overcome this?
facebook
graph
crawler
null
null
null
open
How To Create Social Graph DataSet From FaceBook === Hi i'm doing a project in my collge, i want to build a social graph from facebook, i want only the connections between users(friendship) so i can build a Graph. i read facebook api and everything.. but it says that it doesnet allow to get friends of freins a bit problem... does any onw have any suggetions on how to overcome this?
0
11,373,491
07/07/2012 08:26:15
540,638
12/13/2010 14:34:12
442
10
Android: Logcat is not working for JS console.log()
My app is a combination of Android native, html5. Till last week I'm able to see the log messages from native code and javascript code running inside th WebView. But suddenly Logcat is not showing the console messages from javascript, though it is showing Log messages from my native code. Any ideas? Thanks in advance. Venkat
android-webview
android-logcat
null
null
null
null
open
Android: Logcat is not working for JS console.log() === My app is a combination of Android native, html5. Till last week I'm able to see the log messages from native code and javascript code running inside th WebView. But suddenly Logcat is not showing the console messages from javascript, though it is showing Log messages from my native code. Any ideas? Thanks in advance. Venkat
0
11,542,459
07/18/2012 13:24:00
1,065,897
11/25/2011 15:32:25
35
4
Modalform closes when openFileDialog returns a result from the second form
**Form1** opens **Form2** with Form2.ShowDialog(). Inside **Form2** a file dialog is opened. When the file browser is closed Form2 is also closed (since a DialogResult is fired i guess) I can't seem to find a solution for this by searching, maybe because i don't know exactly what to search for. So what would be the preferred way of achieving this without **Form2** closing?
c#
winforms
null
null
null
null
open
Modalform closes when openFileDialog returns a result from the second form === **Form1** opens **Form2** with Form2.ShowDialog(). Inside **Form2** a file dialog is opened. When the file browser is closed Form2 is also closed (since a DialogResult is fired i guess) I can't seem to find a solution for this by searching, maybe because i don't know exactly what to search for. So what would be the preferred way of achieving this without **Form2** closing?
0
11,542,460
07/18/2012 13:24:03
1,174,088
01/27/2012 18:05:17
8
1
Secure WebSocket (wss://) doesn't work on Firefox
I have a working WebSocket non secure application. But my website uses https and I need a Secure WebSocket connection to avoid Firefox to complain about the fact that the connection is insecure. I am using [php-websocket-server][1] for my WebSocket server with PhP 5.2.9, so when i use WebSocket secure i can't decrypt packets with the openssl_decrypt function. That's why i used [stunnel][2] in order to decrypt packets sent by the client using wss, to do that i binded client WebSocket to 12345 port an server WebSocket to 54321 port, then i added a stunnel in server mode : [wsServer] accept = 12345 connect = 192.168.1.227:54321 With this configuration my application works fine on Chrome through https + wss. But on Firefox there's a problem during the handshake, it seems that `Sec-WebSocket-Version` and `Sec-WebSocket-Key` are missing in the header. I don't understand because it works on Firefox through http + ws. Thanks in advance for your help. [1]: http://code.google.com/p/php-websocket-server/ [2]: http://www.stunnel.org/
php
html5
firefox
websocket
stunnel
null
open
Secure WebSocket (wss://) doesn't work on Firefox === I have a working WebSocket non secure application. But my website uses https and I need a Secure WebSocket connection to avoid Firefox to complain about the fact that the connection is insecure. I am using [php-websocket-server][1] for my WebSocket server with PhP 5.2.9, so when i use WebSocket secure i can't decrypt packets with the openssl_decrypt function. That's why i used [stunnel][2] in order to decrypt packets sent by the client using wss, to do that i binded client WebSocket to 12345 port an server WebSocket to 54321 port, then i added a stunnel in server mode : [wsServer] accept = 12345 connect = 192.168.1.227:54321 With this configuration my application works fine on Chrome through https + wss. But on Firefox there's a problem during the handshake, it seems that `Sec-WebSocket-Version` and `Sec-WebSocket-Key` are missing in the header. I don't understand because it works on Firefox through http + ws. Thanks in advance for your help. [1]: http://code.google.com/p/php-websocket-server/ [2]: http://www.stunnel.org/
0
11,542,462
07/18/2012 13:24:10
905,653
08/22/2011 10:04:10
20
2
JavaScriptSerializer cannot deserialize object
I am building a feed for a type ahead search box so that when a user is conducting a search they can click the link to go straight to a page without having to go to the search page. Currently I have a feed object (TypeAheadFeed) that inherits a dictionary object with the key being the string page name which I use to search and the value being the link string, this worked fine. I then decided to add images to the feed so I made a TypeAheadItem that stored the link and image path then made this object the feed objects value. The object serializes fine and I am storing the JSON in a text file (I will be caching this eventually) but I cannot deserialize the object. The error message I get is **The value "System.Collections.Generic.Dictionary`2[System.String,System.Object]" is not of type "TypeAheadItem" and cannot be used in this generic collection. Parameter name: value** I have included my code below: <Serializable()> _ Public Class TypeAheadFeed Inherits Dictionary(Of String, TypeAheadItem) Public Sub New() MyBase.New() End Sub End Class <Serializable()> _ Public Class TypeAheadItem Public Image As String Public Link As String Public Sub New(ByVal Image As String, ByVal Link As String) Me.Image = Image Me.Link = Link End Sub Public Sub New() End Sub End Class Public Shared Function GetTypeAheadFeed() As TypeAheadFeed Dim FilePath As String = _FeedPath & _TypeAheadFile If File.Exists(FilePath) Then Dim sr As New StreamReader(FilePath) Dim js As New JavaScriptSerializer Dim feed As TypeAheadFeed = js.Deserialize(Of TypeAheadFeed)(sr.ReadToEnd) sr = Nothing js = Nothing Return feed Else Throw New Exception("TypeAhead Feed does not exist") End If End Function
vb.net
json
javascriptserializer
null
null
null
open
JavaScriptSerializer cannot deserialize object === I am building a feed for a type ahead search box so that when a user is conducting a search they can click the link to go straight to a page without having to go to the search page. Currently I have a feed object (TypeAheadFeed) that inherits a dictionary object with the key being the string page name which I use to search and the value being the link string, this worked fine. I then decided to add images to the feed so I made a TypeAheadItem that stored the link and image path then made this object the feed objects value. The object serializes fine and I am storing the JSON in a text file (I will be caching this eventually) but I cannot deserialize the object. The error message I get is **The value "System.Collections.Generic.Dictionary`2[System.String,System.Object]" is not of type "TypeAheadItem" and cannot be used in this generic collection. Parameter name: value** I have included my code below: <Serializable()> _ Public Class TypeAheadFeed Inherits Dictionary(Of String, TypeAheadItem) Public Sub New() MyBase.New() End Sub End Class <Serializable()> _ Public Class TypeAheadItem Public Image As String Public Link As String Public Sub New(ByVal Image As String, ByVal Link As String) Me.Image = Image Me.Link = Link End Sub Public Sub New() End Sub End Class Public Shared Function GetTypeAheadFeed() As TypeAheadFeed Dim FilePath As String = _FeedPath & _TypeAheadFile If File.Exists(FilePath) Then Dim sr As New StreamReader(FilePath) Dim js As New JavaScriptSerializer Dim feed As TypeAheadFeed = js.Deserialize(Of TypeAheadFeed)(sr.ReadToEnd) sr = Nothing js = Nothing Return feed Else Throw New Exception("TypeAhead Feed does not exist") End If End Function
0
11,542,463
07/18/2012 13:24:10
1,482,160
06/26/2012 08:56:18
1
0
Using GPIOInterruptInitialize in WEC7 silverlight application
i am developing silverlight application on WEC7, and i am trying to use GPIO interrupts. If i read/write GPIO it works ok, but when i try to use interrupts they dont get fired. here the initializaion code: HardKeys::gpioHandle = GPIOOpen(); if (HardKeys::gpioHandle == INVALID_HANDLE_VALUE) { OutputDebugString((TEXT("Failed to open the GPIO driver\n"))); return; } GPIOSetMode(HardKeys::gpioHandle,this->EXIT_KEY,GPIO_DIR_INPUT | GPIO_INT_LOW); exitEvent = CreateEvent(NULL,FALSE,FALSE,NULL); BOOL ret; DWORD inthandler = GPIOGetSystemIrq(HardKeys::gpioHandle,this->EXIT_KEY); DWORD erro = GetLastError(); ret = GPIOInterruptInitialize(HardKeys::gpioHandle,this->EXIT_KEY,&inthandler,exitEvent); this->CreateButtonsReadThread(); and here is CreateButtnsReadThread static DWORD WINAPI ButtonsReadThreadStart(void *P) { HardKeys *t = (HardKeys*)P; return t->ReadButtonsThread(); } And here is the rest of the code DWORD HardKeys::ReadButtonsThread() { int z = 0; while(1) { WaitForSingleObject(this->exitEvent,INFINITE); UINT state = GPIOGetBit(this->gpioHandle,this->EXIT_KEY); if (state == 1) { z = 1; } else { z = 0; } } return 0; } void HardKeys::CreateButtonsReadThread() { DWORD ThreadId; CreateThread(NULL,0,ButtonsReadThreadStart,(void*)this,0,&ThreadId); }
embedded
windows-embedded-compact
silverlight-embedded
null
null
null
open
Using GPIOInterruptInitialize in WEC7 silverlight application === i am developing silverlight application on WEC7, and i am trying to use GPIO interrupts. If i read/write GPIO it works ok, but when i try to use interrupts they dont get fired. here the initializaion code: HardKeys::gpioHandle = GPIOOpen(); if (HardKeys::gpioHandle == INVALID_HANDLE_VALUE) { OutputDebugString((TEXT("Failed to open the GPIO driver\n"))); return; } GPIOSetMode(HardKeys::gpioHandle,this->EXIT_KEY,GPIO_DIR_INPUT | GPIO_INT_LOW); exitEvent = CreateEvent(NULL,FALSE,FALSE,NULL); BOOL ret; DWORD inthandler = GPIOGetSystemIrq(HardKeys::gpioHandle,this->EXIT_KEY); DWORD erro = GetLastError(); ret = GPIOInterruptInitialize(HardKeys::gpioHandle,this->EXIT_KEY,&inthandler,exitEvent); this->CreateButtonsReadThread(); and here is CreateButtnsReadThread static DWORD WINAPI ButtonsReadThreadStart(void *P) { HardKeys *t = (HardKeys*)P; return t->ReadButtonsThread(); } And here is the rest of the code DWORD HardKeys::ReadButtonsThread() { int z = 0; while(1) { WaitForSingleObject(this->exitEvent,INFINITE); UINT state = GPIOGetBit(this->gpioHandle,this->EXIT_KEY); if (state == 1) { z = 1; } else { z = 0; } } return 0; } void HardKeys::CreateButtonsReadThread() { DWORD ThreadId; CreateThread(NULL,0,ButtonsReadThreadStart,(void*)this,0,&ThreadId); }
0
11,542,465
07/18/2012 13:24:16
1,090,166
12/09/2011 16:54:50
62
5
Tool for profiling an eclipse plugin
I'm developing an eclipse plugin and I'm starting to have performance problems, so I's like to start using a profiler. Since it's an eclipse plugin and not an ordinary java program, what tool should I use to profile it?
java
eclipse-plugin
profiler
null
null
null
open
Tool for profiling an eclipse plugin === I'm developing an eclipse plugin and I'm starting to have performance problems, so I's like to start using a profiler. Since it's an eclipse plugin and not an ordinary java program, what tool should I use to profile it?
0
11,542,466
07/18/2012 13:24:17
1,534,866
07/18/2012 13:07:30
1
0
Randomly show arrays objects in the same label
I'm working on a project that includes 10 questions and answers. I'm using touchesbegan, touchesmoved and touchesended methods. Question appears in one label, and answer has 10 different labels in the screen. Users should match them, basically this is the game. In touchesended method I'm verifying the result of the question and the location of the answer with if statements, so try to understand if it is the right answer with dragged to right place. So, I need to ask this; the question should be change when the user gives the right answer. I made question on an NSMutableArray, it comes in different and random order for every opening. How can I show some other object of an array in the same label and text. (It should be text because there is another number after that) Here's an example of some code: arr = [[NSMutableArray alloc] initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10", nil]; srandom(time(NULL)); NSUInteger count = [arr count]; for (NSUInteger i = 0; i < count; ++i) { int nElements = count - i; int n = (random() % nElements) + i; [arr exchangeObjectAtIndex: i withObjectAtIndex:n]; } Question.text = [NSString stringWithFormat:@"%ix1=", [[arr objectAtIndex:(random()%9)+1] intValue]];
random
nsmutablearray
label
null
null
null
open
Randomly show arrays objects in the same label === I'm working on a project that includes 10 questions and answers. I'm using touchesbegan, touchesmoved and touchesended methods. Question appears in one label, and answer has 10 different labels in the screen. Users should match them, basically this is the game. In touchesended method I'm verifying the result of the question and the location of the answer with if statements, so try to understand if it is the right answer with dragged to right place. So, I need to ask this; the question should be change when the user gives the right answer. I made question on an NSMutableArray, it comes in different and random order for every opening. How can I show some other object of an array in the same label and text. (It should be text because there is another number after that) Here's an example of some code: arr = [[NSMutableArray alloc] initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10", nil]; srandom(time(NULL)); NSUInteger count = [arr count]; for (NSUInteger i = 0; i < count; ++i) { int nElements = count - i; int n = (random() % nElements) + i; [arr exchangeObjectAtIndex: i withObjectAtIndex:n]; } Question.text = [NSString stringWithFormat:@"%ix1=", [[arr objectAtIndex:(random()%9)+1] intValue]];
0
11,443,380
07/12/2012 00:10:46
645,460
03/04/2011 21:38:53
3,369
144
Having Timestanmp in EF actually tell the code the date of change
I need my entities in EF 4.3 code first environment to know when they were updated last time. Is it possible, and if yes - how - to get the time of the last altering in the entity class has the following property: [Timestamp] public byte[] RowVersion { get; set; } I need to get the time of update from the method in this very same entity class. Thanks.
c#
.net
entity-framework
null
null
null
open
Having Timestanmp in EF actually tell the code the date of change === I need my entities in EF 4.3 code first environment to know when they were updated last time. Is it possible, and if yes - how - to get the time of the last altering in the entity class has the following property: [Timestamp] public byte[] RowVersion { get; set; } I need to get the time of update from the method in this very same entity class. Thanks.
0
11,443,381
07/12/2012 00:11:00
775,698
05/30/2011 03:43:02
295
1
jQuery Autocomplete: How to display tag count?
With Aotocomplete, I want to display name(count) as auto suggestion, when an item is selected, only the name is printed in the input box.My data format is like this [{"name":"Test","count":"5"},{"name":"Javascript","count":"1"}] The code that can display name without count, with multi selected item printed: jQuery(document).ready(function ($){ function split( val ) { return val.split( /,\s*/ ); } function extractLast( term ) { return split( term ).pop(); } $("#ctags-input") .bind( "keydown", function( event ) { if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { event.preventDefault(); } }) .autocomplete({ source: function(req, add){ var ctags_action = 'ctags_autosuggest'; $.getJSON(CTags.url+'?callback=?&action='+ctags_action, req, function(data) { var suggestions = []; $.each(data, function(i, val){ suggestions.push(val.name); }); add(suggestions); }); }, focus: function() { return false; }, select: function( event, ui ) { var terms = split( this.value ); terms.pop(); terms.push( ui.item.value ); terms.push( "" ); this.value = terms.join( ", " ); return false; } }); }); I tried `suggestions.push(val)`;it doesn't work. I also tried `suggestions.push(val.name + "C" + count + ")" );` This can display name(count), but when selected, the (count) also get selected. How can I display display name(count) as suggestion and input name only?
jquery-ui
autocomplete
null
null
null
null
open
jQuery Autocomplete: How to display tag count? === With Aotocomplete, I want to display name(count) as auto suggestion, when an item is selected, only the name is printed in the input box.My data format is like this [{"name":"Test","count":"5"},{"name":"Javascript","count":"1"}] The code that can display name without count, with multi selected item printed: jQuery(document).ready(function ($){ function split( val ) { return val.split( /,\s*/ ); } function extractLast( term ) { return split( term ).pop(); } $("#ctags-input") .bind( "keydown", function( event ) { if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { event.preventDefault(); } }) .autocomplete({ source: function(req, add){ var ctags_action = 'ctags_autosuggest'; $.getJSON(CTags.url+'?callback=?&action='+ctags_action, req, function(data) { var suggestions = []; $.each(data, function(i, val){ suggestions.push(val.name); }); add(suggestions); }); }, focus: function() { return false; }, select: function( event, ui ) { var terms = split( this.value ); terms.pop(); terms.push( ui.item.value ); terms.push( "" ); this.value = terms.join( ", " ); return false; } }); }); I tried `suggestions.push(val)`;it doesn't work. I also tried `suggestions.push(val.name + "C" + count + ")" );` This can display name(count), but when selected, the (count) also get selected. How can I display display name(count) as suggestion and input name only?
0
11,443,308
07/12/2012 00:00:41
1,440,319
06/06/2012 16:48:12
62
4
Symfony2: Pass _route To Event Listener Service
I need to pass the '_route' from the container into an event listener, along with a route attribute. In other words, I need the listener service to become container aware without going through the overhead of passing the whole service_container into the event listener class. I've seen code examples similar to this: services: root.path.locator: class: Acme\Bundle\HelloBundle\Util\RootLocator arguments: ['%kernel.root_dir%'] In a controller I would use something like the code below to grab the "_route": $request = $this->container->get('request'); $routeName = $request->get('_route'); However, in the event listener, I don't have that available. How can I accomplish the above? Thanks, JB
php
symfony-2.0
null
null
null
null
open
Symfony2: Pass _route To Event Listener Service === I need to pass the '_route' from the container into an event listener, along with a route attribute. In other words, I need the listener service to become container aware without going through the overhead of passing the whole service_container into the event listener class. I've seen code examples similar to this: services: root.path.locator: class: Acme\Bundle\HelloBundle\Util\RootLocator arguments: ['%kernel.root_dir%'] In a controller I would use something like the code below to grab the "_route": $request = $this->container->get('request'); $routeName = $request->get('_route'); However, in the event listener, I don't have that available. How can I accomplish the above? Thanks, JB
0
11,443,309
07/12/2012 00:00:51
1,487,312
06/28/2012 02:13:59
1
1
RabbitMQ Shovel plugin stuck on "starting" status
RabbitMQ starts up just fine, but the shovel plugin status is listed as "starting". I'm using the following rabbitmq.config: > [{rabbitmq_shovel, > [{shovels, > [{scrape_request_shovel, > [{sources, [{broker,"amqp://test_user:test_password@localhost"}]}, > {destinations, [{broker, "amqp://test_user:test_password@ec2-###-##-###-###.compute-1.amazonaws.com"}]}, > {queue, <<"scp_request">>}, > {ack_mode, on_confirm}, > {publish_properties, [{delivery_mode, 2}]}, > {publish_fields, [{exchange, <<"">>}, > {routing_key, <<"scp_request">>}]}, > {reconnect_delay, 5} > ]} > ] > }] > }]. Running the following command: > sudo rabbitmqctl eval 'rabbit_shovel_status:status().' returns: > [{scrape_request_shovel,starting,{{2012,7,11},{23,38,47}}}] According to [This question][1], this can result if the users haven't been set up correctly on the two brokers. However, I've double-checked that I've set up the users correctly via rabbitmqctl user_add on both machines -- have even tried it with a different set of users, to be sure. I also ran an nmap scan of port 5672 on the remote host to verify is was up and running on that port. [1]: http://stackoverflow.com/questions/11124526/rabbitmq-shovel-state-always-starting "this question"
rabbitmq
null
null
null
null
null
open
RabbitMQ Shovel plugin stuck on "starting" status === RabbitMQ starts up just fine, but the shovel plugin status is listed as "starting". I'm using the following rabbitmq.config: > [{rabbitmq_shovel, > [{shovels, > [{scrape_request_shovel, > [{sources, [{broker,"amqp://test_user:test_password@localhost"}]}, > {destinations, [{broker, "amqp://test_user:test_password@ec2-###-##-###-###.compute-1.amazonaws.com"}]}, > {queue, <<"scp_request">>}, > {ack_mode, on_confirm}, > {publish_properties, [{delivery_mode, 2}]}, > {publish_fields, [{exchange, <<"">>}, > {routing_key, <<"scp_request">>}]}, > {reconnect_delay, 5} > ]} > ] > }] > }]. Running the following command: > sudo rabbitmqctl eval 'rabbit_shovel_status:status().' returns: > [{scrape_request_shovel,starting,{{2012,7,11},{23,38,47}}}] According to [This question][1], this can result if the users haven't been set up correctly on the two brokers. However, I've double-checked that I've set up the users correctly via rabbitmqctl user_add on both machines -- have even tried it with a different set of users, to be sure. I also ran an nmap scan of port 5672 on the remote host to verify is was up and running on that port. [1]: http://stackoverflow.com/questions/11124526/rabbitmq-shovel-state-always-starting "this question"
0
11,443,382
07/12/2012 00:11:28
1,290,252
03/24/2012 17:04:58
20
2
iOS - Access modifiable raw music library data?
I know it's possible now to take a song from a user's music library and edit it by changing the speed, pitch, etc. but I can't seem to find a link to a useful tutorial on how to access the raw data of a song. Can someone direct me to something like this, or is there perhaps a library for such a thing? Thanks!
objective-c
ios
ios5
audio
library
null
open
iOS - Access modifiable raw music library data? === I know it's possible now to take a song from a user's music library and edit it by changing the speed, pitch, etc. but I can't seem to find a link to a useful tutorial on how to access the raw data of a song. Can someone direct me to something like this, or is there perhaps a library for such a thing? Thanks!
0
11,443,386
07/12/2012 00:11:51
602,253
02/03/2011 21:17:29
18
0
More Rows and More Columns jQuery
Hello i am wanting a "Add Rows" and "Add Columns" button system thing. My html is: <table border="2" id="the_table"> <tr> <td><input name="value_1[]"/></td> </tr> </table> <a href="#" rel="add_row">Add Row</a> <a href="#" rel="add_column">Add Column</a> My jQuery: $(document).ready(function(){ var table_id = "#the_table"; jQuery.fn.renderTable = function() { var rowCount = $(table_id + ' tr').length; var colCount = 0; $(table_id + ' tr:nth-child(1) td').each(function () { if ($(this).attr('colspan')) { colCount += +$(this).attr('colspan'); } else { colCount++; } }); if($(this[0]).attr("rel") == "add_row") { var id = $(table_id + " input:last").attr("name"); id = id.replace(/value_(\d+)/, function(match, number) { return 'value_' + (parseInt(number, 10) + 1); }); var x = 0; var result = "<tr>"; while (x != colCount) { result += '<td><input name="' + id + '" /></td>'; x = x + 1; } result += "</tr>"; $(table_id + ' tr:last').after(result); } if($(this[0]).attr("rel") == "add_column") { } }; $('a').click(function(){ $(this).renderTable(); return false; }); }); So baiscally when i click add rows i want it to add a row but increment the name of the field for php $_POST... And with add columns it must add a column and increment the names down. so my output for a 2 x 2 table would be: <table border="2" id="the_table"> <tr> <td><input name="value_1[]"/></td> <td><input name="value_1[]"/></td> </tr> <tr> <td><input name="value_2[]"/></td> <td><input name="value_2[]"/></td> </tr> </table> Is there a way this can be done? Thank you in advance!! :D
jquery
html
null
null
null
null
open
More Rows and More Columns jQuery === Hello i am wanting a "Add Rows" and "Add Columns" button system thing. My html is: <table border="2" id="the_table"> <tr> <td><input name="value_1[]"/></td> </tr> </table> <a href="#" rel="add_row">Add Row</a> <a href="#" rel="add_column">Add Column</a> My jQuery: $(document).ready(function(){ var table_id = "#the_table"; jQuery.fn.renderTable = function() { var rowCount = $(table_id + ' tr').length; var colCount = 0; $(table_id + ' tr:nth-child(1) td').each(function () { if ($(this).attr('colspan')) { colCount += +$(this).attr('colspan'); } else { colCount++; } }); if($(this[0]).attr("rel") == "add_row") { var id = $(table_id + " input:last").attr("name"); id = id.replace(/value_(\d+)/, function(match, number) { return 'value_' + (parseInt(number, 10) + 1); }); var x = 0; var result = "<tr>"; while (x != colCount) { result += '<td><input name="' + id + '" /></td>'; x = x + 1; } result += "</tr>"; $(table_id + ' tr:last').after(result); } if($(this[0]).attr("rel") == "add_column") { } }; $('a').click(function(){ $(this).renderTable(); return false; }); }); So baiscally when i click add rows i want it to add a row but increment the name of the field for php $_POST... And with add columns it must add a column and increment the names down. so my output for a 2 x 2 table would be: <table border="2" id="the_table"> <tr> <td><input name="value_1[]"/></td> <td><input name="value_1[]"/></td> </tr> <tr> <td><input name="value_2[]"/></td> <td><input name="value_2[]"/></td> </tr> </table> Is there a way this can be done? Thank you in advance!! :D
0
11,443,387
07/12/2012 00:11:58
684,395
03/30/2011 17:20:35
93
5
In Inno Setup, what is the precise definition of ewWaitUntilIdle?
As part of my installer, I need to call out to a DBMS system and shut it down, and then later start it up. If that DBMS hangs for some reason, my installer hangs forever. I call Exec to a command that will start or stop the database, my question is: What exactly is the definition of ewWaitUntilIdle? If my command to start/stop the database never comes back, what meets the condition of idle?
windows-installer
inno-setup
null
null
null
null
open
In Inno Setup, what is the precise definition of ewWaitUntilIdle? === As part of my installer, I need to call out to a DBMS system and shut it down, and then later start it up. If that DBMS hangs for some reason, my installer hangs forever. I call Exec to a command that will start or stop the database, my question is: What exactly is the definition of ewWaitUntilIdle? If my command to start/stop the database never comes back, what meets the condition of idle?
0
11,443,389
07/12/2012 00:12:17
1,519,338
07/11/2012 23:57:32
1
0
Intermittent PHP timeouts in IIS7
I am experiencing an interesting problem with php 5.3.6 running on IIS7. The web server runs fine until it begins experiencing intermittent fastcgi timeouts. These timeouts increase in frequency over time until almost every request to php results in a timeout error (code 258 in IIS). The occurrence pattern is pretty random, seeming to occur once every 2-4 days under normal load. Normal load is about 30-100 requests per minute. I want to make it clear that this is not a question about how to increase timeout settings for IIS or fastcgi processes. The timeout values on the server are set around the 2 minute range and everything works normally *most* of the time. The problem here is specifically fastcgi timeouts increase in frequency until even the most simple php requests are hitting the 2 minute timeout. It is almost as if the fastcgi process is hanging and never recycling. Restarting IIS puts everything back in order. Any ideas? Thanks.
php
iis7
fastcgi
null
null
07/12/2012 00:47:09
not a real question
Intermittent PHP timeouts in IIS7 === I am experiencing an interesting problem with php 5.3.6 running on IIS7. The web server runs fine until it begins experiencing intermittent fastcgi timeouts. These timeouts increase in frequency over time until almost every request to php results in a timeout error (code 258 in IIS). The occurrence pattern is pretty random, seeming to occur once every 2-4 days under normal load. Normal load is about 30-100 requests per minute. I want to make it clear that this is not a question about how to increase timeout settings for IIS or fastcgi processes. The timeout values on the server are set around the 2 minute range and everything works normally *most* of the time. The problem here is specifically fastcgi timeouts increase in frequency until even the most simple php requests are hitting the 2 minute timeout. It is almost as if the fastcgi process is hanging and never recycling. Restarting IIS puts everything back in order. Any ideas? Thanks.
1
11,443,392
07/12/2012 00:12:47
159,342
08/19/2009 14:45:17
238
24
Adding Description to MapQuest Flash API Mobile
Basic code: protected function map_creationCompleteHandler(event:FlexEvent):void { this.geocoder = new Geocoder(this.map.tileMap); this.geocoder.addEventListener(GeocoderEvent.GEOCODE_ERROR_EVENT,this.onGeocodeError); this.geocoder.addEventListener(GeocoderEvent.REVERSE_GEOCODE_RESPONSE,this.onReverseGeocodeResponse); this.geocoder.addEventListener(GeocoderEvent.HTTP_ERROR_EVENT,this.onHttpError); cursorManager.setBusyCursor(); this.map.removeShapes(); var ll:LatLng = new LatLng(Number('40.053097'), Number('-76.313652')); this.geocoder.reverseGeocode(ll); } private function onGeocodeError(e:GeocoderEvent):void { // trace the error.. } private function onHttpError(e:GeocoderEvent):void { this.cursorManager.removeBusyCursor(); this.makeErrorList("HTTP ERROR"); } private function onReverseGeocodeResponse(event:GeocoderEvent):void { // Add the descriptive name to the locationg being geocoded. } On the on onReverseGeocodeResponse event, how can I add a descriptive label to the location tooltip so that when the user focuses on the location pointed, it will show that label which I added, including the complete address that the map service locates? Is there also a way that I could add a button on the location tooltip, so that when the button is clicked, I could perform other functions?
flash
flex
mobile
mapquest
null
null
open
Adding Description to MapQuest Flash API Mobile === Basic code: protected function map_creationCompleteHandler(event:FlexEvent):void { this.geocoder = new Geocoder(this.map.tileMap); this.geocoder.addEventListener(GeocoderEvent.GEOCODE_ERROR_EVENT,this.onGeocodeError); this.geocoder.addEventListener(GeocoderEvent.REVERSE_GEOCODE_RESPONSE,this.onReverseGeocodeResponse); this.geocoder.addEventListener(GeocoderEvent.HTTP_ERROR_EVENT,this.onHttpError); cursorManager.setBusyCursor(); this.map.removeShapes(); var ll:LatLng = new LatLng(Number('40.053097'), Number('-76.313652')); this.geocoder.reverseGeocode(ll); } private function onGeocodeError(e:GeocoderEvent):void { // trace the error.. } private function onHttpError(e:GeocoderEvent):void { this.cursorManager.removeBusyCursor(); this.makeErrorList("HTTP ERROR"); } private function onReverseGeocodeResponse(event:GeocoderEvent):void { // Add the descriptive name to the locationg being geocoded. } On the on onReverseGeocodeResponse event, how can I add a descriptive label to the location tooltip so that when the user focuses on the location pointed, it will show that label which I added, including the complete address that the map service locates? Is there also a way that I could add a button on the location tooltip, so that when the button is clicked, I could perform other functions?
0
11,443,394
07/12/2012 00:13:18
652,259
03/09/2011 19:29:24
470
21
Is there any way to make these span elements vertically align?
Since I'm using a JQuery Sortable control that seems to expect spans, I now am having trouble getting elements to vertically align. Normally, using Div's, I'd just add padding. In this case though the image is centered but the text is too low and needs to be bumped up a few pixels. @foreach(var c in companies) { var company = c.Company; <li class="ui-state-default"> <span> <img src="..\..\Content\img\udarrow.png"/> </span> <span> @company </span> </li> } Is there any way to do this?
html
null
null
null
null
null
open
Is there any way to make these span elements vertically align? === Since I'm using a JQuery Sortable control that seems to expect spans, I now am having trouble getting elements to vertically align. Normally, using Div's, I'd just add padding. In this case though the image is centered but the text is too low and needs to be bumped up a few pixels. @foreach(var c in companies) { var company = c.Company; <li class="ui-state-default"> <span> <img src="..\..\Content\img\udarrow.png"/> </span> <span> @company </span> </li> } Is there any way to do this?
0
11,443,130
07/11/2012 23:37:53
1,074,803
12/01/2011 05:38:03
34
0
Drop down selections based on Previous selection
I have a little question. I am running an event and its in few cities, different dates and different times. I'm creating a signup form in jQuery / PHP / HTML . I wan the options to appear based on the previous selection. I have 3 cities **"City1" "City2" "City3"** And "City1" is on **"22nd July" & "25th July"** And on "22nd July" there are 2 sessions **"2pm" & "5pm"** How can I get started with a form like this? Please give me an example. Thanks heaps guys
php
jquery
html
null
null
null
open
Drop down selections based on Previous selection === I have a little question. I am running an event and its in few cities, different dates and different times. I'm creating a signup form in jQuery / PHP / HTML . I wan the options to appear based on the previous selection. I have 3 cities **"City1" "City2" "City3"** And "City1" is on **"22nd July" & "25th July"** And on "22nd July" there are 2 sessions **"2pm" & "5pm"** How can I get started with a form like this? Please give me an example. Thanks heaps guys
0
11,411,133
07/10/2012 10:14:53
324,112
04/23/2010 11:24:54
262
9
how to send keystrokes to bluetooth connected iphone in cocoa app
I need to send keystrokes to bluetooth connected iPhone from cocoa app,just like "TypeToPhone" app is doing. Please let me know how i can do that. Thanks,
iphone
cocoa
bluetooth
null
null
null
open
how to send keystrokes to bluetooth connected iphone in cocoa app === I need to send keystrokes to bluetooth connected iPhone from cocoa app,just like "TypeToPhone" app is doing. Please let me know how i can do that. Thanks,
0
11,411,135
07/10/2012 10:14:56
1,302,274
03/30/2012 02:48:26
599
50
Saving in NSDocumentDirectory weird preview
Having weird problem with my `NSDocumenDirectory` saving. Here is a sneak preview: First I pick images ( in my `imagePickerViewController`): ![enter image description here][1] in my `PreviewController`: ![enter image description here][2] So at first try, it was okay. Then I revisit the `imagePickerViewController` to add another image: ![enter image description here][3] in my `PreviewController`: ![enter image description here][4] This is where the problem occurs. At the image above, it recopies the last image from the old preview (like a duplicate). I dunno what Im doing wrong in my codes. But Im saving it when a file exist. Kindly see: for (int i = 0; i < info.count; i++) { NSLog(@"%@", [info objectAtIndex:i]); NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask ,YES ); NSString *documentsDir = [paths objectAtIndex:0]; NSString *savedImagePath = [documentsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"firstSlotImages%d.png", i]]; if ([[NSFileManager defaultManager] fileExistsAtPath:savedImagePath]) { NSLog(@"file doesnt exist"); } else { ALAssetRepresentation *rep = [[info objectAtIndex: i] defaultRepresentation]; UIImage *image = [UIImage imageWithCGImage:[rep fullResolutionImage]]; //----resize the images image = [self imageByScalingAndCroppingForSize:image toSize:CGSizeMake(256,256*image.size.height/image.size.width)]; NSData *imageData = UIImagePNGRepresentation(image); [imageData writeToFile:savedImagePath atomically:YES]; NSLog(@"saving at:%@",savedImagePath); } } What I need is to just reAdd AGAIN the same image with the new one. Same as, like the last preview. [1]: http://i.stack.imgur.com/28mVH.png [2]: http://i.stack.imgur.com/K0ASM.png [3]: http://i.stack.imgur.com/YT6T9.png [4]: http://i.stack.imgur.com/2eoWG.png
iphone
ios
xcode
null
null
null
open
Saving in NSDocumentDirectory weird preview === Having weird problem with my `NSDocumenDirectory` saving. Here is a sneak preview: First I pick images ( in my `imagePickerViewController`): ![enter image description here][1] in my `PreviewController`: ![enter image description here][2] So at first try, it was okay. Then I revisit the `imagePickerViewController` to add another image: ![enter image description here][3] in my `PreviewController`: ![enter image description here][4] This is where the problem occurs. At the image above, it recopies the last image from the old preview (like a duplicate). I dunno what Im doing wrong in my codes. But Im saving it when a file exist. Kindly see: for (int i = 0; i < info.count; i++) { NSLog(@"%@", [info objectAtIndex:i]); NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask ,YES ); NSString *documentsDir = [paths objectAtIndex:0]; NSString *savedImagePath = [documentsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"firstSlotImages%d.png", i]]; if ([[NSFileManager defaultManager] fileExistsAtPath:savedImagePath]) { NSLog(@"file doesnt exist"); } else { ALAssetRepresentation *rep = [[info objectAtIndex: i] defaultRepresentation]; UIImage *image = [UIImage imageWithCGImage:[rep fullResolutionImage]]; //----resize the images image = [self imageByScalingAndCroppingForSize:image toSize:CGSizeMake(256,256*image.size.height/image.size.width)]; NSData *imageData = UIImagePNGRepresentation(image); [imageData writeToFile:savedImagePath atomically:YES]; NSLog(@"saving at:%@",savedImagePath); } } What I need is to just reAdd AGAIN the same image with the new one. Same as, like the last preview. [1]: http://i.stack.imgur.com/28mVH.png [2]: http://i.stack.imgur.com/K0ASM.png [3]: http://i.stack.imgur.com/YT6T9.png [4]: http://i.stack.imgur.com/2eoWG.png
0
11,411,136
07/10/2012 10:14:59
1,514,406
07/10/2012 09:58:30
1
0
analytics tracking with php website
I hope I have posted this question in the right place and apologies if it is incorrectly located. I have recently changed my website format to php (rather than html). I.e. I have renamed all my html pages with .php prefix and fixed links with my .htaccess file. I need to track my new php pages with google analytics and therefore I have created a separate php file containing the javascript snippet taken from google analytics website placed at the root of my website. This file is then linked to each of my php pages with this code after the <body> tag: <?php include_once("analyticstracking.php") ?> My problem is that this only appears to be working with my index.php page! Only my index.php page can locate the file...all my other pages cannot find analyticstracking.php (in dreamweaver it says "'analyticstracking.php' is not on the local disk. Get") If I change the link (by adding "/") to: <?php include_once("/analyticstracking.php") ?> then all my pages can locate the file but google analytics doesn't appear to track my activity. I am using "Analytics - Real Time" to test this. Here is my url www.brp-architects.com. (Currently using <?php include_once("/analyticstracking.php") ?> as this code, with the "/", allows all my pages to locate my tracking code php file). The whole reason I am doing this is so I can use a snippet of PHP code to retrieve my website visitor's IP addresses by getting behind the proxy servers ip: <? if (getenv(HTTP_X_FORWARDED_FOR)) { $ip_address = getenv(HTTP_X_FORWARDED_FOR); } else { $ip_address = getenv(REMOTE_ADDR); } ?> Any suggestions welcome! Hope someone can help! Yours struggling, Michael
php
google-analytics
null
null
null
null
open
analytics tracking with php website === I hope I have posted this question in the right place and apologies if it is incorrectly located. I have recently changed my website format to php (rather than html). I.e. I have renamed all my html pages with .php prefix and fixed links with my .htaccess file. I need to track my new php pages with google analytics and therefore I have created a separate php file containing the javascript snippet taken from google analytics website placed at the root of my website. This file is then linked to each of my php pages with this code after the <body> tag: <?php include_once("analyticstracking.php") ?> My problem is that this only appears to be working with my index.php page! Only my index.php page can locate the file...all my other pages cannot find analyticstracking.php (in dreamweaver it says "'analyticstracking.php' is not on the local disk. Get") If I change the link (by adding "/") to: <?php include_once("/analyticstracking.php") ?> then all my pages can locate the file but google analytics doesn't appear to track my activity. I am using "Analytics - Real Time" to test this. Here is my url www.brp-architects.com. (Currently using <?php include_once("/analyticstracking.php") ?> as this code, with the "/", allows all my pages to locate my tracking code php file). The whole reason I am doing this is so I can use a snippet of PHP code to retrieve my website visitor's IP addresses by getting behind the proxy servers ip: <? if (getenv(HTTP_X_FORWARDED_FOR)) { $ip_address = getenv(HTTP_X_FORWARDED_FOR); } else { $ip_address = getenv(REMOTE_ADDR); } ?> Any suggestions welcome! Hope someone can help! Yours struggling, Michael
0
11,411,139
07/10/2012 10:15:05
986,586
10/09/2011 17:22:35
36
0
drag and drop marker openlayers addon for Vaddin
How to drag and drop a Marker using the openLayers Add-on for vaadin ? the add-on : https://vaadin.com/directory#addon/openlayers-wrapper Please any help !!
java-ee
openlayers
vaadin
null
null
null
open
drag and drop marker openlayers addon for Vaddin === How to drag and drop a Marker using the openLayers Add-on for vaadin ? the add-on : https://vaadin.com/directory#addon/openlayers-wrapper Please any help !!
0
11,411,140
07/10/2012 10:15:11
755,584
05/16/2011 11:59:50
130
1
Get file from other developer local GIT and add to main repository
I need to do a simple thing but I just can't find the right way... Me and other developer are working with the same GIT branch on a cloud repository. He added some file with code that is not well formatted and committed locally but didn't push to the cloud. I want to get those files by connecting directly to his `.git` folder by using `git pull`. I know that in this stage GIT will create a remote branch for me and a local branch to hold this files. What I can't understand is: 1. Can I pull only specific files? **2. How can I add this files to the main branch I'm working on' edit them and then push them to the server?** BTW: I guess that the right way will be to create a temporary branch, push from my friend machine to it, pull on my machine and then push it to the cloud but in my workplace committing not well formatted code is problematic...
git
null
null
null
null
null
open
Get file from other developer local GIT and add to main repository === I need to do a simple thing but I just can't find the right way... Me and other developer are working with the same GIT branch on a cloud repository. He added some file with code that is not well formatted and committed locally but didn't push to the cloud. I want to get those files by connecting directly to his `.git` folder by using `git pull`. I know that in this stage GIT will create a remote branch for me and a local branch to hold this files. What I can't understand is: 1. Can I pull only specific files? **2. How can I add this files to the main branch I'm working on' edit them and then push them to the server?** BTW: I guess that the right way will be to create a temporary branch, push from my friend machine to it, pull on my machine and then push it to the cloud but in my workplace committing not well formatted code is problematic...
0
11,390,684
07/09/2012 07:27:53
430,278
07/29/2010 06:14:09
502
0
display information in columnWise
I want to create the NEWS paper app for iPad. Could you please tell me the how to display NEWS in column wise ?
ios
ipad
null
null
null
null
open
display information in columnWise === I want to create the NEWS paper app for iPad. Could you please tell me the how to display NEWS in column wise ?
0
11,390,685
07/09/2012 07:27:53
1,072,848
11/30/2011 07:36:51
60
4
JMS Message Sending After JMS Server Restart During Runtime
I am having a problem about JMS. The problem is, I have an application and it is trying to send a message through JMS , but after JMS server restart, it throws exception as when the server was down time. It is not reconnecting. It is completely fine without a restart of JMS server and I am using weblogic 10.x. Is it a problem about JMS configuration? Thanks
java
spring
jms
weblogic
reconnect
null
open
JMS Message Sending After JMS Server Restart During Runtime === I am having a problem about JMS. The problem is, I have an application and it is trying to send a message through JMS , but after JMS server restart, it throws exception as when the server was down time. It is not reconnecting. It is completely fine without a restart of JMS server and I am using weblogic 10.x. Is it a problem about JMS configuration? Thanks
0
11,390,686
07/09/2012 07:27:59
965,020
09/26/2011 12:12:40
105
1
Android how to fetch parent item in expandable list item by "int groupPosition"
I have to fetch View of Expanded List Item in Expandable list View. I have to do it in method: list.setOnGroupExpandListener(new OnGroupExpandListener() { @Override public void onGroupExpand(int groupPosition) { View v = adapter.getGroupView(groupPosition, true, null, null); v.setBackgroundColor(R.color.orange_expanded_upper); } }); In method onGroupExpand I have only int groupPosition as a prameter. So how to fetch View of it? I need it in order to change background color, wen list expanded.
android
expandablelistview
null
null
null
null
open
Android how to fetch parent item in expandable list item by "int groupPosition" === I have to fetch View of Expanded List Item in Expandable list View. I have to do it in method: list.setOnGroupExpandListener(new OnGroupExpandListener() { @Override public void onGroupExpand(int groupPosition) { View v = adapter.getGroupView(groupPosition, true, null, null); v.setBackgroundColor(R.color.orange_expanded_upper); } }); In method onGroupExpand I have only int groupPosition as a prameter. So how to fetch View of it? I need it in order to change background color, wen list expanded.
0
11,411,149
07/10/2012 10:15:37
1,184,426
02/02/2012 06:23:31
158
12
How to get details of all users using a particular application using PHP SDK?
I created an application in facebook. How to get details of all users of this application even if they are not my facebook friends. I need a PHP SDK query Can someone help me please?
php
facebook
facebook-php-sdk
null
null
null
open
How to get details of all users using a particular application using PHP SDK? === I created an application in facebook. How to get details of all users of this application even if they are not my facebook friends. I need a PHP SDK query Can someone help me please?
0
11,411,153
07/10/2012 10:15:55
255,363
01/20/2010 23:32:43
4,577
270
Clear propel cache (instance pool)
I need to force reread data from DB within one php execution, using propel. I already have a bit hacky solution: call init%modelName% for corresponding classes, but want something better. Is there any single call or service config option for that? Like killing whole instance pool. About service: we use symfony2 and don't need cache only in one specific case, hence we can create even separate environment for that.
symfony-2.0
propel
null
null
null
null
open
Clear propel cache (instance pool) === I need to force reread data from DB within one php execution, using propel. I already have a bit hacky solution: call init%modelName% for corresponding classes, but want something better. Is there any single call or service config option for that? Like killing whole instance pool. About service: we use symfony2 and don't need cache only in one specific case, hence we can create even separate environment for that.
0
11,411,160
07/10/2012 10:16:15
1,504,495
07/05/2012 15:31:45
3
0
Android - using parsed xml data to update SQLite
just a reminder that I'm a noob so maybe my question is fairly stupid... Anyway I'm using SAX to parse an XML file and I can correctly loop through the items and print their contents to the log. What I'd need though is for this parser to return a multidimensional associative array that I can iterate through and subsequently use to update an SQLite database... Question(s): Does such a thing exist in Android? Should I be using some other datatype instead? How is it done? I'll include some code of the parser (the endElement method does the printing to log, so far it has one element per item but that will change, hence the need for multidimensional): private boolean in_image = false; private boolean in_homeimage = false; StringBuilder sb; @Override public void characters(char[] ch, int start, int length) throws SAXException { for (int i=start; i<start+length; i++) { sb.append(ch[i]); } //super.characters(ch, start, length); } @Override public void endElement(String uri, String localName, String qName) throws SAXException { if( localName.equals("image") && this.in_homeimage ){ this.in_homeimage = false; Log.i("Extra", "Found homeimage: " + sb); } else if( localName.equals("image") ){ this.in_image = false; Log.i("Extra", "Found image: " + sb); } //super.endElement(uri, localName, qName); } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { sb = new StringBuilder(); if( localName.equals("image") && attributes.getValue("name") == "home" ) this.in_homeimage = true; else if( localName.equals("image") ) this.in_image = true; //super.startElement(uri, localName, qName, attributes); } Thanks in advance
android
multidimensional-array
xml-parsing
null
null
null
open
Android - using parsed xml data to update SQLite === just a reminder that I'm a noob so maybe my question is fairly stupid... Anyway I'm using SAX to parse an XML file and I can correctly loop through the items and print their contents to the log. What I'd need though is for this parser to return a multidimensional associative array that I can iterate through and subsequently use to update an SQLite database... Question(s): Does such a thing exist in Android? Should I be using some other datatype instead? How is it done? I'll include some code of the parser (the endElement method does the printing to log, so far it has one element per item but that will change, hence the need for multidimensional): private boolean in_image = false; private boolean in_homeimage = false; StringBuilder sb; @Override public void characters(char[] ch, int start, int length) throws SAXException { for (int i=start; i<start+length; i++) { sb.append(ch[i]); } //super.characters(ch, start, length); } @Override public void endElement(String uri, String localName, String qName) throws SAXException { if( localName.equals("image") && this.in_homeimage ){ this.in_homeimage = false; Log.i("Extra", "Found homeimage: " + sb); } else if( localName.equals("image") ){ this.in_image = false; Log.i("Extra", "Found image: " + sb); } //super.endElement(uri, localName, qName); } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { sb = new StringBuilder(); if( localName.equals("image") && attributes.getValue("name") == "home" ) this.in_homeimage = true; else if( localName.equals("image") ) this.in_image = true; //super.startElement(uri, localName, qName, attributes); } Thanks in advance
0
11,411,161
07/10/2012 10:16:26
1,410,112
05/22/2012 11:42:21
1
0
Parameterization using Excel in Selenium Webdriver with C#
What C# code should i use for parameterization in webdriver using Excel?
c#
excel
webdriver
parameterization
null
null
open
Parameterization using Excel in Selenium Webdriver with C# === What C# code should i use for parameterization in webdriver using Excel?
0
11,734,709
07/31/2012 06:54:31
1,531,761
07/17/2012 12:25:44
1
1
How do I get my google account/profile pic to show as a map marker to my current location in android?
I have played with google maps on android for quite some time.I just couldn't find any link/reference as to do this. Is there any way I could retrieve my google account profile pic from any of my signed in accounts?I want to use it as a marker for my current location.Google maps application does this and its pretty neat when you are trying to show your current location. Thanks for any help...
android
android-mapview
android-maps
null
null
null
open
How do I get my google account/profile pic to show as a map marker to my current location in android? === I have played with google maps on android for quite some time.I just couldn't find any link/reference as to do this. Is there any way I could retrieve my google account profile pic from any of my signed in accounts?I want to use it as a marker for my current location.Google maps application does this and its pretty neat when you are trying to show your current location. Thanks for any help...
0
11,734,710
07/31/2012 06:54:34
1,554,885
07/26/2012 13:42:33
6
0
Can the domain control server and team foundation server been installed on the same machine?
I have installed team foundation server adopt the workgroup style, and I find the user manage is difficult, so I want to adpot domain. Can the domain control server and team foundation server been installed on the same machine? Is there need some virtual technology? Thank you!
tfs2010
domain
null
null
null
null
open
Can the domain control server and team foundation server been installed on the same machine? === I have installed team foundation server adopt the workgroup style, and I find the user manage is difficult, so I want to adpot domain. Can the domain control server and team foundation server been installed on the same machine? Is there need some virtual technology? Thank you!
0
11,734,714
07/31/2012 06:54:43
1,258,949
03/09/2012 09:25:00
1
2
target variable refernce name of a event listener
How to get the target variable refernce name of a event listener var key1:Key=new Key(); var key2:Key=new Key(); key1.addEventListener(MouseEvent.CLICK,function(e:MouseEvent):void{ checkAnswer(e,qset) }); key2.addEventListener(MouseEvent.CLICK,function(e:MouseEvent):void{ checkAnswer(e,qset) }); function checkAnswer(e:MouseEvent,qset:Number):void{ //here I want the target variable reference ("key1" or "key2") //e.target only gives the movieclip refernce like "[Object Key]" } `
actionscript-3
flash
mouseevent
flash-cs5
null
null
open
target variable refernce name of a event listener === How to get the target variable refernce name of a event listener var key1:Key=new Key(); var key2:Key=new Key(); key1.addEventListener(MouseEvent.CLICK,function(e:MouseEvent):void{ checkAnswer(e,qset) }); key2.addEventListener(MouseEvent.CLICK,function(e:MouseEvent):void{ checkAnswer(e,qset) }); function checkAnswer(e:MouseEvent,qset:Number):void{ //here I want the target variable reference ("key1" or "key2") //e.target only gives the movieclip refernce like "[Object Key]" } `
0
11,734,715
07/31/2012 06:54:43
1,071,339
11/29/2011 13:07:12
174
3
path to image folder on server
i have a wordpress inside Public html folder on server. i want to dispaly images from the folder Public_html--->Trial-->Wordpress_site-->uploads below is page.php code <?php $directory = dirname(__FILE__).'/uploads'; echo $directory; try { // Styling for images foreach ( new DirectoryIterator("/" . $directory) as $item ) { if ($item->isFile()) { echo "<div class=\"expand_image\">"; $path = "/" . $directory . "/" . $item; echo $path; echo "<img src=/"". $path . "\" width=861 height=443 />"; echo "</div>"; } } } catch(Exception $e) { echo 'No images found for this player.<br />'; } ?> The images arent getting displayed.. anyone knows about the same??
php
wordpress
null
null
null
null
open
path to image folder on server === i have a wordpress inside Public html folder on server. i want to dispaly images from the folder Public_html--->Trial-->Wordpress_site-->uploads below is page.php code <?php $directory = dirname(__FILE__).'/uploads'; echo $directory; try { // Styling for images foreach ( new DirectoryIterator("/" . $directory) as $item ) { if ($item->isFile()) { echo "<div class=\"expand_image\">"; $path = "/" . $directory . "/" . $item; echo $path; echo "<img src=/"". $path . "\" width=861 height=443 />"; echo "</div>"; } } } catch(Exception $e) { echo 'No images found for this player.<br />'; } ?> The images arent getting displayed.. anyone knows about the same??
0
11,734,693
07/31/2012 06:53:41
281,839
02/26/2010 06:30:28
572
1
SQL Server 2012 installation failure An error occurred for a dependency of the feature causing the setup process for the feature to fail
I am installing SQL Server 2012 Developer (from ISO image written on DVD), my machine has Windows 7 and it already has SQL Express and SQL 2008 R2 Express installed in it. On running 2012 setup it goes fine from Setup Support Rules to Installation Progress. In Installation Progress after some progress installation fails. **Windows show the following components couldn't installed:** Managment Tools Complete Failed. Client Tools Connectivity Failed. Client Tools SDK Failed. Client Tools Backwards Compantibility Failed. Managment Tools Basic Failed. SQL Server Data Tools Failed. Reporting Services -Native Failed. Database Engine Services Failed. Data Quality Services Failed. full-Text and Semantic Extractins for Search Failed. SQL Server Replication Failed. Integration Services Failed. Analysis Services Failed. SQL Client Connectivity SDK Failed. In detail for failure of every component it provide these details: **Action required:** Use the following information to resolve the error, and then try the setup process again. **Feature failure reason:** An error occurred for a dependency of the feature causing the setup process for the feature to fail. In summary log file it provide the following details: Overall summary: Final result: Failed: see details below Exit code (Decimal): -2068643839 Start time: 2012-07-31 16:23:37 End time: 2012-07-31 16:33:32 Requested action: Install Setup completed with required actions for features. Troubleshooting information for those features: Next step for Adv_SSMS: Use the following information to resolve the error, and then try the setup process again. Next step for Conn: Use the following information to resolve the error, and then try the setup process again. Next step for SDK: Use the following information to resolve the error, and then try the setup process again. Next step for BC: Use the following information to resolve the error, and then try the setup process again. Next step for SSMS: Use the following information to resolve the error, and then try the setup process again. Next step for BIDS: Use the following information to resolve the error, and then try the setup process again. Next step for RS: Use the following information to resolve the error, and then try the setup process again. Next step for SQLEngine: Use the following information to resolve the error, and then try the setup process again. Next step for DQ: Use the following information to resolve the error, and then try the setup process again. Next step for FullText: Use the following information to resolve the error, and then try the setup process again. Next step for Replication: Use the following information to resolve the error, and then try the setup process again. Next step for IS: Use the following information to resolve the error, and then try the setup process again. Next step for AS: Use the following information to resolve the error, and then try the setup process again. Next step for SNAC_SDK: Use the following information to resolve the error, and then try the setup process again. Machine Properties: Machine name: Haansi-PC Machine processor count: 4 OS version: Windows 7 OS service pack: Service Pack 1 OS region: United States OS language: English (United States) OS architecture: x64 Process architecture: 64 Bit OS clustered: No Product features discovered: Product Instance Instance ID Feature Language Edition Version Clustered SQL Server 2005 SQLEXPRESS MSSQL.1 Database Engine Services 1033 Express Edition 9.4.5000 No SQL Server 2005 SQLEXPRESS MSSQL.1 SQL Server Replication 1033 Express Edition 9.4.5000 No SQL Server 2005 SQLEXPRESS MSSQL.1 SharedTools 1033 Express Edition 9.4.5000 No SQL Server 2005 Tools 1033 Express Edition 9.4.5000 No SQL Server 2005 ToolsClient 1033 Express Edition 9.4.5000 No SQL Server 2005 ToolsClient\Connectivity 1033 Express Edition 9.4.5000 No SQL Server 2008 R2 SQLSERVER08EXPR2 MSSQL10_50.SQLSERVER08EXPR2 Database Engine Services 1033 Express Edition 10.50.1617.0 No SQL Server 2008 R2 SQLSERVER08EXPR2 MSSQL10_50.SQLSERVER08EXPR2 SQL Server Replication 1033 Express Edition 10.50.1617.0 No SQL Server 2008 R2 Management Tools - Basic 1033 Express Edition 10.50.1617.0 No SQL Server 2012 LocalDB 1033 Express Edition 11.0.2318.0 No SQL Server 2012 Reporting Services - SharePoint 11.0.2100.60 No Package properties: Description: Microsoft SQL Server 2012 ProductName: SQL Server 2012 Type: RTM Version: 11 SPLevel: 0 Installation location: F:\x64\setup\ Installation edition: Developer Product Update Status: None discovered. User Input Settings: ACTION: Install ADDCURRENTUSERASSQLADMIN: false AGTSVCACCOUNT: NT Service\SQLAgent$SS2012 AGTSVCPASSWORD: ***** AGTSVCSTARTUPTYPE: Manual ASBACKUPDIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Backup ASCOLLATION: Latin1_General_CI_AS ASCONFIGDIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Config ASDATADIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Data ASLOGDIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Log ASPROVIDERMSOLAP: 1 ASSERVERMODE: TABULAR ASSVCACCOUNT: NT Service\MSOLAP$SS2012 ASSVCPASSWORD: <empty> ASSVCSTARTUPTYPE: Manual ASSYSADMINACCOUNTS: PC\Haansi ASTEMPDIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Temp BROWSERSVCSTARTUPTYPE: Automatic CLTCTLRNAME: <empty> CLTRESULTDIR: <empty> CLTSTARTUPTYPE: 0 CLTSVCACCOUNT: <empty> CLTSVCPASSWORD: <empty> CLTWORKINGDIR: <empty> COMMFABRICENCRYPTION: 0 COMMFABRICNETWORKLEVEL: 0 COMMFABRICPORT: 0 CONFIGURATIONFILE: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20120731_161013\ConfigurationFile.ini CTLRSTARTUPTYPE: 0 CTLRSVCACCOUNT: <empty> CTLRSVCPASSWORD: <empty> CTLRUSERS: <empty> ENABLERANU: false ENU: true ERRORREPORTING: false FEATURES: SQLENGINE, REPLICATION, FULLTEXT, DQ, AS, RS, BIDS, CONN, IS, BC, SDK, SSMS, ADV_SSMS, SNAC_SDK FILESTREAMLEVEL: 0 FILESTREAMSHARENAME: <empty> FTSVCACCOUNT: NT Service\MSSQLFDLauncher$SS2012 FTSVCPASSWORD: <empty> HELP: false INDICATEPROGRESS: false INSTALLSHAREDDIR: C:\Program Files\Microsoft SQL Server\ INSTALLSHAREDWOWDIR: C:\Program Files (x86)\Microsoft SQL Server\ INSTALLSQLDATADIR: <empty> INSTANCEDIR: C:\Program Files\Microsoft SQL Server\ INSTANCEID: SS2012 INSTANCENAME: SS2012 ISSVCACCOUNT: NT Service\MsDtsServer110 ISSVCPASSWORD: <empty> ISSVCSTARTUPTYPE: Automatic MATRIXCMBRICKCOMMPORT: 0 MATRIXCMSERVERNAME: <empty> MATRIXNAME: <empty> NPENABLED: 0 PID: ***** QUIET: false QUIETSIMPLE: false ROLE: <empty> RSINSTALLMODE: DefaultNativeMode RSSHPINSTALLMODE: DefaultSharePointMode RSSVCACCOUNT: NT Service\ReportServer$SS2012 RSSVCPASSWORD: <empty> RSSVCSTARTUPTYPE: Manual SAPWD: <empty> SECURITYMODE: <empty> SQLBACKUPDIR: <empty> SQLCOLLATION: SQL_Latin1_General_CP1_CI_AS SQLSVCACCOUNT: NT Service\MSSQL$SS2012 SQLSVCPASSWORD: <empty> SQLSVCSTARTUPTYPE: Automatic SQLSYSADMINACCOUNTS: Haansi-PC\Haansi SQLTEMPDBDIR: <empty> SQLTEMPDBLOGDIR: <empty> SQLUSERDBDIR: <empty> SQLUSERDBLOGDIR: <empty> SQMREPORTING: false TCPENABLED: 0 UIMODE: Normal UpdateEnabled: true UpdateSource: MU X86: false Configuration file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20120731_161013\ConfigurationFile.ini Detailed results: Feature: Management Tools - Complete Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Client Tools Connectivity Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Client Tools SDK Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Client Tools Backwards Compatibility Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Management Tools - Basic Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: SQL Server Data Tools Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Reporting Services - Native Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Database Engine Services Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Data Quality Services Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Full-Text and Semantic Extractions for Search Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: SQL Server Replication Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Integration Services Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Analysis Services Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: SQL Client Connectivity SDK Status: Failed: see logs for details Reason for failure: An error occurred during the setup process of the feature. Next Step: Use the following information to resolve the error, and then try the setup process again. Rules with failures: Global rules: Scenario specific rules: Rules report file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20120731_161013\SystemConfigurationCheck_Report.htm
sql-server
sql-server-2012
null
null
null
08/01/2012 13:53:02
off topic
SQL Server 2012 installation failure An error occurred for a dependency of the feature causing the setup process for the feature to fail === I am installing SQL Server 2012 Developer (from ISO image written on DVD), my machine has Windows 7 and it already has SQL Express and SQL 2008 R2 Express installed in it. On running 2012 setup it goes fine from Setup Support Rules to Installation Progress. In Installation Progress after some progress installation fails. **Windows show the following components couldn't installed:** Managment Tools Complete Failed. Client Tools Connectivity Failed. Client Tools SDK Failed. Client Tools Backwards Compantibility Failed. Managment Tools Basic Failed. SQL Server Data Tools Failed. Reporting Services -Native Failed. Database Engine Services Failed. Data Quality Services Failed. full-Text and Semantic Extractins for Search Failed. SQL Server Replication Failed. Integration Services Failed. Analysis Services Failed. SQL Client Connectivity SDK Failed. In detail for failure of every component it provide these details: **Action required:** Use the following information to resolve the error, and then try the setup process again. **Feature failure reason:** An error occurred for a dependency of the feature causing the setup process for the feature to fail. In summary log file it provide the following details: Overall summary: Final result: Failed: see details below Exit code (Decimal): -2068643839 Start time: 2012-07-31 16:23:37 End time: 2012-07-31 16:33:32 Requested action: Install Setup completed with required actions for features. Troubleshooting information for those features: Next step for Adv_SSMS: Use the following information to resolve the error, and then try the setup process again. Next step for Conn: Use the following information to resolve the error, and then try the setup process again. Next step for SDK: Use the following information to resolve the error, and then try the setup process again. Next step for BC: Use the following information to resolve the error, and then try the setup process again. Next step for SSMS: Use the following information to resolve the error, and then try the setup process again. Next step for BIDS: Use the following information to resolve the error, and then try the setup process again. Next step for RS: Use the following information to resolve the error, and then try the setup process again. Next step for SQLEngine: Use the following information to resolve the error, and then try the setup process again. Next step for DQ: Use the following information to resolve the error, and then try the setup process again. Next step for FullText: Use the following information to resolve the error, and then try the setup process again. Next step for Replication: Use the following information to resolve the error, and then try the setup process again. Next step for IS: Use the following information to resolve the error, and then try the setup process again. Next step for AS: Use the following information to resolve the error, and then try the setup process again. Next step for SNAC_SDK: Use the following information to resolve the error, and then try the setup process again. Machine Properties: Machine name: Haansi-PC Machine processor count: 4 OS version: Windows 7 OS service pack: Service Pack 1 OS region: United States OS language: English (United States) OS architecture: x64 Process architecture: 64 Bit OS clustered: No Product features discovered: Product Instance Instance ID Feature Language Edition Version Clustered SQL Server 2005 SQLEXPRESS MSSQL.1 Database Engine Services 1033 Express Edition 9.4.5000 No SQL Server 2005 SQLEXPRESS MSSQL.1 SQL Server Replication 1033 Express Edition 9.4.5000 No SQL Server 2005 SQLEXPRESS MSSQL.1 SharedTools 1033 Express Edition 9.4.5000 No SQL Server 2005 Tools 1033 Express Edition 9.4.5000 No SQL Server 2005 ToolsClient 1033 Express Edition 9.4.5000 No SQL Server 2005 ToolsClient\Connectivity 1033 Express Edition 9.4.5000 No SQL Server 2008 R2 SQLSERVER08EXPR2 MSSQL10_50.SQLSERVER08EXPR2 Database Engine Services 1033 Express Edition 10.50.1617.0 No SQL Server 2008 R2 SQLSERVER08EXPR2 MSSQL10_50.SQLSERVER08EXPR2 SQL Server Replication 1033 Express Edition 10.50.1617.0 No SQL Server 2008 R2 Management Tools - Basic 1033 Express Edition 10.50.1617.0 No SQL Server 2012 LocalDB 1033 Express Edition 11.0.2318.0 No SQL Server 2012 Reporting Services - SharePoint 11.0.2100.60 No Package properties: Description: Microsoft SQL Server 2012 ProductName: SQL Server 2012 Type: RTM Version: 11 SPLevel: 0 Installation location: F:\x64\setup\ Installation edition: Developer Product Update Status: None discovered. User Input Settings: ACTION: Install ADDCURRENTUSERASSQLADMIN: false AGTSVCACCOUNT: NT Service\SQLAgent$SS2012 AGTSVCPASSWORD: ***** AGTSVCSTARTUPTYPE: Manual ASBACKUPDIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Backup ASCOLLATION: Latin1_General_CI_AS ASCONFIGDIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Config ASDATADIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Data ASLOGDIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Log ASPROVIDERMSOLAP: 1 ASSERVERMODE: TABULAR ASSVCACCOUNT: NT Service\MSOLAP$SS2012 ASSVCPASSWORD: <empty> ASSVCSTARTUPTYPE: Manual ASSYSADMINACCOUNTS: PC\Haansi ASTEMPDIR: C:\Program Files\Microsoft SQL Server\MSAS11.SS2012\OLAP\Temp BROWSERSVCSTARTUPTYPE: Automatic CLTCTLRNAME: <empty> CLTRESULTDIR: <empty> CLTSTARTUPTYPE: 0 CLTSVCACCOUNT: <empty> CLTSVCPASSWORD: <empty> CLTWORKINGDIR: <empty> COMMFABRICENCRYPTION: 0 COMMFABRICNETWORKLEVEL: 0 COMMFABRICPORT: 0 CONFIGURATIONFILE: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20120731_161013\ConfigurationFile.ini CTLRSTARTUPTYPE: 0 CTLRSVCACCOUNT: <empty> CTLRSVCPASSWORD: <empty> CTLRUSERS: <empty> ENABLERANU: false ENU: true ERRORREPORTING: false FEATURES: SQLENGINE, REPLICATION, FULLTEXT, DQ, AS, RS, BIDS, CONN, IS, BC, SDK, SSMS, ADV_SSMS, SNAC_SDK FILESTREAMLEVEL: 0 FILESTREAMSHARENAME: <empty> FTSVCACCOUNT: NT Service\MSSQLFDLauncher$SS2012 FTSVCPASSWORD: <empty> HELP: false INDICATEPROGRESS: false INSTALLSHAREDDIR: C:\Program Files\Microsoft SQL Server\ INSTALLSHAREDWOWDIR: C:\Program Files (x86)\Microsoft SQL Server\ INSTALLSQLDATADIR: <empty> INSTANCEDIR: C:\Program Files\Microsoft SQL Server\ INSTANCEID: SS2012 INSTANCENAME: SS2012 ISSVCACCOUNT: NT Service\MsDtsServer110 ISSVCPASSWORD: <empty> ISSVCSTARTUPTYPE: Automatic MATRIXCMBRICKCOMMPORT: 0 MATRIXCMSERVERNAME: <empty> MATRIXNAME: <empty> NPENABLED: 0 PID: ***** QUIET: false QUIETSIMPLE: false ROLE: <empty> RSINSTALLMODE: DefaultNativeMode RSSHPINSTALLMODE: DefaultSharePointMode RSSVCACCOUNT: NT Service\ReportServer$SS2012 RSSVCPASSWORD: <empty> RSSVCSTARTUPTYPE: Manual SAPWD: <empty> SECURITYMODE: <empty> SQLBACKUPDIR: <empty> SQLCOLLATION: SQL_Latin1_General_CP1_CI_AS SQLSVCACCOUNT: NT Service\MSSQL$SS2012 SQLSVCPASSWORD: <empty> SQLSVCSTARTUPTYPE: Automatic SQLSYSADMINACCOUNTS: Haansi-PC\Haansi SQLTEMPDBDIR: <empty> SQLTEMPDBLOGDIR: <empty> SQLUSERDBDIR: <empty> SQLUSERDBLOGDIR: <empty> SQMREPORTING: false TCPENABLED: 0 UIMODE: Normal UpdateEnabled: true UpdateSource: MU X86: false Configuration file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20120731_161013\ConfigurationFile.ini Detailed results: Feature: Management Tools - Complete Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Client Tools Connectivity Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Client Tools SDK Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Client Tools Backwards Compatibility Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Management Tools - Basic Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: SQL Server Data Tools Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Reporting Services - Native Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Database Engine Services Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Data Quality Services Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Full-Text and Semantic Extractions for Search Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: SQL Server Replication Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Integration Services Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: Analysis Services Status: Failed: see logs for details Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail. Next Step: Use the following information to resolve the error, and then try the setup process again. Feature: SQL Client Connectivity SDK Status: Failed: see logs for details Reason for failure: An error occurred during the setup process of the feature. Next Step: Use the following information to resolve the error, and then try the setup process again. Rules with failures: Global rules: Scenario specific rules: Rules report file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20120731_161013\SystemConfigurationCheck_Report.htm
2
11,734,694
07/31/2012 06:53:53
1,203,540
02/11/2012 08:52:46
8
0
.htaccess modRewrite - find out the underlying url that is trying to be resolved?
I am having trouble with an htaccess file that works on my local testing setup but not when uploaded to my production server, even though I have other sites on that server which have working .htaccess setups. Is there any way (perhaps with a custom 404 page) that I can find out the url that .htaccess has re-written to, so that I can debug the problem?
apache
.htaccess
redirect
hosting
null
null
open
.htaccess modRewrite - find out the underlying url that is trying to be resolved? === I am having trouble with an htaccess file that works on my local testing setup but not when uploaded to my production server, even though I have other sites on that server which have working .htaccess setups. Is there any way (perhaps with a custom 404 page) that I can find out the url that .htaccess has re-written to, so that I can debug the problem?
0
11,348,780
07/05/2012 16:38:51
1,504,636
07/05/2012 16:30:51
1
0
Unable To Run Access Report With Column Name Which Has Special Character
I'm trying to run a report in Access that references a poorly named column: Vendor#. For those of you not familiar with Access: '#' is a reserved keyword with special meaning. I've been trying to run the report and every time I do a popup appears asking for a value for the column: in other words it keeps seeing it as a variable name. I've tried a number of variations on the name including: [Vendor#], 'Vendor#', ['Vendor#']. I tried an Alias but then I encountered the same issue in the where clause referencing the Alias. No I can't change the schema to rename the column to something more appropriate. Any help is appreciated.
sql
sql-server
ms-access-2007
office
null
null
open
Unable To Run Access Report With Column Name Which Has Special Character === I'm trying to run a report in Access that references a poorly named column: Vendor#. For those of you not familiar with Access: '#' is a reserved keyword with special meaning. I've been trying to run the report and every time I do a popup appears asking for a value for the column: in other words it keeps seeing it as a variable name. I've tried a number of variations on the name including: [Vendor#], 'Vendor#', ['Vendor#']. I tried an Alias but then I encountered the same issue in the where clause referencing the Alias. No I can't change the schema to rename the column to something more appropriate. Any help is appreciated.
0
11,350,976
07/05/2012 19:11:30
915,911
08/27/2011 21:53:41
38
2
iOS5 UINavigationBar background image issues when prompt is shown
I am using the new appearance proxy in iOS 5 to style my UINavigationBar with a background image. [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationBG.png"] forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationLandscapeBG.png"] forBarMetrics:UIBarMetricsLandscapePhone]; This works fine, but I need to set the prompt property of the nav bar. When I do that, the height of the nav bar increases, and my background image no longer fills that nav bar vertically, so it looks very bad. How can I account for the height change with a prompt when using a custom background image?
iphone
ios
uinavigationcontroller
uinavigationbar
uiappearance
null
open
iOS5 UINavigationBar background image issues when prompt is shown === I am using the new appearance proxy in iOS 5 to style my UINavigationBar with a background image. [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationBG.png"] forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationLandscapeBG.png"] forBarMetrics:UIBarMetricsLandscapePhone]; This works fine, but I need to set the prompt property of the nav bar. When I do that, the height of the nav bar increases, and my background image no longer fills that nav bar vertically, so it looks very bad. How can I account for the height change with a prompt when using a custom background image?
0
11,350,978
07/05/2012 19:11:40
1,504,764
07/05/2012 17:30:24
1
0
iOS Memory issue (ARC) when downloading and saving large ammount of images from server
The following code downloads 700+ images from a server with varying sizes, the issue here is that memory (even with ARC) is never released and eventually a memory warning appears followed by the application exiting. I've tried @autoreleasepool in this method and that didn't seem to work. Also I've tried stopping the for loop at different locations to see if memory is released after it finished, but it isn't. This method is called inside a for loop and receives the image url and short name. It has been tried in a background thread and main thread with the same results (memory wise). -(void)saveImage:(NSString*)image name:(NSString*)imageName{ //removing unneccesary text int k = 0; for (int j = 0; j < [imageName length]; j++) { if ([imageName characterAtIndex:j] == '/') { k = j; } } if (k != 0) { imageName = [imageName substringFromIndex:k+1]; } //fullPath to save NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@", imageName]]; //delete image if already exists if ([fileManager fileExistsAtPath:fullPath]) { [fileManager removeItemAtPath:fullPath error:nil]; } //save image NSURL *url = [NSURL URLWithString:image]; NSData *data = [NSData dataWithContentsOfURL:url]; NSLog(@"Saved: %d:%@", [fileManager createFileAtPath:fullPath contents:data attributes:nil], url); }
ios
image
memory
download
nsfilemanager
null
open
iOS Memory issue (ARC) when downloading and saving large ammount of images from server === The following code downloads 700+ images from a server with varying sizes, the issue here is that memory (even with ARC) is never released and eventually a memory warning appears followed by the application exiting. I've tried @autoreleasepool in this method and that didn't seem to work. Also I've tried stopping the for loop at different locations to see if memory is released after it finished, but it isn't. This method is called inside a for loop and receives the image url and short name. It has been tried in a background thread and main thread with the same results (memory wise). -(void)saveImage:(NSString*)image name:(NSString*)imageName{ //removing unneccesary text int k = 0; for (int j = 0; j < [imageName length]; j++) { if ([imageName characterAtIndex:j] == '/') { k = j; } } if (k != 0) { imageName = [imageName substringFromIndex:k+1]; } //fullPath to save NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@", imageName]]; //delete image if already exists if ([fileManager fileExistsAtPath:fullPath]) { [fileManager removeItemAtPath:fullPath error:nil]; } //save image NSURL *url = [NSURL URLWithString:image]; NSData *data = [NSData dataWithContentsOfURL:url]; NSLog(@"Saved: %d:%@", [fileManager createFileAtPath:fullPath contents:data attributes:nil], url); }
0
11,343,154
07/05/2012 11:13:30
1,411,607
05/23/2012 03:24:50
87
2
jQuery Star Rating Modification
Hi i am a new programmer, i am building a 5 star rating system using jQuery, AJAX, PHP and MySQL. I am using image background positioning to position stars on hover and on assigning rating value form database. I am able to make it work but its not the way i want it to be. I first positioned stars for hover state using jQuery, then i am sending click value to PHP file "rating.php" for processing using Ajax, then i am using JSON to retrive the rating value from another PHP file "get-rating.php" to assign new rating to stars. i am able to make it work but my problem is i have to use two PHP files that makes it difficult for me to assign rating for products according to their id. and i have to refresh page to see assigned rating value. I tried using all PHP in one file it doesn't work and stars stoped showing assigned rating. Can anybody suggest me how i can send all AJAX request at once so that i don't have to use two PHP files and it will work without refreshing Page. Thanks. HTML Codes: <div class="star-rating" id="1"> <div class="star"></div> <div class="star"></div> <div class="star"></div> <div class="star"></div> <div class="star"></div> </div> jQuery Codes: $(function(){ $('.star').mouseout(function (){ $(this).parent().css("backgroundPosition","0px 0px"); $('.star').mouseover(function (){ var star = $(this).index()+1; var x =(32 * star).toFixed(1); $(this).parent().css("backgroundPosition","0% " +(-x)+ "px"); }); }); $.ajax({ url: 'get-rating.php', data: "", dataType: 'json', cache: false, success: function(data) { var hit = data[1]; var rating = data[2]; var x =(32 * rating).toFixed(1); $('.star-rating').css("backgroundPosition","0% " +(-(x))+ "px"); } }); $('.star').click(function (){ var id = $(this).parent().attr('id'); var rating = $(this).index()+1; $.ajax({ type: "POST", url:"rating.php", data: {rating: rating, id: id}, cache: false }); }); }); PHP file "rating.php": <?php require_once('_ls-global/php/ss-connect.php'); $db = mysql_select_db($database,$connection) or trigger_error("SQL", E_USER_ERROR); if (isset($_POST['rating'])&& is_numeric($_POST['rating'])) { $post_rating = (int) mysql_real_escape_string($_POST['rating']); }else{ $post_rating='0'; } if (isset($_POST['id'])&& is_numeric($_POST['id'])) { $post_id = (int) mysql_real_escape_string($_POST['id']); }else{ $post_id='0'; } $find_data = mysql_query("SELECT * FROM rating WHERE id='$post_id'"); $row = mysql_fetch_assoc($find_data); $current_hit = $row['hit']; $current_rating = $row['rating']; $current_rating_total = $row['rating_total']; $round_rating= (ceil($post_rating)+floor($post_rating))/2; $new_hits = $current_hit+1; $new_rating_total = $current_rating_total + $round_rating; $new_rating = $new_rating_total / $new_hits; $new_round_rating = (ceil($new_rating)+floor($new_rating))/2; $update_hits = mysql_query("UPDATE rating SET hit='$new_hits' WHERE id='$post_id'"); $update_rating = mysql_query("UPDATE rating SET rating='$new_round_rating' WHERE id='$post_id'"); $update_rating_total = mysql_query("UPDATE rating SET rating_total='$new_rating_total' WHERE id='$post_id'"); ?> PHP file "get-rating.php" require_once('_ls-global/php/ss-connect.php'); $db = mysql_select_db($database,$connection) or trigger_error("SQL", E_USER_ERROR); $find_data = mysql_query("SELECT * FROM rating"); $row=mysql_fetch_row($find_data); header('Content-type: application/json'); echo json_encode($row);
php
jquery
mysql
html
ajax
null
open
jQuery Star Rating Modification === Hi i am a new programmer, i am building a 5 star rating system using jQuery, AJAX, PHP and MySQL. I am using image background positioning to position stars on hover and on assigning rating value form database. I am able to make it work but its not the way i want it to be. I first positioned stars for hover state using jQuery, then i am sending click value to PHP file "rating.php" for processing using Ajax, then i am using JSON to retrive the rating value from another PHP file "get-rating.php" to assign new rating to stars. i am able to make it work but my problem is i have to use two PHP files that makes it difficult for me to assign rating for products according to their id. and i have to refresh page to see assigned rating value. I tried using all PHP in one file it doesn't work and stars stoped showing assigned rating. Can anybody suggest me how i can send all AJAX request at once so that i don't have to use two PHP files and it will work without refreshing Page. Thanks. HTML Codes: <div class="star-rating" id="1"> <div class="star"></div> <div class="star"></div> <div class="star"></div> <div class="star"></div> <div class="star"></div> </div> jQuery Codes: $(function(){ $('.star').mouseout(function (){ $(this).parent().css("backgroundPosition","0px 0px"); $('.star').mouseover(function (){ var star = $(this).index()+1; var x =(32 * star).toFixed(1); $(this).parent().css("backgroundPosition","0% " +(-x)+ "px"); }); }); $.ajax({ url: 'get-rating.php', data: "", dataType: 'json', cache: false, success: function(data) { var hit = data[1]; var rating = data[2]; var x =(32 * rating).toFixed(1); $('.star-rating').css("backgroundPosition","0% " +(-(x))+ "px"); } }); $('.star').click(function (){ var id = $(this).parent().attr('id'); var rating = $(this).index()+1; $.ajax({ type: "POST", url:"rating.php", data: {rating: rating, id: id}, cache: false }); }); }); PHP file "rating.php": <?php require_once('_ls-global/php/ss-connect.php'); $db = mysql_select_db($database,$connection) or trigger_error("SQL", E_USER_ERROR); if (isset($_POST['rating'])&& is_numeric($_POST['rating'])) { $post_rating = (int) mysql_real_escape_string($_POST['rating']); }else{ $post_rating='0'; } if (isset($_POST['id'])&& is_numeric($_POST['id'])) { $post_id = (int) mysql_real_escape_string($_POST['id']); }else{ $post_id='0'; } $find_data = mysql_query("SELECT * FROM rating WHERE id='$post_id'"); $row = mysql_fetch_assoc($find_data); $current_hit = $row['hit']; $current_rating = $row['rating']; $current_rating_total = $row['rating_total']; $round_rating= (ceil($post_rating)+floor($post_rating))/2; $new_hits = $current_hit+1; $new_rating_total = $current_rating_total + $round_rating; $new_rating = $new_rating_total / $new_hits; $new_round_rating = (ceil($new_rating)+floor($new_rating))/2; $update_hits = mysql_query("UPDATE rating SET hit='$new_hits' WHERE id='$post_id'"); $update_rating = mysql_query("UPDATE rating SET rating='$new_round_rating' WHERE id='$post_id'"); $update_rating_total = mysql_query("UPDATE rating SET rating_total='$new_rating_total' WHERE id='$post_id'"); ?> PHP file "get-rating.php" require_once('_ls-global/php/ss-connect.php'); $db = mysql_select_db($database,$connection) or trigger_error("SQL", E_USER_ERROR); $find_data = mysql_query("SELECT * FROM rating"); $row=mysql_fetch_row($find_data); header('Content-type: application/json'); echo json_encode($row);
0
11,350,967
07/05/2012 19:10:49
1,504,906
07/05/2012 18:39:45
1
1
How to convert from JSObject to Map (viceversa) or list JSObject members
In **Javascript** i have the following code: var r=applet.foo({var0:99,var1:'foo',var2:applet}); In my **Java** applet i have the following: public JSObject foo(JSObject args){ System.out.println("The function is correctly invoked"); //In fact, the following works perfectly: System.out.println("var1 is:"+(String)args.getMember("var1")); JSObject w=JSObject.getWindow(this); JSObject j=(JSObject)w.eval("new Object();"); Map m=new Hashmap(); //TODO here all the keys and values of args should be added to m m.put("hello","world"); //TODO here all the keys and values of m should be added to j return j; } How can this be done? (**TODOs**) --- Reading http://docstore.mik.ua/orelly/web/jscript/ch19_06.html, i noticed theres a getSlot method for JSObject but if i do args.getSlot(0) all i have is one Exception: netscape.javascript.JSException: No such slot 0 on JavaScript object ...
java
javascript
json
applet
jsobject
null
open
How to convert from JSObject to Map (viceversa) or list JSObject members === In **Javascript** i have the following code: var r=applet.foo({var0:99,var1:'foo',var2:applet}); In my **Java** applet i have the following: public JSObject foo(JSObject args){ System.out.println("The function is correctly invoked"); //In fact, the following works perfectly: System.out.println("var1 is:"+(String)args.getMember("var1")); JSObject w=JSObject.getWindow(this); JSObject j=(JSObject)w.eval("new Object();"); Map m=new Hashmap(); //TODO here all the keys and values of args should be added to m m.put("hello","world"); //TODO here all the keys and values of m should be added to j return j; } How can this be done? (**TODOs**) --- Reading http://docstore.mik.ua/orelly/web/jscript/ch19_06.html, i noticed theres a getSlot method for JSObject but if i do args.getSlot(0) all i have is one Exception: netscape.javascript.JSException: No such slot 0 on JavaScript object ...
0
11,350,989
07/05/2012 19:12:47
879,119
08/04/2011 17:11:40
382
19
Securing access to PHP API
I have an iPhone app that is using my a php api on the server but it is currently open if someone knows the url. I want to make sure that no one can use this API until I am ready to make it a public api (if I even do) I have read [this article][1] but I am unsure what they mean when they say: > [CLIENT] Before making the REST API call, combine a bunch of unique data together (this is typically all the parameters and values you intend on sending, it is the “data” argument in the code snippets on AWS’s site) I don't understand how if I hash the parameters I plan on sending how my server will properly interpret them since I don't know what the parameter values will be until I have sent them. And then ,if I send the parameters/values unencrypted after how is this anymore secure then just hashing the api secret? [1]: http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/
php
api
rest
hash
null
null
open
Securing access to PHP API === I have an iPhone app that is using my a php api on the server but it is currently open if someone knows the url. I want to make sure that no one can use this API until I am ready to make it a public api (if I even do) I have read [this article][1] but I am unsure what they mean when they say: > [CLIENT] Before making the REST API call, combine a bunch of unique data together (this is typically all the parameters and values you intend on sending, it is the “data” argument in the code snippets on AWS’s site) I don't understand how if I hash the parameters I plan on sending how my server will properly interpret them since I don't know what the parameter values will be until I have sent them. And then ,if I send the parameters/values unencrypted after how is this anymore secure then just hashing the api secret? [1]: http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/
0
11,350,990
07/05/2012 19:12:55
1,460,904
06/16/2012 17:01:01
1
0
how to show nivo-slider pagination in reverse/right to left order for arabic site?
I am using nivo-slider on a arabic site. Now problem is the pagination need to look like 8765 instead of 1,2,3,4 how I can http://nivo.dev7studios.com/demos/'s pagination got it worked for me.
javascript
css
nivoslider
null
null
null
open
how to show nivo-slider pagination in reverse/right to left order for arabic site? === I am using nivo-slider on a arabic site. Now problem is the pagination need to look like 8765 instead of 1,2,3,4 how I can http://nivo.dev7studios.com/demos/'s pagination got it worked for me.
0
11,350,991
07/05/2012 19:12:56
1,504,965
07/05/2012 19:06:54
1
1
Android Bluetooth Tethering
I am trying to Tether (Share Android phone internet connection to other device) through Bluetooth connection. And I need this to work on an unrooted phone. I am not looking for any App. I am looking for implementation (Source code, Script etc..) Also can we do this using PPP ? (Point to Point protocol) Has anyone tried this before and any luck ? I am planning to write an app for this. Any help will be appreciated. Thanks Sayooj Valsan
android
bluetooth
null
null
null
null
open
Android Bluetooth Tethering === I am trying to Tether (Share Android phone internet connection to other device) through Bluetooth connection. And I need this to work on an unrooted phone. I am not looking for any App. I am looking for implementation (Source code, Script etc..) Also can we do this using PPP ? (Point to Point protocol) Has anyone tried this before and any luck ? I am planning to write an app for this. Any help will be appreciated. Thanks Sayooj Valsan
0
11,350,230
07/05/2012 18:20:55
1,351,615
04/23/2012 14:50:06
253
24
T-Sql get average of Time(7)
ProcessTime: 00:00:00.0000012 - RegexResolveTime: 00:00:00.0000421 - MessageResolveTime: 00:00:00.0001269 - FullProcessTime: 00:00:00.0001734 Ok, I've got 4 columns as above with datatype Time(7). I need to get the average of all the entries for those individual columns but obviously Time(7) isn't a valid type for the AVG operator! So; how does one go about getting the average of a Time(7) column?
sql
sql-server
tsql
avg
null
null
open
T-Sql get average of Time(7) === ProcessTime: 00:00:00.0000012 - RegexResolveTime: 00:00:00.0000421 - MessageResolveTime: 00:00:00.0001269 - FullProcessTime: 00:00:00.0001734 Ok, I've got 4 columns as above with datatype Time(7). I need to get the average of all the entries for those individual columns but obviously Time(7) isn't a valid type for the AVG operator! So; how does one go about getting the average of a Time(7) column?
0
11,350,231
07/05/2012 18:20:59
490,127
10/28/2010 13:13:06
861
20
How should Stochastic Universal Sampling be combined with Elitism in Genetic Programming?
Having implemented Ranked Selection ("RS") and Stochastic Universal Sampling ("SUS") [*Baker, 1987*] I'd now like to introduce Elitism (reintroduction of the fittest last-generation members into next-generation) to observe its purported benefits. There are references to SUS and Elitism being combined, such as by Melanie Mitchell in *An Introduction to Genetic Algorithms*. However I've come across a (very vague) online reference suggesting combination of the two methods is to be avoided. I wonder whether, in the latter case, an incorrect implementation is the cause of the two methods' incompatibility. I would therefore be grateful if someone more experienced with GP can provide a description of how SUS and Elitism should be combined. From my knowledge of the two mechanisms, the logical implementation would be to select K fittest individuals from a population size N, then perform SUS over the entire ranked population (including the K elite) but only make N-K selections (instead of the N selections which would take place without elitism). Is someone able to confirm this proposed implementation is mathematically sound, and the recommended approach?
selection
genetic-algorithm
rank
genetic-programming
stochastic
null
open
How should Stochastic Universal Sampling be combined with Elitism in Genetic Programming? === Having implemented Ranked Selection ("RS") and Stochastic Universal Sampling ("SUS") [*Baker, 1987*] I'd now like to introduce Elitism (reintroduction of the fittest last-generation members into next-generation) to observe its purported benefits. There are references to SUS and Elitism being combined, such as by Melanie Mitchell in *An Introduction to Genetic Algorithms*. However I've come across a (very vague) online reference suggesting combination of the two methods is to be avoided. I wonder whether, in the latter case, an incorrect implementation is the cause of the two methods' incompatibility. I would therefore be grateful if someone more experienced with GP can provide a description of how SUS and Elitism should be combined. From my knowledge of the two mechanisms, the logical implementation would be to select K fittest individuals from a population size N, then perform SUS over the entire ranked population (including the K elite) but only make N-K selections (instead of the N selections which would take place without elitism). Is someone able to confirm this proposed implementation is mathematically sound, and the recommended approach?
0
11,660,591
07/26/2012 00:16:25
1,105,107
12/19/2011 01:26:27
83
6
Multiple file upload field in custom module using drupal 7 Form API
I'm searching for a way to add a field in a custom form that will allow me to upload a list of files like this one : ![Like this one][1] which is a screenshot of a File field of the file module. I tried this : http://ygerasimov.com/d7-zip-archive-custom-file-multiple-upload which uses ajax and custom code. My files are saved in DB but not displayed when I reload the page... I tried to make it work but with no luck. I really hope that someone will be able to help me. Thanks in advance, Hervé [1]: http://i.stack.imgur.com/iII5q.png
drupal-7
null
null
null
null
null
open
Multiple file upload field in custom module using drupal 7 Form API === I'm searching for a way to add a field in a custom form that will allow me to upload a list of files like this one : ![Like this one][1] which is a screenshot of a File field of the file module. I tried this : http://ygerasimov.com/d7-zip-archive-custom-file-multiple-upload which uses ajax and custom code. My files are saved in DB but not displayed when I reload the page... I tried to make it work but with no luck. I really hope that someone will be able to help me. Thanks in advance, Hervé [1]: http://i.stack.imgur.com/iII5q.png
0
11,660,698
07/26/2012 00:28:16
1,553,145
07/26/2012 00:16:14
1
0
Trouble connecting .slice Javascript function to my HTML
I've written a script that slices a mass of text into 1000 character blocks and groups them in an object. Now what I'm trying to do is take all the text that is put in the textarea #PATypes, slice it up into 1000 character blocks, then put each individual block into a cell in a table. Unfortunately, I'm running into trouble- does anyone have an idea what I am doing wrong? I've written the relevant snippets down below; if you'd like to see the whole thing, check here: http://jsfiddle.net/ayoformayo/yTcRb/1/ HTML <label for="PATypes">Mass Text PA</label> <textarea rows="2" cols="20" id="PATypes"></textarea> <button onclick = "cutUp()">Submit PA</button> <table> <tr> <td id="PAType=Name=Value1"></td> <td id="PAType=Name=Value2"></td> <td id="PAType=Name=Value3"></td> <td id="PAType=Name=Value4"></td> <td id="PAType=Name=Value5"></td> <td id="PAType=Name=Value6"></td> </tr> </table Javascript function cutUp(){ var chunks = []; var my_long_string = document.getElementById('PATypes').value; var i = 0; var n = 0; while(n < my_long_string.length) { n = 1000 * i; chunks.push(my_long_string.slice(n, n + 1000)); i++; } document.getElementById('PAType=Name=Value4').innerHTML = chunks[0]; document.getElementById('PAType=Name=Value5').innerHTML = chunks[1]; document.getElementById('PAType=Name=Value6').innerHTML = chunks[2]; }​
javascript
html
table
slice
null
null
open
Trouble connecting .slice Javascript function to my HTML === I've written a script that slices a mass of text into 1000 character blocks and groups them in an object. Now what I'm trying to do is take all the text that is put in the textarea #PATypes, slice it up into 1000 character blocks, then put each individual block into a cell in a table. Unfortunately, I'm running into trouble- does anyone have an idea what I am doing wrong? I've written the relevant snippets down below; if you'd like to see the whole thing, check here: http://jsfiddle.net/ayoformayo/yTcRb/1/ HTML <label for="PATypes">Mass Text PA</label> <textarea rows="2" cols="20" id="PATypes"></textarea> <button onclick = "cutUp()">Submit PA</button> <table> <tr> <td id="PAType=Name=Value1"></td> <td id="PAType=Name=Value2"></td> <td id="PAType=Name=Value3"></td> <td id="PAType=Name=Value4"></td> <td id="PAType=Name=Value5"></td> <td id="PAType=Name=Value6"></td> </tr> </table Javascript function cutUp(){ var chunks = []; var my_long_string = document.getElementById('PATypes').value; var i = 0; var n = 0; while(n < my_long_string.length) { n = 1000 * i; chunks.push(my_long_string.slice(n, n + 1000)); i++; } document.getElementById('PAType=Name=Value4').innerHTML = chunks[0]; document.getElementById('PAType=Name=Value5').innerHTML = chunks[1]; document.getElementById('PAType=Name=Value6').innerHTML = chunks[2]; }​
0
11,660,699
07/26/2012 00:28:21
1,553,150
07/26/2012 00:22:33
1
0
Using Apache HTTPClient to submit tricky form data
Here's my code: HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.webcitation.org/comb.php"); try { // Add your data List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair(??, ??)); nameValuePairs.add(new BasicNameValuePair("fromform", "2")); nameValuePairs.add(new BasicNameValuePair("email", "[email protected]")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); // Execute HTTP Post Request HttpResponse response = httpclient.execute(httppost); BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String line = ""; while((line = rd.readLine()) != null) { System.out.println(line); } } catch (Exception e) { System.out.println(e); } And here's the HTML code of the form I'm trying to mimic: http://www.webcitation.org/69Qsz3Tdn I'm trying to submit the URLs `http://video.google.com/?hl=en&tab=wv`, `http://maps.google.com/maps?hl=en&tab=wl`, etc. to the PHP file through Java and read the response. Since there are no `name`s for the `href`s, I'm stumped. Also the checkboxes have no `value`s, so I can't check whether they are checked or not. Thanks for any assistance!!
java
apache
null
null
null
null
open
Using Apache HTTPClient to submit tricky form data === Here's my code: HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.webcitation.org/comb.php"); try { // Add your data List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair(??, ??)); nameValuePairs.add(new BasicNameValuePair("fromform", "2")); nameValuePairs.add(new BasicNameValuePair("email", "[email protected]")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); // Execute HTTP Post Request HttpResponse response = httpclient.execute(httppost); BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String line = ""; while((line = rd.readLine()) != null) { System.out.println(line); } } catch (Exception e) { System.out.println(e); } And here's the HTML code of the form I'm trying to mimic: http://www.webcitation.org/69Qsz3Tdn I'm trying to submit the URLs `http://video.google.com/?hl=en&tab=wv`, `http://maps.google.com/maps?hl=en&tab=wl`, etc. to the PHP file through Java and read the response. Since there are no `name`s for the `href`s, I'm stumped. Also the checkboxes have no `value`s, so I can't check whether they are checked or not. Thanks for any assistance!!
0
11,660,700
07/26/2012 00:28:33
962,856
09/24/2011 17:37:01
46
2
Offline maps with QtMobility location on meego/N9?
I would like to use ovi maps in offline mode in one application for meego-harmattan. According to the qml Map element documentation, there is a Map.OfflineMode option for the connectivityMode, but this option doesnt work in practice. Searching around i found some people claiming that offline ovi maps are possible on meego-harmattan, others (https://bugreports.qt-project.org/browse/QTMOBILITY-1116) saying that they should be, but the plugin that allows it is not easily available. Now, this last information is dated oct 2011. I wonder whether with 2 more updates of the framework (and firmware of the phone), it became possible to use offline maps? thanks in advance
qt
maps
meego
ovi
meego-harmattan
null
open
Offline maps with QtMobility location on meego/N9? === I would like to use ovi maps in offline mode in one application for meego-harmattan. According to the qml Map element documentation, there is a Map.OfflineMode option for the connectivityMode, but this option doesnt work in practice. Searching around i found some people claiming that offline ovi maps are possible on meego-harmattan, others (https://bugreports.qt-project.org/browse/QTMOBILITY-1116) saying that they should be, but the plugin that allows it is not easily available. Now, this last information is dated oct 2011. I wonder whether with 2 more updates of the framework (and firmware of the phone), it became possible to use offline maps? thanks in advance
0
11,660,701
07/26/2012 00:28:43
1,541,577
07/20/2012 18:49:18
1
0
How to write this if conditional in PHP?
My variables, `$current` and `$row['start']` are in the format of **2012-07-24 18:00:00** How should I write the following ? `if ($row['start'] - $current < 2 hours) echo 'starts soon'` Additionally is there a way to combine it with the below ? <?php echo ($current > $row['start']) ? 'Started' : 'Starts'; ?>
php
null
null
null
null
null
open
How to write this if conditional in PHP? === My variables, `$current` and `$row['start']` are in the format of **2012-07-24 18:00:00** How should I write the following ? `if ($row['start'] - $current < 2 hours) echo 'starts soon'` Additionally is there a way to combine it with the below ? <?php echo ($current > $row['start']) ? 'Started' : 'Starts'; ?>
0
11,660,702
07/26/2012 00:28:45
376,742
06/26/2010 00:20:39
349
8
Understanding front end instance hours on google app engine
My app already shows: **Front end instance hours:** Frontend Instance Hours 62% 62% 17.35 of 28.00 Instance Hours **app.yaml:** version: 1 runtime: python27 api_version: 1 threadsafe: true inbound_services: - xmpp_message - xmpp_presence - xmpp_subscribe - xmpp_error libraries: - name: django version: "1.2" Does using the xmpp service increase the front end instance hours? I need xmpp service to send notifications to gchat client. The app is serving less than 10 requests an hour. How do I optimize my front end instance hours on GAE? Any useful resources/tutorial?
google-app-engine
optimization
null
null
null
null
open
Understanding front end instance hours on google app engine === My app already shows: **Front end instance hours:** Frontend Instance Hours 62% 62% 17.35 of 28.00 Instance Hours **app.yaml:** version: 1 runtime: python27 api_version: 1 threadsafe: true inbound_services: - xmpp_message - xmpp_presence - xmpp_subscribe - xmpp_error libraries: - name: django version: "1.2" Does using the xmpp service increase the front end instance hours? I need xmpp service to send notifications to gchat client. The app is serving less than 10 requests an hour. How do I optimize my front end instance hours on GAE? Any useful resources/tutorial?
0
11,660,703
07/26/2012 00:28:48
509,755
11/16/2010 16:19:13
124
1
Reverse Ajax + Spring MVC
I have very unique requirement in my web apps. I have two web apps for eg. webapp1 and webapp2. In webapp1 we are gathering some info and pass it to webapp2. Webapp2 process this info and when complete, has to inform back to webapp1 that all data are processed either successfully or not. Now I know what if there is one web app then I can use dwr reverse ajax and it can send the update back to page. Can we use DWR in my scenario too? Also I dont want to broadcast message to all opened webapp1 instead to only webapp1(browser), who send data to webapp2. I hope I have clearly explained the scenario Thanks
ajax
spring
spring-mvc
reverse
null
null
open
Reverse Ajax + Spring MVC === I have very unique requirement in my web apps. I have two web apps for eg. webapp1 and webapp2. In webapp1 we are gathering some info and pass it to webapp2. Webapp2 process this info and when complete, has to inform back to webapp1 that all data are processed either successfully or not. Now I know what if there is one web app then I can use dwr reverse ajax and it can send the update back to page. Can we use DWR in my scenario too? Also I dont want to broadcast message to all opened webapp1 instead to only webapp1(browser), who send data to webapp2. I hope I have clearly explained the scenario Thanks
0
11,660,704
07/26/2012 00:28:49
1,036,369
11/08/2011 20:01:35
25
0
How to use jquery css a:hover
I'm using a colour selector to change some elements function(color) { $("#post h1").css("color",color.toHexString()); $("#footer").css("background",color.toHexString()); $("#navigation a:hover").css("background",color.toHexString()); } The "#post h1" and "#foooter" work fine but how can I change the "#navigation a:hover"? Thanks
jquery
css
null
null
null
null
open
How to use jquery css a:hover === I'm using a colour selector to change some elements function(color) { $("#post h1").css("color",color.toHexString()); $("#footer").css("background",color.toHexString()); $("#navigation a:hover").css("background",color.toHexString()); } The "#post h1" and "#foooter" work fine but how can I change the "#navigation a:hover"? Thanks
0
11,651,344
07/25/2012 13:53:27
1,063,730
11/24/2011 10:24:56
554
47
Facebooks's expirationDate is 0
I just realised that I don't get any more information about the expiration date of the access token. Precisely I'm talking about the facebook SDK for android where I call the `authorize()` method with a `DialogListener` callback as shown in the code below. I haven't looked at it for some weeks btu I know it was working before, now as I return to the project I find the call of `facebook.getAccessExpires()` returning 0 every time. My first thought was the API might be broken and some changes applied I didn't noticed. However using an iPhone project of about same age it seems to receive an expiration date. (From what I can see with my lack of objective-c skills ^^). Next I checked out commit `5a72863793521a96f5a9f4fb72960a27b98e441d` from [facebook's github][1] 'cause I started to implemented supporting FB around this time and thought this way I might see if the SDK changed in some dramatic way. So far all my efforts been in vain and I can't think of a good reason where to track down this bug. DialogListener dialogListener = new DialogListener(){ @Override public void onComplete(Bundle values) { mPrefsEdit.putString(USER_ACCESS_TOKEN, facebook.getAccessToken() ) .putLong(USER_ACCESS_EXPIR, facebook.getAccessExpires() ) .commit(); } //other required overrides } Facebook facebook = new Facebook(APP_ID); facebook.authorize(activity, APP_PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, dialogListener); [1]: https://github.com/facebook/facebook-android-sdk/commits/master
android
facebook-graph-api
expiration
null
null
null
open
Facebooks's expirationDate is 0 === I just realised that I don't get any more information about the expiration date of the access token. Precisely I'm talking about the facebook SDK for android where I call the `authorize()` method with a `DialogListener` callback as shown in the code below. I haven't looked at it for some weeks btu I know it was working before, now as I return to the project I find the call of `facebook.getAccessExpires()` returning 0 every time. My first thought was the API might be broken and some changes applied I didn't noticed. However using an iPhone project of about same age it seems to receive an expiration date. (From what I can see with my lack of objective-c skills ^^). Next I checked out commit `5a72863793521a96f5a9f4fb72960a27b98e441d` from [facebook's github][1] 'cause I started to implemented supporting FB around this time and thought this way I might see if the SDK changed in some dramatic way. So far all my efforts been in vain and I can't think of a good reason where to track down this bug. DialogListener dialogListener = new DialogListener(){ @Override public void onComplete(Bundle values) { mPrefsEdit.putString(USER_ACCESS_TOKEN, facebook.getAccessToken() ) .putLong(USER_ACCESS_EXPIR, facebook.getAccessExpires() ) .commit(); } //other required overrides } Facebook facebook = new Facebook(APP_ID); facebook.authorize(activity, APP_PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, dialogListener); [1]: https://github.com/facebook/facebook-android-sdk/commits/master
0