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,542,298
07/18/2012 13:15:47
1,255,026
02/07/2011 14:26:07
6
0
How to improve performance in image loading on web application?
I have a web application running on local host. The requirement is to load multiple rectangular jpg images (96 images, average 7k in size each) and show on home page when it runs. Images are showed in a grid of 8x12 rows/columns. I am loading image by setting the 'src' attribute of the 'img' in javascript. The url assigned to the 'src' attribute is same for all images but the image id is different. Images are loading but the main issue is that they are not loading very quickly and they are some what loading in a sequence means 1,2,3,4... and so on but some images are not loaded in sequence. I want to improve the performance of this page. I have tried the figure out the timings at different points like: 1. When call is originated form client (image src attribute is set) 2. When server is receiving call. (the page on server which serve individual image) 3. When server is about to return the image. 4. When on client side image is received/showed (image loaded event called in javascript) It turned out after looking at the collected data that main time is lost between 1 and 2 above that is between the client side call is originated and server is receiving call for a particular image. I have also tried setting parameters like maxWorkerThreads, minWorkerThreads, requestQueueLimit and maxconnection in machine.config but no significant improvement yet. Can someone please help me in this situation as i am stuck here since many days and i am really short of time now. Desperately needs to improve the performance of these images loads. Thanks in advance.
performance
image
null
null
null
null
open
How to improve performance in image loading on web application? === I have a web application running on local host. The requirement is to load multiple rectangular jpg images (96 images, average 7k in size each) and show on home page when it runs. Images are showed in a grid of 8x12 rows/columns. I am loading image by setting the 'src' attribute of the 'img' in javascript. The url assigned to the 'src' attribute is same for all images but the image id is different. Images are loading but the main issue is that they are not loading very quickly and they are some what loading in a sequence means 1,2,3,4... and so on but some images are not loaded in sequence. I want to improve the performance of this page. I have tried the figure out the timings at different points like: 1. When call is originated form client (image src attribute is set) 2. When server is receiving call. (the page on server which serve individual image) 3. When server is about to return the image. 4. When on client side image is received/showed (image loaded event called in javascript) It turned out after looking at the collected data that main time is lost between 1 and 2 above that is between the client side call is originated and server is receiving call for a particular image. I have also tried setting parameters like maxWorkerThreads, minWorkerThreads, requestQueueLimit and maxconnection in machine.config but no significant improvement yet. Can someone please help me in this situation as i am stuck here since many days and i am really short of time now. Desperately needs to improve the performance of these images loads. Thanks in advance.
0
11,443,358
07/12/2012 00:07:52
1,192,890
02/06/2012 17:35:15
11
0
Am I understanding this correctly? (C# Arrays and assigning values)
There was a piece of code in C# for Programmers 2010 that I was wondering about, here it is: <code>for ( int count = 0; count < deck.Length; count++ ) deck[ count ] = new Card( faces[ count % 13 ], suits[ count / 13 ] );</code> Here is the whole program: <code> // Fig. 8.10: DeckOfCards.cs // DeckOfCards class represents a deck of playing cards. using System; public class DeckOfCards {7 private Card[] deck; // array of Card objects private int currentCard; // index of next Card to be dealt private const int NUMBER_OF_CARDS = 52; // constant number of Cards private Random randomNumbers; // random-number generator // constructor fills deck of Cards public DeckOfCards() {currentCard = 0; // set currentCard so deck[ 0 ] is dealt first randomNumbers = new Random(); // create random-number generator } // end DeckOfCards constructor // shuffle deck of Cards with one-pass algorithm public void Shuffle() {// after shuffling, dealing should start at deck[ 0 ] again currentCard = 0; // reinitialize currentCard // for each Card, pick another random Card and swap them for ( int first = 0; first < deck.Length; first++ ) {// select a random number between 0 and 51 int second = randomNumbers.Next( NUMBER_OF_CARDS ); // swap current Card with randomly selected Card } // end for } // end method Shuffle // deal one Card public Card DealCard(){ // determine whether Cards remain to be dealt if ( ) return deck[ currentCard++ ]; // return current Card in array else return null; // indicate that all Cards were dealt } // end method DealCard } // end class DeckOfCards </code> My question is about the first code snippet. I understand that count is the slot in the arrays memory, and that new Card is putting the suits and and faces in the deck and they return the count amount. What I don't understand is how can you modulus and divide into zero? Or am I misunderstanding? Thanks
c#
arrays
null
null
null
null
open
Am I understanding this correctly? (C# Arrays and assigning values) === There was a piece of code in C# for Programmers 2010 that I was wondering about, here it is: <code>for ( int count = 0; count < deck.Length; count++ ) deck[ count ] = new Card( faces[ count % 13 ], suits[ count / 13 ] );</code> Here is the whole program: <code> // Fig. 8.10: DeckOfCards.cs // DeckOfCards class represents a deck of playing cards. using System; public class DeckOfCards {7 private Card[] deck; // array of Card objects private int currentCard; // index of next Card to be dealt private const int NUMBER_OF_CARDS = 52; // constant number of Cards private Random randomNumbers; // random-number generator // constructor fills deck of Cards public DeckOfCards() {currentCard = 0; // set currentCard so deck[ 0 ] is dealt first randomNumbers = new Random(); // create random-number generator } // end DeckOfCards constructor // shuffle deck of Cards with one-pass algorithm public void Shuffle() {// after shuffling, dealing should start at deck[ 0 ] again currentCard = 0; // reinitialize currentCard // for each Card, pick another random Card and swap them for ( int first = 0; first < deck.Length; first++ ) {// select a random number between 0 and 51 int second = randomNumbers.Next( NUMBER_OF_CARDS ); // swap current Card with randomly selected Card } // end for } // end method Shuffle // deal one Card public Card DealCard(){ // determine whether Cards remain to be dealt if ( ) return deck[ currentCard++ ]; // return current Card in array else return null; // indicate that all Cards were dealt } // end method DealCard } // end class DeckOfCards </code> My question is about the first code snippet. I understand that count is the slot in the arrays memory, and that new Card is putting the suits and and faces in the deck and they return the count amount. What I don't understand is how can you modulus and divide into zero? Or am I misunderstanding? Thanks
0
11,443,359
07/12/2012 00:07:53
759,235
05/18/2011 13:05:51
165
2
Stop a loop with an click event jQuery
I am looking for a way to stop a loop with a click event(sort of panic button). If you click the button it should stop immediately. // basic idea $.each(someArray, function(index, value){ setTimeout(function(){ console.log(index); },5000*index); }); $('#panic-button').click(function(){ //the code that should stop the looping }):
javascript
jquery
loops
each
null
null
open
Stop a loop with an click event jQuery === I am looking for a way to stop a loop with a click event(sort of panic button). If you click the button it should stop immediately. // basic idea $.each(someArray, function(index, value){ setTimeout(function(){ console.log(index); },5000*index); }); $('#panic-button').click(function(){ //the code that should stop the looping }):
0
11,443,360
07/12/2012 00:07:58
1,427,060
05/30/2012 21:14:48
3
0
How to Restart IE WebBrowser Control in C#
Basically I've figured out how to pro grammatically change proxies, but now I want my WebBrowser to use the new proxy. To do that I presume I need to restart IE, and by extension, the IE based WebBrowser control in my C# application. How can I do this?
c#
internet-explorer
proxy
webbrowser
null
null
open
How to Restart IE WebBrowser Control in C# === Basically I've figured out how to pro grammatically change proxies, but now I want my WebBrowser to use the new proxy. To do that I presume I need to restart IE, and by extension, the IE based WebBrowser control in my C# application. How can I do this?
0
11,443,345
07/12/2012 00:06:19
1,519,349
07/12/2012 00:04:11
1
0
Assigning IP Addresses to a Physical Location
Is there any way to assign an IP address to a computer connected a specific port on a level 3 Cisco switch? I would like to make a network map that can identify where computers are physically located in our building based on their IP address. If a computer moves locations, it gets a new IP address. That way an IP address is assigned to a physical location, and not a MAC address or computer. Other ideas for being able to identify where computers are physically located would help, if my IP address idea is absurd.
ip
cisco
dhcp
null
null
null
open
Assigning IP Addresses to a Physical Location === Is there any way to assign an IP address to a computer connected a specific port on a level 3 Cisco switch? I would like to make a network map that can identify where computers are physically located in our building based on their IP address. If a computer moves locations, it gets a new IP address. That way an IP address is assigned to a physical location, and not a MAC address or computer. Other ideas for being able to identify where computers are physically located would help, if my IP address idea is absurd.
0
11,443,367
07/12/2012 00:08:52
1,141,641
01/10/2012 19:34:42
32
0
What design patterns to be used in this class diagram?
I'm working on the application to create class diagram of video store. In that customer may subscribe with retailer to be notified of new releases. Can I use observer design pattern for this requirement? And some of the requirements for the application is: 1. the ability to create and retrieve movies for every category 2. retailer sends 10% discount voucher for randomly selected customers everyday I did this class diagram without any pattern which is straightforward. I want to improve this by applying design patterns to the diagram. Any suggestions what patterns can be used?
design-patterns
uml
uml-modeling
null
null
null
open
What design patterns to be used in this class diagram? === I'm working on the application to create class diagram of video store. In that customer may subscribe with retailer to be notified of new releases. Can I use observer design pattern for this requirement? And some of the requirements for the application is: 1. the ability to create and retrieve movies for every category 2. retailer sends 10% discount voucher for randomly selected customers everyday I did this class diagram without any pattern which is straightforward. I want to improve this by applying design patterns to the diagram. Any suggestions what patterns can be used?
0
11,443,369
07/12/2012 00:09:18
255,300
01/20/2010 21:54:49
8
1
How to figure out which class to use in Spring?
I have some code that parses a text data into Java objects. There are several parsers available based on a json value. e.g. when type=1, use parser1, type=2 use parser2 etc. My code is like the following: interface Parser { Data parse(Input data); } class Parser1 implements Parser { } class Parser2 implements Parser { } switch(type) { case 1: return parser1.parse(data); case 2: return parser2.parse(data); default: return null; } I don't like manually check type and manually select parser. Is there a way to let spring handle the mapping from type to parser? Thanks!
spring
null
null
null
null
null
open
How to figure out which class to use in Spring? === I have some code that parses a text data into Java objects. There are several parsers available based on a json value. e.g. when type=1, use parser1, type=2 use parser2 etc. My code is like the following: interface Parser { Data parse(Input data); } class Parser1 implements Parser { } class Parser2 implements Parser { } switch(type) { case 1: return parser1.parse(data); case 2: return parser2.parse(data); default: return null; } I don't like manually check type and manually select parser. Is there a way to let spring handle the mapping from type to parser? Thanks!
0
11,443,324
07/12/2012 00:03:04
525,980
12/01/2010 02:10:33
2,999
55
Haskell type class for Queue
Has anyone written a Haskell type class (or is there a combination of type classes) that describes a FIFO queue. [Data.Collection.Sequence][1] seems too strong, but on the other hand [Data.Collection.Unfoldable][2] seems too weak (as order is not defined). I just wanted to not redo someone else's work. [1]: http://hackage.haskell.org/packages/archive/collections-api/1.0.0.0/doc/html/Data-Collections.html#g:6 [2]: http://hackage.haskell.org/packages/archive/collections-api/1.0.0.0/doc/html/Data-Collections.html#g:2
haskell
typeclass
null
null
null
null
open
Haskell type class for Queue === Has anyone written a Haskell type class (or is there a combination of type classes) that describes a FIFO queue. [Data.Collection.Sequence][1] seems too strong, but on the other hand [Data.Collection.Unfoldable][2] seems too weak (as order is not defined). I just wanted to not redo someone else's work. [1]: http://hackage.haskell.org/packages/archive/collections-api/1.0.0.0/doc/html/Data-Collections.html#g:6 [2]: http://hackage.haskell.org/packages/archive/collections-api/1.0.0.0/doc/html/Data-Collections.html#g:2
0
11,443,374
07/12/2012 00:09:50
1,476,075
06/22/2012 22:33:45
46
0
What is a good book to learn mobile application development(android) that is exercises/questions to practise with?
I am expecting to start an internship with a company and just want to get a leg up before begining. Any advice would be appreciated.
android
null
null
null
null
null
open
What is a good book to learn mobile application development(android) that is exercises/questions to practise with? === I am expecting to start an internship with a company and just want to get a leg up before begining. Any advice would be appreciated.
0
11,443,355
07/12/2012 00:07:30
1,152,940
01/17/2012 00:45:57
30
1
Ignoring empty href in jQuery each
I'm trying to ignore a's with empty href attributes in a jQuery function. Here's the HTML: <ul id="nav-other-links"> <li class="nav-title">NICHOLAS<br/> AREHART</li><br/> <li><a href="">CV/Bio</a></li> <li><a href="">Contact</a></li> <li><a href="">News</a></li> <li><a href="<?php randLink() ?>">Link???</a></li> </ul> <ul id="nav-works"> <li class="nav-title">WORK</li><br/> <li class="work"><a href="#the-speech">The Speech</a></li> <li class="work"><a href="#forms-derived-from-a-code">Forms Derived from a Code</a></li> <li class="work"><a href="#unauthorized-reproduction">Unauthorized Reproduction</a></li> <li class="work"><a href="">Newport Ads</a></li> <li class="work"><a href="">An Illegally Downloaded Film</a></li> <li class="work"><a href="">Hold on to Your Genre</a></li> <li class="work"><a href="">Autonomy</a></li> <li class="work"><a href="">Ikea Objects</a></li><br/> <li id="nav-arrows"> <div class="nav-arrows"> <a class="nav-arrow-prev" href="">&laquo;</a> &emsp;&emsp; <a class="nav-arrow-next" href="">&#187;</a> </div> </li> </ul> And here is the jQuery: <script type="text/javascript"> $(document).ready( function() { $('#nav-works-screen a').smoothScroll(); $(document).scroll( function(){ $('nav a').each( function(){ var workLink = $(this); var work = workLink.attr('href'); if (work != '') { var workTop = $(work).offset().top; var currentPos = $(window).scrollTop(); var winHeight = $(window).height(); if (currentPos >= workTop) { workLink.css({'background-color':'#38FF4F'}); workLink.parent().siblings().children().css({'background-color':'transparent'}); } else { workLink.css({'background-color':'transparent'}); } } }); }); }); </script> Unfortunately, I keep getting an error that property 'top' of null cannot be read. I don't understand why the work variable would be empty if I've explicitly stated that any empty work variables should be ignored. I'm sure its something really simple but I've been banging my head against a wall with this thing for over an hour now. Any help would be much appreciated.
jquery
null
null
null
null
null
open
Ignoring empty href in jQuery each === I'm trying to ignore a's with empty href attributes in a jQuery function. Here's the HTML: <ul id="nav-other-links"> <li class="nav-title">NICHOLAS<br/> AREHART</li><br/> <li><a href="">CV/Bio</a></li> <li><a href="">Contact</a></li> <li><a href="">News</a></li> <li><a href="<?php randLink() ?>">Link???</a></li> </ul> <ul id="nav-works"> <li class="nav-title">WORK</li><br/> <li class="work"><a href="#the-speech">The Speech</a></li> <li class="work"><a href="#forms-derived-from-a-code">Forms Derived from a Code</a></li> <li class="work"><a href="#unauthorized-reproduction">Unauthorized Reproduction</a></li> <li class="work"><a href="">Newport Ads</a></li> <li class="work"><a href="">An Illegally Downloaded Film</a></li> <li class="work"><a href="">Hold on to Your Genre</a></li> <li class="work"><a href="">Autonomy</a></li> <li class="work"><a href="">Ikea Objects</a></li><br/> <li id="nav-arrows"> <div class="nav-arrows"> <a class="nav-arrow-prev" href="">&laquo;</a> &emsp;&emsp; <a class="nav-arrow-next" href="">&#187;</a> </div> </li> </ul> And here is the jQuery: <script type="text/javascript"> $(document).ready( function() { $('#nav-works-screen a').smoothScroll(); $(document).scroll( function(){ $('nav a').each( function(){ var workLink = $(this); var work = workLink.attr('href'); if (work != '') { var workTop = $(work).offset().top; var currentPos = $(window).scrollTop(); var winHeight = $(window).height(); if (currentPos >= workTop) { workLink.css({'background-color':'#38FF4F'}); workLink.parent().siblings().children().css({'background-color':'transparent'}); } else { workLink.css({'background-color':'transparent'}); } } }); }); }); </script> Unfortunately, I keep getting an error that property 'top' of null cannot be read. I don't understand why the work variable would be empty if I've explicitly stated that any empty work variables should be ignored. I'm sure its something really simple but I've been banging my head against a wall with this thing for over an hour now. Any help would be much appreciated.
0
11,472,392
07/13/2012 14:21:48
1,344,109
04/19/2012 13:26:20
117
3
drawstring onclick method C#
I have some strings that I have drawn using DrawString for (int j = 0; j < dt.Rows.Count; j++) { e.Graphics.DrawString(Convert.ToString(dt.Rows[j]["ID"]), drawFont, drawBrush, new Point(Convert.ToInt32(dt.Rows[j]["XCord"]), Convert.ToInt32(dt.Rows[j]["YCord"]))); } Is there any way to create an onclick event for each drawstring? I was hoping to create a new form when you clicked on the drawstring. Thanks!
c#
onclick
drawstring
null
null
null
open
drawstring onclick method C# === I have some strings that I have drawn using DrawString for (int j = 0; j < dt.Rows.Count; j++) { e.Graphics.DrawString(Convert.ToString(dt.Rows[j]["ID"]), drawFont, drawBrush, new Point(Convert.ToInt32(dt.Rows[j]["XCord"]), Convert.ToInt32(dt.Rows[j]["YCord"]))); } Is there any way to create an onclick event for each drawstring? I was hoping to create a new form when you clicked on the drawstring. Thanks!
0
11,472,457
07/13/2012 14:24:56
184,666
10/05/2009 23:48:41
128
9
Fast Enumeration Behavior on NSHTTPCookieStorage cookies collection
I've stumbled across this code: NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage]; for (NSHTTPCookie *cookie in [cookieJar cookies]) { [cookieJar deleteCookie:cookie]; } Having experience with C# I was surprised by the code, it's illegal to modify the collection in a fast enumeration. Well I dig into the docs for Objective-C and it is also illegal to modify the collection in a fast enumeration. The question is why does this code work at all? For us it explains some 'random' crashes we've been experiencing. Just wondering how the deleteCookie call is getting around the guards that are supposed to throw on the delete call.
objective-c
ios
null
null
null
null
open
Fast Enumeration Behavior on NSHTTPCookieStorage cookies collection === I've stumbled across this code: NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage]; for (NSHTTPCookie *cookie in [cookieJar cookies]) { [cookieJar deleteCookie:cookie]; } Having experience with C# I was surprised by the code, it's illegal to modify the collection in a fast enumeration. Well I dig into the docs for Objective-C and it is also illegal to modify the collection in a fast enumeration. The question is why does this code work at all? For us it explains some 'random' crashes we've been experiencing. Just wondering how the deleteCookie call is getting around the guards that are supposed to throw on the delete call.
0
11,472,458
07/13/2012 14:24:56
613,858
02/12/2011 02:10:25
103
15
Listen for iphone notifications?
This maybe not possible, but is there a way to "listen" for iphone notifications or check what kind of notifications have come in from within a app? Is there an API for this? Or does Apple not allow it?
iphone
notifications
null
null
null
null
open
Listen for iphone notifications? === This maybe not possible, but is there a way to "listen" for iphone notifications or check what kind of notifications have come in from within a app? Is there an API for this? Or does Apple not allow it?
0
11,472,466
07/13/2012 14:25:15
571,783
01/11/2011 19:30:33
894
29
Assigning an object/method to a variable OR a new object literal
Looking at Google's code for their bookmark bubble library, I came across this: var google = google || {}; google.bookmarkbubble = google.bookmarkbubble || {}; Could someone explain what it is they're doing here and why they are doing it? Since JS is an interpreted language why would you ever need to assign the same google object into the google variable? Wouldn't the script this is contained in only get executed once each time a page is loaded?
javascript
google
object
variable-assignment
javascript-library
null
open
Assigning an object/method to a variable OR a new object literal === Looking at Google's code for their bookmark bubble library, I came across this: var google = google || {}; google.bookmarkbubble = google.bookmarkbubble || {}; Could someone explain what it is they're doing here and why they are doing it? Since JS is an interpreted language why would you ever need to assign the same google object into the google variable? Wouldn't the script this is contained in only get executed once each time a page is loaded?
0
11,089,190
06/18/2012 18:53:00
304,151
03/29/2010 11:29:49
3,175
38
Trouble printing the value of a Long division and multiplication
I have trouble figuring out why a simple division like this one always returns 0. System.out.println(4091365376L / 4091495462L * 100L); I suffixed all numbers with Ls so they're treated as Longs. I keep getting a zero. I'm trying to calculate the percentage of 4091365376L to 4091495462L. My values are Longs but I'm just looking for a simple Integer value. I haven't managed to wrap my head around why this is happening. Thank you. (Sorry for such a trivial/silly question)
java
math
integer
long-integer
null
null
open
Trouble printing the value of a Long division and multiplication === I have trouble figuring out why a simple division like this one always returns 0. System.out.println(4091365376L / 4091495462L * 100L); I suffixed all numbers with Ls so they're treated as Longs. I keep getting a zero. I'm trying to calculate the percentage of 4091365376L to 4091495462L. My values are Longs but I'm just looking for a simple Integer value. I haven't managed to wrap my head around why this is happening. Thank you. (Sorry for such a trivial/silly question)
0
11,472,473
07/13/2012 14:25:30
1,489,495
06/28/2012 18:40:28
8
0
Where put batch process in a joomla
I have a joombla web site and I have to make a Batch process to run every day at midnight. The think is that I don't know where I should put the process. I thought in make a new component but it isn't a component. Any suggestion?
joomla
null
null
null
null
null
open
Where put batch process in a joomla === I have a joombla web site and I have to make a Batch process to run every day at midnight. The think is that I don't know where I should put the process. I thought in make a new component but it isn't a component. Any suggestion?
0
11,472,477
07/13/2012 14:25:37
1,463,701
06/18/2012 12:44:13
30
3
How to Get General Product Performance Report on Amazon?
I am using Amazon MWS and i get all my product sales report. but I want to know if there is any way i can get sales report for any product ASIN which i am not selling. So That i can find prospective product to sell. --Thank you for your time.
php
amazon
amazon-mws
null
null
null
open
How to Get General Product Performance Report on Amazon? === I am using Amazon MWS and i get all my product sales report. but I want to know if there is any way i can get sales report for any product ASIN which i am not selling. So That i can find prospective product to sell. --Thank you for your time.
0
11,350,670
07/05/2012 18:51:02
1,013,725
10/25/2011 23:40:21
6
0
UIManagedDocument with NSFetchedResultsController and background context
I am trying to get the following working. I have a table view that is displaying data fetched from an API in a table view. For that purpose I am using a NSFetchedResultsController: self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:self.database.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; I create my entities in a background context like this: NSManagedObjectContext *backgroundContext; backgroundContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; backgroundContext.parentContext = document.managedObjectContext; [backgroundContext performBlock:^{ [MyAPI createEntitiesInContext:backgroundContext]; NSError *error = nil; [backgroundContext save:&error]; if (error) NSLog(@"error: %@",error.localizedDescription); [document.managedObjectContext performBlock:^{ [document updateChangeCount:UIDocumentChangeDone]; [document.managedObjectContext save:nil]; }]; Now, whenever I get new data (and insert/update entities like shown just above), my NSFetchedResultsController doesn't quite work as it should. In particular, I am always updating one entity (not creating a new one), but my table view shows two entities. Once I restart the app it shows up correctly. If I perform the creation of the entities ([MyAPI createEntities]) in self.database.managedObjectContext, everything works fine. Any idea what I am doing wrong? Looking through the existing threads here on SO makes me think that I'm doing it the right way. Again, if I do not do the core data saves in the background context (but on document.managedObjectContext) then it works fine...
core-data
nsfetchedresultscontrolle
uimanageddocument
null
null
null
open
UIManagedDocument with NSFetchedResultsController and background context === I am trying to get the following working. I have a table view that is displaying data fetched from an API in a table view. For that purpose I am using a NSFetchedResultsController: self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:self.database.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; I create my entities in a background context like this: NSManagedObjectContext *backgroundContext; backgroundContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; backgroundContext.parentContext = document.managedObjectContext; [backgroundContext performBlock:^{ [MyAPI createEntitiesInContext:backgroundContext]; NSError *error = nil; [backgroundContext save:&error]; if (error) NSLog(@"error: %@",error.localizedDescription); [document.managedObjectContext performBlock:^{ [document updateChangeCount:UIDocumentChangeDone]; [document.managedObjectContext save:nil]; }]; Now, whenever I get new data (and insert/update entities like shown just above), my NSFetchedResultsController doesn't quite work as it should. In particular, I am always updating one entity (not creating a new one), but my table view shows two entities. Once I restart the app it shows up correctly. If I perform the creation of the entities ([MyAPI createEntities]) in self.database.managedObjectContext, everything works fine. Any idea what I am doing wrong? Looking through the existing threads here on SO makes me think that I'm doing it the right way. Again, if I do not do the core data saves in the background context (but on document.managedObjectContext) then it works fine...
0
11,350,686
07/05/2012 18:52:09
1,107,448
12/20/2011 09:04:49
1,697
104
Combine results of joins on two tables
I have 3 tables items tag_id mark_id tags_users tag_id user_id marks_users mark_id user_id Is there a way to select uniq `items` for specific `user_id` without union and nested selects?
sql
postgresql
null
null
null
null
open
Combine results of joins on two tables === I have 3 tables items tag_id mark_id tags_users tag_id user_id marks_users mark_id user_id Is there a way to select uniq `items` for specific `user_id` without union and nested selects?
0
11,350,673
07/05/2012 18:51:13
1,187,070
02/03/2012 08:44:16
6
0
how to install "spree-dropdown-variants" with spree 1.1.1
I am using spree 1.1.1 and facing problem installing "spree-dropdown-variants" because it has no GEM file. Please help me.
extension
gem
spree
null
null
null
open
how to install "spree-dropdown-variants" with spree 1.1.1 === I am using spree 1.1.1 and facing problem installing "spree-dropdown-variants" because it has no GEM file. Please help me.
0
11,334,026
07/04/2012 18:35:01
901,379
08/18/2011 20:48:33
404
41
Eclipse error constantly pops up while editing Javascript
I am working on relatively small (100-300 lines) Javascript files in Eclipse and periodically it gets really upset about some piece of code and pops up this error every time I place the cursor on that line. The error is: 'Requesting JavaScript AST from Selection' has encountered a problem. An internal error occured during "Requesting JavaScript AST from selection". java.lang.NullPointerException While I am converting this: if(p){ // enter code here } else { return false; } into this: if(p){ // enter code here } return false; the error pops up several times. Each time it stops my typing and requires me to click the okay button. I then type two more characters and the error appears again. Any ideas how to either prevent the error or disable whatever Javascript AST is? This is on Eclipse Java EE, Indigo Service Release 2. It is almost a flat install, only two plugins installed and neither are for SVN and have nothing to do with Javascript.
javascript
eclipse
null
null
null
null
open
Eclipse error constantly pops up while editing Javascript === I am working on relatively small (100-300 lines) Javascript files in Eclipse and periodically it gets really upset about some piece of code and pops up this error every time I place the cursor on that line. The error is: 'Requesting JavaScript AST from Selection' has encountered a problem. An internal error occured during "Requesting JavaScript AST from selection". java.lang.NullPointerException While I am converting this: if(p){ // enter code here } else { return false; } into this: if(p){ // enter code here } return false; the error pops up several times. Each time it stops my typing and requires me to click the okay button. I then type two more characters and the error appears again. Any ideas how to either prevent the error or disable whatever Javascript AST is? This is on Eclipse Java EE, Indigo Service Release 2. It is almost a flat install, only two plugins installed and neither are for SVN and have nothing to do with Javascript.
0
11,373,393
07/07/2012 08:05:26
794,075
06/11/2011 15:39:25
742
29
Qt application made in Eclipse doesn't start
I've been trying for a few hours now to make eclipse, mingw and Qt work, and I can't manage to. No matter what I try, when I try to run the qt application (using Run or Debug, same thing), no window appears, and after a few seconds, Eclipse says 'program terminated'. Another time I tried (using some different configurations), windows would give that "Program has stopped" error. If I try to launch the application from outside eclipse, I get a missing .dll error. I have Qt 4.8.1 installed, latest version of eclipse, and I just installed the latest version of MinGW. I am also using the Qt plugin for Eclipse. I'm running Windows 7. There are also some other minor problems: * For some reason I have to rebuild the index after opening/creating a project, or I'll get 'undefined include' errors. * The build (hammer) icon in the toolbar is grayed/disabled, why could that be? * For every new project, I need to change the make application to mingw32-make, is it possible to make the toolchain use this make executable or something? I can't understand why Microsoft Visual Studio just works, I didn't have to set up anything other than install the Qt add-in, and Eclipse is so hard to configure...
eclipse
qt
ide
mingw
null
null
open
Qt application made in Eclipse doesn't start === I've been trying for a few hours now to make eclipse, mingw and Qt work, and I can't manage to. No matter what I try, when I try to run the qt application (using Run or Debug, same thing), no window appears, and after a few seconds, Eclipse says 'program terminated'. Another time I tried (using some different configurations), windows would give that "Program has stopped" error. If I try to launch the application from outside eclipse, I get a missing .dll error. I have Qt 4.8.1 installed, latest version of eclipse, and I just installed the latest version of MinGW. I am also using the Qt plugin for Eclipse. I'm running Windows 7. There are also some other minor problems: * For some reason I have to rebuild the index after opening/creating a project, or I'll get 'undefined include' errors. * The build (hammer) icon in the toolbar is grayed/disabled, why could that be? * For every new project, I need to change the make application to mingw32-make, is it possible to make the toolchain use this make executable or something? I can't understand why Microsoft Visual Studio just works, I didn't have to set up anything other than install the Qt add-in, and Eclipse is so hard to configure...
0
11,373,351
07/07/2012 07:58:04
115,201
05/31/2009 20:11:27
1,157
43
selenium-webdriver and wait for page to load
I'm trying to write simple test. My problem is, that i want to wait until the page is loaded completly. At the moment i'm waiting until some elements are presen, but that is not really what i want. Is it possible to make something like this: driver = Selenium::WebDriver.for :chrome driver.navigate.to url driver.wait_for_page_to_load "30000" With Java isn't problem, but how to make it with ruby?
ruby
selenium
page
webdriver
waiting
null
open
selenium-webdriver and wait for page to load === I'm trying to write simple test. My problem is, that i want to wait until the page is loaded completly. At the moment i'm waiting until some elements are presen, but that is not really what i want. Is it possible to make something like this: driver = Selenium::WebDriver.for :chrome driver.navigate.to url driver.wait_for_page_to_load "30000" With Java isn't problem, but how to make it with ruby?
0
11,373,404
07/07/2012 08:07:01
1,338,152
04/17/2012 07:57:21
4
0
how to save video in ipad simulator
I want to pick video from photo library using imagePickerController. but there is no video on my simulator. I know how to load images in simulator but don't know how to load video. Please help.
ios-simulator
uiimagepickercontroller
null
null
null
null
open
how to save video in ipad simulator === I want to pick video from photo library using imagePickerController. but there is no video on my simulator. I know how to load images in simulator but don't know how to load video. Please help.
0
11,372,997
07/07/2012 07:02:15
1,047,280
11/15/2011 09:51:33
62
7
Is it possible to add Queue Data to DataTable in C#?
I am adding Items in **Queue"<"string">"** Asynchronously to Queue.Instead of *Inserting row by row* for each data of Queue using INSERT query, I want to add these items to DataTableOnly when **if(evtLogQueue.Count==1000)**. So that the DataTable could be used further for Bulk Insert using **BulkCopy** to SQLServerDB. I would like to know is it Possible to do? if YES then how? or any other suggestion? Sample Code: static Queue<string> evtLogQueue = new Queue<string>(); public static void AddItemsToQueue(string itm) { evtLogQueue.Enqueue(itm); Console.WriteLine("Length of Queue:" + evtLogQueue.Count); }
c#
data-structures
datatable
queue
null
null
open
Is it possible to add Queue Data to DataTable in C#? === I am adding Items in **Queue"<"string">"** Asynchronously to Queue.Instead of *Inserting row by row* for each data of Queue using INSERT query, I want to add these items to DataTableOnly when **if(evtLogQueue.Count==1000)**. So that the DataTable could be used further for Bulk Insert using **BulkCopy** to SQLServerDB. I would like to know is it Possible to do? if YES then how? or any other suggestion? Sample Code: static Queue<string> evtLogQueue = new Queue<string>(); public static void AddItemsToQueue(string itm) { evtLogQueue.Enqueue(itm); Console.WriteLine("Length of Queue:" + evtLogQueue.Count); }
0
11,372,998
07/07/2012 07:02:18
689,784
04/03/2011 12:12:14
1
0
Listener on part of textview to check if it is visible
I have a textview which contains a very long text. This textview is placed inside a scrollview. I would like to keep track of specific parts of the textview (few scattered sentences) so that when they are visible on the screen, I perform a specific action. Any suggestions for how this can be achieved ?
android
textview
null
null
null
null
open
Listener on part of textview to check if it is visible === I have a textview which contains a very long text. This textview is placed inside a scrollview. I would like to keep track of specific parts of the textview (few scattered sentences) so that when they are visible on the screen, I perform a specific action. Any suggestions for how this can be achieved ?
0
11,373,387
07/07/2012 08:04:29
573,688
01/13/2011 04:27:46
1,115
67
Accessing or listing unknown attributes of xml nodes with php
Given the following xml structure (cut for brevity): <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="" xml:base="http://www.smashingmagazine.com/wp-atom.php" > I am attempting to list the attributes of the `<feed>` element. In php I am doing this: $xml = simplexml_load_string(file_get_contents($cleanedRssUrl)); $numAttributes = count($xml->attributes()); I am expecting that `xmlns` and `xmlns:thr` will not show up because that is a namespace and can be found by: print_r($xml->getDocNamespaces(true)); But I was expecting to get `xml:lang` and `xml:base`. However, the count is 0. Are there any ways to fetch these into an array without knowing they will exist from RSS to RSS? If I use `print_r($xml->attributes('xml',true));` then they do show up, but this requires knowing they will be present. Any thoughts welcome. MyStream
php
attributes
simplexml-load-string
null
null
null
open
Accessing or listing unknown attributes of xml nodes with php === Given the following xml structure (cut for brevity): <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="" xml:base="http://www.smashingmagazine.com/wp-atom.php" > I am attempting to list the attributes of the `<feed>` element. In php I am doing this: $xml = simplexml_load_string(file_get_contents($cleanedRssUrl)); $numAttributes = count($xml->attributes()); I am expecting that `xmlns` and `xmlns:thr` will not show up because that is a namespace and can be found by: print_r($xml->getDocNamespaces(true)); But I was expecting to get `xml:lang` and `xml:base`. However, the count is 0. Are there any ways to fetch these into an array without knowing they will exist from RSS to RSS? If I use `print_r($xml->attributes('xml',true));` then they do show up, but this requires knowing they will be present. Any thoughts welcome. MyStream
0
11,373,407
07/07/2012 08:07:36
1,163,760
01/22/2012 18:28:44
36
3
should I write [super viewDidLoad]?
I'm writing a navigation based app. (it has modal segues too) I'm not sure if I should keep `[super viewDidLoad];` call or not. should I write code after this line of code or before it? how about `[super viewDidUnload];` and similars?
viewdidload
viewdidunload
null
null
null
null
open
should I write [super viewDidLoad]? === I'm writing a navigation based app. (it has modal segues too) I'm not sure if I should keep `[super viewDidLoad];` call or not. should I write code after this line of code or before it? how about `[super viewDidUnload];` and similars?
0
11,410,914
07/10/2012 10:03:21
1,506,984
07/06/2012 14:11:03
1
0
Problems compiling and running Java app with Bluecove (NoClassDefFoundError)
I have this app that uses bluetooth, so I need both, bluecove and bluecove-gpl packages, when I run it in NetBeans I have no problem at all, and works perfectly fine. But I still can't compile and run from the command line (Ubuntu 11.04). I'm using this line for compilation: $ javac -Xlint:unchecked -classpath bluecove-2.1.0.jar:bluecove-gpl-2.1.0.jar Client.java And it doesn't return errors and it generates a .class file Then I try to run the .class file like this: java -classpath bluecove-2.1.0.jar:bluecove-gpl-2.1.0.jar Client But it returns a NoClassDefFoundError. Could not find the main class: SPPClient. Why is this happening?
java
ubuntu
noclassdeffounderror
bluecove
null
null
open
Problems compiling and running Java app with Bluecove (NoClassDefFoundError) === I have this app that uses bluetooth, so I need both, bluecove and bluecove-gpl packages, when I run it in NetBeans I have no problem at all, and works perfectly fine. But I still can't compile and run from the command line (Ubuntu 11.04). I'm using this line for compilation: $ javac -Xlint:unchecked -classpath bluecove-2.1.0.jar:bluecove-gpl-2.1.0.jar Client.java And it doesn't return errors and it generates a .class file Then I try to run the .class file like this: java -classpath bluecove-2.1.0.jar:bluecove-gpl-2.1.0.jar Client But it returns a NoClassDefFoundError. Could not find the main class: SPPClient. Why is this happening?
0
11,410,915
07/10/2012 10:03:34
1,395,209
05/15/2012 04:41:14
11
9
API of play.google.com/store
<br/> I am trying from many days to find API for play.google.col/store. <br/> But, Still i dont have any solution. <br/> I also try android.market.api, but is not working because is out dated by google. <br/> Is any API for getting list of application from play.google.col/store, like itune ? <br/>
jquery
.net
google
null
null
null
open
API of play.google.com/store === <br/> I am trying from many days to find API for play.google.col/store. <br/> But, Still i dont have any solution. <br/> I also try android.market.api, but is not working because is out dated by google. <br/> Is any API for getting list of application from play.google.col/store, like itune ? <br/>
0
11,410,930
07/10/2012 10:04:21
1,391,245
05/12/2012 15:50:59
1
0
Uncaught ReferenceError: msgbox is not defined (anonymous function)
//////////////////main.js file attached function msgbox (title,text,type,time) { /////////////////////////////////////////// var img = "<img src='image/"+type+".png' /> "; $("#window .wtext").html("<table border='0'><tr><td>"+img+"</td><td>"+text+"</td></tr></table>"); $("#window .wtitle").html(title); /////////////////////////////////////////// //$("#window .wtext").css("height",(parseInt($("#window").css("height"),10)-65)+"px"); get_center("window"); /////////////////////////////////////////// $("#window").fadeIn(); if (time!=0) { var t = window.setInterval(function(){ $("#window").fadeOut(); window.clearInterval(t); },time*1000); } } //////////////////myajax.js file attached function toggle_div () { msgbox("title","text","ok",3); } I have problem when i call msgbox from myajax.js. how can i use my function. it is working from another file. i should use something for declaring global function?
javascript
ajax
null
null
null
null
open
Uncaught ReferenceError: msgbox is not defined (anonymous function) === //////////////////main.js file attached function msgbox (title,text,type,time) { /////////////////////////////////////////// var img = "<img src='image/"+type+".png' /> "; $("#window .wtext").html("<table border='0'><tr><td>"+img+"</td><td>"+text+"</td></tr></table>"); $("#window .wtitle").html(title); /////////////////////////////////////////// //$("#window .wtext").css("height",(parseInt($("#window").css("height"),10)-65)+"px"); get_center("window"); /////////////////////////////////////////// $("#window").fadeIn(); if (time!=0) { var t = window.setInterval(function(){ $("#window").fadeOut(); window.clearInterval(t); },time*1000); } } //////////////////myajax.js file attached function toggle_div () { msgbox("title","text","ok",3); } I have problem when i call msgbox from myajax.js. how can i use my function. it is working from another file. i should use something for declaring global function?
0
11,410,931
07/10/2012 10:04:23
444,173
09/10/2010 08:47:50
50
2
Is there Amazon firewall\port sniffer metrics on Amazon CloudWatch?
Is there Amazon firewall\port sniffer metrics on Amazon CloudWatch? The task is: track traffic on Amazon EC2 machine on specific port. Is this possible via Amazon CloudWatch API?
amazon-ec2
amazon-cloudwatch
null
null
null
null
open
Is there Amazon firewall\port sniffer metrics on Amazon CloudWatch? === Is there Amazon firewall\port sniffer metrics on Amazon CloudWatch? The task is: track traffic on Amazon EC2 machine on specific port. Is this possible via Amazon CloudWatch API?
0
11,410,932
07/10/2012 10:04:27
616,225
02/14/2011 13:05:26
624
25
Call static method from a string name in PHP
I need to call a static method of a class, but I only have a classname, not an instance of it. I am doing it this way. $class = new "ModelName"; $items = $class::model()->findAll(); It works on my computer, but when I move to the server, it throws an `unexpected T_PAAMAYIM_NEKUDOTAYIM`, so I think it actually expects model to be a variable instead of a method. PS: If it helps, it's Yii framework, so if there's another way to call the find() functions, it's ok to me. Thanks in advance
php5
yii
static-methods
null
null
null
open
Call static method from a string name in PHP === I need to call a static method of a class, but I only have a classname, not an instance of it. I am doing it this way. $class = new "ModelName"; $items = $class::model()->findAll(); It works on my computer, but when I move to the server, it throws an `unexpected T_PAAMAYIM_NEKUDOTAYIM`, so I think it actually expects model to be a variable instead of a method. PS: If it helps, it's Yii framework, so if there's another way to call the find() functions, it's ok to me. Thanks in advance
0
11,410,939
07/10/2012 10:04:49
1,287,627
03/23/2012 06:12:27
16
0
Share data Between android and ios via bump
I have developed an application which transfers images from one android phone to another via Bump.Now i want that my app should also able to transfer data from android phone to ios phone.Is there any library available which supports bump between android and ios devices??
android
null
null
null
null
null
open
Share data Between android and ios via bump === I have developed an application which transfers images from one android phone to another via Bump.Now i want that my app should also able to transfer data from android phone to ios phone.Is there any library available which supports bump between android and ios devices??
0
11,410,940
07/10/2012 10:04:49
1,409,699
05/22/2012 08:26:29
1
0
Loading dlls from path specified in SetdllDirectory in c#
I am new in dotnet.I have a dotnet dll that loads a c dll by using DllImport. I want to place all the dlls in a folder which is diffrent from the location of application. I dont want to modify environmental variables. So i used setdlldirectory API and load my c# assembly through Assembly.Loadfrom(..). I checked that SetdllDirectory is working fine by verifying the value of GetDllDirectory(..). But it is neither loading C# dll nor c dll from that folder. I am able to load C# dll by specyfing the path in Assembly.Loadfrom. But not able to load c dll. Thanks in advance!!
c#
c
windows
winapi
null
null
open
Loading dlls from path specified in SetdllDirectory in c# === I am new in dotnet.I have a dotnet dll that loads a c dll by using DllImport. I want to place all the dlls in a folder which is diffrent from the location of application. I dont want to modify environmental variables. So i used setdlldirectory API and load my c# assembly through Assembly.Loadfrom(..). I checked that SetdllDirectory is working fine by verifying the value of GetDllDirectory(..). But it is neither loading C# dll nor c dll from that folder. I am able to load C# dll by specyfing the path in Assembly.Loadfrom. But not able to load c dll. Thanks in advance!!
0
11,410,876
07/10/2012 10:00:40
853,836
07/20/2011 11:38:51
1,128
22
Handling null values where not allowed
I have the following code in the mClass constructor: public mClass(Context ctx) { super(); this.ctx = ctx; } The context can't be null because its necesary for the object operation. So if I allow the creation of an new mClass(null) it will break later. I'd like to crash when the object is create because is when the incorrect situation is happening. Whats the standard way of doing this? For example making public mClass(Context ctx) { super(); if(ctx==null) throw new Exception ("...."); this.ctx = ctx; } forces to declare the method as exception thrower and I dont wan't to do this because passing a null value is not usual
java
android
null
null
null
null
open
Handling null values where not allowed === I have the following code in the mClass constructor: public mClass(Context ctx) { super(); this.ctx = ctx; } The context can't be null because its necesary for the object operation. So if I allow the creation of an new mClass(null) it will break later. I'd like to crash when the object is create because is when the incorrect situation is happening. Whats the standard way of doing this? For example making public mClass(Context ctx) { super(); if(ctx==null) throw new Exception ("...."); this.ctx = ctx; } forces to declare the method as exception thrower and I dont wan't to do this because passing a null value is not usual
0
11,410,941
07/10/2012 10:04:51
896,663
08/16/2011 12:34:38
588
59
Difference between quirks mode and standards mode javascript
are there any differences in the javascript of these two modes in IE 9? if yes what are they?
javascript
internet-explorer
internet-explorer-9
standards
quirks-mode
null
open
Difference between quirks mode and standards mode javascript === are there any differences in the javascript of these two modes in IE 9? if yes what are they?
0
11,410,942
07/10/2012 10:04:56
1,514,389
07/10/2012 09:53:30
1
0
How to use Service Accounts OAuth 2.0 flow with GroupsSettings-api
using google-api-java-client at this [page][1] we can read about some flows. the service accounts flow works fine with calendar api GoogleCredential credential = new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT) .setJsonFactory(JSON_FACTORY) .setServiceAccountId("[[]]") .setServiceAccountScopes(CalendarScopes.CALENDAR) .setServiceAccountPrivateKeyFromP12File(new File("key.p12")).build(); But we have always: 503 Service Unavailable { "code" : 503, "errors" : [ { "domain" : "global", "message" : "Backend Error", "reason" : "backendError" } ], "message" : "Backend Error" } if we use GroupssettingsScopes.APPS_GROUPS_SETTINGS (the api console grant access for this requests). We have to use a mechanism near at the old 2 legged OAuth 1.a for manage the groups of a GApps account. Many thanks in advance [1]: http://code.google.com/p/google-api-java-client/wiki/OAuth2
java
google-api
google-api-java-client
null
null
null
open
How to use Service Accounts OAuth 2.0 flow with GroupsSettings-api === using google-api-java-client at this [page][1] we can read about some flows. the service accounts flow works fine with calendar api GoogleCredential credential = new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT) .setJsonFactory(JSON_FACTORY) .setServiceAccountId("[[]]") .setServiceAccountScopes(CalendarScopes.CALENDAR) .setServiceAccountPrivateKeyFromP12File(new File("key.p12")).build(); But we have always: 503 Service Unavailable { "code" : 503, "errors" : [ { "domain" : "global", "message" : "Backend Error", "reason" : "backendError" } ], "message" : "Backend Error" } if we use GroupssettingsScopes.APPS_GROUPS_SETTINGS (the api console grant access for this requests). We have to use a mechanism near at the old 2 legged OAuth 1.a for manage the groups of a GApps account. Many thanks in advance [1]: http://code.google.com/p/google-api-java-client/wiki/OAuth2
0
11,410,944
07/10/2012 10:05:02
167,033
09/02/2009 05:54:03
103
5
From parameter in email is showing Hosting providers email
I'm using codeigniter 2.X and my app is hosted on Justhost, App was working fine till few days back when justhost upgraded the server, After upgrade outgoing emails are showing wrong From email address. here is debug output after from the app User-Agent: Codeigniter Date: Tue, 10 Jul 2012 03:54:17 -0600 From: "example.com" Return-Path: Reply-To: "example.com" X-Sender: [email protected] X-Mailer: Codeigniter X-Priority: 3 (Normal) Message-ID: <[email protected]> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_4ffbfbc9170e1" In my inbox I get following details Date: Tue, 10 Jul 2012 03:54:17 -0600 From: [email protected] Reply-To: "example.com" <[email protected]> X-Sender: [email protected] X-Mailer: codeigniter X-Priority: 3 (Normal) Message-ID: <[email protected]> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_4ffbfbc9170e1" X-Identified-User: {:just61.justhost.com:user:just61.justhost.com} {sentby:program running on server} Any input will be appreciated.
codeigniter
email
php5
email-headers
null
null
open
From parameter in email is showing Hosting providers email === I'm using codeigniter 2.X and my app is hosted on Justhost, App was working fine till few days back when justhost upgraded the server, After upgrade outgoing emails are showing wrong From email address. here is debug output after from the app User-Agent: Codeigniter Date: Tue, 10 Jul 2012 03:54:17 -0600 From: "example.com" Return-Path: Reply-To: "example.com" X-Sender: [email protected] X-Mailer: Codeigniter X-Priority: 3 (Normal) Message-ID: <[email protected]> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_4ffbfbc9170e1" In my inbox I get following details Date: Tue, 10 Jul 2012 03:54:17 -0600 From: [email protected] Reply-To: "example.com" <[email protected]> X-Sender: [email protected] X-Mailer: codeigniter X-Priority: 3 (Normal) Message-ID: <[email protected]> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_4ffbfbc9170e1" X-Identified-User: {:just61.justhost.com:user:just61.justhost.com} {sentby:program running on server} Any input will be appreciated.
0
11,410,951
07/10/2012 10:05:19
1,508,311
07/07/2012 05:42:14
28
0
Why this DropDownList is not updating inside this GridView?
I have the following database design: Employee Table: Username, Name, JobTitle, BadgeNo, IsActive, DivisionCode Divisions Table: SapCode, DivisionShortcut And I have a GridView that I am using it to add, delete and update/edit the employees information. This information is employee Username, Name, BadgeNo, JobTitle, IsActive and the DivisionShortcut. The Divisions will be listed in DropDownList. I wrote the code but I got the following error: ASP.NET Code: <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Username" DataSourceID="SqlDataSource1" BorderWidth="1px" BackColor="#DEBA84" CellPadding="3" CellSpacing="2" BorderStyle="None" BorderColor="#DEBA84" OnRowEditing="GridView1_RowEditing" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating"> <FooterStyle ForeColor="#8C4510" BackColor="#F7DFB5"></FooterStyle> <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center"></PagerStyle> <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#A55129"></HeaderStyle> <Columns> <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true" /> <asp:TemplateField HeaderText="Division"> <ItemTemplate> <%# Eval("DivisionShortcut")%> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="DivisionsList" runat="server" DataSourceID="DivisionsListDataSource" DataTextField="DivisionShortcut" DataValueField="SapCode"></asp:DropDownList> </EditItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Username" HeaderText="Network ID" ReadOnly="True" SortExpression="Username" /> <asp:TemplateField HeaderText="Name"> <ItemTemplate> <%# Eval("Name")%> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtEmployeeName" runat="server" Text='<%# Bind("Name")%>' /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Job Title"> <ItemTemplate> <%# Eval("JobTitle")%> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtJobTitle" runat="server" Text='<%# Bind("JobTitle")%>' /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Badge No."> <ItemTemplate> <%# Eval("BadgeNo")%> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtBadgeNo" runat="server" Text='<%# Bind("BadgeNo")%>' /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Is Active?"> <ItemTemplate> <%# Eval("IsActive")%> </ItemTemplate> <EditItemTemplate> <asp:CheckBox ID="isActive" runat="server" Checked='<%# Eval("IsActive").ToString().Equals("True") %>'/> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Delete?"> <ItemTemplate> <span onclick="return confirm('Are you sure to Delete the record?')"> <asp:LinkButton ID="lnkB" runat="Server" Text="Delete" CommandName="Delete"></asp:LinkButton> </span> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:UsersInfoDBConnectionString %>" SelectCommand="SELECT dbo.Divisions.DivisionShortcut, dbo.employee.Username, dbo.employee.Name, dbo.employee.JobTitle, dbo.employee.BadgeNo, dbo.employee.IsActive FROM dbo.Divisions INNER JOIN dbo.employee ON dbo.Divisions.SapCode = dbo.employee.DivisionCode" UpdateCommand="UPDATE [employee], [Divisions] SET [Name] = @Name, [JobTitle] = @JobTitle, [BadgeNo] = @BadgeNo, [DivisionShortcut] = @division WHERE [Username] = @Username" DeleteCommand="DELETE FROM [employee] WHERE [Username] = @Username"> <UpdateParameters> <asp:Parameter Name="Name" Type="String" /> <asp:Parameter Name="JobTitle" Type="String" /> <asp:Parameter Name="BadgeNo" Type="String" /> <asp:Parameter Name="DivisionShortcut" Type="String" /> <asp:Parameter Name="Username" Type="String" /> </UpdateParameters> <DeleteParameters> <asp:Parameter Name="Username" Type="String" /> </DeleteParameters> </asp:SqlDataSource>
asp.net
sql
sql-server-2008-r2
null
null
null
open
Why this DropDownList is not updating inside this GridView? === I have the following database design: Employee Table: Username, Name, JobTitle, BadgeNo, IsActive, DivisionCode Divisions Table: SapCode, DivisionShortcut And I have a GridView that I am using it to add, delete and update/edit the employees information. This information is employee Username, Name, BadgeNo, JobTitle, IsActive and the DivisionShortcut. The Divisions will be listed in DropDownList. I wrote the code but I got the following error: ASP.NET Code: <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Username" DataSourceID="SqlDataSource1" BorderWidth="1px" BackColor="#DEBA84" CellPadding="3" CellSpacing="2" BorderStyle="None" BorderColor="#DEBA84" OnRowEditing="GridView1_RowEditing" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating"> <FooterStyle ForeColor="#8C4510" BackColor="#F7DFB5"></FooterStyle> <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center"></PagerStyle> <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#A55129"></HeaderStyle> <Columns> <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true" /> <asp:TemplateField HeaderText="Division"> <ItemTemplate> <%# Eval("DivisionShortcut")%> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="DivisionsList" runat="server" DataSourceID="DivisionsListDataSource" DataTextField="DivisionShortcut" DataValueField="SapCode"></asp:DropDownList> </EditItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Username" HeaderText="Network ID" ReadOnly="True" SortExpression="Username" /> <asp:TemplateField HeaderText="Name"> <ItemTemplate> <%# Eval("Name")%> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtEmployeeName" runat="server" Text='<%# Bind("Name")%>' /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Job Title"> <ItemTemplate> <%# Eval("JobTitle")%> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtJobTitle" runat="server" Text='<%# Bind("JobTitle")%>' /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Badge No."> <ItemTemplate> <%# Eval("BadgeNo")%> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtBadgeNo" runat="server" Text='<%# Bind("BadgeNo")%>' /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Is Active?"> <ItemTemplate> <%# Eval("IsActive")%> </ItemTemplate> <EditItemTemplate> <asp:CheckBox ID="isActive" runat="server" Checked='<%# Eval("IsActive").ToString().Equals("True") %>'/> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Delete?"> <ItemTemplate> <span onclick="return confirm('Are you sure to Delete the record?')"> <asp:LinkButton ID="lnkB" runat="Server" Text="Delete" CommandName="Delete"></asp:LinkButton> </span> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:UsersInfoDBConnectionString %>" SelectCommand="SELECT dbo.Divisions.DivisionShortcut, dbo.employee.Username, dbo.employee.Name, dbo.employee.JobTitle, dbo.employee.BadgeNo, dbo.employee.IsActive FROM dbo.Divisions INNER JOIN dbo.employee ON dbo.Divisions.SapCode = dbo.employee.DivisionCode" UpdateCommand="UPDATE [employee], [Divisions] SET [Name] = @Name, [JobTitle] = @JobTitle, [BadgeNo] = @BadgeNo, [DivisionShortcut] = @division WHERE [Username] = @Username" DeleteCommand="DELETE FROM [employee] WHERE [Username] = @Username"> <UpdateParameters> <asp:Parameter Name="Name" Type="String" /> <asp:Parameter Name="JobTitle" Type="String" /> <asp:Parameter Name="BadgeNo" Type="String" /> <asp:Parameter Name="DivisionShortcut" Type="String" /> <asp:Parameter Name="Username" Type="String" /> </UpdateParameters> <DeleteParameters> <asp:Parameter Name="Username" Type="String" /> </DeleteParameters> </asp:SqlDataSource>
0
11,410,952
07/10/2012 10:05:24
1,305,842
04/01/2012 03:48:16
13
1
How do I get Gnome-do or Ubuntu Dash to open an existing application?
I just upgraded to Ubuntu 12.04 and have also installed GNOME Do as a task launcher. If I already have a Firefox browser window open, and I use my hot key to open Gnome-do and type in Firefox + enter, it opens a whole new window instead of focusing on the window I already have open. I'm used to Mac OS X's Quicksilver where it focuses you back to the opened application if it exists already. Is that possible to replicate using GNOME Do or Ubuntu Dash?
gnome
ubuntu-12.04
quicksilver
null
null
null
open
How do I get Gnome-do or Ubuntu Dash to open an existing application? === I just upgraded to Ubuntu 12.04 and have also installed GNOME Do as a task launcher. If I already have a Firefox browser window open, and I use my hot key to open Gnome-do and type in Firefox + enter, it opens a whole new window instead of focusing on the window I already have open. I'm used to Mac OS X's Quicksilver where it focuses you back to the opened application if it exists already. Is that possible to replicate using GNOME Do or Ubuntu Dash?
0
11,734,594
07/31/2012 06:48:08
964,707
09/26/2011 09:00:52
425
35
Page not view in ipad
Hi i use the splitview page script in phonegap it not works fine,but loads on iphonesimulator, the same script i run in ipad. the page not shown it just blank. Why the code in the body tag run in iphonesimulator but not in ipad simulator. It shows only the h1 tag. My code as follows: <body onload="onBodyLoad()"> <h1> Its the Head! </h1> <div data-role="page" > <div data-role="content"> <ul data-role="listview" data-theme="c" data-dividertheme="a"> <li data-role="list-divider"><h1 style="font-size:22px;text-align:left;">Public Speaking</h1></li> <li data-role="list-divider">Topics</li> <li><a href="speaking-for-success.html" data-panel="main" rel="external">Speaking For Success</a> </li> <li><a href="need-to-get-started.html" data-panel="main" rel="external">Need to get Started</a></li> <li><a href="stage-fright.html" data-panel="main" rel="external">Stage Fright</a></li> <li><a href="building-your-confidence.html" data-panel="main" rel="external">Building your confidence</a></li> <li><a href="preparation-of-delivery.html" data-panel="main" rel="external">Preparation of delivery of Speech</a></li> <li><a href="pre-presentation-analysis.html" data-panel="main" rel="external">Pre - Presentation Analysis </a></li> <li><a href="body-language-and-gestures.html" data-panel="main" rel="external">Body Language and Gestures</a></li> <li><a href="impomptu.html" data-panel="main" rel="external">Impomptu or Extempore Speech</a></li> <li><a href="practise-ideas.html" data-panel="main" rel="external">Practice Ideas</a></li> <li><a href="post-presentation-analysis.html" rel="external">Post - Presentation Analysis</a></li> <li><a href="final-reminders.html" data-panel="main" rel="external">Final Reminders</a></li> </ul> </div> <!-- /content --> <div data-role="footer" data-position="fixed" > <div data-role="group" class="footnav" style="text-align:center; padding-top:5px;"> <a href="index.html" data-panel="main" rel="external"><img src="images/homebtn.png"></a> <a href="" class="togglemenu"><img src="images/menubtn.png"></a> </div> </div> <!-- /page --> </div> </body>
jquery
ios
phonegap
null
null
null
open
Page not view in ipad === Hi i use the splitview page script in phonegap it not works fine,but loads on iphonesimulator, the same script i run in ipad. the page not shown it just blank. Why the code in the body tag run in iphonesimulator but not in ipad simulator. It shows only the h1 tag. My code as follows: <body onload="onBodyLoad()"> <h1> Its the Head! </h1> <div data-role="page" > <div data-role="content"> <ul data-role="listview" data-theme="c" data-dividertheme="a"> <li data-role="list-divider"><h1 style="font-size:22px;text-align:left;">Public Speaking</h1></li> <li data-role="list-divider">Topics</li> <li><a href="speaking-for-success.html" data-panel="main" rel="external">Speaking For Success</a> </li> <li><a href="need-to-get-started.html" data-panel="main" rel="external">Need to get Started</a></li> <li><a href="stage-fright.html" data-panel="main" rel="external">Stage Fright</a></li> <li><a href="building-your-confidence.html" data-panel="main" rel="external">Building your confidence</a></li> <li><a href="preparation-of-delivery.html" data-panel="main" rel="external">Preparation of delivery of Speech</a></li> <li><a href="pre-presentation-analysis.html" data-panel="main" rel="external">Pre - Presentation Analysis </a></li> <li><a href="body-language-and-gestures.html" data-panel="main" rel="external">Body Language and Gestures</a></li> <li><a href="impomptu.html" data-panel="main" rel="external">Impomptu or Extempore Speech</a></li> <li><a href="practise-ideas.html" data-panel="main" rel="external">Practice Ideas</a></li> <li><a href="post-presentation-analysis.html" rel="external">Post - Presentation Analysis</a></li> <li><a href="final-reminders.html" data-panel="main" rel="external">Final Reminders</a></li> </ul> </div> <!-- /content --> <div data-role="footer" data-position="fixed" > <div data-role="group" class="footnav" style="text-align:center; padding-top:5px;"> <a href="index.html" data-panel="main" rel="external"><img src="images/homebtn.png"></a> <a href="" class="togglemenu"><img src="images/menubtn.png"></a> </div> </div> <!-- /page --> </div> </body>
0
11,734,595
07/31/2012 06:48:11
1,234,721
02/27/2012 03:13:16
177
2
JS URL persistence to create templates
I have an interactive UI of elements, and I was encouraged to use divs and spans exclusively, and avoid checkboxes. I have converted the site over to the same functionality, but don't know much about persistence to begin with, but with checkboxes, it seemed approachable given the idea of being 'checked' or 'not checked'. How would I begin to use this approach with tracking each element's visibility? [Here][1] is the page I am trying to implement persistence on. Previous implementation (not my code, as I am new to JS and persistence) used the following: // Persistence //¿¿?? var formvals = {}; var keyval = location.search.replace('?', '').split('&'); $.each(keyval, function () { var splitval = this.split('='); formvals[splitval[0]] = splitval[1]; }); $.each($('form')[0].elements, function () { var key = $(this).attr('name'); if (key && formvals[key]) { $('#' + key).val(formvals[key]); } else { if ($(this).attr('type') == 'checkbox') { $('#'+key)[0].checked = false; } } }); I would like to know how to use the visibility of the elements to help develop different templates. I can't find any intros into URL persistence, and Im not quite sure what the previous code does, so any explanation or guidance is greatly appreciated. If you need more information, please ask, and hopefully you can help send me down the right path. [1]: http://specialorange.org/resume
javascript
jquery
persistence
null
null
null
open
JS URL persistence to create templates === I have an interactive UI of elements, and I was encouraged to use divs and spans exclusively, and avoid checkboxes. I have converted the site over to the same functionality, but don't know much about persistence to begin with, but with checkboxes, it seemed approachable given the idea of being 'checked' or 'not checked'. How would I begin to use this approach with tracking each element's visibility? [Here][1] is the page I am trying to implement persistence on. Previous implementation (not my code, as I am new to JS and persistence) used the following: // Persistence //¿¿?? var formvals = {}; var keyval = location.search.replace('?', '').split('&'); $.each(keyval, function () { var splitval = this.split('='); formvals[splitval[0]] = splitval[1]; }); $.each($('form')[0].elements, function () { var key = $(this).attr('name'); if (key && formvals[key]) { $('#' + key).val(formvals[key]); } else { if ($(this).attr('type') == 'checkbox') { $('#'+key)[0].checked = false; } } }); I would like to know how to use the visibility of the elements to help develop different templates. I can't find any intros into URL persistence, and Im not quite sure what the previous code does, so any explanation or guidance is greatly appreciated. If you need more information, please ask, and hopefully you can help send me down the right path. [1]: http://specialorange.org/resume
0
11,734,596
07/31/2012 06:48:12
1,505,752
07/06/2012 04:42:55
18
0
Multi replacement in the same node with XSLT
I would like to get the output like below using XSLT "analyze-string" <w:body> <w:p> <w:pPr> <w:pStyle w:val="paragraph"/> </w:pPr> <w:r><w:t>1274394 The milk costs , $1.99 [12] test Figure 1</w:t></w:r> </w:p> <w:p> <w:pPr> <w:pStyle w:val="paragraph"/> </w:pPr> <w:r><w:t>sample text Figure 1 and [1]</w:t></w:r> </w:p> </w:body> The XSLT is below: <xsl:stylesheet version="2.0" xmlns:xsl=http://www.w3.org/1999/XSL/Transform xmlns:fn=http://www.w3.org/2005/xpath-functions xmlns:w="www" exclude-result-prefixes='xsl fn'> <xsl:output method="xml" indent="yes"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="w:t/text()"> <xsl:variable name="phase1"> <xsl:apply-templates select="." mode="fig" /> </xsl:variable> <xsl:variable name="phase2"> <xsl:apply-templates select="." mode="tab" /> </xsl:variable> <xsl:apply-templates select="$phase1" mode="ref" /> </xsl:template> <xsl:template match="text()" mode="fig"> <xsl:analyze-string select="." regex="Figure (\d{{1,2}})"> <xsl:matching-substring> <fig> <xsl:value-of select="." /> </fig> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="." /> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> <xsl:template match="text()" mode="ref"> <xsl:analyze-string select="." regex="\[(\d{{1,2}})\]"> <xsl:matching-substring> <ref> <xsl:value-of select="." /> </ref> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="." /> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> <xsl:template match="text()" mode="tab"> <xsl:analyze-string select="." regex="Table (\d{{1,2}})"> <xsl:matching-substring> <tab> <xsl:value-of select="." /> </tab> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="." /> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> <xsl:template match="@*|*|comment()|processing-instruction()" mode="ref"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="ref"/> </xsl:copy> </xsl:template> </xsl:stylesheet> Using above XSLT I could replace Fig and ref, to replace table I am using Phase2 variable but I'm not getting output, is there any alternate way to do this?
xslt
xslt-1.0
null
null
null
null
open
Multi replacement in the same node with XSLT === I would like to get the output like below using XSLT "analyze-string" <w:body> <w:p> <w:pPr> <w:pStyle w:val="paragraph"/> </w:pPr> <w:r><w:t>1274394 The milk costs , $1.99 [12] test Figure 1</w:t></w:r> </w:p> <w:p> <w:pPr> <w:pStyle w:val="paragraph"/> </w:pPr> <w:r><w:t>sample text Figure 1 and [1]</w:t></w:r> </w:p> </w:body> The XSLT is below: <xsl:stylesheet version="2.0" xmlns:xsl=http://www.w3.org/1999/XSL/Transform xmlns:fn=http://www.w3.org/2005/xpath-functions xmlns:w="www" exclude-result-prefixes='xsl fn'> <xsl:output method="xml" indent="yes"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="w:t/text()"> <xsl:variable name="phase1"> <xsl:apply-templates select="." mode="fig" /> </xsl:variable> <xsl:variable name="phase2"> <xsl:apply-templates select="." mode="tab" /> </xsl:variable> <xsl:apply-templates select="$phase1" mode="ref" /> </xsl:template> <xsl:template match="text()" mode="fig"> <xsl:analyze-string select="." regex="Figure (\d{{1,2}})"> <xsl:matching-substring> <fig> <xsl:value-of select="." /> </fig> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="." /> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> <xsl:template match="text()" mode="ref"> <xsl:analyze-string select="." regex="\[(\d{{1,2}})\]"> <xsl:matching-substring> <ref> <xsl:value-of select="." /> </ref> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="." /> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> <xsl:template match="text()" mode="tab"> <xsl:analyze-string select="." regex="Table (\d{{1,2}})"> <xsl:matching-substring> <tab> <xsl:value-of select="." /> </tab> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="." /> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> <xsl:template match="@*|*|comment()|processing-instruction()" mode="ref"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="ref"/> </xsl:copy> </xsl:template> </xsl:stylesheet> Using above XSLT I could replace Fig and ref, to replace table I am using Phase2 variable but I'm not getting output, is there any alternate way to do this?
0
11,734,600
07/31/2012 06:48:22
1,450,921
06/12/2012 10:06:52
51
1
issue to configure smtp mail server
I am using Ubunt Server. But there mail server is not configured out. From command prompt how can I configure this? Please help me. I am the frst time trying to do so.
email
configuration
smtp
null
null
null
open
issue to configure smtp mail server === I am using Ubunt Server. But there mail server is not configured out. From command prompt how can I configure this? Please help me. I am the frst time trying to do so.
0
11,734,607
07/31/2012 06:48:39
622,606
02/18/2011 05:19:19
446
17
When are ParameterInfo.IsLcid or ParameterInfo.IsRetval true?
I find this question in Stack Overflow when googleing, but it has been deleted. So I list this question again. As I can't find the `LcidAttribute` or `RetvalAttribute` in BCL, I guess C# hasn't provided the support for locale identifier parameter and return value parameter. Is that it? Thanks all.
c#
reflection
null
null
null
null
open
When are ParameterInfo.IsLcid or ParameterInfo.IsRetval true? === I find this question in Stack Overflow when googleing, but it has been deleted. So I list this question again. As I can't find the `LcidAttribute` or `RetvalAttribute` in BCL, I guess C# hasn't provided the support for locale identifier parameter and return value parameter. Is that it? Thanks all.
0
11,734,609
07/31/2012 06:48:48
1,564,902
07/31/2012 06:44:01
1
0
How to hide div slowly using jquery with exploting effect
I am New in programing Please help Me to hide div slowly using jquery with exploting effect
jquery
null
null
null
null
null
open
How to hide div slowly using jquery with exploting effect === I am New in programing Please help Me to hide div slowly using jquery with exploting effect
0
11,734,612
07/31/2012 06:48:59
886,241
08/09/2011 15:18:36
1
0
Overriding Right click in a browser
I am new to web development, As part of my project requirement I need to implement a customized right click behaviour in an Internet browser. Kindly advice me with the methods to implement it and make it browser independent. Thanks
user-interface
web
null
null
null
null
open
Overriding Right click in a browser === I am new to web development, As part of my project requirement I need to implement a customized right click behaviour in an Internet browser. Kindly advice me with the methods to implement it and make it browser independent. Thanks
0
11,734,613
07/31/2012 06:49:06
118,584
06/06/2009 16:11:16
1,981
34
Deep copy of List<T> with extension method
I have this class : public class Person : ICloneable { public string FirstName { get; set; } public string LastName { get; set; } public object Clone() { return this; } } An extension method : public static class MyHelper { public static IEnumerable<T> Clone<T>(this IEnumerable<T> collection) where T : ICloneable { return collection.Select(item => (T)item.Clone()); } } I'd like use it in this case : var myList = new List<Person>{ new Person { FirstName = "Dana", LastName = "Scully" }, new Person{ FirstName = "Fox", LastName = "Mulder" } }; List<Person> myCopy = myList.Clone().ToList<Person>(); When I change in the "immediat window" a value of `myCopy`, there is a change in the orginial list too. I'd like have both list completely independent I missed something ?
c#
extension-methods
clone
null
null
null
open
Deep copy of List<T> with extension method === I have this class : public class Person : ICloneable { public string FirstName { get; set; } public string LastName { get; set; } public object Clone() { return this; } } An extension method : public static class MyHelper { public static IEnumerable<T> Clone<T>(this IEnumerable<T> collection) where T : ICloneable { return collection.Select(item => (T)item.Clone()); } } I'd like use it in this case : var myList = new List<Person>{ new Person { FirstName = "Dana", LastName = "Scully" }, new Person{ FirstName = "Fox", LastName = "Mulder" } }; List<Person> myCopy = myList.Clone().ToList<Person>(); When I change in the "immediat window" a value of `myCopy`, there is a change in the orginial list too. I'd like have both list completely independent I missed something ?
0
11,734,614
07/31/2012 06:49:06
1,394,953
05/15/2012 00:54:37
81
0
Entity Framework return no value
Trying to select value from a empty records: var id = (from transactions in testTransactions.Transactions orderby transactions.TransID descending select transactions.TransID).First(); How can I give a default value then the table is empty. Thnak you.
c#
entity-framework-4
null
null
null
null
open
Entity Framework return no value === Trying to select value from a empty records: var id = (from transactions in testTransactions.Transactions orderby transactions.TransID descending select transactions.TransID).First(); How can I give a default value then the table is empty. Thnak you.
0
11,734,615
07/31/2012 06:49:09
1,222,588
02/21/2012 05:01:33
10
1
find the pattern in java
I need to find the method to find the following pattern is in the given string or what. `#8226:`. Here numbers can be anything, that should be start with #, end with : and should contains 4 numbers(4 digits).
java
null
null
null
null
07/31/2012 13:02:26
not a real question
find the pattern in java === I need to find the method to find the following pattern is in the given string or what. `#8226:`. Here numbers can be anything, that should be start with #, end with : and should contains 4 numbers(4 digits).
1
11,734,619
07/31/2012 06:49:22
1,425,511
05/30/2012 08:14:50
81
0
opendir() in FUSE
In the implemention of `xxx_readdir()` in **FUSE**, I use the codes below: static int hello_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) { DIR *dp; struct dirent *de; (void) offset; (void) fi; dp = opendir(path); if (dp == NULL) return -errno; while ((de = readdir(dp)) != NULL) { struct stat st; memset(&st, 0, sizeof(st)); st.st_ino = de->d_ino; st.st_mode = de->d_type << 12; if (filler(buf, de->d_name, &st, 0)) break; } closedir(dp); return 0; } Then, compile and execute on a foler: ./hello /tmp/hello/ When I use `ls /tmp/hello/` command, the results are as below: bin dev home lib64 media opt root sbin sys usr boot etc lib lost+found mnt proc run srv tmp var However, I have not created any file or directory in `/tmp/hello/`. So, why are these direcoties reside on it when I use the `ls` command?
fuse
null
null
null
null
null
open
opendir() in FUSE === In the implemention of `xxx_readdir()` in **FUSE**, I use the codes below: static int hello_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) { DIR *dp; struct dirent *de; (void) offset; (void) fi; dp = opendir(path); if (dp == NULL) return -errno; while ((de = readdir(dp)) != NULL) { struct stat st; memset(&st, 0, sizeof(st)); st.st_ino = de->d_ino; st.st_mode = de->d_type << 12; if (filler(buf, de->d_name, &st, 0)) break; } closedir(dp); return 0; } Then, compile and execute on a foler: ./hello /tmp/hello/ When I use `ls /tmp/hello/` command, the results are as below: bin dev home lib64 media opt root sbin sys usr boot etc lib lost+found mnt proc run srv tmp var However, I have not created any file or directory in `/tmp/hello/`. So, why are these direcoties reside on it when I use the `ls` command?
0
11,500,053
07/16/2012 07:46:29
1,474,923
06/22/2012 13:17:17
1
0
How to run 2 different processes with python at the same time?
I have a looping script , to get infos on a french site. It looks like this : def getInfos(a,b,c) def MyLoop(filename) in which i call getinfos via def MyLoop(filename) values = getInfos() And It works well. But sometimes, the script slows down and finally stops. So i tried several modules with different ideas in mind. The first module ; Signal. But interesting functions are not avalaible on windows. However, i tried to stimulate execution when it's frozen: def reboot(signal, frame): print '??FROZEN??' time.sleep(1) #sys.exit(0) signal.signal(signal.SIGINT, reboot) As you can see i tried sys.exit(0), but too abrupt, and i'm not sur of what's really done. Anyway... after a two-hour loop, i get no answer with this transformed "keyboard interrupt" function. Then i tried to limit execution time. So i found : Multiprocessing, pp, signal (~5%avalaibleOnWindows). The first one opened 30 or 40 other brackgrounded python processes. The second one, pp, do not allow to paralelize two differents function. No it does ? Do you have something that could work for me ? or at least, something i can try, to figure me out where the first step is ?
python
performance
null
null
null
null
open
How to run 2 different processes with python at the same time? === I have a looping script , to get infos on a french site. It looks like this : def getInfos(a,b,c) def MyLoop(filename) in which i call getinfos via def MyLoop(filename) values = getInfos() And It works well. But sometimes, the script slows down and finally stops. So i tried several modules with different ideas in mind. The first module ; Signal. But interesting functions are not avalaible on windows. However, i tried to stimulate execution when it's frozen: def reboot(signal, frame): print '??FROZEN??' time.sleep(1) #sys.exit(0) signal.signal(signal.SIGINT, reboot) As you can see i tried sys.exit(0), but too abrupt, and i'm not sur of what's really done. Anyway... after a two-hour loop, i get no answer with this transformed "keyboard interrupt" function. Then i tried to limit execution time. So i found : Multiprocessing, pp, signal (~5%avalaibleOnWindows). The first one opened 30 or 40 other brackgrounded python processes. The second one, pp, do not allow to paralelize two differents function. No it does ? Do you have something that could work for me ? or at least, something i can try, to figure me out where the first step is ?
0
11,500,059
07/16/2012 07:46:41
867,889
07/28/2011 16:15:30
185
10
Is it possible to combine EF CF and Asp.net basic administration?
We have no time for administration implementation so we are going to use basic administration tools for our Asp.Net MVC site. On the other side we would like to use EF CF for our business logic. So, do you have any suggestions how it can be done? Or may be you know the way how it can be done better? It is a small project and even an "ugly" solution can help. All we need is to write application as fast as possible.
asp.net
asp.net-mvc
entity-framework-4.1
ef-code-first
null
null
open
Is it possible to combine EF CF and Asp.net basic administration? === We have no time for administration implementation so we are going to use basic administration tools for our Asp.Net MVC site. On the other side we would like to use EF CF for our business logic. So, do you have any suggestions how it can be done? Or may be you know the way how it can be done better? It is a small project and even an "ugly" solution can help. All we need is to write application as fast as possible.
0
11,500,062
07/16/2012 07:46:56
1,260,702
03/10/2012 07:10:54
126
22
How to install jdk with yum on Fedora 17?
I want to install jdk by yum on Federa 17 and using : su -c 'yum install java-1.6.0-openjdk' But it show "no available package". How can I do to install it ?
linux
jdk
fedora
yum
null
07/17/2012 21:06:23
off topic
How to install jdk with yum on Fedora 17? === I want to install jdk by yum on Federa 17 and using : su -c 'yum install java-1.6.0-openjdk' But it show "no available package". How can I do to install it ?
2
11,500,035
07/16/2012 07:45:12
1,510,869
07/09/2012 02:25:45
127
0
Getting 'CG\Proxy\InterceptorLoaderInterface' error with JMS Bundle in symfony 2
I am trying to install symfony2 JMS DI Extra bundle. But i keep getting this error > Fatal error: Interface 'CG\Proxy\InterceptorLoaderInterface' not found > in > /home/xxxxx/public_html/XXXX/Symfony/vendor/bundles/JMS/AopBundle/Aop/InterceptorLoader.php > on line 30 I have found the solution here https://github.com/schmittjoh/JMSAopBundle/issues/7 But could not able to understand where to fix the path
php
symfony-2.0
bundle
null
null
null
open
Getting 'CG\Proxy\InterceptorLoaderInterface' error with JMS Bundle in symfony 2 === I am trying to install symfony2 JMS DI Extra bundle. But i keep getting this error > Fatal error: Interface 'CG\Proxy\InterceptorLoaderInterface' not found > in > /home/xxxxx/public_html/XXXX/Symfony/vendor/bundles/JMS/AopBundle/Aop/InterceptorLoader.php > on line 30 I have found the solution here https://github.com/schmittjoh/JMSAopBundle/issues/7 But could not able to understand where to fix the path
0
11,500,070
07/16/2012 07:47:48
145,567
07/27/2009 07:10:18
2,143
64
Ruby - functional approach to filtering with index
I have an array like this: ["A", " ", "C", " ", "E", " ", "G"] and I want to return an array of all the indexes where the data is a blank space say. Is there a nice functional way to do this? I know there is an `each_with_index` method returning an `Enumerable`, but I couldn't figure out how to wield it with a filter.
ruby
functional-programming
null
null
null
null
open
Ruby - functional approach to filtering with index === I have an array like this: ["A", " ", "C", " ", "E", " ", "G"] and I want to return an array of all the indexes where the data is a blank space say. Is there a nice functional way to do this? I know there is an `each_with_index` method returning an `Enumerable`, but I couldn't figure out how to wield it with a filter.
0
11,500,071
07/16/2012 07:47:51
1,310,478
04/03/2012 12:58:42
151
6
how to get the activity to wait before jumping to the next activity on its own in android?
I want to create an activity that opens when i start my app, wait some time and jumps to the next activity without the user pressing anything. thats my code: public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Thread thread = new Thread(); thread.start(); } public class waitSeconds extends Thread { public void run() { Log.i("MyActivity", "MyClass"); try { wait(300); Intent intent = new Intent(MainActivity.this, main_window.class); startActivity(intent); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } as it seems its never going to the "run" method. can someone please help me do this simple thing? Thanks!
android
multithreading
wait
null
null
null
open
how to get the activity to wait before jumping to the next activity on its own in android? === I want to create an activity that opens when i start my app, wait some time and jumps to the next activity without the user pressing anything. thats my code: public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Thread thread = new Thread(); thread.start(); } public class waitSeconds extends Thread { public void run() { Log.i("MyActivity", "MyClass"); try { wait(300); Intent intent = new Intent(MainActivity.this, main_window.class); startActivity(intent); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } as it seems its never going to the "run" method. can someone please help me do this simple thing? Thanks!
0
11,500,076
07/16/2012 07:48:06
1,206,968
02/13/2012 14:07:07
155
18
Prevent calling a web service too many times
I provide a Web Service for my clients which allow him to add a record to the production database. I had an incident lately, in which my client's programmer called the service in a loop , iterated to call to my service thousands of times. My question is what would be the best way to prevent such a thing. I thought of some ways: 1.At the entrence to the service, I can update counters for each client that call the service, but that looks too clumbsy. 2.Check the IP of the client who called this service, and raise a flag each time he/she calls the service, and then reset the flag every hour. I'm positive that there are better ways and would appriciate any suggestions. Thanks, David
c#
asp.net
web-services
null
null
null
open
Prevent calling a web service too many times === I provide a Web Service for my clients which allow him to add a record to the production database. I had an incident lately, in which my client's programmer called the service in a loop , iterated to call to my service thousands of times. My question is what would be the best way to prevent such a thing. I thought of some ways: 1.At the entrence to the service, I can update counters for each client that call the service, but that looks too clumbsy. 2.Check the IP of the client who called this service, and raise a flag each time he/she calls the service, and then reset the flag every hour. I'm positive that there are better ways and would appriciate any suggestions. Thanks, David
0
11,350,691
07/05/2012 18:52:33
586,006
01/22/2011 23:03:24
189
12
javascript crashing iPad browser
I have some javascript inside a function that creates and populates an image carousel. It works fine after activating it in a pop up window the first 5 or 6 times, but then it eventually crashes the browser. I think there's some kind of leak, like something inside of it needs to be deleted before it gets created again. I know it's the carousel because if I get rid of that part of the script, it no longer crashes. Here's the carousel script: /* carousel */ var carousel, el, i, page, slides; carousel = new SwipeView('#wrapper', { numberOfPages: slides.length, hastyPageFlip: true }); // Load initial data for (i=0; i<3; i++) { page = i==0 ? slides.length-1 : i-1; el = document.createElement('span'); el.innerHTML = slides[page]; carousel.masterPages[i].appendChild(el) } carousel.onFlip(function () { var el, upcoming, i; for (i=0; i<3; i++) { upcoming = carousel.masterPages[i].dataset.upcomingPageIndex; if (upcoming != carousel.masterPages[i].dataset.pageIndex) { el = carousel.masterPages[i].querySelector('span'); el.innerHTML = slides[upcoming]; } } }); This script runs every time I click a link that launches a floating window.
javascript
ipad
crash
carousel
null
null
open
javascript crashing iPad browser === I have some javascript inside a function that creates and populates an image carousel. It works fine after activating it in a pop up window the first 5 or 6 times, but then it eventually crashes the browser. I think there's some kind of leak, like something inside of it needs to be deleted before it gets created again. I know it's the carousel because if I get rid of that part of the script, it no longer crashes. Here's the carousel script: /* carousel */ var carousel, el, i, page, slides; carousel = new SwipeView('#wrapper', { numberOfPages: slides.length, hastyPageFlip: true }); // Load initial data for (i=0; i<3; i++) { page = i==0 ? slides.length-1 : i-1; el = document.createElement('span'); el.innerHTML = slides[page]; carousel.masterPages[i].appendChild(el) } carousel.onFlip(function () { var el, upcoming, i; for (i=0; i<3; i++) { upcoming = carousel.masterPages[i].dataset.upcomingPageIndex; if (upcoming != carousel.masterPages[i].dataset.pageIndex) { el = carousel.masterPages[i].querySelector('span'); el.innerHTML = slides[upcoming]; } } }); This script runs every time I click a link that launches a floating window.
0
11,350,692
07/05/2012 18:52:33
993,266
10/13/2011 10:46:32
1,483
89
'android' not recognized as an
I'm trying to get the new GCM service to work for me, so I've been following the demo as described here: http://developer.android.com/guide/google/gcm/demo.html So far, everything works well. However, I'm supposed to build the `ant` files using the command line now, and that's where things stop working. For some reason, this command `$ android update project --name GCMDemo -p . --target android-16` gives me a very nice 'android' is not recognized as an internal or external command, operable program or batch file. Normally this can be fixed easily with a quick Google search, but I haven't found a single other user with this problem. Could someone tell me what the problem is? My educated guess is that I need to add the Android tools folder to my `PATH`, but I'd rather be sure first.
android
command-line
null
null
null
null
open
'android' not recognized as an === I'm trying to get the new GCM service to work for me, so I've been following the demo as described here: http://developer.android.com/guide/google/gcm/demo.html So far, everything works well. However, I'm supposed to build the `ant` files using the command line now, and that's where things stop working. For some reason, this command `$ android update project --name GCMDemo -p . --target android-16` gives me a very nice 'android' is not recognized as an internal or external command, operable program or batch file. Normally this can be fixed easily with a quick Google search, but I haven't found a single other user with this problem. Could someone tell me what the problem is? My educated guess is that I need to add the Android tools folder to my `PATH`, but I'd rather be sure first.
0
11,350,694
07/05/2012 18:52:48
738,737
05/04/2011 20:12:15
342
11
Error while using -N option with qsub
I tried to use `qsub -N "compile-$*"` in Makefile and it gives the following error because $* equals to "compile-obj/linux/flow" in this case. qsub: ERROR! argument to -N option must not contain / The whole command which I am using is:- qsub -P bnormal -N "compile-obj/linux/flow" -cwd -now no -b y -l cputype=amd64 -sync yes -S /bin/sh -e /remote//qsub_files/ -o /remote/qsub_files/ Any idea how to include slash in naming while running qsub? Thanks
linux
qsub
sungridengine
null
null
null
open
Error while using -N option with qsub === I tried to use `qsub -N "compile-$*"` in Makefile and it gives the following error because $* equals to "compile-obj/linux/flow" in this case. qsub: ERROR! argument to -N option must not contain / The whole command which I am using is:- qsub -P bnormal -N "compile-obj/linux/flow" -cwd -now no -b y -l cputype=amd64 -sync yes -S /bin/sh -e /remote//qsub_files/ -o /remote/qsub_files/ Any idea how to include slash in naming while running qsub? Thanks
0
11,350,695
07/05/2012 18:52:51
537,235
05/31/2010 16:41:26
1
1
Micro Cloud Foundry offline mode
during the last week I spent all my time trying to access the MCF in offline mode. I'm working behind a company network (proxy) and the MCF try to do things that conflict with the local network. I've followed several different tutorials such as [1. Working offline with MCF][1] and [2. Working offline with MCF][2]. But the result keeps the same, even if I change all sort of configuration on my ubuntu. **Trying to set up the target.** vm target http: //api.mycloud.me HTTP exception: Errno::ECONNREFUSED:Connection refused - connect(2) **The MCF console show the following information:** Identity: mycloud.me (ok) Admin: [email protected] IP address 10.0.x.x (network up / offline) **When I ping to the IP address, I got positive return.** PING 10.0.x.x (10.0.x.x) 56(84) bytes of data. 64 bytes from 10.0.x.x: icmp_req=1 ttl=62 time=1.06 ms 64 bytes from 10.0.x.x: icmp_req=2 ttl=62 time=0.896 ms 64 bytes from 10.0.x.x: icmp_req=3 ttl=62 time=0.880 ms --- 10.0.2.15 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2000ms rtt min/avg/max/mdev = 0.880/0.948/1.069/0.089 ms But if I try to do a telnet to the port 80 or a ssh I got connection refused error. **ssh: connect to host mycloud.local port 22: Connection refused** I don't know what I need to do to fix this, if anyone have a tip that help me to figure out a solution, I'll be very thankful. Cheers! [1]: http://docs.cloudfoundry.com/infrastructure/micro/using-mcf.html#working-offline-with-micro-cloud-foundry [2]: http://blog.cloudfoundry.com/2011/09/08/working-offline-with-micro-cloud-foundry/
cloudfoundry
null
null
null
null
null
open
Micro Cloud Foundry offline mode === during the last week I spent all my time trying to access the MCF in offline mode. I'm working behind a company network (proxy) and the MCF try to do things that conflict with the local network. I've followed several different tutorials such as [1. Working offline with MCF][1] and [2. Working offline with MCF][2]. But the result keeps the same, even if I change all sort of configuration on my ubuntu. **Trying to set up the target.** vm target http: //api.mycloud.me HTTP exception: Errno::ECONNREFUSED:Connection refused - connect(2) **The MCF console show the following information:** Identity: mycloud.me (ok) Admin: [email protected] IP address 10.0.x.x (network up / offline) **When I ping to the IP address, I got positive return.** PING 10.0.x.x (10.0.x.x) 56(84) bytes of data. 64 bytes from 10.0.x.x: icmp_req=1 ttl=62 time=1.06 ms 64 bytes from 10.0.x.x: icmp_req=2 ttl=62 time=0.896 ms 64 bytes from 10.0.x.x: icmp_req=3 ttl=62 time=0.880 ms --- 10.0.2.15 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2000ms rtt min/avg/max/mdev = 0.880/0.948/1.069/0.089 ms But if I try to do a telnet to the port 80 or a ssh I got connection refused error. **ssh: connect to host mycloud.local port 22: Connection refused** I don't know what I need to do to fix this, if anyone have a tip that help me to figure out a solution, I'll be very thankful. Cheers! [1]: http://docs.cloudfoundry.com/infrastructure/micro/using-mcf.html#working-offline-with-micro-cloud-foundry [2]: http://blog.cloudfoundry.com/2011/09/08/working-offline-with-micro-cloud-foundry/
0
11,350,696
07/05/2012 18:52:52
1,192,861
02/06/2012 17:18:58
53
2
JQuery calls function that shouldn't be called onclick?
Have a look at this JSFiddle: http://jsfiddle.net/kZ3Af/25/ I have the base navigation pinned down nicely. However when I try to click any of the navigation items, the whole menu dissapears? What's that about?
javascript
jquery
html
css
navigation
null
open
JQuery calls function that shouldn't be called onclick? === Have a look at this JSFiddle: http://jsfiddle.net/kZ3Af/25/ I have the base navigation pinned down nicely. However when I try to click any of the navigation items, the whole menu dissapears? What's that about?
0
11,350,698
07/05/2012 18:52:59
999,337
10/17/2011 14:21:41
90
12
Implementing the strategy pattern. Do I have to 'new up' everytime?
I am trying to implement the strategy pattern. Here is part of my implementation: public List<string> GetOrderedEmployeeNames(IOrderByStrategy strategy) { return GetEmployeeFullNames().OrderBy(strategy.Order); } now every time I call this function I have to write: var employees = GetOrderedEmployeeNames(new OrderByFamilyName()); Is 'new-ing up' the strategy every time the right way or am I implementing this incorrectly?
c#
strategy-pattern
null
null
null
null
open
Implementing the strategy pattern. Do I have to 'new up' everytime? === I am trying to implement the strategy pattern. Here is part of my implementation: public List<string> GetOrderedEmployeeNames(IOrderByStrategy strategy) { return GetEmployeeFullNames().OrderBy(strategy.Order); } now every time I call this function I have to write: var employees = GetOrderedEmployeeNames(new OrderByFamilyName()); Is 'new-ing up' the strategy every time the right way or am I implementing this incorrectly?
0
10,111,070
04/11/2012 17:37:11
436,791
09/01/2010 09:22:49
6
0
How can I get "Use packet data" Settings in ICS Android
I am developing an application which does some downloading depends on whether the user has enabled the option in Settings-> Wireless and network-> Mobile networks -> Use packet data. I need to check the user has enabled this options. Please help me to find out how can i get this settings. For eg to check the roaming mode I use., import android.provider.Settings.Secure; String android_id = Secure.getString(getContentResolver(), Secure.DATA_ROAMING); Thanks in advance Deepu
android
null
null
null
null
null
open
How can I get "Use packet data" Settings in ICS Android === I am developing an application which does some downloading depends on whether the user has enabled the option in Settings-> Wireless and network-> Mobile networks -> Use packet data. I need to check the user has enabled this options. Please help me to find out how can i get this settings. For eg to check the roaming mode I use., import android.provider.Settings.Secure; String android_id = Secure.getString(getContentResolver(), Secure.DATA_ROAMING); Thanks in advance Deepu
0
11,350,706
07/05/2012 18:53:38
1,281,598
03/20/2012 17:35:04
26
0
What annotations do I use for embedded Ids?
I want to take three pojos that I have and use Hibernate's ability to generate tables in my database that match them. The classes are Movie, Rater, and Rating. Here is Movie. Rater is practically the same thing as it also has a list of Ratings connected to it. public class Movie{ @Id @GeneratedValue(generator = "IdGenerator", strategy = Generation Type.TABLE) @TableGenerator(name = "IdGenerator", pkColumnValue = "movieId") private long id; private String name; @OneToMany(mappedBy = "id.rater") private List<Rating> ratings; } Rating is much different. I am using an EmbeddedId. Here is what I have so far. public class Rating{ @Embeddable public static class RatingId { @ManyToOne @JoinColumn(name = "movieId") private Movie movie; @ManyToOne @JoinColumn(name = "raterId") private Rater rater; } @EmbeddedId private RatingId id; private String comment; private int rating; } So I ask this: What special annotation is required for using this embedded id setup? Also, which is the proper keyword for the hbm2ddl value? It would appear that I want to use the "create" value, but reading more on it says that it will cause Hibernate to empty the pre-existing table. Did I read that right? Thanks.
hibernate
hbm2ddl
null
null
null
null
open
What annotations do I use for embedded Ids? === I want to take three pojos that I have and use Hibernate's ability to generate tables in my database that match them. The classes are Movie, Rater, and Rating. Here is Movie. Rater is practically the same thing as it also has a list of Ratings connected to it. public class Movie{ @Id @GeneratedValue(generator = "IdGenerator", strategy = Generation Type.TABLE) @TableGenerator(name = "IdGenerator", pkColumnValue = "movieId") private long id; private String name; @OneToMany(mappedBy = "id.rater") private List<Rating> ratings; } Rating is much different. I am using an EmbeddedId. Here is what I have so far. public class Rating{ @Embeddable public static class RatingId { @ManyToOne @JoinColumn(name = "movieId") private Movie movie; @ManyToOne @JoinColumn(name = "raterId") private Rater rater; } @EmbeddedId private RatingId id; private String comment; private int rating; } So I ask this: What special annotation is required for using this embedded id setup? Also, which is the proper keyword for the hbm2ddl value? It would appear that I want to use the "create" value, but reading more on it says that it will cause Hibernate to empty the pre-existing table. Did I read that right? Thanks.
0
11,693,256
07/27/2012 18:05:06
607,079
02/07/2011 20:36:35
235
0
How to make a row of a datagrid bold if that rows item is true?
So let say I have a custom class: Class Elements{ int width; int height; bool isBol; } and in main I have something like: Public class MainWindow{ DataGrid dgv = new DataGrid(); List<Elements> elem = new List<Elements() { new Element(){width=100, height = 200, isBold = false}, new Element(){ width=20, height=100, isBold = true} }; dgv.ItemsSource = elem; dgv.Columns.Add(new DataGridTextColumn() { Header = "Width", Binding = new Binding("width")} dgv.Columns.Add(new DataGridTextColumn() { Header = "Height", Binding = new Binding("height")} } So it is just a simple table with 2 columns, width and height. How would I make the a row appear to be bold based on the bool value isBold? In my example above, the row 20x100 should appear to be bold in the table, where 100x200 should NOT be bold. Can I do this?
c#
wpf
datagrid
null
null
null
open
How to make a row of a datagrid bold if that rows item is true? === So let say I have a custom class: Class Elements{ int width; int height; bool isBol; } and in main I have something like: Public class MainWindow{ DataGrid dgv = new DataGrid(); List<Elements> elem = new List<Elements() { new Element(){width=100, height = 200, isBold = false}, new Element(){ width=20, height=100, isBold = true} }; dgv.ItemsSource = elem; dgv.Columns.Add(new DataGridTextColumn() { Header = "Width", Binding = new Binding("width")} dgv.Columns.Add(new DataGridTextColumn() { Header = "Height", Binding = new Binding("height")} } So it is just a simple table with 2 columns, width and height. How would I make the a row appear to be bold based on the bool value isBold? In my example above, the row 20x100 should appear to be bold in the table, where 100x200 should NOT be bold. Can I do this?
0
11,693,262
07/27/2012 18:05:17
420,540
08/14/2010 18:13:20
321
3
Get make to show line number on error
I have a makefile, which is missing an ldflag. I know how to fix it, but I don't know which line in the makefile the error is generated on. + make CCLD test test-test.o: In function `write_png': /home/lenovo/scratch/libass/test/test.c:52: undefined reference to `png_create_write_struct' ... /home/lenovo/scratch/libass/test/test.c:57: undefined reference to `png_destroy_write_struct' collect2: ld returned 1 exit status make: *** [test] Error 1 How do I get make to print out the line the error is on? (If anybody is wondering, it is a makefile from the libass project in the test directory.)
makefile
make
gnu-make
gnumakefiles
null
null
open
Get make to show line number on error === I have a makefile, which is missing an ldflag. I know how to fix it, but I don't know which line in the makefile the error is generated on. + make CCLD test test-test.o: In function `write_png': /home/lenovo/scratch/libass/test/test.c:52: undefined reference to `png_create_write_struct' ... /home/lenovo/scratch/libass/test/test.c:57: undefined reference to `png_destroy_write_struct' collect2: ld returned 1 exit status make: *** [test] Error 1 How do I get make to print out the line the error is on? (If anybody is wondering, it is a makefile from the libass project in the test directory.)
0
11,693,264
07/27/2012 18:05:28
789,429
06/08/2011 15:06:36
188
9
MKMapKit Clustering in Monotouch
Is there any library or example available to display big amount of data on the MKMapView with monotouch?
ios
monotouch
mkmapview
mkmapkit
null
null
open
MKMapKit Clustering in Monotouch === Is there any library or example available to display big amount of data on the MKMapView with monotouch?
0
11,693,234
07/27/2012 18:03:37
1,135,954
01/07/2012 13:13:51
612
37
PHP Mysql get value of out parameter from a stored proc
I have called a mysql stored proc from php using `mysqli`. This has 1 out parameter. $rs = $mysqli->query("CALL addNewUser($name,$age,@id)"); Here, @id is the out parameter. Next I fire following query to get the value of out parameter $rs2 = $mysqli->query("SELECT @id"); while($row = $rs->fetch_object()){ echo var_dump($row); } The output of `var_dump` is as follows: object(stdClass)#5 (1) { ["@id"]=> string(6) "100026" } So, now I want to retrieve the value of `@id`, which I am unable to. I tried `$row[0]->{@id}` but this gave following error: PHP Fatal error: Cannot use object of type stdClass as array Any ideas/hints would be helpful. Thanks
php
mysql
out-parameter
null
null
null
open
PHP Mysql get value of out parameter from a stored proc === I have called a mysql stored proc from php using `mysqli`. This has 1 out parameter. $rs = $mysqli->query("CALL addNewUser($name,$age,@id)"); Here, @id is the out parameter. Next I fire following query to get the value of out parameter $rs2 = $mysqli->query("SELECT @id"); while($row = $rs->fetch_object()){ echo var_dump($row); } The output of `var_dump` is as follows: object(stdClass)#5 (1) { ["@id"]=> string(6) "100026" } So, now I want to retrieve the value of `@id`, which I am unable to. I tried `$row[0]->{@id}` but this gave following error: PHP Fatal error: Cannot use object of type stdClass as array Any ideas/hints would be helpful. Thanks
0
11,693,243
07/27/2012 18:04:03
1,558,407
07/27/2012 17:56:48
1
0
Displaying feature name using Openlayers and GEOServer
I am trying to display feature name in the map while loading (ex: name of the building). How we can display this in **OpenLayers** by using **GeoServer**. Thanks, Ashok
openlayers
geoserver
null
null
null
null
open
Displaying feature name using Openlayers and GEOServer === I am trying to display feature name in the map while loading (ex: name of the building). How we can display this in **OpenLayers** by using **GeoServer**. Thanks, Ashok
0
11,693,244
07/27/2012 18:04:12
1,094,259
12/12/2011 17:40:05
474
5
Tesseract [OCR] - only numbers and euro symbol
At the moment I'm using `tesseract a.tif output nobatch digits` to parse an image that contains only numbers. I'm in the need of parsing an image that contains numbers and Euro symbol. How can I do that with tesseract?
image
ocr
tesseract
null
null
null
open
Tesseract [OCR] - only numbers and euro symbol === At the moment I'm using `tesseract a.tif output nobatch digits` to parse an image that contains only numbers. I'm in the need of parsing an image that contains numbers and Euro symbol. How can I do that with tesseract?
0
11,693,245
07/27/2012 18:04:11
1,403,159
05/18/2012 10:52:11
12
1
show grocery crud using tab panel
I'm newbie for grocery crud. I'm having a database table lets say customer_details, it includes customer_name & customer_id etc columns. I'm having another table called purches_details, customer_id is the foriegn key for this table. I want to create a tab panel (menu) in my view according to the customer_name column in customer_detail table. tabs names should be customer names & when some one click the relevent customer_name tab the the relevent purches details should show as the grocery crud grid. Please help me friends, I want it so deeply. Thanks.
codeigniter
grocery-crud
null
null
null
null
open
show grocery crud using tab panel === I'm newbie for grocery crud. I'm having a database table lets say customer_details, it includes customer_name & customer_id etc columns. I'm having another table called purches_details, customer_id is the foriegn key for this table. I want to create a tab panel (menu) in my view according to the customer_name column in customer_detail table. tabs names should be customer names & when some one click the relevent customer_name tab the the relevent purches details should show as the grocery crud grid. Please help me friends, I want it so deeply. Thanks.
0
11,675,149
07/26/2012 17:53:42
1,526,306
07/15/2012 00:51:18
16
0
How to stop a button tap event from bubbling into a listview?
I have a listview with a button as part of the datatemplate. When I click the button I want an action to happen, but I don't necessarily want that item selected. Is there any way I can stop the tap event from bubbling up to the listbox? Thanks!
c#
.net
xaml
microsoft-metro
winrt
null
open
How to stop a button tap event from bubbling into a listview? === I have a listview with a button as part of the datatemplate. When I click the button I want an action to happen, but I don't necessarily want that item selected. Is there any way I can stop the tap event from bubbling up to the listbox? Thanks!
0
11,675,151
07/26/2012 17:53:47
1,162,505
01/21/2012 16:18:24
1
0
Mono C# FileChooserButton set to show only .tar.gz files
How can I create a FileChooserButton that shows only .tar.gz files on MonoDevelop C# GTK+? Thanks.
c#
linux
gtk
monodevelop
gtk#
null
open
Mono C# FileChooserButton set to show only .tar.gz files === How can I create a FileChooserButton that shows only .tar.gz files on MonoDevelop C# GTK+? Thanks.
0
11,430,485
07/11/2012 10:18:09
1,427,811
05/31/2012 07:50:24
87
12
decode in PHP a simple text from database
I have a simple text into my database with a string like this: "Online il nuovo sito web di QINT'X: rinnovato nella grafica presenta una struttura più lineare e facilmente fruibile rispetto al precedente, a tutto vantaggio della navigazione" I have make a query in PHP to retrieve data but when I take the string doesn't decode the character'ù'. Why? This is my code (I have hidden the part of query because the problem I think is in the utf8_decode): echo'<span class="txt_page" style="text-align:justify">'.utf8_decode(htmlentities(substr($news['descrizione_it'],0,200))).'</span><br />';
php
decode
null
null
null
null
open
decode in PHP a simple text from database === I have a simple text into my database with a string like this: "Online il nuovo sito web di QINT'X: rinnovato nella grafica presenta una struttura più lineare e facilmente fruibile rispetto al precedente, a tutto vantaggio della navigazione" I have make a query in PHP to retrieve data but when I take the string doesn't decode the character'ù'. Why? This is my code (I have hidden the part of query because the problem I think is in the utf8_decode): echo'<span class="txt_page" style="text-align:justify">'.utf8_decode(htmlentities(substr($news['descrizione_it'],0,200))).'</span><br />';
0
11,430,492
07/11/2012 10:18:37
1,169,835
01/25/2012 18:21:55
1
0
Calling a plain JS function once converted to CoffeeScript
In my Rails app I have some plain old JS: function reorder(divid,url) { jQuery(divid).sortable({ axis: 'y', dropOnEmpty: false, handle: '.drag', cursor: 'crosshair', items: 'li', opacity: 0.4, scroll: true, update: function(){ jQuery.ajax({ type: 'post', data: jQuery(divid).sortable('serialize'), dataType: 'script', url: url) } }); } and it works when I call: reorder("#pages","<%= changeorder_pages_path %>"); So I decided to convert my function to CoffeeScript which gave me this: (function() { var reorder; reorder = function(divid, url) { return jQuery("#pages").sortable({ axis: "y", dropOnEmpty: false, handle: ".drag", cursor: "crosshair", items: "li", opacity: 0.4, scroll: true, update: function() { return jQuery.ajax({ type: "post", data: jQuery("#pages").sortable("serialize"), dataType: "script", complete: function(request) { return jQuery("#pGESs").effect("highlight"); }, url: "/pages/changeorder" }); } }); }; }).call(this); but my call doesn't work any more - I get the Firebug error: reorder is not defined So to my question - how do I call the function now it is CoffeeScripted? I have read this: http://stackoverflow.com/questions/6506112/coffeescript-call-a-function-by-its-name But I have no idea what they are talking about. I have never used global=this and have no idea what it does or why I would want to use it. I read this as well: http://elegantcode.com/2011/06/30/exploring-coffeescript-part-2-variables-and-functions/ As well as this: http://www.informit.com/articles/article.aspx?p=1834699 I realise that CoffeeScript is protecting me from global variables and making my code better - but I can't find an explanation as how to call functions. I have played with the CoffeeScript web site and played with the cube function - so I should just be able to call the function name I think. I'm asking the question because I have a gap in my knowledge - any help filling that gap will be much appreciated.
javascript
coffeescript
null
null
null
null
open
Calling a plain JS function once converted to CoffeeScript === In my Rails app I have some plain old JS: function reorder(divid,url) { jQuery(divid).sortable({ axis: 'y', dropOnEmpty: false, handle: '.drag', cursor: 'crosshair', items: 'li', opacity: 0.4, scroll: true, update: function(){ jQuery.ajax({ type: 'post', data: jQuery(divid).sortable('serialize'), dataType: 'script', url: url) } }); } and it works when I call: reorder("#pages","<%= changeorder_pages_path %>"); So I decided to convert my function to CoffeeScript which gave me this: (function() { var reorder; reorder = function(divid, url) { return jQuery("#pages").sortable({ axis: "y", dropOnEmpty: false, handle: ".drag", cursor: "crosshair", items: "li", opacity: 0.4, scroll: true, update: function() { return jQuery.ajax({ type: "post", data: jQuery("#pages").sortable("serialize"), dataType: "script", complete: function(request) { return jQuery("#pGESs").effect("highlight"); }, url: "/pages/changeorder" }); } }); }; }).call(this); but my call doesn't work any more - I get the Firebug error: reorder is not defined So to my question - how do I call the function now it is CoffeeScripted? I have read this: http://stackoverflow.com/questions/6506112/coffeescript-call-a-function-by-its-name But I have no idea what they are talking about. I have never used global=this and have no idea what it does or why I would want to use it. I read this as well: http://elegantcode.com/2011/06/30/exploring-coffeescript-part-2-variables-and-functions/ As well as this: http://www.informit.com/articles/article.aspx?p=1834699 I realise that CoffeeScript is protecting me from global variables and making my code better - but I can't find an explanation as how to call functions. I have played with the CoffeeScript web site and played with the cube function - so I should just be able to call the function name I think. I'm asking the question because I have a gap in my knowledge - any help filling that gap will be much appreciated.
0
11,430,497
07/11/2012 10:18:59
1,444,442
06/08/2012 11:53:24
16
2
Save pulled data from MySQL table into another table
I have a query here pulling data from MySQL database. It's working great.But what am trying to do is save all the data pulled from the module table into another table. How could I go about this please ?? Any help would be appreciated. Thanks. $coremoduleY1Query = "SELECT ID,title,credits FROM module WHERE ID = 'CS1101' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1105' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1106' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1107' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1108' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1109'"; $coremoduleY1Result = mysql_query($coremoduleY1Query); echo "<B> Core Modules </B>"; while ($coremoduleRow = mysql_fetch_array($coremoduleY1Result)) { $id = htmlentities($coremoduleRow['ID']); $title = htmlentities($coremoduleRow['title']); $credits = $coremoduleRow['credits']; echo "<ul>" . $id . " " . $title . " " . $credits . "</ul>"; } echo "<br />";
php
mysql
null
null
null
null
open
Save pulled data from MySQL table into another table === I have a query here pulling data from MySQL database. It's working great.But what am trying to do is save all the data pulled from the module table into another table. How could I go about this please ?? Any help would be appreciated. Thanks. $coremoduleY1Query = "SELECT ID,title,credits FROM module WHERE ID = 'CS1101' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1105' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1106' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1107' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1108' UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1109'"; $coremoduleY1Result = mysql_query($coremoduleY1Query); echo "<B> Core Modules </B>"; while ($coremoduleRow = mysql_fetch_array($coremoduleY1Result)) { $id = htmlentities($coremoduleRow['ID']); $title = htmlentities($coremoduleRow['title']); $credits = $coremoduleRow['credits']; echo "<ul>" . $id . " " . $title . " " . $credits . "</ul>"; } echo "<br />";
0
11,430,443
07/11/2012 10:15:51
454,488
05/03/2010 03:43:01
869
19
How can i generate random DNS names of Hosts in java
this could be of the form: aaa1.bbb2.ccc3.ddd4 Maybe taking a cue from http://www.dnsjava.org/download/ and first generating individual strings aaaa1 , bbb2 etc and then using join() or String validCharacters = $('a', 'z').join() + $('A', 'Z').join(); String randomString(int length) { return $(validCharacters).shuffle().slice(length).toString(); } @Test public void buildFiveRandomStrings() { for (int i : $(5)) { System.out.println(randomString(12)); } }
java
null
null
null
null
null
open
How can i generate random DNS names of Hosts in java === this could be of the form: aaa1.bbb2.ccc3.ddd4 Maybe taking a cue from http://www.dnsjava.org/download/ and first generating individual strings aaaa1 , bbb2 etc and then using join() or String validCharacters = $('a', 'z').join() + $('A', 'Z').join(); String randomString(int length) { return $(validCharacters).shuffle().slice(length).toString(); } @Test public void buildFiveRandomStrings() { for (int i : $(5)) { System.out.println(randomString(12)); } }
0
11,430,444
07/11/2012 10:15:52
179,437
09/26/2009 10:00:26
157
8
What does 'v !== v' expression check?
I have seen this in the sources of one lib, and confused. I think, it always evaluates to '`false`'. What is the meaning of using that?
javascript
null
null
null
null
null
open
What does 'v !== v' expression check? === I have seen this in the sources of one lib, and confused. I think, it always evaluates to '`false`'. What is the meaning of using that?
0
11,430,446
07/11/2012 10:15:57
1,314,752
04/05/2012 08:32:37
1
0
Actionbar implementation in 2.3 without using thirdparty jars
I have to develop actionbar in my application, but I am working on android 2.3 version. without using thirdparty jars like "actionbarsherlock.com" ,is there any support available from android? I tried the below link from prev.posts but as android site has been modified I am not able to find any thing there"http://developer.android.com/tools/samples/index.html". Thanks in advance...ur help is appreciated..
android
null
null
null
null
null
open
Actionbar implementation in 2.3 without using thirdparty jars === I have to develop actionbar in my application, but I am working on android 2.3 version. without using thirdparty jars like "actionbarsherlock.com" ,is there any support available from android? I tried the below link from prev.posts but as android site has been modified I am not able to find any thing there"http://developer.android.com/tools/samples/index.html". Thanks in advance...ur help is appreciated..
0
11,416,254
07/10/2012 15:03:18
1,199,882
02/09/2012 14:42:02
1,419
57
What loads the classes in rt.jar?
I want to know whether it is possible to specify an alternative to rt.jar to be loaded instead of rt.jar. So my question is, what loads rt.jar and is it possible to specify an alternative jar to be loaded instead of rt.jar?
java
null
null
null
null
null
open
What loads the classes in rt.jar? === I want to know whether it is possible to specify an alternative to rt.jar to be loaded instead of rt.jar. So my question is, what loads rt.jar and is it possible to specify an alternative jar to be loaded instead of rt.jar?
0
11,416,255
07/10/2012 15:03:19
1,501,700
07/04/2012 13:23:58
1
0
How to load JNI dynamically to vc++ program
I need to load JNI to my c++ application dynamically. My application will decided load jvm.dll or no. I'm new to c++. In case I add jni.h and tell linker to include jvm.lib my application is looking for jvm.dll and loads it automatically. I need it to load according required. I'm new to c++. Would you point me into right direction to solve this problem? Thank you
java
visual-c++
jni
null
null
null
open
How to load JNI dynamically to vc++ program === I need to load JNI to my c++ application dynamically. My application will decided load jvm.dll or no. I'm new to c++. In case I add jni.h and tell linker to include jvm.lib my application is looking for jvm.dll and loads it automatically. I need it to load according required. I'm new to c++. Would you point me into right direction to solve this problem? Thank you
0
11,416,256
07/10/2012 15:03:21
1,370,122
05/02/2012 13:24:55
6
0
how to stop saving an image to phone album?
I use the UIImageWriteToSavedPhotosAlbum to save the photos to the album.But if the photo is too large it will take a long time to finish saving.So i need an cancel button which can cancel the saving process. But it seems that there is no way to do that.Does anyone know how to do it? UIImage *tempImage = [[UIImage alloc] initWithContentsOfFile:pPath]; UIImageWriteToSavedPhotosAlbum(tempImage, self, @selector(finishedSavingImage:didFinishSavingWithError:contextInfo:), [file retain]);
ios
null
null
null
null
null
open
how to stop saving an image to phone album? === I use the UIImageWriteToSavedPhotosAlbum to save the photos to the album.But if the photo is too large it will take a long time to finish saving.So i need an cancel button which can cancel the saving process. But it seems that there is no way to do that.Does anyone know how to do it? UIImage *tempImage = [[UIImage alloc] initWithContentsOfFile:pPath]; UIImageWriteToSavedPhotosAlbum(tempImage, self, @selector(finishedSavingImage:didFinishSavingWithError:contextInfo:), [file retain]);
0
11,416,257
07/10/2012 15:03:21
1,454,912
06/13/2012 22:25:03
5
0
Tracing Ip address logic
I want to know how to convert ip address to map-address location as all the traceip site offer. I could not find good info about the logic and the method behind those sites and be thankfull if you will link me or explain it to me. thanks
google-maps
ip
ip-address
tracing
street-address
07/10/2012 17:41:51
not a real question
Tracing Ip address logic === I want to know how to convert ip address to map-address location as all the traceip site offer. I could not find good info about the logic and the method behind those sites and be thankfull if you will link me or explain it to me. thanks
1
11,430,506
07/11/2012 10:19:53
1,077,160
12/02/2011 10:13:49
190
32
Round of function returns different values
I have a field in mysql DB `rating` with data type `float(2,1)`. One row it contains a value 0.5 But when I use `SELECT round(rating) FROM table WHERE ...` gives value 0 instead of 1. But `SELECT round(o.5)` gives value 1 (For Postgresql too). Again php always gives `echo round(0.5);` value 1. I am really confused. Thanks in advanced.
php
mysql
postgresql
null
null
null
open
Round of function returns different values === I have a field in mysql DB `rating` with data type `float(2,1)`. One row it contains a value 0.5 But when I use `SELECT round(rating) FROM table WHERE ...` gives value 0 instead of 1. But `SELECT round(o.5)` gives value 1 (For Postgresql too). Again php always gives `echo round(0.5);` value 1. I am really confused. Thanks in advanced.
0
11,542,302
07/18/2012 13:15:54
953,227
09/19/2011 17:38:14
31
0
built a soap client for this web services in C#
i goin to write a simple example you can find in the web in C#. since i am new in the theme of web services FirstService.asmx <%@ WebService language="C" class="FirstService" %> using System; using System.Web.Services; using System.Xml.Serialization; [WebService(Namespace="http://localhost/MyWebServices/")] public class FirstService : WebService { [WebMethod] public int Add(int a, int b) { return a + b; } } you can see is a simple add, now the client using 3 text box, and 1 button, 2 for the number and one for the result, the client will look like this: WebApp.axpx <%@ Page Language="C#" %> <script runat="server"> void runSrvice_Click(Object sender, EventArgs e) { FirstService mySvc = new FirstService(); txtNum3.Text = mySvc.Add(Int32.Parse(txtNum1.Text), Int32.Parse(txtNum2.Text)).ToString(); } next i creat a proxi with the next line. c:> WSDL http://localhost/MyWebServices/FirstService.asmx?WSDL now a compile the proxy generate: c:> csc /t:library FirstService.cs all the files are in my virtual directoy in IIS, so far soo good, the client show the button and the textbox and when you click the button it will add the numbers in the 2 textbox. soo what's wrong? how can i used the SOAP tecnology to doo the same thing? with the previous steps i am alredy using the soap? any help is much apreciated, links, guide lines, example etc.
c#
asp.net
soap
null
null
null
open
built a soap client for this web services in C# === i goin to write a simple example you can find in the web in C#. since i am new in the theme of web services FirstService.asmx <%@ WebService language="C" class="FirstService" %> using System; using System.Web.Services; using System.Xml.Serialization; [WebService(Namespace="http://localhost/MyWebServices/")] public class FirstService : WebService { [WebMethod] public int Add(int a, int b) { return a + b; } } you can see is a simple add, now the client using 3 text box, and 1 button, 2 for the number and one for the result, the client will look like this: WebApp.axpx <%@ Page Language="C#" %> <script runat="server"> void runSrvice_Click(Object sender, EventArgs e) { FirstService mySvc = new FirstService(); txtNum3.Text = mySvc.Add(Int32.Parse(txtNum1.Text), Int32.Parse(txtNum2.Text)).ToString(); } next i creat a proxi with the next line. c:> WSDL http://localhost/MyWebServices/FirstService.asmx?WSDL now a compile the proxy generate: c:> csc /t:library FirstService.cs all the files are in my virtual directoy in IIS, so far soo good, the client show the button and the textbox and when you click the button it will add the numbers in the 2 textbox. soo what's wrong? how can i used the SOAP tecnology to doo the same thing? with the previous steps i am alredy using the soap? any help is much apreciated, links, guide lines, example etc.
0
11,542,303
07/18/2012 13:16:01
543,327
12/15/2010 12:10:37
129
0
No action execute in struts2 form when try submit him
When i click submit in my form (struts2) there are no action executed. What wrong may be in this files? struts.xml: ...<action name="EditMessageAction" class="action.content.EditMessageAction"> <result name="success">/WEB-INF/pages/messages/message.jsp</result> </action> <action name="SaveEditedMessageAction" class="action.content.SaveEditedMessageAction"> <result name="input">/WEB-INF/pages/messages/message.jsp</result> <result name="success">/WEB-INF/pages/messages/messagesFirstPosition.jsp</result> </action>... message.jsp: <s:form id="saveEditedUserForm" action="SaveEditedUserAction" theme="simple"> <h1>Edycja komunikatu</h1> <div> Id: <b><s:property value="id"/></b> </div> <div> <s:label for="dateFrom" value="Od:*"/> <s:textfield id="dateFrom" name="dateFrom" required="true"/> </div> <div> <s:label for="dateTo" value="Do:*"/> <s:textfield id="dateTo" name="dateTo" required="true"/> </div> <div> <s:label for="linkChecked" value="Link?"/> <s:checkbox id="linkChecked" name="linkChecked" value="true" cssClass="linkChecked"/> </div> <div class="linkDiv"> <s:label for="link" value="Link:*"/> <s:textfield id="link" name="link"/> </div> <div class="redirectActionDiv"> <s:label for="redirectAction" value="redirectAction:*"/> <s:textfield id="redirectAction" name="redirectAction"/> </div> <div> <s:label for="typeDth" value="DTH:"/> <s:checkbox id="typeDth" name="typeDth"/> </div> <div> <s:label for="typeMvno" value="MVNO:"/> <s:checkbox id="typeMvno" name="typeMvno" cssClass="typeMvno"/> <div class="typeMvnoDiv"> <s:label for="subTypeMvnoPostpaid" value="PostPaid:"/> <s:checkbox id="subTypeMvnoPostpaid" name="subTypeMvnoPostpaid"/> <s:label for="subTypeMvnoPrepaid" value="PrePaid:"/> <s:checkbox id="subTypeMvnoPrepaid" name="subTypeMvnoPrepaid"/> </div> </div> <div> <s:label for="typeDvbt" value="DVBT:"/> <s:checkbox id="typeDvbt" name="typeDvbt"/> </div> <div> <s:label for="active" value="Aktywny:"/> <s:checkbox id="active" name="active"/> </div> <div> <s:submit/> </div> </s:form> and SaveEditedMessageAction.java: package pl.cyfrowypolsat.ebok.bm.action.content; import java.util.Date; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import pl.cyfrowypolsat.ebok.bm.action.BaseAction; import pl.cyfrowypolsat.ebok.bm.consts.SessionParameters; import pl.cyfrowypolsat.ebok.bm.ejb.IMessages; import pl.cyfrowypolsat.ebok.bm.ejb.bean.MessageBean; import pl.cyfrowypolsat.ebok.bm.utils.EJBLocator; public class SaveEditedMessageAction extends BaseAction{ private static final long serialVersionUID = 1L; private static final Log LOG = LogFactory.getLog(SaveEditedMessageAction.class); private int id; private Date dateFrom; private Date dateTo; private String link; private String header; private String redirectAction; private boolean typeDth; private boolean typeMvno; private boolean typeDvbt; private boolean subTypeMvnoPostpaid; private boolean subTypeMvnoPrepaid; private boolean active; private boolean linkChecked; public String execute() { LOG.info("Enter: execute(). " + dateFrom + " " + link); MessageBean sessionMessageBean = (MessageBean) sessionParameters.get(SessionParameters.MESSAGE_EDIT); if(sessionMessageBean != null) { IMessages messagesEJB = EJBLocator.getMessages(); sessionMessageBean.setDateFrom(getDateFrom()); sessionMessageBean.setDateTo(getDateTo()); sessionMessageBean.setLinkHref(getLink()); if(linkChecked){ sessionMessageBean.setHtml(generateMessageHtmlLink(getLink(), getHeader())); sessionMessageBean.setRedirectAction("NULL"); } else { sessionMessageBean.setRedirectAction(getRedirectAction()); sessionMessageBean.setHtml(generateMessageWithoutLink(getHeader())); } sessionMessageBean.setTypeDth(booleanToInt(isTypeDth())); sessionMessageBean.setTypeMvno(booleanToInt(isTypeMvno())); sessionMessageBean.setSubTypeMvnoPostpaid(booleanToInt(isSubTypeMvnoPostpaid())); sessionMessageBean.setSubTypeMvnoPrepaid(booleanToInt(isSubTypeMvnoPrepaid())); sessionMessageBean.setTypeDth(booleanToInt(isTypeDth())); sessionMessageBean.setAktywny(booleanToInt(isActive())); messagesEJB.updateMessage(sessionMessageBean); } LOG.info("Exit: execute()"); return SUCCESS; } public int getId() { return id; } public void setId(int id) { this.id = id; } public Date getDateFrom() { return dateFrom; } public void setDateFrom(Date dateFrom) { this.dateFrom = dateFrom; } public Date getDateTo() { return dateTo; } public void setDateTo(Date dateTo) { this.dateTo = dateTo; } public String getLink() { return link; } public void setLink(String link) { this.link = link; } public String getHeader() { return header; } public void setHeader(String header) { this.header = header; } public String getRedirectAction() { return redirectAction; } public void setRedirectAction(String redirectAction) { this.redirectAction = redirectAction; } public boolean isTypeDth() { return typeDth; } public void setTypeDth(boolean typeDth) { this.typeDth = typeDth; } public boolean isTypeMvno() { return typeMvno; } public void setTypeMvno(boolean typeMvno) { this.typeMvno = typeMvno; } public boolean isTypeDvbt() { return typeDvbt; } public void setTypeDvbt(boolean typeDvbt) { this.typeDvbt = typeDvbt; } public boolean isSubTypeMvnoPostpaid() { return subTypeMvnoPostpaid; } public void setSubTypeMvnoPostpaid(boolean subTypeMvnoPostpaid) { this.subTypeMvnoPostpaid = subTypeMvnoPostpaid; } public boolean isSubTypeMvnoPrepaid() { return subTypeMvnoPrepaid; } public void setSubTypeMvnoPrepaid(boolean subTypeMvnoPrepaid) { this.subTypeMvnoPrepaid = subTypeMvnoPrepaid; } public boolean isActive() { return active; } public void setActive(boolean active) { this.active = active; } public boolean isLinkChecked() { return linkChecked; } public void setLinkChecked(boolean linkChecked) { this.linkChecked = linkChecked; } }
forms
struts2
null
null
null
null
open
No action execute in struts2 form when try submit him === When i click submit in my form (struts2) there are no action executed. What wrong may be in this files? struts.xml: ...<action name="EditMessageAction" class="action.content.EditMessageAction"> <result name="success">/WEB-INF/pages/messages/message.jsp</result> </action> <action name="SaveEditedMessageAction" class="action.content.SaveEditedMessageAction"> <result name="input">/WEB-INF/pages/messages/message.jsp</result> <result name="success">/WEB-INF/pages/messages/messagesFirstPosition.jsp</result> </action>... message.jsp: <s:form id="saveEditedUserForm" action="SaveEditedUserAction" theme="simple"> <h1>Edycja komunikatu</h1> <div> Id: <b><s:property value="id"/></b> </div> <div> <s:label for="dateFrom" value="Od:*"/> <s:textfield id="dateFrom" name="dateFrom" required="true"/> </div> <div> <s:label for="dateTo" value="Do:*"/> <s:textfield id="dateTo" name="dateTo" required="true"/> </div> <div> <s:label for="linkChecked" value="Link?"/> <s:checkbox id="linkChecked" name="linkChecked" value="true" cssClass="linkChecked"/> </div> <div class="linkDiv"> <s:label for="link" value="Link:*"/> <s:textfield id="link" name="link"/> </div> <div class="redirectActionDiv"> <s:label for="redirectAction" value="redirectAction:*"/> <s:textfield id="redirectAction" name="redirectAction"/> </div> <div> <s:label for="typeDth" value="DTH:"/> <s:checkbox id="typeDth" name="typeDth"/> </div> <div> <s:label for="typeMvno" value="MVNO:"/> <s:checkbox id="typeMvno" name="typeMvno" cssClass="typeMvno"/> <div class="typeMvnoDiv"> <s:label for="subTypeMvnoPostpaid" value="PostPaid:"/> <s:checkbox id="subTypeMvnoPostpaid" name="subTypeMvnoPostpaid"/> <s:label for="subTypeMvnoPrepaid" value="PrePaid:"/> <s:checkbox id="subTypeMvnoPrepaid" name="subTypeMvnoPrepaid"/> </div> </div> <div> <s:label for="typeDvbt" value="DVBT:"/> <s:checkbox id="typeDvbt" name="typeDvbt"/> </div> <div> <s:label for="active" value="Aktywny:"/> <s:checkbox id="active" name="active"/> </div> <div> <s:submit/> </div> </s:form> and SaveEditedMessageAction.java: package pl.cyfrowypolsat.ebok.bm.action.content; import java.util.Date; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import pl.cyfrowypolsat.ebok.bm.action.BaseAction; import pl.cyfrowypolsat.ebok.bm.consts.SessionParameters; import pl.cyfrowypolsat.ebok.bm.ejb.IMessages; import pl.cyfrowypolsat.ebok.bm.ejb.bean.MessageBean; import pl.cyfrowypolsat.ebok.bm.utils.EJBLocator; public class SaveEditedMessageAction extends BaseAction{ private static final long serialVersionUID = 1L; private static final Log LOG = LogFactory.getLog(SaveEditedMessageAction.class); private int id; private Date dateFrom; private Date dateTo; private String link; private String header; private String redirectAction; private boolean typeDth; private boolean typeMvno; private boolean typeDvbt; private boolean subTypeMvnoPostpaid; private boolean subTypeMvnoPrepaid; private boolean active; private boolean linkChecked; public String execute() { LOG.info("Enter: execute(). " + dateFrom + " " + link); MessageBean sessionMessageBean = (MessageBean) sessionParameters.get(SessionParameters.MESSAGE_EDIT); if(sessionMessageBean != null) { IMessages messagesEJB = EJBLocator.getMessages(); sessionMessageBean.setDateFrom(getDateFrom()); sessionMessageBean.setDateTo(getDateTo()); sessionMessageBean.setLinkHref(getLink()); if(linkChecked){ sessionMessageBean.setHtml(generateMessageHtmlLink(getLink(), getHeader())); sessionMessageBean.setRedirectAction("NULL"); } else { sessionMessageBean.setRedirectAction(getRedirectAction()); sessionMessageBean.setHtml(generateMessageWithoutLink(getHeader())); } sessionMessageBean.setTypeDth(booleanToInt(isTypeDth())); sessionMessageBean.setTypeMvno(booleanToInt(isTypeMvno())); sessionMessageBean.setSubTypeMvnoPostpaid(booleanToInt(isSubTypeMvnoPostpaid())); sessionMessageBean.setSubTypeMvnoPrepaid(booleanToInt(isSubTypeMvnoPrepaid())); sessionMessageBean.setTypeDth(booleanToInt(isTypeDth())); sessionMessageBean.setAktywny(booleanToInt(isActive())); messagesEJB.updateMessage(sessionMessageBean); } LOG.info("Exit: execute()"); return SUCCESS; } public int getId() { return id; } public void setId(int id) { this.id = id; } public Date getDateFrom() { return dateFrom; } public void setDateFrom(Date dateFrom) { this.dateFrom = dateFrom; } public Date getDateTo() { return dateTo; } public void setDateTo(Date dateTo) { this.dateTo = dateTo; } public String getLink() { return link; } public void setLink(String link) { this.link = link; } public String getHeader() { return header; } public void setHeader(String header) { this.header = header; } public String getRedirectAction() { return redirectAction; } public void setRedirectAction(String redirectAction) { this.redirectAction = redirectAction; } public boolean isTypeDth() { return typeDth; } public void setTypeDth(boolean typeDth) { this.typeDth = typeDth; } public boolean isTypeMvno() { return typeMvno; } public void setTypeMvno(boolean typeMvno) { this.typeMvno = typeMvno; } public boolean isTypeDvbt() { return typeDvbt; } public void setTypeDvbt(boolean typeDvbt) { this.typeDvbt = typeDvbt; } public boolean isSubTypeMvnoPostpaid() { return subTypeMvnoPostpaid; } public void setSubTypeMvnoPostpaid(boolean subTypeMvnoPostpaid) { this.subTypeMvnoPostpaid = subTypeMvnoPostpaid; } public boolean isSubTypeMvnoPrepaid() { return subTypeMvnoPrepaid; } public void setSubTypeMvnoPrepaid(boolean subTypeMvnoPrepaid) { this.subTypeMvnoPrepaid = subTypeMvnoPrepaid; } public boolean isActive() { return active; } public void setActive(boolean active) { this.active = active; } public boolean isLinkChecked() { return linkChecked; } public void setLinkChecked(boolean linkChecked) { this.linkChecked = linkChecked; } }
0
11,542,304
07/18/2012 13:16:02
317,889
04/15/2010 19:15:12
294
8
When to multi thread sqlite database queries
I've written a content provider with one database helper and have started to build a "manager" class to perform specific inserts, deletes, updates, queries etc. The manager returns cursorloaders for my cursoradapters where necessary which I believe a multi-threaded. My question is, when I perform actions on the db that do not involve a loader should I create a new thread? An example might be, that I perform a save from the action bar - should I multi thread the insert manually? That goes for updates queries deletes etc also?
android
database
multithreading
sqlite
null
null
open
When to multi thread sqlite database queries === I've written a content provider with one database helper and have started to build a "manager" class to perform specific inserts, deletes, updates, queries etc. The manager returns cursorloaders for my cursoradapters where necessary which I believe a multi-threaded. My question is, when I perform actions on the db that do not involve a loader should I create a new thread? An example might be, that I perform a save from the action bar - should I multi thread the insert manually? That goes for updates queries deletes etc also?
0
11,542,305
07/18/2012 13:16:03
883,680
08/08/2011 08:42:48
60
0
Sending SMTP messages using PHPMailer, response of 'MAIL not accepted from server', why?
I've been banging my head trying to sort this one out... any clues would be greatly appreciated. I am sending mail via PHPMailers SMTP class locally on a Ubuntu 12.04 server running exim. If I send only 10 messages everything works fine. However if I queue up say 260+ messages and try to send them one after another I can guarantee that ~30 of them will be returned with the line: `MAIL not accepted from server` They're all going to the same address (and the other 230 make it there successfully) and I can see at times the queue in exim is functioning, so what could be causing this and why wouldnt this sort of error occur if I were just using the 'Mail' command? Thanks in advance. Ben P.S: I'm not using the mail command because I'm actually extract the message ID from the SMTP output
php
email
ubuntu
smtp
phpmailer
null
open
Sending SMTP messages using PHPMailer, response of 'MAIL not accepted from server', why? === I've been banging my head trying to sort this one out... any clues would be greatly appreciated. I am sending mail via PHPMailers SMTP class locally on a Ubuntu 12.04 server running exim. If I send only 10 messages everything works fine. However if I queue up say 260+ messages and try to send them one after another I can guarantee that ~30 of them will be returned with the line: `MAIL not accepted from server` They're all going to the same address (and the other 230 make it there successfully) and I can see at times the queue in exim is functioning, so what could be causing this and why wouldnt this sort of error occur if I were just using the 'Mail' command? Thanks in advance. Ben P.S: I'm not using the mail command because I'm actually extract the message ID from the SMTP output
0
11,542,162
07/18/2012 13:08:28
1,534,729
07/18/2012 12:09:30
1
0
Override javascript click event one time
I would like to replace the default action of an click event for all anchors in a webpage. When I use this piece of code: <html> <head> <script> var list=document.getElementsByTagName("a"); var isChecked = false; function load () { for (i=0; i<list.length; i++) { var old = (list[i].onclick) ? list[i].onclick : function () {}; list[i].onclick = function () { if( !isChecked) { test(); old(); } else old(); }; } } function test() { alert("new action"); isChecked = true; } </script> </head> <body onload="load();"> <a id="nr_1" onClick="alert('test');"> Anchor 1 </A> <a id="nr_2" onClick="alert('test2');"> Anchor 2 </A> </body> </html> When I click an anchor I get the alert out of the test function and then the default function of the second anchor (even when I click the first anchor). When I then again click one of the two anchors I always get the Alert from the second anchor. How do I put the original onclick functions back for each anchor element? When someone has an solution in jquery I would be glad as well.
javascript
jquery
html
null
null
null
open
Override javascript click event one time === I would like to replace the default action of an click event for all anchors in a webpage. When I use this piece of code: <html> <head> <script> var list=document.getElementsByTagName("a"); var isChecked = false; function load () { for (i=0; i<list.length; i++) { var old = (list[i].onclick) ? list[i].onclick : function () {}; list[i].onclick = function () { if( !isChecked) { test(); old(); } else old(); }; } } function test() { alert("new action"); isChecked = true; } </script> </head> <body onload="load();"> <a id="nr_1" onClick="alert('test');"> Anchor 1 </A> <a id="nr_2" onClick="alert('test2');"> Anchor 2 </A> </body> </html> When I click an anchor I get the alert out of the test function and then the default function of the second anchor (even when I click the first anchor). When I then again click one of the two anchors I always get the Alert from the second anchor. How do I put the original onclick functions back for each anchor element? When someone has an solution in jquery I would be glad as well.
0
11,542,309
07/18/2012 13:16:08
614,165
02/12/2011 11:31:01
1,372
75
HandleErrorInfo using MVC2 - Model is null?
I have an MVC 2 web application, which is nearing release. Until now I have had custom errors turned off but I would like them working when I go production ready. I have set up my web.config with the following: <customErrors mode="On" defaultRedirect="/Error/"> <error statusCode="404" redirect="/Error/NotFound "/> </customErrors> The 404 one works perfectly, and NotFound is an action which maps directly to a View that just shows a pretty standard 404 page using my own Site.Master file. For anything other than a 404, I want a user to be able to view the exception details. (This is an internal application, and there is no security risk in doing so). The `Error` default action `Index` is set to return a View() which I have defined. What I cannot figure out is how to pass the exception information into the View? This looked promising: http://devstuffs.wordpress.com/2010/12/12/how-to-use-customerrors-in-asp-net-mvc-2/ But when I use the View with: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Bootstrap.Master" Inherits="System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>" %> The error page itself throws an error, as HandleErrorInfo is null. Obviously an error in the custom error causes MVC2 a whole host of problems, and the result is a yellow screen of death. I guess either I missed something key in the blog, or it doesn't explain how to get the HandleErrorInfo to be anything other than null without setting the Error attribute for every single one of my Controllers/Actions. Also, I am aware that MVC3 deals with this better, and I am aware Razor is very good. It has not been used for this project nor will this project be changed to use it. So please no "Use MVC3" answers.
c#
asp.net
asp.net-mvc
asp.net-mvc-2
null
null
open
HandleErrorInfo using MVC2 - Model is null? === I have an MVC 2 web application, which is nearing release. Until now I have had custom errors turned off but I would like them working when I go production ready. I have set up my web.config with the following: <customErrors mode="On" defaultRedirect="/Error/"> <error statusCode="404" redirect="/Error/NotFound "/> </customErrors> The 404 one works perfectly, and NotFound is an action which maps directly to a View that just shows a pretty standard 404 page using my own Site.Master file. For anything other than a 404, I want a user to be able to view the exception details. (This is an internal application, and there is no security risk in doing so). The `Error` default action `Index` is set to return a View() which I have defined. What I cannot figure out is how to pass the exception information into the View? This looked promising: http://devstuffs.wordpress.com/2010/12/12/how-to-use-customerrors-in-asp-net-mvc-2/ But when I use the View with: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Bootstrap.Master" Inherits="System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>" %> The error page itself throws an error, as HandleErrorInfo is null. Obviously an error in the custom error causes MVC2 a whole host of problems, and the result is a yellow screen of death. I guess either I missed something key in the blog, or it doesn't explain how to get the HandleErrorInfo to be anything other than null without setting the Error attribute for every single one of my Controllers/Actions. Also, I am aware that MVC3 deals with this better, and I am aware Razor is very good. It has not been used for this project nor will this project be changed to use it. So please no "Use MVC3" answers.
0
11,542,311
07/18/2012 13:16:10
1,057,328
11/21/2011 07:26:10
18
1
Visual Studio 2008 can't show designer when designing Inherited Forms
I'm trying to create a form by inheriting from another form I have already created. The reason for this is that the original form actually has 3 states, and an inheritance structure will make it easier to debug, understand and improve. The problem is that my Visual Studio 2008 Forms designer doesn't play nice with this idea. Instead of a form I can design I get this error message: **The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: InheritedForm --- The base class 'MyBaseForm' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.** Basically I can't see my inherited form in the designer, but the original form works as it should in the designer. This was very frustrating, so to make sure the problem was not VS2008's fault I created a fresh clean Forms project (.net 2.0) and created a form which I called Form1 and another form (Form2) that inherited from Form1. This project work just fine. I can see Form1 in the designer and in my Form2 I can see a label I have added to Form1 but cannot move it in Form2 as it belongs to Form 1. The result from my test proves that my Visual Studio indeed works; just not in my original project that needs it to work. Another thing I tried was to create an inherited From through the Inheritance Picker when you use the VS2008 Guide to create an inherited form. On my test project I can see all the forms I have created, but in my original I can't choose anything. I tried to browse to the exe file in my bin folder, but it does not give my any forms to choose. I have also tried rebuilding the project, cleaning the project and restarting VS2008 hoping it was in some weird state, but nothing helps. I will not dismiss the idea that I have some weird project setup that might interfere with the Designer, since the project file is somewhat old and has a lot of files and elements. But due to the error descriptions I got, I find this unlikely (Still investigating this). I have been scouring the internet to the point where I get the same articles, forums or blogs no matter what I put into the search field in Google or doing link browsing, with no success. Do any of you have an idea or suggestion as to what could cause my problem? Any help, hint or suggestions at this point is highly appreciated. Thank you in advance.
visual-studio-2008
windows-forms-designer
null
null
null
null
open
Visual Studio 2008 can't show designer when designing Inherited Forms === I'm trying to create a form by inheriting from another form I have already created. The reason for this is that the original form actually has 3 states, and an inheritance structure will make it easier to debug, understand and improve. The problem is that my Visual Studio 2008 Forms designer doesn't play nice with this idea. Instead of a form I can design I get this error message: **The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: InheritedForm --- The base class 'MyBaseForm' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.** Basically I can't see my inherited form in the designer, but the original form works as it should in the designer. This was very frustrating, so to make sure the problem was not VS2008's fault I created a fresh clean Forms project (.net 2.0) and created a form which I called Form1 and another form (Form2) that inherited from Form1. This project work just fine. I can see Form1 in the designer and in my Form2 I can see a label I have added to Form1 but cannot move it in Form2 as it belongs to Form 1. The result from my test proves that my Visual Studio indeed works; just not in my original project that needs it to work. Another thing I tried was to create an inherited From through the Inheritance Picker when you use the VS2008 Guide to create an inherited form. On my test project I can see all the forms I have created, but in my original I can't choose anything. I tried to browse to the exe file in my bin folder, but it does not give my any forms to choose. I have also tried rebuilding the project, cleaning the project and restarting VS2008 hoping it was in some weird state, but nothing helps. I will not dismiss the idea that I have some weird project setup that might interfere with the Designer, since the project file is somewhat old and has a lot of files and elements. But due to the error descriptions I got, I find this unlikely (Still investigating this). I have been scouring the internet to the point where I get the same articles, forums or blogs no matter what I put into the search field in Google or doing link browsing, with no success. Do any of you have an idea or suggestion as to what could cause my problem? Any help, hint or suggestions at this point is highly appreciated. Thank you in advance.
0
11,541,505
07/18/2012 12:35:14
138,170
07/14/2009 16:04:56
832
42
Trivial hash for a consecutive sequence of input that doesn't have visible cycles in output
In a simple tile-based image, if each area of grass has the same grass tile repeated on each square, it looks like a horrible moire pattern, but if three or four grass tiles are alternated, it looks surprisingly natural. The preferable way to produce this is that each tile is chosen via a simple hash of its coordinates. (An alternative possible implementation is that they are chosen randomly at the start of the game, but I prefer the hash function if possible.) The necessary properties for the hash function are: * As fast as possible (ideally something like x+y mod N), with no cryptographic properties wanted * No visible periods on the output: eg. x+y mod N fails because it always repeats the same N tiles across each row Is there a simple arithmetic hash which would work, and be simpler than "seed(coords); return randomrange(N)", but if the input is "(0,0)","(1,0)","(2,0)"... the output doesn't have visible patterns in? Would it be better to generate some random data at the beginning of the game to use?
python
hash
null
null
null
null
open
Trivial hash for a consecutive sequence of input that doesn't have visible cycles in output === In a simple tile-based image, if each area of grass has the same grass tile repeated on each square, it looks like a horrible moire pattern, but if three or four grass tiles are alternated, it looks surprisingly natural. The preferable way to produce this is that each tile is chosen via a simple hash of its coordinates. (An alternative possible implementation is that they are chosen randomly at the start of the game, but I prefer the hash function if possible.) The necessary properties for the hash function are: * As fast as possible (ideally something like x+y mod N), with no cryptographic properties wanted * No visible periods on the output: eg. x+y mod N fails because it always repeats the same N tiles across each row Is there a simple arithmetic hash which would work, and be simpler than "seed(coords); return randomrange(N)", but if the input is "(0,0)","(1,0)","(2,0)"... the output doesn't have visible patterns in? Would it be better to generate some random data at the beginning of the game to use?
0
11,541,507
07/18/2012 12:35:20
1,503,608
07/05/2012 09:57:20
13
0
Getting Instagram Feeds on Facebook with PHP SDK
I have a little question on some facebook development stuff. Currently I'm trying to get information about Photos that I posted via Instagram. I've tried it with the graph api: <?php $status = $fb->api($fb->getUser().'/photos', 'GET'); ?> <pre><?php print_r($status);?></pre> But I don't get information about posts that were done by using other apps. Everything else show up just fine. The permissions I required are: user_status, user_photos, friends_photos' Where could the problem source be? Thanks in advance, Thomas
php
facebook
facebook-graph-api
instagram
null
null
open
Getting Instagram Feeds on Facebook with PHP SDK === I have a little question on some facebook development stuff. Currently I'm trying to get information about Photos that I posted via Instagram. I've tried it with the graph api: <?php $status = $fb->api($fb->getUser().'/photos', 'GET'); ?> <pre><?php print_r($status);?></pre> But I don't get information about posts that were done by using other apps. Everything else show up just fine. The permissions I required are: user_status, user_photos, friends_photos' Where could the problem source be? Thanks in advance, Thomas
0
11,542,314
07/18/2012 13:16:23
1,161,235
01/20/2012 18:24:44
454
30
JRuby Rails 3.1.6 deploy WAR on Tomcat 7 in subdirectory (redirects and links don't use the subdirectory)
I have an JRuby on Rails 3.1.6 application and want to deploy it on a Tomcat 7 as WAR file. To generate the war I use warbler. I can deploy the application to the server and all is running. But the links generated or a redirect form devise to `/users/sign_in` dont work because the context path is ignored. I tried to set the relative url root with: config.action_controller.relative_url_root = '/foo' But the method was not found. (Also tried the ENV variable for this, but nothing happened) I tried to use `scope '/foo'` in my `routes.rb` but this doesn't work either. I also tried to add this in my `config.ru` map '/foo' do run Foo::Application end But the `config.ru` files seams not to be included in the WAR file or used in any way. <br /> I can't generate a VirtualHost or anything in tomcat, I have only the rights to deploy the application as WAR file. Is there any way to tell the rails application that it runs under a given subdirectory (context path) so it adds this to all generated links, redirects, etc., that works within Rails 3.1.6?
tomcat
deployment
ruby-on-rails-3.1
jruby
rails-routing
null
open
JRuby Rails 3.1.6 deploy WAR on Tomcat 7 in subdirectory (redirects and links don't use the subdirectory) === I have an JRuby on Rails 3.1.6 application and want to deploy it on a Tomcat 7 as WAR file. To generate the war I use warbler. I can deploy the application to the server and all is running. But the links generated or a redirect form devise to `/users/sign_in` dont work because the context path is ignored. I tried to set the relative url root with: config.action_controller.relative_url_root = '/foo' But the method was not found. (Also tried the ENV variable for this, but nothing happened) I tried to use `scope '/foo'` in my `routes.rb` but this doesn't work either. I also tried to add this in my `config.ru` map '/foo' do run Foo::Application end But the `config.ru` files seams not to be included in the WAR file or used in any way. <br /> I can't generate a VirtualHost or anything in tomcat, I have only the rights to deploy the application as WAR file. Is there any way to tell the rails application that it runs under a given subdirectory (context path) so it adds this to all generated links, redirects, etc., that works within Rails 3.1.6?
0
11,542,315
07/18/2012 13:16:23
1,336,793
04/16/2012 16:23:39
11
0
Jersey object mapping
I'd like to to GET a Java object with a REST call, using Jersey. The question: can send objecy of class A and receive object of class B, if A has all B's members? Let me show an example: class A { String one; Date two; int three; } class B { Date two; int three; } Lets say, I have a REST service: class MyREST { @GET @Path("somepath") public void getThing() { return new A(); { and I call it with a code: Client client = Client.create(); WebResource scResource = client.resource("somePath"); MyClass result = scResource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).get(B.class);
java
json
jersey
null
null
null
open
Jersey object mapping === I'd like to to GET a Java object with a REST call, using Jersey. The question: can send objecy of class A and receive object of class B, if A has all B's members? Let me show an example: class A { String one; Date two; int three; } class B { Date two; int three; } Lets say, I have a REST service: class MyREST { @GET @Path("somepath") public void getThing() { return new A(); { and I call it with a code: Client client = Client.create(); WebResource scResource = client.resource("somePath"); MyClass result = scResource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).get(B.class);
0
11,542,317
07/18/2012 13:16:33
333,404
05/05/2010 12:04:29
378
18
Creating Azure Blob using Javascript
I wan't to create a blob using javascript and a SharedAccessSignature. All javascript files are deployed in the BlobStorage, where i want to upload my blob, so I hope Same Site Origin should be no problem. The Server sends the client the SharedAccessSignature and the client uploads the file/data into the blob storage. Is this possible? If yes: Is there a javascript library for blob handling? (I've found this [library][1], but it doesn't support PutBlob operations) If no: Is the best alternative approach, to implement the upload functionality in the according ASP.Net site and let javascript call some provided method? [1]: http://azureblobstoragejs.codeplex.com/releases/view/32114
javascript
azure
null
null
null
null
open
Creating Azure Blob using Javascript === I wan't to create a blob using javascript and a SharedAccessSignature. All javascript files are deployed in the BlobStorage, where i want to upload my blob, so I hope Same Site Origin should be no problem. The Server sends the client the SharedAccessSignature and the client uploads the file/data into the blob storage. Is this possible? If yes: Is there a javascript library for blob handling? (I've found this [library][1], but it doesn't support PutBlob operations) If no: Is the best alternative approach, to implement the upload functionality in the according ASP.Net site and let javascript call some provided method? [1]: http://azureblobstoragejs.codeplex.com/releases/view/32114
0
11,542,282
07/18/2012 13:15:02
1,514,111
07/10/2012 08:08:57
8
0
jquery put existing (reusable) functions in ajax request - cant use async:false
I have a few ajax functions* e.g. function MyFunctionA(PassingObj) { $.ajax({ url: '123.ashx',data: PassingObj, type: 'POST',contentType: 'application/json', success: function (data1) { return data1 } } }); function MyFunctionB(PassingObj) { $.ajax({ url: '456.ashx',data: PassingObj,type: 'POST', contentType: 'application/json', success: function (data2) { return data2 } } }); var GetValuesXY(){ var x = MyFunctionA(PassingObj); var y = MyFunctionB(PassingObj); return x + y; } MyFunctionA and MyFunction are general functions which are called all over the page and I dont want to implement callbacks if not possible, because they can be used in different situations. I cannot set the Ajax functions to async:false - the option is deprecated from v1.8 and I am not allowed to use it, and it has caused problems ([http://api.jquery.com/jQuery.ajax/][1]) So to confirm, I can never successfully call the function GetValuesXY(){} as x will always be undefined as it will continue without waiting for a result as it is asynchronous. Thus, Currently the only way i know how to handle the above is to merge the 2 and this is not acceptable in the situation: function MyFunctionA(PassingObj) { $.ajax({ url: '123.ashx',data: PassingObj,type: 'POST',contentType: 'application/json', success: function (data1) { $.ajax({ //MyFunctionB is effectively copied in here url: '456.ashx',data: PassingObj,type: 'POST',contentType: 'application/json', success: function (data2) { return data1 + data2 } } }); } } }); Now I cant use the two example functions seperately at all, and it is very very inefficient way of programming as I will possibly have an unlimited amount of permutations for this and i will have to cut and paste for each of these every time i want to use any of the functions Is it not possible to at least put the function calls in an ajax request? something to the tune of var myData1; var myData2; $.ajax({ call MyFunctionA(), success: function (data1) { myData1 = data1; $.ajax({ call MyFunctionB(), success: function (data2) { myData2 = data2; } } }); } } }); (* - these are just dummy functions for demo purposes) [1]: http://api.jquery.com/jQuery.ajax/
jquery
function
null
null
null
null
open
jquery put existing (reusable) functions in ajax request - cant use async:false === I have a few ajax functions* e.g. function MyFunctionA(PassingObj) { $.ajax({ url: '123.ashx',data: PassingObj, type: 'POST',contentType: 'application/json', success: function (data1) { return data1 } } }); function MyFunctionB(PassingObj) { $.ajax({ url: '456.ashx',data: PassingObj,type: 'POST', contentType: 'application/json', success: function (data2) { return data2 } } }); var GetValuesXY(){ var x = MyFunctionA(PassingObj); var y = MyFunctionB(PassingObj); return x + y; } MyFunctionA and MyFunction are general functions which are called all over the page and I dont want to implement callbacks if not possible, because they can be used in different situations. I cannot set the Ajax functions to async:false - the option is deprecated from v1.8 and I am not allowed to use it, and it has caused problems ([http://api.jquery.com/jQuery.ajax/][1]) So to confirm, I can never successfully call the function GetValuesXY(){} as x will always be undefined as it will continue without waiting for a result as it is asynchronous. Thus, Currently the only way i know how to handle the above is to merge the 2 and this is not acceptable in the situation: function MyFunctionA(PassingObj) { $.ajax({ url: '123.ashx',data: PassingObj,type: 'POST',contentType: 'application/json', success: function (data1) { $.ajax({ //MyFunctionB is effectively copied in here url: '456.ashx',data: PassingObj,type: 'POST',contentType: 'application/json', success: function (data2) { return data1 + data2 } } }); } } }); Now I cant use the two example functions seperately at all, and it is very very inefficient way of programming as I will possibly have an unlimited amount of permutations for this and i will have to cut and paste for each of these every time i want to use any of the functions Is it not possible to at least put the function calls in an ajax request? something to the tune of var myData1; var myData2; $.ajax({ call MyFunctionA(), success: function (data1) { myData1 = data1; $.ajax({ call MyFunctionB(), success: function (data2) { myData2 = data2; } } }); } } }); (* - these are just dummy functions for demo purposes) [1]: http://api.jquery.com/jQuery.ajax/
0