PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
47
30.1k
OpenStatus_id
int64
0
4
9,703,389
03/14/2012 13:58:06
1,242,232
03/01/2012 09:07:55
1
0
TWTweetComposeViewController not dismissing on iPad simulator
In my app I have an action sheet and one of its buttons opens the TWTweetComposeViewController modally. On iPhone simulator the cancel button on the tweet composer works fine and dismisses the view. However, on iPad simulator the cancel button does not work and the tweet composer view remains on the screen. It is even weirder because after pressing the cancel button, the keyboard retracts and the underlying views become active. It behaves as if the view has been dismissed but its is still there. The code I used when the user pressed the action button is: -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { NSString *buttonTitle = [actionSheet buttonTitleAtIndex:buttonIndex]; if ([buttonTitle isEqualToString:@"Open in Safari"]){ [[UIApplication sharedApplication] openURL:[self.webView.request URL]]; }else if ([buttonTitle isEqualToString:@"Twitter"]){ if ([TWTweetComposeViewController canSendTweet]){ TWTweetComposeViewController *tweetSheet = [[TWTweetComposeViewController alloc] init]; [tweetSheet addURL:[self.webView.request URL]]; tweetSheet.completionHandler = ^(TWTweetComposeViewControllerResult result){ if (result == TWTweetComposeViewControllerResultCancelled){ [self dismissModalViewControllerAnimated:YES]; } }; [self presentModalViewController:tweetSheet animated:YES]; }else { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Twitter error" message:@"You can't send a tweet right now, make sure your device has an internet connection and you have at least one Twitter account setup" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } } } Do you have any idea on how to solve this problem or is it a bug of the simulator? P.S.: My app is a tabbar app and this code is called from one of of the view controller of the tab bar.
ios5
twitter-api
modalviewcontroller
null
null
null
open
TWTweetComposeViewController not dismissing on iPad simulator === In my app I have an action sheet and one of its buttons opens the TWTweetComposeViewController modally. On iPhone simulator the cancel button on the tweet composer works fine and dismisses the view. However, on iPad simulator the cancel button does not work and the tweet composer view remains on the screen. It is even weirder because after pressing the cancel button, the keyboard retracts and the underlying views become active. It behaves as if the view has been dismissed but its is still there. The code I used when the user pressed the action button is: -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { NSString *buttonTitle = [actionSheet buttonTitleAtIndex:buttonIndex]; if ([buttonTitle isEqualToString:@"Open in Safari"]){ [[UIApplication sharedApplication] openURL:[self.webView.request URL]]; }else if ([buttonTitle isEqualToString:@"Twitter"]){ if ([TWTweetComposeViewController canSendTweet]){ TWTweetComposeViewController *tweetSheet = [[TWTweetComposeViewController alloc] init]; [tweetSheet addURL:[self.webView.request URL]]; tweetSheet.completionHandler = ^(TWTweetComposeViewControllerResult result){ if (result == TWTweetComposeViewControllerResultCancelled){ [self dismissModalViewControllerAnimated:YES]; } }; [self presentModalViewController:tweetSheet animated:YES]; }else { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Twitter error" message:@"You can't send a tweet right now, make sure your device has an internet connection and you have at least one Twitter account setup" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } } } Do you have any idea on how to solve this problem or is it a bug of the simulator? P.S.: My app is a tabbar app and this code is called from one of of the view controller of the tab bar.
0
5,401,454
03/23/2011 06:08:22
249,634
01/13/2010 09:03:23
423
14
Why objective-C is selected as platform for Cocoa why not C, C++?
Why objective is chooses as platform for cocoa or cocoa touch, why not other? What are main usages in Objective-c that are not in other languages. Please share, Thank you, Madan Mohan
objective-c
null
null
null
null
03/23/2011 11:40:34
not constructive
Why objective-C is selected as platform for Cocoa why not C, C++? === Why objective is chooses as platform for cocoa or cocoa touch, why not other? What are main usages in Objective-c that are not in other languages. Please share, Thank you, Madan Mohan
4
8,970,957
01/23/2012 11:33:20
754,905
05/15/2011 22:53:28
68
2
Title for UIButton won't appear
So I am trying to create a custom UIBarButtonItem, but I can't for the life of me figure out why the title won't show. Maybe someone else can spot it :\ Here is the code I use to create the bar button: + (UIBarButtonItem *)barButtonItemWithTitle:(NSString *)title normal:(UIImage *)normal highlighted:(UIImage *)highlight selected:(UIImage *)selected target:(id)target action:(SEL)action { UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setFrame:CGRectMake(0.0f, 0.0f, normal.size.width, normal.size.height)]; [button setTitle:title forState:UIControlStateNormal]; [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; [button setImage:normal forState:UIControlStateNormal]; [button setImage:selected forState:UIControlStateHighlighted]; [button setImage:selected forState:UIControlStateSelected]; return [[UIBarButtonItem alloc] initWithCustomView:button]; } self.navigationItem.leftBarButtonItem = [UIBarButtonItem barButtonItemWithTitle:@"Cancel" normal:[UIImage imageNamed:@"back_button_active.png"] highlighted:[UIImage imageNamed:@"back_button_highlight.png"] selected:[UIImage imageNamed:@"back_button_selected.png"] target:self action:@selector(popViewController)]; Any help would be appreciated! P.S. This is in iOS 5 using ARC.
iphone
ios4
ios5
uibutton
uibarbuttonitem
null
open
Title for UIButton won't appear === So I am trying to create a custom UIBarButtonItem, but I can't for the life of me figure out why the title won't show. Maybe someone else can spot it :\ Here is the code I use to create the bar button: + (UIBarButtonItem *)barButtonItemWithTitle:(NSString *)title normal:(UIImage *)normal highlighted:(UIImage *)highlight selected:(UIImage *)selected target:(id)target action:(SEL)action { UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setFrame:CGRectMake(0.0f, 0.0f, normal.size.width, normal.size.height)]; [button setTitle:title forState:UIControlStateNormal]; [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; [button setImage:normal forState:UIControlStateNormal]; [button setImage:selected forState:UIControlStateHighlighted]; [button setImage:selected forState:UIControlStateSelected]; return [[UIBarButtonItem alloc] initWithCustomView:button]; } self.navigationItem.leftBarButtonItem = [UIBarButtonItem barButtonItemWithTitle:@"Cancel" normal:[UIImage imageNamed:@"back_button_active.png"] highlighted:[UIImage imageNamed:@"back_button_highlight.png"] selected:[UIImage imageNamed:@"back_button_selected.png"] target:self action:@selector(popViewController)]; Any help would be appreciated! P.S. This is in iOS 5 using ARC.
0
1,724,708
11/12/2009 19:23:50
114,474
05/29/2009 18:27:43
455
32
When not to Use Integration Tests
I am writing an application that uses 3rd party libraries to instantiate and make some operations on virtualmachines. At first I was writing integration tests to every functionality of the application. But them I found that these tests were not really helping since my environment had to be at a determined state, which turned the tests more and more difficult to write. And I decided to make only the unit and acceptance tests. So, my question ... is/can there be method or a clue to notice when the integration tests are not to be used?? (or I am wrong and on all cases they should be written)
tdd
integration-testing
testing
null
null
null
open
When not to Use Integration Tests === I am writing an application that uses 3rd party libraries to instantiate and make some operations on virtualmachines. At first I was writing integration tests to every functionality of the application. But them I found that these tests were not really helping since my environment had to be at a determined state, which turned the tests more and more difficult to write. And I decided to make only the unit and acceptance tests. So, my question ... is/can there be method or a clue to notice when the integration tests are not to be used?? (or I am wrong and on all cases they should be written)
0
6,969,628
08/06/2011 23:16:59
583,781
01/21/2011 00:17:01
127
2
MySQL trigger needs tweaking
I have a trigger that sets a datetime field in a table row when a new row is inserted. (Don't bother lecturing me that I could do this in the table definition, I have second datetime field that is using that functionality already and you can only do it with one column per table.) This trigger works great for my purposes: CREATE TRIGGER foobar_insert BEFORE INSERT ON foobar FOR EACH ROW SET NEW.created=NOW(); So whenever a new row is inserted, `foobar.created` gets set to the current time. This is great when I do something like: > INSERT INTO foobar (foo) VALUES ('bar'); The only problem with this is that if I want to explicitly set `foobar.created` in the insert statement, it gets overridden by the trigger. So, > INSERT INTO foobar (foo,created) VALUES ('foo','2006-01-01 12:12:12'); results in `foobar.created` equaling the time of the insert, not the time specified in the insert statement. So my question is: How can I change my trigger to only set `foobar.created` if it doesn't already have a value?
mysql
triggers
null
null
null
null
open
MySQL trigger needs tweaking === I have a trigger that sets a datetime field in a table row when a new row is inserted. (Don't bother lecturing me that I could do this in the table definition, I have second datetime field that is using that functionality already and you can only do it with one column per table.) This trigger works great for my purposes: CREATE TRIGGER foobar_insert BEFORE INSERT ON foobar FOR EACH ROW SET NEW.created=NOW(); So whenever a new row is inserted, `foobar.created` gets set to the current time. This is great when I do something like: > INSERT INTO foobar (foo) VALUES ('bar'); The only problem with this is that if I want to explicitly set `foobar.created` in the insert statement, it gets overridden by the trigger. So, > INSERT INTO foobar (foo,created) VALUES ('foo','2006-01-01 12:12:12'); results in `foobar.created` equaling the time of the insert, not the time specified in the insert statement. So my question is: How can I change my trigger to only set `foobar.created` if it doesn't already have a value?
0
4,720,957
01/18/2011 06:02:00
563,564
01/05/2011 06:51:21
27
2
problem with maven
i have download project from svn and try to deply it it will give me error like dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.primefaces:primefaces:jar -> duplicate declaration of version 2.1 @ com.icijapan.onit:servlet:${parent.version} (C:\WorkSpace\ONiT\servlet\pom.xml) what should i do for that
maven
null
null
null
null
null
open
problem with maven === i have download project from svn and try to deply it it will give me error like dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.primefaces:primefaces:jar -> duplicate declaration of version 2.1 @ com.icijapan.onit:servlet:${parent.version} (C:\WorkSpace\ONiT\servlet\pom.xml) what should i do for that
0
3,402,535
08/04/2010 04:18:28
146,857
07/29/2009 06:11:50
4,922
239
Suggestion for this kind of execution in asp.net
I have a web application that sends a single sms to multiple numbers via gsm.Every user has this application in his local system. I am able to send messages one by one. Thus far i have only 10 numbers so there is no problem. Consider i have a file having 10000 mobile numbers, - what will happen to my execution time? - What is your suggestion for this scenario? **NOTE:**<br/> I dont use an sms gateway because its a simple application which ll be hosted in IIS of my user system only..
asp.net
timeout
execution
null
null
null
open
Suggestion for this kind of execution in asp.net === I have a web application that sends a single sms to multiple numbers via gsm.Every user has this application in his local system. I am able to send messages one by one. Thus far i have only 10 numbers so there is no problem. Consider i have a file having 10000 mobile numbers, - what will happen to my execution time? - What is your suggestion for this scenario? **NOTE:**<br/> I dont use an sms gateway because its a simple application which ll be hosted in IIS of my user system only..
0
8,628,320
12/25/2011 05:13:29
975,566
10/02/2011 16:27:04
1,256
0
Does a derived class always have to call the default base constructor using UNITY?
I have the following: public class BaseController : Controller { protected ISequenceService _sequence; public BaseController() { } [InjectionConstructor] public BaseController(ISequenceService sequence) { _sequence = sequence; } public class ProductsController : BaseController { public ProductsController( IService<Account> accountService, IService<Product> productService ) { _account = accountService; _product = productService; } I have been trying everything I can think of to get the BaseController **one parameter** constructor parameter called. However the parameterless constructor is always called. When I remove the parameterless constructor I get an error. Is it possible to have a derived class and no parameterless constructor in the parent ? Is there some way that I can configure Unity to call the one parameter constructor?
c#
null
null
null
null
null
open
Does a derived class always have to call the default base constructor using UNITY? === I have the following: public class BaseController : Controller { protected ISequenceService _sequence; public BaseController() { } [InjectionConstructor] public BaseController(ISequenceService sequence) { _sequence = sequence; } public class ProductsController : BaseController { public ProductsController( IService<Account> accountService, IService<Product> productService ) { _account = accountService; _product = productService; } I have been trying everything I can think of to get the BaseController **one parameter** constructor parameter called. However the parameterless constructor is always called. When I remove the parameterless constructor I get an error. Is it possible to have a derived class and no parameterless constructor in the parent ? Is there some way that I can configure Unity to call the one parameter constructor?
0
6,848,608
07/27/2011 17:26:01
865,960
07/27/2011 17:22:16
1
0
SQLite foreign key mismatch
<pre> Why am I getting a SQLite "foreign key mismatch" error when Executing DELETE FROM rlsconfig WHERE importer_config_id=2 and program_mode_config_id=1 Where CREATE TABLE [RLSConfig] ( "rlsconfig_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "importer_config_id" integer NOT NULL, "program_mode_config_id" integer NOT NULL, "l2_channel_config_id" integer NOT NULL, "rls_fixed_width" integer NOT NULL , FOREIGN KEY ([importer_config_id]) REFERENCES [ImporterConfig]([importer_config_id]), FOREIGN KEY ([program_mode_config_id]) REFERENCES [ImporterConfig]([importer_config_id]), FOREIGN KEY ([importer_config_id]) REFERENCES [ImporterConfig]([program_mode_config_id]), FOREIGN KEY ([program_mode_config_id]) REFERENCES [ImporterConfig]([program_mode_config_id]) ) and CREATE TABLE [ImporterConfig] ( "importer_config_id" integer NOT NULL, "program_mode_config_id" integer NOT NULL, "selected" integer NOT NULL DEFAULT 0, "combined_config_id" integer NOT NULL, "description" varchar(50) NOT NULL COLLATE NOCASE, "date_created" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP), PRIMARY KEY ([program_mode_config_id], [importer_config_id]) , FOREIGN KEY ([program_mode_config_id]) REFERENCES [ProgramModeConfig]([program_mode_config_id]) ) </pre>
sqlite
null
null
null
null
null
open
SQLite foreign key mismatch === <pre> Why am I getting a SQLite "foreign key mismatch" error when Executing DELETE FROM rlsconfig WHERE importer_config_id=2 and program_mode_config_id=1 Where CREATE TABLE [RLSConfig] ( "rlsconfig_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "importer_config_id" integer NOT NULL, "program_mode_config_id" integer NOT NULL, "l2_channel_config_id" integer NOT NULL, "rls_fixed_width" integer NOT NULL , FOREIGN KEY ([importer_config_id]) REFERENCES [ImporterConfig]([importer_config_id]), FOREIGN KEY ([program_mode_config_id]) REFERENCES [ImporterConfig]([importer_config_id]), FOREIGN KEY ([importer_config_id]) REFERENCES [ImporterConfig]([program_mode_config_id]), FOREIGN KEY ([program_mode_config_id]) REFERENCES [ImporterConfig]([program_mode_config_id]) ) and CREATE TABLE [ImporterConfig] ( "importer_config_id" integer NOT NULL, "program_mode_config_id" integer NOT NULL, "selected" integer NOT NULL DEFAULT 0, "combined_config_id" integer NOT NULL, "description" varchar(50) NOT NULL COLLATE NOCASE, "date_created" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP), PRIMARY KEY ([program_mode_config_id], [importer_config_id]) , FOREIGN KEY ([program_mode_config_id]) REFERENCES [ProgramModeConfig]([program_mode_config_id]) ) </pre>
0
9,732,032
03/16/2012 04:46:41
1,273,222
03/16/2012 04:38:26
1
0
Dashboard Shuffle Button
Wouldn't it be cool if SoundCloud had a "shuffle button" to shuffle playback of dashboard tracks? I think it would be a fun way to discover music from artists you are following. Anybody working on such a feature?
dashboard
shuffle
soundcloud
discover
null
03/16/2012 23:50:18
off topic
Dashboard Shuffle Button === Wouldn't it be cool if SoundCloud had a "shuffle button" to shuffle playback of dashboard tracks? I think it would be a fun way to discover music from artists you are following. Anybody working on such a feature?
2
11,044,776
06/15/2012 04:53:40
1,457,811
06/15/2012 04:51:48
1
0
Exception in thread "main" java.lang.UnsatisfiedLinkError:+ The specified procedure could not be found
I am having the same problem as described in the above thread. Scenario: I am calling C++ dll as "SubscriberSDK.dll" in my Java application. This c++ dll is dependent on "QtCore4.dll" as i used its lib file while building this C++ dll. Hence i placed both dlls SubscriberSDK.dll & QtCore4.dll in the same directory. In java application, i used statement as "System.loadLibrary("SubscriberSDK");" But while running, i am getting following error: *Exception in thread "main" java.lang.UnsatisfiedLinkError:+ The specified procedure could not be found* Solution: To solve this problem, I explicitly load both dlls as following: - System.loadLibrary("QtCore4"); - System.loadLibrary("SubscriberSDK"); Summary: Explicitly load all the dependent dlls while using JNI.
jni
null
null
null
null
06/16/2012 07:54:55
not a real question
Exception in thread "main" java.lang.UnsatisfiedLinkError:+ The specified procedure could not be found === I am having the same problem as described in the above thread. Scenario: I am calling C++ dll as "SubscriberSDK.dll" in my Java application. This c++ dll is dependent on "QtCore4.dll" as i used its lib file while building this C++ dll. Hence i placed both dlls SubscriberSDK.dll & QtCore4.dll in the same directory. In java application, i used statement as "System.loadLibrary("SubscriberSDK");" But while running, i am getting following error: *Exception in thread "main" java.lang.UnsatisfiedLinkError:+ The specified procedure could not be found* Solution: To solve this problem, I explicitly load both dlls as following: - System.loadLibrary("QtCore4"); - System.loadLibrary("SubscriberSDK"); Summary: Explicitly load all the dependent dlls while using JNI.
1
10,711,517
05/22/2012 23:29:33
379,888
06/30/2010 09:47:17
1,689
44
Turning error reporting off php
I wanted to turn off the error reporting on a website. Googling for it I found that placing the code mentioned below in the website stops the errors from getting displayed on the screen. I placed it into my website but it did not worked. Please help me out. Thanks <?php error_reporting(0); // Turn off all error reporting ?>
php
null
null
null
null
05/23/2012 01:57:02
not a real question
Turning error reporting off php === I wanted to turn off the error reporting on a website. Googling for it I found that placing the code mentioned below in the website stops the errors from getting displayed on the screen. I placed it into my website but it did not worked. Please help me out. Thanks <?php error_reporting(0); // Turn off all error reporting ?>
1
8,973,963
01/23/2012 15:21:50
150,062
08/04/2009 00:07:17
868
23
PHP File Injection?
I have a script that calls a bash script that does some processing, but the script calls the bash script using user inputed data. I am wondering if there is a way to make sure the person (it's a file upload) doesn't append like `;cd /;rm -rf *` to the end of the file. Or anything else like that. Would a normal MYSQL Injection methods work? Is there a better alternative?
php
null
null
null
null
null
open
PHP File Injection? === I have a script that calls a bash script that does some processing, but the script calls the bash script using user inputed data. I am wondering if there is a way to make sure the person (it's a file upload) doesn't append like `;cd /;rm -rf *` to the end of the file. Or anything else like that. Would a normal MYSQL Injection methods work? Is there a better alternative?
0
11,625,034
07/24/2012 06:05:24
1,547,694
07/24/2012 05:56:23
1
0
Selecting value either from dependent or independent table?
I have three tables An Employee Table, a employeeDependents Table, and a Medicare table. The procedure i want to make is either employee or its dependent is provided with mediacal care. now I want to put the primary key of either employee or dependent in the table of Medicare. My question is how i can get one value from both tables. There is a one to many relationship from employee to employee dependent. hope you understand Thanks in Advance
table
multiple
values
null
null
null
open
Selecting value either from dependent or independent table? === I have three tables An Employee Table, a employeeDependents Table, and a Medicare table. The procedure i want to make is either employee or its dependent is provided with mediacal care. now I want to put the primary key of either employee or dependent in the table of Medicare. My question is how i can get one value from both tables. There is a one to many relationship from employee to employee dependent. hope you understand Thanks in Advance
0
4,899,384
02/04/2011 14:56:14
349,719
05/25/2010 08:34:15
80
4
Good resource books/sites for learning MVC3 in detail
What are the best books and/or online resources for learning MVC3 **comprehensively** (not looking for just documentation) or am I best off waiting until June for the Galloway/Haack/Wilson book?
books
asp.net-mvc-3
null
null
null
10/02/2011 00:33:56
not constructive
Good resource books/sites for learning MVC3 in detail === What are the best books and/or online resources for learning MVC3 **comprehensively** (not looking for just documentation) or am I best off waiting until June for the Galloway/Haack/Wilson book?
4
7,028,904
08/11/2011 15:47:37
890,264
08/11/2011 15:47:37
1
0
System.IO.FileNotFoundException when executing CLR Stored Procedure to run a Cognos Report
Good Morning. I am currently experiencing an issue with a CLR Stored procedure calling an assembly created in Visual Basic (VS 2008). At the highest level, the assembly executes a report contained in Cognos8 and moves the output to a specificed directory on the network. I have no issue when calling the method from a simple test EXE, but when I try to execute via the CLR stored procedure, I am getting the following: Msg 6522, Level 16, State 1, Procedure ReportRunner, Line 0 A .NET Framework error occurred during execution of user-defined routine or aggregate "ReportRunner": System.IO.FileNotFoundException: Could not load file or assembly 'cognosdotnetassembly_2_0, Version=10.1.4707.501, Culture=neutral, PublicKeyToken=d6e6d7d808b7e5b7' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.LoadWithPartialNameInternal(String partialName, Evidence securityEvidence, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadWithPartialName(String partialName, Evidence securityEvidence) at System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly(Type type, String defaultNamespace, XmlSerializerImplementation& contract) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) at System.Web.Services.Protocols.SoapClientType..ctor(Type type) at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() at cognosdotnet_2_0.reportService1..ctor() at ReportRunnerv3.ReportRunner.ExecuteReport(Int32 inPLAN_ID, Int32 inContract_Sfx, String inRptDate_DT, String inPlanType, String inInvstmentOnlyInd, String inMOMInd, String inGPSIInd, String inPBTInd, String inPICAInd, String inClientAccomInd, String inInstSelectInd, String inRptType, Int32& outRC) Notes •cognosdotnetassembly_2_0 is located in the same directory as the "ReportRunner" assembly •cognosdotnetassembly_2_0 was cataloged using CREATE ASSEMBLY with permission set = unsafe •cognosdotnetassembly_2_0 is also installed in the GAC The following is the message provided by fuslogvw.exe: *** Assembly Binder Log Entry (8/11/2011 @ 5:57:39 AM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll Running under executable c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\Binn\sqlservr.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = NT AUTHORITY\NETWORK SERVICE LOG: DisplayName = cognosdotnetassembly_2_0, Version=10.1.4707.501, Culture=neutral, PublicKeyToken=d6e6d7d808b7e5b7 (Fully-specified) LOG: Appbase = file:///c:/Program Files/Microsoft SQL Server/MSSQL10_50.SQLEXPRESS/MSSQL/Binn/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = NULL Calling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. === LOG: This bind starts in default load context. LOG: No application configuration file found. LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Post-policy reference: cognosdotnetassembly_2_0, Version=10.1.4707.501, Culture=neutral, PublicKeyToken=d6e6d7d808b7e5b7 LOG: Fusion is hosted. Check host about this assembly. LOG: Assembly is not in CLR Loaded list. Asking host assembly store. LOG: Try host assembly store with assembly cognosdotnetassembly_2_0, version=10.1.4707.501, culture=neutral, publickeytoken=d6e6d7d808b7e5b7, processorarchitecture=x86. LOG: Try host assembly store with assembly cognosdotnetassembly_2_0, version=10.1.4707.501, culture=neutral, publickeytoken=d6e6d7d808b7e5b7, processorarchitecture=msil. LOG: Try host assembly store with assembly cognosdotnetassembly_2_0, version=10.1.4707.501, culture=neutral, publickeytoken=d6e6d7d808b7e5b7. WRN: Host assembly store does not contain this assembly. ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002). Can someone provide insight as to why SQL Server is unable to find cognosdotnetassembly_2_0? If you need more information, please let me know. Thanks for your assistance. --Chris
.net
sql-server-2008
sdk
cognos
clrstoredprocedure
null
open
System.IO.FileNotFoundException when executing CLR Stored Procedure to run a Cognos Report === Good Morning. I am currently experiencing an issue with a CLR Stored procedure calling an assembly created in Visual Basic (VS 2008). At the highest level, the assembly executes a report contained in Cognos8 and moves the output to a specificed directory on the network. I have no issue when calling the method from a simple test EXE, but when I try to execute via the CLR stored procedure, I am getting the following: Msg 6522, Level 16, State 1, Procedure ReportRunner, Line 0 A .NET Framework error occurred during execution of user-defined routine or aggregate "ReportRunner": System.IO.FileNotFoundException: Could not load file or assembly 'cognosdotnetassembly_2_0, Version=10.1.4707.501, Culture=neutral, PublicKeyToken=d6e6d7d808b7e5b7' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.LoadWithPartialNameInternal(String partialName, Evidence securityEvidence, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadWithPartialName(String partialName, Evidence securityEvidence) at System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly(Type type, String defaultNamespace, XmlSerializerImplementation& contract) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) at System.Web.Services.Protocols.SoapClientType..ctor(Type type) at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() at cognosdotnet_2_0.reportService1..ctor() at ReportRunnerv3.ReportRunner.ExecuteReport(Int32 inPLAN_ID, Int32 inContract_Sfx, String inRptDate_DT, String inPlanType, String inInvstmentOnlyInd, String inMOMInd, String inGPSIInd, String inPBTInd, String inPICAInd, String inClientAccomInd, String inInstSelectInd, String inRptType, Int32& outRC) Notes •cognosdotnetassembly_2_0 is located in the same directory as the "ReportRunner" assembly •cognosdotnetassembly_2_0 was cataloged using CREATE ASSEMBLY with permission set = unsafe •cognosdotnetassembly_2_0 is also installed in the GAC The following is the message provided by fuslogvw.exe: *** Assembly Binder Log Entry (8/11/2011 @ 5:57:39 AM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll Running under executable c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\Binn\sqlservr.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = NT AUTHORITY\NETWORK SERVICE LOG: DisplayName = cognosdotnetassembly_2_0, Version=10.1.4707.501, Culture=neutral, PublicKeyToken=d6e6d7d808b7e5b7 (Fully-specified) LOG: Appbase = file:///c:/Program Files/Microsoft SQL Server/MSSQL10_50.SQLEXPRESS/MSSQL/Binn/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = NULL Calling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. === LOG: This bind starts in default load context. LOG: No application configuration file found. LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Post-policy reference: cognosdotnetassembly_2_0, Version=10.1.4707.501, Culture=neutral, PublicKeyToken=d6e6d7d808b7e5b7 LOG: Fusion is hosted. Check host about this assembly. LOG: Assembly is not in CLR Loaded list. Asking host assembly store. LOG: Try host assembly store with assembly cognosdotnetassembly_2_0, version=10.1.4707.501, culture=neutral, publickeytoken=d6e6d7d808b7e5b7, processorarchitecture=x86. LOG: Try host assembly store with assembly cognosdotnetassembly_2_0, version=10.1.4707.501, culture=neutral, publickeytoken=d6e6d7d808b7e5b7, processorarchitecture=msil. LOG: Try host assembly store with assembly cognosdotnetassembly_2_0, version=10.1.4707.501, culture=neutral, publickeytoken=d6e6d7d808b7e5b7. WRN: Host assembly store does not contain this assembly. ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002). Can someone provide insight as to why SQL Server is unable to find cognosdotnetassembly_2_0? If you need more information, please let me know. Thanks for your assistance. --Chris
0
5,630,760
04/12/2011 05:24:32
76,509
03/11/2009 05:45:04
1,035
3
How to get swf's url on swc library
I'am a beginner of ActionScript3 I wanna get swf's url. but I develop swc lib. swf(Main) develop other developer. I have to get from Main loaderinfo, I / F is already fixed. Do you have a good idea?
actionscript-3
actionscript
swf
swc
null
null
open
How to get swf's url on swc library === I'am a beginner of ActionScript3 I wanna get swf's url. but I develop swc lib. swf(Main) develop other developer. I have to get from Main loaderinfo, I / F is already fixed. Do you have a good idea?
0
3,227,637
07/12/2010 10:27:06
387,129
07/08/2010 20:21:08
12
0
How to get data for UITableViewController in an iphone app
I have a main View that has a table which has it's own controller. How can I pass an array from the main controller to the table controller? (I use interface builder maybe i need to init the view programatically?)
iphone
objective-c
xcode
uiview
null
null
open
How to get data for UITableViewController in an iphone app === I have a main View that has a table which has it's own controller. How can I pass an array from the main controller to the table controller? (I use interface builder maybe i need to init the view programatically?)
0
1,788,433
11/24/2009 07:25:56
134,202
07/07/2009 11:41:28
284
2
XAML for Three way splitter in WPF.
I want to split the main window in three way Grid Spliiter same alike outlook style. and all the controls nested inside in the three window is resized using Grid Splitter. I am trying to that using defining Row Definition of Grid and placing each control in Row 1 or column 1.. If any body has some kind of template to kick start with this kind of layout.. I don't want too complex sample..
wpf
null
null
null
null
null
open
XAML for Three way splitter in WPF. === I want to split the main window in three way Grid Spliiter same alike outlook style. and all the controls nested inside in the three window is resized using Grid Splitter. I am trying to that using defining Row Definition of Grid and placing each control in Row 1 or column 1.. If any body has some kind of template to kick start with this kind of layout.. I don't want too complex sample..
0
7,509,573
09/22/2011 04:29:43
648,290
03/07/2011 14:25:02
156
1
string as parameter in a function
i wrote a function to search if its parameter is in a given table obtab1.txt....the optab table has two columns out of which the parameter can only be in the first column....in the aviasm.h file i wrote this code.... class aviasm { public: aviasm(char *,char *); ~aviasm(); void crsymtab(); bool in1(string ); } In the aviasm.cpp file i wrote... bool aviasm::in1(string s) { ifstream in("optab1.txt",ios::in);//opening the optab1.txt char c; string x,y; while((c=in.get())!=EOF) { in.putback(c);//putting back the charcter into stream in>>x;//first field in>>y; if(x==s) return true; else return false; } } but i encountered several errors on compiling.... 'bool aviasm::in1(std::string)' : overloaded member function not found in 'aviasm' 'aviasm::in1' : function does not take 1 arguments 'syntax error : identifier 'string' ...can anybody help??
c++
string
null
null
null
null
open
string as parameter in a function === i wrote a function to search if its parameter is in a given table obtab1.txt....the optab table has two columns out of which the parameter can only be in the first column....in the aviasm.h file i wrote this code.... class aviasm { public: aviasm(char *,char *); ~aviasm(); void crsymtab(); bool in1(string ); } In the aviasm.cpp file i wrote... bool aviasm::in1(string s) { ifstream in("optab1.txt",ios::in);//opening the optab1.txt char c; string x,y; while((c=in.get())!=EOF) { in.putback(c);//putting back the charcter into stream in>>x;//first field in>>y; if(x==s) return true; else return false; } } but i encountered several errors on compiling.... 'bool aviasm::in1(std::string)' : overloaded member function not found in 'aviasm' 'aviasm::in1' : function does not take 1 arguments 'syntax error : identifier 'string' ...can anybody help??
0
9,365,407
02/20/2012 17:17:03
1,061,834
11/23/2011 11:53:17
15
0
BSc: Choosing essay topic - help needed
Im really..really not sure to whether a question like this one fits here on stackoverflow, but it's worth a try. So basically im doing my undergradute degree essay this term, but i've had major problems choosing a topic. Weeks have past by now, and im still without a project. All the things i've thought of didn't really suit this kind of work since the primarly work burden lay on programming which should not instead investigation and analysis are prioritized. And aslo the subject should be interesting from a CS point of view. I would really like to write about something regarding computer securite or any algorithmic problem, with some interesting problem statments. Other suggestions are also highly appricated :) /Y
algorithm
security
essay
null
null
02/20/2012 17:22:37
not constructive
BSc: Choosing essay topic - help needed === Im really..really not sure to whether a question like this one fits here on stackoverflow, but it's worth a try. So basically im doing my undergradute degree essay this term, but i've had major problems choosing a topic. Weeks have past by now, and im still without a project. All the things i've thought of didn't really suit this kind of work since the primarly work burden lay on programming which should not instead investigation and analysis are prioritized. And aslo the subject should be interesting from a CS point of view. I would really like to write about something regarding computer securite or any algorithmic problem, with some interesting problem statments. Other suggestions are also highly appricated :) /Y
4
2,979,997
06/05/2010 10:37:51
359,138
06/05/2010 10:31:12
1
0
Need to make a simple C++ project with Sqlite
I just research the sqlite3! i dont know the way to connect database - it's maked by sqlite - to C++ project! Could you help me create a example, please? Thanks so much everybody!
sqlite
null
null
null
null
06/13/2012 19:37:52
not constructive
Need to make a simple C++ project with Sqlite === I just research the sqlite3! i dont know the way to connect database - it's maked by sqlite - to C++ project! Could you help me create a example, please? Thanks so much everybody!
4
5,659,208
04/14/2011 06:04:59
588,418
01/25/2011 02:41:00
20
0
how can string to int? (no output)
import java.io.*; public class Thamer { public static void main(String args[]) { String str = "thamer"; //approach 1: to convert String to int int int1 = Integer.parseInt(str); System.out.println( "int1 = " + int1 ); //approach 2: to convert String to int int int2 = Integer.valueOf(str); System.out.println( "int2 = " + int2 ); } } /*public class Thamer { public static void main(String [] args) { String [] a={"thamer","waleed","thai"}; for(i=0; i<a.length; i++) int m=Integer.parseInt.(a); System.out.println(m); } }*/
java
null
null
null
null
04/15/2011 14:39:39
not a real question
how can string to int? (no output) === import java.io.*; public class Thamer { public static void main(String args[]) { String str = "thamer"; //approach 1: to convert String to int int int1 = Integer.parseInt(str); System.out.println( "int1 = " + int1 ); //approach 2: to convert String to int int int2 = Integer.valueOf(str); System.out.println( "int2 = " + int2 ); } } /*public class Thamer { public static void main(String [] args) { String [] a={"thamer","waleed","thai"}; for(i=0; i<a.length; i++) int m=Integer.parseInt.(a); System.out.println(m); } }*/
1
10,387,416
04/30/2012 16:49:53
427,619
08/22/2010 12:35:29
1
0
how to create a new sub domain in amazon ec2
I have installed amazon ami image in a free instance and installed PHP and httpd. Now I am not able to setup a new sub domain or map multiple domain. I have changed the A record of the main domain. Any thoughts how to do this ?
amazon-ec2
null
null
null
null
05/02/2012 14:47:01
off topic
how to create a new sub domain in amazon ec2 === I have installed amazon ami image in a free instance and installed PHP and httpd. Now I am not able to setup a new sub domain or map multiple domain. I have changed the A record of the main domain. Any thoughts how to do this ?
2
9,215,505
02/09/2012 17:14:04
1,020,171
09/04/2011 06:07:15
318
15
How to extract textual contents from a web page?
I'm developing an application in java which can take textual information from different web pages and will summarize it into one page.For example,suppose I have a news on different web pages like Hindu,Times of India,Statesman,etc.Now my application is supposed to extract important points from each one of these pages and will put them together as a single news.The application is based on concepts of web content mining.As a beginner to this field,I can't understand where to start off.I have gone through research papers which explains noise removal as first step in buiding this application. So,if I'm given a news web page the very first step is to extract main news from the page excluding hyperlinks,advertisements,useless images,etc. My question is how can I do this ? Please give me some good tutorials which explains the implementation of such kind of application using web content mining.Or at least give me some hint how to accomplish it ?
java
web
data-mining
text-mining
web-mining
03/03/2012 00:15:57
not a real question
How to extract textual contents from a web page? === I'm developing an application in java which can take textual information from different web pages and will summarize it into one page.For example,suppose I have a news on different web pages like Hindu,Times of India,Statesman,etc.Now my application is supposed to extract important points from each one of these pages and will put them together as a single news.The application is based on concepts of web content mining.As a beginner to this field,I can't understand where to start off.I have gone through research papers which explains noise removal as first step in buiding this application. So,if I'm given a news web page the very first step is to extract main news from the page excluding hyperlinks,advertisements,useless images,etc. My question is how can I do this ? Please give me some good tutorials which explains the implementation of such kind of application using web content mining.Or at least give me some hint how to accomplish it ?
1
8,564,445
12/19/2011 16:37:23
1,106,286
12/19/2011 16:24:03
1
0
Get VM Arguments using JNI
I'd like to know if it is possible to get the VM arguments using JNI? Using the Invocation API allows you to specify the VM arguments if you are creating your own JVM. What I'd like to be able to do is query these arguments in JNI from an already running JVM that has been lauched using the normal Java launcher. I believe that it must be possible because JMX is able to do so. I've searched quite extensivley for this and as yet have not found a solution. Thanks in advance CND PS. I know it is possible to query these using RuntimeMXBean.getInputArguments() but I need to do this natively in JNI.
java
jni
null
null
null
null
open
Get VM Arguments using JNI === I'd like to know if it is possible to get the VM arguments using JNI? Using the Invocation API allows you to specify the VM arguments if you are creating your own JVM. What I'd like to be able to do is query these arguments in JNI from an already running JVM that has been lauched using the normal Java launcher. I believe that it must be possible because JMX is able to do so. I've searched quite extensivley for this and as yet have not found a solution. Thanks in advance CND PS. I know it is possible to query these using RuntimeMXBean.getInputArguments() but I need to do this natively in JNI.
0
840,557
05/08/2009 16:01:20
54,420
09/16/2008 01:17:00
1,912
118
Generic List Equivalent of DataTable.Rows.Find using VB.NET?
I am converting DataTables to a generic list and need a quick and easy way to implement a Find function. It seems I am going to have to use a Predicate. Upon further investigation, I still can't seem to re-create the functionality. I have this predicate... Private Function ByKey(ByVal Instance As MyClass) As Boolean Return Instance.Key = "I NEED THIS COMPARISON TO BE DYNAMIC!" End Function And then calling it like this... Dim Blah As MyClass = MyList.Find(AddressOf ByKey) But I have no way to pass in a key variable to this predicate to do the comparison, as I used to do with DataTable... Dim MyRow as DataRow = MyTable.Rows.Find(KeyVariable) How can I setup a predicate delegate function in VB.NET to accomplish this? Do not recommend LINQ or lambdas because this is question is regarding .NET version 2.0.
vb.net
.net-2.0
null
null
null
null
open
Generic List Equivalent of DataTable.Rows.Find using VB.NET? === I am converting DataTables to a generic list and need a quick and easy way to implement a Find function. It seems I am going to have to use a Predicate. Upon further investigation, I still can't seem to re-create the functionality. I have this predicate... Private Function ByKey(ByVal Instance As MyClass) As Boolean Return Instance.Key = "I NEED THIS COMPARISON TO BE DYNAMIC!" End Function And then calling it like this... Dim Blah As MyClass = MyList.Find(AddressOf ByKey) But I have no way to pass in a key variable to this predicate to do the comparison, as I used to do with DataTable... Dim MyRow as DataRow = MyTable.Rows.Find(KeyVariable) How can I setup a predicate delegate function in VB.NET to accomplish this? Do not recommend LINQ or lambdas because this is question is regarding .NET version 2.0.
0
180,573
10/07/2008 21:44:13
5,324
09/09/2008 06:49:51
1,693
88
Visual Studio Express any good ?
We all know Visual Studio is one of the best IDEs out there but what about the free Express edition. Is it any good ? Would any of you use it for serious work ?
visual-studio
ide
null
null
null
09/01/2011 13:31:20
not constructive
Visual Studio Express any good ? === We all know Visual Studio is one of the best IDEs out there but what about the free Express edition. Is it any good ? Would any of you use it for serious work ?
4
4,562,697
12/30/2010 12:46:42
380,890
07/01/2010 08:40:49
72
4
Getting the parent node of selected node in RadTreeView?
I have a RadTreeView and a lot of nodes in this treeview. what i want to do is, when a node clicked i want to get the top parent node. How can i do this? the structure is like this : 1. Parent<br /> 2. Child<br /> 3.Child's child<br /> 4.selected node<br /> 3.Child's child<br /> 3.Child's child<br /> when i select the "4.selected node" i want to be able to get the top parent node not by calling the method three times.
telerik
radtreeview
null
null
null
null
open
Getting the parent node of selected node in RadTreeView? === I have a RadTreeView and a lot of nodes in this treeview. what i want to do is, when a node clicked i want to get the top parent node. How can i do this? the structure is like this : 1. Parent<br /> 2. Child<br /> 3.Child's child<br /> 4.selected node<br /> 3.Child's child<br /> 3.Child's child<br /> when i select the "4.selected node" i want to be able to get the top parent node not by calling the method three times.
0
6,474,310
06/24/2011 22:13:54
70,226
02/24/2009 06:16:15
655
26
"yield outside of block" while trying to use activerecord-jdbcmysql-adapter
this happens when i deploy my app to glassfish as a war: [#|2011-06-24T17:11:40.903-0500|INFO|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=135;_ThreadName=Thread-1;|PWC1412: WebModule[null] ServletContext.log():/!\ FAILSAFE /!\ Fri Jun 24 17:11:40 -0500 2011 Status: 500 Internal Server Error yield called out of block /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/connection.rb:91:in `tap' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/connection.rb:91:in `initialize' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/adapter.rb:31:in `new' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/adapter.rb:31:in `initialize' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/mysql/adapter.rb:396:in `initialize' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/connection_methods.rb:6:in `new' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/connection_methods.rb:6:in `jdbc_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/mysql/connection_methods.rb:18:in `mysql_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout' classpath:/META-INF/jruby.home/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:9:in `cache' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:28:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/string_coercion.rb:25:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/rack-1.1.0/lib/rack/head.rb:9:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/params_parser.rb:15:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/session/cookie_store.rb:99:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/failsafe.rb:26:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:114:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/reloader.rb:34:in `run' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:108:in `call' classpath:/rack/adapter/rails.rb:36:in `serve_rails' classpath:/rack/adapter/rails.rb:41:in `call' classpath:/jruby/rack/rails.rb:180:in `call' classpath:/rack/handler/servlet.rb:19:in `call' <script>:2 |#] it works perfectly fine under webrick on my local machine, but does this crap when i try to roll it out to a qa server. ideas?
mysql
activerecord
jruby
null
null
null
open
"yield outside of block" while trying to use activerecord-jdbcmysql-adapter === this happens when i deploy my app to glassfish as a war: [#|2011-06-24T17:11:40.903-0500|INFO|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=135;_ThreadName=Thread-1;|PWC1412: WebModule[null] ServletContext.log():/!\ FAILSAFE /!\ Fri Jun 24 17:11:40 -0500 2011 Status: 500 Internal Server Error yield called out of block /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/connection.rb:91:in `tap' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/connection.rb:91:in `initialize' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/adapter.rb:31:in `new' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/adapter.rb:31:in `initialize' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/mysql/adapter.rb:396:in `initialize' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/connection_methods.rb:6:in `new' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/jdbc/connection_methods.rb:6:in `jdbc_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.2/lib/arjdbc/mysql/connection_methods.rb:18:in `mysql_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout' classpath:/META-INF/jruby.home/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:9:in `cache' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:28:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/string_coercion.rb:25:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/rack-1.1.0/lib/rack/head.rb:9:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/params_parser.rb:15:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/session/cookie_store.rb:99:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/failsafe.rb:26:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:114:in `call' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/reloader.rb:34:in `run' /home/glassfish/glassfish/domains/domain1/applications/trainer-web/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:108:in `call' classpath:/rack/adapter/rails.rb:36:in `serve_rails' classpath:/rack/adapter/rails.rb:41:in `call' classpath:/jruby/rack/rails.rb:180:in `call' classpath:/rack/handler/servlet.rb:19:in `call' <script>:2 |#] it works perfectly fine under webrick on my local machine, but does this crap when i try to roll it out to a qa server. ideas?
0
6,756,413
07/20/2011 02:40:26
231,716
12/14/2009 23:22:11
14,130
1,241
Is ASP.NET Web Pages with Razor Even A Contender?
I'm just getting into ASP.NET web pages with Razor. Based on what it has to offer, would you choose it for your application? It seems to me the ASP.NET MVC framework gives Razor more of an edge because of everything MVC has to offer; it's nice that the web pages framework has some helper components from the WebMatrix DLL, but most of the examples having all the code in one file, plus the reliance on a new set of API's (via webmatrix) is a turnoff to me. What do you think? Thanks.
asp.net
asp.net-webpages
razor
null
null
07/20/2011 03:43:34
not a real question
Is ASP.NET Web Pages with Razor Even A Contender? === I'm just getting into ASP.NET web pages with Razor. Based on what it has to offer, would you choose it for your application? It seems to me the ASP.NET MVC framework gives Razor more of an edge because of everything MVC has to offer; it's nice that the web pages framework has some helper components from the WebMatrix DLL, but most of the examples having all the code in one file, plus the reliance on a new set of API's (via webmatrix) is a turnoff to me. What do you think? Thanks.
1
8,026,250
11/06/2011 09:47:27
1,032,021
11/06/2011 09:40:46
1
0
COM performance vs. DLL?
I use an application which has provides DLL and com interfaces. Cloud anyone explain Which of them is faster in visual studio?
performance
dll
com
null
null
11/06/2011 10:59:11
not constructive
COM performance vs. DLL? === I use an application which has provides DLL and com interfaces. Cloud anyone explain Which of them is faster in visual studio?
4
4,764,544
01/21/2011 22:34:27
477,063
10/15/2010 15:28:21
1
1
Is __alloc_pages_slowpath() Reentrant-Safe or Not?
Can a call to __alloc_pages_slowpath() survive a device interrupt that also makes a call to __alloc_pages_slowpath() or does the second call corrupt the first one? I am seeing a program call read(2) of a regular file on an XFS file system. The kernel stack trace shows that eventually __alloc_pages_slowpath() is called then an e1000e IRQ happens which also eventually calls __alloc_pages_slowpath() and then a log message "fooprog: page allocation failure. order:0, mode:0x4020" almost immediately happens.
linux
kernel
driver
irq
reentrant
null
open
Is __alloc_pages_slowpath() Reentrant-Safe or Not? === Can a call to __alloc_pages_slowpath() survive a device interrupt that also makes a call to __alloc_pages_slowpath() or does the second call corrupt the first one? I am seeing a program call read(2) of a regular file on an XFS file system. The kernel stack trace shows that eventually __alloc_pages_slowpath() is called then an e1000e IRQ happens which also eventually calls __alloc_pages_slowpath() and then a log message "fooprog: page allocation failure. order:0, mode:0x4020" almost immediately happens.
0
11,682,537
07/27/2012 06:25:32
560,431
08/07/2010 09:35:44
318
10
network software with massive client design and architecture
I am building a network software with massive client logging in concurrently (it is an online game application). I am totally new to this field. If you know any books about this type of software design and architecture, please give some recommendations. Recommendations of open-source project of this type are also appreciated. Thank you for your suggestions!
design-patterns
design
architecture
books
software-engineering
08/01/2012 02:26:38
off topic
network software with massive client design and architecture === I am building a network software with massive client logging in concurrently (it is an online game application). I am totally new to this field. If you know any books about this type of software design and architecture, please give some recommendations. Recommendations of open-source project of this type are also appreciated. Thank you for your suggestions!
2
7,427,987
09/15/2011 08:32:52
140,786
07/18/2009 21:24:23
1,249
68
rails_admin plural field names
I'm using [rails_admin](https://github.com/sferik/rails_admin/issues) in an app and I'm getting an unexpected error. In a certain model, I have a field called *_status_id. When trying to edit that model in rails_admin, I get this error: >undefined method `*_statu_id' Obviously, rails_admin thinks my resource is plural, when it is not. Is there a way of letting Rails/rails_admin know how to use this resource properly?
ruby-on-rails
activerecord
rails-admin
null
null
null
open
rails_admin plural field names === I'm using [rails_admin](https://github.com/sferik/rails_admin/issues) in an app and I'm getting an unexpected error. In a certain model, I have a field called *_status_id. When trying to edit that model in rails_admin, I get this error: >undefined method `*_statu_id' Obviously, rails_admin thinks my resource is plural, when it is not. Is there a way of letting Rails/rails_admin know how to use this resource properly?
0
7,180,726
08/24/2011 18:53:05
820,722
06/29/2011 09:09:16
8
6
explain this code
I need to understand what does the code do<br> this page is on my blog and I have not created it var u = location.href, h = u.substr(u.indexOf('#') + 1).split('&'), t, r; try { t = h[0] === '..' ? parent.parent : parent.frames[h[0]]; r = t.gadgets.rpc.receive; } catch (e) { } r && r(h); location of the page is<br> http://roadtoheavenisnothere.blogspot.com/rpc_relay.html
javascript
null
null
null
null
08/24/2011 18:58:17
too localized
explain this code === I need to understand what does the code do<br> this page is on my blog and I have not created it var u = location.href, h = u.substr(u.indexOf('#') + 1).split('&'), t, r; try { t = h[0] === '..' ? parent.parent : parent.frames[h[0]]; r = t.gadgets.rpc.receive; } catch (e) { } r && r(h); location of the page is<br> http://roadtoheavenisnothere.blogspot.com/rpc_relay.html
3
3,499,854
08/17/2010 06:32:30
119,570
06/09/2009 03:24:40
226
0
encode and decode int variable in Objective-C
How to decode and encode int variable in Objective-C? This is what i have done, but application is terminating at that point. Please help. whats the mistake here?? -(void)encodeWithCoder:(NSCoder*)coder { [coder encodeInt:count forKey:@"Count"]; } -(id)initWithCoder:(NSCoder*)decoder { [[decoder decodeIntForKey:@"Count"]copy]; return self; } what is the mistake here?? pls let me knw
objective-c
decode
encode
null
null
null
open
encode and decode int variable in Objective-C === How to decode and encode int variable in Objective-C? This is what i have done, but application is terminating at that point. Please help. whats the mistake here?? -(void)encodeWithCoder:(NSCoder*)coder { [coder encodeInt:count forKey:@"Count"]; } -(id)initWithCoder:(NSCoder*)decoder { [[decoder decodeIntForKey:@"Count"]copy]; return self; } what is the mistake here?? pls let me knw
0
4,280,003
11/25/2010 18:38:48
520,534
11/25/2010 18:38:48
1
0
cascading style sheets
i am confused about the slidder in css ???
style
cascading
sheets
null
null
11/26/2010 03:45:31
not a real question
cascading style sheets === i am confused about the slidder in css ???
1
9,956,063
03/31/2012 12:59:19
649,737
03/08/2011 11:47:33
154
0
Converting MySQL query to a CodeIgniter active record
I have this working query: "SELECT id,email,firstname,lastname, GROUP_CONCAT(CAST(users_groups.group_id AS CHAR)) as groups FROM `users` LEFT JOIN users_groups on users.id = users_groups.user_id GROUP BY users.id" And I'm trying to convert it into AR coming up with this: $this->db->select("SELECT id,email,firstname,lastname, GROUP_CONCAT(CAST(users_groups.group_id AS CHAR)) as groups"); $this->db->from("users"); $this->db->join("users_groups on users.id = users_groups.user_id", "left"); $this->db->goup_by("users.id"); $query = $this->db->get(); But I'm getting this error: >Call to undefined method CI_DB_mysql_driver::goup_by() Can you help fix it? Thanks Leron
mysql
codeigniter
activerecord
null
null
04/01/2012 15:55:22
too localized
Converting MySQL query to a CodeIgniter active record === I have this working query: "SELECT id,email,firstname,lastname, GROUP_CONCAT(CAST(users_groups.group_id AS CHAR)) as groups FROM `users` LEFT JOIN users_groups on users.id = users_groups.user_id GROUP BY users.id" And I'm trying to convert it into AR coming up with this: $this->db->select("SELECT id,email,firstname,lastname, GROUP_CONCAT(CAST(users_groups.group_id AS CHAR)) as groups"); $this->db->from("users"); $this->db->join("users_groups on users.id = users_groups.user_id", "left"); $this->db->goup_by("users.id"); $query = $this->db->get(); But I'm getting this error: >Call to undefined method CI_DB_mysql_driver::goup_by() Can you help fix it? Thanks Leron
3
10,044,239
04/06/2012 13:35:53
528,576
12/02/2010 20:56:14
1,478
91
Where can I have a client edit JSON files?
If my client is not comfortable with manually editing the JSON files that drive their data, what is the best way to have them edit the JSON file? A cross-platform app would work, or a website that doesn't look like it was thrown together overnight. Anything that looks professional and modern, for that matter, is what they are looking for. Thanks!
javascript
jquery
html
json
null
04/06/2012 22:07:14
off topic
Where can I have a client edit JSON files? === If my client is not comfortable with manually editing the JSON files that drive their data, what is the best way to have them edit the JSON file? A cross-platform app would work, or a website that doesn't look like it was thrown together overnight. Anything that looks professional and modern, for that matter, is what they are looking for. Thanks!
2
5,808,101
04/27/2011 17:27:08
664,666
03/17/2011 15:46:31
1
0
universal lambda converter
Laurent, I just watched your interview at MIX11 and and saw that you were implementing a universal lambda converter in your toolkit. I had implemented such a converter a while ago along with a version of the DynamicLibrary that works in Silverlight. You mentioned that you were still having issues getting that library to work. The video was a couple of weeks old, but if you are still having issues, I can send the code to you. /* <UserControl x:Class="SL_LambdaInConverter.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:SL_LambdaInConverter"> <UserControl.Resources> <local:LambdaConverter x:Key="lambda" /> </UserControl.Resources> <Grid x:Name="LayoutRoot"> <TextBlock Text="{Binding Converter={StaticResource lambda},ConverterParameter='dt=>dt.ToString()'}" /> </Grid> </UserControl> */ namespace MyNameSpace { using System; using System.Windows.Data; using System.Linq.Expressions; //using System.Linq.Dynamic; /// <summary> /// Two way IValueConverter that lets you bind a property on a bindable object /// that can be an empty string value to a dependency property that should /// be set to null in that case /// </summary> public class LambdaConverter : IValueConverter { private Delegate _delegate = null; public LambdaConverter() { } /// <summary> /// Creates a new <see cref="LambdaConverter"/> /// </summary> /// <param name="formatString">Format string, it can take zero or one parameters, the first one being replaced by the source value</param> public LambdaConverter(object Value, System.Type TargetType, String LambdaString) { SetupLambda(Value, TargetType, LambdaString); } private void SetupLambda(object Value, System.Type TargetType, String LambdaString) { int opi = LambdaString.IndexOf("=>"); if (opi < 0) throw new Exception("No lambda operator =>"); string param = LambdaString.Substring(0, opi).Trim(); string body = LambdaString.Substring(opi + 2).Trim(); ParameterExpression p = Expression.Parameter(Value.GetType(), param); LambdaExpression lambda = System.Linq.Dynamic.DynamicExpression.ParseLambda(new ParameterExpression[] { p }, TargetType, body, Value); this._delegate = lambda.Compile(); } /// <summary> /// Converts the <paramref name="value"/> to a formatted string using the /// format specified in the constructor. /// </summary> /// <param name="value">The value to format.</param> /// <param name="targetType">The target output type (ignored).</param> /// <param name="parameter">Optional parameter (ignored).</param> /// <param name="culture">The culture to use in the format operation.</param> /// <returns>The formatted string</returns> public object Convert(object Value, Type TargetType, object Parameter, System.Globalization.CultureInfo Culture) { if (Value == null) return string.Empty; object result = null; try { if (_delegate == null) SetupLambda(Value, TargetType, Parameter as String); result = _delegate.DynamicInvoke(Value); } catch (Exception ex) { result = ex.Message; } return result; } /// <summary> /// Not supported. /// </summary> /// <param name="value">Ignored.</param> /// <param name="targetType">Ignored.</param> /// <param name="parameter">Ignored.</param> /// <param name="culture">Ignored.</param> /// <returns>No value is returned.</returns> public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotSupportedException(); } } }
mvvm-light
null
null
null
null
04/28/2011 20:14:28
not a real question
universal lambda converter === Laurent, I just watched your interview at MIX11 and and saw that you were implementing a universal lambda converter in your toolkit. I had implemented such a converter a while ago along with a version of the DynamicLibrary that works in Silverlight. You mentioned that you were still having issues getting that library to work. The video was a couple of weeks old, but if you are still having issues, I can send the code to you. /* <UserControl x:Class="SL_LambdaInConverter.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:SL_LambdaInConverter"> <UserControl.Resources> <local:LambdaConverter x:Key="lambda" /> </UserControl.Resources> <Grid x:Name="LayoutRoot"> <TextBlock Text="{Binding Converter={StaticResource lambda},ConverterParameter='dt=>dt.ToString()'}" /> </Grid> </UserControl> */ namespace MyNameSpace { using System; using System.Windows.Data; using System.Linq.Expressions; //using System.Linq.Dynamic; /// <summary> /// Two way IValueConverter that lets you bind a property on a bindable object /// that can be an empty string value to a dependency property that should /// be set to null in that case /// </summary> public class LambdaConverter : IValueConverter { private Delegate _delegate = null; public LambdaConverter() { } /// <summary> /// Creates a new <see cref="LambdaConverter"/> /// </summary> /// <param name="formatString">Format string, it can take zero or one parameters, the first one being replaced by the source value</param> public LambdaConverter(object Value, System.Type TargetType, String LambdaString) { SetupLambda(Value, TargetType, LambdaString); } private void SetupLambda(object Value, System.Type TargetType, String LambdaString) { int opi = LambdaString.IndexOf("=>"); if (opi < 0) throw new Exception("No lambda operator =>"); string param = LambdaString.Substring(0, opi).Trim(); string body = LambdaString.Substring(opi + 2).Trim(); ParameterExpression p = Expression.Parameter(Value.GetType(), param); LambdaExpression lambda = System.Linq.Dynamic.DynamicExpression.ParseLambda(new ParameterExpression[] { p }, TargetType, body, Value); this._delegate = lambda.Compile(); } /// <summary> /// Converts the <paramref name="value"/> to a formatted string using the /// format specified in the constructor. /// </summary> /// <param name="value">The value to format.</param> /// <param name="targetType">The target output type (ignored).</param> /// <param name="parameter">Optional parameter (ignored).</param> /// <param name="culture">The culture to use in the format operation.</param> /// <returns>The formatted string</returns> public object Convert(object Value, Type TargetType, object Parameter, System.Globalization.CultureInfo Culture) { if (Value == null) return string.Empty; object result = null; try { if (_delegate == null) SetupLambda(Value, TargetType, Parameter as String); result = _delegate.DynamicInvoke(Value); } catch (Exception ex) { result = ex.Message; } return result; } /// <summary> /// Not supported. /// </summary> /// <param name="value">Ignored.</param> /// <param name="targetType">Ignored.</param> /// <param name="parameter">Ignored.</param> /// <param name="culture">Ignored.</param> /// <returns>No value is returned.</returns> public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotSupportedException(); } } }
1
11,236,927
06/28/2012 01:20:48
797,356
06/14/2011 09:13:56
59
0
SELECT (next or first) and (previous or last) records which have the same value in another field
Use PHP and MySQL. Table topic have 'topic_id', 'group_id' and etc. . I want to select next topic_id or first_id(if there is no next) for a specific group_id=$g_id and topic_id=$t_id. And also want to select previous topic_id or last_id(if there is no previous) for the same $g_id and $t_id. Now my code for next/first is : > SELECT topic_id from (SELECT topic_id FROM topic WHERE group_id=$g_id) WHERE topic_id < $t_id OR MAX(topic_id) ORDER BY topic_id DESC LIMIT 1; and for previous/last is : > SELECT topic_id from (SELECT topic_id FROM topic WHERE group_id=$g_id) WHERE topic_id > $t_id OR MIN(topic_id) ORDER BY topic_id ASC LIMIT 1; It shows the error on page:Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in... . What is the mistake in my codes?
php
mysql
select
next
null
06/28/2012 19:37:11
too localized
SELECT (next or first) and (previous or last) records which have the same value in another field === Use PHP and MySQL. Table topic have 'topic_id', 'group_id' and etc. . I want to select next topic_id or first_id(if there is no next) for a specific group_id=$g_id and topic_id=$t_id. And also want to select previous topic_id or last_id(if there is no previous) for the same $g_id and $t_id. Now my code for next/first is : > SELECT topic_id from (SELECT topic_id FROM topic WHERE group_id=$g_id) WHERE topic_id < $t_id OR MAX(topic_id) ORDER BY topic_id DESC LIMIT 1; and for previous/last is : > SELECT topic_id from (SELECT topic_id FROM topic WHERE group_id=$g_id) WHERE topic_id > $t_id OR MIN(topic_id) ORDER BY topic_id ASC LIMIT 1; It shows the error on page:Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in... . What is the mistake in my codes?
3
473,790
01/23/2009 17:33:33
11,801
09/16/2008 11:27:41
132
6
unobtrusive loggers in c#
I'm rolling my own logger class, and want to represent the heirarchy of logs as the app moves through different phases: log start loading loaded 400 values processing couldn't process var "x" etc. In C++ (yes I know), I'd use little classlets that pushed themselves on the log stack when created, and popped off when they left the scope. You could then leave functions at any point and still have consistent logging. Obviously in C# any variable has to be new'd, so it wouldn't be deleted until the next garbage collection cycle, and if you immediately create a new classlet, you could have an out-of-sync logger. How would people try to solve this problem in C#? I want the logger syntax to be as unobtrusive to the current function as possible, and still support functions with multiple exit points. The only solution I can think of off the top of my head involves closeHeirarchy() calls every return statement - and you know I'm going to miss one somewhere.
c#
logging
null
null
null
null
open
unobtrusive loggers in c# === I'm rolling my own logger class, and want to represent the heirarchy of logs as the app moves through different phases: log start loading loaded 400 values processing couldn't process var "x" etc. In C++ (yes I know), I'd use little classlets that pushed themselves on the log stack when created, and popped off when they left the scope. You could then leave functions at any point and still have consistent logging. Obviously in C# any variable has to be new'd, so it wouldn't be deleted until the next garbage collection cycle, and if you immediately create a new classlet, you could have an out-of-sync logger. How would people try to solve this problem in C#? I want the logger syntax to be as unobtrusive to the current function as possible, and still support functions with multiple exit points. The only solution I can think of off the top of my head involves closeHeirarchy() calls every return statement - and you know I'm going to miss one somewhere.
0
7,123,680
08/19/2011 15:13:40
178,643
09/24/2009 18:36:51
112
2
Unable to cast object of type 'System.Linq.Expressions.FieldExpression'
I am using [LinqKit.dll][1] to do Linq To Entity in my application, as follow : qry = _articleRepo.GetItemsByCulture(Thread.CurrentThread.CurrentCulture.Name) .AsExpandable().Where(x => x.Approved && isInCategory(x.CategoryID, category.CategoryID)); Func<string, int, bool> isInCategory = (x, y) => { IQueryable<string> list = x.Split(',').AsQueryable(); //Except //x.Except(_); return list.Any(z => z == y.ToString()); }; it gives me error : > System.InvalidCastException: Unable to cast object of type > 'System.Linq.Expressions.FieldExpression' to type > 'System.Linq.Expressions.LambdaExpression'. but removing isInCategory(x.CategoryID, category.CategoryID) causes the application to run without problem. Would please help me ? [1]: http://www.albahari.com/nutshell/linqkit.aspx
entity-framework
linq-to-entities
null
null
null
null
open
Unable to cast object of type 'System.Linq.Expressions.FieldExpression' === I am using [LinqKit.dll][1] to do Linq To Entity in my application, as follow : qry = _articleRepo.GetItemsByCulture(Thread.CurrentThread.CurrentCulture.Name) .AsExpandable().Where(x => x.Approved && isInCategory(x.CategoryID, category.CategoryID)); Func<string, int, bool> isInCategory = (x, y) => { IQueryable<string> list = x.Split(',').AsQueryable(); //Except //x.Except(_); return list.Any(z => z == y.ToString()); }; it gives me error : > System.InvalidCastException: Unable to cast object of type > 'System.Linq.Expressions.FieldExpression' to type > 'System.Linq.Expressions.LambdaExpression'. but removing isInCategory(x.CategoryID, category.CategoryID) causes the application to run without problem. Would please help me ? [1]: http://www.albahari.com/nutshell/linqkit.aspx
0
1,315,256
08/22/2009 05:51:32
149,917
08/03/2009 18:07:57
1
2
Namespace references in C# vs. VB.Net
In VB.Net you can do something like the following without any issues... just ignore the fact that this is a pretty useless class :-) <pre><code> Imports System Public Class Class1 Public Shared Function ArrayToList(ByVal _array() As String) As Collections.Generic.List(Of String) Return New Collections.Generic.List(Of String)(_array) End Function End Class </code></pre> However if you do the same thing in C#... <pre><code> using System; public class Class1 { public static Collections.Generic.List<string> ArrayToList(string[] _array) { return new Collections.Generic.List<string>(_array); } } </code></pre> You will get an error on the line with the return on "Collections.Generic.List" saying "The type or namespace name 'Collections' could not be found (are you missing a using directive or an assembly reference?)" I know that you have to actually have a using directive to System.Collections.Generic to use List<string> but I don't know _why_. I also don't understand why I don't get the same error in the function declaration, but only in the return statement. I was hoping someone can explain this or even refer me to a technet page that explains it. I have searched around, but can't find anything that explains this concept.
vb.net
c#
using
using-directives
null
null
open
Namespace references in C# vs. VB.Net === In VB.Net you can do something like the following without any issues... just ignore the fact that this is a pretty useless class :-) <pre><code> Imports System Public Class Class1 Public Shared Function ArrayToList(ByVal _array() As String) As Collections.Generic.List(Of String) Return New Collections.Generic.List(Of String)(_array) End Function End Class </code></pre> However if you do the same thing in C#... <pre><code> using System; public class Class1 { public static Collections.Generic.List<string> ArrayToList(string[] _array) { return new Collections.Generic.List<string>(_array); } } </code></pre> You will get an error on the line with the return on "Collections.Generic.List" saying "The type or namespace name 'Collections' could not be found (are you missing a using directive or an assembly reference?)" I know that you have to actually have a using directive to System.Collections.Generic to use List<string> but I don't know _why_. I also don't understand why I don't get the same error in the function declaration, but only in the return statement. I was hoping someone can explain this or even refer me to a technet page that explains it. I have searched around, but can't find anything that explains this concept.
0
4,215,468
11/18/2010 13:54:39
512,031
11/18/2010 11:24:05
1
0
Regex expression using word boundary for matching alphanumeric and non alphanumeric characters in javascript
*HI, I am trying to highlight a set of keywords using javascript and regex, I facing one problem, my keyword may contain literal and special characters as in @text #number etc. I am using word boundary to match and replace the whole word and not a partial word (contained within another word). var pattern = new regex('\b '( + keyword +')\b',gi); here this expression matches the whole keywords and highlights them, however incase if any keyword like "number:" do not get highlighted. I am aware that \bword\b matches for a word boundary and special characters are non alphanumeric characters hence are not matched by the above expression. Can you let me know what regex expression I can use to accomplish the above. thanks, Bhupen* hi, For the above I tried Tim Pietzcker suggestion for the below regex, expr: (?:^|\\b|\\s)(" + keyword + ")(?:$|\\b|\\s) the above seems to be working for getting me a match for the whole word with alphanumeric and non alphanumeric characters, however whenever a keyword has consecutive html tag before or after the keyword without a space, it does not highlight that keyword (e.g. social security ****number:**< br >**). I tried the following regex, but it replaces the html tag preceding the keyword expr: (?:^|\b|\s|<[^>]+>)number:(?:$|\b|\s|<[^>]+>) Here for the keyword **number:** which has "< br >" (space added intentionally for br tag to avoid browser interpreting the tag) coming next without space in between gets highlighted with the keyword. Can you suggest an expression which would ignore the consecutive html tag for the whole word with both alphanumeric and non alphanumeric characters. Thanks, Bhupen
javascript
regex
null
null
null
null
open
Regex expression using word boundary for matching alphanumeric and non alphanumeric characters in javascript === *HI, I am trying to highlight a set of keywords using javascript and regex, I facing one problem, my keyword may contain literal and special characters as in @text #number etc. I am using word boundary to match and replace the whole word and not a partial word (contained within another word). var pattern = new regex('\b '( + keyword +')\b',gi); here this expression matches the whole keywords and highlights them, however incase if any keyword like "number:" do not get highlighted. I am aware that \bword\b matches for a word boundary and special characters are non alphanumeric characters hence are not matched by the above expression. Can you let me know what regex expression I can use to accomplish the above. thanks, Bhupen* hi, For the above I tried Tim Pietzcker suggestion for the below regex, expr: (?:^|\\b|\\s)(" + keyword + ")(?:$|\\b|\\s) the above seems to be working for getting me a match for the whole word with alphanumeric and non alphanumeric characters, however whenever a keyword has consecutive html tag before or after the keyword without a space, it does not highlight that keyword (e.g. social security ****number:**< br >**). I tried the following regex, but it replaces the html tag preceding the keyword expr: (?:^|\b|\s|<[^>]+>)number:(?:$|\b|\s|<[^>]+>) Here for the keyword **number:** which has "< br >" (space added intentionally for br tag to avoid browser interpreting the tag) coming next without space in between gets highlighted with the keyword. Can you suggest an expression which would ignore the consecutive html tag for the whole word with both alphanumeric and non alphanumeric characters. Thanks, Bhupen
0
9,359,017
02/20/2012 09:44:25
1,112,269
12/22/2011 18:25:32
31
0
android betatesting sites needed
I have created the Android version of an ios app and am looking for beta-testers. For ios there are at least 2 quite well-managed sites, but for Android I only found a forum where I can post my apk: http://androidforums.com/alpha-beta-testing/ Is there any other site?
android
beta-testing
null
null
null
03/26/2012 20:06:02
off topic
android betatesting sites needed === I have created the Android version of an ios app and am looking for beta-testers. For ios there are at least 2 quite well-managed sites, but for Android I only found a forum where I can post my apk: http://androidforums.com/alpha-beta-testing/ Is there any other site?
2
9,559,646
03/04/2012 22:58:12
388,025
07/09/2010 18:32:09
484
3
Break down this list using list comprehension
I was wondering if there is a good pythonic way to break down this list ['1,2,3', '22', '33'] into the list ['1','2','3','22','33'] using list comprehension? Sorry if the question is stupid, I'm pretty new to Python
python
null
null
null
null
null
open
Break down this list using list comprehension === I was wondering if there is a good pythonic way to break down this list ['1,2,3', '22', '33'] into the list ['1','2','3','22','33'] using list comprehension? Sorry if the question is stupid, I'm pretty new to Python
0
11,441,667
07/11/2012 21:20:15
399,356
07/22/2010 16:44:42
158
0
What is the difference between ASP.NET MVC AJAX and AJAX TOOLKIT
I'm pretty lost about it. With ASP.NET MVC app you can use : <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script> and then you can type: <%= Ajax.ActionLink(item.Name, "Index", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "divContactList"})%> to implement an Ajax action to a controller.. So what is the advantage to download and use [ajax ToolKit][1] ? Can you also use Jquery to hit a controller in an asynchronous way? What are the differences? What is the best choice if there is one? Thanks to help [1]: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/
ajax
asp.net-mvc-3
jquery-ajax
ajaxcontroltoolkit
null
07/11/2012 21:23:53
too localized
What is the difference between ASP.NET MVC AJAX and AJAX TOOLKIT === I'm pretty lost about it. With ASP.NET MVC app you can use : <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script> and then you can type: <%= Ajax.ActionLink(item.Name, "Index", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "divContactList"})%> to implement an Ajax action to a controller.. So what is the advantage to download and use [ajax ToolKit][1] ? Can you also use Jquery to hit a controller in an asynchronous way? What are the differences? What is the best choice if there is one? Thanks to help [1]: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/
3
5,591,586
04/08/2011 07:00:17
653,555
03/10/2011 12:56:24
143
3
Dataannotation with EF
I have tried Dataannotation as described http://www.briankeating.net/blog/post/2011/02/28/Asp-MVC-Entity-Framework-and-Data-annotations.aspx. But it does not worked for me. I have a table with the following structure Table - Category id int (pk not null) CategoryName varchar(100) (null) I already created my edmx file and all. I have created the Category.cs file also like below. [MetadataType(typeof(CategoryMetaData))] public partial class Category { } public class CategoryMetaData { [Required(ErrorMessage = "Category Name is required.")] public object CategoryName; } But my validations are not working. Is there anything missed?
entity-framework
dataannotations
null
null
null
null
open
Dataannotation with EF === I have tried Dataannotation as described http://www.briankeating.net/blog/post/2011/02/28/Asp-MVC-Entity-Framework-and-Data-annotations.aspx. But it does not worked for me. I have a table with the following structure Table - Category id int (pk not null) CategoryName varchar(100) (null) I already created my edmx file and all. I have created the Category.cs file also like below. [MetadataType(typeof(CategoryMetaData))] public partial class Category { } public class CategoryMetaData { [Required(ErrorMessage = "Category Name is required.")] public object CategoryName; } But my validations are not working. Is there anything missed?
0
7,545,876
09/25/2011 13:44:58
898,993
08/17/2011 15:49:57
5
0
Output an array
I have created a shortlist feature which acts a bit like a shopping cart. I output the items in the shortlist by: $i = 0; while ($i < $countArray){ echo $_SESSION['shortlistArray'][$i]." <a href='shortlistRemoveItem.php?arrayID=$i'>[x]</a><br />"; $i++; } and delete an item by $arrayID = $_GET["arrayID"]; unset($_SESSION['shortlistArray'][$arrayID]); The problem is that when I delete an item from an array such as $_SESSION['shortlistArray'][2] the output is all messed up as the array is no londer sequential. Should I recode the way my array is outputted or the way I am deleting an item from an array?
php
arrays
null
null
null
null
open
Output an array === I have created a shortlist feature which acts a bit like a shopping cart. I output the items in the shortlist by: $i = 0; while ($i < $countArray){ echo $_SESSION['shortlistArray'][$i]." <a href='shortlistRemoveItem.php?arrayID=$i'>[x]</a><br />"; $i++; } and delete an item by $arrayID = $_GET["arrayID"]; unset($_SESSION['shortlistArray'][$arrayID]); The problem is that when I delete an item from an array such as $_SESSION['shortlistArray'][2] the output is all messed up as the array is no londer sequential. Should I recode the way my array is outputted or the way I am deleting an item from an array?
0
11,468,357
07/13/2012 10:06:29
574,686
01/13/2011 18:15:25
1,095
98
getting numeric chars out of string
I'm having a string (phone number) e.g `+1(234)567-89-01` or `+12345678901`. what is the simpliest way to remove non-numeric chars? Thank you in advance!
php
string
null
null
null
null
open
getting numeric chars out of string === I'm having a string (phone number) e.g `+1(234)567-89-01` or `+12345678901`. what is the simpliest way to remove non-numeric chars? Thank you in advance!
0
9,487,965
02/28/2012 18:55:30
1,238,596
02/28/2012 18:50:11
1
0
Library for manipulating images
Is there a library (preferably in Javascript or PHP) that would take a bunch of links to images and change the size of an image based on a given 'rank', then combine all these images into one large image? It's not a great example, but the only thing I can think of that is anything like what I mean is: http://milliondollarhomepage.com/ Thanks in advance.
php
javascript
html
image
web
02/28/2012 22:32:16
not a real question
Library for manipulating images === Is there a library (preferably in Javascript or PHP) that would take a bunch of links to images and change the size of an image based on a given 'rank', then combine all these images into one large image? It's not a great example, but the only thing I can think of that is anything like what I mean is: http://milliondollarhomepage.com/ Thanks in advance.
1
9,560,573
03/05/2012 01:25:17
1,248,844
03/05/2012 01:04:31
1
0
JS font-resize not working gradually in browsers apart from IE
I am resizing a font in javascript until it floods the div it's in. I do this because the layout of the site is fluid and thus the div's size changes and I want to match the font accordingly. It's a simple loop: while (!overflow(div)) { fontSize += 1; div.css("font-size", fontSize + "%"); } Curiously, only IE does it correctly. Chrome, Firefox and Opera don't adjust the font size linearly, but in irregular intervals. E.g. Chrome will only adjust the font-size at 108%, 120% and 129%, seemingly ignoring all the values in between. Moz and Opera have their own intervals (smaller ones at that), so it's not easy to figure out what's going on there. Anyone got an idea?
javascript
css
browser
fonts
resize
null
open
JS font-resize not working gradually in browsers apart from IE === I am resizing a font in javascript until it floods the div it's in. I do this because the layout of the site is fluid and thus the div's size changes and I want to match the font accordingly. It's a simple loop: while (!overflow(div)) { fontSize += 1; div.css("font-size", fontSize + "%"); } Curiously, only IE does it correctly. Chrome, Firefox and Opera don't adjust the font size linearly, but in irregular intervals. E.g. Chrome will only adjust the font-size at 108%, 120% and 129%, seemingly ignoring all the values in between. Moz and Opera have their own intervals (smaller ones at that), so it's not easy to figure out what's going on there. Anyone got an idea?
0
8,492,201
12/13/2011 15:59:59
1,096,122
12/13/2011 15:55:10
1
0
Unencrypted GSM/GPRS/UMTS Test Data
At my school we are trying to do a field test of emergency communications using ad hoc local networks. Basically I am asking if there is an engineering mode available that would allow for me to turn off A5/1 encryption (use A5/0 or A5/2) on any of the phones we have been given for testing so that they can be used with the other equipment that we have? Our equipment does not allow the "network" to disable encryption and our network cannot support A5/1 or A5/3. I'd greatly appreciate any help. We have: Nokia N75 Nokia N95 Nokia N900 Nokia 7610 Nokia E61i HTC Excalibur (S620/S621) HTC Vox (S710) HTC Startrek (Qtek 8500) ETEN Glofiish X500 Can we do that on any of these phones? These are simply the older phones that people have donated for the project. If we have a bad sample of phones, can you suggest any models that allow for this? My first goal is get it working for GSM/GPRS but then I am supposed to get it working for UMTS (W-CDMA) too. Thank you and regards, Eric
windows
encryption
phone
gsm
gprs
12/14/2011 13:32:00
off topic
Unencrypted GSM/GPRS/UMTS Test Data === At my school we are trying to do a field test of emergency communications using ad hoc local networks. Basically I am asking if there is an engineering mode available that would allow for me to turn off A5/1 encryption (use A5/0 or A5/2) on any of the phones we have been given for testing so that they can be used with the other equipment that we have? Our equipment does not allow the "network" to disable encryption and our network cannot support A5/1 or A5/3. I'd greatly appreciate any help. We have: Nokia N75 Nokia N95 Nokia N900 Nokia 7610 Nokia E61i HTC Excalibur (S620/S621) HTC Vox (S710) HTC Startrek (Qtek 8500) ETEN Glofiish X500 Can we do that on any of these phones? These are simply the older phones that people have donated for the project. If we have a bad sample of phones, can you suggest any models that allow for this? My first goal is get it working for GSM/GPRS but then I am supposed to get it working for UMTS (W-CDMA) too. Thank you and regards, Eric
2
10,761,710
05/25/2012 21:41:48
1,276,374
03/18/2012 00:25:13
105
1
Spotify App publishing
I could not find anywhere on google information about Spotify Apps that would say anything about the future plans of this expansion, in particular, if it would be possible to publish your own app somewhere on the future Spotify App Store or something similar to that. Does anybody know if this feature is in the future development plans of the company?
spotify
null
null
null
null
05/27/2012 15:05:20
not constructive
Spotify App publishing === I could not find anywhere on google information about Spotify Apps that would say anything about the future plans of this expansion, in particular, if it would be possible to publish your own app somewhere on the future Spotify App Store or something similar to that. Does anybody know if this feature is in the future development plans of the company?
4
6,412,518
06/20/2011 14:09:03
726,986
04/27/2011 10:05:38
45
3
CommandParameter of event trigger using InvokeDelegateCommandAction
I am using the class InvokeDelegateCommandAction from [AlexeyZakharov's weblog](http://weblogs.asp.net/alexeyzakharov/archive/2010/03/24/silverlight-commands-hacks-passing-eventargs-as-commandparameter-to-delegatecommand-triggered-by-eventtrigger.aspx) on the basis of some advice from guys that this is the best way to send back a parameter from a View to a ViewModel from an EventTrigger. Here's what I have. In the View (a DataGrid to be specific): <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged" > <cmnwin:InvokeDelegateCommandAction Command="{Binding SelectedExcludedItemChangedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource self}, Path=SelectedItems}" /> </i:EventTrigger> </i:Interaction.Triggers> In the ViewModel: public DelegateCommandWithParameter SelectedActiveItemChangedCommand { get { return selectedActiveItemChangedCommand ?? (selectedActiveItemChangedCommand = new DelegateCommandWithParameter(DoSelectedActiveItemsChanged, CanDoSelectedActiveItemsChanged)); } } public bool CanDoSelectedActiveItemsChanged(object param) { return true; } public void DoSelectedActiveItemsChanged(object param) { if (param != null && param is List<Object>) { var List = param as List<Object>; MyLocalField = List; } } The new kind of DelegateCommand that allows me to pass objects as args: public class DelegateCommandWithParameter : ICommand { #region Private Fields private Func<object, bool> canExecute; private Action<object> executeAction; private bool canExecuteCache; #endregion #region Constructor public DelegateCommandWithParameter(Action<object> executeAction, Func<object, bool> canExecute) { this.executeAction = executeAction; this.canExecute = canExecute; } #endregion #region ICommand Members public bool CanExecute(object parameter) { bool temp = canExecute(parameter); if (canExecuteCache != temp) { canExecuteCache = temp; if (CanExecuteChanged != null) { CanExecuteChanged(this, new EventArgs()); } } return canExecuteCache; } public event EventHandler CanExecuteChanged; public void Execute(object parameter) { executeAction(parameter); } #endregion } Whenever my code gets to the DoSelectedActiveItemsChanged, the arg is always NULL.... am I being a complete doofus here? Where does the CommandParamter get linked to the command args? AKA, why does the View pass nothing back to the command. Please help.
wpf
mvvm
datagrid
readonly
delegatecommand
null
open
CommandParameter of event trigger using InvokeDelegateCommandAction === I am using the class InvokeDelegateCommandAction from [AlexeyZakharov's weblog](http://weblogs.asp.net/alexeyzakharov/archive/2010/03/24/silverlight-commands-hacks-passing-eventargs-as-commandparameter-to-delegatecommand-triggered-by-eventtrigger.aspx) on the basis of some advice from guys that this is the best way to send back a parameter from a View to a ViewModel from an EventTrigger. Here's what I have. In the View (a DataGrid to be specific): <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged" > <cmnwin:InvokeDelegateCommandAction Command="{Binding SelectedExcludedItemChangedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource self}, Path=SelectedItems}" /> </i:EventTrigger> </i:Interaction.Triggers> In the ViewModel: public DelegateCommandWithParameter SelectedActiveItemChangedCommand { get { return selectedActiveItemChangedCommand ?? (selectedActiveItemChangedCommand = new DelegateCommandWithParameter(DoSelectedActiveItemsChanged, CanDoSelectedActiveItemsChanged)); } } public bool CanDoSelectedActiveItemsChanged(object param) { return true; } public void DoSelectedActiveItemsChanged(object param) { if (param != null && param is List<Object>) { var List = param as List<Object>; MyLocalField = List; } } The new kind of DelegateCommand that allows me to pass objects as args: public class DelegateCommandWithParameter : ICommand { #region Private Fields private Func<object, bool> canExecute; private Action<object> executeAction; private bool canExecuteCache; #endregion #region Constructor public DelegateCommandWithParameter(Action<object> executeAction, Func<object, bool> canExecute) { this.executeAction = executeAction; this.canExecute = canExecute; } #endregion #region ICommand Members public bool CanExecute(object parameter) { bool temp = canExecute(parameter); if (canExecuteCache != temp) { canExecuteCache = temp; if (CanExecuteChanged != null) { CanExecuteChanged(this, new EventArgs()); } } return canExecuteCache; } public event EventHandler CanExecuteChanged; public void Execute(object parameter) { executeAction(parameter); } #endregion } Whenever my code gets to the DoSelectedActiveItemsChanged, the arg is always NULL.... am I being a complete doofus here? Where does the CommandParamter get linked to the command args? AKA, why does the View pass nothing back to the command. Please help.
0
4,224,916
11/19/2010 12:23:39
203,204
11/05/2009 05:57:52
120
11
How-to insert Image into Hyperlink in GWT
Is there a way to make a clickable Image in GWT?
java
image
gwt
hyperlink
null
null
open
How-to insert Image into Hyperlink in GWT === Is there a way to make a clickable Image in GWT?
0
415,511
01/06/2009 04:54:23
46,646
12/16/2008 12:26:29
89
0
How to get current time in Python
Can anybody tell what is the module/method used to get current time ???
python
current
time
methods
module
null
open
How to get current time in Python === Can anybody tell what is the module/method used to get current time ???
0
3,662,164
09/07/2010 19:51:25
113,416
05/27/2009 21:38:41
341
3
How to properly dispose of SP objects although not assigned?
If I assign SPContext.Current.Site.OpenWeb().Title to a string, do I need to dispose of it (if possible)? string title = SPContext.Current.Site.OpenWeb().Title; I'm still a little fuzzy on when to dispose of sp objects, so I always dispose of my SPWeb and SPSite objects... But, if I don't assign the statement above to an object first, is there any disposing I need to do? I also understand that there are certain cases where using Current eliminates the need to dispose. Thanks.
sharepoint
null
null
null
null
null
open
How to properly dispose of SP objects although not assigned? === If I assign SPContext.Current.Site.OpenWeb().Title to a string, do I need to dispose of it (if possible)? string title = SPContext.Current.Site.OpenWeb().Title; I'm still a little fuzzy on when to dispose of sp objects, so I always dispose of my SPWeb and SPSite objects... But, if I don't assign the statement above to an object first, is there any disposing I need to do? I also understand that there are certain cases where using Current eliminates the need to dispose. Thanks.
0
7,192,412
08/25/2011 14:45:23
343,148
05/17/2010 14:36:14
63
0
Input string was not in a correct format
I have a small problem here, When i tried to do the following steps, string set1="123.10,134.40"; string set2="17,134"; List<string> List1 = new List<string>(set1.Split(',')); List<string> List2 = new List<string>(set2.Split(',')); var QueryResult = from D1 in List1 from E1 in List2 select new { D1, E1 }; DataTable tempDT = new DataTable(); tempDT.Columns.Add("Data1", typeof(int)); tempDT.Columns.Add("Data2", typeof(string)); foreach (var item in QueryResult) { tempDT.Rows.Add(new object[] {Convert.ToInt32(item.E1.ToString()), Convert.ToString(item.D1.ToString()) }); } When I try to add those values to the tempDT. I am getting "Input string was not in a correct format." exception.Please help me out to fix the issue. Thanks Pradeep.A
c#
linq
null
null
null
null
open
Input string was not in a correct format === I have a small problem here, When i tried to do the following steps, string set1="123.10,134.40"; string set2="17,134"; List<string> List1 = new List<string>(set1.Split(',')); List<string> List2 = new List<string>(set2.Split(',')); var QueryResult = from D1 in List1 from E1 in List2 select new { D1, E1 }; DataTable tempDT = new DataTable(); tempDT.Columns.Add("Data1", typeof(int)); tempDT.Columns.Add("Data2", typeof(string)); foreach (var item in QueryResult) { tempDT.Rows.Add(new object[] {Convert.ToInt32(item.E1.ToString()), Convert.ToString(item.D1.ToString()) }); } When I try to add those values to the tempDT. I am getting "Input string was not in a correct format." exception.Please help me out to fix the issue. Thanks Pradeep.A
0
11,428,601
07/11/2012 08:33:01
1,337,806
04/17/2012 04:49:31
58
1
NLP Parser in Haskell
Does Haskell have a good (a) natural language parser (b) part of speech tagger (c) nlp library (a la python's nltk)
haskell
nlp
null
null
null
07/12/2012 12:18:15
not constructive
NLP Parser in Haskell === Does Haskell have a good (a) natural language parser (b) part of speech tagger (c) nlp library (a la python's nltk)
4
4,926,835
02/07/2011 21:29:43
601,881
02/03/2011 16:25:48
24
0
Can someone explain this c# code?
Can someone explain what lambda expressions are? Public Function GetHttpHandler(requestContext As RequestContext) As IHttpHandler Dim requestRouteValues = requestContext.RouteData.Values Dim routeValues = AdditionalRouteValues.Merge(requestRouteValues) Dim vpd = TargetRoute.GetVirtualPath(requestContext, routeValues) Dim targetUrl As String = Nothing If vpd IsNot Nothing Then targetUrl = "~/" & Convert.ToString(vpd.VirtualPath) Return New RedirectHttpHandler(targetUrl, Permanent, isReusable := False) End If Return New DelegateHttpHandler(Function(httpContext) InlineAssignHelper(httpContext.Response.StatusCode, 404), False) End Function
c#
c#-4.0
null
null
null
02/07/2011 21:35:46
not a real question
Can someone explain this c# code? === Can someone explain what lambda expressions are? Public Function GetHttpHandler(requestContext As RequestContext) As IHttpHandler Dim requestRouteValues = requestContext.RouteData.Values Dim routeValues = AdditionalRouteValues.Merge(requestRouteValues) Dim vpd = TargetRoute.GetVirtualPath(requestContext, routeValues) Dim targetUrl As String = Nothing If vpd IsNot Nothing Then targetUrl = "~/" & Convert.ToString(vpd.VirtualPath) Return New RedirectHttpHandler(targetUrl, Permanent, isReusable := False) End If Return New DelegateHttpHandler(Function(httpContext) InlineAssignHelper(httpContext.Response.StatusCode, 404), False) End Function
1
4,524,340
12/24/2010 05:08:46
300,385
03/23/2010 22:50:32
125
6
Is there some kind of static class that contains my applications window information in winforms
Is there an easy way in a winforms application to get access to the collection of forms that are open and which ones are on top, order they opened etc? I'd like to make it a static class so I can call it anywhere in my code without having to pass objects around. Otherwise, I'll have to make my own 'window manager' so to speak. Thanks, Isaac
c#-4.0
null
null
null
null
null
open
Is there some kind of static class that contains my applications window information in winforms === Is there an easy way in a winforms application to get access to the collection of forms that are open and which ones are on top, order they opened etc? I'd like to make it a static class so I can call it anywhere in my code without having to pass objects around. Otherwise, I'll have to make my own 'window manager' so to speak. Thanks, Isaac
0
4,404,633
12/10/2010 00:44:52
363,551
06/10/2010 14:29:59
91
1
What technologies was used to created spoof applications?
I have a client that would like to start a text spoof application. I have seen it be done before, and I am wondering where would I start to achieve this?
mobile
sms
null
null
null
null
open
What technologies was used to created spoof applications? === I have a client that would like to start a text spoof application. I have seen it be done before, and I am wondering where would I start to achieve this?
0
6,386,178
06/17/2011 13:07:16
745,835
05/09/2011 21:16:58
30
0
How do I use jquery ajax to retrieve a json object and refresh this object every n seconds
> Restful Service (from Server) @GET @Produces("application/json") @Consumes("application/json") @Path("/getStatus/") // server:8080/server/rest/admin/mamba/status/whatSoEver public void getStatus( @Context HttpServletRequest request, @Context HttpServletResponse response) throws ServletException, IOException { //create the JSON Object to pass to the client JSONObject object=new JSONObject(); response.setContentType("text/javascript"); String callback = request.getParameter("jsoncallback"); try { for (Server i : svr) { object.put("name",getName()); object.put("status",getStatus()); } } catch(Exception e) { throw new ServletException("JSON Hosed up"); } String json = object.toString(); /*response.getOutputStream().println(callback + "(" + json + ");");*/ response.getOutputStream().print(json); response.flushBuffer(); System.out.println("Sending "+json); } On the client side <script> $(document).ready(function() { function myFunc() { $.getJSON("http://localhost:8080/MyWebApp/getStatus", function (json) { $('#refreshMe').replaceWith(json.status); /* alert("Server name: " + json.name + "Server Status:"+json.status); */ }); } myFunc(); }); /*Do a refresh every 2 seconds */ setInterval( "myFunc()", 500 ); </script> > How do I get this jquery ajax call to > behave the same as the above? <script> $.ajaxSetup ({ cache: false }); $.ajax ({ url: "http://localhost:8080/MyWebApp/getStatus", dataType: 'json', data: "???", success: ??? }); </script>
javascript
jquery
ajax
jsp
null
06/18/2011 22:54:48
too localized
How do I use jquery ajax to retrieve a json object and refresh this object every n seconds === > Restful Service (from Server) @GET @Produces("application/json") @Consumes("application/json") @Path("/getStatus/") // server:8080/server/rest/admin/mamba/status/whatSoEver public void getStatus( @Context HttpServletRequest request, @Context HttpServletResponse response) throws ServletException, IOException { //create the JSON Object to pass to the client JSONObject object=new JSONObject(); response.setContentType("text/javascript"); String callback = request.getParameter("jsoncallback"); try { for (Server i : svr) { object.put("name",getName()); object.put("status",getStatus()); } } catch(Exception e) { throw new ServletException("JSON Hosed up"); } String json = object.toString(); /*response.getOutputStream().println(callback + "(" + json + ");");*/ response.getOutputStream().print(json); response.flushBuffer(); System.out.println("Sending "+json); } On the client side <script> $(document).ready(function() { function myFunc() { $.getJSON("http://localhost:8080/MyWebApp/getStatus", function (json) { $('#refreshMe').replaceWith(json.status); /* alert("Server name: " + json.name + "Server Status:"+json.status); */ }); } myFunc(); }); /*Do a refresh every 2 seconds */ setInterval( "myFunc()", 500 ); </script> > How do I get this jquery ajax call to > behave the same as the above? <script> $.ajaxSetup ({ cache: false }); $.ajax ({ url: "http://localhost:8080/MyWebApp/getStatus", dataType: 'json', data: "???", success: ??? }); </script>
3
5,299,063
03/14/2011 13:16:21
997
08/11/2008 12:29:21
441
12
downsides javascript prefetching
I'm currently experimenting with prefetching pages to increase perceived performance of our website, using the code below (req. jQuery). Only 0.5% of our visitors use dial-up, I'm excluding querystrings (good old times), externals links (http) and pdfs (our large files are in this format). On a production site, what other possible negative scenario's apply when prefetching that I haven't considered? > <script type="text/javascript"> > $(document).ready(function() { > $("a").each( > > function(){ > $(this).bind ("mouseover", function(){ > var href=$(this).attr('href'); > if ( > (href.indexOf('?') == -1)&& > (href.indexOf('http:') ==-1)&& > (href.indexOf('.pdf') == -1) > ) { > $.ajax({ url:href, cache:true, dataType:"text" }); > } > else { > $('html').append('<div>not precaching: ' + href + '</div>'); > } > }); > $(this).bind ("mousedown", function(){ > var href=$(this).attr('href'); > window.location.href = href; > }); }); }); </script> For certain links, when hovered over it will preload the page and on mousedown will navigate (rather then after the button is released).
javascript
jquery
prefetch
null
null
null
open
downsides javascript prefetching === I'm currently experimenting with prefetching pages to increase perceived performance of our website, using the code below (req. jQuery). Only 0.5% of our visitors use dial-up, I'm excluding querystrings (good old times), externals links (http) and pdfs (our large files are in this format). On a production site, what other possible negative scenario's apply when prefetching that I haven't considered? > <script type="text/javascript"> > $(document).ready(function() { > $("a").each( > > function(){ > $(this).bind ("mouseover", function(){ > var href=$(this).attr('href'); > if ( > (href.indexOf('?') == -1)&& > (href.indexOf('http:') ==-1)&& > (href.indexOf('.pdf') == -1) > ) { > $.ajax({ url:href, cache:true, dataType:"text" }); > } > else { > $('html').append('<div>not precaching: ' + href + '</div>'); > } > }); > $(this).bind ("mousedown", function(){ > var href=$(this).attr('href'); > window.location.href = href; > }); }); }); </script> For certain links, when hovered over it will preload the page and on mousedown will navigate (rather then after the button is released).
0
9,393,713
02/22/2012 11:15:22
15,441
09/17/2008 09:20:36
1,996
42
Clojure - test for equality of function expression?
Suppose I have the following clojure functions: (defn a [x] (* x x)) (def b (fn [x] (* x x))) (def c (eval (read-string "(defn d [x] (* x x))"))) Is there a way to test for the equality of the function expression - some equivalent of (eqls a b) returns true?
function
clojure
expression
equality
null
null
open
Clojure - test for equality of function expression? === Suppose I have the following clojure functions: (defn a [x] (* x x)) (def b (fn [x] (* x x))) (def c (eval (read-string "(defn d [x] (* x x))"))) Is there a way to test for the equality of the function expression - some equivalent of (eqls a b) returns true?
0
394,320
12/26/2008 21:52:10
4,234
09/02/2008 13:28:31
180
53
Software neither in active development nor moribund (ie, bug-free software, classic example being TeX).
I have two related questions: First, why is it so rare for software to ever be finished? It seems "no longer in active development" is often synonymous with "moribund". Second, what are exceptions to this? Donald Knuth's TeX is a famous example. It's been untouched for years yet remains massively popular. Knuth even has cash bug bounty, which is never claimed anymore. There are probably various unix utilities like this, used ubiquitously yet with the source code in stasis. I'd like to hear interesting examples and commentary on why this is rare.
philosophy
software-engineering
null
null
null
04/05/2012 13:42:36
not constructive
Software neither in active development nor moribund (ie, bug-free software, classic example being TeX). === I have two related questions: First, why is it so rare for software to ever be finished? It seems "no longer in active development" is often synonymous with "moribund". Second, what are exceptions to this? Donald Knuth's TeX is a famous example. It's been untouched for years yet remains massively popular. Knuth even has cash bug bounty, which is never claimed anymore. There are probably various unix utilities like this, used ubiquitously yet with the source code in stasis. I'd like to hear interesting examples and commentary on why this is rare.
4
6,983,687
08/08/2011 14:30:18
631
08/07/2008 12:14:37
3,179
68
Good practices in designing Universal apps (iPad/iPhone)
So I just wrote an absolutely superb, perfectly well-designed iPhone app that's going to make so rich, I'll be awash in pontoon boats and swimsuit models and helicopters. I want to make even more cash by converting it to a universal app for both iPad and iPhone. Now that I'm doing that, and being the lazy programmer I am, trying to maximize reuse of code I've already written, I'm finding I can reuse most of it -- certainly all of the model -- but there's always some little thing that I have to modify on a controller class. Or, there's constant checks on `UI_USER_INTERFACE_IDIOM()` which seems like a code smell to me. At the same time, I think the iPad version should not be the iPhone version writ large. A different UI is certainly warranted to most cases, but there will be spots where you want to reuse a dialog, or a whole view hierarchy. So, I ask the community. What are some good practices to follow to ensure that my app can be universal with minimal tweaks?
iphone
cocoa-touch
ipad
design
null
08/08/2011 19:09:58
not constructive
Good practices in designing Universal apps (iPad/iPhone) === So I just wrote an absolutely superb, perfectly well-designed iPhone app that's going to make so rich, I'll be awash in pontoon boats and swimsuit models and helicopters. I want to make even more cash by converting it to a universal app for both iPad and iPhone. Now that I'm doing that, and being the lazy programmer I am, trying to maximize reuse of code I've already written, I'm finding I can reuse most of it -- certainly all of the model -- but there's always some little thing that I have to modify on a controller class. Or, there's constant checks on `UI_USER_INTERFACE_IDIOM()` which seems like a code smell to me. At the same time, I think the iPad version should not be the iPhone version writ large. A different UI is certainly warranted to most cases, but there will be spots where you want to reuse a dialog, or a whole view hierarchy. So, I ask the community. What are some good practices to follow to ensure that my app can be universal with minimal tweaks?
4
10,162,678
04/15/2012 14:00:32
1,178,770
01/30/2012 18:53:47
59
0
JSF - Dice roll with images (JAVA)
today I have a more general question to ask you. In a [previous exercise][1] I created a JSF web application that simulates the roll of two dice. The output after each page refresh looks something like this: > On your third throw you have thrown a 3 and a 6. Now, I want to create an application similar to that, except that both dice and the throw counter will be displayed as images. The throw counter must display values in range 1 to 9. I am not very experienced in jsf, hence I am asking for some advice as to how to get started with this exercise. If you could help, that would be much appreciated. Thanks! [1]: http://stackoverflow.com/questions/10155704/jsf-random-number-using-beans-java/%22previous%20exercise%22
java
image
jsf
web
dice
04/17/2012 04:36:45
not a real question
JSF - Dice roll with images (JAVA) === today I have a more general question to ask you. In a [previous exercise][1] I created a JSF web application that simulates the roll of two dice. The output after each page refresh looks something like this: > On your third throw you have thrown a 3 and a 6. Now, I want to create an application similar to that, except that both dice and the throw counter will be displayed as images. The throw counter must display values in range 1 to 9. I am not very experienced in jsf, hence I am asking for some advice as to how to get started with this exercise. If you could help, that would be much appreciated. Thanks! [1]: http://stackoverflow.com/questions/10155704/jsf-random-number-using-beans-java/%22previous%20exercise%22
1
6,947,588
08/04/2011 19:40:36
172,350
09/12/2009 01:08:21
1,165
34
Symfony: How to use same action for CREATE and UPDATE?
Lets say I have a website where I create articles and I also edit existing articles. The template page for creating new articles is the same as the template page for editing existing articles. The only difference is that the form for editing has default/existing values added to it already. I'm trying to figure out how to use the same action for both routes. Here are my routes: article_new url: /article/new/ class: sfDoctrineRoute options: model: MyArticle type: object param: module: article action: edit article_edit url: /article/edit/:id/ class: sfDoctrineRoute options: model: MyArticle type: object param: module: article action: edit requirements: id: /d+ So both articles point to the following action: public function executeEdit(sfWebRequest $request) { $article = $this->getRoute()->getObject(); $this->form = new MyForm( $article ); // Binding and validation stuff here // ..... } This works great when you want to edit an article. `getRoute()->getObject()` automatically get the correct article for you from the `id` slug and passes those values as defaults into the form. Perfect. But with the `article_new` route, it doesn't work so well. The `getRoute()->getObject()` returns the first article in my database table, even though I didn't feed the url any type of `id` parameter. So the information from the first article in the database gets passed as default values into the form. I obviously don't want this. I also tried removing the `class: sfDoctrineRoute` stuff from the `article_new` route but then `getRoute()->getObject() fails because it's no longer an `sfRoute` object that I'm working with. What is the best approach here? I'd like to do everything in one action just to save programming time and future maintenance time. Also I found that one solution is that I can check to see if `$request->getParameter('id')` is `null` and if so, then `$article = array()`, else the article is retrieved using the `getRoute()->getObject()`. That seems to work fine but I figured there might be less hacky solution.
php
symfony
symfony-forms
null
null
null
open
Symfony: How to use same action for CREATE and UPDATE? === Lets say I have a website where I create articles and I also edit existing articles. The template page for creating new articles is the same as the template page for editing existing articles. The only difference is that the form for editing has default/existing values added to it already. I'm trying to figure out how to use the same action for both routes. Here are my routes: article_new url: /article/new/ class: sfDoctrineRoute options: model: MyArticle type: object param: module: article action: edit article_edit url: /article/edit/:id/ class: sfDoctrineRoute options: model: MyArticle type: object param: module: article action: edit requirements: id: /d+ So both articles point to the following action: public function executeEdit(sfWebRequest $request) { $article = $this->getRoute()->getObject(); $this->form = new MyForm( $article ); // Binding and validation stuff here // ..... } This works great when you want to edit an article. `getRoute()->getObject()` automatically get the correct article for you from the `id` slug and passes those values as defaults into the form. Perfect. But with the `article_new` route, it doesn't work so well. The `getRoute()->getObject()` returns the first article in my database table, even though I didn't feed the url any type of `id` parameter. So the information from the first article in the database gets passed as default values into the form. I obviously don't want this. I also tried removing the `class: sfDoctrineRoute` stuff from the `article_new` route but then `getRoute()->getObject() fails because it's no longer an `sfRoute` object that I'm working with. What is the best approach here? I'd like to do everything in one action just to save programming time and future maintenance time. Also I found that one solution is that I can check to see if `$request->getParameter('id')` is `null` and if so, then `$article = array()`, else the article is retrieved using the `getRoute()->getObject()`. That seems to work fine but I figured there might be less hacky solution.
0
6,198,804
06/01/2011 09:12:51
406,762
07/30/2010 13:35:07
101
0
methods of creating image sprites that are fast and effective?
I was wondering of anyone can recommend any techniques they use or any tips they have for creating quick sets of image sprites, are there any psd to sprite tools are anything like that? Kyle
html
css
design
photoshop
null
06/04/2011 13:31:13
off topic
methods of creating image sprites that are fast and effective? === I was wondering of anyone can recommend any techniques they use or any tips they have for creating quick sets of image sprites, are there any psd to sprite tools are anything like that? Kyle
2
4,820,804
01/27/2011 19:21:32
293,686
03/15/2010 03:16:16
156
13
Looking for a way to use an NSArray as an outlet for a bunch of buttons
My user interface has four buttons and they all will share some common behaviour, like tracking area creation a things like that. What I'm looking for is a solution so I don't have to do this: @interface MyController : NSWindowController { NSButton * button1; NSButton * button2; NSButton * button3; NSButton * button4; } @property (nonatomic) IBOutlet NSButton * button1; @property (nonatomic) IBOutlet NSButton * button2; // and so on @end I would like to have a solution like this one: @interface MyController : NSWindowController { NSMutableArray * buttons; } @property (nonatomic) IBOutlet NSMutableArray * buttons; // tell interface builder to place all buttons here @end Is this possible?
objective-c
cocoa
osx
null
null
null
open
Looking for a way to use an NSArray as an outlet for a bunch of buttons === My user interface has four buttons and they all will share some common behaviour, like tracking area creation a things like that. What I'm looking for is a solution so I don't have to do this: @interface MyController : NSWindowController { NSButton * button1; NSButton * button2; NSButton * button3; NSButton * button4; } @property (nonatomic) IBOutlet NSButton * button1; @property (nonatomic) IBOutlet NSButton * button2; // and so on @end I would like to have a solution like this one: @interface MyController : NSWindowController { NSMutableArray * buttons; } @property (nonatomic) IBOutlet NSMutableArray * buttons; // tell interface builder to place all buttons here @end Is this possible?
0
9,277,458
02/14/2012 13:12:36
834,697
03/11/2010 02:14:27
23
1
Setting programmatically values of a form in an Web Browser
Assuming that I have an html web page open in firefox,safari,google etc. In this page have a form, like this: <form name='fo' action='baa.aspx'> <input type='text' name='name'> <input type='file' name='pic'> </form> how can I to set values of this html inputs and submit it at following? there an library or some thing equivalent for handling browser? it is possible? point me a path,please! the solution can be written in `C`, `C++` `Java` or `C#`. But if you know how do this on another programming language is very useful as well. Any help is very appreciated. Any help is very appreciated. I hope this is clear for you. Thanks in advance.
c#
c++
c
webbrowser
null
02/16/2012 00:55:40
not a real question
Setting programmatically values of a form in an Web Browser === Assuming that I have an html web page open in firefox,safari,google etc. In this page have a form, like this: <form name='fo' action='baa.aspx'> <input type='text' name='name'> <input type='file' name='pic'> </form> how can I to set values of this html inputs and submit it at following? there an library or some thing equivalent for handling browser? it is possible? point me a path,please! the solution can be written in `C`, `C++` `Java` or `C#`. But if you know how do this on another programming language is very useful as well. Any help is very appreciated. Any help is very appreciated. I hope this is clear for you. Thanks in advance.
1
3,820,293
09/29/2010 09:26:41
457,142
09/24/2010 10:12:36
16
0
Checking for equality in lists in SML
i want to write a function that checks for equality of lists in SML for instance : [1,2,3]=[1,2,3]; val it = true : bool So instead of writing down the whole thing, i want to make a function that takes two predefined lists, and compare them, so that if list01 = [1,2,3] and list09 = [1,2,3] then fun equal (list01,list09); will return -val it = true : bool; Thanx in advance for any ideas/hints and help :)
equality
sml
null
null
null
null
open
Checking for equality in lists in SML === i want to write a function that checks for equality of lists in SML for instance : [1,2,3]=[1,2,3]; val it = true : bool So instead of writing down the whole thing, i want to make a function that takes two predefined lists, and compare them, so that if list01 = [1,2,3] and list09 = [1,2,3] then fun equal (list01,list09); will return -val it = true : bool; Thanx in advance for any ideas/hints and help :)
0
10,684,194
05/21/2012 11:17:39
1,184,896
02/02/2012 10:56:57
4
0
Why data show one row.I want show all row.Please helpme
Connection conn = null; String url = "jdbc:jtds:sqlserver://192.168.1.11:1433/"; String dbName = "koh;Instance=MSSQLSERVER;"; String userName = "bit"; String password = "1234"; String driver = "net.sourceforge.jtds.jdbc.Driver"; try { Class.forName(driver).newInstance(); conn = DriverManager.getConnection(url+dbName,userName,password); Log.w("connect","Connect Success"); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT LocalDesc FROM StaffPosition WHERE LocalDesc IN ('XXX','Administrator','Trainner')"); String[] items44 = new String[] {}; while (rs.next()) { items44 = new String[]{rs.getString("LocalDesc")}; } Spinner spinner = (Spinner) findViewById(R.id.spinner1); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, items44); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); conn.close(); } catch (Exception e) { Log.w("can't connect",e.toString()); }} data is show one row . Show XXX but not show Administrator and Trainner. Do you like this.Pleast example to me.
android
null
null
null
null
05/22/2012 14:19:42
not a real question
Why data show one row.I want show all row.Please helpme === Connection conn = null; String url = "jdbc:jtds:sqlserver://192.168.1.11:1433/"; String dbName = "koh;Instance=MSSQLSERVER;"; String userName = "bit"; String password = "1234"; String driver = "net.sourceforge.jtds.jdbc.Driver"; try { Class.forName(driver).newInstance(); conn = DriverManager.getConnection(url+dbName,userName,password); Log.w("connect","Connect Success"); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT LocalDesc FROM StaffPosition WHERE LocalDesc IN ('XXX','Administrator','Trainner')"); String[] items44 = new String[] {}; while (rs.next()) { items44 = new String[]{rs.getString("LocalDesc")}; } Spinner spinner = (Spinner) findViewById(R.id.spinner1); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, items44); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); conn.close(); } catch (Exception e) { Log.w("can't connect",e.toString()); }} data is show one row . Show XXX but not show Administrator and Trainner. Do you like this.Pleast example to me.
1
3,008,003
06/09/2010 16:54:28
115,608
06/01/2009 19:31:12
175
13
localstorage vs html5?
What's the difference between local/html5 on this page: http://code.google.com/p/jquery-jstore/wiki/DefaultEngines I was under the impression that I could use localstorage on Chrome, but looks like that's not the case? Some elucidation would be greatly appreciated. Thanks.
html5
local-storage
null
null
null
null
open
localstorage vs html5? === What's the difference between local/html5 on this page: http://code.google.com/p/jquery-jstore/wiki/DefaultEngines I was under the impression that I could use localstorage on Chrome, but looks like that's not the case? Some elucidation would be greatly appreciated. Thanks.
0
7,848,969
10/21/2011 11:48:23
968,184
09/28/2011 01:36:34
1
0
Integrating PayPal with a WebMatrix-based site (Razor/C#)
I have spent countless hours reading over the docs on PayPal's site and also on their x.com site, and have searched all over the web for this, but unfortunately, I am in need of some help. I have a service that I offer on my site, and all I am trying to do is to send the customer off to the paypal site (which I can do), and let them pay (which they can do), and then have them be redirected back to my site once the payment has been approved/made (which is what happens), but that's where it all stops... I have tried so many tutorials and samples out there, and it's becoming quite difficult here. I need to be able to do simple checks on my site (IPN thing). So that I know whether or not someone has paid for the service at paypal, so I know whether or not I should activate the service on my site for that particular customer. I know there is a PayPal Helper, but that does not help me in this situation since it does not deal with the IPN stuff. Note: This service is not a subscription service, it is just a one-off payment. I would really appreciate your help on this, I really am stuck and don't know what to do next.
c#
asp.net
razor
paypal
ipn
null
open
Integrating PayPal with a WebMatrix-based site (Razor/C#) === I have spent countless hours reading over the docs on PayPal's site and also on their x.com site, and have searched all over the web for this, but unfortunately, I am in need of some help. I have a service that I offer on my site, and all I am trying to do is to send the customer off to the paypal site (which I can do), and let them pay (which they can do), and then have them be redirected back to my site once the payment has been approved/made (which is what happens), but that's where it all stops... I have tried so many tutorials and samples out there, and it's becoming quite difficult here. I need to be able to do simple checks on my site (IPN thing). So that I know whether or not someone has paid for the service at paypal, so I know whether or not I should activate the service on my site for that particular customer. I know there is a PayPal Helper, but that does not help me in this situation since it does not deal with the IPN stuff. Note: This service is not a subscription service, it is just a one-off payment. I would really appreciate your help on this, I really am stuck and don't know what to do next.
0
10,255,607
04/21/2012 02:12:56
272,501
02/13/2010 18:25:08
1,294
11
JavaScript returning a 2D array in a function
I'm trying to return an array within a function like this: function loadMap(map) { if (map == 1) { return board = [][ [ 1, 1, 1, 1, 1, 1, 1, 190, 115, 1, 1, 1, 1, 1, 1, 2], [ 190, 190, 190, 190, 190, 190, 190, 190, 13, 148, 148, 148, 148, 148, 121, 2], [ 1, 520, 127, 127, 127, 127, 127, 13, 13, 148, 167, 167, 167, 148, 343, 1], [ 1, 520, 127, 166, 166, 166, 127, 13, 13, 148, 167, 167, 167, 148, 343, 1], [ 1, 520, 127, 166, 166, 166, 127, 13, 13, 148, 148, 148, 183, 148, 343, 1], [ 1, 520, 364, 174, 127, 361, 127, 13, 13, 13, 13, 13, 13, 13, 13, 1], [ 115, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 115], [ 1, 514, 13, 13, 394, 343, 145, 220, 145, 145, 145, 13, 13, 13, 13, 1], [ 1, 514, 13, 13, 343, 118, 145, 166, 166, 166, 145, 13, 13, 13, 13, 1], [ 1, 514, 514, 13, 118, 118, 145, 166, 166, 166, 145, 13, 13, 13, 13, 1], [ 1, 1, 1, 115, 1, 1, 145, 145, 145, 145, 145, 1, 1, 1, 1, 1] ]; } } However that is not right. How do I fix this?
javascript
null
null
null
null
null
open
JavaScript returning a 2D array in a function === I'm trying to return an array within a function like this: function loadMap(map) { if (map == 1) { return board = [][ [ 1, 1, 1, 1, 1, 1, 1, 190, 115, 1, 1, 1, 1, 1, 1, 2], [ 190, 190, 190, 190, 190, 190, 190, 190, 13, 148, 148, 148, 148, 148, 121, 2], [ 1, 520, 127, 127, 127, 127, 127, 13, 13, 148, 167, 167, 167, 148, 343, 1], [ 1, 520, 127, 166, 166, 166, 127, 13, 13, 148, 167, 167, 167, 148, 343, 1], [ 1, 520, 127, 166, 166, 166, 127, 13, 13, 148, 148, 148, 183, 148, 343, 1], [ 1, 520, 364, 174, 127, 361, 127, 13, 13, 13, 13, 13, 13, 13, 13, 1], [ 115, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 115], [ 1, 514, 13, 13, 394, 343, 145, 220, 145, 145, 145, 13, 13, 13, 13, 1], [ 1, 514, 13, 13, 343, 118, 145, 166, 166, 166, 145, 13, 13, 13, 13, 1], [ 1, 514, 514, 13, 118, 118, 145, 166, 166, 166, 145, 13, 13, 13, 13, 1], [ 1, 1, 1, 115, 1, 1, 145, 145, 145, 145, 145, 1, 1, 1, 1, 1] ]; } } However that is not right. How do I fix this?
0
10,150,429
04/14/2012 02:12:15
1,332,729
04/14/2012 01:39:26
1
0
Inserting dynamic variables into an HTML template...PHP? ASP? ColdFusion? SQL?
I have looked on this site, googled, and even searched adobe developer central, without luck. As such, I think I might not know the correct terminology to search for, as my question is pretty straight-forward. Thus, if the title was misleading I apologize. I'd like to learn how to create an HTML template which will then insert variables as needed, specifically, the names of cities and states (for a franchise), where it is appropriate. Not to be too broad but I am a "front-end" web designer yet I am familiar (but not comfortable) with dynamic languages. This seems like it'd be very simple with what I know of PHP and MySQL, and I prefer (I view it as support) open-source technologies, but not at the expense of performance (I have read that PHP doesn't support UTF-8). I don't know much about ColdFusion but some stuff on Adobe's forums seemed like it was along the right lines... In short, what I am getting at, is I'd like to know how to do this but also, if--for now--I am going to start with learning one dynamic language, what are the pros and cons of them (same for database technology). This may seem contradictory to my previous statement, but being a beginner, it would be awesome if you could recommend one that is "easier" to learn than another. Basically, I'm asking for people more familiar with this to make a judgement call and give me some guidance...trying to figure everything out myself is making me prematurely old--either that or the 80+ hour weeks. Thanks everybody.
php
asp.net
mysql
html
variables
null
open
Inserting dynamic variables into an HTML template...PHP? ASP? ColdFusion? SQL? === I have looked on this site, googled, and even searched adobe developer central, without luck. As such, I think I might not know the correct terminology to search for, as my question is pretty straight-forward. Thus, if the title was misleading I apologize. I'd like to learn how to create an HTML template which will then insert variables as needed, specifically, the names of cities and states (for a franchise), where it is appropriate. Not to be too broad but I am a "front-end" web designer yet I am familiar (but not comfortable) with dynamic languages. This seems like it'd be very simple with what I know of PHP and MySQL, and I prefer (I view it as support) open-source technologies, but not at the expense of performance (I have read that PHP doesn't support UTF-8). I don't know much about ColdFusion but some stuff on Adobe's forums seemed like it was along the right lines... In short, what I am getting at, is I'd like to know how to do this but also, if--for now--I am going to start with learning one dynamic language, what are the pros and cons of them (same for database technology). This may seem contradictory to my previous statement, but being a beginner, it would be awesome if you could recommend one that is "easier" to learn than another. Basically, I'm asking for people more familiar with this to make a judgement call and give me some guidance...trying to figure everything out myself is making me prematurely old--either that or the 80+ hour weeks. Thanks everybody.
0
7,630,427
10/03/2011 01:46:13
892,690
08/13/2011 02:50:16
76
0
Interface php results with jQuery
I have quite some experience with php, but I am very new to using jQuery. I am hoping someone can give me some example code (preferably) or point me in the right direction for which jQuery functions I need to use, essentially, what I want to do is for a user to submit a form in php and then for the results of that form submit to be displayed on the same page using jQuery (I assume). Like I said I have very little experience with jQuery, and none doing something like this. So any help is appreciated.
php
jquery
forms
null
null
null
open
Interface php results with jQuery === I have quite some experience with php, but I am very new to using jQuery. I am hoping someone can give me some example code (preferably) or point me in the right direction for which jQuery functions I need to use, essentially, what I want to do is for a user to submit a form in php and then for the results of that form submit to be displayed on the same page using jQuery (I assume). Like I said I have very little experience with jQuery, and none doing something like this. So any help is appreciated.
0
4,514,289
12/22/2010 22:27:27
354,134
05/30/2010 19:21:00
473
24
Real-time open-source team programming hangout site?
I sometimes want to write a program of general interest, but want to work in real-time w/ someone else, just to make it easier, more interesting, and not run into stumbling blocks (where I spend an hour trying to figure something out, but another programmer takes a minute to do it and vice versa). Is there a "hangout" location for people who are looking to team program in real time? vark.com, irc.freenode.net, stackexchange and many other sites are excellent for one off questions, but I'm sure there are people who want to team program to create a quick-and-dirty, but useful, program.
open-source
teamwork
extreme-programming
null
null
08/05/2011 04:21:16
off topic
Real-time open-source team programming hangout site? === I sometimes want to write a program of general interest, but want to work in real-time w/ someone else, just to make it easier, more interesting, and not run into stumbling blocks (where I spend an hour trying to figure something out, but another programmer takes a minute to do it and vice versa). Is there a "hangout" location for people who are looking to team program in real time? vark.com, irc.freenode.net, stackexchange and many other sites are excellent for one off questions, but I'm sure there are people who want to team program to create a quick-and-dirty, but useful, program.
2
2,128,890
01/24/2010 21:17:16
461,880
10/18/2008 10:53:27
157
11
how to detect which level on the dom is selected
I have the following selector $('#navigation ul li a').click(function(evt) {} this get the elements i need, but also retries child elements. ie i get me this as well #navigation ul li li a // extra li Just wondering the best way to detect what level of the dom i am selecting.
jquery
javascript
null
null
null
null
open
how to detect which level on the dom is selected === I have the following selector $('#navigation ul li a').click(function(evt) {} this get the elements i need, but also retries child elements. ie i get me this as well #navigation ul li li a // extra li Just wondering the best way to detect what level of the dom i am selecting.
0
11,491,837
07/15/2012 12:21:02
1,507,756
07/06/2012 20:08:41
1
0
php or jsf for public web site?
We have a public website written in php. We are considering rebuit it with jsf. What is your opinions about building a public website with php or jsf? Pros & cons? When to choose php? When to choose jsf? Thanks
java
php
website
null
null
07/15/2012 12:44:43
not constructive
php or jsf for public web site? === We have a public website written in php. We are considering rebuit it with jsf. What is your opinions about building a public website with php or jsf? Pros & cons? When to choose php? When to choose jsf? Thanks
4
6,718,052
07/16/2011 14:37:45
574,122
01/13/2011 11:05:13
738
3
Data Structures and Algorithms book in Java 5 or 6 or Scala for programmers and not a CS class textbook
Virtually all the books I looked at so far related to this topic are designed for computer science students in a class room. I am looking for a book that is authored by professional working software engineer and its for working programmers. Do you know such as book? Especially I am looking for something that also introduces related math such as statistic or algebra and makes good use of Object Oriendted concepts. If no such book then I am looking for online PDF documents related to the topic of this question. It would be ideal if it uses scala but if not then Java 5 or 6 is ok.
java
scala
null
null
null
07/18/2011 02:10:16
off topic
Data Structures and Algorithms book in Java 5 or 6 or Scala for programmers and not a CS class textbook === Virtually all the books I looked at so far related to this topic are designed for computer science students in a class room. I am looking for a book that is authored by professional working software engineer and its for working programmers. Do you know such as book? Especially I am looking for something that also introduces related math such as statistic or algebra and makes good use of Object Oriendted concepts. If no such book then I am looking for online PDF documents related to the topic of this question. It would be ideal if it uses scala but if not then Java 5 or 6 is ok.
2
9,201,752
02/08/2012 21:30:56
1,182,960
02/01/2012 14:54:47
1
1
Radio buttons for site
How to make radio buttons using css, html, javascript, jquery, php, using my own images and with function `.fadeTo` on hover? Best will be of using only one image for one button but for all functions (default, hover, clicked - so image is showing only needed part, maybe top, or center or bottom).
javascript
jquery
css
button
radio
02/09/2012 07:18:27
not a real question
Radio buttons for site === How to make radio buttons using css, html, javascript, jquery, php, using my own images and with function `.fadeTo` on hover? Best will be of using only one image for one button but for all functions (default, hover, clicked - so image is showing only needed part, maybe top, or center or bottom).
1
292,107
11/15/2008 03:35:32
19,687
09/20/2008 16:29:52
479
29
How can the Eight Commandments of Source Code Control be modernized?
1. You shall check in early and check in often. You anger your coworkers when you check out a file and insist on keeping it checked out until some future point in time that is measured using variables that exist solely in your brain. 2. You shall never check in code that breaks the build. If you code does not compile, it does not belong in the source control repository. 3. You shall not go home for the day with files checked out, nor shall you depart for the weekend or for a vacation, with files checked out. 4. You shall leave a descriptive comment when checking in your code. You need not include your name or the date in the comment as that information is already tracked. 5. You shall use the 'Undo Checkout' option if you check out a file and do not make any changes. It displeases your coworkers when you check in code that has not changed at all from the original. 6. You shall not use comments to 'save' defunct code. Fear not, for the code you delete still exists in the source control code history and can be retrieved if needed. 7. You shall use source control for more than archiving just code. The source code control repository makes an excellent storage for technical docs, SQL scripts, and other documents and files related to the project. 8. You shall religiously backup your source code control database on a regular basis and store a copy in an off-site location. From http://scottonwriting.net/sowblog/posts/13581.aspx
version-control
null
null
null
null
04/05/2012 13:33:38
not constructive
How can the Eight Commandments of Source Code Control be modernized? === 1. You shall check in early and check in often. You anger your coworkers when you check out a file and insist on keeping it checked out until some future point in time that is measured using variables that exist solely in your brain. 2. You shall never check in code that breaks the build. If you code does not compile, it does not belong in the source control repository. 3. You shall not go home for the day with files checked out, nor shall you depart for the weekend or for a vacation, with files checked out. 4. You shall leave a descriptive comment when checking in your code. You need not include your name or the date in the comment as that information is already tracked. 5. You shall use the 'Undo Checkout' option if you check out a file and do not make any changes. It displeases your coworkers when you check in code that has not changed at all from the original. 6. You shall not use comments to 'save' defunct code. Fear not, for the code you delete still exists in the source control code history and can be retrieved if needed. 7. You shall use source control for more than archiving just code. The source code control repository makes an excellent storage for technical docs, SQL scripts, and other documents and files related to the project. 8. You shall religiously backup your source code control database on a regular basis and store a copy in an off-site location. From http://scottonwriting.net/sowblog/posts/13581.aspx
4
5,956,449
05/10/2011 21:03:22
747,603
05/10/2011 21:03:22
1
0
PHP Basic encryption/decryption for URL parameters
I'm creating a standard 'framework' in PHP for my own projects. On this point I want to have certain URL parameters encrypted. Those variables will not contain any data I need to hide from anyone. Think about sorting parameters etc.. But I do want to have some restrictions on the encyption output. - No security involved at all - Decryption - Basic characters only (A-Z,a-z,0-9) - Optionally salt - Optionally limit length I've searched the internet, but all contained characters I did not prefer due to my htaccess standards. People that asked the same question often get point at security leaving no suitable answer in my case. Has anybody encountered this, and has a solution for this which I think must be basic? Many thanks in advance.
php
url
parameters
encryption
null
05/10/2011 21:28:12
too localized
PHP Basic encryption/decryption for URL parameters === I'm creating a standard 'framework' in PHP for my own projects. On this point I want to have certain URL parameters encrypted. Those variables will not contain any data I need to hide from anyone. Think about sorting parameters etc.. But I do want to have some restrictions on the encyption output. - No security involved at all - Decryption - Basic characters only (A-Z,a-z,0-9) - Optionally salt - Optionally limit length I've searched the internet, but all contained characters I did not prefer due to my htaccess standards. People that asked the same question often get point at security leaving no suitable answer in my case. Has anybody encountered this, and has a solution for this which I think must be basic? Many thanks in advance.
3
10,898,879
06/05/2012 14:07:02
1,027,669
11/03/2011 12:30:11
121
3
Add icon to a panel in Sencha
I am new to sencha. I am trying to add an icon to a panel, but my code doesn't work. Ext.define('components.ImagePanel', { extend: 'Ext.Panel', initialize: function () { this.callParent(arguments); var image = { xtype: "image", src: 'icon.png', width:100, height:100 }, scope: this }; this.add([image]); }); What I am doing wrong?
icons
sencha
null
null
null
null
open
Add icon to a panel in Sencha === I am new to sencha. I am trying to add an icon to a panel, but my code doesn't work. Ext.define('components.ImagePanel', { extend: 'Ext.Panel', initialize: function () { this.callParent(arguments); var image = { xtype: "image", src: 'icon.png', width:100, height:100 }, scope: this }; this.add([image]); }); What I am doing wrong?
0
9,349,072
02/19/2012 12:18:34
1,535,251
03/06/2011 11:29:28
56
4
Multithread web estimates .NET
I write an application which works in one or several threads estimating some values and sending them to another server. Threads must work in cycle and supposed to be accessible through network via http to receive data that will be handled in those threads. Also they must have some local variables but as I know web-server apps like on ASP.NET reinitialize variables on each request. So can I use one of following means to realize such application: WCF, ASP.NET, cloud services on Azure, or I'll have to use smth other? Hence what ones?
asp.net
asp.net-mvc
wcf
azure
null
02/19/2012 23:27:02
not a real question
Multithread web estimates .NET === I write an application which works in one or several threads estimating some values and sending them to another server. Threads must work in cycle and supposed to be accessible through network via http to receive data that will be handled in those threads. Also they must have some local variables but as I know web-server apps like on ASP.NET reinitialize variables on each request. So can I use one of following means to realize such application: WCF, ASP.NET, cloud services on Azure, or I'll have to use smth other? Hence what ones?
1
9,222,656
02/10/2012 04:23:34
1,182,212
02/01/2012 08:16:52
1
0
how can i will insert the same data when user local address and permanent address is same?
i don't want to type the same data if both the address is same i.e. if local address and Permanent address is same then i want to ask only is both user address is same then automatically fill the same data as previous otherwise open the text field so that user can fill the data in HTML form
javascript
html
null
null
null
02/10/2012 23:28:30
not a real question
how can i will insert the same data when user local address and permanent address is same? === i don't want to type the same data if both the address is same i.e. if local address and Permanent address is same then i want to ask only is both user address is same then automatically fill the same data as previous otherwise open the text field so that user can fill the data in HTML form
1
4,477,992
12/18/2010 12:18:39
546,969
12/18/2010 12:18:39
1
0
How to build GWT standalone application?
I need to design SPA with GWT technology, but I do not understand clearly how to make (compile) only one page with all JavaScript code in it. So, for example my task is to make simple page with button and div. You click on button and div appears on page. Simple. When I did this on GWT, I can not find a way to compile this page in siple index.html with all JS code inside (or in one js file).
javascript
web-applications
gwt
singlepage
null
null
open
How to build GWT standalone application? === I need to design SPA with GWT technology, but I do not understand clearly how to make (compile) only one page with all JavaScript code in it. So, for example my task is to make simple page with button and div. You click on button and div appears on page. Simple. When I did this on GWT, I can not find a way to compile this page in siple index.html with all JS code inside (or in one js file).
0
5,104,373
02/24/2011 12:03:14
581,805
01/19/2011 17:00:44
15
0
Ajax call on Multiple selection in Select box.
How to Make Jquery Ajax call on selecting Multiple values in select box. Regards, Raj
jquery
null
null
null
null
null
open
Ajax call on Multiple selection in Select box. === How to Make Jquery Ajax call on selecting Multiple values in select box. Regards, Raj
0
8,733,030
01/04/2012 19:47:54
1,060,293
11/22/2011 17:14:20
38
1
coin flip generator
what do you guys think will be the outcome if a program is coded to simulate a coin flip where there is a 50% of the coin landing either heads or tails when the results are looked at; Mainly will there be a higher % of the coin flips landing heads when the previous 10 flips were tails and vice versa?
simulation
probability
coin-flipping
null
null
01/04/2012 20:21:07
not a real question
coin flip generator === what do you guys think will be the outcome if a program is coded to simulate a coin flip where there is a 50% of the coin landing either heads or tails when the results are looked at; Mainly will there be a higher % of the coin flips landing heads when the previous 10 flips were tails and vice versa?
1
10,766,403
05/26/2012 12:54:37
184,108
10/05/2009 01:42:30
227
2
How can I get my Javascript code to prefer cookies, but use local storage if cookies aren't present?
I some Javascript code used on the web and also in an Android app using Phonegap. At first, my code was set up to default to using local storage, and if there is no local storage, then default to cookies. However, in a few contexts (too complicated to go into here), that is not working, so I want to see if I can go the other way: default to using cookies, and if cookies aren't possible, use local storage. Really, it's only Android that is having trouble with cookies, so basically if my code is being used on an Android device, then I want to switch to local storage. In any case, here is the code for setting cookie/local storage data that I have, but it's not working: function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays === null) ? "" : ";expires=" + exdate.toUTCString()); if(document.cookie.length < 1 && typeof localStorage != "undefined") { localStorage.setItem(c_name, value); } } I think the problem might be where it says `document.cookie.length < 1`. Is that a reliable way of seeing if cookies are being set? Part of the problem is I don't know why Android is rejecting my cookies, so I don't know what kind of response it's giving me (and debugging on the phone is not possible). Bottom line: How can I reliably default to setting cookies, and use local storage as an alternative if cookies aren't present?
javascript
cookies
local-storage
null
null
null
open
How can I get my Javascript code to prefer cookies, but use local storage if cookies aren't present? === I some Javascript code used on the web and also in an Android app using Phonegap. At first, my code was set up to default to using local storage, and if there is no local storage, then default to cookies. However, in a few contexts (too complicated to go into here), that is not working, so I want to see if I can go the other way: default to using cookies, and if cookies aren't possible, use local storage. Really, it's only Android that is having trouble with cookies, so basically if my code is being used on an Android device, then I want to switch to local storage. In any case, here is the code for setting cookie/local storage data that I have, but it's not working: function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays === null) ? "" : ";expires=" + exdate.toUTCString()); if(document.cookie.length < 1 && typeof localStorage != "undefined") { localStorage.setItem(c_name, value); } } I think the problem might be where it says `document.cookie.length < 1`. Is that a reliable way of seeing if cookies are being set? Part of the problem is I don't know why Android is rejecting my cookies, so I don't know what kind of response it's giving me (and debugging on the phone is not possible). Bottom line: How can I reliably default to setting cookies, and use local storage as an alternative if cookies aren't present?
0
2,020,775
01/07/2010 13:58:46
189,815
10/14/2009 12:30:50
33
0
Query and paginate three types of models at the same time in django
In django I have three models: - SimpleProduct - ConfigurableProduct Instead of showing several variations of SimpleProducts, the user will see one product with options like color. - GroupProduct - Several SimpleProducts that are sold together. First I'm creating all the SimpleProducts, then I create ConfigurableProducts from several products that are variations on the same product and last GroupProducts which are combiniations of several SimpleProducts. When a user navigate to a category I need to show him all the three types. If a SimpleProduct is part of a ConfigurableProduct I don't want to show it twice. How do I make the query? Do I have to create three several queries? How do I use pagination on three models at the same time? Can I somehow use inheritance? Thanks
django
pagination
queryset
null
null
null
open
Query and paginate three types of models at the same time in django === In django I have three models: - SimpleProduct - ConfigurableProduct Instead of showing several variations of SimpleProducts, the user will see one product with options like color. - GroupProduct - Several SimpleProducts that are sold together. First I'm creating all the SimpleProducts, then I create ConfigurableProducts from several products that are variations on the same product and last GroupProducts which are combiniations of several SimpleProducts. When a user navigate to a category I need to show him all the three types. If a SimpleProduct is part of a ConfigurableProduct I don't want to show it twice. How do I make the query? Do I have to create three several queries? How do I use pagination on three models at the same time? Can I somehow use inheritance? Thanks
0
6,641,553
07/10/2011 14:10:43
128,036
06/24/2009 07:19:10
107
12
how to create website in indian langauge - Kannada
I wanted to build a website which would have two versions. **English, Indian Langauge (Kannada)**. The website should have same design, creatives , structure and data across the whole site. This site is **content heavy** and needs a **cms** and a relevant **language editor**. I am a php coder and I am okay with any of the free cms present - wordpress, drupal , joomla. I have heard of installing fonts onto my shared server to support Kannada language. These fonts I guess should support all platforms (windows,mac,linux and mobile website.) Can anyone please help me on this. Are there any free widgets, plugins which could be installed on my shared server and help display my webiste in intended languages.
php
content-management-system
multilanguage
null
null
null
open
how to create website in indian langauge - Kannada === I wanted to build a website which would have two versions. **English, Indian Langauge (Kannada)**. The website should have same design, creatives , structure and data across the whole site. This site is **content heavy** and needs a **cms** and a relevant **language editor**. I am a php coder and I am okay with any of the free cms present - wordpress, drupal , joomla. I have heard of installing fonts onto my shared server to support Kannada language. These fonts I guess should support all platforms (windows,mac,linux and mobile website.) Can anyone please help me on this. Are there any free widgets, plugins which could be installed on my shared server and help display my webiste in intended languages.
0
3,315,905
07/23/2010 06:50:34
225,312
12/05/2009 07:28:24
297
1
Recommended books on open source
I was wondering what is the best book on open source that is a must read? I was thinking of getting 'The Cathedral and the Bazaar' but I thought I had check once with you guys here. I am interested in general books about open source and how open source works.
open-source
null
null
null
null
09/25/2011 10:55:20
not constructive
Recommended books on open source === I was wondering what is the best book on open source that is a must read? I was thinking of getting 'The Cathedral and the Bazaar' but I thought I had check once with you guys here. I am interested in general books about open source and how open source works.
4
1,274,911
08/13/2009 22:14:49
38,226
11/17/2008 12:26:19
1,457
42
Connecting to Gmail through IMAP with PHP - SSL context failed
I'm trying to connect to Gmail through IMAP with PHP running in Apache. This is on an Ubuntu 9.04 system. I've got some sort of PHP configuration issue that is keeping this from working. First, here's what I did to setup IMAP for PHP: sudo apt-get install libc-client2007b libc-client2007b-dev sudo apt-get install php5-imap sudo /etc/init.d/apache2 start When I run phpinfo(), I get the following imap values: IMAP c-Client Version: 2004 SSL Support: enabled Kerberos Support: enabled Here's my sample code: <?php $connect_to = '{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX'; $user = 'my gmail address'; $password = 'my gmail password'; $connection = imap_open($connect_to, $user, $password) or die("Can't connect to '$connect_to': " . imap_last_error()); imap_close($connection); ?> When I execute this code, I get the following output: Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX in /var/www/clint/gmail/gmail.php on line 10 Can't connect to '{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX': TLS/SSL failure for imap.gmail.com: SSL context failed Note that I can telnet to imap.gmail.com:993 from this computer. I can also hookup Evolution (mail reader) to Gmail through IMAP and fetch mail without problems. So, I don't think this is a firewall issue. I'm pretty sure I've got something in PHP not setup correctly. Any ideas?
gmail
php
imap
ssl
ubuntu
null
open
Connecting to Gmail through IMAP with PHP - SSL context failed === I'm trying to connect to Gmail through IMAP with PHP running in Apache. This is on an Ubuntu 9.04 system. I've got some sort of PHP configuration issue that is keeping this from working. First, here's what I did to setup IMAP for PHP: sudo apt-get install libc-client2007b libc-client2007b-dev sudo apt-get install php5-imap sudo /etc/init.d/apache2 start When I run phpinfo(), I get the following imap values: IMAP c-Client Version: 2004 SSL Support: enabled Kerberos Support: enabled Here's my sample code: <?php $connect_to = '{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX'; $user = 'my gmail address'; $password = 'my gmail password'; $connection = imap_open($connect_to, $user, $password) or die("Can't connect to '$connect_to': " . imap_last_error()); imap_close($connection); ?> When I execute this code, I get the following output: Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX in /var/www/clint/gmail/gmail.php on line 10 Can't connect to '{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX': TLS/SSL failure for imap.gmail.com: SSL context failed Note that I can telnet to imap.gmail.com:993 from this computer. I can also hookup Evolution (mail reader) to Gmail through IMAP and fetch mail without problems. So, I don't think this is a firewall issue. I'm pretty sure I've got something in PHP not setup correctly. Any ideas?
0