question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
6,254,442
6,254,490
Can java.lang.StringBuffer be replaced by the "regular" string manipulation logic in ColdFusion?
I am not an expert in Java; I am hoping that someone on this list who are more proficient in Java can help me out. I have the following codes on my current server. I am trying to move these codes to another server. The problem is that this new server (shared hosting) does not allow invoking of a Java Object. So, I chan...
No, the "new" code is less efficient when used in a heavy loop. You can emulate StringBuffer with an array. However: If you are not concatenating hundreds or thousands of strings in a row, there is little benefit in using StringBuffer. You can go with & in most cases. I have done some testing (on a ColdFusion 7 server ...
Can java.lang.StringBuffer be replaced by the "regular" string manipulation logic in ColdFusion? I am not an expert in Java; I am hoping that someone on this list who are more proficient in Java can help me out. I have the following codes on my current server. I am trying to move these codes to another server. The prob...
TITLE: Can java.lang.StringBuffer be replaced by the "regular" string manipulation logic in ColdFusion? QUESTION: I am not an expert in Java; I am hoping that someone on this list who are more proficient in Java can help me out. I have the following codes on my current server. I am trying to move these codes to anothe...
[ "java", "coldfusion" ]
3
6
1,283
3
0
2011-06-06T15:36:23.730000
2011-06-06T15:40:41.043000
6,254,445
6,254,488
JQuery Multiple Fade Out
I have a quick question with some jQuery where I'm running into a problem. My client wants me to have an absolutely positioned/overflow hidden div that loads on the screen before the website loads. Essentially he wants to highlight an event with a flyer and then fade into the page. Well, I've got all that. Now he wants...
hehe. $("...").load(); is ajax request, you meant $("...").ready(function(){});, didn't you?
JQuery Multiple Fade Out I have a quick question with some jQuery where I'm running into a problem. My client wants me to have an absolutely positioned/overflow hidden div that loads on the screen before the website loads. Essentially he wants to highlight an event with a flyer and then fade into the page. Well, I've g...
TITLE: JQuery Multiple Fade Out QUESTION: I have a quick question with some jQuery where I'm running into a problem. My client wants me to have an absolutely positioned/overflow hidden div that loads on the screen before the website loads. Essentially he wants to highlight an event with a flyer and then fade into the ...
[ "jquery" ]
0
0
338
1
0
2011-06-06T15:36:41.290000
2011-06-06T15:40:11.093000
6,254,447
6,268,367
Using pHash from .NET
I am trying to use pHash from.NET First thing I tried was to register (regsvr32) phash.dll and asked here Second of all, i was trying to import using DllImport as shown below. [DllImport(@".\Com\pHash.dll")] public static extern int ph_dct_imagehash( [MarshalAs(UnmanagedType.LPStr)] string file, UInt64 hash); But when ...
The current Windows source code project (as of 7/2011) on phash.org does not seem to export the ph_ API calls from the DLL. You will need to add these yourself by __declspec(dllexport) at the beginning of the line in pHash.h like so: __declspec(dllexport) int ph_dct_imagehash(const char* file,ulong64 &hash); You should...
Using pHash from .NET I am trying to use pHash from.NET First thing I tried was to register (regsvr32) phash.dll and asked here Second of all, i was trying to import using DllImport as shown below. [DllImport(@".\Com\pHash.dll")] public static extern int ph_dct_imagehash( [MarshalAs(UnmanagedType.LPStr)] string file, U...
TITLE: Using pHash from .NET QUESTION: I am trying to use pHash from.NET First thing I tried was to register (regsvr32) phash.dll and asked here Second of all, i was trying to import using DllImport as shown below. [DllImport(@".\Com\pHash.dll")] public static extern int ph_dct_imagehash( [MarshalAs(UnmanagedType.LPSt...
[ "c#", ".net", "c++", "dllimport" ]
9
13
6,433
1
0
2011-06-06T15:36:43.163000
2011-06-07T16:17:00.880000
6,254,450
6,254,579
ViewModels and UI
from the design point of view, I have a complex GUI, what is the recommended granularity for cutting the GUI (Window) into ViewModels, UserControls and DataTemplates. Let's assume I have a window showing list of entities in DataGrid, then some filters in ComboBoxes, some detail... How many ViewModels should I create?.....
Although your question is not very clear, I'll try to answer it. The number of ViewModels is... just up to you. My personal approach is to separate my UI into many different custom UserControls, with one ViewModel per control. It allows me to have a crystal-clear architecture with a lot of smart controls designed for o...
ViewModels and UI from the design point of view, I have a complex GUI, what is the recommended granularity for cutting the GUI (Window) into ViewModels, UserControls and DataTemplates. Let's assume I have a window showing list of entities in DataGrid, then some filters in ComboBoxes, some detail... How many ViewModels ...
TITLE: ViewModels and UI QUESTION: from the design point of view, I have a complex GUI, what is the recommended granularity for cutting the GUI (Window) into ViewModels, UserControls and DataTemplates. Let's assume I have a window showing list of entities in DataGrid, then some filters in ComboBoxes, some detail... Ho...
[ "c#", ".net", "wpf", "mvvm" ]
0
3
311
2
0
2011-06-06T15:36:55.470000
2011-06-06T15:47:56.263000
6,254,457
6,254,540
Drop all logins where loginname like
I'm looking to bulk remove users from a database with a script for every login with a name that matches a certain pattern. What is the best way to do this with TSQL? DELETE syslogins WHERE.... does not work Trying to delete straight from syslogins will return "Ad hoc updates to system catalogs are not allowed"
How about this query to create your TSQL statements? Then copy this SQL into a new query and exec. select 'drop login [' + name + '];' from sys.server_principals WHERE name like 'foo%' This is basically the script that'll be created and run when you delete/drop a login from SSMS.
Drop all logins where loginname like I'm looking to bulk remove users from a database with a script for every login with a name that matches a certain pattern. What is the best way to do this with TSQL? DELETE syslogins WHERE.... does not work Trying to delete straight from syslogins will return "Ad hoc updates to syst...
TITLE: Drop all logins where loginname like QUESTION: I'm looking to bulk remove users from a database with a script for every login with a name that matches a certain pattern. What is the best way to do this with TSQL? DELETE syslogins WHERE.... does not work Trying to delete straight from syslogins will return "Ad h...
[ "t-sql", "sql-server-2008" ]
7
6
11,706
2
0
2011-06-06T15:37:17.907000
2011-06-06T15:44:52.223000
6,254,470
6,254,527
Multi language website
I have a multi language site, what is the way to proceed for good SEO for each language/ locale, right now i have: The site structure is: one domain, languages are switched within the file: php redraws the file according to the language selected by the user. So i thought i could switch the content of these meta's depen...
It depends on how the user selects their language. If it is a standard URL link robots shouldn't have a hard time crawling it. If you're using some type of javascript or flash menu they may have a hard time indexing this dynamic content. A bit of discussion on javascript and search engines can be found at: http://www.w...
Multi language website I have a multi language site, what is the way to proceed for good SEO for each language/ locale, right now i have: The site structure is: one domain, languages are switched within the file: php redraws the file according to the language selected by the user. So i thought i could switch the conten...
TITLE: Multi language website QUESTION: I have a multi language site, what is the way to proceed for good SEO for each language/ locale, right now i have: The site structure is: one domain, languages are switched within the file: php redraws the file according to the language selected by the user. So i thought i could...
[ "seo" ]
3
3
531
2
0
2011-06-06T15:38:29.207000
2011-06-06T15:43:46.770000
6,254,471
6,254,742
Initialize a var with LINQ and anonymous type
I have this: if (Folder == "Unprocessed") { var FolderEmails = from emails in EmailManagerDAL.Context.Emails join activities in EmailManagerDAL.Context.EmailActivities on emails.ID equals activities.EmailID where activities.EmailID!= null select new { emails.ID, emails.MessageFrom,emails.MessageSubject, emails.MessageD...
I don't think anonymous types are intended to be used like you're wanting (the compiler creates the anonymous type based on the assignment result). Why don't you just declare a Tuple type and use it. Edit: IEnumerable > FolderEmails = default( IEnumerable > ); if (folder == "Unprocessed") { FolderEmails = from emails ...
Initialize a var with LINQ and anonymous type I have this: if (Folder == "Unprocessed") { var FolderEmails = from emails in EmailManagerDAL.Context.Emails join activities in EmailManagerDAL.Context.EmailActivities on emails.ID equals activities.EmailID where activities.EmailID!= null select new { emails.ID, emails.Mess...
TITLE: Initialize a var with LINQ and anonymous type QUESTION: I have this: if (Folder == "Unprocessed") { var FolderEmails = from emails in EmailManagerDAL.Context.Emails join activities in EmailManagerDAL.Context.EmailActivities on emails.ID equals activities.EmailID where activities.EmailID!= null select new { emai...
[ "linq-to-entities", "initialization", "anonymous-types", "var" ]
1
1
5,535
3
0
2011-06-06T15:38:32.433000
2011-06-06T15:59:11.503000
6,254,474
6,256,706
Why war packaging creates maven problem "Could not calculate build plan: error in opening zip file"?
First of all, I am working with STS 2.6.1 R1 IDE maven 2.2.1 I created a new maven project (simple archetype) 4.0.0 org.dsample root 0.0.1 pom Added a maven module to that project with a war packaging and I get the Maven Problem in Markers tab: "Could not calculate build plan: error in opening zip file" Can anyone tell...
After closer inspection of the stack trace from the command prompt when running the mvn clean install -Dmaven.skip.test=true command I solved the issue: C:\pathToRootOfProject>mvn clean install -Dmaven.test.skip=true [INFO] Scanning for projects... [INFO] ----------------------------------------------------------------...
Why war packaging creates maven problem "Could not calculate build plan: error in opening zip file"? First of all, I am working with STS 2.6.1 R1 IDE maven 2.2.1 I created a new maven project (simple archetype) 4.0.0 org.dsample root 0.0.1 pom Added a maven module to that project with a war packaging and I get the Mave...
TITLE: Why war packaging creates maven problem "Could not calculate build plan: error in opening zip file"? QUESTION: First of all, I am working with STS 2.6.1 R1 IDE maven 2.2.1 I created a new maven project (simple archetype) 4.0.0 org.dsample root 0.0.1 pom Added a maven module to that project with a war packaging ...
[ "maven-2", "sts-springsourcetoolsuite" ]
2
0
2,314
1
0
2011-06-06T15:39:10.333000
2011-06-06T18:59:33.910000
6,254,483
6,254,598
JQuery Dialog Close Event
$("#termSheetPrinted").dialog({ autoOpen: false, resizable: true, height: $(window).height() - 50, width: $(window).width() - 50, position: 'center', title: 'Term Sheet', beforeClose: function(event, ui) { $("#termSheetPrinted").html(''); }, modal: true, buttons: { "Print": function () { $("#termSheetPrinted").jqprint(...
Seems to work if I bind it to close instead. Shouldn't this work both ways though?
JQuery Dialog Close Event $("#termSheetPrinted").dialog({ autoOpen: false, resizable: true, height: $(window).height() - 50, width: $(window).width() - 50, position: 'center', title: 'Term Sheet', beforeClose: function(event, ui) { $("#termSheetPrinted").html(''); }, modal: true, buttons: { "Print": function () { $("#t...
TITLE: JQuery Dialog Close Event QUESTION: $("#termSheetPrinted").dialog({ autoOpen: false, resizable: true, height: $(window).height() - 50, width: $(window).width() - 50, position: 'center', title: 'Term Sheet', beforeClose: function(event, ui) { $("#termSheetPrinted").html(''); }, modal: true, buttons: { "Print": f...
[ "jquery-dialog" ]
2
2
7,338
1
0
2011-06-06T15:40:04.827000
2011-06-06T15:49:23.670000
6,254,484
6,254,539
What should I be aware of when allowing users to upload images via a URL?
I'm working on a site where users can post notes. I'm considering allowing users to post images by providing a url to the image (ie not uploading it via a form). However, I've learned that this can be used to do some kind of hacking, for example, users can paste an url that is not an image, so when the page was load, a...
There are a lot of issues to be concerned with when allowing users to upload arbitrary files to a server (which this is). Firstly, you need to make sure the file is an image, and can only be accessed as an image (ie not executed as a script) Secondly, the image can't be too large or act as a DoS to users or the server ...
What should I be aware of when allowing users to upload images via a URL? I'm working on a site where users can post notes. I'm considering allowing users to post images by providing a url to the image (ie not uploading it via a form). However, I've learned that this can be used to do some kind of hacking, for example,...
TITLE: What should I be aware of when allowing users to upload images via a URL? QUESTION: I'm working on a site where users can post notes. I'm considering allowing users to post images by providing a url to the image (ie not uploading it via a form). However, I've learned that this can be used to do some kind of hac...
[ "javascript", "security", "get" ]
3
6
469
2
0
2011-06-06T15:40:06.453000
2011-06-06T15:44:42.430000
6,254,495
6,254,798
encrypting hidden variables in JSP
We've got user SSN's in jsp's that show in source code of an html page as: In order to avoid this, I made couple of methods called getEncryptedSSN() and getDecryptedSSN() which could be called from the JSP. These methods made use of the javax.crypto to encrypt/decrypt the ssn string, however, this import is "disallowed...
One obvious option is to just write your own encryptian function. You probably aren't going to write something as secure as the big-time security folks have come up with, but depending on the context, something simple might be adequate, i.e. something that would frustrate the casual snooper, and accept that if the CIA ...
encrypting hidden variables in JSP We've got user SSN's in jsp's that show in source code of an html page as: In order to avoid this, I made couple of methods called getEncryptedSSN() and getDecryptedSSN() which could be called from the JSP. These methods made use of the javax.crypto to encrypt/decrypt the ssn string, ...
TITLE: encrypting hidden variables in JSP QUESTION: We've got user SSN's in jsp's that show in source code of an html page as: In order to avoid this, I made couple of methods called getEncryptedSSN() and getDecryptedSSN() which could be called from the JSP. These methods made use of the javax.crypto to encrypt/decryp...
[ "java", "jsp", "encryption", "jakarta-ee" ]
1
2
2,777
3
0
2011-06-06T15:41:06.103000
2011-06-06T16:03:22.757000
6,254,497
6,254,575
array passed as parameter issue
I've got 2dim array set as global variable populated with numbers on row - 0 and strings on row-1. But when I passed it as a parameter to a function most of its values modifies into undefined but in one strangely value is kept!?! function formElements(howMany){ elArr = []; var w; var surface; for(var j=0; j Could someb...
The references to j make it look like this is inside a loop. In which case, I don't think this is doing what you want: elArry[0] = [j]; This sets the value of elArray[0] to an array with a single element, j. If you're doing that inside your loop then you're overwriting the arrays every time with a new one with a single...
array passed as parameter issue I've got 2dim array set as global variable populated with numbers on row - 0 and strings on row-1. But when I passed it as a parameter to a function most of its values modifies into undefined but in one strangely value is kept!?! function formElements(howMany){ elArr = []; var w; var sur...
TITLE: array passed as parameter issue QUESTION: I've got 2dim array set as global variable populated with numbers on row - 0 and strings on row-1. But when I passed it as a parameter to a function most of its values modifies into undefined but in one strangely value is kept!?! function formElements(howMany){ elArr = ...
[ "javascript" ]
1
4
104
1
0
2011-06-06T15:41:18.337000
2011-06-06T15:47:44.357000
6,254,511
6,254,547
Question about jquery slideDown
I have a div with hight 300px I want to use slideDown or any of jquery methods to slide down a part of the div not all the 300px may be just 50px
Try this DEMO $('#clickme').click(function() { $('#book').animate({ top: '+=50', height: '-=50' }, 1000, function() { // callback on complete. }); });
Question about jquery slideDown I have a div with hight 300px I want to use slideDown or any of jquery methods to slide down a part of the div not all the 300px may be just 50px
TITLE: Question about jquery slideDown QUESTION: I have a div with hight 300px I want to use slideDown or any of jquery methods to slide down a part of the div not all the 300px may be just 50px ANSWER: Try this DEMO $('#clickme').click(function() { $('#book').animate({ top: '+=50', height: '-=50' }, 1000, function()...
[ "javascript", "jquery", "jquery-animate", "slidedown" ]
4
3
171
2
0
2011-06-06T15:42:16.250000
2011-06-06T15:45:20.820000
6,254,516
6,255,330
How to use IIS app_offline.htm file with Azure
I have a brilliantly designed app_offline.htm file that I'd like to display on my site periodically when I'm doing things like backing up the DB. On a server with a real file system, this wouldn't be a problem: I'd just copy app_offline.htm to the my app's root, and IIS will work its magic and redirect all requests to ...
Actually there is a real file system, as each VM instance runs on Windows 2008 Server (SP2 or R2 SP1). To see this for yourself, enable Remote Desktop for your deployment and connect to a running instance. Knowing this, you should be able to set up a mechanism to perform a file-copy of your app_offline.htm to your app ...
How to use IIS app_offline.htm file with Azure I have a brilliantly designed app_offline.htm file that I'd like to display on my site periodically when I'm doing things like backing up the DB. On a server with a real file system, this wouldn't be a problem: I'd just copy app_offline.htm to the my app's root, and IIS wi...
TITLE: How to use IIS app_offline.htm file with Azure QUESTION: I have a brilliantly designed app_offline.htm file that I'd like to display on my site periodically when I'm doing things like backing up the DB. On a server with a real file system, this wouldn't be a problem: I'd just copy app_offline.htm to the my app'...
[ "azure", "filesystems", "app-offline.htm" ]
9
5
7,209
3
0
2011-06-06T15:42:59.443000
2011-06-06T16:49:12.477000
6,254,522
6,254,980
Database not updating model in MVC
So i just started using ASP.NET MVC and i'm really liking it, except i seem to have an odd knack to encounter the most bizarre of errors. I'm making a simple blogging application for myself. I have two simple models: post and comment. I have a partial view for creating a comment that is embedded in the details view for...
Perhaps saving the changes is working fine but you don't see the saved comments to a post because you don't load them when you display the post. You can eager load the comments of a post in your action which displays a post like so: post p = db.posts.Include(p1 => p1.comments).Where(p1 => p1.Id == id).SingleOrDefault()...
Database not updating model in MVC So i just started using ASP.NET MVC and i'm really liking it, except i seem to have an odd knack to encounter the most bizarre of errors. I'm making a simple blogging application for myself. I have two simple models: post and comment. I have a partial view for creating a comment that ...
TITLE: Database not updating model in MVC QUESTION: So i just started using ASP.NET MVC and i'm really liking it, except i seem to have an odd knack to encounter the most bizarre of errors. I'm making a simple blogging application for myself. I have two simple models: post and comment. I have a partial view for creati...
[ "asp.net", "asp.net-mvc", "entity-framework", "sql-server-ce" ]
0
3
2,048
2
0
2011-06-06T15:43:25.103000
2011-06-06T16:19:10.947000
6,254,530
6,254,627
Is this way of saving true/false options in JavaScript efficient?
In some places, you'll see options saved as numbers. For example, when setting file permissions, you pass them using a value ranging from 0 to 7 for each group of users. Each one of the bits in the binary representation of the number represents one of three permissions: read, write and execute, so a value of 7, with a ...
If you are wanting to accomplish something similar in JavaScript, I would recommend actually using bitwise operators, namely & and |. For example: var read = 1; var write = 2; var execute = 4; var rw = read | write; var someUserPermission = 3; // or, var someUserPermission = read & write; // can read? console.log((s...
Is this way of saving true/false options in JavaScript efficient? In some places, you'll see options saved as numbers. For example, when setting file permissions, you pass them using a value ranging from 0 to 7 for each group of users. Each one of the bits in the binary representation of the number represents one of th...
TITLE: Is this way of saving true/false options in JavaScript efficient? QUESTION: In some places, you'll see options saved as numbers. For example, when setting file permissions, you pass them using a value ranging from 0 to 7 for each group of users. Each one of the bits in the binary representation of the number re...
[ "javascript", "performance", "binary", "storage" ]
0
2
163
3
0
2011-06-06T15:44:07.857000
2011-06-06T15:51:38.410000
6,254,533
6,254,606
Finding all possible combinations of a three strings
Let's say I have a couple roots, prefixes, and suffixes. roots <- c("car insurance", "auto insurance") prefix <- c("cheap", "budget") suffix <- c("quote", "quotes") Is there a simple function or package in R which will allow me to construct all possible combinations of the three character vectors. So I want a list, dat...
expand.grid is your friend: expand.grid(prefix, roots, suffix) Var1 Var2 Var3 1 cheap car insurance quote 2 budget car insurance quote 3 cheap auto insurance quote 4 budget auto insurance quote 5 cheap car insurance quotes 6 budget car insurance quotes 7 cheap auto insurance quotes 8 budget auto insurance quotes Edite...
Finding all possible combinations of a three strings Let's say I have a couple roots, prefixes, and suffixes. roots <- c("car insurance", "auto insurance") prefix <- c("cheap", "budget") suffix <- c("quote", "quotes") Is there a simple function or package in R which will allow me to construct all possible combinations ...
TITLE: Finding all possible combinations of a three strings QUESTION: Let's say I have a couple roots, prefixes, and suffixes. roots <- c("car insurance", "auto insurance") prefix <- c("cheap", "budget") suffix <- c("quote", "quotes") Is there a simple function or package in R which will allow me to construct all poss...
[ "string", "r" ]
7
30
10,097
2
0
2011-06-06T15:44:36.113000
2011-06-06T15:49:55.693000
6,254,537
6,287,000
Is there a Directed Acyclic Graph (DAG) data type in Java, and should I use it?
I am modeling a power subsystem in Java. A simple SQLite database contains a set of Line Replaceable Units (LRUs) and the connections between them. I am writing a Power Model API to simplify queries of the data store, using DDD patterns and repositories. I am seeking an appropriate Java collection to model the query re...
For this particular problem. I've decided to use a LinkedListMultimap from Guava.
Is there a Directed Acyclic Graph (DAG) data type in Java, and should I use it? I am modeling a power subsystem in Java. A simple SQLite database contains a set of Line Replaceable Units (LRUs) and the connections between them. I am writing a Power Model API to simplify queries of the data store, using DDD patterns and...
TITLE: Is there a Directed Acyclic Graph (DAG) data type in Java, and should I use it? QUESTION: I am modeling a power subsystem in Java. A simple SQLite database contains a set of Line Replaceable Units (LRUs) and the connections between them. I am writing a Power Model API to simplify queries of the data store, usin...
[ "java", "collections", "tree", "set", "hashtable" ]
8
1
9,385
4
0
2011-06-06T15:44:39.060000
2011-06-09T00:58:13.020000
6,254,538
6,254,659
Store unevaluted function in list mathematica
Example: list:={ Plus[1,1], Times[2,3] } When looking at list, I get {2,6} I want to keep them unevaluated (as above) so that list returns { Plus[1,1], Times[2,3] } Later I want to evaluate the functions in list sequence to get {2,6} The number of unevaluated functions in list is not known beforehand. Besides Plus, use...
The best way is to store them in Hold, not List, like so: In[255]:= f[x_]:= x^2; lh = Hold[Plus[1, 1], Times[2, 3], f[2]] Out[256]= Hold[1 + 1, 2 3, f[2]] In this way, you have full control over them. At some point, you may call ReleaseHold to evaluate them: In[258]:= ReleaseHold@lh Out[258]= Sequence[2, 6, 4] If you...
Store unevaluted function in list mathematica Example: list:={ Plus[1,1], Times[2,3] } When looking at list, I get {2,6} I want to keep them unevaluated (as above) so that list returns { Plus[1,1], Times[2,3] } Later I want to evaluate the functions in list sequence to get {2,6} The number of unevaluated functions in l...
TITLE: Store unevaluted function in list mathematica QUESTION: Example: list:={ Plus[1,1], Times[2,3] } When looking at list, I get {2,6} I want to keep them unevaluated (as above) so that list returns { Plus[1,1], Times[2,3] } Later I want to evaluate the functions in list sequence to get {2,6} The number of unevalua...
[ "wolfram-mathematica" ]
10
10
1,171
4
0
2011-06-06T15:44:39.387000
2011-06-06T15:53:38.263000
6,254,551
6,273,993
Intercepting outgoing call - what am I missing?
I'm trying to write a simple app to capture the ACTION_NEW_OUTGOING_CALL intent and write some debugging information. Here is my manifest: And here is the code for DialerReceiver: package com.example.android.apis; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; ...
Answering my own question. After reviewing my manifest, it seemed like android:exported="false" was incorrect, since Android itself would need to invoke DialerReceiver. When I changed this to android:export="true", everything worked just fine. FWIW, I did this against the emulator (API version 8 and version 10 devices)...
Intercepting outgoing call - what am I missing? I'm trying to write a simple app to capture the ACTION_NEW_OUTGOING_CALL intent and write some debugging information. Here is my manifest: And here is the code for DialerReceiver: package com.example.android.apis; import android.content.BroadcastReceiver; import android....
TITLE: Intercepting outgoing call - what am I missing? QUESTION: I'm trying to write a simple app to capture the ACTION_NEW_OUTGOING_CALL intent and write some debugging information. Here is my manifest: And here is the code for DialerReceiver: package com.example.android.apis; import android.content.BroadcastReceive...
[ "android" ]
5
6
9,350
2
0
2011-06-06T15:45:53.037000
2011-06-08T03:48:09.377000
6,254,552
6,254,661
Inconsistent Javascript behaviour (IF statement nested in while loop)
I'm trying to write a simple Javascript(jQuery) function that randomly displays 6 Divs out of a possible 11. The code sort-of-works, it does randomly display around about half of the Divs, but it varaies between 4 and 8. Can anyone tell me where I'm going wrong? It seems it should be so simple yet I'm completely lost! ...
The problem as it stands now is that you have a bunch of unrelated attempts. If you have a bucket with 11 balls and have a 50% chance to remove each ball, you could end up with any number of balls between 0 and 11. Probability is skewed toward the center, but you don't get six and exactly six each time. What you want i...
Inconsistent Javascript behaviour (IF statement nested in while loop) I'm trying to write a simple Javascript(jQuery) function that randomly displays 6 Divs out of a possible 11. The code sort-of-works, it does randomly display around about half of the Divs, but it varaies between 4 and 8. Can anyone tell me where I'm ...
TITLE: Inconsistent Javascript behaviour (IF statement nested in while loop) QUESTION: I'm trying to write a simple Javascript(jQuery) function that randomly displays 6 Divs out of a possible 11. The code sort-of-works, it does randomly display around about half of the Divs, but it varaies between 4 and 8. Can anyone ...
[ "javascript", "jquery", "random", "while-loop" ]
1
6
321
3
0
2011-06-06T15:45:53.673000
2011-06-06T15:53:46.410000
6,254,555
6,254,783
Include new items into Objects (PHP)
As you see below, we have price and name properties for each Object row. I want to include one more property, category, into each row. So, tricky question here: how can I do it? stdClass Object ( [0] => stdClass Object ( [price] => 12.99 [name] => Million Dollar Baby (Two-Disc Widescreen) ) [1] => stdClass Object ( [p...
Is this what you are loooking for? price = 12.99; $p1->name = "Million Dollar Baby (Two-Disc Widescreen)"; $p2 = new stdClass(); $p2->price = 599.95; $p2->name = "Screets Kiddiebank Experience"; $p3 = new stdClass(); $p3->price = 1999.00; $p3->name = "Screets Kiddiebank Unlimited"; $products = array($p1, $p2, $p3); ...
Include new items into Objects (PHP) As you see below, we have price and name properties for each Object row. I want to include one more property, category, into each row. So, tricky question here: how can I do it? stdClass Object ( [0] => stdClass Object ( [price] => 12.99 [name] => Million Dollar Baby (Two-Disc Wides...
TITLE: Include new items into Objects (PHP) QUESTION: As you see below, we have price and name properties for each Object row. I want to include one more property, category, into each row. So, tricky question here: how can I do it? stdClass Object ( [0] => stdClass Object ( [price] => 12.99 [name] => Million Dollar Ba...
[ "php", "oop" ]
1
3
110
2
0
2011-06-06T15:46:05.837000
2011-06-06T16:02:21.197000
6,254,557
6,254,675
How to allow multiple users in local network to share a single MySQL database
How to allow multiple users in local network to share a single MySQL database? We even have option of share drive, if it will help. we are using C# windows application as front end The limitation is that we do not have acces to our main server. The server is with the other ofice department and we do not want to indulge...
Here is an excellent guide for unix based servers: http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html the same passages are needed for a windows system, you need to enable remote access and eventually grant permissions on a defined IP. Remote sharing of the database is disabled by...
How to allow multiple users in local network to share a single MySQL database How to allow multiple users in local network to share a single MySQL database? We even have option of share drive, if it will help. we are using C# windows application as front end The limitation is that we do not have acces to our main serve...
TITLE: How to allow multiple users in local network to share a single MySQL database QUESTION: How to allow multiple users in local network to share a single MySQL database? We even have option of share drive, if it will help. we are using C# windows application as front end The limitation is that we do not have acces...
[ "mysql" ]
0
1
9,832
3
0
2011-06-06T15:46:10.050000
2011-06-06T15:54:58.820000
6,254,574
6,254,778
Android API 11 introduced new components including ListView and GridView in app widgets, is there a way to scroll horizontally in app widgets now?
I've read in the Android 3.0 documentation that it is now possible to use "several new widget classes for more interactive app widgets on the users Home screen, including: GridView, ListView, StackView, ViewFlipper, and AdapterViewFlipper." Is this list exhaustive or can I use for example Gallery with an app widget in ...
No, you can't scroll horizontally in an AppWidget because that would break switching home screens.
Android API 11 introduced new components including ListView and GridView in app widgets, is there a way to scroll horizontally in app widgets now? I've read in the Android 3.0 documentation that it is now possible to use "several new widget classes for more interactive app widgets on the users Home screen, including: G...
TITLE: Android API 11 introduced new components including ListView and GridView in app widgets, is there a way to scroll horizontally in app widgets now? QUESTION: I've read in the Android 3.0 documentation that it is now possible to use "several new widget classes for more interactive app widgets on the users Home sc...
[ "android", "scroll", "widget", "android-3.0-honeycomb" ]
2
2
666
1
0
2011-06-06T15:47:39.327000
2011-06-06T16:02:01.800000
6,254,580
6,254,960
Issue in parsing Json response in ruby
@response = Typhoeus::Request.get(FOUR_SQUARE_API_SERVER_ADDRESS+'search?ll=' + current_user.altitude.to_s + "&query="+ params[:query] + FOUR_SQUARE_API_ACESS_CODE) @venues = ActiveSupport::JSON.decode(@response.body) @venues['response']['groups'][0]['items'].each do |venue| venue['name'] //working venue['name']['locat...
First of all, the venue['name'] is a scalar, not an array; secondly, venue['location'] (which I think you're trying to access) is not encoded as an array, that's just an object: location: { address: "...', city: "...", //... } So here you want: venue['location'] Then, your venue['name']['categories'][0]['id'] will fail...
Issue in parsing Json response in ruby @response = Typhoeus::Request.get(FOUR_SQUARE_API_SERVER_ADDRESS+'search?ll=' + current_user.altitude.to_s + "&query="+ params[:query] + FOUR_SQUARE_API_ACESS_CODE) @venues = ActiveSupport::JSON.decode(@response.body) @venues['response']['groups'][0]['items'].each do |venue| venue...
TITLE: Issue in parsing Json response in ruby QUESTION: @response = Typhoeus::Request.get(FOUR_SQUARE_API_SERVER_ADDRESS+'search?ll=' + current_user.altitude.to_s + "&query="+ params[:query] + FOUR_SQUARE_API_ACESS_CODE) @venues = ActiveSupport::JSON.decode(@response.body) @venues['response']['groups'][0]['items'].eac...
[ "ruby", "json", "parsing" ]
0
2
785
1
0
2011-06-06T15:47:59.243000
2011-06-06T16:18:04.943000
6,254,586
6,254,615
Testing for specific method in a Python class
What is the best (or 'Pythonic') way to test if a class has a specific method defined? Both of these work but don't feel 'correct' in that in the second one, I just try to access it and trap for an exception if it doesn't exist. Is there a better / more correct way? class TestClass(object): def TestFunc(self): pass if...
Use hasattr: class Foo(object): def bar(): pass assert hasattr(Foo, 'bar') If you really mean to test whether the attribute is a method, you could do this: assert hasattr(Foo, 'bar') and callable(getattr(Foo, 'bar'))
Testing for specific method in a Python class What is the best (or 'Pythonic') way to test if a class has a specific method defined? Both of these work but don't feel 'correct' in that in the second one, I just try to access it and trap for an exception if it doesn't exist. Is there a better / more correct way? class T...
TITLE: Testing for specific method in a Python class QUESTION: What is the best (or 'Pythonic') way to test if a class has a specific method defined? Both of these work but don't feel 'correct' in that in the second one, I just try to access it and trap for an exception if it doesn't exist. Is there a better / more co...
[ "python", "oop", "class", "methods" ]
2
10
187
2
0
2011-06-06T15:48:18.860000
2011-06-06T15:50:28.490000
6,254,587
6,289,642
Solr changes document's score when its random field value altered
I need to navigate forth and back in Solr results set ordered by score viewing documents one by one. To visualise that, first a list of document titles is presented to user, then he or she can click one of the title to see more details and then needs to have an opportunity to move to the next document in the original l...
I've found the solution which doesn't eliminate the problem completely but makes it much less likely to happen. So the problem happens when the documents are sorted by some field and there is a number of them with the same value in this field (e.g. result set is sorted by first name, and there are 100 entries for "John...
Solr changes document's score when its random field value altered I need to navigate forth and back in Solr results set ordered by score viewing documents one by one. To visualise that, first a list of document titles is presented to user, then he or she can click one of the title to see more details and then needs to ...
TITLE: Solr changes document's score when its random field value altered QUESTION: I need to navigate forth and back in Solr results set ordered by score viewing documents one by one. To visualise that, first a list of document titles is presented to user, then he or she can click one of the title to see more details ...
[ "solr", "relevance" ]
2
2
2,054
2
0
2011-06-06T15:48:20.550000
2011-06-09T07:47:11.160000
6,254,591
6,254,641
format a string separate with dots
Is there another alternative (smaller) for to format a string separate with dots? Like this: Unformatted: 9211fe01c98c8847c1a397a6c9c95986 Formatted 9211.fe01.c98c.8847.c1a3.97a6.c9c9.5986 I'm using the substr function, like this sample: $part1 = substr($codigo, 0, 4); $part2 = substr($codigo, 4, 4); $part3 = substr($c...
Use str_split and implode: $str = '9211fe01c98c8847c1a397a6c9c95986'; $result = implode('.', str_split($str, 4));
format a string separate with dots Is there another alternative (smaller) for to format a string separate with dots? Like this: Unformatted: 9211fe01c98c8847c1a397a6c9c95986 Formatted 9211.fe01.c98c.8847.c1a3.97a6.c9c9.5986 I'm using the substr function, like this sample: $part1 = substr($codigo, 0, 4); $part2 = substr...
TITLE: format a string separate with dots QUESTION: Is there another alternative (smaller) for to format a string separate with dots? Like this: Unformatted: 9211fe01c98c8847c1a397a6c9c95986 Formatted 9211.fe01.c98c.8847.c1a3.97a6.c9c9.5986 I'm using the substr function, like this sample: $part1 = substr($codigo, 0, 4...
[ "php" ]
1
5
168
3
0
2011-06-06T15:48:51.137000
2011-06-06T15:52:22.620000
6,254,599
6,254,800
A problem with higher order functions and lambdas in C++0x
I have a program where I must print many STL vectors on the screen after doing some calculation on each component. So I tried to create a function like this: template void printWith(vector foo, a func(a)){ for_each(foo.begin(), foo.end(), [func](a x){cout << func(x) << " "; }); } And then use it like this: int main(){ ...
The following works for me: #include #include #include using namespace std; template void printWith(vector foo, F f){ for_each(foo.begin(), foo.end(), [&](a x){cout << f(x) << " "; }); } int main(){ vector foo = {1,2,3,4,5}; printWith(foo, [](int x) {return x + 1;}); std::cout << '\n'; return 0; } Testing: $ g++-4.5 ...
A problem with higher order functions and lambdas in C++0x I have a program where I must print many STL vectors on the screen after doing some calculation on each component. So I tried to create a function like this: template void printWith(vector foo, a func(a)){ for_each(foo.begin(), foo.end(), [func](a x){cout << fu...
TITLE: A problem with higher order functions and lambdas in C++0x QUESTION: I have a program where I must print many STL vectors on the screen after doing some calculation on each component. So I tried to create a function like this: template void printWith(vector foo, a func(a)){ for_each(foo.begin(), foo.end(), [fun...
[ "c++", "c++11", "higher-order-functions", "lambda" ]
4
6
626
4
0
2011-06-06T15:49:23.947000
2011-06-06T16:03:27.860000
6,254,609
6,255,073
Why won't these 2 divs align horizontally?
I'm building a landing page and I've got a container and below that I have have a hero and it's below this that I'm trying to align 2 divs next to each other. I can't seem to get them to align and I've tried everything ( float:left and float:right ) and even margin but it doesn't work. Annoying thing is I need it to wo...
For centering, just add margin to #boxes. CSS: #container { width:960px; margin:0 auto } #boxes { width:100%; margin:0 30px } #leftbox, #rightbox { width:450px; height:359px; float:left } #leftbox { background-image:url(images/left-box.jpg) } #rightbox { background-image:url(images/right-box.jpg) } HTML:
Why won't these 2 divs align horizontally? I'm building a landing page and I've got a container and below that I have have a hero and it's below this that I'm trying to align 2 divs next to each other. I can't seem to get them to align and I've tried everything ( float:left and float:right ) and even margin but it does...
TITLE: Why won't these 2 divs align horizontally? QUESTION: I'm building a landing page and I've got a container and below that I have have a hero and it's below this that I'm trying to align 2 divs next to each other. I can't seem to get them to align and I've tried everything ( float:left and float:right ) and even ...
[ "css", "html" ]
0
3
3,204
2
0
2011-06-06T15:50:03.790000
2011-06-06T16:27:04.707000
6,254,610
6,254,670
Try Catch Not Working on BadImageFormatException
I have a MVC app that is loading a external DLL and when in production I get no error at all. Firefox just says the connection was reset. So I put some try/catch in the code but they still do not work, I still get the connection reset message. I know the error is a BadImageFormatException but why don't I see anything i...
There seem to be some exceptions which are marked as unrecoverable and so cannot be caught. This question (well this answer really) has a list of them, but I don't know how exhaustive this is. This article has some more information about uncatchable exceptions, and how they can be caught if you throw them but not if th...
Try Catch Not Working on BadImageFormatException I have a MVC app that is loading a external DLL and when in production I get no error at all. Firefox just says the connection was reset. So I put some try/catch in the code but they still do not work, I still get the connection reset message. I know the error is a BadIm...
TITLE: Try Catch Not Working on BadImageFormatException QUESTION: I have a MVC app that is loading a external DLL and when in production I get no error at all. Firefox just says the connection was reset. So I put some try/catch in the code but they still do not work, I still get the connection reset message. I know th...
[ "c#", ".net", "asp.net-mvc", "asp.net-mvc-3", "dllimport" ]
4
6
1,732
2
0
2011-06-06T15:50:05.677000
2011-06-06T15:54:14.400000
6,254,621
6,254,807
Different results using == and find in MATLAB
I have created a sparse matrix using MEX and also created a sparse matrix using MATLAB. To fill in the values of the matrix i have used same formula. Now to check if the both the matrices are equal I used result=(A==B). result returns 1 for all indices, which implies that all the matrix elements are equal. But if I do ...
I'm guessing you have values of infinity cropping up in your matrices at the same points. For example: >> A = Inf; >> B = Inf; >> A == B ans = 1 %# They are treated as equal... >> A-B ans = NaN %#...but their difference actually results in NaN... >> find(A-B) ans = 1 %#...which is treated as a non-zero value. T...
Different results using == and find in MATLAB I have created a sparse matrix using MEX and also created a sparse matrix using MATLAB. To fill in the values of the matrix i have used same formula. Now to check if the both the matrices are equal I used result=(A==B). result returns 1 for all indices, which implies that a...
TITLE: Different results using == and find in MATLAB QUESTION: I have created a sparse matrix using MEX and also created a sparse matrix using MATLAB. To fill in the values of the matrix i have used same formula. Now to check if the both the matrices are equal I used result=(A==B). result returns 1 for all indices, wh...
[ "matlab" ]
3
6
273
1
0
2011-06-06T15:51:10.930000
2011-06-06T16:04:19.107000
6,254,622
6,255,039
modified executeIndex in IndexSucces?
i have public function executeIndex(sfWebRequest $request) { $this->plans = Doctrine_Core::getTable('Messages') ->createQuery('a') ->execute(); } I can add ->limit(5); and how can i this make in indexSuccess.php? for example i add: $message):?> echo $message->getId(); how to send data directly to executeNew?
if you define the property correctly in the action you can use it in the view: public function executeIndex() { $this->messages = // whatever way you fetch the data } in the view you can now use the $messages variable. Is this what you are trying to accomplish?
modified executeIndex in IndexSucces? i have public function executeIndex(sfWebRequest $request) { $this->plans = Doctrine_Core::getTable('Messages') ->createQuery('a') ->execute(); } I can add ->limit(5); and how can i this make in indexSuccess.php? for example i add: $message):?> echo $message->getId(); how to send d...
TITLE: modified executeIndex in IndexSucces? QUESTION: i have public function executeIndex(sfWebRequest $request) { $this->plans = Doctrine_Core::getTable('Messages') ->createQuery('a') ->execute(); } I can add ->limit(5); and how can i this make in indexSuccess.php? for example i add: $message):?> echo $message->getI...
[ "php", "oop", "symfony1", "symfony-1.4" ]
0
1
132
1
0
2011-06-06T15:51:19.560000
2011-06-06T16:23:44.370000
6,254,624
6,255,216
How can I deal with invalid IDs in before_filter?
Let's say my controller looks like this: class MyController < ApplicationController before_filter:find_user,:only => [:index,:create,:update,:destroy] def index @some_objects = @user.objects.all end... private def find_user @user = User.find(params[:user_id]) end end If the user_id param does not exist, @user will be...
If the user_id param does not exist, then find method throw ActiveRecord::RecordNotFound exception. This exception is caught in a before_filter and rendered error. Аll subsequent filters and the index action will not be called. class MyController < ApplicationController before_filter:find_user,:only => [:index,:create,...
How can I deal with invalid IDs in before_filter? Let's say my controller looks like this: class MyController < ApplicationController before_filter:find_user,:only => [:index,:create,:update,:destroy] def index @some_objects = @user.objects.all end... private def find_user @user = User.find(params[:user_id]) end end ...
TITLE: How can I deal with invalid IDs in before_filter? QUESTION: Let's say my controller looks like this: class MyController < ApplicationController before_filter:find_user,:only => [:index,:create,:update,:destroy] def index @some_objects = @user.objects.all end... private def find_user @user = User.find(params[:u...
[ "ruby-on-rails", "controllers" ]
3
2
1,256
4
0
2011-06-06T15:51:29.913000
2011-06-06T16:39:48.537000
6,254,630
6,261,321
Update XML field with no text in T-SQL
I've come across a problem in updating an SQL field in that what I've written works perfectly for xml nodes with a text present, however it trips up when the node is empty. TEST This code works fine; UPDATE filemetaDB SET filemeta.modify('replace value of (/filemeta/heading/text())[1] with "TEST"'); However this breaks...
This node (/filemeta/description/text())[1] does not exist in the XML so there is nothing to replace. You have to do an insert instead. If you have a scenario where you have a mix of empty nodes and nodes with a value you have to run two update statements. declare @filemetaDB table(filemeta xml) insert into @filemetaD...
Update XML field with no text in T-SQL I've come across a problem in updating an SQL field in that what I've written works perfectly for xml nodes with a text present, however it trips up when the node is empty. TEST This code works fine; UPDATE filemetaDB SET filemeta.modify('replace value of (/filemeta/heading/text()...
TITLE: Update XML field with no text in T-SQL QUESTION: I've come across a problem in updating an SQL field in that what I've written works perfectly for xml nodes with a text present, however it trips up when the node is empty. TEST This code works fine; UPDATE filemetaDB SET filemeta.modify('replace value of (/filem...
[ "t-sql", "sql-server-2008", "xquery-sql" ]
6
11
6,333
4
0
2011-06-06T15:51:46.097000
2011-06-07T06:24:15.960000
6,254,637
6,255,263
Windows: Resize shared memory
When I create a shared memory segment on Windows (like CreateFileMapping(INVALID_HANDLE_VALUE,...) ), is there any way to resize it, other than creating a bigger segment and copying the data? I've read in MSDN that file mappings have a fixed size, but is there possibly some way to make a new mapping over the same memor...
The short answer is no - you cannot resize a file mapping once it has been created. The create/copy sequence you describe is the only way I'm aware of to accomplish this with file mappings backed by the system paging file. That said, you can manage the file backing your mapping yourself and accomplish this. Start with ...
Windows: Resize shared memory When I create a shared memory segment on Windows (like CreateFileMapping(INVALID_HANDLE_VALUE,...) ), is there any way to resize it, other than creating a bigger segment and copying the data? I've read in MSDN that file mappings have a fixed size, but is there possibly some way to make a n...
TITLE: Windows: Resize shared memory QUESTION: When I create a shared memory segment on Windows (like CreateFileMapping(INVALID_HANDLE_VALUE,...) ), is there any way to resize it, other than creating a bigger segment and copying the data? I've read in MSDN that file mappings have a fixed size, but is there possibly so...
[ "windows", "shared-memory", "memory-mapped-files" ]
7
6
3,550
1
0
2011-06-06T15:52:13.300000
2011-06-06T16:43:37.997000
6,254,651
6,254,722
JavaScript run function keydown
I cant find an answer to this that I understand. I want with JavaScript (not jQuery) to make it so if the with the id boxFilm is visible and I click on "SPACE" (keycode 32), the function togglep(); runs. How do I do this? I've tried many things but haven't succeeded:(
function togglep(){ alert("Hi"); } document.body.onkeydown = function(event){ event = event || window.event; var keycode = event.charCode || event.keyCode; if(keycode === 32){ togglep(); } } try it here: http://jsfiddle.net/GuvRP/1/
JavaScript run function keydown I cant find an answer to this that I understand. I want with JavaScript (not jQuery) to make it so if the with the id boxFilm is visible and I click on "SPACE" (keycode 32), the function togglep(); runs. How do I do this? I've tried many things but haven't succeeded:(
TITLE: JavaScript run function keydown QUESTION: I cant find an answer to this that I understand. I want with JavaScript (not jQuery) to make it so if the with the id boxFilm is visible and I click on "SPACE" (keycode 32), the function togglep(); runs. How do I do this? I've tried many things but haven't succeeded:( ...
[ "javascript", "onkeydown" ]
2
10
12,245
1
0
2011-06-06T15:53:05.097000
2011-06-06T15:58:16.260000
6,254,652
6,254,780
Html.Select doesn't exist
I am trying to get an old application, that was written using a mvc preview version, to run with version mvc-2 and have run in the following problem. <%= Html.Select("categorie", ViewData.Model.Categories, "naam", "categorieId", null, 1, false, new { prompt = "== geen filter =="} )%> Now I get the message that Html.Sel...
Use Html.DropDownList, Html.DropDownListFor. See html helpers overview
Html.Select doesn't exist I am trying to get an old application, that was written using a mvc preview version, to run with version mvc-2 and have run in the following problem. <%= Html.Select("categorie", ViewData.Model.Categories, "naam", "categorieId", null, 1, false, new { prompt = "== geen filter =="} )%> Now I get...
TITLE: Html.Select doesn't exist QUESTION: I am trying to get an old application, that was written using a mvc preview version, to run with version mvc-2 and have run in the following problem. <%= Html.Select("categorie", ViewData.Model.Categories, "naam", "categorieId", null, 1, false, new { prompt = "== geen filter ...
[ "c#", ".net", "asp.net", "asp.net-mvc-2", ".net-3.5" ]
0
1
85
1
0
2011-06-06T15:53:05.143000
2011-06-06T16:02:10.050000
6,254,655
6,263,548
jQuery KeyFilter Plugin Problem
Using keyfilter plugin for jQuery, and all seems to be fine apart from one problem. I am using a regular expression to filter the element. $('#nameVal').keyfilter(/[0-9a-zA-Z]/); The odd thing is, this is not only allowing alpha-numeric characters but it is also allowing '(' to be entered. In fact, it doesn't matter wh...
I found the problem. The isSpecialKey function in the KeyFilter plugin returns true if the keycode is 40, which is the keycode for '('. This means that the test is never performed on the character. var isSpecialKey = function(e) { var k = e.keyCode; var c = e.charCode; return k == 9 || k == 13 || /*(k == 40 && (!$.brow...
jQuery KeyFilter Plugin Problem Using keyfilter plugin for jQuery, and all seems to be fine apart from one problem. I am using a regular expression to filter the element. $('#nameVal').keyfilter(/[0-9a-zA-Z]/); The odd thing is, this is not only allowing alpha-numeric characters but it is also allowing '(' to be entere...
TITLE: jQuery KeyFilter Plugin Problem QUESTION: Using keyfilter plugin for jQuery, and all seems to be fine apart from one problem. I am using a regular expression to filter the element. $('#nameVal').keyfilter(/[0-9a-zA-Z]/); The odd thing is, this is not only allowing alpha-numeric characters but it is also allowin...
[ "javascript", "jquery", "regex", "mask", "keyfilter" ]
1
1
1,111
1
0
2011-06-06T15:53:14.363000
2011-06-07T09:55:11.980000
6,254,666
6,254,905
maxlength for JSF TextArea
I am using I already have a javascript inplace where it will read the maxlength and only allow 50 characters (in our example) it works fine with textarea but not with h:inputTextarea. thanks
h:inputTextarea doesn't support the maxlength attribute: http://download.oracle.com/docs/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/h/inputTextarea.html The html textarea element doesn't have that property prior to html5 which is why it's not supported. You can of course validate the length with...
maxlength for JSF TextArea I am using I already have a javascript inplace where it will read the maxlength and only allow 50 characters (in our example) it works fine with textarea but not with h:inputTextarea. thanks
TITLE: maxlength for JSF TextArea QUESTION: I am using I already have a javascript inplace where it will read the maxlength and only allow 50 characters (in our example) it works fine with textarea but not with h:inputTextarea. thanks ANSWER: h:inputTextarea doesn't support the maxlength attribute: http://download.or...
[ "javascript", "html", "jsf" ]
0
3
3,759
1
0
2011-06-06T15:54:10.763000
2011-06-06T16:12:03.173000
6,254,669
6,254,719
Required fields one of two fields
I am writing in asp.net c#. I want a control similiar to RequiredFieldValidator except I want one of two fields to be required. I found an excellent example for two text fields but in my case one field is a check box and the other is an text box. If the check box is not checked the text box must be entered. Any thought...
Just use javascript or C# code to check this. I personally don't care for the RequiredFieldValidator types as they are limited and rather confusing. With C# server side code you could just check if (!chk.Checked && txtBox.Text.Length==0) For JavaScript something to this effect: if (!(document.getElementById('myCheckBox...
Required fields one of two fields I am writing in asp.net c#. I want a control similiar to RequiredFieldValidator except I want one of two fields to be required. I found an excellent example for two text fields but in my case one field is a check box and the other is an text box. If the check box is not checked the tex...
TITLE: Required fields one of two fields QUESTION: I am writing in asp.net c#. I want a control similiar to RequiredFieldValidator except I want one of two fields to be required. I found an excellent example for two text fields but in my case one field is a check box and the other is an text box. If the check box is n...
[ "c#", "javascript", "asp.net" ]
0
1
405
2
0
2011-06-06T15:54:13.913000
2011-06-06T15:58:07.127000
6,254,686
6,254,813
A debug register substitute?
I was reading some old articles about debugging, and one of them mentioned the debug registers. Reading some more about these registers and what they can do made me incredibly eager to have some fun with them. However when I tried looking for some more information about how to actually use them I read that they can onl...
Thats not true at all, you can set HW debug register from ring3, indirectly (ollydbg does this), for this you need to use SetThreadContext under windows ( example ). if you still want a substitute for HW registers, you can use INT3 for code break points and single step trapping for checking if a varibale has changed(hi...
A debug register substitute? I was reading some old articles about debugging, and one of them mentioned the debug registers. Reading some more about these registers and what they can do made me incredibly eager to have some fun with them. However when I tried looking for some more information about how to actually use ...
TITLE: A debug register substitute? QUESTION: I was reading some old articles about debugging, and one of them mentioned the debug registers. Reading some more about these registers and what they can do made me incredibly eager to have some fun with them. However when I tried looking for some more information about ho...
[ "windows", "debugging", "cpu-registers" ]
1
2
508
1
0
2011-06-06T15:55:40.140000
2011-06-06T16:04:48.913000
6,254,687
6,254,727
T-SQL - Using CASE with Parameters in WHERE clause
I'm running a report on a Sales table: SaleId INT | SalesUserID INT | SiteID INT | BrandId INT| SaleDate DATETIME I'm having a nightmare trying to do something like this with a set of Nullable parameters @SalesUserID, @SiteId, @BrandID and two DateTime params. Additional Point: Only ONE of the filter parameters will ev...
I don't think you want a CASE statement at all, but a compound conditional... Give this a shot and let me know: select * from Sales where SaleDate between @StartDate and @EndDate and ( (@SalesUserId is not null and SalesUserId = @SalesUserID) or (@SiteId is not null and SiteId = @SiteId) or (BrandId = @BrandID) )
T-SQL - Using CASE with Parameters in WHERE clause I'm running a report on a Sales table: SaleId INT | SalesUserID INT | SiteID INT | BrandId INT| SaleDate DATETIME I'm having a nightmare trying to do something like this with a set of Nullable parameters @SalesUserID, @SiteId, @BrandID and two DateTime params. Addition...
TITLE: T-SQL - Using CASE with Parameters in WHERE clause QUESTION: I'm running a report on a Sales table: SaleId INT | SalesUserID INT | SiteID INT | BrandId INT| SaleDate DATETIME I'm having a nightmare trying to do something like this with a set of Nullable parameters @SalesUserID, @SiteId, @BrandID and two DateTim...
[ "sql", "sql-server", "sql-server-2008", "stored-procedures", "case" ]
4
9
39,690
7
0
2011-06-06T15:55:41.467000
2011-06-06T15:58:22.610000
6,254,689
6,255,143
What happens if limit of Sql Server Compact Edition is reached?
What happens if a database reaches the limit of 4GB of the SQL Server Compact Edition? Is there a special exception for this? Can I safely catch this event or exception and, let's say, create a new database?
I have not experienced this myself, but it looks like a SqlCeException will be thrown and the NativeError property of the contained SqlCeError will have an error code of 25104 (SSCE_M_DATABASETOOBIG). Here's a listing of SqlCeError Native Codes related to db engine errors -- the one about the db file being too big is a...
What happens if limit of Sql Server Compact Edition is reached? What happens if a database reaches the limit of 4GB of the SQL Server Compact Edition? Is there a special exception for this? Can I safely catch this event or exception and, let's say, create a new database?
TITLE: What happens if limit of Sql Server Compact Edition is reached? QUESTION: What happens if a database reaches the limit of 4GB of the SQL Server Compact Edition? Is there a special exception for this? Can I safely catch this event or exception and, let's say, create a new database? ANSWER: I have not experience...
[ "c#", "sql-server-ce" ]
12
8
847
1
0
2011-06-06T15:55:58.373000
2011-06-06T16:32:21.617000
6,254,691
6,254,758
How to change font color of a textView
I want to use the below method of textView to change the font color. What format can I use to specify the color? public void setTextColor (int color) Sets the text color for all the states (normal, selected, focused) to be this color. I've tried this: text.setTextColor(#FF0000) But it's not a valid syntax.
TextView.setTextColor(Color.BLUE); TextView.setTextColor(Color.RED); Or this: textView.setTextColor(Color.rgb(255,0,0)); // rgb( red, green, blue );
How to change font color of a textView I want to use the below method of textView to change the font color. What format can I use to specify the color? public void setTextColor (int color) Sets the text color for all the states (normal, selected, focused) to be this color. I've tried this: text.setTextColor(#FF0000) Bu...
TITLE: How to change font color of a textView QUESTION: I want to use the below method of textView to change the font color. What format can I use to specify the color? public void setTextColor (int color) Sets the text color for all the states (normal, selected, focused) to be this color. I've tried this: text.setTex...
[ "android", "fonts" ]
2
4
9,219
5
0
2011-06-06T15:56:13.400000
2011-06-06T16:00:41.603000
6,254,698
6,255,200
iPhone - creating the smoothest curve
I have this iPhone app that has an array containing around 50 to 100 points. How do I calculate the smoothest curve that will fit the points? It can be bezier, cubic, quadratic, whatever. It just have to look smooth and fit as much as possible all points (obviously, as I did in my drawing, to create a smooth curve, som...
Maybe you are looking for a Cubic Spline Cubic Spline These are the functions with continous second derivative that interpolate your nodes with the smallest curvature so they oscillate less. And there are lots of examples and algorithms to find these.
iPhone - creating the smoothest curve I have this iPhone app that has an array containing around 50 to 100 points. How do I calculate the smoothest curve that will fit the points? It can be bezier, cubic, quadratic, whatever. It just have to look smooth and fit as much as possible all points (obviously, as I did in my ...
TITLE: iPhone - creating the smoothest curve QUESTION: I have this iPhone app that has an array containing around 50 to 100 points. How do I calculate the smoothest curve that will fit the points? It can be bezier, cubic, quadratic, whatever. It just have to look smooth and fit as much as possible all points (obviousl...
[ "iphone", "objective-c", "cocoa-touch", "math" ]
0
0
718
1
0
2011-06-06T15:56:41.123000
2011-06-06T16:37:39.840000
6,254,703
6,254,753
Thread.Sleep for less than 1 millisecond
I want to call thread sleep with less than 1 millisecond. I read that neither thread.Sleep nor Windows-OS support that. What's the solution for that? For all those who wonder why I need this: I'm doing a stress test, and want to know how many messages my module can handle per second. So my code is: // Set the relative ...
You can't do this. A single sleep call will typically block for far longer than a millisecond (it's OS and system dependent, but in my experience, Thread.Sleep(1) tends to block for somewhere between 12-15ms). Windows, in general, is not designed as a real-time operating system. This type of control is typically imposs...
Thread.Sleep for less than 1 millisecond I want to call thread sleep with less than 1 millisecond. I read that neither thread.Sleep nor Windows-OS support that. What's the solution for that? For all those who wonder why I need this: I'm doing a stress test, and want to know how many messages my module can handle per se...
TITLE: Thread.Sleep for less than 1 millisecond QUESTION: I want to call thread sleep with less than 1 millisecond. I read that neither thread.Sleep nor Windows-OS support that. What's the solution for that? For all those who wonder why I need this: I'm doing a stress test, and want to know how many messages my module...
[ "c#", ".net", "multithreading" ]
41
53
62,614
6
0
2011-06-06T15:57:20.960000
2011-06-06T16:00:15.590000
6,254,704
6,254,736
keyboard shortcut for showing proposal table for solving errors using Eclipse
When a row contains an error, Eclipse display an error icon on the left. If you click on that icon a proposal table is showed and lists some possible solutions, if the jvm finds any. Is possible to activate the proposed problem solution list, using a shortcut from the keyboard?
Ctrl + 1 (or Ctrl + Shift + 1 on azerty keyboards) is the standard binding
keyboard shortcut for showing proposal table for solving errors using Eclipse When a row contains an error, Eclipse display an error icon on the left. If you click on that icon a proposal table is showed and lists some possible solutions, if the jvm finds any. Is possible to activate the proposed problem solution list,...
TITLE: keyboard shortcut for showing proposal table for solving errors using Eclipse QUESTION: When a row contains an error, Eclipse display an error icon on the left. If you click on that icon a proposal table is showed and lists some possible solutions, if the jvm finds any. Is possible to activate the proposed prob...
[ "java", "eclipse", "keyboard-shortcuts" ]
8
15
2,141
1
0
2011-06-06T15:57:22.010000
2011-06-06T15:58:52.317000
6,254,706
6,265,741
Java applet doesn't load if ASP.NET Forms Authentication is used
I have a Java applet that was working fine in a browser hosted in an ASP.NET application. I then added Forms Authentication to my application and have an access rule that denies Anonymous users to the directory the Java applet and page that hosts it live in. The applet no longer loads and when I look at the Java consol...
It seems that the Java applet isn't getting the permission it needs when put in a directory with access rules denying anonymous users. As a workaround I put the applet in the root directory and kept the aspx page in the limited access directory, then just updated the "applet" tag to point to the root directory to retri...
Java applet doesn't load if ASP.NET Forms Authentication is used I have a Java applet that was working fine in a browser hosted in an ASP.NET application. I then added Forms Authentication to my application and have an access rule that denies Anonymous users to the directory the Java applet and page that hosts it live ...
TITLE: Java applet doesn't load if ASP.NET Forms Authentication is used QUESTION: I have a Java applet that was working fine in a browser hosted in an ASP.NET application. I then added Forms Authentication to my application and have an access rule that denies Anonymous users to the directory the Java applet and page t...
[ "asp.net", "applet" ]
0
0
737
1
0
2011-06-06T15:57:24.813000
2011-06-07T13:15:10.850000
6,254,715
6,254,752
Threading emails by subject
We're parsing an email inbox signed up to a mailing list (Mailman) that does nothing except sit there and capture emails from other users on the mailing list. This is going to be PHP connecting to an email box, grabbing new emails and putting them into a MySQL database for use as a web archive that's searchable. I noti...
The proper way to thread them is not by subject, but rather by the Message-ID and References headers. The References header will contain a comma-delimited string of all the previously related Messgage-ID headers. By using these, the actual content of the subject line becomes less relevant since it can get modified and ...
Threading emails by subject We're parsing an email inbox signed up to a mailing list (Mailman) that does nothing except sit there and capture emails from other users on the mailing list. This is going to be PHP connecting to an email box, grabbing new emails and putting them into a MySQL database for use as a web archi...
TITLE: Threading emails by subject QUESTION: We're parsing an email inbox signed up to a mailing list (Mailman) that does nothing except sit there and capture emails from other users on the mailing list. This is going to be PHP connecting to an email box, grabbing new emails and putting them into a MySQL database for ...
[ "php", "email", "pear" ]
3
7
1,805
2
0
2011-06-06T15:57:36.743000
2011-06-06T16:00:09.367000
6,254,718
6,254,759
Update(GameTime gameTime) - how to do task some specific times per second?
I'm using C# and XNA. And there's this method in Game class Update(GameTime gameTime) I need to execute my function inside this method about 4 times per second. How can I acheive that? So far I could only know when new second starts by doing if (gameTime.TotalGameTime.Milliseconds == 0) But I need a way to run my funct...
You need to keep a separate counter, and the interval at which to call your function. For 4 times a second, this is float interval = 1/4;. Every frame, update the counter by the number of milliseconds that have passed since the last frame. Check if this counter is greater than interval; if so, at least interval seconds...
Update(GameTime gameTime) - how to do task some specific times per second? I'm using C# and XNA. And there's this method in Game class Update(GameTime gameTime) I need to execute my function inside this method about 4 times per second. How can I acheive that? So far I could only know when new second starts by doing if ...
TITLE: Update(GameTime gameTime) - how to do task some specific times per second? QUESTION: I'm using C# and XNA. And there's this method in Game class Update(GameTime gameTime) I need to execute my function inside this method about 4 times per second. How can I acheive that? So far I could only know when new second s...
[ "c#", "time", "xna" ]
0
2
1,034
2
0
2011-06-06T15:57:59.737000
2011-06-06T16:00:46.590000
6,254,728
6,264,178
Choosing a java web framework 2011
My question is based on the following question: Choosing a Java Web Framework now?..only one year later. The reason for my question is that plenty has happened in one year, play framework has matured etc., and I want to know whats the hot thing today. What are the advantages and disadvantages of todays frameworks.
focusing on Java frameworks, it depends on your aim (as everything in IT!) On products for big companies, you either go with Java EE or the standard Struts/Spring/Hibernate. They are proven stacks, the scalability needs in that environment are meet by those stacks and being stateful can be relevant in that environment....
Choosing a java web framework 2011 My question is based on the following question: Choosing a Java Web Framework now?..only one year later. The reason for my question is that plenty has happened in one year, play framework has matured etc., and I want to know whats the hot thing today. What are the advantages and disad...
TITLE: Choosing a java web framework 2011 QUESTION: My question is based on the following question: Choosing a Java Web Framework now?..only one year later. The reason for my question is that plenty has happened in one year, play framework has matured etc., and I want to know whats the hot thing today. What are the ad...
[ "java", "web-services", "web-applications", "web-frameworks" ]
7
3
5,367
2
0
2011-06-06T15:58:25.130000
2011-06-07T10:56:56.550000
6,254,730
6,254,810
JSON Data probably not formatted correctly
I have the following script which does not work 100%, it returns about 20 undefined and somewhere in between those undefined, it will return the full_name: function get_staff_details(phrase) { $.ajax({ url: 'get_staff_details.aspx?rand=' + Math.random(), type: 'POST', dataType: 'json', data: { strPhrase:phrase }, error...
As hvgotcodes said, what you have there is an array with a bunch of individual entries, each of which is an object with just one property (and each of which has a different property). You may have wanted this: [ { "image": "http://intranet/images/jb.jpg", "position": "Marketing Manager", "cms_initials": "JB", "departme...
JSON Data probably not formatted correctly I have the following script which does not work 100%, it returns about 20 undefined and somewhere in between those undefined, it will return the full_name: function get_staff_details(phrase) { $.ajax({ url: 'get_staff_details.aspx?rand=' + Math.random(), type: 'POST', dataType...
TITLE: JSON Data probably not formatted correctly QUESTION: I have the following script which does not work 100%, it returns about 20 undefined and somewhere in between those undefined, it will return the full_name: function get_staff_details(phrase) { $.ajax({ url: 'get_staff_details.aspx?rand=' + Math.random(), type...
[ "jquery", "json", "asp.net-3.5" ]
1
2
754
3
0
2011-06-06T15:58:31.557000
2011-06-06T16:04:27.167000
6,254,734
6,254,874
How complex is Drag/Drop implementation in java desktop apps
I'm working on software specifications at the moment and just want to get an idea if this would be an easy/hard thing to implement. What I'd like to do is to be able to move items(rows?) between two listbox(grid?) type controls on the same dialog; no external drag/drop support is needed. In.net apps drag/drop implement...
It is not bad at all. Have a look at the tutorial. To start with, see the code for Basic DnD demo, which basically covers what you are looking for. The only thing you have to figure out is exactly what data is packaged for the drag-drop. The right choice will depend on whether you plan to support data from outside your...
How complex is Drag/Drop implementation in java desktop apps I'm working on software specifications at the moment and just want to get an idea if this would be an easy/hard thing to implement. What I'd like to do is to be able to move items(rows?) between two listbox(grid?) type controls on the same dialog; no external...
TITLE: How complex is Drag/Drop implementation in java desktop apps QUESTION: I'm working on software specifications at the moment and just want to get an idea if this would be an easy/hard thing to implement. What I'd like to do is to be able to move items(rows?) between two listbox(grid?) type controls on the same d...
[ "java", "swing", "drag-and-drop" ]
1
3
381
1
0
2011-06-06T15:58:48.453000
2011-06-06T16:09:38.040000
6,254,749
6,254,954
android switch between two canvas
I have no idea why my app isnt liking the following and would be grateful for any help. I have a main activity that sets the following onCreate setContentView(new Splash(this)); Splash being a surfaceview with the following in its constructor this.setBackgroundDrawable(getResources().getDrawable(R.drawable.splash)); Th...
Activities are designed to be different "screens" in your application, and thus you should separate your splash screen's activity from your main game activity. Once an activity has drawn, I don't believe changing the contentView will trigger a redraw. I believe you are only supposed to call setContentView once- from th...
android switch between two canvas I have no idea why my app isnt liking the following and would be grateful for any help. I have a main activity that sets the following onCreate setContentView(new Splash(this)); Splash being a surfaceview with the following in its constructor this.setBackgroundDrawable(getResources().g...
TITLE: android switch between two canvas QUESTION: I have no idea why my app isnt liking the following and would be grateful for any help. I have a main activity that sets the following onCreate setContentView(new Splash(this)); Splash being a surfaceview with the following in its constructor this.setBackgroundDrawabl...
[ "android", "multithreading", "canvas", "splash-screen" ]
0
1
650
1
0
2011-06-06T15:59:38.853000
2011-06-06T16:17:10.947000
6,254,757
6,254,811
If Statement within Views in Rails 3
Ok so i have been starting to get used to rails 3 over the past few days and have got a project in the works to test things out on. Is it possible to do the following or what would you suggest is the best way to only allow post authors to edit their posts. <% if post.author_id == current_user.id %> <%= link_to 'Edit', ...
Recommendation: Don't compare id s - compare objects. <% if post.author == current_user %> Optional: Consider using a plugin (only if necessary) like cancan to make it even more descriptive. <% if can?:edit, post %>
If Statement within Views in Rails 3 Ok so i have been starting to get used to rails 3 over the past few days and have got a project in the works to test things out on. Is it possible to do the following or what would you suggest is the best way to only allow post authors to edit their posts. <% if post.author_id == cu...
TITLE: If Statement within Views in Rails 3 QUESTION: Ok so i have been starting to get used to rails 3 over the past few days and have got a project in the works to test things out on. Is it possible to do the following or what would you suggest is the best way to only allow post authors to edit their posts. <% if po...
[ "ruby-on-rails", "ruby-on-rails-3" ]
2
4
6,283
1
0
2011-06-06T16:00:28.243000
2011-06-06T16:04:33.233000
6,254,764
6,256,824
Phonegap - Source image larger on canvas than on html page
I'm using Phonegap to allow a user to select a photo from their library, and then edit it. When I retrieve the photo using Phonegap, I store the image in an html img element that is already on my page: sourceImage = document.getElementById('smallImage'); sourceImage.style.display = 'block'; sourceImage.src = "data:imag...
when you draw the image on canvas you can specify the destination coords on the canvas an the part of the image your like to draw like this: context.drawImage(image, source_x1, source_y1, source_x2, source_y2, dest_x1, dest_y1, dest_x2, dest_y2); So you can draw the image in any size you like...
Phonegap - Source image larger on canvas than on html page I'm using Phonegap to allow a user to select a photo from their library, and then edit it. When I retrieve the photo using Phonegap, I store the image in an html img element that is already on my page: sourceImage = document.getElementById('smallImage'); source...
TITLE: Phonegap - Source image larger on canvas than on html page QUESTION: I'm using Phonegap to allow a user to select a photo from their library, and then edit it. When I retrieve the photo using Phonegap, I store the image in an html img element that is already on my page: sourceImage = document.getElementById('sm...
[ "html", "canvas", "cordova", "image" ]
1
1
1,582
1
0
2011-06-06T16:00:58.807000
2011-06-06T19:09:49.423000
6,254,766
6,254,814
Generating HTML from server-side block in ASP.NET MVC
This is a very newbie kind of ASP.NET question: I simply don't know and can't work out the correct syntax to use. In my view I want to generate an action link if a certain condition is true on my model. I know how to generate a link using this syntax: <%: Html.ActionLink("Do Something", "DoSomething", new { id = Model....
This will do the trick <% if (Model.CanDoSomething) { %> <%: Html.ActionLink("Do Something", "DoSomething", new { id = Model.ID }) %> <% } %> <%: writes to the output buffer but encodes the string. You could also use <%= for unencoded output because ActionLink returns an encoded MvcHtmlString. EDIT: This may also work ...
Generating HTML from server-side block in ASP.NET MVC This is a very newbie kind of ASP.NET question: I simply don't know and can't work out the correct syntax to use. In my view I want to generate an action link if a certain condition is true on my model. I know how to generate a link using this syntax: <%: Html.Actio...
TITLE: Generating HTML from server-side block in ASP.NET MVC QUESTION: This is a very newbie kind of ASP.NET question: I simply don't know and can't work out the correct syntax to use. In my view I want to generate an action link if a certain condition is true on my model. I know how to generate a link using this synt...
[ "c#", "asp.net", "asp.net-mvc" ]
0
1
950
2
0
2011-06-06T16:01:03.383000
2011-06-06T16:04:49.623000
6,254,769
6,254,890
Execute JQuery after ASP.Net Microsoft AJAX
I'm trying to execute JQuery after an ASP.Net Microsoft AJAX post back. When a user clicks on a link, Microsoft AJAX is used to update some fields in the DB and if success a label appears informing the user the change has been made. Unfortunately the label is not very obvious and I would like to use to fade the backgro...
This is how you can execute a random javascript after an ASP.NET Ajax postback function executeThis(){ //code here to fade in out the label that comes var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.remove_pageLoaded(executeThis); //job done, remove this so that it is not fired again. } $("link").click(f...
Execute JQuery after ASP.Net Microsoft AJAX I'm trying to execute JQuery after an ASP.Net Microsoft AJAX post back. When a user clicks on a link, Microsoft AJAX is used to update some fields in the DB and if success a label appears informing the user the change has been made. Unfortunately the label is not very obvious...
TITLE: Execute JQuery after ASP.Net Microsoft AJAX QUESTION: I'm trying to execute JQuery after an ASP.Net Microsoft AJAX post back. When a user clicks on a link, Microsoft AJAX is used to update some fields in the DB and if success a label appears informing the user the change has been made. Unfortunately the label i...
[ "jquery", "asp.net", "asp.net-ajax", "microsoft-ajax" ]
1
2
1,797
4
0
2011-06-06T16:01:12.773000
2011-06-06T16:11:04.227000
6,254,779
6,254,845
PHP - catchall method in a class
Is there away to set up a class so that if a method is not defined, instead of throwing an error it would go to a catch-all function? such that if i call $myClass->foobar(); but foobar was never set in the class definition, some other method will handle it?
Yes, it's overloading: class Foo { public function __call($method, $args) { echo "$method is not defined"; } } $a = new Foo; $a->foo(); $b->bar(); As of PHP 5.3, you can also do it with static methods: class Foo { static public function __callStatic($method, $args) { echo "$method is not defined"; } } Foo::hello(); F...
PHP - catchall method in a class Is there away to set up a class so that if a method is not defined, instead of throwing an error it would go to a catch-all function? such that if i call $myClass->foobar(); but foobar was never set in the class definition, some other method will handle it?
TITLE: PHP - catchall method in a class QUESTION: Is there away to set up a class so that if a method is not defined, instead of throwing an error it would go to a catch-all function? such that if i call $myClass->foobar(); but foobar was never set in the class definition, some other method will handle it? ANSWER: Ye...
[ "php", "oop", "class", "methods", "catch-all" ]
14
20
4,295
4
0
2011-06-06T16:02:05.830000
2011-06-06T16:07:31.917000
6,254,782
6,283,228
RVM & Unicorn deploy
My RVM is installed as root. When I'm trying to start unicorn socket, it prints user@9001-3:~$ /etc/init.d/unicorn start Starting myapp app: /usr/bin/env: ruby: No such file or directory unicorn. But if I type user@9001-3:~$ ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux] /usr/local/rvm/gems/ruby-1.9....
/etc/init.d/unicorn doesn't know where to find Ruby because it's managed via RVM. Normally, your.bashrc or similar file is executed and sets up the environment; this doesn't happen in init scripts (or likely anything else executed by root). The solution is to use wrappers. For example, to create a binary called system_...
RVM & Unicorn deploy My RVM is installed as root. When I'm trying to start unicorn socket, it prints user@9001-3:~$ /etc/init.d/unicorn start Starting myapp app: /usr/bin/env: ruby: No such file or directory unicorn. But if I type user@9001-3:~$ ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux] /usr/loc...
TITLE: RVM & Unicorn deploy QUESTION: My RVM is installed as root. When I'm trying to start unicorn socket, it prints user@9001-3:~$ /etc/init.d/unicorn start Starting myapp app: /usr/bin/env: ruby: No such file or directory unicorn. But if I type user@9001-3:~$ ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_...
[ "ruby-on-rails-3", "rvm", "unicorn" ]
7
11
4,867
4
0
2011-06-06T16:02:17.137000
2011-06-08T18:06:58.040000
6,254,793
6,254,825
Center an <h1> tag inside a <div>
I have the following inside a tag: Yes And these are their CSS classes: #AlertDiv { position:absolute; height: 51px; left: 365px; top: 198px; width: 62px; background-color:black; color:white; } #AlertDiv h1{ margin:auto; vertical-align:middle; } How can I vertically and horizontally align an inside of a? AlertDiv will...
You can add line-height:51px to #AlertDiv h1 if you know it's only ever going to be one line. Also add text-align:center to #AlertDiv. #AlertDiv { top:198px; left:365px; width:62px; height:51px; color:white; position:absolute; text-align:center; background-color:black; } #AlertDiv h1 { margin:auto; line-height:51px; v...
Center an <h1> tag inside a <div> I have the following inside a tag: Yes And these are their CSS classes: #AlertDiv { position:absolute; height: 51px; left: 365px; top: 198px; width: 62px; background-color:black; color:white; } #AlertDiv h1{ margin:auto; vertical-align:middle; } How can I vertically and horizontally a...
TITLE: Center an <h1> tag inside a <div> QUESTION: I have the following inside a tag: Yes And these are their CSS classes: #AlertDiv { position:absolute; height: 51px; left: 365px; top: 198px; width: 62px; background-color:black; color:white; } #AlertDiv h1{ margin:auto; vertical-align:middle; } How can I vertically ...
[ "html", "css", "alignment", "vertical-alignment" ]
46
47
202,402
7
0
2011-06-06T16:03:10.683000
2011-06-06T16:05:57.527000
6,254,817
6,255,126
Create Left / Right Transition Effect
I am trying to create a slide transition effect like the one posted in the video http://www.youtube.com/watch?v=SZTiJmclaRc. When the button is clicked the current div#1 will be sliding out to the left and hide itself while another div#2 will be sliding from the right and move to the location of of the previous slided ...
Something like this? http://jsfiddle.net/k_rma/VmSX4/ HTML: Click Click JS/JQUERY: function toggleDivs() { var $inner = $("#inner"); // See which should be animated in/out. if ($inner.position().left == 0) { $inner.animate({ left: "-400px" }); } else { $inner.animate({ left: "0px" }); } } $("button").bind("click", fu...
Create Left / Right Transition Effect I am trying to create a slide transition effect like the one posted in the video http://www.youtube.com/watch?v=SZTiJmclaRc. When the button is clicked the current div#1 will be sliding out to the left and hide itself while another div#2 will be sliding from the right and move to t...
TITLE: Create Left / Right Transition Effect QUESTION: I am trying to create a slide transition effect like the one posted in the video http://www.youtube.com/watch?v=SZTiJmclaRc. When the button is clicked the current div#1 will be sliding out to the left and hide itself while another div#2 will be sliding from the r...
[ "jquery", "toggle", "slide", "slidetoggle" ]
1
8
11,239
1
0
2011-06-06T16:05:03.867000
2011-06-06T16:30:34.933000
6,254,822
6,254,903
Inconsistent UserAgent strings with IE9
I have a website running on a server in IIS6. The website is configured with two hostheader bindings on port 80: mywebsite1 <- requires an entry in local windows hosts file to fake a DNS entry mywebsite2.mydomain.com <- uses DNS So, in theory using a web browser to access either: http://mywebsite1/ http://mywebsite2.my...
IE9 reports Mozilla/4.0 when in Compatibility View, did you click the "torn page" icon when viewing your http://mywebsite1/? (The view can also be requested by the html thats served.)
Inconsistent UserAgent strings with IE9 I have a website running on a server in IIS6. The website is configured with two hostheader bindings on port 80: mywebsite1 <- requires an entry in local windows hosts file to fake a DNS entry mywebsite2.mydomain.com <- uses DNS So, in theory using a web browser to access either:...
TITLE: Inconsistent UserAgent strings with IE9 QUESTION: I have a website running on a server in IIS6. The website is configured with two hostheader bindings on port 80: mywebsite1 <- requires an entry in local windows hosts file to fake a DNS entry mywebsite2.mydomain.com <- uses DNS So, in theory using a web browser...
[ "internet-explorer", "iis-6", "cross-browser", "internet-explorer-9" ]
3
4
881
2
0
2011-06-06T16:05:30.880000
2011-06-06T16:12:00.870000
6,254,832
6,257,155
visual studio 2010 web service
can not find the new way of referencing / using the web service. there is the old way of adding WEB REFERENCE (.net 2.0) but I would like to use the new service reference. following tutorial: http://sarangasl.blogspot.com/2010/09/create-simple-web-service-in-visual.html or: http://www.youtube.com/watch?v=qOqEKpYbTzw I ...
The issue (found elsewhere) is that I had to move config to the project that initiated the call. Somehow strange (seems out of place now), but now it seems to work.
visual studio 2010 web service can not find the new way of referencing / using the web service. there is the old way of adding WEB REFERENCE (.net 2.0) but I would like to use the new service reference. following tutorial: http://sarangasl.blogspot.com/2010/09/create-simple-web-service-in-visual.html or: http://www.you...
TITLE: visual studio 2010 web service QUESTION: can not find the new way of referencing / using the web service. there is the old way of adding WEB REFERENCE (.net 2.0) but I would like to use the new service reference. following tutorial: http://sarangasl.blogspot.com/2010/09/create-simple-web-service-in-visual.html ...
[ "c#", "asp.net", "web-services" ]
0
0
8,536
6
0
2011-06-06T16:06:27.423000
2011-06-06T19:43:46.380000
6,254,836
6,254,880
Does this time format look familiar?
Can someone help me tell what datetime format is this, or what are it's parts? e.g. 201106020539Z0000031552001001 201106020702Z0000000000001 201105140701Z0000000000001 201105170207A0000018560001001 I think I've got the first few parts ( 201106020539 is yyyymmddhhmm ), but from the Z / A character onward, I have no clue...
The Z implies Zulu or UTC time https://meta.stackexchange.com/questions/14684/so-html-formats-time-incorrectly, as for what comes after, I don't know since all other time data has already been indicated prior to the Timezone Character. Also, the fact that your timestamps don't seem to end in the same number of characte...
Does this time format look familiar? Can someone help me tell what datetime format is this, or what are it's parts? e.g. 201106020539Z0000031552001001 201106020702Z0000000000001 201105140701Z0000000000001 201105170207A0000018560001001 I think I've got the first few parts ( 201106020539 is yyyymmddhhmm ), but from the Z...
TITLE: Does this time format look familiar? QUESTION: Can someone help me tell what datetime format is this, or what are it's parts? e.g. 201106020539Z0000031552001001 201106020702Z0000000000001 201105140701Z0000000000001 201105170207A0000018560001001 I think I've got the first few parts ( 201106020539 is yyyymmddhhmm...
[ "datetime", "format" ]
1
1
62
2
0
2011-06-06T16:06:48.243000
2011-06-06T16:10:09.747000
6,254,837
6,255,005
Share remote repository using git?
I am trying to get the hang of git. We have a main git repository that is our master website, we pull data from it but cannot push to it. We also have individual repositories for each developer. Now we want to create a repository that can pull from the main repository, but can be pushed to by a select few of developers...
You could just use a network share and do a git clone --bare This will clone your centralized repository into your shared location and set it up so it can receive pushes. You then only have to add it to your remotes on all development machines and you are set: git remote add development As long as both your developers ...
Share remote repository using git? I am trying to get the hang of git. We have a main git repository that is our master website, we pull data from it but cannot push to it. We also have individual repositories for each developer. Now we want to create a repository that can pull from the main repository, but can be push...
TITLE: Share remote repository using git? QUESTION: I am trying to get the hang of git. We have a main git repository that is our master website, we pull data from it but cannot push to it. We also have individual repositories for each developer. Now we want to create a repository that can pull from the main repositor...
[ "git", "repository" ]
2
2
5,696
6
0
2011-06-06T16:06:49.743000
2011-06-06T16:21:29.853000
6,254,844
6,254,898
pdo and mysqli in the same project
there is a problem, if in my project i use mysqli for the most part of the project and for a specific query to another db use the pdo? I'll probably have to do some queries to another databases, but i prefer using mysqli in terms of performance for the rest of the project. I don't know what is the SGBD in another datab...
It is possible to use multiple database access layers within the same application without issue. From a readability/maintainability standpoint, it's recommended to use just one. If you're not seeing good enough performance from PDO, it's okay to use mysqli_ for a performance sensitive part of your application as long a...
pdo and mysqli in the same project there is a problem, if in my project i use mysqli for the most part of the project and for a specific query to another db use the pdo? I'll probably have to do some queries to another databases, but i prefer using mysqli in terms of performance for the rest of the project. I don't kno...
TITLE: pdo and mysqli in the same project QUESTION: there is a problem, if in my project i use mysqli for the most part of the project and for a specific query to another db use the pdo? I'll probably have to do some queries to another databases, but i prefer using mysqli in terms of performance for the rest of the pr...
[ "php", "mysql", "database", "pdo", "mysqli" ]
2
6
1,398
1
0
2011-06-06T16:07:28.057000
2011-06-06T16:11:35.907000
6,254,849
6,255,025
android proxy application
I want to create an android application that acts like a proxy, all Internet communication (at least http) will be redirected to this app before reaching the network. I don't have any idea how to do it, so any help is welcome. thanks
It's not possible without rooting the phone, as this blog post aptly explains: http://android-proxy.blogspot.com/ Edit: It's actually a dedicated blog site!
android proxy application I want to create an android application that acts like a proxy, all Internet communication (at least http) will be redirected to this app before reaching the network. I don't have any idea how to do it, so any help is welcome. thanks
TITLE: android proxy application QUESTION: I want to create an android application that acts like a proxy, all Internet communication (at least http) will be redirected to this app before reaching the network. I don't have any idea how to do it, so any help is welcome. thanks ANSWER: It's not possible without rooting...
[ "java", "android", "redirect", "proxy" ]
3
2
3,162
2
0
2011-06-06T16:07:35.193000
2011-06-06T16:23:08.863000
6,254,850
6,255,205
Gauge animation on iphone
I'm trying to implement a gauge animation using (+ and - buttons) on iphone, but i have no idea where to start? Any help is really welcome. See the image below (this is what I'm trying to do). Thanks for your help.
Here is some open source code (with an example) that implements the gauge view. You of course would still need to do the buttons yourself, and possible add a different visual style. http://www.cocoacontrols.com/platforms/ios/controls/meterview
Gauge animation on iphone I'm trying to implement a gauge animation using (+ and - buttons) on iphone, but i have no idea where to start? Any help is really welcome. See the image below (this is what I'm trying to do). Thanks for your help.
TITLE: Gauge animation on iphone QUESTION: I'm trying to implement a gauge animation using (+ and - buttons) on iphone, but i have no idea where to start? Any help is really welcome. See the image below (this is what I'm trying to do). Thanks for your help. ANSWER: Here is some open source code (with an example) that...
[ "iphone", "animation", "uibutton", "gauge" ]
2
2
1,511
2
0
2011-06-06T16:07:36.703000
2011-06-06T16:38:00.143000
6,254,854
6,255,161
Help with a Given step that goes to a page and as a logged in user
My scenerio looks like: Given I am on the homepage As a member When I follow "new post".... In my web_steps.rb I added: When /^As a (.+)$/ do |type| @user = Factory(:user, type) end My factories are in: /spec/factories.rb /spec/factories/user.rb How do I reference my factories.rb into my web_steps.rb page? Am I doing t...
'As' is not valid in a cucumber scenario as far as I know. Your lines should start with 'Given', 'When', 'Then', or 'And'. Your scenario should probably look more like Given I am logged in as 'User' When I go to the homepage And I follow "New post" Then...
Help with a Given step that goes to a page and as a logged in user My scenerio looks like: Given I am on the homepage As a member When I follow "new post".... In my web_steps.rb I added: When /^As a (.+)$/ do |type| @user = Factory(:user, type) end My factories are in: /spec/factories.rb /spec/factories/user.rb How do ...
TITLE: Help with a Given step that goes to a page and as a logged in user QUESTION: My scenerio looks like: Given I am on the homepage As a member When I follow "new post".... In my web_steps.rb I added: When /^As a (.+)$/ do |type| @user = Factory(:user, type) end My factories are in: /spec/factories.rb /spec/factori...
[ "ruby-on-rails", "rspec", "cucumber" ]
0
3
108
2
0
2011-06-06T16:08:08.353000
2011-06-06T16:33:58.530000
6,254,865
6,255,299
Garbage collector won't collect an object created with using
I want to test for object references held improperly and wrote a test that always failed. I simplified the test to the following behaviour: [Test] public void ScopesAreNotLeaking() { WeakReference weakRef; Stub scope = null; using (scope = new Stub()) { weakRef = new WeakReference(scope); } scope = null; GC.Collect(); ...
I suspect there may be a local introduced by the using statement. Use ildasm to see if all the references in the function to the object are truly cleared before the call to GC.Collect. Also try to put the using bit in a separate function that returns the weak reference.
Garbage collector won't collect an object created with using I want to test for object references held improperly and wrote a test that always failed. I simplified the test to the following behaviour: [Test] public void ScopesAreNotLeaking() { WeakReference weakRef; Stub scope = null; using (scope = new Stub()) { weakR...
TITLE: Garbage collector won't collect an object created with using QUESTION: I want to test for object references held improperly and wrote a test that always failed. I simplified the test to the following behaviour: [Test] public void ScopesAreNotLeaking() { WeakReference weakRef; Stub scope = null; using (scope = n...
[ "c#", "garbage-collection" ]
6
2
825
4
0
2011-06-06T16:09:03.903000
2011-06-06T16:46:52.703000
6,254,871
6,254,950
Python: min(None, x)
I would like to perform the following: a=max(a,3) b=min(b,3) However sometimes a and b may be None. I was happy to discover that in the case of max it works out nicely, giving my required result 3, however if b is None, b remains None... Anyone can think of an elegant little trick to make min return the number in case ...
Why don't you just create a generator without None values? It's simplier and cleaner. >>> l=[None,3] >>> min(i for i in l if i is not None) 3
Python: min(None, x) I would like to perform the following: a=max(a,3) b=min(b,3) However sometimes a and b may be None. I was happy to discover that in the case of max it works out nicely, giving my required result 3, however if b is None, b remains None... Anyone can think of an elegant little trick to make min retur...
TITLE: Python: min(None, x) QUESTION: I would like to perform the following: a=max(a,3) b=min(b,3) However sometimes a and b may be None. I was happy to discover that in the case of max it works out nicely, giving my required result 3, however if b is None, b remains None... Anyone can think of an elegant little trick...
[ "python", "python-2.x" ]
49
53
34,055
11
0
2011-06-06T16:09:17.417000
2011-06-06T16:16:47.260000
6,254,881
6,255,030
How to profile sort algorithms?
I have coded a few sorting methods in C and I would like to find the input size at which the program is optimal (i.e.) profiling each algorithm. But how do I do this? I know to time each method, but I don't know how I can find the size at which it is 'optimal'.
Sort algorithms do not have a single number at which they are optimal. For pure execution time, almost every sort algorithm will be fastest on a set of 2 numbers, but that it not useful in most cases. Some sort algorithms may work more efficiently on smaller data sets, but that does not mean they are 'optimal' at that ...
How to profile sort algorithms? I have coded a few sorting methods in C and I would like to find the input size at which the program is optimal (i.e.) profiling each algorithm. But how do I do this? I know to time each method, but I don't know how I can find the size at which it is 'optimal'.
TITLE: How to profile sort algorithms? QUESTION: I have coded a few sorting methods in C and I would like to find the input size at which the program is optimal (i.e.) profiling each algorithm. But how do I do this? I know to time each method, but I don't know how I can find the size at which it is 'optimal'. ANSWER:...
[ "c", "algorithm", "profiling" ]
0
1
300
3
0
2011-06-06T16:10:11.013000
2011-06-06T16:23:31.647000
6,254,888
6,255,022
CSS Efficiency Questions
For the sake of this question, let "efficiency" mean, more-or-less, page rendering speed. Albeit, we should also take into account performance issues, like smooth scrolling. Let's say you're putting a striped background on a page. From an efficiency standpoint, is it better to tile an image 100px wide (showing ten stri...
Yes, this is all OS and browser centric. For instance, in Safari, it's more efficient to use CSS transformations to animate elements than JS. In general: you want to avoid tiling very small images. A 20px image will tile better than a 1px as the browser is doing a lot less work to repaint the entire screen. Likely not ...
CSS Efficiency Questions For the sake of this question, let "efficiency" mean, more-or-less, page rendering speed. Albeit, we should also take into account performance issues, like smooth scrolling. Let's say you're putting a striped background on a page. From an efficiency standpoint, is it better to tile an image 100...
TITLE: CSS Efficiency Questions QUESTION: For the sake of this question, let "efficiency" mean, more-or-less, page rendering speed. Albeit, we should also take into account performance issues, like smooth scrolling. Let's say you're putting a striped background on a page. From an efficiency standpoint, is it better to...
[ "css", "browser", "cross-browser", "performance", "webpage-rendering" ]
6
2
177
2
0
2011-06-06T16:10:58.310000
2011-06-06T16:22:58.413000
6,254,897
6,254,918
How to Combine Two SQL Queries
How can I combine the two sql queries into one: strQuery = "select * from UNITHD where driver1medical BETWEEN '1/1/1990' and GETDATE()+29 ORDER BY driver1medical" objMedicalDriver1.Open strQuery and strQuery = "select * from UNITHD where driver2medical BETWEEN '1/1/1990' and GETDATE()+29 ORDER BY driver1medical" objMed...
select * from UNITHD where ( driver1medical BETWEEN '1/1/1990' and GETDATE()+29 ) or ( driver2medical BETWEEN '1/1/1990' and GETDATE()+29 ) ORDER BY driver1medical
How to Combine Two SQL Queries How can I combine the two sql queries into one: strQuery = "select * from UNITHD where driver1medical BETWEEN '1/1/1990' and GETDATE()+29 ORDER BY driver1medical" objMedicalDriver1.Open strQuery and strQuery = "select * from UNITHD where driver2medical BETWEEN '1/1/1990' and GETDATE()+29 ...
TITLE: How to Combine Two SQL Queries QUESTION: How can I combine the two sql queries into one: strQuery = "select * from UNITHD where driver1medical BETWEEN '1/1/1990' and GETDATE()+29 ORDER BY driver1medical" objMedicalDriver1.Open strQuery and strQuery = "select * from UNITHD where driver2medical BETWEEN '1/1/1990'...
[ "sql", "sql-server-2008" ]
1
4
193
2
0
2011-06-06T16:11:31.463000
2011-06-06T16:13:26.950000
6,254,901
6,254,969
ASPx Dev Express File Upload Control to Mapped Network Drive
Here is my function, and as you can see I have the upload going into the web sites directory/files... I am hosting the site on IIS with another site & need the files to upload to the mapped network drive DOCSD9F1/TECHDOCS/ No idea what the folder path should be... any help would be greatly appreciated protected void AS...
Use backslashes instead of slashes for the network path. If it doesn't work, make sure the ASP.Net account has adequate permissions to write to the share.
ASPx Dev Express File Upload Control to Mapped Network Drive Here is my function, and as you can see I have the upload going into the web sites directory/files... I am hosting the site on IIS with another site & need the files to upload to the mapped network drive DOCSD9F1/TECHDOCS/ No idea what the folder path should ...
TITLE: ASPx Dev Express File Upload Control to Mapped Network Drive QUESTION: Here is my function, and as you can see I have the upload going into the web sites directory/files... I am hosting the site on IIS with another site & need the files to upload to the mapped network drive DOCSD9F1/TECHDOCS/ No idea what the f...
[ "c#", "asp.net", "file-upload", "devexpress" ]
0
1
2,097
1
0
2011-06-06T16:11:50.863000
2011-06-06T16:18:42.553000
6,254,904
6,261,748
Retrieving only the relevant part of a stored document
I'm a newbie with MongoDB, and am trying to store user activity performed on a site. My data is currently structured as: { "_id": ObjectId("4decfb0fc7c6ff7ff77d615e"), "activity": [ { "action": "added", "item_name": "iPhone", "item_id": 6140, }, { "action": "added", "item_name": "iPad", "item_id": 7220, } ], "name": "S...
You have to wait the following dev: https://jira.mongodb.org/browse/SERVER-828 You can use $slice only if you know insertion order and position of your element. Standard queries on MongoDb always return all document. (question also available here: MongoDB query to return only embedded document )
Retrieving only the relevant part of a stored document I'm a newbie with MongoDB, and am trying to store user activity performed on a site. My data is currently structured as: { "_id": ObjectId("4decfb0fc7c6ff7ff77d615e"), "activity": [ { "action": "added", "item_name": "iPhone", "item_id": 6140, }, { "action": "added"...
TITLE: Retrieving only the relevant part of a stored document QUESTION: I'm a newbie with MongoDB, and am trying to store user activity performed on a site. My data is currently structured as: { "_id": ObjectId("4decfb0fc7c6ff7ff77d615e"), "activity": [ { "action": "added", "item_name": "iPhone", "item_id": 6140, }, {...
[ "mongodb" ]
0
2
730
1
0
2011-06-06T16:12:01.770000
2011-06-07T07:12:10.970000
6,254,906
6,254,939
JQuery UI DatePicker with disabled field
Problem here is, the field is disabled (greyed out to the user), but you can still open the Date Picker and set the date, you just can't manually modify the date field yourself. How can we make the Date Picker unable to open when the field is disabled?
To disable datepicker on a field you need to use the destroy or disable properties DatePicker Options Example: someinput.disabled = true $('select that input').datePicker('disable'); // or $('select that input').datePicker('destroy');
JQuery UI DatePicker with disabled field Problem here is, the field is disabled (greyed out to the user), but you can still open the Date Picker and set the date, you just can't manually modify the date field yourself. How can we make the Date Picker unable to open when the field is disabled?
TITLE: JQuery UI DatePicker with disabled field QUESTION: Problem here is, the field is disabled (greyed out to the user), but you can still open the Date Picker and set the date, you just can't manually modify the date field yourself. How can we make the Date Picker unable to open when the field is disabled? ANSWER:...
[ "html", "jquery-ui", "jquery-ui-datepicker" ]
2
1
4,784
2
0
2011-06-06T16:12:10.053000
2011-06-06T16:15:26.573000
6,254,913
6,254,935
Using insert into ... select results in a incorrect syntax near select, why?
How can I make a SELECT inside an INSERT operation? insert into tableX (a_id, b_id) VALUES ((SELECT service_id FROM tableY WHERE id = 10, 2)); But the server returns a syntax error, why? SQL Error [156] [S0001]: Incorrect syntax near the keyword 'select'.
While my original answer gave a working solution, I was actually wrong about the cause of the error. There is nothing wrong with using a scalar subquery inside a VALUES clause. The problem with the statement in the question is simply that one parenthesis is in the wrong place; the scalar subquery must be enclosed in pa...
Using insert into ... select results in a incorrect syntax near select, why? How can I make a SELECT inside an INSERT operation? insert into tableX (a_id, b_id) VALUES ((SELECT service_id FROM tableY WHERE id = 10, 2)); But the server returns a syntax error, why? SQL Error [156] [S0001]: Incorrect syntax near the keywo...
TITLE: Using insert into ... select results in a incorrect syntax near select, why? QUESTION: How can I make a SELECT inside an INSERT operation? insert into tableX (a_id, b_id) VALUES ((SELECT service_id FROM tableY WHERE id = 10, 2)); But the server returns a syntax error, why? SQL Error [156] [S0001]: Incorrect syn...
[ "sql" ]
33
58
67,321
6
0
2011-06-06T16:12:46.470000
2011-06-06T16:15:04.037000
6,254,915
6,254,951
Abstract class accessing the implemented type through a templated virtual function?
I was wondering if there could be any way to write a template function in an abstract class, and have it (the template function) automatically instantiated with the type of the derived class? So you have a class that looks something like this class A { virtual template < typename T> void vtfunc(void) }; class B: public...
I’m not sure what you’re after but one common pattern is the so-called curiously recurring template pattern; here, the base class itself is the template, not its member functions. In other words: template class A { virtual void vtfunc(void) }; class B: public A { … };
Abstract class accessing the implemented type through a templated virtual function? I was wondering if there could be any way to write a template function in an abstract class, and have it (the template function) automatically instantiated with the type of the derived class? So you have a class that looks something lik...
TITLE: Abstract class accessing the implemented type through a templated virtual function? QUESTION: I was wondering if there could be any way to write a template function in an abstract class, and have it (the template function) automatically instantiated with the type of the derived class? So you have a class that l...
[ "c++", "templates", "polymorphism" ]
1
2
101
2
0
2011-06-06T16:13:10.467000
2011-06-06T16:16:48.647000
6,254,920
6,255,017
Is is possible to have a collection of generic collections?
I'm writing some code that needs to process an arbitrary number of lists of doubles. However, although I can declare function parameters of type List > I'm having trouble creating actual instances since I need to create instances of a concrete class such as ArrayList I've tried List > inputs = new ArrayList >(); inputs...
You can omit the cast since this one is perfectly valid. Each ArrayList is a List. List > inputs = new ArrayList >(); inputs.add(new ArrayList ());
Is is possible to have a collection of generic collections? I'm writing some code that needs to process an arbitrary number of lists of doubles. However, although I can declare function parameters of type List > I'm having trouble creating actual instances since I need to create instances of a concrete class such as Ar...
TITLE: Is is possible to have a collection of generic collections? QUESTION: I'm writing some code that needs to process an arbitrary number of lists of doubles. However, although I can declare function parameters of type List > I'm having trouble creating actual instances since I need to create instances of a concret...
[ "java" ]
4
7
183
3
0
2011-06-06T16:13:53.367000
2011-06-06T16:22:29.830000
6,254,938
6,254,970
Disable surround sound with openAL
I'm french so sorry for my english. I'm currently making a splitscreen 2D game with LWJGL. I'm using the openAL API which is given with LWJGL. Everything seems to works perfectly. Well, too perfectly to be honest: because I'm making a splitscreen game and because I can't have 2 listener sharing the same context, I want...
When you calculate the sound's position (soundPosition - closestPlayerPosition) take the length of the vector returned by that and then put that sound directly down the z axis that distance away from the player. Example: soundPosition = (1.4,0,1.4) closestPlayerPosition = (0,0,0) soundDirection = soundPosition - closes...
Disable surround sound with openAL I'm french so sorry for my english. I'm currently making a splitscreen 2D game with LWJGL. I'm using the openAL API which is given with LWJGL. Everything seems to works perfectly. Well, too perfectly to be honest: because I'm making a splitscreen game and because I can't have 2 listen...
TITLE: Disable surround sound with openAL QUESTION: I'm french so sorry for my english. I'm currently making a splitscreen 2D game with LWJGL. I'm using the openAL API which is given with LWJGL. Everything seems to works perfectly. Well, too perfectly to be honest: because I'm making a splitscreen game and because I c...
[ "audio", "openal", "lwjgl" ]
1
1
899
1
0
2011-06-06T16:15:22.867000
2011-06-06T16:18:50.353000
6,254,945
6,255,278
Reading ClientCredentials from SOAP Request body node and verifying it against a Custom Validator?
I have a method GetColors which takes a GetColorIdsRQ as a parameter and returns a GetColorIdsRS. GetColorIdsRQ is the SOAP Request and GetColorIdsRS is the SOAP Resposne. Here are the implementation details of each one: GetColorIdsRQ: [DataContract] public class GetColorIdsRQ { [DataMember(Name="UserCredentials",Order...
That is not possible unless you dive deeply into WCF security pipeline and implement custom security token (even then you can find that it is not possible) and all the stuff related to this implementation - it is a lot of work. Why don't you use standard UserName authentication? Edit: If you want to pass credentials in...
Reading ClientCredentials from SOAP Request body node and verifying it against a Custom Validator? I have a method GetColors which takes a GetColorIdsRQ as a parameter and returns a GetColorIdsRS. GetColorIdsRQ is the SOAP Request and GetColorIdsRS is the SOAP Resposne. Here are the implementation details of each one: ...
TITLE: Reading ClientCredentials from SOAP Request body node and verifying it against a Custom Validator? QUESTION: I have a method GetColors which takes a GetColorIdsRQ as a parameter and returns a GetColorIdsRS. GetColorIdsRQ is the SOAP Request and GetColorIdsRS is the SOAP Resposne. Here are the implementation det...
[ "c#", "wcf", "wcf-security", "wcf-authentication" ]
1
0
1,343
1
0
2011-06-06T16:16:16.033000
2011-06-06T16:44:40.047000
6,254,948
6,254,963
MVC2 Json result - include cookies?
Can you return cookies when returning an MVC2 Json result?
Yes - Not via the json result but you can simply add in your same controller method Response.Cookies.Add() and they will be added. Note: that in the an Async action you will need to set the response cookie in the completed method.
MVC2 Json result - include cookies? Can you return cookies when returning an MVC2 Json result?
TITLE: MVC2 Json result - include cookies? QUESTION: Can you return cookies when returning an MVC2 Json result? ANSWER: Yes - Not via the json result but you can simply add in your same controller method Response.Cookies.Add() and they will be added. Note: that in the an Async action you will need to set the response...
[ "asp.net-mvc", "json", "cookies" ]
2
2
1,735
2
0
2011-06-06T16:16:31.697000
2011-06-06T16:18:10.940000
6,254,957
6,255,255
How can I write data from a dictionary to a CSV file in Python
I have the following data in a dictionary: {'323503': [{'name': 'Derek', 'age': '21', 'race': 'white'}, {'name': 'Josh', 'age': '15', 'race': 'white'}, {'name': 'Adam', 'age': '32', 'weight': '180'}], '3802': [{'name': 'Abe', 'age': '12', 'weight': '132', 'race': 'black'}, {'name': 'Amy', 'age': '31', 'weight': '180'}]...
First, transform your structure in a list of dictionaries. Something like this (maybe in a more compact fashion): data = {'323503': [{'name': 'Derek', 'age': '21', 'race': 'white'}, {'name': 'Josh', 'age': '15', 'race': 'white'}, {'name': 'Adam', 'age': '32', 'weight': '180'}], '3802': [{'name': 'Abe', 'age': '12', 'we...
How can I write data from a dictionary to a CSV file in Python I have the following data in a dictionary: {'323503': [{'name': 'Derek', 'age': '21', 'race': 'white'}, {'name': 'Josh', 'age': '15', 'race': 'white'}, {'name': 'Adam', 'age': '32', 'weight': '180'}], '3802': [{'name': 'Abe', 'age': '12', 'weight': '132', '...
TITLE: How can I write data from a dictionary to a CSV file in Python QUESTION: I have the following data in a dictionary: {'323503': [{'name': 'Derek', 'age': '21', 'race': 'white'}, {'name': 'Josh', 'age': '15', 'race': 'white'}, {'name': 'Adam', 'age': '32', 'weight': '180'}], '3802': [{'name': 'Abe', 'age': '12', ...
[ "python", "csv", "dictionary" ]
2
3
1,559
1
0
2011-06-06T16:17:45.560000
2011-06-06T16:42:30.673000
6,254,959
6,255,164
How can I pass an int to my onDraw(Canvas canvas) in Android?
I use a surfaceview to draw a pie chart in Android. In order to know how big the pie slice should be I need to pass a parameter to the onDraw() method. How can I do this? Inside the onDraw() I make a query to a datahelper-class that fetches the right data. I tried to call a static function in one Activity from the onDr...
One of solutions can be like this: public class MySurfaceView extends SurfaceView { private MyParameter parameter; public void setParameter(MyParameter parameter) { this.parameter=parameter; } @Override public void onDraw(Canvas canvas) { if(this.parameter==null) return; //nothing to draw... //draw here... } } //som...
How can I pass an int to my onDraw(Canvas canvas) in Android? I use a surfaceview to draw a pie chart in Android. In order to know how big the pie slice should be I need to pass a parameter to the onDraw() method. How can I do this? Inside the onDraw() I make a query to a datahelper-class that fetches the right data. I...
TITLE: How can I pass an int to my onDraw(Canvas canvas) in Android? QUESTION: I use a surfaceview to draw a pie chart in Android. In order to know how big the pie slice should be I need to pass a parameter to the onDraw() method. How can I do this? Inside the onDraw() I make a query to a datahelper-class that fetches...
[ "android", "parameters", "ondraw" ]
1
4
3,613
1
0
2011-06-06T16:18:02.093000
2011-06-06T16:34:14.897000
6,254,962
6,255,404
Custom sorting function bottleneck
I am trying to sort big array using actionscript 3. The problem is that i have to use custom sorting function which is painfully slow and leads to flash plugin crash. Below is a sample code for custom function used to sort array by length of its members: private function sortByLength():int { var x:int = arguments[0].le...
try to use strong typing whenever possible, here tell your function that you are waiting two strings. you could rewrite your function in two way one fastest than the other if you know that all your element are not null: function sortByLength(a:String, b:String):int { return a.length-b.length // fastest way not comparis...
Custom sorting function bottleneck I am trying to sort big array using actionscript 3. The problem is that i have to use custom sorting function which is painfully slow and leads to flash plugin crash. Below is a sample code for custom function used to sort array by length of its members: private function sortByLength(...
TITLE: Custom sorting function bottleneck QUESTION: I am trying to sort big array using actionscript 3. The problem is that i have to use custom sorting function which is painfully slow and leads to flash plugin crash. Below is a sample code for custom function used to sort array by length of its members: private func...
[ "actionscript-3", "actionscript" ]
0
2
1,078
3
0
2011-06-06T16:18:10.083000
2011-06-06T16:55:29.783000
6,254,965
6,275,370
junit: impact of forkMode="once" on test correctness
I'd like to reduce the time which our build (using ant) takes for running the tests. Currently I am using the default forkMode, which forks a new vm on each test class ( perTest ). I am thinking about to switch to forkMode="once" but I am unsure if this will couple the tests somehow and maybe give me false positive and...
The test runner will effectively make a single Suite of all of your tests and run them - so that only one classloader is involved. Yes that means that static data will be shared between tests, which can occasionally be handy, but will force you to cut down on the static coupling between clauses, which is a good thing. ...
junit: impact of forkMode="once" on test correctness I'd like to reduce the time which our build (using ant) takes for running the tests. Currently I am using the default forkMode, which forks a new vm on each test class ( perTest ). I am thinking about to switch to forkMode="once" but I am unsure if this will couple t...
TITLE: junit: impact of forkMode="once" on test correctness QUESTION: I'd like to reduce the time which our build (using ant) takes for running the tests. Currently I am using the default forkMode, which forks a new vm on each test class ( perTest ). I am thinking about to switch to forkMode="once" but I am unsure if ...
[ "java", "unit-testing", "ant", "junit", "continuous-integration" ]
22
11
7,745
3
0
2011-06-06T16:18:19.183000
2011-06-08T07:16:08.563000
6,254,968
6,254,993
Help understand syntax of this statement in C#
I'm currently working on DevExpress Report, and I see this kind of syntax everywhere. I wonder what are they? What are they used for? I meant the one within the square bracket []. What do we call it in C#? [XRDesigner("Rapattoni.ControlLibrary.SFEAmenitiesCtrlTableDesigner," + "Rapattoni.ControlLibrary")] // what is th...
Those are called Attributes. Attributes can be used to add metadata to your code that can be accessed later via Reflection or, in the case of Aspect Oriented Programming, Attributes can actually modify the execution of code.
Help understand syntax of this statement in C# I'm currently working on DevExpress Report, and I see this kind of syntax everywhere. I wonder what are they? What are they used for? I meant the one within the square bracket []. What do we call it in C#? [XRDesigner("Rapattoni.ControlLibrary.SFEAmenitiesCtrlTableDesigner...
TITLE: Help understand syntax of this statement in C# QUESTION: I'm currently working on DevExpress Report, and I see this kind of syntax everywhere. I wonder what are they? What are they used for? I meant the one within the square bracket []. What do we call it in C#? [XRDesigner("Rapattoni.ControlLibrary.SFEAmenitie...
[ "c#" ]
1
7
110
6
0
2011-06-06T16:18:38.663000
2011-06-06T16:20:19.583000
6,254,971
6,255,082
Adobe Flex reference another object
I have a flex 3 datagrid that is in a completely separate container from the object that I am trying to reference it from - i.e. the datagrid is in a vbox, and I am trying to set a property in the datagrid from a popup. How do I access the datagrid from the popup? I'd like to do something like: myView.myDatagrid.resiza...
You'll have to explain your architecture better to get a specific answer. This answer may help as everything I said about running methods on another component, also applies to accessing properties. One solution for you is to pass the DataGrid instance into the popup as an instance variable; then the PopUp will be able ...
Adobe Flex reference another object I have a flex 3 datagrid that is in a completely separate container from the object that I am trying to reference it from - i.e. the datagrid is in a vbox, and I am trying to set a property in the datagrid from a popup. How do I access the datagrid from the popup? I'd like to do some...
TITLE: Adobe Flex reference another object QUESTION: I have a flex 3 datagrid that is in a completely separate container from the object that I am trying to reference it from - i.e. the datagrid is in a vbox, and I am trying to set a property in the datagrid from a popup. How do I access the datagrid from the popup? I...
[ "apache-flex", "datagrid", "adobe" ]
0
0
101
2
0
2011-06-06T16:18:52.650000
2011-06-06T16:27:40.103000
6,254,976
6,255,010
File browser in R
I need to write a small R script for people who never used R before that imports a file and does some things with it. I would like to minimize user input as much as possible, and since assigning the file-path is basically all the user input required I was wondering, is it possible to get a popup screen (basically your ...
The file.choose function performs this, eg: fname <- file.choose() source(file.choose()) You may also want to look at choose.files (for multiple files) and choose.dir (for just selecting a directory path).
File browser in R I need to write a small R script for people who never used R before that imports a file and does some things with it. I would like to minimize user input as much as possible, and since assigning the file-path is basically all the user input required I was wondering, is it possible to get a popup scree...
TITLE: File browser in R QUESTION: I need to write a small R script for people who never used R before that imports a file and does some things with it. I would like to minimize user input as much as possible, and since assigning the file-path is basically all the user input required I was wondering, is it possible to...
[ "file", "r" ]
24
41
26,620
3
0
2011-06-06T16:19:01.803000
2011-06-06T16:22:03.100000
6,254,982
6,255,052
php sessions and mobile applications
I'm developing application that would communicate with a mobile app. My problem is as follows - my mobile app doesn't accept any session data - no $_GET variables, no cookies - all communication in both sides is done with xml and I can't change it by, for example adding some parameters to xml, because mobile app would ...
You can use the session_id() function to fetch the PHP session ID and somehow include that in the XML you send to the device, and then at the other end you can extract the unique identifier, call session_id({unique_parameter}); to set the session ID and then call session_start(); and you should be all set.
php sessions and mobile applications I'm developing application that would communicate with a mobile app. My problem is as follows - my mobile app doesn't accept any session data - no $_GET variables, no cookies - all communication in both sides is done with xml and I can't change it by, for example adding some paramet...
TITLE: php sessions and mobile applications QUESTION: I'm developing application that would communicate with a mobile app. My problem is as follows - my mobile app doesn't accept any session data - no $_GET variables, no cookies - all communication in both sides is done with xml and I can't change it by, for example a...
[ "php", "session", "mobile" ]
0
2
2,970
1
0
2011-06-06T16:19:21.320000
2011-06-06T16:25:13.597000
6,254,983
6,257,802
VB.NET - Set windows to control/manage wireless over third-party clients
Within VB.NET, trying to find an easy way to in a sense check the check-box "Use Windows to configure my Wireless Network Settings". This is an option that forces windows to use your wireless over third-party programs that may try to steal control. I am aware this requires to have WZC enabled within services and that's...
I would use a registry-recorder to record the changes when manually changing the value, then its a piece of cake to implement the register change in code. There are plenty programs that can be used to see what changes has been done in the registry, here are one free: http://www.kephyr.com/systemsherlocklite/index.phtml...
VB.NET - Set windows to control/manage wireless over third-party clients Within VB.NET, trying to find an easy way to in a sense check the check-box "Use Windows to configure my Wireless Network Settings". This is an option that forces windows to use your wireless over third-party programs that may try to steal control...
TITLE: VB.NET - Set windows to control/manage wireless over third-party clients QUESTION: Within VB.NET, trying to find an easy way to in a sense check the check-box "Use Windows to configure my Wireless Network Settings". This is an option that forces windows to use your wireless over third-party programs that may tr...
[ "vb.net", "windows-services", "wireless" ]
1
0
389
1
0
2011-06-06T16:19:21.487000
2011-06-06T20:42:28.363000
6,254,987
6,255,044
What is the name of this Button?
What is the name of this round button in the bottom left corner of this image? I would like to use only that little circle button. How do I allocate it to my nib file?
It's the locate button, check this to use it. But I wont rely on Apple to approve your app, if you submit it.
What is the name of this Button? What is the name of this round button in the bottom left corner of this image? I would like to use only that little circle button. How do I allocate it to my nib file?
TITLE: What is the name of this Button? QUESTION: What is the name of this round button in the bottom left corner of this image? I would like to use only that little circle button. How do I allocate it to my nib file? ANSWER: It's the locate button, check this to use it. But I wont rely on Apple to approve your app, ...
[ "iphone", "objective-c", "button", "maps" ]
0
1
1,012
1
0
2011-06-06T16:19:59.293000
2011-06-06T16:24:36.767000
6,254,991
6,258,548
How to group this SQL outer join query
Currently I'm executing the following: SELECT SiteFeatures.SiteId, Blogs.FeatureInstance_Id as BlogId, PageCollections.FeatureInstance_Id as PagesId, Portfolios.FeatureInstance_Id as PortfolioId FROM SiteFeatures LEFT OUTER JOIN Blogs ON SiteFeatures.FeatureInstanceId = Blogs.FeatureInstance_id LEFT OUTER JOIN Portfoli...
SELECT S.SiteId, B.FeatureInstance_Id BlogId, P.FeatureInstance_Id PortfolioId, C.FeatureInstance_Id PagesId FROM Sites S LEFT JOIN ( SiteFeatures F1 INNER JOIN Blogs B ON F1.FeatureInstanceId = B.FeatureInstance_id ) ON S.SiteID = F1.SiteID LEFT JOIN ( SiteFeatures F2 INNER JOIN Portfolios P ON F2.FeatureInstanceId = ...
How to group this SQL outer join query Currently I'm executing the following: SELECT SiteFeatures.SiteId, Blogs.FeatureInstance_Id as BlogId, PageCollections.FeatureInstance_Id as PagesId, Portfolios.FeatureInstance_Id as PortfolioId FROM SiteFeatures LEFT OUTER JOIN Blogs ON SiteFeatures.FeatureInstanceId = Blogs.Feat...
TITLE: How to group this SQL outer join query QUESTION: Currently I'm executing the following: SELECT SiteFeatures.SiteId, Blogs.FeatureInstance_Id as BlogId, PageCollections.FeatureInstance_Id as PagesId, Portfolios.FeatureInstance_Id as PortfolioId FROM SiteFeatures LEFT OUTER JOIN Blogs ON SiteFeatures.FeatureInsta...
[ "sql", "sql-server", "sql-server-2008" ]
2
3
903
4
0
2011-06-06T16:20:16.807000
2011-06-06T22:02:57.813000
6,255,006
6,255,028
How do i match content between particular all <li> tags?
How do I match all the tags in the below HTML code: some content some other content some other other content. This expression doesn't work: (.*) Because it returns: some content some other content some other other content. Which is the content between the first and the last
Regular expressions are greedy by nature. Make it non-greedy by adding the?. (.*?) Note: I'd encourage a DOM Parser for such a thing. Check out PHP's DOMDocument.
How do i match content between particular all <li> tags? How do I match all the tags in the below HTML code: some content some other content some other other content. This expression doesn't work: (.*) Because it returns: some content some other content some other other content. Which is the content between the first a...
TITLE: How do i match content between particular all <li> tags? QUESTION: How do I match all the tags in the below HTML code: some content some other content some other other content. This expression doesn't work: (.*) Because it returns: some content some other content some other other content. Which is the content b...
[ "php", "regex" ]
3
8
7,228
7
0
2011-06-06T16:21:33.630000
2011-06-06T16:23:22.693000
6,255,018
6,263,719
Test if two first chars typed in are alphanumeric - no regex
I have following code that needs something smart to deal with typed in chars and detection: private final MultiWordSuggestOracle mySuggestions = new MultiWordSuggestOracle(); private final Set mySuggestionsData = new HashSet (); @UiHandler("suggestBox") public void onKeyPress(KeyDownEvent event) { if (Character.isLett...
Instead of handling events, you should make your own SuggestOracle (possible wrapping a MultiSuggestOracle used as an internal cache) and check the query 's length and "pattern" there to decide whether to call the server or not (and then give an empty list of suggestions as the response, or maybe a single suggestion be...
Test if two first chars typed in are alphanumeric - no regex I have following code that needs something smart to deal with typed in chars and detection: private final MultiWordSuggestOracle mySuggestions = new MultiWordSuggestOracle(); private final Set mySuggestionsData = new HashSet (); @UiHandler("suggestBox") publ...
TITLE: Test if two first chars typed in are alphanumeric - no regex QUESTION: I have following code that needs something smart to deal with typed in chars and detection: private final MultiWordSuggestOracle mySuggestions = new MultiWordSuggestOracle(); private final Set mySuggestionsData = new HashSet (); @UiHandler(...
[ "java", "gwt", "detect", "alphanumeric", "chars" ]
2
1
3,179
2
0
2011-06-06T16:22:35.317000
2011-06-07T10:10:52.947000
6,255,019
6,255,393
Coordinates of HTML elements
I am going to create a selection 'lasso' that the user can use to select portions of a table. I figured that positioning a div over the region is far easier than trying to manipulate the cell borders. If you don't understand what I mean, open up a spread sheet and drag over a region. I want the div to align perfectly w...
Use.offset() along with.height() and.width() if necessary. var td = $(someTDReference); var pos = td.offset(); pos.bottom = pos.top + td.height(); pos.right = pos.left + td.width(); // pos now contains top, left, bottom, and right in pixels Edit: Not.position(), use.offset(). Updated above. Edit: Changed pos.width() to...
Coordinates of HTML elements I am going to create a selection 'lasso' that the user can use to select portions of a table. I figured that positioning a div over the region is far easier than trying to manipulate the cell borders. If you don't understand what I mean, open up a spread sheet and drag over a region. I want...
TITLE: Coordinates of HTML elements QUESTION: I am going to create a selection 'lasso' that the user can use to select portions of a table. I figured that positioning a div over the region is far easier than trying to manipulate the cell borders. If you don't understand what I mean, open up a spread sheet and drag ove...
[ "javascript", "jquery", "html", "html-table", "coordinates" ]
5
7
8,243
4
0
2011-06-06T16:22:41.917000
2011-06-06T16:54:22.147000
6,255,042
6,255,135
Splitting an array
I have two javascript functions, the first one is working, teh second is working but not echoing the correct value in the hidden inputs. Ive manage to get the last hidden input value correct but I'm not sure how var customTicketsArr = Array(); function EditEventAddTicket(){ alertWrongTime = false; var TicketName = jQu...
why do you save it as a string? I would recommend storing it in an object: function EditEventAddTicket(){ alertWrongTime = false; var TicketName = jQuery("#ticketname").val(); var TicketPrice = jQuery("#ticketprice").val(); var ticketquantity = jQuery("#ticketquantity").val(); var ticket = {"TicketName": TicketName, "...
Splitting an array I have two javascript functions, the first one is working, teh second is working but not echoing the correct value in the hidden inputs. Ive manage to get the last hidden input value correct but I'm not sure how var customTicketsArr = Array(); function EditEventAddTicket(){ alertWrongTime = false; v...
TITLE: Splitting an array QUESTION: I have two javascript functions, the first one is working, teh second is working but not echoing the correct value in the hidden inputs. Ive manage to get the last hidden input value correct but I'm not sure how var customTicketsArr = Array(); function EditEventAddTicket(){ alertWr...
[ "javascript", "jquery", "arrays" ]
0
2
147
3
0
2011-06-06T16:24:27.057000
2011-06-06T16:31:11.053000