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,253,857
6,253,957
facebook session expires in android
i am using facebook api in my android project {"error":{"type":"OAuthException","message":"Error validating access token: Session has expired at unix time 1307350800. The current unix time is 1307352870."}} My session expires....after a while....i want it as session never...expires expecting piece a piece code..so that...
You have to request the offline permission when the user signs in to get a token that doesn't expire. getFacebookApi().authorize(this, new String[]{"offline_access"}, CONSTANT_ID, myDialogListener); hope this helps!
facebook session expires in android i am using facebook api in my android project {"error":{"type":"OAuthException","message":"Error validating access token: Session has expired at unix time 1307350800. The current unix time is 1307352870."}} My session expires....after a while....i want it as session never...expires e...
TITLE: facebook session expires in android QUESTION: i am using facebook api in my android project {"error":{"type":"OAuthException","message":"Error validating access token: Session has expired at unix time 1307350800. The current unix time is 1307352870."}} My session expires....after a while....i want it as session...
[ "java", "android" ]
2
5
1,323
1
0
2011-06-06T14:51:57.193000
2011-06-06T14:57:49.817000
6,253,858
6,254,163
C# Complex Return Types
I am new to C# and find myself in situations sometimes where I have to return complex return types for some functions. Like the function may take in some object and return a different view of that object: some fields added, some removed, etc. And other times, I may take in a list of objects and want to return a list of...
In your specific example you should have a concrete type which handles those properties, and utilize LINQ to reinterpret the data in a different "view". public class Item { public int Id { get; private set; } public int Category { get; set; } public string Name { get; set; } public Item(int id, int category, string na...
C# Complex Return Types I am new to C# and find myself in situations sometimes where I have to return complex return types for some functions. Like the function may take in some object and return a different view of that object: some fields added, some removed, etc. And other times, I may take in a list of objects and ...
TITLE: C# Complex Return Types QUESTION: I am new to C# and find myself in situations sometimes where I have to return complex return types for some functions. Like the function may take in some object and return a different view of that object: some fields added, some removed, etc. And other times, I may take in a li...
[ "c#" ]
2
1
2,105
4
0
2011-06-06T14:51:57.337000
2011-06-06T15:15:24.573000
6,253,859
6,253,911
jQuery $.getJSON not working
I am try to get a URL from a one server and using that URL to get contents of another server. $.ajax({url: 'http://localhost:8080/geturl.jsp?A=1&B=2,C=3', success: function (data) { alert(data); $.getJSON(data, function (mydata) { alert(mydata); }); }, error: function (data, status, xhr) { } }); I know that we cannot m...
The getJSON function can only be used across domains to fetch JSONP. It does not magically evade any security restrictions.
jQuery $.getJSON not working I am try to get a URL from a one server and using that URL to get contents of another server. $.ajax({url: 'http://localhost:8080/geturl.jsp?A=1&B=2,C=3', success: function (data) { alert(data); $.getJSON(data, function (mydata) { alert(mydata); }); }, error: function (data, status, xhr) { ...
TITLE: jQuery $.getJSON not working QUESTION: I am try to get a URL from a one server and using that URL to get contents of another server. $.ajax({url: 'http://localhost:8080/geturl.jsp?A=1&B=2,C=3', success: function (data) { alert(data); $.getJSON(data, function (mydata) { alert(mydata); }); }, error: function (dat...
[ "javascript", "jquery", "cross-domain" ]
0
5
1,491
2
0
2011-06-06T14:52:00.513000
2011-06-06T14:55:11.203000
6,253,886
6,261,759
Access relative path from eclipse-plugin
Does anyone know how to get a file with uri from a self-made Eclipse Plug-in? Absolute paths would be no problem: URI.createFileURI("C:/Users/hp/workspace(dke)/SMartGen/StarSchema.profile.uml"); But how do I access local resources relatively? URI.createFileURI("jar:file:/%ECLIPSE_HOME%/plugins/SMartGen.jar!StarSchema.p...
Use the FileLocator. Example: URL iconUrl = FileLocator.find(Platform.getBundle("myBundle"), new Path("icons/someIcon.png"), null); This will get the URL of a file "someIcon.png" that is located in the "icons" folder in the bundle "myBundle".
Access relative path from eclipse-plugin Does anyone know how to get a file with uri from a self-made Eclipse Plug-in? Absolute paths would be no problem: URI.createFileURI("C:/Users/hp/workspace(dke)/SMartGen/StarSchema.profile.uml"); But how do I access local resources relatively? URI.createFileURI("jar:file:/%ECLIPS...
TITLE: Access relative path from eclipse-plugin QUESTION: Does anyone know how to get a file with uri from a self-made Eclipse Plug-in? Absolute paths would be no problem: URI.createFileURI("C:/Users/hp/workspace(dke)/SMartGen/StarSchema.profile.uml"); But how do I access local resources relatively? URI.createFileURI(...
[ "eclipse", "eclipse-plugin", "eclipse-rcp", "uri", "relative-path" ]
3
3
3,318
2
0
2011-06-06T14:53:46.213000
2011-06-07T07:13:06.777000
6,253,899
6,254,344
storing multiple selections from html form in PHP array (I'm using Codeigniter)
I've got an HTML form which allows a user to select multiple options in a dropdown. I then pass that data on as post data to a PHP backend (I'm using codeigniter for the backend, and the data is being passed to a model). In javascript, I can log the value being passed, and if there are multiple values, it shows as a pr...
Set the name of your select box to f_memberdep[] the [] will tell PHP that it should be passed as an array so you will receive all values. Also should point out that your logging a field called sel_dep when your select box is called f_memberdep but that's probably just a formatting thing.
storing multiple selections from html form in PHP array (I'm using Codeigniter) I've got an HTML form which allows a user to select multiple options in a dropdown. I then pass that data on as post data to a PHP backend (I'm using codeigniter for the backend, and the data is being passed to a model). In javascript, I ca...
TITLE: storing multiple selections from html form in PHP array (I'm using Codeigniter) QUESTION: I've got an HTML form which allows a user to select multiple options in a dropdown. I then pass that data on as post data to a PHP backend (I'm using codeigniter for the backend, and the data is being passed to a model). I...
[ "php", "html", "forms", "codeigniter" ]
0
2
2,167
1
0
2011-06-06T14:54:29.503000
2011-06-06T15:29:36.240000
6,253,901
6,254,417
SSIS/C#: Script Task, C# script to look at directory and store the name of 1 file in a variable
Basically I've written a C# script for a Script task in SSIS that looks in a User::Directory for 1 csv, if & only if there is one file, it stores that in the instance variable which then maps to the package variables of SSIS. When I exicute, it gives me the red filled in box of the Script task. I think it's related to ...
This could simply be done using Foreach loop container as explained in this Stack Overflow question, which was asked by you.:-) Anyway, to answer your question with respect to Script Task code that you have provided. Below mentioned reasons could be cause of the issues: You are looking for.csv. This won't return any re...
SSIS/C#: Script Task, C# script to look at directory and store the name of 1 file in a variable Basically I've written a C# script for a Script task in SSIS that looks in a User::Directory for 1 csv, if & only if there is one file, it stores that in the instance variable which then maps to the package variables of SSIS...
TITLE: SSIS/C#: Script Task, C# script to look at directory and store the name of 1 file in a variable QUESTION: Basically I've written a C# script for a Script task in SSIS that looks in a User::Directory for 1 csv, if & only if there is one file, it stores that in the instance variable which then maps to the package...
[ "ssis" ]
0
0
16,102
1
0
2011-06-06T14:54:34.173000
2011-06-06T15:34:41.740000
6,253,905
6,254,128
Dealing with DateTime using "Linq Methods"
[ASP.NET 4.0 / EF 4.1] Hi, I´m trying to use "Linq Methods" to filter a datasource based on datetime fields, but I´m getting the error: "Only primitive types ('such as Int32, String, and Guid') are supported in this context". I know that Entity Framework have some limitations when dealing with dates, but what I need is...
You're using a nullable type DateTime? in your example. I'm not sure if your database column allows NULL, but I'd use date.Value to pass the value of the parameter to be sure EF doesn't fall over it. Note that with nullable types, you can als use the HasValue property to check if your parameter contains a proper value....
Dealing with DateTime using "Linq Methods" [ASP.NET 4.0 / EF 4.1] Hi, I´m trying to use "Linq Methods" to filter a datasource based on datetime fields, but I´m getting the error: "Only primitive types ('such as Int32, String, and Guid') are supported in this context". I know that Entity Framework have some limitations ...
TITLE: Dealing with DateTime using "Linq Methods" QUESTION: [ASP.NET 4.0 / EF 4.1] Hi, I´m trying to use "Linq Methods" to filter a datasource based on datetime fields, but I´m getting the error: "Only primitive types ('such as Int32, String, and Guid') are supported in this context". I know that Entity Framework have...
[ "c#", "asp.net", "entity-framework" ]
3
4
2,465
1
0
2011-06-06T14:54:48.240000
2011-06-06T15:12:55.820000
6,253,946
6,255,107
Rails 3: application.rb not loading?
I'm migrating a Rails 2 app over to Rails 3, and hitting a major problem. I've got a method being called in my application.html.erb called check_author_role which is throwing undefined local variable or method `check_author_role' The check_author_role method is defined in a file called lib/authenticated_system.rb. I le...
Is the AuthenticatedSystem module mixed in to your application_controller? If so, then methods there will not be automatically available in the views. You need to add something like: helper:check_author_role... in your application_controller, after mixing in the AuthenticatedSystem module.
Rails 3: application.rb not loading? I'm migrating a Rails 2 app over to Rails 3, and hitting a major problem. I've got a method being called in my application.html.erb called check_author_role which is throwing undefined local variable or method `check_author_role' The check_author_role method is defined in a file cal...
TITLE: Rails 3: application.rb not loading? QUESTION: I'm migrating a Rails 2 app over to Rails 3, and hitting a major problem. I've got a method being called in my application.html.erb called check_author_role which is throwing undefined local variable or method `check_author_role' The check_author_role method is def...
[ "ruby-on-rails", "ruby-on-rails-3", "upgrade" ]
2
0
1,291
2
0
2011-06-06T14:57:19.297000
2011-06-06T16:28:57.710000
6,253,963
6,254,367
Table with table-layout: fixed; and how to make one column wider
So I have a table with this style: table-layout: fixed; Which makes all columns to be of the same width. I would like to have one column (the first one) to be wider and then rest of the columns to occupy the remaining width of the table with equal widths. How to achieve that? table { border-collapse: collapse; width:...
You could just give the first cell (therefore column) a width and have the rest default to auto table { table-layout: fixed; border-collapse: collapse; width: 100%; } td { border: 1px solid #000; width: 150px; } td+td { width: auto; } 150px equal equal or alternatively the "proper way" to get column widths m...
Table with table-layout: fixed; and how to make one column wider So I have a table with this style: table-layout: fixed; Which makes all columns to be of the same width. I would like to have one column (the first one) to be wider and then rest of the columns to occupy the remaining width of the table with equal widths....
TITLE: Table with table-layout: fixed; and how to make one column wider QUESTION: So I have a table with this style: table-layout: fixed; Which makes all columns to be of the same width. I would like to have one column (the first one) to be wider and then rest of the columns to occupy the remaining width of the table ...
[ "html", "css", "xhtml" ]
110
110
261,487
4
0
2011-06-06T14:58:01.340000
2011-06-06T15:30:48.813000
6,253,964
6,254,001
c# How to get session from asp.net session cookie
I'm pretty basic with.net But basically I've been told that to have session stickiness for my website in the environment it is to be deployed means I have to get session from the cookie ASP.NET_SessionId But what does this mean/how do I use this? And where I am using my existing session code e.g. Session.Add("Something...
This is automated for you You don't have to manually read cookies yourself. Asp.net does it for you. So whenever you access Session dictionary your session will already be preserved if it existed from your previous request(s). If there is none (or expired) it will also be automatically created so adding items to it wil...
c# How to get session from asp.net session cookie I'm pretty basic with.net But basically I've been told that to have session stickiness for my website in the environment it is to be deployed means I have to get session from the cookie ASP.NET_SessionId But what does this mean/how do I use this? And where I am using my...
TITLE: c# How to get session from asp.net session cookie QUESTION: I'm pretty basic with.net But basically I've been told that to have session stickiness for my website in the environment it is to be deployed means I have to get session from the cookie ASP.NET_SessionId But what does this mean/how do I use this? And w...
[ "c#", "asp.net", "session-state", "session-cookies" ]
0
1
13,519
5
0
2011-06-06T14:58:05.300000
2011-06-06T15:00:50.377000
6,253,965
6,254,584
Add a reference to an XSLT in Perl using only XML:LibXML
I have a XML created dynamically. However, I want to add a reference to an XSLT file in it, to be able to render the XML file as HTML in Mozilla. I want my final XML to start something like this: I am not able to install XML::LibXSLT, so that is not a solution. Another solution would be to write the XML in a file, open...
use strict; use warnings; use XML::LibXML; my $final_xml = XML::LibXML::Document->new('1.0','utf-8'); my $pi = $final_xml->createProcessingInstruction("xml-stylesheet"); $pi->setData(type=>'text/xsl', href=>'xslt_stylesheet_file.xsl'); $final_xml->appendChild($pi); my $root_node = $final_xml->createElement('root'); ...
Add a reference to an XSLT in Perl using only XML:LibXML I have a XML created dynamically. However, I want to add a reference to an XSLT file in it, to be able to render the XML file as HTML in Mozilla. I want my final XML to start something like this: I am not able to install XML::LibXSLT, so that is not a solution. A...
TITLE: Add a reference to an XSLT in Perl using only XML:LibXML QUESTION: I have a XML created dynamically. However, I want to add a reference to an XSLT file in it, to be able to render the XML file as HTML in Mozilla. I want my final XML to start something like this: I am not able to install XML::LibXSLT, so that is...
[ "xml", "perl", "libxml2" ]
4
5
694
2
0
2011-06-06T14:58:06.413000
2011-06-06T15:48:12.373000
6,253,966
6,254,082
jquery how to remove a column from a table
I need to click in a Close img, and remove all the column where the img is located. I'm trying to do something like this: var colnum = $(this).closest("td").prevAll("td").html(); $(this).closest("table").find("tr td:eq(" + colnum + ")").remove(); but, its not working. EDIT: GUYS, SORRY FOR THE FIRST POST, I WAS KIND A...
In your example demo, what should actually close?... I modified it slightly and the close column disappears, but I am unsure what else you are expecting to be removed. See here: http://jsfiddle.net/gfosco/TdCYy/24/ The issue is being inside a nested table... You want to remove the column from the cell parent tables par...
jquery how to remove a column from a table I need to click in a Close img, and remove all the column where the img is located. I'm trying to do something like this: var colnum = $(this).closest("td").prevAll("td").html(); $(this).closest("table").find("tr td:eq(" + colnum + ")").remove(); but, its not working. EDIT: G...
TITLE: jquery how to remove a column from a table QUESTION: I need to click in a Close img, and remove all the column where the img is located. I'm trying to do something like this: var colnum = $(this).closest("td").prevAll("td").html(); $(this).closest("table").find("tr td:eq(" + colnum + ")").remove(); but, its no...
[ "javascript", "jquery" ]
0
1
9,158
4
0
2011-06-06T14:58:07.970000
2011-06-06T15:08:19.620000
6,253,968
6,254,022
Selenium IDE Not Typing Entry
I am a beginner with Selenium, and I am trying a simple case of going to Wikipedia, entering some text (e.g - James Joyce), and asserting that James Joyce is on the page after clicking the "go" button. However, Selenium is not registering that I am entering "James Joyce". When I stop recording and view the commands, al...
I think that is a problem with Wikipedia. Not sure why it doesn;t work. You can enter the command manually. For Selenium IDE that is Command: type, Target: searchInput, Value: James Joyce.
Selenium IDE Not Typing Entry I am a beginner with Selenium, and I am trying a simple case of going to Wikipedia, entering some text (e.g - James Joyce), and asserting that James Joyce is on the page after clicking the "go" button. However, Selenium is not registering that I am entering "James Joyce". When I stop recor...
TITLE: Selenium IDE Not Typing Entry QUESTION: I am a beginner with Selenium, and I am trying a simple case of going to Wikipedia, entering some text (e.g - James Joyce), and asserting that James Joyce is on the page after clicking the "go" button. However, Selenium is not registering that I am entering "James Joyce"....
[ "selenium-ide" ]
0
1
1,103
2
0
2011-06-06T14:58:14.777000
2011-06-06T15:03:43.617000
6,253,984
6,254,052
JQueryUI Autocomplete - Trigger on all events
I'm using JQuery UI Autocomplete to pull records from a caller database. This works fine for records that are in the database but I want to improve handling for new records. For example, if a user chooses a name from a suggestion, I use the return id later in the form. This works fine. If the value is not found in sugg...
Could you not add a new handler for change eg: $( ".selector" ).autocomplete({ select: function(event, ui) {... }, change: function(event, ui) {... } });
JQueryUI Autocomplete - Trigger on all events I'm using JQuery UI Autocomplete to pull records from a caller database. This works fine for records that are in the database but I want to improve handling for new records. For example, if a user chooses a name from a suggestion, I use the return id later in the form. This...
TITLE: JQueryUI Autocomplete - Trigger on all events QUESTION: I'm using JQuery UI Autocomplete to pull records from a caller database. This works fine for records that are in the database but I want to improve handling for new records. For example, if a user chooses a name from a suggestion, I use the return id later...
[ "php", "jquery-ui", "autocomplete" ]
0
0
305
2
0
2011-06-06T14:59:12.803000
2011-06-06T15:05:54.760000
6,253,989
6,254,227
Shell script syntax error in expression
I'm trying to make self extracting file using the following Ant tasks:..... and my_program.exe looks like this: #!/bin/bash begin=`head -30 $0 | grep -n ^START | cut -d ':' -f -1` # find line number of the marker start=$(($begin+1)) # beginning of the binary archive which will be extracted echo $start... START #bina...
I guess you should use the -a (resp. --text, meaning to process a binary file as if it were text ) option of grep. Otherwise grep will only output "Binary file matches". So probably the line 4 should be: begin=`head -30 $0 | grep -na ^START | cut -d ':' -f -1` # find line number of the marker
Shell script syntax error in expression I'm trying to make self extracting file using the following Ant tasks:..... and my_program.exe looks like this: #!/bin/bash begin=`head -30 $0 | grep -n ^START | cut -d ':' -f -1` # find line number of the marker start=$(($begin+1)) # beginning of the binary archive which will b...
TITLE: Shell script syntax error in expression QUESTION: I'm trying to make self extracting file using the following Ant tasks:..... and my_program.exe looks like this: #!/bin/bash begin=`head -30 $0 | grep -n ^START | cut -d ':' -f -1` # find line number of the marker start=$(($begin+1)) # beginning of the binary ar...
[ "bash", "shell", "unix", "ksh" ]
0
4
2,469
1
0
2011-06-06T14:59:37.283000
2011-06-06T15:20:25.150000
6,253,995
6,254,712
xcode c include files
I would like to use XCode 4 as IDE for my C program. I am using few libraries, which are not installed in system paths. Also, I am using external program for building (waf). So, basically, I need XCode for everything, except building. But I can't figure out how to tell XCode where my library include files are for it to...
In the build settings for the Target - look for the HEADER_SEARCH_PATHS setting. Have you added the library headers to the project? You can just add them by reference.
xcode c include files I would like to use XCode 4 as IDE for my C program. I am using few libraries, which are not installed in system paths. Also, I am using external program for building (waf). So, basically, I need XCode for everything, except building. But I can't figure out how to tell XCode where my library inclu...
TITLE: xcode c include files QUESTION: I would like to use XCode 4 as IDE for my C program. I am using few libraries, which are not installed in system paths. Also, I am using external program for building (waf). So, basically, I need XCode for everything, except building. But I can't figure out how to tell XCode wher...
[ "c", "xcode", "ide", "xcode4" ]
1
0
661
1
0
2011-06-06T15:00:29.067000
2011-06-06T15:57:34.890000
6,253,998
6,280,139
How to create and read pkcs7 signed envelop with smime format?
I want to create pkcs7 signed envelop having S/MIME format and also want to read it. The file extension is pk7. How to do it with the OpenSSL library?
The SMIME_read_PKCS7() and SMIME_write_PKCS7() functions can be used to convert an SMIME message into a PKCS7 structure and vice-versa. You can use PKCS7_sign() / PKCS7_encrypt() to create PKCS7 structures, and PKCS7_verify() / PKCS7_decrypt() to consume them.
How to create and read pkcs7 signed envelop with smime format? I want to create pkcs7 signed envelop having S/MIME format and also want to read it. The file extension is pk7. How to do it with the OpenSSL library?
TITLE: How to create and read pkcs7 signed envelop with smime format? QUESTION: I want to create pkcs7 signed envelop having S/MIME format and also want to read it. The file extension is pk7. How to do it with the OpenSSL library? ANSWER: The SMIME_read_PKCS7() and SMIME_write_PKCS7() functions can be used to convert...
[ "c++", "c", "openssl" ]
1
2
2,205
1
0
2011-06-06T15:00:40.197000
2011-06-08T14:14:55.317000
6,254,000
6,254,079
Collapsible panel - MVC3 - Razor
Whats the best approach to take if I want to include a Collapsible panel in a MVC3 web page. In a Non MVC3 page, it is as easy as to drag and drop an Ajax control from the tool kit. I want to get that same functionality in my MVC3 application.. Thanks in advance for the suggestions.
The AJAX Toolkit is built for ASP.NET Web Forms, while it may work using ASP.NET MVC, it's not really recommended. I'd go with a, in my opinion, cleaner solution - try the jQuery Accordion. I've used it in several MVC based sites, and hasn't let me down so far.
Collapsible panel - MVC3 - Razor Whats the best approach to take if I want to include a Collapsible panel in a MVC3 web page. In a Non MVC3 page, it is as easy as to drag and drop an Ajax control from the tool kit. I want to get that same functionality in my MVC3 application.. Thanks in advance for the suggestions.
TITLE: Collapsible panel - MVC3 - Razor QUESTION: Whats the best approach to take if I want to include a Collapsible panel in a MVC3 web page. In a Non MVC3 page, it is as easy as to drag and drop an Ajax control from the tool kit. I want to get that same functionality in my MVC3 application.. Thanks in advance for th...
[ "asp.net", "asp.net-mvc-2", "asp.net-mvc-3", "razor" ]
0
3
11,004
1
0
2011-06-06T15:00:44.813000
2011-06-06T15:08:07.663000
6,254,003
6,254,120
string values to byte array without converting
I'm trying to put the values of a string into a byte array with out changing the characters. This is because the string is in fact a byte representation of the data. The goal is to move the input string into a byte array and then convert the byte array using: string result = System.Text.Encoding.UTF8.GetString(data); I...
Are you saying you have something like this: string s = "48656c6c6f2c20776f726c6421"; and you want these values as a byte array? Then: public IEnumerable GetBytesFromByteString(string s) { for (int index = 0; index < s.Length; index += 2) { yield return Convert.ToByte(s.Substring(index, 2), 16); } } Usage: string s = "...
string values to byte array without converting I'm trying to put the values of a string into a byte array with out changing the characters. This is because the string is in fact a byte representation of the data. The goal is to move the input string into a byte array and then convert the byte array using: string result...
TITLE: string values to byte array without converting QUESTION: I'm trying to put the values of a string into a byte array with out changing the characters. This is because the string is in fact a byte representation of the data. The goal is to move the input string into a byte array and then convert the byte array us...
[ "c#", ".net", "casting" ]
5
9
29,195
5
0
2011-06-06T15:01:09.560000
2011-06-06T15:12:08.667000
6,254,030
6,254,285
jquery rotate plugin throwing uncaught exception
I've got a problem when implementing the jquery rotate plugin. I implement it like this: var iDirection = 90; var dImg = $(" ").addClass('defect-image').attr({src: $(this).attr('IMAGE_PATH')}).load(function(){ //do stuff if img loads without errors }).error(function(){ $(this).attr({src: 'img/missing.jpg' }); }).rotate...
If I were you, I'd put the call to ".rotate()" inside the "load" handler, or in a "success" handler: var dImg = $(" ").addClass('defect-image').attr({src: $(this).attr('IMAGE_PATH')}).load(function(){ //do stuff if img loads without errors }).success(function() { dImg.rotate(iDirection); }) edit — this seems to be a ca...
jquery rotate plugin throwing uncaught exception I've got a problem when implementing the jquery rotate plugin. I implement it like this: var iDirection = 90; var dImg = $(" ").addClass('defect-image').attr({src: $(this).attr('IMAGE_PATH')}).load(function(){ //do stuff if img loads without errors }).error(function(){ $...
TITLE: jquery rotate plugin throwing uncaught exception QUESTION: I've got a problem when implementing the jquery rotate plugin. I implement it like this: var iDirection = 90; var dImg = $(" ").addClass('defect-image').attr({src: $(this).attr('IMAGE_PATH')}).load(function(){ //do stuff if img loads without errors }).e...
[ "jquery", "jquery-plugins", "rotation", "image-manipulation" ]
1
1
295
1
0
2011-06-06T15:04:21.563000
2011-06-06T15:25:21.297000
6,254,039
6,261,713
Silverlight styles for custom controls. Using the BasedOn property
I had been previously using the DefaultStyleKey setting to set my datagrid's style, but now i want to extend one style with the BasedOn property of another. So now I have two styles with the same Type, and I must be more specifc than simply setting the DefaultStyleKey. Unfortunately, I can't seem to access the generic....
Are you looking for something like this: public override void OnApplyTemplate() { base.OnApplyTemplate(); ResourceDictionary rd = new ResourceDictionary(); rd.Source = new Uri("/CustomControl;component/Themes/generic.xaml", UriKind.RelativeOrAbsolute); Style style = rd["StyleKey"] as Style; } 'CustomControl' is the nam...
Silverlight styles for custom controls. Using the BasedOn property I had been previously using the DefaultStyleKey setting to set my datagrid's style, but now i want to extend one style with the BasedOn property of another. So now I have two styles with the same Type, and I must be more specifc than simply setting the ...
TITLE: Silverlight styles for custom controls. Using the BasedOn property QUESTION: I had been previously using the DefaultStyleKey setting to set my datagrid's style, but now i want to extend one style with the BasedOn property of another. So now I have two styles with the same Type, and I must be more specifc than s...
[ "silverlight", "controls" ]
0
0
579
2
0
2011-06-06T15:05:04.777000
2011-06-07T07:08:02.617000
6,254,046
6,254,145
How much time do users actively spend on my program?
One of the analytics that I had to have on my program was How much time do users spend on my program? It is basically a measure of how useful the users find my program that they actively keep on using it. and used to promote users to actively start using the application. I initially thought of using Time Span between w...
Since you want to know how much people use your software as opposed to how long your software uses the CPU (they aren't always the same thing), the way I'd do it (and I actually used this before) is to use GetLastInputInfo. You can have a timer in your application and check every say.. 500ms if your application is the ...
How much time do users actively spend on my program? One of the analytics that I had to have on my program was How much time do users spend on my program? It is basically a measure of how useful the users find my program that they actively keep on using it. and used to promote users to actively start using the applicat...
TITLE: How much time do users actively spend on my program? QUESTION: One of the analytics that I had to have on my program was How much time do users spend on my program? It is basically a measure of how useful the users find my program that they actively keep on using it. and used to promote users to actively start ...
[ "c#", ".net", "analytics" ]
2
2
393
1
0
2011-06-06T15:05:35.077000
2011-06-06T15:13:56.647000
6,254,047
6,254,108
ignore non existing method
so let's say you have a singleton pattern or whatever: class Smth{ public static function Foo(){ static $instance; if(!condition()) return false; // <-- it's nothing... if(!($instance instanceof FooClass)) $instance = new FooClass(); return $instance; // <-- it's a object and has that method } } so if I call Smth::foo...
You do not want to do that. This is a silent failure and it's not a good thing. When you call a method, you expect it to do something (especially a getInstance -like method in the Singleton pattern, which should return an instance). So yes, you have to check if foo() returns an actual object before calling A_foo_method...
ignore non existing method so let's say you have a singleton pattern or whatever: class Smth{ public static function Foo(){ static $instance; if(!condition()) return false; // <-- it's nothing... if(!($instance instanceof FooClass)) $instance = new FooClass(); return $instance; // <-- it's a object and has that method...
TITLE: ignore non existing method QUESTION: so let's say you have a singleton pattern or whatever: class Smth{ public static function Foo(){ static $instance; if(!condition()) return false; // <-- it's nothing... if(!($instance instanceof FooClass)) $instance = new FooClass(); return $instance; // <-- it's a object a...
[ "php", "class", "methods", "singleton" ]
0
2
134
3
0
2011-06-06T15:05:38.827000
2011-06-06T15:11:22.017000
6,254,054
6,255,125
Text alignment in java printing
I am using 2d graphics to print the string on to the paper. I want the string to be aligned on the paper like right, left, centre. How can I do that?
basic Printing tutorial EDIT: basic 2D Graphics stuff shows examples about PrinterJob, PrintJob and Print
Text alignment in java printing I am using 2d graphics to print the string on to the paper. I want the string to be aligned on the paper like right, left, centre. How can I do that?
TITLE: Text alignment in java printing QUESTION: I am using 2d graphics to print the string on to the paper. I want the string to be aligned on the paper like right, left, centre. How can I do that? ANSWER: basic Printing tutorial EDIT: basic 2D Graphics stuff shows examples about PrinterJob, PrintJob and Print
[ "java", "swing", "printing", "java-2d" ]
1
3
1,858
2
0
2011-06-06T15:06:00.297000
2011-06-06T16:30:29.863000
6,254,057
6,259,154
What technology can be used for this browserbased ping-pong game?
I just saw the McDonald's commercial which I have linked to below and I would like to try developing something similar for a festival. We have been talking about making a game in which the user has to use their iPhone and something like what McDonald's has done would be great. My question is if anyone have an idea how ...
Just use WebSockets. The problem with them is browser support and supporting older browsers / platforms. To handle this there are various abstractions. I would personally recommend socket.io A solid abstraction that relies on node.js. Has a range of fallbacks (including COMET and Flash). Whilst your at it, you might wa...
What technology can be used for this browserbased ping-pong game? I just saw the McDonald's commercial which I have linked to below and I would like to try developing something similar for a festival. We have been talking about making a game in which the user has to use their iPhone and something like what McDonald's h...
TITLE: What technology can be used for this browserbased ping-pong game? QUESTION: I just saw the McDonald's commercial which I have linked to below and I would like to try developing something similar for a festival. We have been talking about making a game in which the user has to use their iPhone and something like...
[ "php", "javascript", "ajax", "actionscript-3", "browser" ]
2
2
691
4
0
2011-06-06T15:06:08.427000
2011-06-06T23:26:27.370000
6,254,059
6,254,140
jQuery serialize remove empty Select
I have a big form, that will be serialized by a jQuery function. The problem is that I need to remove from this form before being serialized all the empty values. I found a way to successfully remove all the empty input text fields, but not the selections. It does not work properly with select dropdowns. Ceck below: ec...
If with 'empty select' you mean that the user has not chosen a 'valid' option (for example the fist option of a select is Select your value )why don't you iterate on the select and check their value? $('select').each(function(){ if ($(this).val() === ''){//this assumes that your empty value is '' $(this).remove(); } })...
jQuery serialize remove empty Select I have a big form, that will be serialized by a jQuery function. The problem is that I need to remove from this form before being serialized all the empty values. I found a way to successfully remove all the empty input text fields, but not the selections. It does not work properly ...
TITLE: jQuery serialize remove empty Select QUESTION: I have a big form, that will be serialized by a jQuery function. The problem is that I need to remove from this form before being serialized all the empty values. I found a way to successfully remove all the empty input text fields, but not the selections. It does ...
[ "javascript", "jquery" ]
0
1
3,546
4
0
2011-06-06T15:06:15.773000
2011-06-06T15:13:45.710000
6,254,060
6,262,106
quartz.net fires twice
I have quartz.net integrated in asp.net mvc app. I have it scheduled to run once a day in the early morning hours. Most of the times, my Sample job fires 2 times 2011-06-06 04:00:00.0077|INFO| -> once 2011-06-06 04:00:00.0233|INFO| -> twice But it has happened that it fires only once, but rarely (only once actually). I...
It's hard to say, really. Everything seems all right. I would suggest you to make your factory and scheduler singleton (that's the way it should be) and see what happens: public class MyScheduler { static MyScheduler() { _schedulerFactory = new StdSchedulerFactory(getProperties()); _scheduler = _schedulerFactory.GetSch...
quartz.net fires twice I have quartz.net integrated in asp.net mvc app. I have it scheduled to run once a day in the early morning hours. Most of the times, my Sample job fires 2 times 2011-06-06 04:00:00.0077|INFO| -> once 2011-06-06 04:00:00.0233|INFO| -> twice But it has happened that it fires only once, but rarely ...
TITLE: quartz.net fires twice QUESTION: I have quartz.net integrated in asp.net mvc app. I have it scheduled to run once a day in the early morning hours. Most of the times, my Sample job fires 2 times 2011-06-06 04:00:00.0077|INFO| -> once 2011-06-06 04:00:00.0233|INFO| -> twice But it has happened that it fires only...
[ "c#", "asp.net", "scheduled-tasks", "quartz.net" ]
3
1
3,520
3
0
2011-06-06T15:06:34.357000
2011-06-07T07:47:25.017000
6,254,064
6,254,122
Fighting against repetitive clicks
I'm writing an Adsense style adserver now. Want to know which are the best methods to fight against repetitive clicks. Now i'm storing the clickers IP address in an other table, and allow 1 click in every 24hr for an ad. This solution is not the best, and it still can be screwed. How does Google and the others does? Th...
One click per 24h will hurt your business big time. Just think of big organizations with just one public IP for their "staff computers". As far as I know, there is no proper solution to this, but a combination of these things might do the trick for you: Check in your session if a click has already occurred. Check again...
Fighting against repetitive clicks I'm writing an Adsense style adserver now. Want to know which are the best methods to fight against repetitive clicks. Now i'm storing the clickers IP address in an other table, and allow 1 click in every 24hr for an ad. This solution is not the best, and it still can be screwed. How ...
TITLE: Fighting against repetitive clicks QUESTION: I'm writing an Adsense style adserver now. Want to know which are the best methods to fight against repetitive clicks. Now i'm storing the clickers IP address in an other table, and allow 1 click in every 24hr for an ad. This solution is not the best, and it still ca...
[ "php" ]
1
2
94
2
0
2011-06-06T15:06:46.813000
2011-06-06T15:12:16.523000
6,254,065
6,254,990
Tweet (or facebook) status update from iPhone with predefined Text
Hey, sorry to bother you again, but I can't get this to work and would appreciate a working example project.. I try to give my users the possibility to post a short, predefined message from inside my App on either twitter or facebook (both should be available, but it doesn't have to update both on the same action, so o...
Perhaps the easiest way to be able to publish to a number of different services is ShareKit. This supports sending messages to Twitter, Facebook and a bunch of other services.
Tweet (or facebook) status update from iPhone with predefined Text Hey, sorry to bother you again, but I can't get this to work and would appreciate a working example project.. I try to give my users the possibility to post a short, predefined message from inside my App on either twitter or facebook (both should be ava...
TITLE: Tweet (or facebook) status update from iPhone with predefined Text QUESTION: Hey, sorry to bother you again, but I can't get this to work and would appreciate a working example project.. I try to give my users the possibility to post a short, predefined message from inside my App on either twitter or facebook (...
[ "iphone", "objective-c", "facebook", "twitter" ]
0
2
750
1
0
2011-06-06T15:06:56.933000
2011-06-06T16:20:14.317000
6,254,067
6,262,823
Batch: delete line feed from end of text file?
I have a.txt file where I need to get rid of the last line feed. Looking at the file in a HEX Editor it shows "0d 0a" at the end. I have looked at the thread How to delete Linefeed using batch file but that did not help. I have tried COPY source target /b which also does not help. Unfortunately I can't use Java or any ...
Using batch this should work. @echo off setlocal DisableDelayedExpansion set "firstLineReady=" ( for /F "eol=$ delims=" %%a in (myFile.txt) DO ( if defined firstLineReady (echo() set "firstLineReady=1" out.txt It copies all lines and append to each line a CR/LF, but not to the last one
Batch: delete line feed from end of text file? I have a.txt file where I need to get rid of the last line feed. Looking at the file in a HEX Editor it shows "0d 0a" at the end. I have looked at the thread How to delete Linefeed using batch file but that did not help. I have tried COPY source target /b which also does n...
TITLE: Batch: delete line feed from end of text file? QUESTION: I have a.txt file where I need to get rid of the last line feed. Looking at the file in a HEX Editor it shows "0d 0a" at the end. I have looked at the thread How to delete Linefeed using batch file but that did not help. I have tried COPY source target /b...
[ "batch-file", "carriage-return", "linefeed" ]
2
3
9,720
2
0
2011-06-06T15:07:15.220000
2011-06-07T08:52:53.927000
6,254,076
6,254,206
Is it possible to change text color for one database item when it is printed from a cursor?
I have a database that I use a cursor to display. What I am doing right now is just appending the results to a string and displaying. What I am trying to do is change the text color of the title of each database result based on the type of item it is but I don't think that is possible when appending text using a String...
Use fromHtml: this will allow you to style your string. String styleText = "This is red."; textView.setText(Html.fromHtml(styleText), TextView.BufferType.SPANNABLE);
Is it possible to change text color for one database item when it is printed from a cursor? I have a database that I use a cursor to display. What I am doing right now is just appending the results to a string and displaying. What I am trying to do is change the text color of the title of each database result based on ...
TITLE: Is it possible to change text color for one database item when it is printed from a cursor? QUESTION: I have a database that I use a cursor to display. What I am doing right now is just appending the results to a string and displaying. What I am trying to do is change the text color of the title of each databas...
[ "android", "sqlite" ]
0
1
346
1
0
2011-06-06T15:07:54.157000
2011-06-06T15:18:35.263000
6,254,077
6,254,150
While transferring a file to a remote system,i get an error message "The network path was not found". What could be the reasons for that?
While transferring a file to a remote system,i get an error message "The network path was not found". What could be the reasons for that? os used is windows in both the systems
It's possible the network connection was lost during transfer.
While transferring a file to a remote system,i get an error message "The network path was not found". What could be the reasons for that? While transferring a file to a remote system,i get an error message "The network path was not found". What could be the reasons for that? os used is windows in both the systems
TITLE: While transferring a file to a remote system,i get an error message "The network path was not found". What could be the reasons for that? QUESTION: While transferring a file to a remote system,i get an error message "The network path was not found". What could be the reasons for that? os used is windows in both...
[ "networking", "file-transfer" ]
0
1
111
1
0
2011-06-06T15:07:56.633000
2011-06-06T15:14:22.670000
6,254,078
6,257,933
Program to factorize a number into two smaller prime numbers
I have a very big number, and I want to make a program, that finds two prime numbers, that will give the original number, if multiplied. Ex. Original_number = 299 // The program should get these two numbers: q = 13 p = 23 The program runs fine at the start, but at a certain point, it just stops, and I'm not sure what...
A simple approach is trial division: import math def factors(number): return [(x, number / x) for x in range(int(math.sqrt(number)))[2:] if not number % x] Then factors(299) returns [(13,23)] There are problems with this method for large numbers: Large numbers may exceed the python integer limit (found in sys.maxint )....
Program to factorize a number into two smaller prime numbers I have a very big number, and I want to make a program, that finds two prime numbers, that will give the original number, if multiplied. Ex. Original_number = 299 // The program should get these two numbers: q = 13 p = 23 The program runs fine at the start,...
TITLE: Program to factorize a number into two smaller prime numbers QUESTION: I have a very big number, and I want to make a program, that finds two prime numbers, that will give the original number, if multiplied. Ex. Original_number = 299 // The program should get these two numbers: q = 13 p = 23 The program runs ...
[ "python", "primes" ]
1
2
3,482
6
0
2011-06-06T15:08:05.680000
2011-06-06T20:55:21.687000
6,254,080
6,254,191
Adding a view to a view just crashes the android application
I'm using Kevin Whinnery's Snapost application for reference (https://github.com/kwhinnery/Snapost/blob/master/1.1.x/Snapost/Resources/app.js), but when add a view to a view the application just crashes. This is the only code i have in the application. Titanium.UI.setBackgroundColor('#FFF'); var viewContainer = Titani...
Seems to be an issue with API 1.6, it works fine on API 2.2.
Adding a view to a view just crashes the android application I'm using Kevin Whinnery's Snapost application for reference (https://github.com/kwhinnery/Snapost/blob/master/1.1.x/Snapost/Resources/app.js), but when add a view to a view the application just crashes. This is the only code i have in the application. Titani...
TITLE: Adding a view to a view just crashes the android application QUESTION: I'm using Kevin Whinnery's Snapost application for reference (https://github.com/kwhinnery/Snapost/blob/master/1.1.x/Snapost/Resources/app.js), but when add a view to a view the application just crashes. This is the only code i have in the a...
[ "javascript", "view", "appcelerator" ]
0
0
95
1
0
2011-06-06T15:08:08.133000
2011-06-06T15:17:30.267000
6,254,083
6,254,521
regex doubt in gawk
my csv data file is like this title,name,gender MRS.,MADHU,Female MRS.,RAJ KUMAR,male MR.,N,Male MRS.,SHASHI,Female MRS.,ALKA,Female now as you can see i wanna avoid all data like line 2 and 3 (i.e no white space or data length >= 3 ) MRS.,RAJ KUMAR,male MR.,N,Male and place it in a file called rejected_list.csv, rest ...
I added a rejection condition: not exactly 3 fields gawk -F, ' BEGIN { titles = "MRS.|MR.|MS.|MISS.|MASTER.|SMT.|DR.|BABY.|PROF." genders = "M|F|Male|Female" } $1!~ titles || $2 ~ /[[:space:]]/ || length($2) < 3 || $3!~ genders || NF!= 3 { print > "rejected_list.csv" next } { print > "clean_list.csv" } ' < DATA_file.cs...
regex doubt in gawk my csv data file is like this title,name,gender MRS.,MADHU,Female MRS.,RAJ KUMAR,male MR.,N,Male MRS.,SHASHI,Female MRS.,ALKA,Female now as you can see i wanna avoid all data like line 2 and 3 (i.e no white space or data length >= 3 ) MRS.,RAJ KUMAR,male MR.,N,Male and place it in a file called reje...
TITLE: regex doubt in gawk QUESTION: my csv data file is like this title,name,gender MRS.,MADHU,Female MRS.,RAJ KUMAR,male MR.,N,Male MRS.,SHASHI,Female MRS.,ALKA,Female now as you can see i wanna avoid all data like line 2 and 3 (i.e no white space or data length >= 3 ) MRS.,RAJ KUMAR,male MR.,N,Male and place it in ...
[ "regex", "gawk" ]
1
1
117
2
0
2011-06-06T15:08:23.713000
2011-06-06T15:43:22.557000
6,254,093
6,254,138
How to parse Camel Case to human readable string?
Is it possible to parse camel case string in to something more readable. for example: LocalBusiness = Local Business CivicStructureBuilding = Civic Structure Building getUserMobilePhoneNumber = Get User Mobile Phone Number bandGuitar1 = Band Guitar 1 UPDATE Using simshaun regex example I managed to separate numbers fro...
There are some examples in the user comments of str_split in the PHP manual. From Kevin: And here's something I wrote to meet your post's requirements: 'Local Business', 'CivicStructureBuilding' => 'Civic Structure Building', 'getUserMobilePhoneNumber' => 'Get User Mobile Phone Number', 'bandGuitar1' => 'Band Guitar 1'...
How to parse Camel Case to human readable string? Is it possible to parse camel case string in to something more readable. for example: LocalBusiness = Local Business CivicStructureBuilding = Civic Structure Building getUserMobilePhoneNumber = Get User Mobile Phone Number bandGuitar1 = Band Guitar 1 UPDATE Using simsha...
TITLE: How to parse Camel Case to human readable string? QUESTION: Is it possible to parse camel case string in to something more readable. for example: LocalBusiness = Local Business CivicStructureBuilding = Civic Structure Building getUserMobilePhoneNumber = Get User Mobile Phone Number bandGuitar1 = Band Guitar 1 U...
[ "php", "regex", "string", "parsing", "camelcasing" ]
16
34
10,839
2
0
2011-06-06T15:09:49.333000
2011-06-06T15:13:39.410000
6,254,095
6,254,160
Oracle 10g simple query error
Oracle SQL Developer complains about next SQL though I can't seem to find the reason: IF to_number(to_char(sysdate, 'HH24')) > 6 THEN IF to_number(to_char(sysdate, 'HH24')) < 9 THEN SELECT 1 FROM dual; ELSE SELECT (CASE WHEN result = 'SUCCESS' THEN 1 ELSE 0 END) FROM t_job WHERE to_char(start_time, 'yyyy/mm/dd') = to_c...
There are a couple of problems with your code (which is PL/SQL, not just SQL): 1) You are missing the begin and end around the block. 2) Your select s need an into clause try: DECLARE l_result number; BEGIN IF to_number(to_char(sysdate, 'HH24')) > 6 THEN IF to_number(to_char(sysdate, 'HH24')) < 9 THEN SELECT 1 INTO l_r...
Oracle 10g simple query error Oracle SQL Developer complains about next SQL though I can't seem to find the reason: IF to_number(to_char(sysdate, 'HH24')) > 6 THEN IF to_number(to_char(sysdate, 'HH24')) < 9 THEN SELECT 1 FROM dual; ELSE SELECT (CASE WHEN result = 'SUCCESS' THEN 1 ELSE 0 END) FROM t_job WHERE to_char(st...
TITLE: Oracle 10g simple query error QUESTION: Oracle SQL Developer complains about next SQL though I can't seem to find the reason: IF to_number(to_char(sysdate, 'HH24')) > 6 THEN IF to_number(to_char(sysdate, 'HH24')) < 9 THEN SELECT 1 FROM dual; ELSE SELECT (CASE WHEN result = 'SUCCESS' THEN 1 ELSE 0 END) FROM t_jo...
[ "plsql", "oracle10g" ]
0
3
3,618
2
0
2011-06-06T15:09:59.083000
2011-06-06T15:15:17.643000
6,254,096
6,254,166
Apache Virtualhosts, stopping PHP throwing errors with "/"
I have a pretty stable development machine set up running Apache and using virtual hosts to keep my projects separate, and running a dyndns.org service which I use to access them. Each VHost directive typically looks like this: ServerName [my_internal_subdomain].[my_dyndns_name].dyndns.org ServerAlias home DocumentRoo...
Do you mean this? require($_SERVER['DOCUMENT_ROOT']. '/includes/myfile.php');
Apache Virtualhosts, stopping PHP throwing errors with "/" I have a pretty stable development machine set up running Apache and using virtual hosts to keep my projects separate, and running a dyndns.org service which I use to access them. Each VHost directive typically looks like this: ServerName [my_internal_subdomain...
TITLE: Apache Virtualhosts, stopping PHP throwing errors with "/" QUESTION: I have a pretty stable development machine set up running Apache and using virtual hosts to keep my projects separate, and running a dyndns.org service which I use to access them. Each VHost directive typically looks like this: ServerName [my_...
[ "php", "apache" ]
1
1
86
4
0
2011-06-06T15:10:07.803000
2011-06-06T15:15:33.463000
6,254,099
6,254,146
How to pass parameters in jsp page
I am calling a servlet with params window.location.href = "/csm/csminfo.jsp?CFG_ID="+cfgid+"&path="+path; In the other csminfo on body load i am calling a function to retrieve these params,<%= request.getParameter("path") %>)"> JS function getConfigDetails(cfgid,path) { alert(cfgid+","+path); } But no alert gets popped...
You didn't quote the strings properly: ','<%= request.getParameter("path") %>')"> Some other issues: When building the URL on the original page, you should make sure the parameter values are properly encoded by using the JavaScript built-in "encodeURIComponent()" function. JSP scriptlets are an old, ugly way of doing t...
How to pass parameters in jsp page I am calling a servlet with params window.location.href = "/csm/csminfo.jsp?CFG_ID="+cfgid+"&path="+path; In the other csminfo on body load i am calling a function to retrieve these params,<%= request.getParameter("path") %>)"> JS function getConfigDetails(cfgid,path) { alert(cfgid+",...
TITLE: How to pass parameters in jsp page QUESTION: I am calling a servlet with params window.location.href = "/csm/csminfo.jsp?CFG_ID="+cfgid+"&path="+path; In the other csminfo on body load i am calling a function to retrieve these params,<%= request.getParameter("path") %>)"> JS function getConfigDetails(cfgid,path...
[ "javascript", "jsp" ]
0
3
5,817
1
0
2011-06-06T15:10:10.953000
2011-06-06T15:14:12.577000
6,254,100
6,254,491
hide plusone button after click
I want to hide google's +1 button after the user clicks on it using jQuery; this is the code I'm using but it seems it's not functioning properly: JS: $(function() { $("#button").click(function() { $(".HIDE").hide(); }); return false; }); HTML:
Use the +1 tag callback parameter to fire the hide function. There's probably a better way to select the +1 button but this works for the purpose of a demo. Demo: jsfiddle.net/Gju6T
hide plusone button after click I want to hide google's +1 button after the user clicks on it using jQuery; this is the code I'm using but it seems it's not functioning properly: JS: $(function() { $("#button").click(function() { $(".HIDE").hide(); }); return false; }); HTML:
TITLE: hide plusone button after click QUESTION: I want to hide google's +1 button after the user clicks on it using jQuery; this is the code I'm using but it seems it's not functioning properly: JS: $(function() { $("#button").click(function() { $(".HIDE").hide(); }); return false; }); HTML: ANSWER: Use the +1 tag ...
[ "javascript", "jquery", "google-plus-one" ]
4
3
1,868
4
0
2011-06-06T15:10:23.383000
2011-06-06T15:40:57.560000
6,254,101
6,270,589
ExtJS 4 Problem with MVC concept
i'm trying to use the new MVC concept and therefore started witht the AccountManager Example (examples/simple). Everything works fine as far as I stick to the tutorial, but I tried to extend it a bit. I define a border layout in 'Viewport.js' and assign a header component (views/Header.js) to 'north' and a tab-Panel (v...
The problem was that i had to give my controller a reference to the store and the model. I didn't do that from the beginning, after my controller had a reference to the view, the view had a reference to the store and the store had a reference to the model. So I assumed everything is ok. But it seems to be mandatory to ...
ExtJS 4 Problem with MVC concept i'm trying to use the new MVC concept and therefore started witht the AccountManager Example (examples/simple). Everything works fine as far as I stick to the tutorial, but I tried to extend it a bit. I define a border layout in 'Viewport.js' and assign a header component (views/Header....
TITLE: ExtJS 4 Problem with MVC concept QUESTION: i'm trying to use the new MVC concept and therefore started witht the AccountManager Example (examples/simple). Everything works fine as far as I stick to the tutorial, but I tried to extend it a bit. I define a border layout in 'Viewport.js' and assign a header compon...
[ "javascript", "model-view-controller", "extjs", "extjs4" ]
1
0
1,489
2
0
2011-06-06T15:10:37.497000
2011-06-07T19:32:32.950000
6,254,102
6,254,175
Passing a double to later in a program - using a dialog box for entry
I am trying to pass a double that is used later in my program. When the program launches, a dialog box appears, asking for a number to be input. The following code is supposed to receive entry of the number, and convert it into a double to be passed on: char MaxBuf[256]; #ifdef WIN32 edit_dialog(NULL,"Max", "Enter Max...
First of all, defining variable in a header file is not a good practice because every file that includes that header will have its own version of the variable (unless you use some guarding macro to anticipate this). That is why you experience uninitialized variable because it is different variable with the variable you...
Passing a double to later in a program - using a dialog box for entry I am trying to pass a double that is used later in my program. When the program launches, a dialog box appears, asking for a number to be input. The following code is supposed to receive entry of the number, and convert it into a double to be passed ...
TITLE: Passing a double to later in a program - using a dialog box for entry QUESTION: I am trying to pass a double that is used later in my program. When the program launches, a dialog box appears, asking for a number to be input. The following code is supposed to receive entry of the number, and convert it into a do...
[ "c++", "double", "global" ]
0
1
71
4
0
2011-06-06T15:10:50.157000
2011-06-06T15:16:10.107000
6,254,103
6,254,123
How I can determine when a window handle is valid?
I am writing a DLL which make some operations on a particular window, but sometimes the handle passed is not valid. Does there exist any function to validate that the handle passed is valid (belongs to a window)?
Try using the IsWindow function, which is declared in the Windows unit. function IsWindow(hWnd: HWND): BOOL; stdcall;
How I can determine when a window handle is valid? I am writing a DLL which make some operations on a particular window, but sometimes the handle passed is not valid. Does there exist any function to validate that the handle passed is valid (belongs to a window)?
TITLE: How I can determine when a window handle is valid? QUESTION: I am writing a DLL which make some operations on a particular window, but sometimes the handle passed is not valid. Does there exist any function to validate that the handle passed is valid (belongs to a window)? ANSWER: Try using the IsWindow functi...
[ "delphi", "winapi" ]
18
31
7,270
1
0
2011-06-06T15:11:05.153000
2011-06-06T15:12:27.883000
6,254,107
6,254,923
database query in action.class move to lib/model
i have: public function executeTest(sfWebRequest $request) { $query = Doctrine_Query::create() ->from('Messages') ->where('id =?', $id); $query->fetchArray(); } i did function in lib/model: public function newfunction($id) { $query = Doctrine_Query::create() ->from('Messages') ->where('id =?', $id); return $query->fet...
I'm assuming you created newFunction in lib/model/MessagesTable.class.php. $this->newFunction() won't work, because $this refers to the current action instance, not your model's table. You need to use either: Doctrine_Core::getTable("Messages")->newFunction($id); or MessagesTable::getInstance()->newFunction($id); they ...
database query in action.class move to lib/model i have: public function executeTest(sfWebRequest $request) { $query = Doctrine_Query::create() ->from('Messages') ->where('id =?', $id); $query->fetchArray(); } i did function in lib/model: public function newfunction($id) { $query = Doctrine_Query::create() ->from('Mess...
TITLE: database query in action.class move to lib/model QUESTION: i have: public function executeTest(sfWebRequest $request) { $query = Doctrine_Query::create() ->from('Messages') ->where('id =?', $id); $query->fetchArray(); } i did function in lib/model: public function newfunction($id) { $query = Doctrine_Query::cre...
[ "php", "oop", "symfony1", "doctrine", "symfony-1.4" ]
0
2
148
3
0
2011-06-06T15:11:17.600000
2011-06-06T16:14:00.990000
6,254,111
6,254,304
Object Layer for a Java RPG
I'm trying to make a basic RPG in java. I think I have a good hold of the basics of java, but when it comes to this stuff I'm definitely a beginner. Anyway, I thought that it would be best to create a map with two layers: a terrain layer with water, rocks, grass, etc... and an object layer with trees, houses, items- th...
If I may ask, what are you trying to accomplish by keeping the 2 layers separate? One would think that a natural complement of interacting with objects is to interact with the terrain as well. It would allow for a more extensible game design. Perhaps create a model object called Tile to represent each grid and then hav...
Object Layer for a Java RPG I'm trying to make a basic RPG in java. I think I have a good hold of the basics of java, but when it comes to this stuff I'm definitely a beginner. Anyway, I thought that it would be best to create a map with two layers: a terrain layer with water, rocks, grass, etc... and an object layer w...
TITLE: Object Layer for a Java RPG QUESTION: I'm trying to make a basic RPG in java. I think I have a good hold of the basics of java, but when it comes to this stuff I'm definitely a beginner. Anyway, I thought that it would be best to create a map with two layers: a terrain layer with water, rocks, grass, etc... and...
[ "java" ]
2
0
1,306
2
0
2011-06-06T15:11:35.930000
2011-06-06T15:26:39.013000
6,254,121
6,254,321
MySQL Connector/Net 6.0.2 path not found
I created a Windows form application (C#) with Mysql as back end mysql connector net 6 0 2 is used in my form for connection the exe works fine on my system but when i copied it to other computer and try to run it, it is giving me eror as MySQL Connector/Net 6.0.2 file path not found Thanx
You either need to deploy the MySQL Connector assemblies with your own application (or merge them into your own application assembly), or ensure the connector is installed on the machine you need to run the application on.
MySQL Connector/Net 6.0.2 path not found I created a Windows form application (C#) with Mysql as back end mysql connector net 6 0 2 is used in my form for connection the exe works fine on my system but when i copied it to other computer and try to run it, it is giving me eror as MySQL Connector/Net 6.0.2 file path not ...
TITLE: MySQL Connector/Net 6.0.2 path not found QUESTION: I created a Windows form application (C#) with Mysql as back end mysql connector net 6 0 2 is used in my form for connection the exe works fine on my system but when i copied it to other computer and try to run it, it is giving me eror as MySQL Connector/Net 6....
[ "c#", "mysql" ]
0
1
664
2
0
2011-06-06T15:12:12.220000
2011-06-06T15:27:53.667000
6,254,125
6,255,122
OpenID Selector for asp.net c#
I am trying to integrate openid authentication in asp.net 4 and have followed the following articles: Article 1 Article 2 I have uploaded the page here and the problem is explained here. I want to implement the openID selector as given in https://www.idselector.com/ but i didn't get any response from the site nor did t...
You could use the DotNetOpenAuth library instead of rolling out your own. http://www.dotnetopenauth.net/ They also provide project templates which can integrated into a website.
OpenID Selector for asp.net c# I am trying to integrate openid authentication in asp.net 4 and have followed the following articles: Article 1 Article 2 I have uploaded the page here and the problem is explained here. I want to implement the openID selector as given in https://www.idselector.com/ but i didn't get any r...
TITLE: OpenID Selector for asp.net c# QUESTION: I am trying to integrate openid authentication in asp.net 4 and have followed the following articles: Article 1 Article 2 I have uploaded the page here and the problem is explained here. I want to implement the openID selector as given in https://www.idselector.com/ but ...
[ "c#", "asp.net", "openid", "openid-selector" ]
0
2
333
1
0
2011-06-06T15:12:31.717000
2011-06-06T16:30:22.553000
6,254,127
6,254,153
Performing action on each selected item in Listbox VB.net
I am populating a listbox with a large list. The user then has the option of choosing multiple items from this list. I then want to perfrom a few actions on only the selected items. I cant figure out how to only perform the actions on only the highlighted selections. 'I have tried all combinations of For each Listbx.S...
For Each selecteditem As [Object] In Listbx.SelectedItems //Your code on each item Next
Performing action on each selected item in Listbox VB.net I am populating a listbox with a large list. The user then has the option of choosing multiple items from this list. I then want to perfrom a few actions on only the selected items. I cant figure out how to only perform the actions on only the highlighted select...
TITLE: Performing action on each selected item in Listbox VB.net QUESTION: I am populating a listbox with a large list. The user then has the option of choosing multiple items from this list. I then want to perfrom a few actions on only the selected items. I cant figure out how to only perform the actions on only the ...
[ "vb.net", "visual-studio-2010" ]
1
4
10,259
1
0
2011-06-06T15:12:51.860000
2011-06-06T15:14:44.100000
6,254,131
6,254,269
google chrome extension : how to get data from webpage and save it on user harddrive permanently?
I have this website which I frequently visit to lookup a German language word meanings in English. I want to save the text from each webpage I visit of the site in a json file by highlighting it. How do I go about doing this? Which api of google chrome extension should I refer to? Also will a firefox addon be faster to...
If you just need to store data between browser restarts then take a look at LocalStorage API. If you actually need to create a file there is a FileSystem API, but it has its limitations and not very easy to use. Chrome extensions are much easier to learn and create than Firefox.
google chrome extension : how to get data from webpage and save it on user harddrive permanently? I have this website which I frequently visit to lookup a German language word meanings in English. I want to save the text from each webpage I visit of the site in a json file by highlighting it. How do I go about doing th...
TITLE: google chrome extension : how to get data from webpage and save it on user harddrive permanently? QUESTION: I have this website which I frequently visit to lookup a German language word meanings in English. I want to save the text from each webpage I visit of the site in a json file by highlighting it. How do I...
[ "google-chrome-extension" ]
3
5
2,582
2
0
2011-06-06T15:13:14.090000
2011-06-06T15:23:44.133000
6,254,137
6,257,563
VS 2010 Error: ...csproj Cannot Be Opened
I'm trying to launch a project created by someone else in my local environment. I'm currently using the following products: Visual Studio 2010 Ultimate version 10.0.40219.1 SP1 Rel MVC 2 Windows 7 Ultimate But when I double click on the.sln file I get the following error: C:\Users...\Desktop\ContactManager\ContactManag...
Turns out that I just needed to install MVC version 3. I guess the project that I was trying to open is using MVC3 and my machine only had 2 as you can see in my environment list above. I'm glad I was able to fix this BUT give me a better error message for crying out loud. Sheesh.;) Aaron
VS 2010 Error: ...csproj Cannot Be Opened I'm trying to launch a project created by someone else in my local environment. I'm currently using the following products: Visual Studio 2010 Ultimate version 10.0.40219.1 SP1 Rel MVC 2 Windows 7 Ultimate But when I double click on the.sln file I get the following error: C:\Us...
TITLE: VS 2010 Error: ...csproj Cannot Be Opened QUESTION: I'm trying to launch a project created by someone else in my local environment. I'm currently using the following products: Visual Studio 2010 Ultimate version 10.0.40219.1 SP1 Rel MVC 2 Windows 7 Ultimate But when I double click on the.sln file I get the foll...
[ "visual-studio-2010" ]
15
25
14,719
3
0
2011-06-06T15:13:38.787000
2011-06-06T20:21:48.557000
6,254,152
6,254,373
Can I call Getopts multiple times in perl?
I am a noob to perl, so please try to be patient with this question of mine. It seems that if I make multiple calls to perl Getopts::Long::GetOpts method, the second call is completely ignored. Is this normal??(Why) What are the alternatives to this process?? (Actually Ive written a module, where I make a GetOpts call,...
Getopts::Long alters @ARGV while it works, that's how it can leave non-switch values behind in @ARGV when it is done processing the switches. So, when you make your second call, there's nothing left in @ARGV to parse and nothing useful happens. However, there is GetOptionsFromArray: By default, GetOptions parses the op...
Can I call Getopts multiple times in perl? I am a noob to perl, so please try to be patient with this question of mine. It seems that if I make multiple calls to perl Getopts::Long::GetOpts method, the second call is completely ignored. Is this normal??(Why) What are the alternatives to this process?? (Actually Ive wri...
TITLE: Can I call Getopts multiple times in perl? QUESTION: I am a noob to perl, so please try to be patient with this question of mine. It seems that if I make multiple calls to perl Getopts::Long::GetOpts method, the second call is completely ignored. Is this normal??(Why) What are the alternatives to this process??...
[ "perl", "getopt-long" ]
1
8
2,020
4
0
2011-06-06T15:14:32.810000
2011-06-06T15:31:19.503000
6,254,154
6,254,205
internal encoding for my application
My desktop c# application gets various documents from users, possibly in different encodings. I need to show users existing documents, allow to manipulate them in my UI, and store them for future use. Adding the notion of "encoding" to each of these steps seems complex to me. I was thinking to internally always convert...
Encodings are not interoperable, since some have characters that others don't have. Unicode internal representation is a good idea since it has the wider charset, but I'd advice to save back the document in the original encoding if the added characters are still in the said encoding. If not, prompt the user that you'll...
internal encoding for my application My desktop c# application gets various documents from users, possibly in different encodings. I need to show users existing documents, allow to manipulate them in my UI, and store them for future use. Adding the notion of "encoding" to each of these steps seems complex to me. I was ...
TITLE: internal encoding for my application QUESTION: My desktop c# application gets various documents from users, possibly in different encodings. I need to show users existing documents, allow to manipulate them in my UI, and store them for future use. Adding the notion of "encoding" to each of these steps seems com...
[ "c#", "unicode", "encoding", "utf-8", "utf-16" ]
2
1
580
5
0
2011-06-06T15:14:55.527000
2011-06-06T15:18:35.087000
6,254,157
6,254,197
Checkbox state on toggle?
$(document).ready(function(){ $("#CO_createAccount").toggle( function(){ $(".CO_accountForm").show('slow'); }, function () { $(".CO_accountForm").hide('slow'); } ); }); Tried several methods presented here in SO for showing the checkbox state, but it's not working for me. Thoughts?
toggle is used to show/hide an element. To get the state you can either use the jquery attr("checked") method or use the HTML DOM property checked. Try this: $(document).ready(function(){ $("#CO_createAccount").click( function (){ if(this.checked){ $(".CO_accountForm").show('slow'); } else { $(".CO_accountForm").hide('...
Checkbox state on toggle? $(document).ready(function(){ $("#CO_createAccount").toggle( function(){ $(".CO_accountForm").show('slow'); }, function () { $(".CO_accountForm").hide('slow'); } ); }); Tried several methods presented here in SO for showing the checkbox state, but it's not working for me. Thoughts?
TITLE: Checkbox state on toggle? QUESTION: $(document).ready(function(){ $("#CO_createAccount").toggle( function(){ $(".CO_accountForm").show('slow'); }, function () { $(".CO_accountForm").hide('slow'); } ); }); Tried several methods presented here in SO for showing the checkbox state, but it's not working for me. Tho...
[ "jquery", "forms", "checkbox", "toggle" ]
1
2
964
1
0
2011-06-06T15:15:11.953000
2011-06-06T15:17:56.180000
6,254,161
6,254,324
How to keep service running after force-stop?
I've seen that if you kill some process, it restarts immediately and keep running. How this implemented? How to inform system that my service should not be killed and if that happened - restart it.
Not sure this is something that's good, but I've seen malware processes that have "buddy" processes that revive each other when one or more go down. I hope whatever you're doing is ethical:-)
How to keep service running after force-stop? I've seen that if you kill some process, it restarts immediately and keep running. How this implemented? How to inform system that my service should not be killed and if that happened - restart it.
TITLE: How to keep service running after force-stop? QUESTION: I've seen that if you kill some process, it restarts immediately and keep running. How this implemented? How to inform system that my service should not be killed and if that happened - restart it. ANSWER: Not sure this is something that's good, but I've ...
[ "android" ]
1
2
2,252
2
0
2011-06-06T15:15:18.660000
2011-06-06T15:28:07.083000
6,254,164
6,254,211
Reason for .get() without index in jQuery API?
Let's say that I've got a page which extracts some image sources like so: Note that srcs is not a JavaScript Array but an array-like object; we know this because of the fact that we can make jQuery API calls on objects returned by the selector and the fact that srcs.constructor!= Array. The jQuery API provides a.get() ...
It allows you to use standard array methods which jQuery doesn't have, such as push. In particular, jQuery objects are intended to be immutable, whereas arrays are not.
Reason for .get() without index in jQuery API? Let's say that I've got a page which extracts some image sources like so: Note that srcs is not a JavaScript Array but an array-like object; we know this because of the fact that we can make jQuery API calls on objects returned by the selector and the fact that srcs.constr...
TITLE: Reason for .get() without index in jQuery API? QUESTION: Let's say that I've got a page which extracts some image sources like so: Note that srcs is not a JavaScript Array but an array-like object; we know this because of the fact that we can make jQuery API calls on objects returned by the selector and the fac...
[ "javascript", "jquery", "arrays" ]
10
2
165
2
0
2011-06-06T15:15:28.383000
2011-06-06T15:18:59.723000
6,254,181
6,254,193
How to monitor events in Firebug?
For example I have a dropdown box and I want to see the javascript code that runs after clicking on that dropdown box. How to accomplish this? The problem is that if I press button "break on next" it stops on hover event before I click on the item.
Right-click the element in the HTML tab, then click Log Events.
How to monitor events in Firebug? For example I have a dropdown box and I want to see the javascript code that runs after clicking on that dropdown box. How to accomplish this? The problem is that if I press button "break on next" it stops on hover event before I click on the item.
TITLE: How to monitor events in Firebug? QUESTION: For example I have a dropdown box and I want to see the javascript code that runs after clicking on that dropdown box. How to accomplish this? The problem is that if I press button "break on next" it stops on hover event before I click on the item. ANSWER: Right-clic...
[ "javascript", "events", "firebug" ]
13
17
7,266
1
0
2011-06-06T15:16:30.943000
2011-06-06T15:17:33.983000
6,254,183
6,254,225
Combining List initializer and object initializer
Is is possible to combine a List initializer and object initializer at the same time? Given the following class definition: class MyList: List { public string Text { get; set; } } // we can do this var obj1 = new MyList() { Text="Hello" }; // we can also do that var obj2 = new MyList() { 1, 2, 3 }; // but this one d...
No, looking at the definitions from section 7.6.10 of the C# spec, an object-or-collection-initializer expression is either an object-initializer or a collection-initializer. An object-initializer is composed of multiple member-initializer s, each of which is of the form initializer = initializer-value whereas a collec...
Combining List initializer and object initializer Is is possible to combine a List initializer and object initializer at the same time? Given the following class definition: class MyList: List { public string Text { get; set; } } // we can do this var obj1 = new MyList() { Text="Hello" }; // we can also do that var o...
TITLE: Combining List initializer and object initializer QUESTION: Is is possible to combine a List initializer and object initializer at the same time? Given the following class definition: class MyList: List { public string Text { get; set; } } // we can do this var obj1 = new MyList() { Text="Hello" }; // we can ...
[ "c#", ".net", "object-initializers", "collection-initializer" ]
19
29
6,847
3
0
2011-06-06T15:16:49.987000
2011-06-06T15:20:10.717000
6,254,189
6,254,255
when you do activeRecord.save does the transaction commit or is when the method exits?
In Rails 3, when you do activeRecord.save does the transaction commit or is when the method exits? so what I'm trying to figure out is if the MySQL is written right after save! or it's save after I exit the define black def something 1000.times do o = Order.new(:name => "Tomas") o.save end end
You should probably read up a bit on the ActiveRecord object callback chain; it explains what is going on under the hood with your objects. Basically, when you call save, an ActiveRecord::Base object will go through all the callbacks in the order the documentation lists them, you can see where the commit takes place (i...
when you do activeRecord.save does the transaction commit or is when the method exits? In Rails 3, when you do activeRecord.save does the transaction commit or is when the method exits? so what I'm trying to figure out is if the MySQL is written right after save! or it's save after I exit the define black def something...
TITLE: when you do activeRecord.save does the transaction commit or is when the method exits? QUESTION: In Rails 3, when you do activeRecord.save does the transaction commit or is when the method exits? so what I'm trying to figure out is if the MySQL is written right after save! or it's save after I exit the define b...
[ "ruby-on-rails", "ruby" ]
5
5
7,814
1
0
2011-06-06T15:17:21.760000
2011-06-06T15:22:33.123000
6,254,201
6,254,311
Improving a site that is showing max_user_connections
After some recent changes a site has started showing the max_user_connections error which is probably a sign that too many concurrent connection attempts are being to the MySQL database. I've noticed that the original programmers implemented a "DB" class for managing database connections and it seems that a close is on...
I am not familiar with PHP but closing DB-Connections as soon as possible is always good and independent from the programming language used. Also try to get a new DB-Connection as late as possible. If you're doing transactional DML then you should also release locks as soon as possible by commiting as soon as possible ...
Improving a site that is showing max_user_connections After some recent changes a site has started showing the max_user_connections error which is probably a sign that too many concurrent connection attempts are being to the MySQL database. I've noticed that the original programmers implemented a "DB" class for managin...
TITLE: Improving a site that is showing max_user_connections QUESTION: After some recent changes a site has started showing the max_user_connections error which is probably a sign that too many concurrent connection attempts are being to the MySQL database. I've noticed that the original programmers implemented a "DB"...
[ "php", "mysql", "max", "connection" ]
0
2
317
2
0
2011-06-06T15:18:17.027000
2011-06-06T15:27:08.347000
6,254,213
6,254,526
How do I turn off client side validation in MVC 3?
I have a framework for client side validation that I'd prefer to use over the existing one that ships with ASP.NET MVC 3. Does anyone know how to disable it in MVC 3? I have tried the following: HtmlHelper.ClientValidationEnabled = false; HtmlHelper.UnobtrusiveJavaScriptEnabled = false; And this in the web.config: Neit...
enable unobtrusive and disable clientvalidation. I just tried it (actually with both false) and it works fine. Its possible your page was being cached as well. I recommend keeping UnobtrusiveJavaScriptEnabled=true because of the lighter ajax attributes it adds.
How do I turn off client side validation in MVC 3? I have a framework for client side validation that I'd prefer to use over the existing one that ships with ASP.NET MVC 3. Does anyone know how to disable it in MVC 3? I have tried the following: HtmlHelper.ClientValidationEnabled = false; HtmlHelper.UnobtrusiveJavaScri...
TITLE: How do I turn off client side validation in MVC 3? QUESTION: I have a framework for client side validation that I'd prefer to use over the existing one that ships with ASP.NET MVC 3. Does anyone know how to disable it in MVC 3? I have tried the following: HtmlHelper.ClientValidationEnabled = false; HtmlHelper.U...
[ "asp.net-mvc-3", "client-side-validation" ]
2
7
9,124
3
0
2011-06-06T15:19:14.793000
2011-06-06T15:43:45.300000
6,254,219
6,256,889
jQuery AJAX Request 302 Redirect - What callbacks are available?
I'm working with an older system that is using jQuery 1.2.6. I am sending an AJAX Request via the jQuery.ajax function. The URL that it is hitting is sending a 302 HTTP Redirect response and eventually ends up with a 200 HTTP OK response. I have registered both a success and a complete callback, however neither of them...
As per the comments: Changing the dataType to html alters the request. It sends an OPTIONS request instead of a GET request, and it also no longer redirects. This will happen when you send a crossdomain request. I.e., the url does not point to the same domain as where this script is been served from. This namely violat...
jQuery AJAX Request 302 Redirect - What callbacks are available? I'm working with an older system that is using jQuery 1.2.6. I am sending an AJAX Request via the jQuery.ajax function. The URL that it is hitting is sending a 302 HTTP Redirect response and eventually ends up with a 200 HTTP OK response. I have registere...
TITLE: jQuery AJAX Request 302 Redirect - What callbacks are available? QUESTION: I'm working with an older system that is using jQuery 1.2.6. I am sending an AJAX Request via the jQuery.ajax function. The URL that it is hitting is sending a 302 HTTP Redirect response and eventually ends up with a 200 HTTP OK response...
[ "jquery", "redirect", "jquery-callback" ]
5
2
10,729
2
0
2011-06-06T15:19:35.430000
2011-06-06T19:17:08.547000
6,254,220
6,254,339
What is the correct usage of DataContext.Refresh()?
I have a LinqToSql object in memory, whose field values on the database are expected to change during the lifetime of the object. So periodically I need to check if everything is still in sync. I was expecting to be able to do this like so: myDataContext.Refresh(RefreshMode.KeepCurrentValues, myObj); but unfortunately ...
If you want your refreshed object's current values to match what's currently in the database you'll need to use RefreshMode.OverwriteCurrentValues mode instead.
What is the correct usage of DataContext.Refresh()? I have a LinqToSql object in memory, whose field values on the database are expected to change during the lifetime of the object. So periodically I need to check if everything is still in sync. I was expecting to be able to do this like so: myDataContext.Refresh(Refre...
TITLE: What is the correct usage of DataContext.Refresh()? QUESTION: I have a LinqToSql object in memory, whose field values on the database are expected to change during the lifetime of the object. So periodically I need to check if everything is still in sync. I was expecting to be able to do this like so: myDataCon...
[ "c#", "linq", "linq-to-sql" ]
9
13
10,865
2
0
2011-06-06T15:19:36.603000
2011-06-06T15:29:08.877000
6,254,230
6,259,597
Data via jQuery AJAX to Pyramid backend woes
So, I'm trying to post the value of an element with an id of "AltTitle" via AJAX back to a Pyramid backend. With the code below, Python receives a request.param of AlternativeTitle. That's it. No value. I'm stuck. I want to learn how to build a dictionary of AJAX data so I can then pass all values back to Python, but s...
Ok, it seems that the {} are causing the issue. This could be because the jQuery is inside a Jinja2 template, but even adding {% raw %} didn't change the outcome. By changing the script to: data:"AlternativeTitle:" + alttitle + '&' "othervalue" + otherval, I got the serialized version at the server. I am yet to write t...
Data via jQuery AJAX to Pyramid backend woes So, I'm trying to post the value of an element with an id of "AltTitle" via AJAX back to a Pyramid backend. With the code below, Python receives a request.param of AlternativeTitle. That's it. No value. I'm stuck. I want to learn how to build a dictionary of AJAX data so I c...
TITLE: Data via jQuery AJAX to Pyramid backend woes QUESTION: So, I'm trying to post the value of an element with an id of "AltTitle" via AJAX back to a Pyramid backend. With the code below, Python receives a request.param of AlternativeTitle. That's it. No value. I'm stuck. I want to learn how to build a dictionary o...
[ "jquery", "python", "ajax", "pyramid" ]
1
1
1,613
3
0
2011-06-06T15:20:32.497000
2011-06-07T00:42:22.553000
6,254,233
6,254,384
Different Getters and Setters for Different Attributes
in C#, getters and setters can be defined and filled differently for each attribute (property) but in php it looks a common gateway for all the attributes. Is there is a way to define getters and setters for each properties like the code shown below in C#: private string hello; private string world; public string Hell...
You could set a magic method with a switch case, but that won't fix your issue at 100%, because the magic method will not get invoked unless the property does not exist or if its scope is not accessible from the caller: class Foo { private $bar = 'hello'; private $baz = 0; public function __set($var, $value) { switch ...
Different Getters and Setters for Different Attributes in C#, getters and setters can be defined and filled differently for each attribute (property) but in php it looks a common gateway for all the attributes. Is there is a way to define getters and setters for each properties like the code shown below in C#: private ...
TITLE: Different Getters and Setters for Different Attributes QUESTION: in C#, getters and setters can be defined and filled differently for each attribute (property) but in php it looks a common gateway for all the attributes. Is there is a way to define getters and setters for each properties like the code shown bel...
[ "php" ]
2
4
127
1
0
2011-06-06T15:20:44.310000
2011-06-06T15:32:09.860000
6,254,235
6,254,448
Android: custom shaped button
I'm looking the best way to create a group of four buttons. Each button is an image. So, I think about just create a "big" square from four small images-buttons and then rotate them. The question is: how to rotate layout in xml? Is it possible? Is there any better way to create such group of buttons? Thank you!
One way to do this is to create a single ImageButton, then use trigonometry to work out where the user has clicked on the circle, using data from an onClick() event and the centre of the button. This question may help: Get the co-ordinates of a touch event on Android
Android: custom shaped button I'm looking the best way to create a group of four buttons. Each button is an image. So, I think about just create a "big" square from four small images-buttons and then rotate them. The question is: how to rotate layout in xml? Is it possible? Is there any better way to create such group ...
TITLE: Android: custom shaped button QUESTION: I'm looking the best way to create a group of four buttons. Each button is an image. So, I think about just create a "big" square from four small images-buttons and then rotate them. The question is: how to rotate layout in xml? Is it possible? Is there any better way to ...
[ "android", "button" ]
6
7
2,350
2
0
2011-06-06T15:20:45.740000
2011-06-06T15:36:52.930000
6,254,238
6,254,482
Problem with debugging firefox extension
I'm using Venkman javascript debugger for debugging firefox extension. I set a breakpoint, the javascript is running, but it won't stop on my breakpoints, so I can't debug. Could you help me with this problem? What's wrong or advise me some alternative debugger? thank you
I'd definitely recommend using Firebug. Much, much better than Venkman.
Problem with debugging firefox extension I'm using Venkman javascript debugger for debugging firefox extension. I set a breakpoint, the javascript is running, but it won't stop on my breakpoints, so I can't debug. Could you help me with this problem? What's wrong or advise me some alternative debugger? thank you
TITLE: Problem with debugging firefox extension QUESTION: I'm using Venkman javascript debugger for debugging firefox extension. I set a breakpoint, the javascript is running, but it won't stop on my breakpoints, so I can't debug. Could you help me with this problem? What's wrong or advise me some alternative debugger...
[ "javascript", "debugging", "firefox-addon" ]
5
1
1,042
3
0
2011-06-06T15:20:52.030000
2011-06-06T15:40:04.053000
6,254,239
6,254,348
Preg match if not
Is it possible to do a preg_match() on something that shouldn't be a match whilst still returning true? For example, at the moment we have... if (preg_match('#^Mozilla(.*)#', $agent)) { We want to check if the Mozilla string is not in $agent, but still have preg_match return true. We can't change it to: if (!preg_match...
What you want is a negative lookahead, and the syntax is: if (preg_match('#^(?!Mozilla).#', $agent)) { Actually, you can probably get away with just #^(?!Mozilla)# for this. I don't know how PHP will feel about a pattern that's nothing but zero-width tokens, but I've tested it in JavaScript and it works fine. Edit: If ...
Preg match if not Is it possible to do a preg_match() on something that shouldn't be a match whilst still returning true? For example, at the moment we have... if (preg_match('#^Mozilla(.*)#', $agent)) { We want to check if the Mozilla string is not in $agent, but still have preg_match return true. We can't change it t...
TITLE: Preg match if not QUESTION: Is it possible to do a preg_match() on something that shouldn't be a match whilst still returning true? For example, at the moment we have... if (preg_match('#^Mozilla(.*)#', $agent)) { We want to check if the Mozilla string is not in $agent, but still have preg_match return true. We...
[ "php", "regex", "preg-match" ]
10
15
32,892
3
0
2011-06-06T15:20:55.803000
2011-06-06T15:29:47.600000
6,254,242
6,254,295
mysterious linker error
I have written a simple program that use some classes and procol buffers. These classes are to make connecting and sending messages between computers easier. Compilation succeeded. However, linker says: server.o: In function `main': server.cpp:(.text+0x24): undefined reference to `dataExchange::Server::Server(unsigned ...
Forgot to compile and/or link the "connection.cpp", most likely. I atleast hope you have such a file, which implements all the functions? I think you have some fundamental misunderstandings how the splitting in.h and.cpp works. In the.cpp, you do not simple redeclare the classes, this time with the functions defined in...
mysterious linker error I have written a simple program that use some classes and procol buffers. These classes are to make connecting and sending messages between computers easier. Compilation succeeded. However, linker says: server.o: In function `main': server.cpp:(.text+0x24): undefined reference to `dataExchange::...
TITLE: mysterious linker error QUESTION: I have written a simple program that use some classes and procol buffers. These classes are to make connecting and sending messages between computers easier. Compilation succeeded. However, linker says: server.o: In function `main': server.cpp:(.text+0x24): undefined reference ...
[ "c++", "linker", "protocol-buffers" ]
1
4
514
3
0
2011-06-06T15:21:01.133000
2011-06-06T15:25:53.403000
6,254,267
6,254,341
Variable Scope in Blocks
David A Black ( The Well Grounded Rubyist, Chapter 6) presents the following code: def block_local_parameter x = 100 [1,2,3].each do |x| puts "Parameter x is #{x}" x += 10 puts "Reassigned to x in block; it is now #{x}" end puts "The value of outer x is now #{x}" end block_local_parameter Expected output as per the bo...
What you're seeing is the behavior for Ruby 1.8.x. Variable scope for blocks was introduced in 1.9, switch to 1.9.x and you will get the same results as in the book.
Variable Scope in Blocks David A Black ( The Well Grounded Rubyist, Chapter 6) presents the following code: def block_local_parameter x = 100 [1,2,3].each do |x| puts "Parameter x is #{x}" x += 10 puts "Reassigned to x in block; it is now #{x}" end puts "The value of outer x is now #{x}" end block_local_parameter Expe...
TITLE: Variable Scope in Blocks QUESTION: David A Black ( The Well Grounded Rubyist, Chapter 6) presents the following code: def block_local_parameter x = 100 [1,2,3].each do |x| puts "Parameter x is #{x}" x += 10 puts "Reassigned to x in block; it is now #{x}" end puts "The value of outer x is now #{x}" end block_lo...
[ "ruby" ]
3
8
688
1
0
2011-06-06T15:23:29.963000
2011-06-06T15:29:16.583000
6,254,268
6,254,297
Verify What Server Sends HTTP Request
How can I verify that the server sending a HTTP request is who I expect? I want to make a basic code protection system, where the software runs on a permitted webserver and does an Am_I_Allowed? HTTP request to my server. My server would then determine the server sending the request, and check against a whitelist. IP a...
Use SSL client-certificate authentication. See also: Using client certificates with PHP.
Verify What Server Sends HTTP Request How can I verify that the server sending a HTTP request is who I expect? I want to make a basic code protection system, where the software runs on a permitted webserver and does an Am_I_Allowed? HTTP request to my server. My server would then determine the server sending the reques...
TITLE: Verify What Server Sends HTTP Request QUESTION: How can I verify that the server sending a HTTP request is who I expect? I want to make a basic code protection system, where the software runs on a permitted webserver and does an Am_I_Allowed? HTTP request to my server. My server would then determine the server ...
[ "php", "httpwebrequest", "copy-protection" ]
1
1
155
1
0
2011-06-06T15:23:40.047000
2011-06-06T15:25:58.130000
6,254,276
6,254,519
Intercepting Java field and method access, creating proxy objects
I want to create such object in Java that will contain some "dispatcher" function like Object getAttr(String name) that will receive all attribute access attempts - so, if I'll do System.out.print(myObj.hello), actual code will be translated to something like System.out.print(myObj.getAttr('hello')), and if I will do m...
It is not possible using pure Java, except via: Bytecode Manipulation For example using AspectJ. Annotation Processor Using a custom annotation processor, which actually is a kind of bytecode manipulation as well. Projekt Lombok is doing something like this. Synthetic Accessor Method That is, if the code is anyway usin...
Intercepting Java field and method access, creating proxy objects I want to create such object in Java that will contain some "dispatcher" function like Object getAttr(String name) that will receive all attribute access attempts - so, if I'll do System.out.print(myObj.hello), actual code will be translated to something...
TITLE: Intercepting Java field and method access, creating proxy objects QUESTION: I want to create such object in Java that will contain some "dispatcher" function like Object getAttr(String name) that will receive all attribute access attempts - so, if I'll do System.out.print(myObj.hello), actual code will be trans...
[ "java", "attributes", "proxy", "introspection", "intercept" ]
3
3
5,091
5
0
2011-06-06T15:24:35.160000
2011-06-06T15:43:14.540000
6,254,281
6,254,402
Initializing another class's instance variable and memory management
Hey all, this is something I've wondered about for a while and never really figured out. If I allocate and initialize another class's instance variable/property (example below), am i responsible for releasing it? In Foo, I have an instance of Bar (called bar) and want to init one of Bar's variables like so: self.bar.va...
Foo is responsible for releasing the UIBarButtonItem it creates because Foo owns it. This can be done simply by sending an autorelease message to the UIBarButtonItem. Otherwise, this will leak. self.bar.variable1 = [[[UIBarButtonItem alloc] initWithCustomView:customView] autorelease]; If Bar needs to keep variable1 aro...
Initializing another class's instance variable and memory management Hey all, this is something I've wondered about for a while and never really figured out. If I allocate and initialize another class's instance variable/property (example below), am i responsible for releasing it? In Foo, I have an instance of Bar (cal...
TITLE: Initializing another class's instance variable and memory management QUESTION: Hey all, this is something I've wondered about for a while and never really figured out. If I allocate and initialize another class's instance variable/property (example below), am i responsible for releasing it? In Foo, I have an in...
[ "iphone", "memory-management" ]
0
4
79
4
0
2011-06-06T15:24:56.550000
2011-06-06T15:33:16.633000
6,254,286
6,254,611
@@ERROR in SQL Server 2005
I have learned to use the SCOPE_IDENTITY() instead of just @@IDENTITY to get the last identity value inserted in a given scope, which can be quite useful in high-concurrency scenarios. Is there any equivalent to that function for the @@ERROR variable? I mean, is there any way to make sure that whenever I write IF (@@ER...
From Books Online: @@ERROR only returns error information immediately after the Transact-SQL statement that generates the error. @@Error is only within the current scope. So it should have the value for whatever sent the proc to the catch block no matter which of several statements was the one that errored.
@@ERROR in SQL Server 2005 I have learned to use the SCOPE_IDENTITY() instead of just @@IDENTITY to get the last identity value inserted in a given scope, which can be quite useful in high-concurrency scenarios. Is there any equivalent to that function for the @@ERROR variable? I mean, is there any way to make sure tha...
TITLE: @@ERROR in SQL Server 2005 QUESTION: I have learned to use the SCOPE_IDENTITY() instead of just @@IDENTITY to get the last identity value inserted in a given scope, which can be quite useful in high-concurrency scenarios. Is there any equivalent to that function for the @@ERROR variable? I mean, is there any wa...
[ "sql-server-2005" ]
3
6
10,917
2
0
2011-06-06T15:25:21.793000
2011-06-06T15:50:09.093000
6,254,288
6,254,309
.NET Resource File in different project: How to modify post build?
I have a ASP.NET website that references another project with contains as resx file. This file is currently set as an "Embedded Resource" and "Do not copy" to the output directory (although I can change these if need be). My question is what do I need to do so that once the website has been deployed my coworkers in the...
You can't. Resx files are compiled into the assembly. Here is some information. http://msdn.microsoft.com/en-us/library/ekyft91f(v=VS.90).aspx
.NET Resource File in different project: How to modify post build? I have a ASP.NET website that references another project with contains as resx file. This file is currently set as an "Embedded Resource" and "Do not copy" to the output directory (although I can change these if need be). My question is what do I need t...
TITLE: .NET Resource File in different project: How to modify post build? QUESTION: I have a ASP.NET website that references another project with contains as resx file. This file is currently set as an "Embedded Resource" and "Do not copy" to the output directory (although I can change these if need be). My question i...
[ "asp.net", "resources", "localization", "internationalization", "resx" ]
0
1
912
1
0
2011-06-06T15:25:29.377000
2011-06-06T15:26:57.893000
6,254,290
6,254,329
Recursive MySql view: is this possible?
I have an table in my MySql database that has the following columns: - id - parent_id - visible Basically if I have a table populated like this: id name parent_id visible ------ --------- -------------- ------- 1 Admin 0 1 2 Review 0 0 3 Archive 2 1 4 Support 0 1 Though the hierarchy is... 1 - Admin 2 - Review 3 - Arch...
You can do this in a normal query using a CASE statement for the visible column: select a.id, a.name, a.parent_id, CASE WHEN a.parent_id = 0 then a.visible else b.visible end as visible from myTable a left join myTable b on a.parent_id = b.id You could also create the view (same code): create view myTableView as select...
Recursive MySql view: is this possible? I have an table in my MySql database that has the following columns: - id - parent_id - visible Basically if I have a table populated like this: id name parent_id visible ------ --------- -------------- ------- 1 Admin 0 1 2 Review 0 0 3 Archive 2 1 4 Support 0 1 Though the hiera...
TITLE: Recursive MySql view: is this possible? QUESTION: I have an table in my MySql database that has the following columns: - id - parent_id - visible Basically if I have a table populated like this: id name parent_id visible ------ --------- -------------- ------- 1 Admin 0 1 2 Review 0 0 3 Archive 2 1 4 Support 0 ...
[ "mysql", "database", "recursion", "view" ]
0
0
1,134
1
0
2011-06-06T15:25:43.210000
2011-06-06T15:28:26.943000
6,254,301
6,254,340
referencing multiple foreign keys php mysql
I'm very new to php/MySQL and I'm having a bit of trouble. Help would be much appreciated. I have 2 tables laid out as such: table team team_id,team_name table schedule game_id,game_time,team1_id,team2_id,location schedule.team1_id and schedule.team2_id are both foreign keys to team.team_id. I'm trying to reference tea...
It's not quite clear on what you would like the results of your query to look like, but I am assuming you would like to get information about both teams involved in each game. To do so, you'll have to join the team table twice: SELECT t1.name, t2.name, s.* FROM schedule AS s INNER JOIN team AS t1 ON t1.team_id = s.team...
referencing multiple foreign keys php mysql I'm very new to php/MySQL and I'm having a bit of trouble. Help would be much appreciated. I have 2 tables laid out as such: table team team_id,team_name table schedule game_id,game_time,team1_id,team2_id,location schedule.team1_id and schedule.team2_id are both foreign keys ...
TITLE: referencing multiple foreign keys php mysql QUESTION: I'm very new to php/MySQL and I'm having a bit of trouble. Help would be much appreciated. I have 2 tables laid out as such: table team team_id,team_name table schedule game_id,game_time,team1_id,team2_id,location schedule.team1_id and schedule.team2_id are ...
[ "php", "mysql", "foreign-keys", "new-operator", "foreign-key-relationship" ]
1
1
556
1
0
2011-06-06T15:26:19.653000
2011-06-06T15:29:09.127000
6,254,303
6,255,224
Android: programmatically select Gallary image
I have a Gallery view in my application which is working fine. When clicking on a Gallery item, I'm displaying the full image in an ImageView. When the activity is first loaded, I want to display the first image in the full image's ImageView programmatically, so that the user doesn't have to click the first item in the...
You can use directly imageView.setImageBitmap(pics.get(0).getImageUri());
Android: programmatically select Gallary image I have a Gallery view in my application which is working fine. When clicking on a Gallery item, I'm displaying the full image in an ImageView. When the activity is first loaded, I want to display the first image in the full image's ImageView programmatically, so that the u...
TITLE: Android: programmatically select Gallary image QUESTION: I have a Gallery view in my application which is working fine. When clicking on a Gallery item, I'm displaying the full image in an ImageView. When the activity is first loaded, I want to display the first image in the full image's ImageView programmatica...
[ "android", "image-gallery" ]
0
0
3,189
2
0
2011-06-06T15:26:36.303000
2011-06-06T16:40:28.207000
6,254,305
6,254,375
Any way to set a horizontally repeated background image to position: fixed?
I have a menu at the top of the page which is fixed in place using position: fixed. Our background creates a thin horizontal line that is just underneath the menu. Currently, as the page content is scrolled the background scrolls with it. As a result, the line moves up with the content. I have looked for a way to fix t...
The following line will repeat your image horizontally, 100px from the top of the container:.backg { background: url(../images/background.gif) 0 100px repeat-x!important;
Any way to set a horizontally repeated background image to position: fixed? I have a menu at the top of the page which is fixed in place using position: fixed. Our background creates a thin horizontal line that is just underneath the menu. Currently, as the page content is scrolled the background scrolls with it. As a ...
TITLE: Any way to set a horizontally repeated background image to position: fixed? QUESTION: I have a menu at the top of the page which is fixed in place using position: fixed. Our background creates a thin horizontal line that is just underneath the menu. Currently, as the page content is scrolled the background scro...
[ "css" ]
0
1
182
1
0
2011-06-06T15:26:39.017000
2011-06-06T15:31:37.517000
6,254,307
6,254,440
Create a map of pointers to objects in a list?
In trying to patch memory leaks among other things in a side project I've totally confused myself with pointers and lists and maps and memory, etc. I want to create a list of objects to use throughout the programs life. But I also want to use a map to quickly access individual objects from that list through their uniqu...
I would alter this a little bit, and use something like a std::shared_ptr in both your list and your map. You can, for the map, use either an int, or possibly a std::string for the key-type, and then for the value-type, use the std::shared_ptr So your code would look more like: using namespace std; list > mylist; map ...
Create a map of pointers to objects in a list? In trying to patch memory leaks among other things in a side project I've totally confused myself with pointers and lists and maps and memory, etc. I want to create a list of objects to use throughout the programs life. But I also want to use a map to quickly access indivi...
TITLE: Create a map of pointers to objects in a list? QUESTION: In trying to patch memory leaks among other things in a side project I've totally confused myself with pointers and lists and maps and memory, etc. I want to create a list of objects to use throughout the programs life. But I also want to use a map to qui...
[ "c++", "list", "pointers", "object", "dictionary" ]
0
3
2,904
2
0
2011-06-06T15:26:45.773000
2011-06-06T15:36:05.803000
6,254,308
6,254,356
Windows Forms switch between Panels
I'm writing a program that has two main functions. Each of the functions will have a different user interface, on a separate Panel, but only one will be visible at a time. But, how do I switch between them?
Look at the visible property of the Panel(s) Panel1.Visible = True Panel2.Visible = False
Windows Forms switch between Panels I'm writing a program that has two main functions. Each of the functions will have a different user interface, on a separate Panel, but only one will be visible at a time. But, how do I switch between them?
TITLE: Windows Forms switch between Panels QUESTION: I'm writing a program that has two main functions. Each of the functions will have a different user interface, on a separate Panel, but only one will be visible at a time. But, how do I switch between them? ANSWER: Look at the visible property of the Panel(s) Panel...
[ "winforms", "panel" ]
2
3
2,345
2
0
2011-06-06T15:26:54.320000
2011-06-06T15:30:20.357000
6,254,312
6,280,167
how to get a small portion of an oracle polygon collection
I've a SDO_GEOMETRY column containing quite large multi polygons, defined like this: INSERT INTO t1 (i, d, g) VALUES ( 25, 'Multipolygon - multi-touch', sdo_geometry (2007, null, null, sdo_elem_info_array (1,1003,1, 17,1003,1), sdo_ordinate_array (50,95, 55,95, 53,96, 55,97, 53,98, 55,99, 50,99, 50,95, 55,100, 55,95, 6...
A first attempt at brute force solution might look something like this: CREATE OR REPLACE FUNCTION FILTER_MULTI_POLYGONS ( udtGeometry IN SDO_GEOMETRY, udtMask IN SDO_GEOMETRY, dTolerance IN NUMBER ) RETURN SDO_GEOMETRY AS iElements INTEGER; udtElement SDO_GEOMETRY; udtResult SDO_GEOMETRY:= NULL; iCount INTEGER; BEGIN ...
how to get a small portion of an oracle polygon collection I've a SDO_GEOMETRY column containing quite large multi polygons, defined like this: INSERT INTO t1 (i, d, g) VALUES ( 25, 'Multipolygon - multi-touch', sdo_geometry (2007, null, null, sdo_elem_info_array (1,1003,1, 17,1003,1), sdo_ordinate_array (50,95, 55,95,...
TITLE: how to get a small portion of an oracle polygon collection QUESTION: I've a SDO_GEOMETRY column containing quite large multi polygons, defined like this: INSERT INTO t1 (i, d, g) VALUES ( 25, 'Multipolygon - multi-touch', sdo_geometry (2007, null, null, sdo_elem_info_array (1,1003,1, 17,1003,1), sdo_ordinate_ar...
[ "sql", "oracle", "polygon", "spatial", "oracle-xe" ]
2
4
1,969
1
0
2011-06-06T15:27:08.923000
2011-06-08T14:16:05.740000
6,254,315
6,254,383
threads behaviour on multiple locks of the same mutex
If I lock the same mutex in two different places in my function, and a context switch occurs when one thread is in one of them, and the second thread gets to the other one, will it be blocked? I'll try to give a simple example of what I mean, maybe it will be clearer. Say I have the following code in a file test.c int ...
The short answer is "yes". The pthread_mutex_lock documentation makes this pretty clear: The mutex object referenced by mutex shall be locked by calling pthread_mutex_lock(). If the mutex is already locked, the calling thread shall block until the mutex becomes available. This operation shall return with the mutex obje...
threads behaviour on multiple locks of the same mutex If I lock the same mutex in two different places in my function, and a context switch occurs when one thread is in one of them, and the second thread gets to the other one, will it be blocked? I'll try to give a simple example of what I mean, maybe it will be cleare...
TITLE: threads behaviour on multiple locks of the same mutex QUESTION: If I lock the same mutex in two different places in my function, and a context switch occurs when one thread is in one of them, and the second thread gets to the other one, will it be blocked? I'll try to give a simple example of what I mean, maybe...
[ "c", "pthreads", "mutex" ]
1
5
8,721
5
0
2011-06-06T15:27:28.703000
2011-06-06T15:32:08.767000
6,254,326
6,254,828
drupal fivestar rating
I want some suggestion regarding the usage of fivestar rating module in drupal. The requirement is like this: A customer can rate a manufacturer according to service, quality of work, overall score etc. But I am not sure as to how can I integrate this functionality using fivestar module? any ideas?! EDIT - 1 What I mea...
Assuming "manufacturer" is a content type or a user a quick and simple way can be seen below: Create a new content type called something like "review" or manufacturer review", etc Add a node reference/user reference field to the content type (depending on the manufacturer's type) so that customers can link their review...
drupal fivestar rating I want some suggestion regarding the usage of fivestar rating module in drupal. The requirement is like this: A customer can rate a manufacturer according to service, quality of work, overall score etc. But I am not sure as to how can I integrate this functionality using fivestar module? any idea...
TITLE: drupal fivestar rating QUESTION: I want some suggestion regarding the usage of fivestar rating module in drupal. The requirement is like this: A customer can rate a manufacturer according to service, quality of work, overall score etc. But I am not sure as to how can I integrate this functionality using fivesta...
[ "php", "drupal", "drupal-modules", "rating", "fivestar" ]
0
1
419
1
0
2011-06-06T15:28:15.893000
2011-06-06T16:06:07.623000
6,254,337
6,265,854
How to find all prolog rules in database
Suppose I have a facts db filled with at least: fact1(A):-!, A=ok. fact2(B):-!, B=ok. How can I enumerate through all the facts in this db? Ideally I'd have a predicate that I could use:?- all_rules( Head:- Tail). Head=fact1(_G100), Tail=(!, _G100=ok); Head=fact2(_G101), Tail=(!, _G101=ok)....followed by all other pred...
It depends on the precise Prolog system you are using. As long, as you only want to look at the definitions, listing/0 works in many systems. But listing/0 only prints a text. clause/2 often works only for predicates declared dynamically.
How to find all prolog rules in database Suppose I have a facts db filled with at least: fact1(A):-!, A=ok. fact2(B):-!, B=ok. How can I enumerate through all the facts in this db? Ideally I'd have a predicate that I could use:?- all_rules( Head:- Tail). Head=fact1(_G100), Tail=(!, _G100=ok); Head=fact2(_G101), Tail=(!...
TITLE: How to find all prolog rules in database QUESTION: Suppose I have a facts db filled with at least: fact1(A):-!, A=ok. fact2(B):-!, B=ok. How can I enumerate through all the facts in this db? Ideally I'd have a predicate that I could use:?- all_rules( Head:- Tail). Head=fact1(_G100), Tail=(!, _G100=ok); Head=fac...
[ "prolog" ]
8
7
2,192
2
0
2011-06-06T15:29:06.563000
2011-06-07T13:24:09.940000
6,254,342
6,254,561
SimpleButtons display but are not active on the stage
I wrote a class called ButtonTile to extend the SimpleButton class. I then create an array of ButtonTile objects and add them to my stage in a grid formation. When I run the code all of the ButtonTile objects appear on the stage, but they are not clickable and their color does not change for their over and down states....
I believe you're just missing the hitTestState property in your ButtonTile class: this.hitTestState = TileColor(0);
SimpleButtons display but are not active on the stage I wrote a class called ButtonTile to extend the SimpleButton class. I then create an array of ButtonTile objects and add them to my stage in a grid formation. When I run the code all of the ButtonTile objects appear on the stage, but they are not clickable and their...
TITLE: SimpleButtons display but are not active on the stage QUESTION: I wrote a class called ButtonTile to extend the SimpleButton class. I then create an array of ButtonTile objects and add them to my stage in a grid formation. When I run the code all of the ButtonTile objects appear on the stage, but they are not c...
[ "flash", "actionscript-3", "events", "actionscript", "button" ]
1
1
103
1
0
2011-06-06T15:29:26.397000
2011-06-06T15:46:23.823000
6,254,351
6,254,581
Efficient Database interaction with a tracker/persister
Let's say I have a class method named ->saveAll(). This class tracks the objects that's to be put into the database. (Like what doctrine do) What's the efficient way to save those objects? This is what I'm thinking right now (I'm going to be using MySQL as an example): Open a connection to MySQL. Perform a loop on all ...
If your table has a primary key or unique index, you can use a REPLACE statement with all your data at once: REPLACE INTO foo (id, bar) VALUES (NULL, 'baz'), (1, 'hello'); The row will be inserted if it does not exist or if the primary key/unique index is not specified. If the primary key or unique index is found, it w...
Efficient Database interaction with a tracker/persister Let's say I have a class method named ->saveAll(). This class tracks the objects that's to be put into the database. (Like what doctrine do) What's the efficient way to save those objects? This is what I'm thinking right now (I'm going to be using MySQL as an exam...
TITLE: Efficient Database interaction with a tracker/persister QUESTION: Let's say I have a class method named ->saveAll(). This class tracks the objects that's to be put into the database. (Like what doctrine do) What's the efficient way to save those objects? This is what I'm thinking right now (I'm going to be usin...
[ "php", "mysql", "database", "model-view-controller" ]
1
1
119
1
0
2011-06-06T15:30:03.183000
2011-06-06T15:48:02.870000
6,254,361
6,254,461
dll needed at runtime if lib included?
I want to create a.dll (in C++) that uses RAPI. For this I create the visual studio project and then I set the additional include directories to the place where I have "rapi2.h" needed, and also the additional link directories to the place where rapi.lib is located. Then I write another application using my created.dll...
You need to understand the difference between dynamic linking and static linking. In your case, the lib is an import library only and does not contain actual executable code. That is dynamically linked at runtime.
dll needed at runtime if lib included? I want to create a.dll (in C++) that uses RAPI. For this I create the visual studio project and then I set the additional include directories to the place where I have "rapi2.h" needed, and also the additional link directories to the place where rapi.lib is located. Then I write a...
TITLE: dll needed at runtime if lib included? QUESTION: I want to create a.dll (in C++) that uses RAPI. For this I create the visual studio project and then I set the additional include directories to the place where I have "rapi2.h" needed, and also the additional link directories to the place where rapi.lib is locat...
[ "c++", "dll", "linker" ]
1
2
720
1
0
2011-06-06T15:30:32.793000
2011-06-06T15:37:39.353000
6,254,363
6,254,506
Change SQL table/column names in query using c#
I am looking to provide a Web API similar to Facebook's FQL interface. https://developers.facebook.com/docs/reference/fql/ My idea is to create a mapping of real SQL tables to fake ones, with nice friendly names etc, and then apply a condition to the query submitted to restrict access where needed. My problem comes in ...
You might want to look into creating your own Abstract Syntax Tree which you use to interpret the request sent to you. If you're able to build a complete syntax tree with this (see what expression trees can do for LINQ) you must be able to build something that translates your AST to the FQL you need. There's a lot to f...
Change SQL table/column names in query using c# I am looking to provide a Web API similar to Facebook's FQL interface. https://developers.facebook.com/docs/reference/fql/ My idea is to create a mapping of real SQL tables to fake ones, with nice friendly names etc, and then apply a condition to the query submitted to re...
TITLE: Change SQL table/column names in query using c# QUESTION: I am looking to provide a Web API similar to Facebook's FQL interface. https://developers.facebook.com/docs/reference/fql/ My idea is to create a mapping of real SQL tables to fake ones, with nice friendly names etc, and then apply a condition to the que...
[ "c#", "sql", "parsing", "object", "graph" ]
0
1
1,120
2
0
2011-06-06T15:30:35.197000
2011-06-06T15:41:56.560000
6,254,368
6,254,803
The supplied DisplayObject must be a child of the caller?
I having problems setting the child index of a sprite... It works perfectly on the first run of the program, but fails on the second time around. For context this function is in a class which accepts an array of sprites and displays them. My problem is with setChildIndex(_selected as DisplayObject, numChildren-1); priv...
The problem was where I had forgot to remove the previous Event Listeners from the objects. With the following code everything works correctly again. addEventListener(Event.REMOVED_FROM_STAGE, removed); private function removed(e:Event):void { for (var i:uint; i < _objectsArray.length; i ++) { var object:Sprite = _obje...
The supplied DisplayObject must be a child of the caller? I having problems setting the child index of a sprite... It works perfectly on the first run of the program, but fails on the second time around. For context this function is in a class which accepts an array of sprites and displays them. My problem is with setC...
TITLE: The supplied DisplayObject must be a child of the caller? QUESTION: I having problems setting the child index of a sprite... It works perfectly on the first run of the program, but fails on the second time around. For context this function is in a class which accepts an array of sprites and displays them. My pr...
[ "actionscript-3", "indexing", "stack" ]
0
0
1,756
1
0
2011-06-06T15:30:51.123000
2011-06-06T16:03:47.563000
6,254,371
6,260,309
Cannot call method 'substring' of undefined
Here is my code: Ext.define('Ext.app.Portal', { extend: 'Ext.container.Viewport', uses: ['Ext.app.PortalPanel', 'Ext.app.PortalColumn', 'Ext.app.GridPortlet', 'Ext.app.ChartPortlet'], getTools: function () { return [{ xtype: 'tool', type: 'gear', handler: function (e, target, panelHeader, tool) { var portlet = panelH...
first... i tried to copypaste your code, and replace it into portal sample,... i didn't get your error, there is no substring error, but i got error in tabpanel part.. i think, the error is because uses config (this because substrin, can be found in classes.js).. in portal sample, they use Ext.app.PortalPanel, Ext.app....
Cannot call method 'substring' of undefined Here is my code: Ext.define('Ext.app.Portal', { extend: 'Ext.container.Viewport', uses: ['Ext.app.PortalPanel', 'Ext.app.PortalColumn', 'Ext.app.GridPortlet', 'Ext.app.ChartPortlet'], getTools: function () { return [{ xtype: 'tool', type: 'gear', handler: function (e, targe...
TITLE: Cannot call method 'substring' of undefined QUESTION: Here is my code: Ext.define('Ext.app.Portal', { extend: 'Ext.container.Viewport', uses: ['Ext.app.PortalPanel', 'Ext.app.PortalColumn', 'Ext.app.GridPortlet', 'Ext.app.ChartPortlet'], getTools: function () { return [{ xtype: 'tool', type: 'gear', handler: ...
[ "extjs", "tabs", "portal", "extjs4" ]
1
3
15,559
3
0
2011-06-06T15:31:16.567000
2011-06-07T03:23:22.053000
6,254,379
6,254,435
Calling a javascript function after a server call in asp.net web forms
Is there a way in web forms to call a javasctipt function after making a server call for example function showAlert(){ alert("hello"); } In MVC I can say OnSuccess = "showAlert()" is there a way to do this in webforms? UPDATE I ended up using ScriptManager instead of Page.ClientScript because it didn't work with update...
In the callJavaSctipt_click event in the code behind, do the following: Page.RegisterClientScriptBlock("MyScript"," ");
Calling a javascript function after a server call in asp.net web forms Is there a way in web forms to call a javasctipt function after making a server call for example function showAlert(){ alert("hello"); } In MVC I can say OnSuccess = "showAlert()" is there a way to do this in webforms? UPDATE I ended up using Script...
TITLE: Calling a javascript function after a server call in asp.net web forms QUESTION: Is there a way in web forms to call a javasctipt function after making a server call for example function showAlert(){ alert("hello"); } In MVC I can say OnSuccess = "showAlert()" is there a way to do this in webforms? UPDATE I end...
[ "javascript", "asp.net" ]
0
0
3,861
2
0
2011-06-06T15:31:44.930000
2011-06-06T15:35:51.087000
6,254,381
6,254,501
System.Runtime.InteropServices.COMException
I get the following error: Unable to create instance of class TestProject.TestClass. Error: System.Runtime.InteropServices.COMException: 'D:\Automation\TestProject\OBJECT_DEFINITIONS.XLS' could not be found. Check the spelling of the file name, and verify that the file location is correct. If you are trying to open the...
And of course you need to assing path to public string sobjfile. Application doesn't know where to search your file. EDIT: using System.Windows.Forms; using Excel = Microsoft.Office.Interop.Excel; namespace WindowsApplication1 { public partial class Form1: Form { public Form1() { InitializeComponent(); } private void...
System.Runtime.InteropServices.COMException I get the following error: Unable to create instance of class TestProject.TestClass. Error: System.Runtime.InteropServices.COMException: 'D:\Automation\TestProject\OBJECT_DEFINITIONS.XLS' could not be found. Check the spelling of the file name, and verify that the file locati...
TITLE: System.Runtime.InteropServices.COMException QUESTION: I get the following error: Unable to create instance of class TestProject.TestClass. Error: System.Runtime.InteropServices.COMException: 'D:\Automation\TestProject\OBJECT_DEFINITIONS.XLS' could not be found. Check the spelling of the file name, and verify th...
[ "c#", "excel", "comexception", "vba" ]
0
1
7,210
2
0
2011-06-06T15:31:51.683000
2011-06-06T15:41:37.907000
6,254,389
6,254,414
Linq query to get items out of set of sets
So, class A contains list of class B objects. I have a list of class A objects. I would like to get list of all distinct class B objects from all class A objects in that listOfAObjects - in one query. Currently I'm getting set of sets, add them individually with AddRange to helper list, and then call distinct on that l...
You'll need to use a combination of SelectMany (to aggregate all of the Class B lists into a single collection) and then Distinct (to weed out the duplicates): listOfClassA.SelectMany(a => a.ListOfClassB).Distinct();
Linq query to get items out of set of sets So, class A contains list of class B objects. I have a list of class A objects. I would like to get list of all distinct class B objects from all class A objects in that listOfAObjects - in one query. Currently I'm getting set of sets, add them individually with AddRange to he...
TITLE: Linq query to get items out of set of sets QUESTION: So, class A contains list of class B objects. I have a list of class A objects. I would like to get list of all distinct class B objects from all class A objects in that listOfAObjects - in one query. Currently I'm getting set of sets, add them individually w...
[ "c#", "linq-to-entities" ]
0
4
97
1
0
2011-06-06T15:32:30.960000
2011-06-06T15:34:11.133000
6,254,394
6,254,428
ListBox GroupStyle HeaderTemplate with a color
I would like to create a HeaderTemplate for GroupStyle ( ListBox ) which contains a rectangle with a color and the name of a color. I have a list of employees. Each employee has a color. I used a ListBox and a CollectionViewSource with a specific converter to group employees by their own color. It works great! But at t...
The Name of the group will be the color, if you bind it to the Color property of a SolidColorBrush it should be converted automatically.
ListBox GroupStyle HeaderTemplate with a color I would like to create a HeaderTemplate for GroupStyle ( ListBox ) which contains a rectangle with a color and the name of a color. I have a list of employees. Each employee has a color. I used a ListBox and a CollectionViewSource with a specific converter to group employe...
TITLE: ListBox GroupStyle HeaderTemplate with a color QUESTION: I would like to create a HeaderTemplate for GroupStyle ( ListBox ) which contains a rectangle with a color and the name of a color. I have a list of employees. Each employee has a color. I used a ListBox and a CollectionViewSource with a specific converte...
[ "wpf", "silverlight", "header", "listbox", "groupstyle" ]
1
1
856
1
0
2011-06-06T15:32:52.977000
2011-06-06T15:35:29.737000
6,254,404
6,254,436
why this list doesn't have a bullet
i'm using a list inside a dialog with jquery and my problem it's that bullets of each element doesn't appear this is the code associate. http://jsfiddle.net/9J3gZ/1/ I don't see any problem with the code that's why i have the question.
Because of normalize.css (of js Fiddle) (line 16); ol, ul { list-style: none outside none; } See: http://jsfiddle.net/9J3gZ/2/ (without the normalize css checkbox)
why this list doesn't have a bullet i'm using a list inside a dialog with jquery and my problem it's that bullets of each element doesn't appear this is the code associate. http://jsfiddle.net/9J3gZ/1/ I don't see any problem with the code that's why i have the question.
TITLE: why this list doesn't have a bullet QUESTION: i'm using a list inside a dialog with jquery and my problem it's that bullets of each element doesn't appear this is the code associate. http://jsfiddle.net/9J3gZ/1/ I don't see any problem with the code that's why i have the question. ANSWER: Because of normalize....
[ "jquery", "jquery-ui" ]
1
5
693
3
0
2011-06-06T15:33:29.343000
2011-06-06T15:36:02.397000
6,254,409
6,254,456
Zip a memory stream but keep as stream (don't create file)?
For my application, I need to upload a zipped tif image. The caveat is that the tif is downloaded from a webservice to a MemoryStream and I'm trying to avoid writing to the harddrive. What's the best way to zip this MemoryStream and copy the resulting data to another stream (Specifically, a HttpWebRequest 's request st...
Have you taken a look at the GZipStream? This should be able to deal with most of your problems. See: http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx
Zip a memory stream but keep as stream (don't create file)? For my application, I need to upload a zipped tif image. The caveat is that the tif is downloaded from a webservice to a MemoryStream and I'm trying to avoid writing to the harddrive. What's the best way to zip this MemoryStream and copy the resulting data to ...
TITLE: Zip a memory stream but keep as stream (don't create file)? QUESTION: For my application, I need to upload a zipped tif image. The caveat is that the tif is downloaded from a webservice to a MemoryStream and I'm trying to avoid writing to the harddrive. What's the best way to zip this MemoryStream and copy the ...
[ "c#", "compression" ]
2
1
15,511
3
0
2011-06-06T15:33:42.200000
2011-06-06T15:37:08.730000
6,254,412
6,254,478
cssText or individual stylename?
When we are applying a lot of style changes using JavaScript to a single element, phpied & Writing Efficient JavaScript (slide 87) suggests: instead of applying styles one by one using style.stylename, apply everything in one go using cssText or changing classname as it'll reduce reflows/repaints Which is better when t...
I should use the individual stylename in your case, because you are going to change only one style.:)
cssText or individual stylename? When we are applying a lot of style changes using JavaScript to a single element, phpied & Writing Efficient JavaScript (slide 87) suggests: instead of applying styles one by one using style.stylename, apply everything in one go using cssText or changing classname as it'll reduce reflow...
TITLE: cssText or individual stylename? QUESTION: When we are applying a lot of style changes using JavaScript to a single element, phpied & Writing Efficient JavaScript (slide 87) suggests: instead of applying styles one by one using style.stylename, apply everything in one go using cssText or changing classname as i...
[ "javascript", "css", "optimization", "repaint", "reflow" ]
8
1
2,255
1
0
2011-06-06T15:33:56.563000
2011-06-06T15:39:34.057000
6,254,416
6,254,452
How do I extract location from Windows using C#?
Google Maps seems to be able to do this quite well, presumably leveraging my ISP. How is this done? Is it possible to tap Google Maps or some other database to derive where the user is? (Within maybe 1 km?)
This is done through using a GEOIP database. A company named Maxmind is in this business. There are paid databases and free databases (the latter less accurate, of course). However, I believe free databases could not be used for your "1km accuracy".
How do I extract location from Windows using C#? Google Maps seems to be able to do this quite well, presumably leveraging my ISP. How is this done? Is it possible to tap Google Maps or some other database to derive where the user is? (Within maybe 1 km?)
TITLE: How do I extract location from Windows using C#? QUESTION: Google Maps seems to be able to do this quite well, presumably leveraging my ISP. How is this done? Is it possible to tap Google Maps or some other database to derive where the user is? (Within maybe 1 km?) ANSWER: This is done through using a GEOIP da...
[ "c#", ".net", "geolocation", "location", "ip-geolocation" ]
1
2
371
3
0
2011-06-06T15:34:37.457000
2011-06-06T15:36:59.267000
6,254,419
6,254,508
Multiple Activities in TabActivity
I have a TabActivity that has three tabs. The fist tab is the problem. The first tab loads an ActivityGroup. OnCreate it loads a default content view. Later on a certain event, we add a different content view. This works fine, but my problem is when someone presses the back button on the phone after the second content ...
I had to override the Back button myself. See below for code that does this for you. Basically, this overrides the default implementation of onKeyDown that is in the Android Activity class. The keycode for the back button is KeyEvent.KEYCODE_BACK and this code catches that. For anything else, it will just run the defau...
Multiple Activities in TabActivity I have a TabActivity that has three tabs. The fist tab is the problem. The first tab loads an ActivityGroup. OnCreate it loads a default content view. Later on a certain event, we add a different content view. This works fine, but my problem is when someone presses the back button on ...
TITLE: Multiple Activities in TabActivity QUESTION: I have a TabActivity that has three tabs. The fist tab is the problem. The first tab loads an ActivityGroup. OnCreate it loads a default content view. Later on a certain event, we add a different content view. This works fine, but my problem is when someone presses t...
[ "android" ]
1
2
866
1
0
2011-06-06T15:34:47.053000
2011-06-06T15:42:07.060000
6,254,441
6,255,390
WPF ObservableCollection<T> vs BindingList<T>
In my WPF app I have a XamDataGrid. The grid is bound to an ObservableCollection. I need to allow users to insert new rows through the grid but it turns out that in order for the "Add New Row" row to be available, the xamDataGrid's source needs to implement IBindingList. ObservableCollection does not implement that int...
The IBindingList interface and BindingList class are defined in the System.ComponentModel namespace, and so are not strictly Windows Forms related. Have you checked if xamGrid supports binding to a ICollectionView source? If so, you could expose your data sources using this interface and back it using a BindingListColl...
WPF ObservableCollection<T> vs BindingList<T> In my WPF app I have a XamDataGrid. The grid is bound to an ObservableCollection. I need to allow users to insert new rows through the grid but it turns out that in order for the "Add New Row" row to be available, the xamDataGrid's source needs to implement IBindingList. Ob...
TITLE: WPF ObservableCollection<T> vs BindingList<T> QUESTION: In my WPF app I have a XamDataGrid. The grid is bound to an ObservableCollection. I need to allow users to insert new rows through the grid but it turns out that in order for the "Add New Row" row to be available, the xamDataGrid's source needs to implemen...
[ "c#", "wpf", "data-binding", "observablecollection", "infragistics" ]
12
5
11,502
5
0
2011-06-06T15:36:10.433000
2011-06-06T16:54:19.540000