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,247,629
6,248,069
Rails 3: Manipulating devise "resource" in controller?
I'm using devise & devise_invitable in a rails 3 project, and I'm trying to manipulate some of the 'User' object fields in the devise controller. The action is question is this: def update self.resource = resource_class.accept_invitation!(params[resource_name]) resource.first_name = 'Lemmechangethis' if resource.erro...
resource does return a User models instance. So the resource.first_name = 'Lemmechangethis' statement does change your User models instance but it doesnot trigger your User models validations, which is probably why resource.errors always returns an empty array. One way to trigger the User models validation is to call r...
Rails 3: Manipulating devise "resource" in controller? I'm using devise & devise_invitable in a rails 3 project, and I'm trying to manipulate some of the 'User' object fields in the devise controller. The action is question is this: def update self.resource = resource_class.accept_invitation!(params[resource_name]) re...
TITLE: Rails 3: Manipulating devise "resource" in controller? QUESTION: I'm using devise & devise_invitable in a rails 3 project, and I'm trying to manipulate some of the 'User' object fields in the devise controller. The action is question is this: def update self.resource = resource_class.accept_invitation!(params[r...
[ "ruby-on-rails-3", "devise" ]
1
2
3,419
1
0
2011-06-06T03:57:30.290000
2011-06-06T05:22:17.833000
6,247,638
6,247,664
static variable in asp.net web application
I have: MyNameSpace.MyClass1 MyNameSpace.MyClass2 i need to get value from MyClass1.myvar1 from MyClass2. Should I do that with static variable What happens with variable value if it is static in a web application. Im using MyClass1 as: var mClass=new MyNameSpace.MyClass1(), and from that im using mClass. thank you
If the value context is global, than it is ok to use static variable. Remember that if the value is updated, its updated for all users. If the data is different or belong to a user, than never use static, instead instantiate object of MyClass1 inside MyClass2 method. you can use following approach. Declare MyClass1.myv...
static variable in asp.net web application I have: MyNameSpace.MyClass1 MyNameSpace.MyClass2 i need to get value from MyClass1.myvar1 from MyClass2. Should I do that with static variable What happens with variable value if it is static in a web application. Im using MyClass1 as: var mClass=new MyNameSpace.MyClass1(), a...
TITLE: static variable in asp.net web application QUESTION: I have: MyNameSpace.MyClass1 MyNameSpace.MyClass2 i need to get value from MyClass1.myvar1 from MyClass2. Should I do that with static variable What happens with variable value if it is static in a web application. Im using MyClass1 as: var mClass=new MyNameS...
[ "asp.net", "variables", "static" ]
4
2
2,311
4
0
2011-06-06T03:59:44.363000
2011-06-06T04:06:56.610000
6,247,642
6,247,959
Checking conditions and adding items to a data frame
I'm trying to develop a function which will allow me to input new elements to a data frame and then check if they contain certain words. df <- data.frame(keyword=c("He drives a Honda", "He goes to Ohio State"), car=c(1,0), school=c(0,1)) df keyword car school He drives a Honda 1 0 He goes to Ohio State 0 1 In this dat...
I think the easiest way is to use a compound regular expression: library(stringr) car <- c("Honda", "Chevy", "Toyota", "Ford") school <- c("Michigan", "Ohio State", "Missouri") car_match <- str_c(car, collapse = "|") school_match <- str_c(school, collapse = "|") df <- data.frame(keyword=c("He drives a Honda", "He go...
Checking conditions and adding items to a data frame I'm trying to develop a function which will allow me to input new elements to a data frame and then check if they contain certain words. df <- data.frame(keyword=c("He drives a Honda", "He goes to Ohio State"), car=c(1,0), school=c(0,1)) df keyword car school He dri...
TITLE: Checking conditions and adding items to a data frame QUESTION: I'm trying to develop a function which will allow me to input new elements to a data frame and then check if they contain certain words. df <- data.frame(keyword=c("He drives a Honda", "He goes to Ohio State"), car=c(1,0), school=c(0,1)) df keyword...
[ "r", "dataframe" ]
3
10
981
3
0
2011-06-06T04:01:16.647000
2011-06-06T05:04:57.657000
6,247,667
6,247,788
uwsgi + python + nginx + willy nilly file execution
I'm using uwsgi on Nginx to run some Python code. I'd like to bind uwsgi to a directory and make it render any.py file that I call from the server in the browser. I'm thinking like PHP, here (/index.php executes that file, /login.php executes that file). Is this a possibility? Or am I only able to explicitly specify a ...
WSGI is not like PHP. You can't just point uwsgi to a directory with a bunch of.py files. In fact, never, ever make your python modules available in a public directory, accessible from the server. You need to hook uwsgi up to a WSGI application, preferably a framework. Read more about WSGI here. Check out bottle which ...
uwsgi + python + nginx + willy nilly file execution I'm using uwsgi on Nginx to run some Python code. I'd like to bind uwsgi to a directory and make it render any.py file that I call from the server in the browser. I'm thinking like PHP, here (/index.php executes that file, /login.php executes that file). Is this a pos...
TITLE: uwsgi + python + nginx + willy nilly file execution QUESTION: I'm using uwsgi on Nginx to run some Python code. I'd like to bind uwsgi to a directory and make it render any.py file that I call from the server in the browser. I'm thinking like PHP, here (/index.php executes that file, /login.php executes that fi...
[ "python", "nginx", "uwsgi" ]
5
10
2,202
2
0
2011-06-06T04:07:08.290000
2011-06-06T04:35:00.177000
6,247,670
6,253,375
How do I integrate MongoDB with Solr?
I've seen this question before, but it's never received a real answer- so I was wondering.. Can someone point me in the right direction as to how I can integrate mongoDB with Solr? I'm looking for pseudo real-time and eventual consistency. Can anyone that's done this shed some light? I'm also using PHP/Zend with Doctri...
I haven't done any integration, and I'm sure you've already googled, but... http://nosql.mypopescu.com/post/383437318/integrating-mongodb-with-solr http://blog.knuthaugen.no/2010/04/cooking-with-mongodb-and-solr.html The issue you are probably going to run into with a "psuedo real-time" solution, depending on your volu...
How do I integrate MongoDB with Solr? I've seen this question before, but it's never received a real answer- so I was wondering.. Can someone point me in the right direction as to how I can integrate mongoDB with Solr? I'm looking for pseudo real-time and eventual consistency. Can anyone that's done this shed some ligh...
TITLE: How do I integrate MongoDB with Solr? QUESTION: I've seen this question before, but it's never received a real answer- so I was wondering.. Can someone point me in the right direction as to how I can integrate mongoDB with Solr? I'm looking for pseudo real-time and eventual consistency. Can anyone that's done t...
[ "php", "mongodb", "solr" ]
6
7
3,327
1
0
2011-06-06T04:08:19.697000
2011-06-06T14:16:26.950000
6,247,674
6,247,954
return all the array between one hour via php
lets say we do some search useing search api then it retuns something like this in json. 'results' => array 0 => object(stdClass)[9] public 'from_user_id_str' => string '57393273' (length=8) public 'profile_image_url' => string 'http://a1.twimg.com/profile_images/1150792547/49146_1365401218_7951632_q_normal.jpg' (lengt...
So, you're looking to return only those that have created_at within the past hour? I like to use array_filter() when I can. function filterWithinHour($obj) { return (strtotime($obj->created_at) > strtotime('-1 hour')); } $recent = array_filter($results, 'filterWithinHour'); If you ever need need to pass it a certain t...
return all the array between one hour via php lets say we do some search useing search api then it retuns something like this in json. 'results' => array 0 => object(stdClass)[9] public 'from_user_id_str' => string '57393273' (length=8) public 'profile_image_url' => string 'http://a1.twimg.com/profile_images/1150792547...
TITLE: return all the array between one hour via php QUESTION: lets say we do some search useing search api then it retuns something like this in json. 'results' => array 0 => object(stdClass)[9] public 'from_user_id_str' => string '57393273' (length=8) public 'profile_image_url' => string 'http://a1.twimg.com/profile...
[ "php", "json", "search", "twitter" ]
2
2
216
2
0
2011-06-06T04:09:29.663000
2011-06-06T05:04:30.200000
6,247,702
6,247,785
Using HTML5, how do I use contenteditable fields in a form submission?
So I have a bunch of paragraph elements which are dynamically populated from a db. I have made the elements contenteditable. I now want to submit edits back the the db via a standard form submission. Is there a way to post the contenteditable elements back?
You have to use javascript one way or the other, it won't work as a "standard" form element as it would with a textarea or the like. If you like, you could make a hidden textarea within your form, and in the form's onsubmit function copy the innerHTML of the contenteditable to the textarea's value. Alternatively you co...
Using HTML5, how do I use contenteditable fields in a form submission? So I have a bunch of paragraph elements which are dynamically populated from a db. I have made the elements contenteditable. I now want to submit edits back the the db via a standard form submission. Is there a way to post the contenteditable elemen...
TITLE: Using HTML5, how do I use contenteditable fields in a form submission? QUESTION: So I have a bunch of paragraph elements which are dynamically populated from a db. I have made the elements contenteditable. I now want to submit edits back the the db via a standard form submission. Is there a way to post the cont...
[ "html", "contenteditable" ]
50
44
37,254
4
0
2011-06-06T04:17:28.223000
2011-06-06T04:34:49.607000
6,247,703
6,247,950
qt inherited signal won't reach to slot
here's the code of my problem class Base: QThread { Q_OBJECT virtual void run() = 0; signals: void Ping(int); }; class Derived: public Base { void run() { emit Ping(42); } } the signal(42) won't reach/call to slots. what's wrong? thanks in advance.
Did that 100 times, it does work. Are you sure your base class is properly MOC'ed? (i.e. defined in a file contained in HEADERS section of.pro ) Also when connecting your signal, check the return status of QObject::connect (it's a boolean). A good practice is something like that bool r=false; r=QObject::connect(pObj1,S...
qt inherited signal won't reach to slot here's the code of my problem class Base: QThread { Q_OBJECT virtual void run() = 0; signals: void Ping(int); }; class Derived: public Base { void run() { emit Ping(42); } } the signal(42) won't reach/call to slots. what's wrong? thanks in advance.
TITLE: qt inherited signal won't reach to slot QUESTION: here's the code of my problem class Base: QThread { Q_OBJECT virtual void run() = 0; signals: void Ping(int); }; class Derived: public Base { void run() { emit Ping(42); } } the signal(42) won't reach/call to slots. what's wrong? thanks in advance. ANSWER: Did...
[ "qt", "inheritance", "signals-slots", "multithreading" ]
1
5
2,328
2
0
2011-06-06T04:17:29.570000
2011-06-06T05:04:00.320000
6,247,705
6,247,738
Whats the easy way to build search engine for website in python
I have one website in django, with many content pages. I want to build the search engine so that if i search for keywords then i get the URL of that Page. It can be any library or scripts. My Main rquirements is that i should be able to tweak the script or add my own code so that in future i can build the index accordi...
A pure python search library would be whoosh: http://whoosh.ca/ http://www.arnebrodowski.de/blog/add-full-text-search-to-your-django-project-with-whoosh.html
Whats the easy way to build search engine for website in python I have one website in django, with many content pages. I want to build the search engine so that if i search for keywords then i get the URL of that Page. It can be any library or scripts. My Main rquirements is that i should be able to tweak the script or...
TITLE: Whats the easy way to build search engine for website in python QUESTION: I have one website in django, with many content pages. I want to build the search engine so that if i search for keywords then i get the URL of that Page. It can be any library or scripts. My Main rquirements is that i should be able to t...
[ "python", "linux", "full-text-search" ]
0
1
214
1
0
2011-06-06T04:17:36.303000
2011-06-06T04:24:25.013000
6,247,709
6,247,736
Which web platform would be best to create a web app with an android client
I'm working on an android app which would connect to a web server which would power a social network and data store inside the app. Recently we decided that we would use a landing page and pre-order page to try and try and market our app before we launch. Right now I'm working to create the landing page and I ran into ...
GAE has two big advantages for this case: It's free: for the description of what you want, it does not seem that you'll be over the free quota, at leas at the beginning. You can write it in java, which means reusing a lot of code in the final android app.
Which web platform would be best to create a web app with an android client I'm working on an android app which would connect to a web server which would power a social network and data store inside the app. Recently we decided that we would use a landing page and pre-order page to try and try and market our app before...
TITLE: Which web platform would be best to create a web app with an android client QUESTION: I'm working on an android app which would connect to a web server which would power a social network and data store inside the app. Recently we decided that we would use a landing page and pre-order page to try and try and mar...
[ "android", "web-services" ]
1
0
344
2
0
2011-06-06T04:18:01.940000
2011-06-06T04:23:54.940000
6,247,726
6,247,728
What is the meaning of this code?
Here is the code sample provided in.Net Sdk: Private Sub ReadOrderData(ByVal connectionString As String) Dim queryString As String = _ "SELECT OrderID, CustomerID FROM dbo.Orders;" Using connection As New SqlConnection(connectionString) Dim command As New SqlCommand(queryString, connection) connection.Open() Dim read...
reader(0) refers to the very first field in the retrieved row. However you better reference field by name, OrderID in this case. Take a look at SqlDataReader.Item Property. This is indexed property. You can find some details here.
What is the meaning of this code? Here is the code sample provided in.Net Sdk: Private Sub ReadOrderData(ByVal connectionString As String) Dim queryString As String = _ "SELECT OrderID, CustomerID FROM dbo.Orders;" Using connection As New SqlConnection(connectionString) Dim command As New SqlCommand(queryString, conne...
TITLE: What is the meaning of this code? QUESTION: Here is the code sample provided in.Net Sdk: Private Sub ReadOrderData(ByVal connectionString As String) Dim queryString As String = _ "SELECT OrderID, CustomerID FROM dbo.Orders;" Using connection As New SqlConnection(connectionString) Dim command As New SqlCommand(...
[ ".net", "sql", "vb.net", "ado.net", "indexed-properties" ]
0
5
168
2
0
2011-06-06T04:20:38.760000
2011-06-06T04:21:56.857000
6,247,730
6,255,259
Movement of Objects in a simulation
i am currently making a flash "pond" with fishes in it, and i have the ability to add food pellets onto the pond, how should i make the movement of my fishes to the food x,y location? so it will be smooth, rather than setting the x,y location of my fishes to the x,y location of the food pellets. Also is there a good pl...
This should explain exactly how to move your objects around. Obviously you will need to change the Sprite to whatever class your using for your fish/food/etc. Your fish object will either need a property for speed. such as: public var speed:int = 5; Or you can just define one in your main simulation for all the fish. (...
Movement of Objects in a simulation i am currently making a flash "pond" with fishes in it, and i have the ability to add food pellets onto the pond, how should i make the movement of my fishes to the food x,y location? so it will be smooth, rather than setting the x,y location of my fishes to the x,y location of the f...
TITLE: Movement of Objects in a simulation QUESTION: i am currently making a flash "pond" with fishes in it, and i have the ability to add food pellets onto the pond, how should i make the movement of my fishes to the food x,y location? so it will be smooth, rather than setting the x,y location of my fishes to the x,y...
[ "flash", "actionscript-3", "flash-cs4" ]
0
2
2,407
4
0
2011-06-06T04:22:34.067000
2011-06-06T16:42:55.687000
6,247,732
6,247,774
Need explanation of some Ruby syntax
I am new to ruby on rails, could anybody explain what does the symbol ':' mean, what would be 'validates' and 'create_table'? So much confused... class Post < ActiveRecord::Base validates:name,:presence => true validates:title,:presence => true,:length => {:minimum => 5} end class CreatePosts < ActiveRecord::Migration...
The colon character (: ) is the beginning of a syntax literal for a Ruby "Symbol"::abc.class # => Symbol "abc".to_sym # =>:abc Symbols are like strings but they are "interned", meaning the Ruby interpreter only has a single copy of it in memory despite multiple possible references (whereas there can be many equivalent ...
Need explanation of some Ruby syntax I am new to ruby on rails, could anybody explain what does the symbol ':' mean, what would be 'validates' and 'create_table'? So much confused... class Post < ActiveRecord::Base validates:name,:presence => true validates:title,:presence => true,:length => {:minimum => 5} end class ...
TITLE: Need explanation of some Ruby syntax QUESTION: I am new to ruby on rails, could anybody explain what does the symbol ':' mean, what would be 'validates' and 'create_table'? So much confused... class Post < ActiveRecord::Base validates:name,:presence => true validates:title,:presence => true,:length => {:minimum...
[ "ruby", "symbols" ]
1
6
273
8
0
2011-06-06T04:22:44.017000
2011-06-06T04:33:17.673000
6,247,744
6,247,852
Is there a hardware unit called " 2's complement "?
I understand that in order to do a subtraction you should do a 2's complement transformation to the second number. Is there a dedicated Hardware for that checks the MSB and if it is found to be 1 it does the transformation? Also, Is this system used for subtraction of floating points?
The Two's Complement operation is implemented in most languages with the unary - operator. It is only used with signed integer types. It can be implemented in an ALU as either a distinct negation (e.g. NEG ) instruction or rolled into another operation, for example when you use a subtract (e.g. SUB ) instruction instea...
Is there a hardware unit called " 2's complement "? I understand that in order to do a subtraction you should do a 2's complement transformation to the second number. Is there a dedicated Hardware for that checks the MSB and if it is found to be 1 it does the transformation? Also, Is this system used for subtraction of...
TITLE: Is there a hardware unit called " 2's complement "? QUESTION: I understand that in order to do a subtraction you should do a 2's complement transformation to the second number. Is there a dedicated Hardware for that checks the MSB and if it is found to be 1 it does the transformation? Also, Is this system used ...
[ "hardware", "twos-complement" ]
1
2
1,358
3
0
2011-06-06T04:25:40.173000
2011-06-06T04:46:46.810000
6,247,745
6,248,065
Rails checking to see if record exists when it contains a NULL value?
Using before_create to see if the record exists. Have four variables/columns (alpha, beta, delta, gamma). What to see if the record exists that matches but one or more of the columns is NULL. My problem: If alpha, beta, and delta are none null, but gamma is null, the exists query will never say the record already exist...
To check nil you have to use IS instead of = operator Try following!Model.where("alpha =? AND beta =? AND delta =? AND (gamma =? OR gamma is?)", self.alpha, self.beta, self.delta, self.gamma, nil ).find(:first)
Rails checking to see if record exists when it contains a NULL value? Using before_create to see if the record exists. Have four variables/columns (alpha, beta, delta, gamma). What to see if the record exists that matches but one or more of the columns is NULL. My problem: If alpha, beta, and delta are none null, but g...
TITLE: Rails checking to see if record exists when it contains a NULL value? QUESTION: Using before_create to see if the record exists. Have four variables/columns (alpha, beta, delta, gamma). What to see if the record exists that matches but one or more of the columns is NULL. My problem: If alpha, beta, and delta ar...
[ "ruby-on-rails", "ruby-on-rails-3" ]
0
0
522
1
0
2011-06-06T04:26:11.093000
2011-06-06T05:21:21.957000
6,247,748
6,247,770
Single Line separated records in SQL SERVER Query result
I had a query that returned multiple rows from a table. Then I converted that query to this one:;with mycte as (select s.FirstName + ' ' + s.LastName as Name from ClientStaff cs left outer join Staff s on s.Id = cs.StaffId left outer join GeneralStatus gs on gs.Id = s.StatusId where cs.ClientId = @clientId and gs.Name ...
declare @staff varchar(max);with mycte as ( select distinct s.FirstName + ' ' + s.LastName as Name from ClientStaff cs left outer join Staff s on s.Id = cs.StaffId left outer join GeneralStatus gs on gs.Id = s.StatusId where cs.ClientId = @clientId and gs.Name = 'Active' ) select @staff = isnull(@staff + char(13), '') ...
Single Line separated records in SQL SERVER Query result I had a query that returned multiple rows from a table. Then I converted that query to this one:;with mycte as (select s.FirstName + ' ' + s.LastName as Name from ClientStaff cs left outer join Staff s on s.Id = cs.StaffId left outer join GeneralStatus gs on gs.I...
TITLE: Single Line separated records in SQL SERVER Query result QUESTION: I had a query that returned multiple rows from a table. Then I converted that query to this one:;with mycte as (select s.FirstName + ' ' + s.LastName as Name from ClientStaff cs left outer join Staff s on s.Id = cs.StaffId left outer join Genera...
[ "sql", "sql-server", "t-sql", "csv" ]
2
3
1,353
1
0
2011-06-06T04:27:13.710000
2011-06-06T04:32:47.433000
6,247,751
6,247,850
Python - Tree traversal question
I have a hard time with tree traversal, and so avoid it like the plague... normally. I have a class that's sort-of (slightly simplified version here, but functionally the same) like: class Branch(object): def __init__(self, title, parent=None): self.title = title self.parent = parent I have a dictionary of a bunch of B...
http://en.wikipedia.org/wiki/Depth-first_search http://en.wikipedia.org/wiki/Tree_traversal You traverse as follows in two passes: First pass: Search for the query node with the appropriate key. (This step is unnecessary if you have a hashmap of all the nodes in the entire tree; you have this (good) so this step is not...
Python - Tree traversal question I have a hard time with tree traversal, and so avoid it like the plague... normally. I have a class that's sort-of (slightly simplified version here, but functionally the same) like: class Branch(object): def __init__(self, title, parent=None): self.title = title self.parent = parent I ...
TITLE: Python - Tree traversal question QUESTION: I have a hard time with tree traversal, and so avoid it like the plague... normally. I have a class that's sort-of (slightly simplified version here, but functionally the same) like: class Branch(object): def __init__(self, title, parent=None): self.title = title self....
[ "python", "algorithm", "binary-tree", "tree-traversal" ]
7
6
12,082
1
0
2011-06-06T04:28:08.503000
2011-06-06T04:46:19.583000
6,247,754
6,247,968
AS3: Overriding Proxy getProperty method
I've run into a peculiar problem while trying to make use of the Proxy class and override the getProperty() method. I've attached my example class code below: package { import flash.utils.Proxy; import flash.utils.flash_proxy; public class Thing extends Proxy { // holder object private var _holder:Object; /** * Const...
This is because your class isn't dynamic, just add "dynamic" keyword and all will be good: public dynamic class Thing extends Proxy
AS3: Overriding Proxy getProperty method I've run into a peculiar problem while trying to make use of the Proxy class and override the getProperty() method. I've attached my example class code below: package { import flash.utils.Proxy; import flash.utils.flash_proxy; public class Thing extends Proxy { // holder object...
TITLE: AS3: Overriding Proxy getProperty method QUESTION: I've run into a peculiar problem while trying to make use of the Proxy class and override the getProperty() method. I've attached my example class code below: package { import flash.utils.Proxy; import flash.utils.flash_proxy; public class Thing extends Proxy ...
[ "flash", "actionscript-3", "proxy", "getter-setter" ]
2
3
1,958
1
0
2011-06-06T04:28:53.057000
2011-06-06T05:06:31.130000
6,247,756
6,247,762
Regex: finding a string with an undetermined amount of words
I have a tag that is like tag="text textwithdot. text text" followed by a further tag that would resemble tag="text text text" I wanted to use the following regular expression tag="\w+" but that only finds one word, how do I find the whole string within the quotes, what wildcard does that?
This should work for you: tag="([^"]*)" That basically means tag=" followed by zero or more characters that are not a double quote, followed by a double quote. BTW: I'm assuming that there is no such thing as a tag that contains the double quote character. If there is such a thing, it would need some escaping rule appl...
Regex: finding a string with an undetermined amount of words I have a tag that is like tag="text textwithdot. text text" followed by a further tag that would resemble tag="text text text" I wanted to use the following regular expression tag="\w+" but that only finds one word, how do I find the whole string within the q...
TITLE: Regex: finding a string with an undetermined amount of words QUESTION: I have a tag that is like tag="text textwithdot. text text" followed by a further tag that would resemble tag="text text text" I wanted to use the following regular expression tag="\w+" but that only finds one word, how do I find the whole s...
[ "regex", "string", "tags", "grep" ]
1
1
100
3
0
2011-06-06T04:29:01.180000
2011-06-06T04:31:16.113000
6,247,759
6,247,978
Issue with setting icon image in cell
I am trying to create a 'blank_star icon' in every cell of a table view, the star should become a 'solid' star after the user clicks on it. I have created a subclass of UIButton as seen below //.h file @interface Bleh: UIButton { } +(id)specialInit; -(void)vvv; @end //.m file @implementation Bleh +(id) specialInit...
You can store the state of the button in a NSMutableArray and when you draw the cell you set if it is enabled or disabled based on the NSMutableArray. To change the value on the Array you should Tag the cell and make the change on your vvv selector. //.h file @interface Bleh: UIButton { NSMutableArray *data; } On your ...
Issue with setting icon image in cell I am trying to create a 'blank_star icon' in every cell of a table view, the star should become a 'solid' star after the user clicks on it. I have created a subclass of UIButton as seen below //.h file @interface Bleh: UIButton { } +(id)specialInit; -(void)vvv; @end //.m file @...
TITLE: Issue with setting icon image in cell QUESTION: I am trying to create a 'blank_star icon' in every cell of a table view, the star should become a 'solid' star after the user clicks on it. I have created a subclass of UIButton as seen below //.h file @interface Bleh: UIButton { } +(id)specialInit; -(void)vvv; ...
[ "objective-c", "ios", "uitableview", "uiimage", "reuseidentifier" ]
1
1
452
2
0
2011-06-06T04:29:40.420000
2011-06-06T05:08:20.073000
6,247,760
6,247,891
mysql exclude problem
table a _______________________________ id col1 col2 col3...........col20 1............................ 2............................ 3............................ table b _______________________________ id colA colB colC colD...... colZ query ________________________________ select a.*, b.* from a left join b on b.i...
As far as I know there is not an easy way to select * and exclude columns, and it requires putting the full column list, but I'm sure there are other possibilities. One way of doing this which would make those a.*, b.* type queries work, but requires some initial setup, is to create a view for the table which aliases a...
mysql exclude problem table a _______________________________ id col1 col2 col3...........col20 1............................ 2............................ 3............................ table b _______________________________ id colA colB colC colD...... colZ query ________________________________ select a.*, b.* fro...
TITLE: mysql exclude problem QUESTION: table a _______________________________ id col1 col2 col3...........col20 1............................ 2............................ 3............................ table b _______________________________ id colA colB colC colD...... colZ query ________________________________ s...
[ "mysql" ]
0
1
81
1
0
2011-06-06T04:30:05.007000
2011-06-06T04:54:53.883000
6,247,761
6,247,906
Browser support for eTags
I'm working on getting my site to support the eTag/If-None-Match browser cache, but I'm not sure which browsers do/don't support it. Can anyone point me to a list? I can't imagine it's universal, but I haven't found anything that supports that claim. cheers, Mike
If-None-Match was Specified in HTTP 1.1 (June 1999): http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol According to Wikipedia: By March 1996, pre-standard HTTP/1.1 was supported in Arena, Netscape 2.0, Netscape Navigator Gold 2.01, Mosaic 2.7, Lynx 2.5, and ...
Browser support for eTags I'm working on getting my site to support the eTag/If-None-Match browser cache, but I'm not sure which browsers do/don't support it. Can anyone point me to a list? I can't imagine it's universal, but I haven't found anything that supports that claim. cheers, Mike
TITLE: Browser support for eTags QUESTION: I'm working on getting my site to support the eTag/If-None-Match browser cache, but I'm not sure which browsers do/don't support it. Can anyone point me to a list? I can't imagine it's universal, but I haven't found anything that supports that claim. cheers, Mike ANSWER: If-...
[ "cross-browser", "etag", "browser-support" ]
26
22
13,890
1
0
2011-06-06T04:31:09.290000
2011-06-06T04:57:52.097000
6,247,765
6,247,810
pros and cons of array extracting methods
Which method is good to get values from array using in loops. 1. list() 2. extract() 3. Normal extracting like $array['id'] code snippet: $sel = mysql_query("SELECT id,name from user"); while($get = mysql_fetch_array($sel)){ //Which one is good extract($get); loop($id,$name)=$get; $id = $get['id']; } I like to know pro...
extract() should be used with most care. But it is perfectly fine if you want to get a limited set of known variables from an associative array. list() however is usually unsuited for associative arrays. It's for numerically indexed arrays, and assigns them to local variables. list() is sort of equivalent to extract(ar...
pros and cons of array extracting methods Which method is good to get values from array using in loops. 1. list() 2. extract() 3. Normal extracting like $array['id'] code snippet: $sel = mysql_query("SELECT id,name from user"); while($get = mysql_fetch_array($sel)){ //Which one is good extract($get); loop($id,$name)=$g...
TITLE: pros and cons of array extracting methods QUESTION: Which method is good to get values from array using in loops. 1. list() 2. extract() 3. Normal extracting like $array['id'] code snippet: $sel = mysql_query("SELECT id,name from user"); while($get = mysql_fetch_array($sel)){ //Which one is good extract($get); ...
[ "php", "arrays" ]
3
4
230
2
0
2011-06-06T04:31:42.160000
2011-06-06T04:38:06.143000
6,247,769
6,247,994
How can I ensure my UITableView data update function is called only once when app is displayed again (from background start, or launch)?
How can I ensure my table data function is called only once when app is displayed again (from background start, or launch)? That is, I want to have my table data refreshed when the user clicks on the application icon, and only once. So the requirement would be: a) update method in controller called only once after appl...
You can implement it in following way: 1) Take one variable in NSUserDefault. 2) Set it's value FALSE when app is launch for the first time. 3) Get the value of NSUserDefault variable in respective view controller. And if it's value if FALSE then call update method. 4) Now, when app become Active, then set the variable...
How can I ensure my UITableView data update function is called only once when app is displayed again (from background start, or launch)? How can I ensure my table data function is called only once when app is displayed again (from background start, or launch)? That is, I want to have my table data refreshed when the us...
TITLE: How can I ensure my UITableView data update function is called only once when app is displayed again (from background start, or launch)? QUESTION: How can I ensure my table data function is called only once when app is displayed again (from background start, or launch)? That is, I want to have my table data ref...
[ "iphone", "ios", "viewdidload", "nsnotificationcenter" ]
0
1
555
3
0
2011-06-06T04:32:41.113000
2011-06-06T05:10:05.937000
6,247,775
6,247,802
problem in using between function in sql server 2008
I am developing one web application using asp.net 2005 and Microsoft SQL Server 2008. I need a help for fetching the data from database between a given range. the date field in my table is of type VARCHAR(25) and the date format stored is dd-mm-yyyy. when I using the between clause in the SQL query then it is not givin...
You have a string comparison on the varchar(25), not a date comparison so exactly as expected. That is, the string '06-06-2011' is before the string '31-05-2011' Add some CONVERTs with style 112 and compare actual dates. Or fix your data... the format dd-mm-yyyy should be set in the client code and the database should ...
problem in using between function in sql server 2008 I am developing one web application using asp.net 2005 and Microsoft SQL Server 2008. I need a help for fetching the data from database between a given range. the date field in my table is of type VARCHAR(25) and the date format stored is dd-mm-yyyy. when I using the...
TITLE: problem in using between function in sql server 2008 QUESTION: I am developing one web application using asp.net 2005 and Microsoft SQL Server 2008. I need a help for fetching the data from database between a given range. the date field in my table is of type VARCHAR(25) and the date format stored is dd-mm-yyyy...
[ "sql-server", "sql-server-2008" ]
0
5
669
2
0
2011-06-06T04:33:37.937000
2011-06-06T04:37:00.350000
6,247,781
6,247,818
jQuery slide down panel
its my first time using.animate() from jQuery. My main idea is panel with picture will appear within 2 seconds, and sliding down. But currently its not working, can you make it work? You can see demo here: http://jsfiddle.net/thisizmonster/8WN5c/3/ If you can't see it, here is copied version. HTML: CSS: #panel { width:...
Maybe you meant something more like this: http://jsfiddle.net/8WN5c/6/ This will actually slide the image down into place by moving the relative position of the image. The "panel" in this case acts like a picture frame. The image can't be seen when it's outside the frame, and the image slides down into the frame. HTML:...
jQuery slide down panel its my first time using.animate() from jQuery. My main idea is panel with picture will appear within 2 seconds, and sliding down. But currently its not working, can you make it work? You can see demo here: http://jsfiddle.net/thisizmonster/8WN5c/3/ If you can't see it, here is copied version. HT...
TITLE: jQuery slide down panel QUESTION: its my first time using.animate() from jQuery. My main idea is panel with picture will appear within 2 seconds, and sliding down. But currently its not working, can you make it work? You can see demo here: http://jsfiddle.net/thisizmonster/8WN5c/3/ If you can't see it, here is ...
[ "jquery", "animation", "slide" ]
0
2
1,668
4
0
2011-06-06T04:34:21.433000
2011-06-06T04:38:51.740000
6,247,790
6,252,480
How to get 12 hour format time string when system is set to use 24 hour format
I want to get a time string like "10:00 PM", and I use the NSDateFormatterShortStyle to achieve this. However when the system is set to use 24-hour format, what I got is "22:00". Besides, I want to get a localized time string. For example, in Chinese, I want to get "下午10:00" instead of "10:00 PM". So I have to use the ...
Well this should work: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; [dateFormatter setDateFormat:[NSDateFormatter dateFormatFromTemplate:@"hh:mm a" options:0 locale:[NSLocale currentLocale]]]; NSString *theTime = [dateFormatter stringFromDate:[NSDate date]]; This should get you a date formatter that ...
How to get 12 hour format time string when system is set to use 24 hour format I want to get a time string like "10:00 PM", and I use the NSDateFormatterShortStyle to achieve this. However when the system is set to use 24-hour format, what I got is "22:00". Besides, I want to get a localized time string. For example, i...
TITLE: How to get 12 hour format time string when system is set to use 24 hour format QUESTION: I want to get a time string like "10:00 PM", and I use the NSDateFormatterShortStyle to achieve this. However when the system is set to use 24-hour format, what I got is "22:00". Besides, I want to get a localized time stri...
[ "ios", "datetime", "locale" ]
3
14
12,645
3
0
2011-06-06T04:35:09.677000
2011-06-06T13:09:03.223000
6,247,799
6,247,832
how to check whether the row is focused or not (or) selected or not in if condition in gridview
i am using master detail grid.when i click on the master grid row with focused row index, it must show the information in detail grid.fr that i have used check box to do that.i have checked checkbox if it is selected or not.but in my context checkbox not used so i have to get through focused row selection. plz help me ...
In your case when you select the row you want to pass the Selected value to your Detailed GridView, you can then get the Selected Row value.. GridView1.SelectedValue // return selected row Data key value
how to check whether the row is focused or not (or) selected or not in if condition in gridview i am using master detail grid.when i click on the master grid row with focused row index, it must show the information in detail grid.fr that i have used check box to do that.i have checked checkbox if it is selected or not....
TITLE: how to check whether the row is focused or not (or) selected or not in if condition in gridview QUESTION: i am using master detail grid.when i click on the master grid row with focused row index, it must show the information in detail grid.fr that i have used check box to do that.i have checked checkbox if it i...
[ "c#", "asp.net", "gridview" ]
0
1
626
1
0
2011-06-06T04:36:34.170000
2011-06-06T04:42:11.163000
6,247,809
6,247,859
how to avoid AutoComplete in android app
I have placed an edit box and in that box the user has to type his email id and when he clicks a button it must be send to network. When the user starts typing his name it gives some suggestions above the default keypad of the device, if the user selects one among them a small space appears after the name that gets sel...
Try textNoSuggestions value for the android:inputType attribute. For example: android:inputType="textFilter|textMultiLine|textNoSuggestions"
how to avoid AutoComplete in android app I have placed an edit box and in that box the user has to type his email id and when he clicks a button it must be send to network. When the user starts typing his name it gives some suggestions above the default keypad of the device, if the user selects one among them a small s...
TITLE: how to avoid AutoComplete in android app QUESTION: I have placed an edit box and in that box the user has to type his email id and when he clicks a button it must be send to network. When the user starts typing his name it gives some suggestions above the default keypad of the device, if the user selects one am...
[ "android", "autocomplete", "keyboard" ]
2
2
924
2
0
2011-06-06T04:37:57.273000
2011-06-06T04:48:39.940000
6,247,812
6,247,853
Two optional values in the attribute of the helper methods in rails
I have created a helper method for generating a li content tag with a link def method1(attribute,path,classname={},id={}) content_tag(:li, link_to(attribute, path,:class => classname),:id => id) end I am calling the helper method like <%= method1("BLOGS",blogs_path,"","blog1")%> In the above case I gave an empty string...
Look into options hashes. This is used just about everywhere in Rails and is perfect for handling clunky method invocations like that.
Two optional values in the attribute of the helper methods in rails I have created a helper method for generating a li content tag with a link def method1(attribute,path,classname={},id={}) content_tag(:li, link_to(attribute, path,:class => classname),:id => id) end I am calling the helper method like <%= method1("BLOG...
TITLE: Two optional values in the attribute of the helper methods in rails QUESTION: I have created a helper method for generating a li content tag with a link def method1(attribute,path,classname={},id={}) content_tag(:li, link_to(attribute, path,:class => classname),:id => id) end I am calling the helper method like...
[ "ruby-on-rails", "ruby" ]
0
2
338
2
0
2011-06-06T04:38:19.537000
2011-06-06T04:46:55.073000
6,247,827
6,247,861
UIImageView /UIImage Not Working - What Am I Doing Wrong?
I am not getting my image working. Can anyone tell me what I am doing wrong here? musclePicture is a string in format of picture.png 1st view: NSString *muscleURL = [[self.muscleArray objectAtIndex:indexPath.row]objectForKey:@"musclePicture"]; specificExerciseTableViewController.muscleImage = [UIImage imageNamed:muscle...
Try by giving a frame to your UIImageView after: self.image = [[UIImageView alloc]initWithImage:muscleImage]; [image setFrame:CGRectMake(0,0,50,50)]; [image release];
UIImageView /UIImage Not Working - What Am I Doing Wrong? I am not getting my image working. Can anyone tell me what I am doing wrong here? musclePicture is a string in format of picture.png 1st view: NSString *muscleURL = [[self.muscleArray objectAtIndex:indexPath.row]objectForKey:@"musclePicture"]; specificExerciseTa...
TITLE: UIImageView /UIImage Not Working - What Am I Doing Wrong? QUESTION: I am not getting my image working. Can anyone tell me what I am doing wrong here? musclePicture is a string in format of picture.png 1st view: NSString *muscleURL = [[self.muscleArray objectAtIndex:indexPath.row]objectForKey:@"musclePicture"]; ...
[ "iphone", "objective-c", "xcode", "uiimageview", "uiimage" ]
0
0
1,120
3
0
2011-06-06T04:41:04.017000
2011-06-06T04:49:03.017000
6,247,834
6,247,860
How to get the mysql column/field value in PHP without specifying each field?
I am a beginner to PHP and MySQL so please bear with me... I am trying to get the field values of a mysql table using a for loop. I know to how to get it by using mysql_fetch_array but the thing is I have to specify each field. I want to do it by just getting the number of fields and use a loop to get the values. I als...
I use this function I made which returns all the results from the SQL into an array. array( [0]array( [0]id => 0 [1]name => blah ) [1]array( [0]id => 5 [1]name => test ) )
How to get the mysql column/field value in PHP without specifying each field? I am a beginner to PHP and MySQL so please bear with me... I am trying to get the field values of a mysql table using a for loop. I know to how to get it by using mysql_fetch_array but the thing is I have to specify each field. I want to do i...
TITLE: How to get the mysql column/field value in PHP without specifying each field? QUESTION: I am a beginner to PHP and MySQL so please bear with me... I am trying to get the field values of a mysql table using a for loop. I know to how to get it by using mysql_fetch_array but the thing is I have to specify each fie...
[ "php", "mysql" ]
0
2
5,081
2
0
2011-06-06T04:42:39.547000
2011-06-06T04:48:42.703000
6,247,842
6,248,105
How do I search for files using C# on a windows OS
I have a csv file with file names and I need to search for those filenames in a particular directory. I can read thru a csv file and get all the filenames but would like to know how can I search for those files. Any pointers would be would of great help
It's pretty easy, there are many different ways you can do this. I prefer the "exists" method if I am just trying to find out if the files are there. string SearchDirectory = "C:\\SomeDirectory\\"; List FilesToSearch = new List (); //Populate FilesToSearch from your csv... foreach (String CurrentFileToSearch in FilesTo...
How do I search for files using C# on a windows OS I have a csv file with file names and I need to search for those filenames in a particular directory. I can read thru a csv file and get all the filenames but would like to know how can I search for those files. Any pointers would be would of great help
TITLE: How do I search for files using C# on a windows OS QUESTION: I have a csv file with file names and I need to search for those filenames in a particular directory. I can read thru a csv file and get all the filenames but would like to know how can I search for those files. Any pointers would be would of great he...
[ "c#", "search", "visual-studio-2005" ]
2
2
128
3
0
2011-06-06T04:44:50.747000
2011-06-06T05:29:26.817000
6,247,845
6,247,976
Fetch file from specific directory where jar file is placed
I want to fetch a text file from the directory where my jar file is placed. Assuming my desktop application 'foo.jar' file is placed in d:\ in an installation of Windows. There is also a test.txt file in the same directory which I want to read when 'foo.jar' application is running. How can fetch that particular path in...
Note, that actual code does depend on actual class location within your package, but in general it could look like: URL root = package.Main.class.getProtectionDomain().getCodeSource().getLocation(); String path = (new File(root.toURI())).getParentFile().getPath();... // handle file.txt in path
Fetch file from specific directory where jar file is placed I want to fetch a text file from the directory where my jar file is placed. Assuming my desktop application 'foo.jar' file is placed in d:\ in an installation of Windows. There is also a test.txt file in the same directory which I want to read when 'foo.jar' a...
TITLE: Fetch file from specific directory where jar file is placed QUESTION: I want to fetch a text file from the directory where my jar file is placed. Assuming my desktop application 'foo.jar' file is placed in d:\ in an installation of Windows. There is also a test.txt file in the same directory which I want to rea...
[ "java", "relative-path" ]
0
3
642
3
0
2011-06-06T04:45:47.153000
2011-06-06T05:07:44.030000
6,247,849
6,247,924
Java package naming
Okay, so I'm wanting tips on how to pick a name for my Java packages. I saw this post: What package naming convention do you use for personal/hobby projects in Java? but this talks about personal projects. What if for example I wanted to make an API Wrapper, and I develop with others on GitHub? I don't have a domain na...
The domain-name-backwards convention is there to prevent name collisions. Two different companies with the same product name will have different namespaces so everything works fine. If you don't have a domain then you need to choose a name that is meaningful to you and will not collide with anything else. That's OK; it...
Java package naming Okay, so I'm wanting tips on how to pick a name for my Java packages. I saw this post: What package naming convention do you use for personal/hobby projects in Java? but this talks about personal projects. What if for example I wanted to make an API Wrapper, and I develop with others on GitHub? I do...
TITLE: Java package naming QUESTION: Okay, so I'm wanting tips on how to pick a name for my Java packages. I saw this post: What package naming convention do you use for personal/hobby projects in Java? but this talks about personal projects. What if for example I wanted to make an API Wrapper, and I develop with othe...
[ "java", "package", "naming" ]
4
6
6,550
2
0
2011-06-06T04:46:16.640000
2011-06-06T05:00:19.617000
6,247,882
6,252,593
Zend Form action="#" not working
Ive been working on a project on my local machine and recently purchased a shared hosting account with ServerGrove(php5.3). After uploading my project all of my form submissions are broken. On my local host all of my forms submit to the current action,. This has been working fine. It even works on my godaddy and hostga...
Try die(var_dump($_POST)); on the first line of controller you expect the form to be submited to. You can also use FireBug to find any redirects that will make the server "forget" the POST.
Zend Form action="#" not working Ive been working on a project on my local machine and recently purchased a shared hosting account with ServerGrove(php5.3). After uploading my project all of my form submissions are broken. On my local host all of my forms submit to the current action,. This has been working fine. It ev...
TITLE: Zend Form action="#" not working QUESTION: Ive been working on a project on my local machine and recently purchased a shared hosting account with ServerGrove(php5.3). After uploading my project all of my form submissions are broken. On my local host all of my forms submit to the current action,. This has been w...
[ "zend-framework", "hosting", "shared-hosting" ]
0
1
166
1
0
2011-06-06T04:52:34.390000
2011-06-06T13:18:15.237000
6,247,887
6,248,001
Adding Zoom Controls to a normal XML layout
I just want to know, whether it is possible for me to add zoom controls to my XML layout. If yes, can anyone direct me to a sample based on it. Or any help based on it will help me much. Thanks.
Only a few controls (e.g. WebView and MapView) have built-in zoom. You will need to implement your own zoom logic to any other View and/or layout. If you are just asking about the buttons to control the zoom, just add the following code to your layout: (note that this code will add the buttons, but not any actual zoom ...
Adding Zoom Controls to a normal XML layout I just want to know, whether it is possible for me to add zoom controls to my XML layout. If yes, can anyone direct me to a sample based on it. Or any help based on it will help me much. Thanks.
TITLE: Adding Zoom Controls to a normal XML layout QUESTION: I just want to know, whether it is possible for me to add zoom controls to my XML layout. If yes, can anyone direct me to a sample based on it. Or any help based on it will help me much. Thanks. ANSWER: Only a few controls (e.g. WebView and MapView) have bu...
[ "android", "zooming" ]
1
1
4,896
1
0
2011-06-06T04:53:59.677000
2011-06-06T05:11:53.077000
6,247,895
6,247,991
Want to make the visibility true from client side of the control which made invisible from server side
I have a text box in a page. Whose visibility is set false from the server side. Now I want to make it visible from client side by using java-script. (Any post back or partial post back can not be implemented in this case.) <%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inher...
If you set the control visible=false it will not render at client side, But there is a tricky solution, that will accomplish the same thing. In your page load, where you are set Visible=false, you can set the style to display:none protected void Page_Load(object sender, EventArgs e) { TextBox1.Attributes.Add("style", "...
Want to make the visibility true from client side of the control which made invisible from server side I have a text box in a page. Whose visibility is set false from the server side. Now I want to make it visible from client side by using java-script. (Any post back or partial post back can not be implemented in this ...
TITLE: Want to make the visibility true from client side of the control which made invisible from server side QUESTION: I have a text box in a page. Whose visibility is set false from the server side. Now I want to make it visible from client side by using java-script. (Any post back or partial post back can not be im...
[ "c#", "javascript", "asp.net", "html", "css" ]
3
8
29,492
3
0
2011-06-06T04:55:39.317000
2011-06-06T05:09:53.130000
6,247,904
6,247,922
C++: Comparing two strings
Possible Duplicate: comparing two strings with comma seperated values I am working in C++, where I have two strings: string str1 = "1,4,8,", str2 = "4,1,8,"; Both strings contains comma separated values. Now I just want to check whether all the elements in str1 also exist in str2, regardless of their position. Is there...
As far as C++ is concerned, those strings are just sequences of characters. If you apply meaning to those characters (such as "comma separated values"), then you'll have to write some code to extract the data and deal with it. I would do something like: split the string on ',' convert each sequence of digits into an in...
C++: Comparing two strings Possible Duplicate: comparing two strings with comma seperated values I am working in C++, where I have two strings: string str1 = "1,4,8,", str2 = "4,1,8,"; Both strings contains comma separated values. Now I just want to check whether all the elements in str1 also exist in str2, regardless ...
TITLE: C++: Comparing two strings QUESTION: Possible Duplicate: comparing two strings with comma seperated values I am working in C++, where I have two strings: string str1 = "1,4,8,", str2 = "4,1,8,"; Both strings contains comma separated values. Now I just want to check whether all the elements in str1 also exist in...
[ "c++", "stdstring" ]
2
9
429
2
0
2011-06-06T04:56:42.080000
2011-06-06T05:00:00.057000
6,247,907
6,248,145
how to communicate between client and server in java
I have a chat program. Now the code works for communicate between client and server via command line. But it gives an exception (java.net.SocketException: Socket is closed) while running. Please help me to fix that problem. In a java chat program,how will the communication be implemented between client and server? ie. ...
First of all, don't close the streams in every run(). Secondly, check whether port for server which you are using is free.
how to communicate between client and server in java I have a chat program. Now the code works for communicate between client and server via command line. But it gives an exception (java.net.SocketException: Socket is closed) while running. Please help me to fix that problem. In a java chat program,how will the communi...
TITLE: how to communicate between client and server in java QUESTION: I have a chat program. Now the code works for communicate between client and server via command line. But it gives an exception (java.net.SocketException: Socket is closed) while running. Please help me to fix that problem. In a java chat program,ho...
[ "java", "network-programming" ]
2
2
14,426
4
0
2011-06-06T04:57:54.030000
2011-06-06T05:37:04.900000
6,247,915
6,247,952
How to delete all "one-to-many" items in a ColdFusion orm entity?
var items = job.getItems(); for (var item in items) job.removeItem(item); And CF / Java throws java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) What's the cleanest way to remove all items without ConcurrentModificationException? Thank you!
A java List has an (optional) clear() method. The code would then become: job.getItems().clear() AFAICS coldfusion9 uses hibernate as ORM, and hibernate does implement clear on the List abstraction, and will even translate it to a single DELETE statement to the database.
How to delete all "one-to-many" items in a ColdFusion orm entity? var items = job.getItems(); for (var item in items) job.removeItem(item); And CF / Java throws java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) What's the cleanest way to remove all ite...
TITLE: How to delete all "one-to-many" items in a ColdFusion orm entity? QUESTION: var items = job.getItems(); for (var item in items) job.removeItem(item); And CF / Java throws java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) What's the cleanest way...
[ "orm", "coldfusion", "coldfusion-9" ]
1
3
1,260
2
0
2011-06-06T04:58:43.887000
2011-06-06T05:04:03.210000
6,247,920
6,248,002
How to apply alternate row style in listbox in window phone 7
Hi I am New to Window phone 7, I have a Problem for Applying style to alternate row color in listbox in Window phone 7. Please Help Me.
While WPF has an ALternationCount property that supports this, Silverlight, both the web version and WP7, do not. The easiest way to create this effect in Silverlight is to set the bacground colour of your item via a value converter. See the following thread: Alternating background colors for ListBox rows
How to apply alternate row style in listbox in window phone 7 Hi I am New to Window phone 7, I have a Problem for Applying style to alternate row color in listbox in Window phone 7. Please Help Me.
TITLE: How to apply alternate row style in listbox in window phone 7 QUESTION: Hi I am New to Window phone 7, I have a Problem for Applying style to alternate row color in listbox in Window phone 7. Please Help Me. ANSWER: While WPF has an ALternationCount property that supports this, Silverlight, both the web versio...
[ "windows-phone-7" ]
5
4
2,719
2
0
2011-06-06T04:59:50.657000
2011-06-06T05:11:59.400000
6,247,926
6,247,984
GCC Command-Line Argument Pickiness
GCC can get pretty picky about the order in which it accepts its arguments: # Works. g++ Foo.cpp -L. -I. -lBar -o Foo # Linker errors. g++ -o Foo -I. -L. -lBar Foo.cpp What, specifically, are the ordering requirements for command-line options?
Libraries are loaded on demand based on the symbols required from them, so the library which provides a symbol needed by something else must follow that something else. This is historical; arguably a modern system should resolve symbols automatically, handling loops sensibly (that being the reason for the rule; you bro...
GCC Command-Line Argument Pickiness GCC can get pretty picky about the order in which it accepts its arguments: # Works. g++ Foo.cpp -L. -I. -lBar -o Foo # Linker errors. g++ -o Foo -I. -L. -lBar Foo.cpp What, specifically, are the ordering requirements for command-line options?
TITLE: GCC Command-Line Argument Pickiness QUESTION: GCC can get pretty picky about the order in which it accepts its arguments: # Works. g++ Foo.cpp -L. -I. -lBar -o Foo # Linker errors. g++ -o Foo -I. -L. -lBar Foo.cpp What, specifically, are the ordering requirements for command-line options? ANSWER: Libraries ar...
[ "gcc", "command-line", "g++", "command-line-arguments" ]
7
7
1,508
1
0
2011-06-06T05:00:31.590000
2011-06-06T05:09:17.797000
6,247,927
6,248,012
Vector-Java equivalent in PHP?
Is there a: 1> Vector(Java) class 2> ListIterator 3> Single Linkedlist equivalent available in PHP?
1) Any PHP array can be considered and used as a Vector (since by definition Vector is just an array that can grow in size and PHP doesn't require to specify array size). As java documents it, public class Vector extends AbstractList implements List, RandomAccess, Cloneable, Serializable PHP array fulfills all there re...
Vector-Java equivalent in PHP? Is there a: 1> Vector(Java) class 2> ListIterator 3> Single Linkedlist equivalent available in PHP?
TITLE: Vector-Java equivalent in PHP? QUESTION: Is there a: 1> Vector(Java) class 2> ListIterator 3> Single Linkedlist equivalent available in PHP? ANSWER: 1) Any PHP array can be considered and used as a Vector (since by definition Vector is just an array that can grow in size and PHP doesn't require to specify arra...
[ "java", "php" ]
1
3
3,008
2
0
2011-06-06T05:00:38.740000
2011-06-06T05:13:08.013000
6,247,928
6,247,981
Javascript assigning event handlers via for loop
Apologies if I appear a little "noobish" with events, but for whatever reason the following doesn't work for me: var someDomRef = document.getElementByRef("refVal"); for(i=0;i Each time I release the mouse button after holding it upon someDomRef, I find a "onmouseover could not be assigned to undefined object" error in...
i is undefined when mouseup is called. You need to close over this with some closure functions: var someDomRef = document.getElementByRef("refVal"); for(i=0;i You may need another closure inside of the onmouseup function
Javascript assigning event handlers via for loop Apologies if I appear a little "noobish" with events, but for whatever reason the following doesn't work for me: var someDomRef = document.getElementByRef("refVal"); for(i=0;i Each time I release the mouse button after holding it upon someDomRef, I find a "onmouseover co...
TITLE: Javascript assigning event handlers via for loop QUESTION: Apologies if I appear a little "noobish" with events, but for whatever reason the following doesn't work for me: var someDomRef = document.getElementByRef("refVal"); for(i=0;i Each time I release the mouse button after holding it upon someDomRef, I find...
[ "javascript", "events", "dom" ]
1
1
529
1
0
2011-06-06T05:00:57.150000
2011-06-06T05:08:48.820000
6,247,931
6,248,129
problem with python inspect module-python
how to write a program to "identify the line number of the function call?" python inspect module provides options to locate the line number but, def di(): return inspect.currentframe().f_back.f_lineno this python code prints the current line number.
Why not use inspect.stack()? def get_caller_lineno(): frame, _, lineno, _, _, _ = inspect.stack()[1] return lineno
problem with python inspect module-python how to write a program to "identify the line number of the function call?" python inspect module provides options to locate the line number but, def di(): return inspect.currentframe().f_back.f_lineno this python code prints the current line number.
TITLE: problem with python inspect module-python QUESTION: how to write a program to "identify the line number of the function call?" python inspect module provides options to locate the line number but, def di(): return inspect.currentframe().f_back.f_lineno this python code prints the current line number. ANSWER: W...
[ "python" ]
1
3
804
2
0
2011-06-06T05:01:13.717000
2011-06-06T05:34:50.953000
6,247,934
6,252,408
How do I calculate conversion rate using Google Analytics?
I have created a goal in Google Analytics that is met when the user completes the sign up process. The page that they end up at is http://my_url.com/?just_signed_up=true In order to calculate my conversation rate, I need to do this calculation: goal (sign ups) / new visitors I know that in order to use new visitor numb...
A returning visitor is someone who starts an additional Google Analytics session while using your site. To start a new session they need to close their browser or stop using the site for a period of at least 30 minutes. Browsing around your site clicking links isn't considered stating a new session. This means that, in...
How do I calculate conversion rate using Google Analytics? I have created a goal in Google Analytics that is met when the user completes the sign up process. The page that they end up at is http://my_url.com/?just_signed_up=true In order to calculate my conversation rate, I need to do this calculation: goal (sign ups) ...
TITLE: How do I calculate conversion rate using Google Analytics? QUESTION: I have created a goal in Google Analytics that is met when the user completes the sign up process. The page that they end up at is http://my_url.com/?just_signed_up=true In order to calculate my conversation rate, I need to do this calculation...
[ "google-analytics", "analytics", "metrics" ]
3
3
1,309
1
0
2011-06-06T05:01:52.860000
2011-06-06T13:02:13.010000
6,247,936
6,247,995
How to calculate height of html string?
I want to display html text on a label(TTStyleLabel). I am receieving text in form of html. How do I calculate height of html string?
To get height of html text you need to put that html info uiwebview. After loading the html in uiwebview you can get its height in its delegate methods like this - - (void)viewDidLoad { [super viewDidLoad]; webview.delegate = self; [webview loadHTMLString:@" The quick brown fox jumped over the lazy dog. " baseURL:nil];...
How to calculate height of html string? I want to display html text on a label(TTStyleLabel). I am receieving text in form of html. How do I calculate height of html string?
TITLE: How to calculate height of html string? QUESTION: I want to display html text on a label(TTStyleLabel). I am receieving text in form of html. How do I calculate height of html string? ANSWER: To get height of html text you need to put that html info uiwebview. After loading the html in uiwebview you can get it...
[ "html", "objective-c", "ios4", "nsstring", "css" ]
3
4
3,279
1
0
2011-06-06T05:02:14.030000
2011-06-06T05:10:12.630000
6,247,958
6,247,966
Does apple allow modifying UIAlertView?
I found a sample on github in which A tableView is added inside UIAlertView. SO I would like to know that will my app rejected if I use that?
I added a username and password filed in UIAlertView and its get accepted! So I think added a table view will also get accepted!
Does apple allow modifying UIAlertView? I found a sample on github in which A tableView is added inside UIAlertView. SO I would like to know that will my app rejected if I use that?
TITLE: Does apple allow modifying UIAlertView? QUESTION: I found a sample on github in which A tableView is added inside UIAlertView. SO I would like to know that will my app rejected if I use that? ANSWER: I added a username and password filed in UIAlertView and its get accepted! So I think added a table view will a...
[ "iphone", "uialertview", "appstore-approval" ]
0
1
261
2
0
2011-06-06T05:04:53.360000
2011-06-06T05:06:17.813000
6,247,969
6,249,810
Anti XSS Sanitization of IFrames with specific src attribute values in .NET
I'm looking to accomplish the following: sanitize WYSIWIG user-input using either AntiXSS or AntiSamy libraries, however, allow iframe tags which have "src" attribute from particular domains. Is there a way to accomplish this? I was thinking about parsing it up with Regex somehow and swapping it out "< iframe" for some...
I also wanted to do some HTML sanitization for one of my WYSISWIG editors. One aproach is to use the Microsoft Anti-Cross Site Scripting Library. http://msdn.microsoft.com/en-us/library/aa973813.aspx Another is to create a whitelist parser for HTML. Here is what I used along with HTML Agility Pack, you can configure th...
Anti XSS Sanitization of IFrames with specific src attribute values in .NET I'm looking to accomplish the following: sanitize WYSIWIG user-input using either AntiXSS or AntiSamy libraries, however, allow iframe tags which have "src" attribute from particular domains. Is there a way to accomplish this? I was thinking ab...
TITLE: Anti XSS Sanitization of IFrames with specific src attribute values in .NET QUESTION: I'm looking to accomplish the following: sanitize WYSIWIG user-input using either AntiXSS or AntiSamy libraries, however, allow iframe tags which have "src" attribute from particular domains. Is there a way to accomplish this?...
[ "c#", ".net", "xss" ]
2
2
1,420
1
0
2011-06-06T05:06:32.367000
2011-06-06T09:10:14.120000
6,247,972
6,248,025
How can you redirect to a logon page for cross-domain requests?
In an application where I am making cross-domain JSONP requests (using jQuery), when the browser makes the first jsonp request, it pops up a dialog for basic authentication, because that is what the target server requires. I would instead like to trap the event and bring up a dialog with a logon page from the server ho...
I agree with Adeel... it can't be trapped. However, you can supply the required authentication header manually - to prevent the prompt from ever appearing - if the user has already "logged in" and you know their un/pw on the client side.
How can you redirect to a logon page for cross-domain requests? In an application where I am making cross-domain JSONP requests (using jQuery), when the browser makes the first jsonp request, it pops up a dialog for basic authentication, because that is what the target server requires. I would instead like to trap the ...
TITLE: How can you redirect to a logon page for cross-domain requests? QUESTION: In an application where I am making cross-domain JSONP requests (using jQuery), when the browser makes the first jsonp request, it pops up a dialog for basic authentication, because that is what the target server requires. I would instead...
[ "javascript", "jquery", "html", "browser", "cross-domain" ]
0
0
515
3
0
2011-06-06T05:06:59.277000
2011-06-06T05:14:37.977000
6,247,980
6,248,022
Positioning an img with javascript: it wont move
I have some javascript to set the offsetLeft attribute of an img element. But my javascript doesn't move the HTML element, what do you think I can do to make it move left? This is a scenario when it is easiest for me to position the element in javascript & not css. The img that wont move left when it should(it displays...
Set the.style.left along with position:absolute, not the offsetLeft. Alternatively, change the.style.marginLeft. offsetLeft is a read-only property.
Positioning an img with javascript: it wont move I have some javascript to set the offsetLeft attribute of an img element. But my javascript doesn't move the HTML element, what do you think I can do to make it move left? This is a scenario when it is easiest for me to position the element in javascript & not css. The i...
TITLE: Positioning an img with javascript: it wont move QUESTION: I have some javascript to set the offsetLeft attribute of an img element. But my javascript doesn't move the HTML element, what do you think I can do to make it move left? This is a scenario when it is easiest for me to position the element in javascrip...
[ "javascript", "html", "css" ]
1
0
563
1
0
2011-06-06T05:08:40.523000
2011-06-06T05:14:24.953000
6,247,985
6,290,439
How to initialize jquery easy slider plugin to my plugin?
I have a plugin which retrieves JSON data from external file and appends it to the "div#slider", the data is retrieved and is working fine but the easySlider is not initialized after retrieving the data successfully. and the slide does not starts. I have codes on http://lkamal.com.np/r3dImage my plugin code is as follo...
I got solution for this also. $(function() { $.fn.r3dImage = function(param) { var options = { url: "", pause: 2000, feedFetchDelay: 10 }; this.each(function() { var element = $(this); //alert(element.attr('id')); element.html(" "); options = $.extend(options,param); if(options.url=="") { console.log("URL is not speci...
How to initialize jquery easy slider plugin to my plugin? I have a plugin which retrieves JSON data from external file and appends it to the "div#slider", the data is retrieved and is working fine but the easySlider is not initialized after retrieving the data successfully. and the slide does not starts. I have codes o...
TITLE: How to initialize jquery easy slider plugin to my plugin? QUESTION: I have a plugin which retrieves JSON data from external file and appends it to the "div#slider", the data is retrieved and is working fine but the easySlider is not initialized after retrieving the data successfully. and the slide does not star...
[ "jquery-plugins", "jquery-slider" ]
0
0
745
1
0
2011-06-06T05:09:28.780000
2011-06-09T09:06:15.223000
6,247,986
6,248,007
C++: storing CSV in contianer
I have a std::string that contains comma separated values, i need to store those values in some suitable container e.g. array, vector or some other container. Is there any built in function through which i could do this? Or i need to write custom code for this?
If you're willing and able to use the Boost libraries, Boost Tokenizer would work really well for this task. That would look like: std::string str = "some,comma,separated,words"; typedef boost::tokenizer > tokenizer; boost::char_separator sep(","); tokenizer tokens(str, sep); std::vector vec(tokens.begin(), tokens.end(...
C++: storing CSV in contianer I have a std::string that contains comma separated values, i need to store those values in some suitable container e.g. array, vector or some other container. Is there any built in function through which i could do this? Or i need to write custom code for this?
TITLE: C++: storing CSV in contianer QUESTION: I have a std::string that contains comma separated values, i need to store those values in some suitable container e.g. array, vector or some other container. Is there any built in function through which i could do this? Or i need to write custom code for this? ANSWER: I...
[ "c++", "stdvector" ]
0
3
129
4
0
2011-06-06T05:09:30.190000
2011-06-06T05:12:09.400000
6,247,993
6,248,032
Easy way to get the node value of this example
I have a sample XML (Android platform) and I wanted to know the easiest and most efficient approach to get the node value of the node "e". Please help. data
Use XPath. See - http://developer.android.com/reference/javax/xml/xpath/package-summary.html The XPath expression to grab the correct element would be: /a/b/c/e You could coalesce the resulting node into a String to get the textual value.
Easy way to get the node value of this example I have a sample XML (Android platform) and I wanted to know the easiest and most efficient approach to get the node value of the node "e". Please help. data
TITLE: Easy way to get the node value of this example QUESTION: I have a sample XML (Android platform) and I wanted to know the easiest and most efficient approach to get the node value of the node "e". Please help. data ANSWER: Use XPath. See - http://developer.android.com/reference/javax/xml/xpath/package-summary.h...
[ "android", "xml" ]
1
1
1,003
3
0
2011-06-06T05:09:56.010000
2011-06-06T05:15:58.973000
6,247,998
6,248,018
Memory Leaks in Class method which consists of sqlite3_stmt object
Memory Leaks in Class method which consists of sqlite3_stmt object. + (PTModelObject *) processRawRow: (sqlite3_stmt *) selectStatement { NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@"yyyy-MM-dd hh:mm:ss ZZZ"]; BBDashboard * myModelObject = [[BBDashboard alloc] init]; **128 byt...
from cocos2d documentation: CCSpriteSheet is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw"). A CCSpriteSheet can reference one and only one texture (one image file, one texture atlas). Only the CCSprites that are contained in that texture can be added...
Memory Leaks in Class method which consists of sqlite3_stmt object Memory Leaks in Class method which consists of sqlite3_stmt object. + (PTModelObject *) processRawRow: (sqlite3_stmt *) selectStatement { NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@"yyyy-MM-dd hh:mm:ss ZZZ"]; ...
TITLE: Memory Leaks in Class method which consists of sqlite3_stmt object QUESTION: Memory Leaks in Class method which consists of sqlite3_stmt object. + (PTModelObject *) processRawRow: (sqlite3_stmt *) selectStatement { NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@"yyyy-MM-dd...
[ "iphone" ]
0
1
206
1
0
2011-06-06T05:11:17.303000
2011-06-06T05:13:43.003000
6,248,005
6,256,839
Handling changes in user Google Tasks using GTasks API
We are building service that will synchronize with user Google Tasks data, so if user add/edit/delete task in GTask, so it will be added/edited/deleted in our service. And there is a big problem with synchronization: as I see GTasks API does not provide any onUpdate/onChange event listeners. I mean, the perfect solutio...
You could use updatedMin parameter to only get Tasks that have been updated since a given timestamp, as described in the documentation. You should be able to rely on ETag and If-None-Match headers when querying user tasks lists to get a 304 Not Modified if the no tasks in the list have changed. (Not that should also wo...
Handling changes in user Google Tasks using GTasks API We are building service that will synchronize with user Google Tasks data, so if user add/edit/delete task in GTask, so it will be added/edited/deleted in our service. And there is a big problem with synchronization: as I see GTasks API does not provide any onUpdat...
TITLE: Handling changes in user Google Tasks using GTasks API QUESTION: We are building service that will synchronize with user Google Tasks data, so if user add/edit/delete task in GTask, so it will be added/edited/deleted in our service. And there is a big problem with synchronization: as I see GTasks API does not p...
[ "google-calendar-api", "google-tasks" ]
3
8
946
1
0
2011-06-06T05:12:08.650000
2011-06-06T19:11:03.547000
6,248,011
6,248,042
Web, SQL: display random images despite file name, load images from folder
I want a web page to display several random images on load. I've thought of several solutions but I would really like to be able to dump images into a folder without renaming them, and the web page will choose from those images in the folder and display them I can imagine a PHP solution that will display random images ...
Glob works like on the filesystem, e.g. supports wildcards $files = glob('/path/to/files/*.jpg'); $yourRandomFile = array_rand($files); This will return a random JPG file, based on it's extension.
Web, SQL: display random images despite file name, load images from folder I want a web page to display several random images on load. I've thought of several solutions but I would really like to be able to dump images into a folder without renaming them, and the web page will choose from those images in the folder and...
TITLE: Web, SQL: display random images despite file name, load images from folder QUESTION: I want a web page to display several random images on load. I've thought of several solutions but I would really like to be able to dump images into a folder without renaming them, and the web page will choose from those images...
[ "php", "sql", "css", "image", "random" ]
1
3
1,040
3
0
2011-06-06T05:13:07.790000
2011-06-06T05:16:58.417000
6,248,026
6,248,037
Assigning variable from select statement
Which is the correct syntax? DECLARE @TotalRows INT SET @TotalRows = (SELECT COUNT(*) FROM MyTable WHERE MyID = Value) OR DECLARE @TotalRows INT SELECT @TotalRows = COUNT(*) FROM MyTable WHERE MyID = Value Does it even matter?
Difference between set vs select SET is the ANSI standard for variable assignment, SELECT is not. SET can only assign one variable at a time, SELECT can make multiple assignments at once. If assigning from a query, SET can only assign a scalar value. If the query returns multiple values/rows then SET will raise an erro...
Assigning variable from select statement Which is the correct syntax? DECLARE @TotalRows INT SET @TotalRows = (SELECT COUNT(*) FROM MyTable WHERE MyID = Value) OR DECLARE @TotalRows INT SELECT @TotalRows = COUNT(*) FROM MyTable WHERE MyID = Value Does it even matter?
TITLE: Assigning variable from select statement QUESTION: Which is the correct syntax? DECLARE @TotalRows INT SET @TotalRows = (SELECT COUNT(*) FROM MyTable WHERE MyID = Value) OR DECLARE @TotalRows INT SELECT @TotalRows = COUNT(*) FROM MyTable WHERE MyID = Value Does it even matter? ANSWER: Difference between set vs...
[ "sql", "t-sql", "select", "variable-assignment" ]
4
3
3,728
1
0
2011-06-06T05:14:54.110000
2011-06-06T05:16:30.580000
6,248,039
6,248,074
How to sort list of Ip Addresses using c#
I've a list of IP addresses as follows 192.168.1.5 69.52.220.44 10.152.16.23 192.168.3.10 192.168.1.4 192.168.2.1 I'm looking for such a way to sort this list to match the below order 10.152.16.23 69.52.220.44 192.168.1.4 192.168.1.5 192.168.2.1
This might look as a hack, but it does exactly what you need: var unsortedIps = new[] { "192.168.1.4", "192.168.1.5", "192.168.2.1", "10.152.16.23", "69.52.220.44" }; var sortedIps = unsortedIps.Select(Version.Parse).OrderBy(arg => arg).Select(arg => arg.ToString()).ToList();
How to sort list of Ip Addresses using c# I've a list of IP addresses as follows 192.168.1.5 69.52.220.44 10.152.16.23 192.168.3.10 192.168.1.4 192.168.2.1 I'm looking for such a way to sort this list to match the below order 10.152.16.23 69.52.220.44 192.168.1.4 192.168.1.5 192.168.2.1
TITLE: How to sort list of Ip Addresses using c# QUESTION: I've a list of IP addresses as follows 192.168.1.5 69.52.220.44 10.152.16.23 192.168.3.10 192.168.1.4 192.168.2.1 I'm looking for such a way to sort this list to match the below order 10.152.16.23 69.52.220.44 192.168.1.4 192.168.1.5 192.168.2.1 ANSWER: This ...
[ "c#", ".net", "list", "string", "ip-address" ]
23
54
12,173
5
0
2011-06-06T05:16:38.323000
2011-06-06T05:22:43.810000
6,248,044
6,248,053
How to compare two vectors for equality element by element?
Is there any way to compare two vectors? if (vector1 == vector2) DoSomething(); Note: Currently, these vectors are not sorted and contain integer values.
Check out the std::mismatch method of C++. Comparing vectors has been discussed on DaniWeb forum and also answered: C++: Comparing two vectors Check out the below SO post. It will be helpful to you. They have achieved the same with two different methods. How do I get the number of different or common elements between t...
How to compare two vectors for equality element by element? Is there any way to compare two vectors? if (vector1 == vector2) DoSomething(); Note: Currently, these vectors are not sorted and contain integer values.
TITLE: How to compare two vectors for equality element by element? QUESTION: Is there any way to compare two vectors? if (vector1 == vector2) DoSomething(); Note: Currently, these vectors are not sorted and contain integer values. ANSWER: Check out the std::mismatch method of C++. Comparing vectors has been discussed...
[ "c++", "stdvector" ]
98
20
197,716
5
0
2011-06-06T05:17:19.173000
2011-06-06T05:19:29.307000
6,248,049
6,254,505
BrowserCouch, help with basic example
I'm trying to get a basic example of BrowserCouch working... the one shown here: http://hg.toolness.com/browser-couch/raw-file/blog-post/tutorial.html My code: I get this error in the Chrome and FF console: BrowserCouch is not defined I've double checked and the browser-couch.js file is correctly src'd. How can I get t...
Looks like you're using code from the blog post but using a newer version of the JavaScript and the newer one has a different API. From the github page: var database = BrowserCouch('foo'); database.onload(function(){ database.get('bar', function(d){console.log(d)}); }); But the older version wanted what you're doing: B...
BrowserCouch, help with basic example I'm trying to get a basic example of BrowserCouch working... the one shown here: http://hg.toolness.com/browser-couch/raw-file/blog-post/tutorial.html My code: I get this error in the Chrome and FF console: BrowserCouch is not defined I've double checked and the browser-couch.js fi...
TITLE: BrowserCouch, help with basic example QUESTION: I'm trying to get a basic example of BrowserCouch working... the one shown here: http://hg.toolness.com/browser-couch/raw-file/blog-post/tutorial.html My code: I get this error in the Chrome and FF console: BrowserCouch is not defined I've double checked and the b...
[ "javascript", "couchdb" ]
1
2
244
1
0
2011-06-06T05:18:35.743000
2011-06-06T15:41:48.503000
6,248,058
6,271,215
InfoWindow graphics "messed up" using Google Maps API v3
I'm simply putting a marker on the map (after it's all set up and centered like in the sample code in the Google documentation) using geocoder and place an infoWindow on it like so: geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var marker = new googl...
Like mkilmanas guessed, it was a colliding CSS declaration. I had this in my CSS file: img { max-width: 300px; } I am fully aware of how stupid that was. Thanks a lot mkilmanas.
InfoWindow graphics "messed up" using Google Maps API v3 I'm simply putting a marker on the map (after it's all set up and centered like in the sample code in the Google documentation) using geocoder and place an infoWindow on it like so: geocoder.geocode( { 'address': address}, function(results, status) { if (status =...
TITLE: InfoWindow graphics "messed up" using Google Maps API v3 QUESTION: I'm simply putting a marker on the map (after it's all set up and centered like in the sample code in the Google documentation) using geocoder and place an infoWindow on it like so: geocoder.geocode( { 'address': address}, function(results, stat...
[ "javascript", "google-maps" ]
4
7
3,453
2
0
2011-06-06T05:20:23.450000
2011-06-07T20:26:51.693000
6,248,068
6,248,092
How can I solve this problem with C# classes?
I am creating an application that the user will be able to setup a series of functions to run on an object (image manipulation stuff). Each different function has either no configurable options, or its own uniques set of options. This is hard to explain, so let me show a simple example: Image opened (always happens) Re...
I'd highly recommend you look into the Command Pattern: http://www.codeproject.com/KB/architecture/Command_Pattern.aspx Essentially, this involves creating "Command" subclasses for each type of action the user can perform - and pushing them unto a stack once the command has been executed. Each command knows how to "do"...
How can I solve this problem with C# classes? I am creating an application that the user will be able to setup a series of functions to run on an object (image manipulation stuff). Each different function has either no configurable options, or its own uniques set of options. This is hard to explain, so let me show a si...
TITLE: How can I solve this problem with C# classes? QUESTION: I am creating an application that the user will be able to setup a series of functions to run on an object (image manipulation stuff). Each different function has either no configurable options, or its own uniques set of options. This is hard to explain, s...
[ "c#", "design-patterns" ]
1
6
169
2
0
2011-06-06T05:22:11.110000
2011-06-06T05:27:01.203000
6,248,073
6,248,171
Status bar Notification in android
I want to set a onClickListner for a status bar Notification. How it is possible? Please help. Now i can load a Activity by using the pending intent. I like to set a onClickListner for the notificatioin. Regards Parvathi
It is not possible to set an OnClickListener for a notification. Because of the way notifications are handled/displayed there is no way to guarantee that the process that created the notification will be running at the time the notification is clicked. This means that any code you wrote to provide click handling may no...
Status bar Notification in android I want to set a onClickListner for a status bar Notification. How it is possible? Please help. Now i can load a Activity by using the pending intent. I like to set a onClickListner for the notificatioin. Regards Parvathi
TITLE: Status bar Notification in android QUESTION: I want to set a onClickListner for a status bar Notification. How it is possible? Please help. Now i can load a Activity by using the pending intent. I like to set a onClickListner for the notificatioin. Regards Parvathi ANSWER: It is not possible to set an OnClickL...
[ "android", "notifications" ]
1
1
629
1
0
2011-06-06T05:22:43.453000
2011-06-06T05:44:14.520000
6,248,079
6,248,106
How to Order NUnit Tests
More than once the question has been asked on SO. But the only answers that are given read "you should not need to order your unit tests, it is bad because" or "you can avoid that if..." I already know it is bad, why it is bad, and techniques to avoid it. But that is not what I want to know. I'd like to know if it is p...
The work-around (hack) is to alphabetize your test case names. See this thread: https://bugs.launchpad.net/nunit-3.0/+bug/740539 Relying on alphabetical order is a workaround that you can use but it is not documented and supported beyond the visual order of the display. In theory it could change at any time. In practic...
How to Order NUnit Tests More than once the question has been asked on SO. But the only answers that are given read "you should not need to order your unit tests, it is bad because" or "you can avoid that if..." I already know it is bad, why it is bad, and techniques to avoid it. But that is not what I want to know. I'...
TITLE: How to Order NUnit Tests QUESTION: More than once the question has been asked on SO. But the only answers that are given read "you should not need to order your unit tests, it is bad because" or "you can avoid that if..." I already know it is bad, why it is bad, and techniques to avoid it. But that is not what ...
[ "nunit" ]
21
10
16,235
5
0
2011-06-06T05:24:03.453000
2011-06-06T05:29:55.227000
6,248,080
6,248,095
How to compress your django project ( along w/ the dependent Python modules ) into one file that can be run on a server
The basic core of the problem I've expressed being - portability of the Django Project. I want to give my testing team the project as a single file. How do I go about doing it?
disutils will allow you to package your project into a single archive that can be extracted and installed.
How to compress your django project ( along w/ the dependent Python modules ) into one file that can be run on a server The basic core of the problem I've expressed being - portability of the Django Project. I want to give my testing team the project as a single file. How do I go about doing it?
TITLE: How to compress your django project ( along w/ the dependent Python modules ) into one file that can be run on a server QUESTION: The basic core of the problem I've expressed being - portability of the Django Project. I want to give my testing team the project as a single file. How do I go about doing it? ANSW...
[ "python", "django" ]
1
1
73
1
0
2011-06-06T05:24:08.697000
2011-06-06T05:27:35.607000
6,248,086
6,248,161
Why does BigInteger.ToString("x") prepend a 0 for values between signed.MaxValue (exclusive) and unsigned.MaxValue (inclusive)?
Examples (asterisks next to odd behavior): [Fact] public void BigInteger_ToString_behavior_is_odd() { writeHex(new BigInteger(short.MaxValue)); // 7fff writeHex(new BigInteger(short.MaxValue) + 1); // 08000 ** writeHex(new BigInteger(ushort.MaxValue)); // 0ffff ** writeHex(new BigInteger(ushort.MaxValue) + 1); // 10000...
Without a leading zero, the number may appear as though it is a negative number of the same number of bits in two's complement. Putting a leading zero ensures that the high bit isn't set, so it can't possibly be interpreted as a negative number. Go ahead and remove the first character, if it's a zero, unless it's the o...
Why does BigInteger.ToString("x") prepend a 0 for values between signed.MaxValue (exclusive) and unsigned.MaxValue (inclusive)? Examples (asterisks next to odd behavior): [Fact] public void BigInteger_ToString_behavior_is_odd() { writeHex(new BigInteger(short.MaxValue)); // 7fff writeHex(new BigInteger(short.MaxValue) ...
TITLE: Why does BigInteger.ToString("x") prepend a 0 for values between signed.MaxValue (exclusive) and unsigned.MaxValue (inclusive)? QUESTION: Examples (asterisks next to odd behavior): [Fact] public void BigInteger_ToString_behavior_is_odd() { writeHex(new BigInteger(short.MaxValue)); // 7fff writeHex(new BigIntege...
[ "c#", "biginteger" ]
6
6
1,605
6
0
2011-06-06T05:25:51.723000
2011-06-06T05:41:06.057000
6,248,101
6,248,110
reverse string recursive method
Hello Why my reverse method that uses recursion isn't working? The print statement shows that the operation is done correctly but at the end it seems like only the very ast char of the entire String is assigned to h. public static String reverse(String s,String h){ if(s.length()==0){ return s; } else { h+=s.charAt(...
Use return reverse(s,h); instead of return h; i.e: public static String reverse(String s,String h){ if(s.length() == 0){ return h; } else { h+=s.charAt(s.length()-1); System.out.println(h);//FOR TEST s=s.substring(0,s.length()-1); return reverse(s,h); //NOTICE THE CHANGE HERE, } }
reverse string recursive method Hello Why my reverse method that uses recursion isn't working? The print statement shows that the operation is done correctly but at the end it seems like only the very ast char of the entire String is assigned to h. public static String reverse(String s,String h){ if(s.length()==0){ r...
TITLE: reverse string recursive method QUESTION: Hello Why my reverse method that uses recursion isn't working? The print statement shows that the operation is done correctly but at the end it seems like only the very ast char of the entire String is assigned to h. public static String reverse(String s,String h){ if(...
[ "java", "recursion", "reverse" ]
1
5
4,913
4
0
2011-06-06T05:28:35.483000
2011-06-06T05:30:56.880000
6,248,132
6,291,663
Symbolicate XCode4 crash reports
I'm trying to get XCode 4 to symbolicate a crash report. I've googled and followed this link (https://github.com/chrispix/symbolicatecrash-fix) but get stopped. The instructions say "To fix your iOS crash report symbolication, move /usr/local/bin/symbolicatecrash aside and copy in the version in this repo." Well, I can...
that tool has been relocated to /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash in newer version of the SDK you would run it as:./symbolicatecrash -A -v [crashlog-filename] MyApp.dSYM keep in mind this is for iOS only, for OSX see ht...
Symbolicate XCode4 crash reports I'm trying to get XCode 4 to symbolicate a crash report. I've googled and followed this link (https://github.com/chrispix/symbolicatecrash-fix) but get stopped. The instructions say "To fix your iOS crash report symbolication, move /usr/local/bin/symbolicatecrash aside and copy in the v...
TITLE: Symbolicate XCode4 crash reports QUESTION: I'm trying to get XCode 4 to symbolicate a crash report. I've googled and followed this link (https://github.com/chrispix/symbolicatecrash-fix) but get stopped. The instructions say "To fix your iOS crash report symbolication, move /usr/local/bin/symbolicatecrash aside...
[ "xcode4", "symbolicate", "symbolicatecrash" ]
5
10
5,960
1
0
2011-06-06T05:35:13.407000
2011-06-09T10:54:22.287000
6,248,162
6,248,170
why am I getting this error
Why Am I getting an error. In eclipse it says constructor call should be the first line. It is the first line. or you can not extend Main? import javax.swing.JFrame; import javax.swing.JLabel; public class Main extends JFrame{ /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method...
Your Main constructor should sit outside of the main method. Like so: public class Main extends JFrame { public Main() { super("title bar"); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub //JLabel testLabel1 = new JLabel(); } }
why am I getting this error Why Am I getting an error. In eclipse it says constructor call should be the first line. It is the first line. or you can not extend Main? import javax.swing.JFrame; import javax.swing.JLabel; public class Main extends JFrame{ /** * @param args */ public static void main(String[] args) { /...
TITLE: why am I getting this error QUESTION: Why Am I getting an error. In eclipse it says constructor call should be the first line. It is the first line. or you can not extend Main? import javax.swing.JFrame; import javax.swing.JLabel; public class Main extends JFrame{ /** * @param args */ public static void main(...
[ "java" ]
0
5
75
4
0
2011-06-06T05:41:39.287000
2011-06-06T05:44:14.787000
6,248,175
6,289,262
Facebook C# SDK Update Schedule
I'm using the Facebook C# SDK (http://facebooksdk.codeplex.com/releases/view/66412) and would like to know what the best approach would be to use it to keep my cached user data up to date? Currently I am storing these pieces of user information: userid birthday name sex country pic pic_square Has anyone given this any ...
Use the facebook subscription feature. This way the facebook will ping your url with the changed data every time the data is changed by the user. it is a push based notification. It allows you to get real time updates for a graph object. https://developers.facebook.com/docs/reference/api/subscription/ If you are using ...
Facebook C# SDK Update Schedule I'm using the Facebook C# SDK (http://facebooksdk.codeplex.com/releases/view/66412) and would like to know what the best approach would be to use it to keep my cached user data up to date? Currently I am storing these pieces of user information: userid birthday name sex country pic pic_s...
TITLE: Facebook C# SDK Update Schedule QUESTION: I'm using the Facebook C# SDK (http://facebooksdk.codeplex.com/releases/view/66412) and would like to know what the best approach would be to use it to keep my cached user data up to date? Currently I am storing these pieces of user information: userid birthday name sex...
[ "facebook-c#-sdk" ]
1
0
1,049
2
0
2011-06-06T05:44:49.943000
2011-06-09T07:07:35.637000
6,249,407
6,251,152
jsf auto-login according to cookie
I'm having a problem in achieving an auto-login feature for my JSF application which is being proted from a JSP & servlet-based architecture. I used LoginBean backing the jsf page with a constructor method to check if the cookie containing the user crendtials exists, and if it does to automatically open a session and r...
Here is an option that should work. You can do something like this once you've ascertained that they are valid: final ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); try { HttpServletResponse response = (HttpServletResponse) externalContext.getResponse(); if (!response.isComm...
jsf auto-login according to cookie I'm having a problem in achieving an auto-login feature for my JSF application which is being proted from a JSP & servlet-based architecture. I used LoginBean backing the jsf page with a constructor method to check if the cookie containing the user crendtials exists, and if it does to...
TITLE: jsf auto-login according to cookie QUESTION: I'm having a problem in achieving an auto-login feature for my JSF application which is being proted from a JSP & servlet-based architecture. I used LoginBean backing the jsf page with a constructor method to check if the cookie containing the user crendtials exists,...
[ "jsf", "cookies", "authentication", "redirectwithcookies" ]
0
1
1,429
1
0
2011-06-06T08:28:51.660000
2011-06-06T11:11:49.210000
6,249,414
6,249,694
Adding behavior to EMF models
I'm wondering how people in general deal with adding behavior to EMF models. I have a model representing a certain type of physical file (a project file for an IDE, but the details are not interesting), and the model contains some computed attributes (such as the result of passing this file to external tools). I can se...
I had the same kind of problem and I talked to some modeling people and Ed Merks. The general approach is to statically create all possible types and use them without modification. Dynamic models (i.e. EMF models which change at runtime) aren't very common so there isn't a lot of knowledge around what's the best way to...
Adding behavior to EMF models I'm wondering how people in general deal with adding behavior to EMF models. I have a model representing a certain type of physical file (a project file for an IDE, but the details are not interesting), and the model contains some computed attributes (such as the result of passing this fil...
TITLE: Adding behavior to EMF models QUESTION: I'm wondering how people in general deal with adding behavior to EMF models. I have a model representing a certain type of physical file (a project file for an IDE, but the details are not interesting), and the model contains some computed attributes (such as the result o...
[ "eclipse", "eclipse-emf", "eclipse-emf-ecore" ]
1
1
393
2
0
2011-06-06T08:30:04.647000
2011-06-06T08:59:58.317000
6,249,415
6,249,441
Testing against hacking attempts
I want to make sure my site is protected against hacking attempts and I think the best way to test is to try and hack my site myself. What sort of things do hackers do to try and hack my site? E.g., Test - they might put javascript in a input field e.g., <“open javascript tag">window.location = “www.somewhereelse.com”;...
You will find an extensive list of attacks here: https://www.owasp.org/index.php/Category:Attack
Testing against hacking attempts I want to make sure my site is protected against hacking attempts and I think the best way to test is to try and hack my site myself. What sort of things do hackers do to try and hack my site? E.g., Test - they might put javascript in a input field e.g., <“open javascript tag">window.lo...
TITLE: Testing against hacking attempts QUESTION: I want to make sure my site is protected against hacking attempts and I think the best way to test is to try and hack my site myself. What sort of things do hackers do to try and hack my site? E.g., Test - they might put javascript in a input field e.g., <“open javascr...
[ "php", "html", "security", "cracking" ]
5
6
2,314
6
0
2011-06-06T08:30:13.617000
2011-06-06T08:33:01.703000
6,249,416
6,249,616
adding more than two button on the navigationbar
I am trying this but it does not work. -(void)viewDidLoad { // create a toolbar where we can place some buttons UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 100, 45)]; [toolbar setBarStyle: UIBarStyleBlackOpaque]; // create an array for the buttons NSMutableArray* buttons = [[NSMutableArray a...
UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 45)]; [toolbar setBarStyle: UIBarStyleBlackOpaque]; // create an array for the buttons NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:5]; // create a standard save button UIBarButtonItem *saveButton = [[UIBarButtonItem all...
adding more than two button on the navigationbar I am trying this but it does not work. -(void)viewDidLoad { // create a toolbar where we can place some buttons UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 100, 45)]; [toolbar setBarStyle: UIBarStyleBlackOpaque]; // create an array for the but...
TITLE: adding more than two button on the navigationbar QUESTION: I am trying this but it does not work. -(void)viewDidLoad { // create a toolbar where we can place some buttons UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 100, 45)]; [toolbar setBarStyle: UIBarStyleBlackOpaque]; // create an...
[ "iphone", "objective-c", "cocoa-touch", "uinavigationbar" ]
16
11
16,076
4
0
2011-06-06T08:30:25.113000
2011-06-06T08:51:14.187000
6,249,418
6,258,984
Clients with Multiple IP Addresses - How?
I have a squid transparent proxy that authenticates client based on IP address (the only way available). The intended setup is my client would sign up, my php page logs the IP to MySql, and Squid would authenticate based on the Ip in the database. This method works well under normal scenario but I noticed there is a pr...
Any corporate user is likely sitting behind several proxies, therefore potentially every request will appear from a different source IP address. Usually for HTTPS requests the proxy system is configured to use the same source address, however for regular HTTP it is a free for all.
Clients with Multiple IP Addresses - How? I have a squid transparent proxy that authenticates client based on IP address (the only way available). The intended setup is my client would sign up, my php page logs the IP to MySql, and Squid would authenticate based on the Ip in the database. This method works well under n...
TITLE: Clients with Multiple IP Addresses - How? QUESTION: I have a squid transparent proxy that authenticates client based on IP address (the only way available). The intended setup is my client would sign up, my php page logs the IP to MySql, and Squid would authenticate based on the Ip in the database. This method ...
[ "networking", "network-programming", "ip" ]
0
2
1,015
2
0
2011-06-06T08:30:50.013000
2011-06-06T23:03:23.643000
6,249,419
6,249,869
I can't convert a flat link to a dynamic link through my .htaccess file
EDIT: The default installation of Apache2 on a Ubuntu system seems to be completely locked down. This also affects the.htaccess files as these aren't allowed to overwrite anything from the default configuration. However, editing the /etc/apache2/sites-available/default file did grant my.htaccess files enough privileges...
.* matches everything, try making it less greedy by appending a? to it: RewriteEngine on RewriteCond %{REQUEST_FILENAME}!-d RewriteRule ^(.+?)/(.+)$ $1-$2.php If this does not work, try matching everything except for a slash: RewriteEngine on RewriteCond %{REQUEST_FILENAME}!-d RewriteRule ^([^/]+)/(.+)$ $1-$2.php
I can't convert a flat link to a dynamic link through my .htaccess file EDIT: The default installation of Apache2 on a Ubuntu system seems to be completely locked down. This also affects the.htaccess files as these aren't allowed to overwrite anything from the default configuration. However, editing the /etc/apache2/si...
TITLE: I can't convert a flat link to a dynamic link through my .htaccess file QUESTION: EDIT: The default installation of Apache2 on a Ubuntu system seems to be completely locked down. This also affects the.htaccess files as these aren't allowed to overwrite anything from the default configuration. However, editing t...
[ "php", ".htaccess", "apache2" ]
1
0
241
3
0
2011-06-06T08:30:52.640000
2011-06-06T09:15:52.513000
6,249,422
6,249,910
C++0x perfect forwarding getting in the way of copy ctor?
Using MSVC2010... I have a struct that wraps a std::string, with standard move ctor's defined, as well as a perfect forwarding ctor to forward an argument to the std::string ctor. struct Wrapper { std::string value; Wrapper() { } Wrapper( Wrapper const& rhs ):value(rhs.value) { } Wrapper( Wrapper&& rhs ):value(std::...
Yes, this is the correct behaviour. There are two constructors that might be called in this case - your copy constructor and the template one. However, template constructor might deduce the type to be perfect match ( Wrapper(StringT&&) with StringT = Wrapper& yields perfect match Wrapper(Wrapper&) ) and thus gets used ...
C++0x perfect forwarding getting in the way of copy ctor? Using MSVC2010... I have a struct that wraps a std::string, with standard move ctor's defined, as well as a perfect forwarding ctor to forward an argument to the std::string ctor. struct Wrapper { std::string value; Wrapper() { } Wrapper( Wrapper const& rhs ):...
TITLE: C++0x perfect forwarding getting in the way of copy ctor? QUESTION: Using MSVC2010... I have a struct that wraps a std::string, with standard move ctor's defined, as well as a perfect forwarding ctor to forward an argument to the std::string ctor. struct Wrapper { std::string value; Wrapper() { } Wrapper( Wra...
[ "c++11" ]
3
4
402
1
0
2011-06-06T08:30:59.117000
2011-06-06T09:20:35.540000
6,249,423
6,249,490
2 tables with more than one relationship
I have 2 tables, an events and users. These 2 tables has 2 types of relationship. 1 event can have 1 creator (user) 1 user can create many events and 1 event can have many members (users) 1 user can join many events for the many-to-many relationship, I will create another table to link them. Probably named it participa...
The creator is not related to your participants, so I would not try to mix them. Add the reference to the creator as another column to the event.
2 tables with more than one relationship I have 2 tables, an events and users. These 2 tables has 2 types of relationship. 1 event can have 1 creator (user) 1 user can create many events and 1 event can have many members (users) 1 user can join many events for the many-to-many relationship, I will create another table ...
TITLE: 2 tables with more than one relationship QUESTION: I have 2 tables, an events and users. These 2 tables has 2 types of relationship. 1 event can have 1 creator (user) 1 user can create many events and 1 event can have many members (users) 1 user can join many events for the many-to-many relationship, I will cre...
[ "database-design" ]
0
2
191
2
0
2011-06-06T08:31:06.633000
2011-06-06T08:39:31.777000
6,249,428
6,249,643
Constructing a combination chart with Highcharts
I am constructing a combination chart from an ajax json object consisting of a 'spline' and 'pie'. The problem I have is only the pie chart renders, its as though the pie overrides the spline. If i remove the pie chart the spline renders correctly. Here is my code. $(document).ready(function () { var options = { chart:...
success: function (items) { var obj = jsonParse(items.d); $.each(obj, function (itemNo, item) { series = new Array(); if (itemNo == 0) { series.data = item.data; series.name = item.name; series.type = item.type; } else if (itemNo == 1) { series.type = item.type; series.data = item.data; series.name = item.name; serie...
Constructing a combination chart with Highcharts I am constructing a combination chart from an ajax json object consisting of a 'spline' and 'pie'. The problem I have is only the pie chart renders, its as though the pie overrides the spline. If i remove the pie chart the spline renders correctly. Here is my code. $(doc...
TITLE: Constructing a combination chart with Highcharts QUESTION: I am constructing a combination chart from an ajax json object consisting of a 'spline' and 'pie'. The problem I have is only the pie chart renders, its as though the pie overrides the spline. If i remove the pie chart the spline renders correctly. Here...
[ "json", "highcharts" ]
0
2
3,266
1
0
2011-06-06T08:31:50.910000
2011-06-06T08:55:03.967000
6,249,449
6,249,517
Is H2 Database able to make SQL query of the over clause with Aggregate function?
such SQL like SELECT empno, deptno, COUNT(*) OVER (PARTITION BY deptno) DEPT_COUNT FROM emp WHERE deptno IN (20, 30); is very useful. I just wonder if in H2, how do we implement the similiar function? Maybe creating a java procedure will work. But will this function be inside the roadmap of H2 database?
There is no support for windowing functions in H2. This has been discussed recently in the H2 forum: http://groups.google.com/group/h2-database/browse_thread/thread/3899106a85851de3#
Is H2 Database able to make SQL query of the over clause with Aggregate function? such SQL like SELECT empno, deptno, COUNT(*) OVER (PARTITION BY deptno) DEPT_COUNT FROM emp WHERE deptno IN (20, 30); is very useful. I just wonder if in H2, how do we implement the similiar function? Maybe creating a java procedure will ...
TITLE: Is H2 Database able to make SQL query of the over clause with Aggregate function? QUESTION: such SQL like SELECT empno, deptno, COUNT(*) OVER (PARTITION BY deptno) DEPT_COUNT FROM emp WHERE deptno IN (20, 30); is very useful. I just wonder if in H2, how do we implement the similiar function? Maybe creating a ja...
[ "sql", "h2", "window-functions" ]
5
4
5,460
1
0
2011-06-06T08:33:35.157000
2011-06-06T08:41:11.113000
6,249,456
6,249,566
uninitialized constant Base64
class Key < ActiveRecord::Base class << self def generate (key) Base64.encode64(key) end end end When calling Key.generate from a controller it works as expected. However, when calling Key.generate from a Rake::Task library I receive the error message: uninitialized constant Base64
did you put require 'base64' inside application.rb after require 'rails/all'?
uninitialized constant Base64 class Key < ActiveRecord::Base class << self def generate (key) Base64.encode64(key) end end end When calling Key.generate from a controller it works as expected. However, when calling Key.generate from a Rake::Task library I receive the error message: uninitialized constant Base64
TITLE: uninitialized constant Base64 QUESTION: class Key < ActiveRecord::Base class << self def generate (key) Base64.encode64(key) end end end When calling Key.generate from a controller it works as expected. However, when calling Key.generate from a Rake::Task library I receive the error message: uninitialized con...
[ "ruby-on-rails", "ruby-on-rails-3" ]
12
20
10,208
1
0
2011-06-06T08:34:19.040000
2011-06-06T08:46:33.937000
6,249,458
6,249,478
Pre installing android application
How to pre-install an Android application? Because I have a specific device, and I wanted to make my application pre-installed.
I'm assuming you're talking about a rom here. If you want the user to be able to delete the application you should put the.apk file in "/data/app" If you want to have the app behave like a system app (like e-mail or calendar) you can put the.apk in "/system/app"
Pre installing android application How to pre-install an Android application? Because I have a specific device, and I wanted to make my application pre-installed.
TITLE: Pre installing android application QUESTION: How to pre-install an Android application? Because I have a specific device, and I wanted to make my application pre-installed. ANSWER: I'm assuming you're talking about a rom here. If you want the user to be able to delete the application you should put the.apk fil...
[ "android" ]
8
4
8,481
2
0
2011-06-06T08:34:31.410000
2011-06-06T08:37:49.057000
6,249,468
6,251,263
representation of double and radix point
According to what I know on double (IEEE standard) there is one bit for signus, 54 bits for mantissa, a base and some bits for exponent the formula to get the double is: (−1)^s × c × b^q Maybe I made some mistake but the idea is here. I'm just wondering how we can know where to put the radix point with this formula. If...
32 = 1 * 2^5, so mantissa=1, exponent=5, sign=0. We need to add 1023 to exponent when coding the exponent, so below we have 1023+5=1028. Also we need to remove digit 1 when coding mantissa, so that 1.(whatever) becomes (whatever) Hexadecimal representation of 32 as 64-bit double is 4040000000000000, or binary: 0100 000...
representation of double and radix point According to what I know on double (IEEE standard) there is one bit for signus, 54 bits for mantissa, a base and some bits for exponent the formula to get the double is: (−1)^s × c × b^q Maybe I made some mistake but the idea is here. I'm just wondering how we can know where to ...
TITLE: representation of double and radix point QUESTION: According to what I know on double (IEEE standard) there is one bit for signus, 54 bits for mantissa, a base and some bits for exponent the formula to get the double is: (−1)^s × c × b^q Maybe I made some mistake but the idea is here. I'm just wondering how we ...
[ "c++", "double" ]
2
1
346
2
0
2011-06-06T08:35:49.163000
2011-06-06T11:20:35.873000
6,249,470
6,249,745
Jquery BUG - animation problem on mouse out
I have a div on a page with the following properties: div { width:100px; background:#0000ff; height:100px; } I am animating the border-radius of the div on mouse hover event. The animation works fine when the mouse is entering, but the animation stops working when the mouse is coming out of the DIV. You can see the LIV...
in Chrome this worked for me... it seems that the browser parses -webkit and after the animation is complete jQuery cannot get the new values so this is the code that worked for me: animateCorners = function(event) { r = (event.type=='mouseenter'? 40: 0); style = { 'border-top-left-radius': r, 'border-top-right-radius...
Jquery BUG - animation problem on mouse out I have a div on a page with the following properties: div { width:100px; background:#0000ff; height:100px; } I am animating the border-radius of the div on mouse hover event. The animation works fine when the mouse is entering, but the animation stops working when the mouse ...
TITLE: Jquery BUG - animation problem on mouse out QUESTION: I have a div on a page with the following properties: div { width:100px; background:#0000ff; height:100px; } I am animating the border-radius of the div on mouse hover event. The animation works fine when the mouse is entering, but the animation stops worki...
[ "jquery", "animation" ]
6
4
591
6
0
2011-06-06T08:35:58.037000
2011-06-06T09:03:57.010000
6,249,471
6,249,582
Decompiling java class files and comparing with svn
We have normal java files residing in the SVN. We have made some changes in those files, but it happens that, those files are lost (they are not in SVN). But we have the class files that are generated using the newly changed files. Can we use the class files, decompile them and compare it against SVN. What is the easie...
For decompiling use JAD, most commonly used tool. Comparing is a bit tricky though. I would suggest the following scenario: Grab the latest source code from SVN Build it Decompile it (!) Take your compiled classes that include some modifications but you don't have sources Decompile them as well Compare both decompiled ...
Decompiling java class files and comparing with svn We have normal java files residing in the SVN. We have made some changes in those files, but it happens that, those files are lost (they are not in SVN). But we have the class files that are generated using the newly changed files. Can we use the class files, decompil...
TITLE: Decompiling java class files and comparing with svn QUESTION: We have normal java files residing in the SVN. We have made some changes in those files, but it happens that, those files are lost (they are not in SVN). But we have the class files that are generated using the newly changed files. Can we use the cla...
[ "java", "svn", "decompiling", "filecompare" ]
1
9
4,215
6
0
2011-06-06T08:36:02.920000
2011-06-06T08:47:55.607000
6,249,475
6,249,572
Ruby on Rails Callback, what is difference between :before_save and :before_create?
Could you explain in detail what the:before_save and:before_create Ruby on Rails callbacks are, and what they have to do with Rails validations? Does validation occur after:before_save or:before_create?
In a create operation under Rails, there are six callbacks before the database operation, and two after. In order, these are: before_validation before_validation_on_create after_validation after_validation_on_create before_save before_create DATABASE INSERT after_create after_save Update operations have exactly the sam...
Ruby on Rails Callback, what is difference between :before_save and :before_create? Could you explain in detail what the:before_save and:before_create Ruby on Rails callbacks are, and what they have to do with Rails validations? Does validation occur after:before_save or:before_create?
TITLE: Ruby on Rails Callback, what is difference between :before_save and :before_create? QUESTION: Could you explain in detail what the:before_save and:before_create Ruby on Rails callbacks are, and what they have to do with Rails validations? Does validation occur after:before_save or:before_create? ANSWER: In a c...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "validation" ]
199
389
84,752
3
0
2011-06-06T08:37:20.690000
2011-06-06T08:46:59.023000
6,249,483
6,249,597
Ruby parse comma separated text file
I need some help with a Ruby script I can call from the console. The script needs to parse a simple.txt file with comma separated values. value 1, value2, value3, etc... The values needs to be added to the database. Any suggestions?
array = File.read("csv_file.txt").split(",").map(&:strip) You will get the values in the array and use it to store to database. If you want more functions, you can make use of FasterCSV gem.
Ruby parse comma separated text file I need some help with a Ruby script I can call from the console. The script needs to parse a simple.txt file with comma separated values. value 1, value2, value3, etc... The values needs to be added to the database. Any suggestions?
TITLE: Ruby parse comma separated text file QUESTION: I need some help with a Ruby script I can call from the console. The script needs to parse a simple.txt file with comma separated values. value 1, value2, value3, etc... The values needs to be added to the database. Any suggestions? ANSWER: array = File.read("csv_...
[ "ruby", "ruby-on-rails-3" ]
0
8
6,924
4
0
2011-06-06T08:38:37.137000
2011-06-06T08:49:13.247000
6,249,486
6,249,779
How can I add my app to the Settings of the iphone/ipad?
How can I make it possible to add my app in the Settings tab of the iPad? Like in here: As you can see there are 3 rows there. But I want my app in there as well. How can I do this?
You need to add a settings bundle for your app to appear in the settings app. Check this Tutorial
How can I add my app to the Settings of the iphone/ipad? How can I make it possible to add my app in the Settings tab of the iPad? Like in here: As you can see there are 3 rows there. But I want my app in there as well. How can I do this?
TITLE: How can I add my app to the Settings of the iphone/ipad? QUESTION: How can I make it possible to add my app in the Settings tab of the iPad? Like in here: As you can see there are 3 rows there. But I want my app in there as well. How can I do this? ANSWER: You need to add a settings bundle for your app to appe...
[ "objective-c", "ios" ]
8
7
7,467
2
0
2011-06-06T08:38:52.473000
2011-06-06T09:07:17.930000
6,249,491
6,249,763
An algorithm for inverting a soundwave
Hi I’m making a simple program in Objective-C and I need to get the inverse of a soundwave. I've tried searching for an algorithm for doing this but I haven't found anything. I guess it’s more complicated than just multiplying each value with -1:P Here’s my code so far, I’ve cast the data to int32_t to be able to manip...
Multiplying by -1 should work no? What output do you get? Bear in mind you won't hear ANY difference with the wave unless you layer the normal and inverted together in which case they will cancel each other out.
An algorithm for inverting a soundwave Hi I’m making a simple program in Objective-C and I need to get the inverse of a soundwave. I've tried searching for an algorithm for doing this but I haven't found anything. I guess it’s more complicated than just multiplying each value with -1:P Here’s my code so far, I’ve cast ...
TITLE: An algorithm for inverting a soundwave QUESTION: Hi I’m making a simple program in Objective-C and I need to get the inverse of a soundwave. I've tried searching for an algorithm for doing this but I haven't found anything. I guess it’s more complicated than just multiplying each value with -1:P Here’s my code ...
[ "iphone", "objective-c", "audio" ]
0
2
541
1
0
2011-06-06T08:39:33.150000
2011-06-06T09:05:51.737000
6,249,496
6,249,676
What expression method to use to get back parameter?
Simple question. I am trying to create a basic lambda expression that returns the parameter. (i, o) => o I have the first part: ParameterExpression p1 = Expression.Parameter(relationshipItems.ElementType, "i"); ParameterExpression p2 = Expression.Parameter(instanceEntities.ElementType, "o"); And the last part: LambdaEx...
Just set the body to be the second parameter, p2. You already have the reference. var p1 = Expression.Parameter(relationshipItems.ElementType, "i"); var p2 = Expression.Parameter(instanceEntities.ElementType, "o"); var body = p2; var lambda = Expression.Lambda(body, p1, p2);
What expression method to use to get back parameter? Simple question. I am trying to create a basic lambda expression that returns the parameter. (i, o) => o I have the first part: ParameterExpression p1 = Expression.Parameter(relationshipItems.ElementType, "i"); ParameterExpression p2 = Expression.Parameter(instanceEn...
TITLE: What expression method to use to get back parameter? QUESTION: Simple question. I am trying to create a basic lambda expression that returns the parameter. (i, o) => o I have the first part: ParameterExpression p1 = Expression.Parameter(relationshipItems.ElementType, "i"); ParameterExpression p2 = Expression.Pa...
[ "c#", "linq", "expression-trees" ]
2
3
116
2
0
2011-06-06T08:39:46.527000
2011-06-06T08:58:21.313000
6,249,502
6,250,118
How to detect an arrived sms message in IPhone?
How to detect an arrived SMS in code? and how can I auto check if it contains specific strings? for example I wanna send SMS to the Iphone which contains "specifString" and I want the receiver Iphone auto open my app.
You cannot, get a notification when a person receives a SMS, but you can enter a special url in that SMS that then would launch your application when clicked. In your Info.plist you have to define some key-value pairs: And then your app is launched when url like this is clicked: yourapp://?foo=1&bar=2 as you can see, y...
How to detect an arrived sms message in IPhone? How to detect an arrived SMS in code? and how can I auto check if it contains specific strings? for example I wanna send SMS to the Iphone which contains "specifString" and I want the receiver Iphone auto open my app.
TITLE: How to detect an arrived sms message in IPhone? QUESTION: How to detect an arrived SMS in code? and how can I auto check if it contains specific strings? for example I wanna send SMS to the Iphone which contains "specifString" and I want the receiver Iphone auto open my app. ANSWER: You cannot, get a notificat...
[ "iphone", "objective-c" ]
4
4
4,023
2
0
2011-06-06T08:40:16.403000
2011-06-06T09:36:31.963000
6,249,504
6,260,291
Recommended testing frameworks for Rails 2 app with randomness
I have a Rails 2.3.5 app which is serving a card game. I've been a bit lax in writing tests for it (read: I haven't written any:embarrassed:), and I'd like to make a start now. From reading other questions, I think I probably want to be using Shoulda extending Test::Unit for unit testing. I wondered about using Capybar...
If the majority of the users' interactions are via POST, is it via an API (as opposed to filling out forms or something)? Just about any combination of RSpec/Shoulda/Capybara/Test Unit/Rack::Test could work for you depending on your need. They're all capable. However, these are my recommendations: If you've decided you...
Recommended testing frameworks for Rails 2 app with randomness I have a Rails 2.3.5 app which is serving a card game. I've been a bit lax in writing tests for it (read: I haven't written any:embarrassed:), and I'd like to make a start now. From reading other questions, I think I probably want to be using Shoulda extend...
TITLE: Recommended testing frameworks for Rails 2 app with randomness QUESTION: I have a Rails 2.3.5 app which is serving a card game. I've been a bit lax in writing tests for it (read: I haven't written any:embarrassed:), and I'd like to make a start now. From reading other questions, I think I probably want to be us...
[ "ruby-on-rails", "rspec", "capybara", "shoulda" ]
0
2
310
1
0
2011-06-06T08:40:19.677000
2011-06-07T03:19:06.053000
6,249,514
6,249,954
numpy argmin elegant solution required.
In python to find the index of the minimum value of the array I use y = numpy.argmin(someMat) Can i find the minimum value of this matrix such that it does not lie within a specified range in a neat way?
"Can i find the minimum value of this matrix such that it does not lie within a specified range in a neat way?" If you only care about the minimum value satisfying some condition and not the location, then >>> numpy.random.seed(1) >>> m = numpy.random.randn(5.,5.) >>> m array([[ 1.62434536, -0.61175641, -0.52817175, -1...
numpy argmin elegant solution required. In python to find the index of the minimum value of the array I use y = numpy.argmin(someMat) Can i find the minimum value of this matrix such that it does not lie within a specified range in a neat way?
TITLE: numpy argmin elegant solution required. QUESTION: In python to find the index of the minimum value of the array I use y = numpy.argmin(someMat) Can i find the minimum value of this matrix such that it does not lie within a specified range in a neat way? ANSWER: "Can i find the minimum value of this matrix such...
[ "python", "numpy", "scipy" ]
3
7
8,480
2
0
2011-06-06T08:40:58.570000
2011-06-06T09:24:17.600000
6,249,516
6,250,703
Hosting games locally with Flash?
I just can't find the right Google search terms for this... Is it possible to use Flash (or a Flash compatible service) to allow players in a game to host their own games (using their own bandwidth), through a web browser? In a way, to run their own game servers (for a Flash in-browser game) from their computer, but th...
I am guessing that you want to make some kind of "game room" on which users can join local sessions hosted by themselves. The word you are looking for is P2P. Some useful links: http://www.flashrealtime.com/local-flash-peer-to-peer-communication-over-lan-without-cirrus/ http://www.flashrealtime.com/video-on-demand-over...
Hosting games locally with Flash? I just can't find the right Google search terms for this... Is it possible to use Flash (or a Flash compatible service) to allow players in a game to host their own games (using their own bandwidth), through a web browser? In a way, to run their own game servers (for a Flash in-browser...
TITLE: Hosting games locally with Flash? QUESTION: I just can't find the right Google search terms for this... Is it possible to use Flash (or a Flash compatible service) to allow players in a game to host their own games (using their own bandwidth), through a web browser? In a way, to run their own game servers (for ...
[ "flash", "networking", "browser", "actionscript" ]
3
2
215
2
0
2011-06-06T08:41:06.403000
2011-06-06T10:28:50.603000
6,249,518
6,249,638
Binding only part of the margin property of WPF control
I have this:... I want to bind only the "Top" part of the TabControl, which intuitively I would do it this way:... How do I do it?
Have you tried using a converter like this? in VB.Net Public Class MarginConverter Implements IValueConverter Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConv...
Binding only part of the margin property of WPF control I have this:... I want to bind only the "Top" part of the TabControl, which intuitively I would do it this way:... How do I do it?
TITLE: Binding only part of the margin property of WPF control QUESTION: I have this:... I want to bind only the "Top" part of the TabControl, which intuitively I would do it this way:... How do I do it? ANSWER: Have you tried using a converter like this? in VB.Net Public Class MarginConverter Implements IValueConver...
[ "wpf", "binding", "margin" ]
62
59
52,721
7
0
2011-06-06T08:41:35.857000
2011-06-06T08:53:58.823000
6,249,519
6,249,603
Query doesn't work on c# but work on powershell
Anyone know why my query "select Name, ProcessID, Caption from Win32_Process where ProcessId='" + processIds[index] + "'" return Column 'Name' does not belong to table Win32_Process in my program C#. In powershell when I execute Get-WmiObject -query "select Name, ProcessID, Caption from win32_process" It's works! Strin...
This code: const string queryString = "SELECT Name, ProcessID, Caption FROM Win32_Process"; var scope = new ManagementScope(@"\root\cimv2"); var query = new ObjectQuery(queryString); var searcher = new ManagementObjectSearcher(scope, query); var objectCollection = searcher.Get(); foreach (var o in objectCollection) {...
Query doesn't work on c# but work on powershell Anyone know why my query "select Name, ProcessID, Caption from Win32_Process where ProcessId='" + processIds[index] + "'" return Column 'Name' does not belong to table Win32_Process in my program C#. In powershell when I execute Get-WmiObject -query "select Name, ProcessI...
TITLE: Query doesn't work on c# but work on powershell QUESTION: Anyone know why my query "select Name, ProcessID, Caption from Win32_Process where ProcessId='" + processIds[index] + "'" return Column 'Name' does not belong to table Win32_Process in my program C#. In powershell when I execute Get-WmiObject -query "sel...
[ "c#", "process", "win32-process" ]
1
2
963
1
0
2011-06-06T08:42:03.313000
2011-06-06T08:50:02.423000
6,249,521
6,249,733
Android Custom expandeablelistivew without xml layout
I am following below code to create expandablistView in android withour xml layout.its working fine,but I don't know how I can change an image If I use an image in child/group layout? I already done code to adding the ImageView on childes/group views but how I can refresh/change the image posted using ImageView on chil...
First you will need to change your data in order to know which row will have a different picture. Then you can call BaseExpandableListAdapter.notifyDataSetChanged() which will have the effect of calling getChildView again on each row. Then you will be able to setBackgroundDrawable() on each image view you want to chang...
Android Custom expandeablelistivew without xml layout I am following below code to create expandablistView in android withour xml layout.its working fine,but I don't know how I can change an image If I use an image in child/group layout? I already done code to adding the ImageView on childes/group views but how I can r...
TITLE: Android Custom expandeablelistivew without xml layout QUESTION: I am following below code to create expandablistView in android withour xml layout.its working fine,but I don't know how I can change an image If I use an image in child/group layout? I already done code to adding the ImageView on childes/group vie...
[ "android", "expandablelistview" ]
0
0
916
1
0
2011-06-06T08:42:10.923000
2011-06-06T09:03:05.520000
6,249,522
6,250,342
Loading meshes from .obj (or any other) File into DirectX9/C++ project
Currently I have a 3D Cube that I drew by writing coordinates, that can rotate and move on a black screen. Now I have a Model that I created in "3Ds Max" (It's a little backyard with high stonewalls, so I'm trying to use it as my world object. ) and I want to load this model into my DirectX9/C++ project. As far as I se...
AFAIK, DirectX does not support wavefront object files out of the box. You will need an external mesh loader for that purpose. I can remember, that in the DX 10 SDK is a sample of how to load an.obj file, I think the sample is called MeshFromOBJ10. I don't know if it is of any use in DirectX 9. As far as I know, the st...
Loading meshes from .obj (or any other) File into DirectX9/C++ project Currently I have a 3D Cube that I drew by writing coordinates, that can rotate and move on a black screen. Now I have a Model that I created in "3Ds Max" (It's a little backyard with high stonewalls, so I'm trying to use it as my world object. ) and...
TITLE: Loading meshes from .obj (or any other) File into DirectX9/C++ project QUESTION: Currently I have a 3D Cube that I drew by writing coordinates, that can rotate and move on a black screen. Now I have a Model that I created in "3Ds Max" (It's a little backyard with high stonewalls, so I'm trying to use it as my w...
[ "c++", "directx", "mesh", "directx-9" ]
2
4
6,442
2
0
2011-06-06T08:42:39.093000
2011-06-06T09:56:43.010000