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,237,312
6,241,014
c# mvc structure - easy question
I need some information here. I am totally new at MVC therefore for you guys, I think it will be an easy question to answer. I have the following structure: Controller.cs Public ActionResult PageMain() { return View(); // this is the main page I'm working with } [ChildActionOnly] Public PartialViewResult Partial1(stri...
A few things I would change here First, here: Response.Redirect("url to PageMain"); You want to instead return a RedirectToAction("PageMain") second - make Pagemain only valid for get requests by using the HttpGet attribute. [HttpGet] public actionResult PageMain() { return View(); // this is the main page I'm working ...
c# mvc structure - easy question I need some information here. I am totally new at MVC therefore for you guys, I think it will be an easy question to answer. I have the following structure: Controller.cs Public ActionResult PageMain() { return View(); // this is the main page I'm working with } [ChildActionOnly] Publi...
TITLE: c# mvc structure - easy question QUESTION: I need some information here. I am totally new at MVC therefore for you guys, I think it will be an easy question to answer. I have the following structure: Controller.cs Public ActionResult PageMain() { return View(); // this is the main page I'm working with } [Chil...
[ "asp.net-mvc", "structure", "partial-views", "modelstate" ]
0
1
209
1
0
2011-06-04T14:31:30.987000
2011-06-05T04:31:18.647000
6,237,315
6,237,429
jsp php json communication
I have Json response from my database. I am using Php for this which can be viewed over here. In this we can search the record from identifier value like identifier =123. Is that possible to to show this response in the Jsp page. like when i put the identifier value in the text box of jsp page,it can give the response ...
Since the PHP response does not have the access control headers which would allow crossdomain access by JS/Ajax, you would need to handle this fully at the server side. Use java.net.URL to get the PHP response as an InputStream. Use a JSON (de)serializer like Google Gson to convert the JSON string to an fullworthy Java...
jsp php json communication I have Json response from my database. I am using Php for this which can be viewed over here. In this we can search the record from identifier value like identifier =123. Is that possible to to show this response in the Jsp page. like when i put the identifier value in the text box of jsp pag...
TITLE: jsp php json communication QUESTION: I have Json response from my database. I am using Php for this which can be viewed over here. In this we can search the record from identifier value like identifier =123. Is that possible to to show this response in the Jsp page. like when i put the identifier value in the t...
[ "php", "json", "jsp" ]
1
1
462
1
0
2011-06-04T14:32:07.487000
2011-06-04T14:54:14.650000
6,237,317
6,238,680
Magento Custom Payment Gateway
I'm trying to write a custom payment gateway for Magento. The module is recognised in the administration backend (System - Config - Payment Methods), but when reaching 'Payment Information' in the frontend, the option to select the module does not appear. Below contains the three XML files I have created, and the direc...
The values you setup in system.xml are global Magento configuration values. Payment module's are required to include a configuration field named model, which specifies the PHP class that's responsible for payment logic. Take a look in app/code/core/Mage/Payment/etc/system.xml Typically, a module makes this a hidden con...
Magento Custom Payment Gateway I'm trying to write a custom payment gateway for Magento. The module is recognised in the administration backend (System - Config - Payment Methods), but when reaching 'Payment Information' in the frontend, the option to select the module does not appear. Below contains the three XML file...
TITLE: Magento Custom Payment Gateway QUESTION: I'm trying to write a custom payment gateway for Magento. The module is recognised in the administration backend (System - Config - Payment Methods), but when reaching 'Payment Information' in the frontend, the option to select the module does not appear. Below contains ...
[ "magento", "payment" ]
4
5
3,710
2
0
2011-06-04T14:32:14.047000
2011-06-04T18:45:20.050000
6,237,326
6,237,385
Linking UI objects together : could I do it with attributes?
I'm currently working on a custom UI engine for a game. I've very basic C# skills (I'm a C programmer by trade) and I'm having problems figuring out how to link a UI element with the data it represents. Here's what I mean: class SomeClass { //some stuff //This is what I want to monitor and/or modify. private SomeType ...
What you want to do is called 'Databinding'. Specificly in your situation, it is Object Data Binding. Follow this link and it will get you started.
Linking UI objects together : could I do it with attributes? I'm currently working on a custom UI engine for a game. I've very basic C# skills (I'm a C programmer by trade) and I'm having problems figuring out how to link a UI element with the data it represents. Here's what I mean: class SomeClass { //some stuff //Th...
TITLE: Linking UI objects together : could I do it with attributes? QUESTION: I'm currently working on a custom UI engine for a game. I've very basic C# skills (I'm a C programmer by trade) and I'm having problems figuring out how to link a UI element with the data it represents. Here's what I mean: class SomeClass { ...
[ "c#", "winforms", "data-binding" ]
3
2
78
1
0
2011-06-04T14:34:01.177000
2011-06-04T14:45:54.263000
6,237,349
6,243,187
How to use GCC to compile C code to 8088 Assembly?
I've been looking for a piece of information and couldn't seem to find it, maybe you guys could give me a hand. It's a simple question: How to use GCC to compile C code into 8088 assembly? I'm coding a small program in 8088 assembly and would like to know how some things are done by the compiler, this would be really g...
There is an 16 bit release of djgpp (which is based on gcc), which is said to be able to produce 8086/88 code here
How to use GCC to compile C code to 8088 Assembly? I've been looking for a piece of information and couldn't seem to find it, maybe you guys could give me a hand. It's a simple question: How to use GCC to compile C code into 8088 assembly? I'm coding a small program in 8088 assembly and would like to know how some thin...
TITLE: How to use GCC to compile C code to 8088 Assembly? QUESTION: I've been looking for a piece of information and couldn't seem to find it, maybe you guys could give me a hand. It's a simple question: How to use GCC to compile C code into 8088 assembly? I'm coding a small program in 8088 assembly and would like to ...
[ "c", "gcc", "compiler-construction", "assembly" ]
10
3
5,632
4
0
2011-06-04T14:37:49.320000
2011-06-05T13:24:00.703000
6,237,356
6,237,438
Why does MyClass.__class__ return a different value than MyClass().__class__?
I want to be able to call 'person.Person. class ' and get back 'class person.Person', like it does for a person object: >>> p = person.Person() >>> p.__class__ >>> person.Person.__class__ Here is the Person inheritance tree... class TypeSystem(object): __metaclass__ = TypeSystemMeta class Model(TypeSystem): pass clas...
In Python, even classes are objects and every object is an instance of a class. Person refers to the "class object", which is an instance of type. In this case, there's a metaclass in the play - highly confusing metaprogramming magic, but if you want an introduction, see What is a metaclass in Python?. If you declare a...
Why does MyClass.__class__ return a different value than MyClass().__class__? I want to be able to call 'person.Person. class ' and get back 'class person.Person', like it does for a person object: >>> p = person.Person() >>> p.__class__ >>> person.Person.__class__ Here is the Person inheritance tree... class TypeSyste...
TITLE: Why does MyClass.__class__ return a different value than MyClass().__class__? QUESTION: I want to be able to call 'person.Person. class ' and get back 'class person.Person', like it does for a person object: >>> p = person.Person() >>> p.__class__ >>> person.Person.__class__ Here is the Person inheritance tree....
[ "python", "inheritance", "reflection", "multiple-inheritance", "method-resolution-order" ]
0
5
342
3
0
2011-06-04T14:39:21.310000
2011-06-04T14:56:27.723000
6,237,361
6,237,369
regex remove whitespaces and match exact words
I'm don't know regex really well, so can someone give me example how to fix this regex http://rubular.com/r/UdzYMJc9iE: /\b([stack over flow]+)+\b/ not to match whitespaces and to match only exact words (stack matches ac as word, I want to match only stack), tia. I want when we have 'lorem etiam nam' to match only thes...
If you only want to match three alternatives, use the | syntax, and group them into normal parenthesis: /\b(stack|over|flow)+\b/ Not sure about the + or what exactly you wanted to match.
regex remove whitespaces and match exact words I'm don't know regex really well, so can someone give me example how to fix this regex http://rubular.com/r/UdzYMJc9iE: /\b([stack over flow]+)+\b/ not to match whitespaces and to match only exact words (stack matches ac as word, I want to match only stack), tia. I want wh...
TITLE: regex remove whitespaces and match exact words QUESTION: I'm don't know regex really well, so can someone give me example how to fix this regex http://rubular.com/r/UdzYMJc9iE: /\b([stack over flow]+)+\b/ not to match whitespaces and to match only exact words (stack matches ac as word, I want to match only stac...
[ "php", "regex", "whitespace" ]
1
2
1,075
3
0
2011-06-04T14:40:26.167000
2011-06-04T14:44:27.063000
6,237,364
6,237,391
D operator overloading
import std.stdio; struct Vector2 { float x, y; this (float x, float y) { this.x = x; this.y = y; } // vector2 * number Vector2 opBinary(string op)(const float rhs) if (op == "*") { auto result = this; this *= rhs; return this; } // number * vector2 Vector2 opBinaryRight(string op)(const float lhs) if (op == "*") { ...
Why would you expect it to pass? first *= 3 modifies first, so it doesn't retain its original value. Perhaps you meant to write Vector2 result = first * 3;? There is also a problem with Vector2 opBinary(string op)(const float rhs) That function is what is used in expression like 10 * v. Your code modifies this in the e...
D operator overloading import std.stdio; struct Vector2 { float x, y; this (float x, float y) { this.x = x; this.y = y; } // vector2 * number Vector2 opBinary(string op)(const float rhs) if (op == "*") { auto result = this; this *= rhs; return this; } // number * vector2 Vector2 opBinaryRight(string op)(const float...
TITLE: D operator overloading QUESTION: import std.stdio; struct Vector2 { float x, y; this (float x, float y) { this.x = x; this.y = y; } // vector2 * number Vector2 opBinary(string op)(const float rhs) if (op == "*") { auto result = this; this *= rhs; return this; } // number * vector2 Vector2 opBinaryRight(stri...
[ "operator-overloading", "d" ]
3
4
260
1
0
2011-06-04T14:42:33.590000
2011-06-04T14:46:47.773000
6,237,374
6,237,434
How can i check if a template is compiled out?
Is there a simple way to check if my template has been optimized out? After using #define HIDE_IT the code in play is below. I'm sure this code is optimized out so i get 0 overhead from defining Property but i like to check if possible (without going into assembly. Trivial code is hard enough to read after the optimize...
There's no other way other than looking at the assembly. The only way it can be "optimised out" is by inlining those functions, and you can only check that by looking at the source. That being said, on any modern compiler you can be pretty sure that those functions will be inlined in optimised code.
How can i check if a template is compiled out? Is there a simple way to check if my template has been optimized out? After using #define HIDE_IT the code in play is below. I'm sure this code is optimized out so i get 0 overhead from defining Property but i like to check if possible (without going into assembly. Trivial...
TITLE: How can i check if a template is compiled out? QUESTION: Is there a simple way to check if my template has been optimized out? After using #define HIDE_IT the code in play is below. I'm sure this code is optimized out so i get 0 overhead from defining Property but i like to check if possible (without going into...
[ "c++", "templates", "optimization" ]
1
5
109
1
0
2011-06-04T14:44:54.837000
2011-06-04T14:55:27.133000
6,237,375
6,237,408
HTML table generated with PHP
function destinations(){ global $db; $numri1 = $db->query("SELECT * FROM destinations WHERE direction='1';"); $i = 1; while ($row = mysql_fetch_array($numri1)) { if ($i % 2!= "0") # An odd row $rowColor = "bgC1"; else # An even row $rowColor = "bgC2"; $direction1.= ' '.$i.' '.$row['name'].' '; $i++; } $table1 = '
You're missing a quote at the end of your style attribute. Change: ^ See this fiddle? No table displayed! Now have a look at this fiddle.
HTML table generated with PHP function destinations(){ global $db; $numri1 = $db->query("SELECT * FROM destinations WHERE direction='1';"); $i = 1; while ($row = mysql_fetch_array($numri1)) { if ($i % 2!= "0") # An odd row $rowColor = "bgC1"; else # An even row $rowColor = "bgC2"; $direction1.= ' '.$i.' '.$row['name...
TITLE: HTML table generated with PHP QUESTION: function destinations(){ global $db; $numri1 = $db->query("SELECT * FROM destinations WHERE direction='1';"); $i = 1; while ($row = mysql_fetch_array($numri1)) { if ($i % 2!= "0") # An odd row $rowColor = "bgC1"; else # An even row $rowColor = "bgC2"; $direction1.= ' '...
[ "php", "html-table" ]
0
4
161
1
0
2011-06-04T14:44:57.423000
2011-06-04T14:49:08.427000
6,237,378
6,237,842
insert into sqlite table with unique column
I'm inserting values into my table (from python code) as follows: cur.execute("insert into t(a, b, c) values (?,?,?)", (a, b, c)) There is a unique constraint on column c. What is a common way of insert if I want to cover the case when we're inserting duplicate value for c column? I have some ideas select everything fr...
You could use INSERT OR REPLACE to update rows with a unique constraint, or INSERT OR IGNORE to ignore inserts which conflict with a unique constraint: import sqlite3 def insert_or_replace(): # https://sqlite.org/lang_insert.html connection=sqlite3.connect(':memory:') cursor=connection.cursor() cursor.execute('CREATE ...
insert into sqlite table with unique column I'm inserting values into my table (from python code) as follows: cur.execute("insert into t(a, b, c) values (?,?,?)", (a, b, c)) There is a unique constraint on column c. What is a common way of insert if I want to cover the case when we're inserting duplicate value for c co...
TITLE: insert into sqlite table with unique column QUESTION: I'm inserting values into my table (from python code) as follows: cur.execute("insert into t(a, b, c) values (?,?,?)", (a, b, c)) There is a unique constraint on column c. What is a common way of insert if I want to cover the case when we're inserting duplic...
[ "python", "sqlite" ]
7
14
11,307
2
0
2011-06-04T14:45:23.003000
2011-06-04T16:09:03.817000
6,237,388
6,238,163
A template for button skins using FXG graphics?
The UI in my app uses a lot of buttons that are mostly the same minus the FXG graphics used in their skins. Their skins look something like this [HostComponent("spark.components.Button")] where RectangleGraphic and SmallButtonLineSeparatorGraphic are FXGs that are used across all buttons, and ButtonTextGraphic and Butt...
You'll have to do some ActionScript magic to make it work. Probably Leave RectangleGraphic and SmallButtonLineSeparatorGraphic as they are in MXML. Create variables for ButtonTextGraphic and ButtonSymbolGraphic. I'll just demonstrate using ButtonTextGraphic a sample. Something like this: public var buttonTextGraphicCla...
A template for button skins using FXG graphics? The UI in my app uses a lot of buttons that are mostly the same minus the FXG graphics used in their skins. Their skins look something like this [HostComponent("spark.components.Button")] where RectangleGraphic and SmallButtonLineSeparatorGraphic are FXGs that are used ac...
TITLE: A template for button skins using FXG graphics? QUESTION: The UI in my app uses a lot of buttons that are mostly the same minus the FXG graphics used in their skins. Their skins look something like this [HostComponent("spark.components.Button")] where RectangleGraphic and SmallButtonLineSeparatorGraphic are FXG...
[ "apache-flex", "fxg" ]
1
2
1,265
1
0
2011-06-04T14:46:03.743000
2011-06-04T17:05:58.423000
6,237,390
6,237,405
split to preg_split?
after 10 years with php i still S*** in regex, could you please help me converting this $x_ary=split('&x=',$url); to the preg_split equivalent? Thank you
In most cases you just need to add delimiters: preg_split('/&x=/',$url) / are fine if you do not need them as part of the pattern. And none of the other symbols are meta characters, so don't need escaping. Take note that in your case you could just use explode instead, since you don't need a regex.
split to preg_split? after 10 years with php i still S*** in regex, could you please help me converting this $x_ary=split('&x=',$url); to the preg_split equivalent? Thank you
TITLE: split to preg_split? QUESTION: after 10 years with php i still S*** in regex, could you please help me converting this $x_ary=split('&x=',$url); to the preg_split equivalent? Thank you ANSWER: In most cases you just need to add delimiters: preg_split('/&x=/',$url) / are fine if you do not need them as part of ...
[ "php", "split", "preg-split" ]
1
3
1,147
1
0
2011-06-04T14:46:13.703000
2011-06-04T14:48:36.050000
6,237,402
6,238,040
DOMDocument::saveHTML($domnode) in PHP 5.2?
I have several functions in a class that return saveHTML(). After I echo more than one function in the class saveHTML(), it repeats some of the HTML. I initially solved this by doing saveHTML($node) but that doesn't seem to be an option now. I didn't know saveHTML($domnode) was only available in PHP 5.3.6 and I have no...
What I do, is just save the node as XML. There are a few differences in the syntax, but it's good enough for most uses: return $dom->saveXml($node);
DOMDocument::saveHTML($domnode) in PHP 5.2? I have several functions in a class that return saveHTML(). After I echo more than one function in the class saveHTML(), it repeats some of the HTML. I initially solved this by doing saveHTML($node) but that doesn't seem to be an option now. I didn't know saveHTML($domnode) w...
TITLE: DOMDocument::saveHTML($domnode) in PHP 5.2? QUESTION: I have several functions in a class that return saveHTML(). After I echo more than one function in the class saveHTML(), it repeats some of the HTML. I initially solved this by doing saveHTML($node) but that doesn't seem to be an option now. I didn't know sa...
[ "php", "dom" ]
7
10
2,633
2
0
2011-06-04T14:48:27.723000
2011-06-04T16:46:26.993000
6,237,403
6,237,487
c++ inheritance darray from array
i do this in the education purpose. such is idea: i have class Array. I inheritance it in class Darray, and add necessary dimension it likes so: main.cpp int main(int argc, char *argv[]) { Array obj; obj.output(); DArray obj2; obj2.output(); return 0; } header class Array { public: int *x,sizem; //одно измерение, м...
There are no memory leaks, but there is one mismatch between new and delete: You're using new[] here: for(i=1;i but you're using delete (not delete[] ) here: for(int i=1;i With that changed to delete[] z[i];, there are no warnings from valgrind: ==29235== HEAP SUMMARY: ==29235== in use at exit: 0 bytes in 0 blocks ==29...
c++ inheritance darray from array i do this in the education purpose. such is idea: i have class Array. I inheritance it in class Darray, and add necessary dimension it likes so: main.cpp int main(int argc, char *argv[]) { Array obj; obj.output(); DArray obj2; obj2.output(); return 0; } header class Array { public:...
TITLE: c++ inheritance darray from array QUESTION: i do this in the education purpose. such is idea: i have class Array. I inheritance it in class Darray, and add necessary dimension it likes so: main.cpp int main(int argc, char *argv[]) { Array obj; obj.output(); DArray obj2; obj2.output(); return 0; } header clas...
[ "c++" ]
0
1
641
3
0
2011-06-04T14:48:32.543000
2011-06-04T15:05:58.593000
6,237,409
6,238,382
MVC3 Exposing repository functionality through service
I've been playing around with asp.net MVC3 a bit and have been struggling to decide where to place my business logic. I've settled on using a service layer for now: public class AnimalsService: IAnimalsService { private readonly IAnimalsRepository _animalsRepository; public AnimalsService(IAnimalsRepository animalsRep...
1) Do I have to create wrapper methods in the service for these respository calls? Mostly, yes. Typically, you want to offer CRUD for your domain models in the service layer. This way, the controller does not need to work with the repository directly (in fact, it never should). You can add more more sophisticated logic...
MVC3 Exposing repository functionality through service I've been playing around with asp.net MVC3 a bit and have been struggling to decide where to place my business logic. I've settled on using a service layer for now: public class AnimalsService: IAnimalsService { private readonly IAnimalsRepository _animalsRepositor...
TITLE: MVC3 Exposing repository functionality through service QUESTION: I've been playing around with asp.net MVC3 a bit and have been struggling to decide where to place my business logic. I've settled on using a service layer for now: public class AnimalsService: IAnimalsService { private readonly IAnimalsRepository...
[ "c#", "asp.net-mvc-3" ]
1
3
838
3
0
2011-06-04T14:49:10.640000
2011-06-04T17:42:23.443000
6,237,425
6,237,466
Java Hashset Search
Good afternoon In Java, I have HashSet which contain list of Object User which has properties: email group machinename now my hashset has following values (list of above object) email | group | machinename ---------------------------------------- robert@yahoo.com | hewitt | AP1 Mathew@gmail.com | test | AP1 melody@app....
This will do exactly what you want: Set users = new HashSet (); //... Map > hits = new HashMap >(); for (User user: users) { String key = user.getMachineName() + user.getEmail(); List list = hits.get(key); if (list == null) { list = new ArrayList (); hits.put(key, list); } list.add(user); } // Users are now grouped ...
Java Hashset Search Good afternoon In Java, I have HashSet which contain list of Object User which has properties: email group machinename now my hashset has following values (list of above object) email | group | machinename ---------------------------------------- robert@yahoo.com | hewitt | AP1 Mathew@gmail.com | te...
TITLE: Java Hashset Search QUESTION: Good afternoon In Java, I have HashSet which contain list of Object User which has properties: email group machinename now my hashset has following values (list of above object) email | group | machinename ---------------------------------------- robert@yahoo.com | hewitt | AP1 Mat...
[ "java", "find", "hashset" ]
0
3
3,913
1
0
2011-06-04T14:52:09.583000
2011-06-04T15:01:54.667000
6,237,428
6,237,507
Animating element background image when hovering another element with jQuery
I'm trying to switch the background image of an element (e.g. body ) when hovering another (e.g. nav ), having some sort of fade transition between the two images using jQuery. I've been reading similar questions at stackoverflow and tried almost every example without much luck. Resources index.html styles.css scripts....
If you want a fade transition inbetween your backgrounds, it can't be done by solely changing the background-image from one to another. You'll need to at least create one other element which you can fadeIn and out. For example like this: var d = $(' ').width($('body').width()).height($(window).height()).attr('id','fake...
Animating element background image when hovering another element with jQuery I'm trying to switch the background image of an element (e.g. body ) when hovering another (e.g. nav ), having some sort of fade transition between the two images using jQuery. I've been reading similar questions at stackoverflow and tried alm...
TITLE: Animating element background image when hovering another element with jQuery QUESTION: I'm trying to switch the background image of an element (e.g. body ) when hovering another (e.g. nav ), having some sort of fade transition between the two images using jQuery. I've been reading similar questions at stackover...
[ "jquery", "html", "css", "jquery-animate" ]
0
2
1,108
3
0
2011-06-04T14:53:16.867000
2011-06-04T15:10:26.327000
6,237,453
6,237,473
PHP PCRE pattern
I want to understand the following pattern, step by step. /\p{L}/u /u is a modifier (http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php): u (PCRE8) This modifier turns on additional functionality of PCRE that is incompatible with Perl. > Pattern strings are treated as UTF-8. This modifier is available fr...
Check the PHP documentation about escape sequences to find out about \p{xx}, then Unicode character properties to find out what \p{L} does. To elaborate: the u modifier makes it possible to use Unicode escape sequences \p{xx} is a Unicode sequence with a certain property \p{L} is a Unicode sequence that matches a lette...
PHP PCRE pattern I want to understand the following pattern, step by step. /\p{L}/u /u is a modifier (http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php): u (PCRE8) This modifier turns on additional functionality of PCRE that is incompatible with Perl. > Pattern strings are treated as UTF-8. This modifie...
TITLE: PHP PCRE pattern QUESTION: I want to understand the following pattern, step by step. /\p{L}/u /u is a modifier (http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php): u (PCRE8) This modifier turns on additional functionality of PCRE that is incompatible with Perl. > Pattern strings are treated as U...
[ "php", "regex", "unicode", "utf-8" ]
2
3
453
1
0
2011-06-04T14:59:08.233000
2011-06-04T15:03:06.917000
6,237,457
6,243,169
Binding onChange Event to jHtmlArea textarea
How do I bind an onchange event to this jQuery plugin. I want to save the content the user types in this textarea. So I will bind an onchange event and post on ajax.
I actually wrote a jQuery plugin to solve this issue. This jQuery plugin, takes an element and watches if the user has entered some data, by accessin the elements keypress and keyup elements. Have a look at the plugin here and its source is up on github Please let me know if you have any queries:-)
Binding onChange Event to jHtmlArea textarea How do I bind an onchange event to this jQuery plugin. I want to save the content the user types in this textarea. So I will bind an onchange event and post on ajax.
TITLE: Binding onChange Event to jHtmlArea textarea QUESTION: How do I bind an onchange event to this jQuery plugin. I want to save the content the user types in this textarea. So I will bind an onchange event and post on ajax. ANSWER: I actually wrote a jQuery plugin to solve this issue. This jQuery plugin, takes an...
[ "jquery", "jquery-plugins", "jquery-events" ]
0
0
1,858
2
0
2011-06-04T15:00:18.787000
2011-06-05T13:20:58.370000
6,237,458
6,237,535
Sort vectors within 2D Vectors
I have a problem sorting vectors in 2D vector? I would like to sort them based on their capacity from the largest to the smallest. Example: ROWS {{1,2,3},{1,2},{1,2,3,4,5}} it should be sorted as ROWS.capacity(); // ROWS {{1,2,3,4,5},{1,2,3},{1,2}} The following is part of the code i did until now: std::vector< std::ve...
You could use std::sort with a custom ordering predicate: struct CapacityGreater: public std::binary_function, std::vector,bool> { bool operator()(const std::vector &a, const std::vector &b) const { return a.capacity() > b.capacity(); } }; std::sort(ROWS.begin(), ROWS.end(), CapacityGreater()); This should work well i...
Sort vectors within 2D Vectors I have a problem sorting vectors in 2D vector? I would like to sort them based on their capacity from the largest to the smallest. Example: ROWS {{1,2,3},{1,2},{1,2,3,4,5}} it should be sorted as ROWS.capacity(); // ROWS {{1,2,3,4,5},{1,2,3},{1,2}} The following is part of the code i did ...
TITLE: Sort vectors within 2D Vectors QUESTION: I have a problem sorting vectors in 2D vector? I would like to sort them based on their capacity from the largest to the smallest. Example: ROWS {{1,2,3},{1,2},{1,2,3,4,5}} it should be sorted as ROWS.capacity(); // ROWS {{1,2,3,4,5},{1,2,3},{1,2}} The following is part ...
[ "arrays", "sorting", "vector", "multidimensional-array", "swap" ]
1
1
916
2
0
2011-06-04T15:00:24.490000
2011-06-04T15:14:45.247000
6,237,467
6,237,522
How to access data directory when updating an Android app where I have changed the package in the Manifest
I have an Android app in the Market and I want to push an update. The problem is that after refactoring my base package name in the Manifest file is completely different. I feel I'm in trouble because (in order to migrate old data) I need to access a file stored in: /data/data/old_app_pkg_name/app_data but with my refa...
You probably can't. Unfortunately Android generates a new user the combination of package name and signing certificate. If you had created your old files as WORLD_READABLE on the SD card then maybe you would have been able to do it, but as far as I am aware once you change the package name you can't get to the old dire...
How to access data directory when updating an Android app where I have changed the package in the Manifest I have an Android app in the Market and I want to push an update. The problem is that after refactoring my base package name in the Manifest file is completely different. I feel I'm in trouble because (in order to...
TITLE: How to access data directory when updating an Android app where I have changed the package in the Manifest QUESTION: I have an Android app in the Market and I want to push an update. The problem is that after refactoring my base package name in the Manifest file is completely different. I feel I'm in trouble be...
[ "android", "android-manifest", "google-play" ]
2
3
389
2
0
2011-06-04T15:02:02.977000
2011-06-04T15:11:57.493000
6,237,470
6,245,012
MyObject[] return json object instead of array when size < 2
In my REST webservice that produces json, I have a method that return an object that contains an array of MyObject. Now I have the problem that when the MyObject[] has only one item in it, it show a single object instead of an array. Example; If the object has a single item; { "myObjectList": { "name": "Test", "value":...
Apparently this is a known bug, the solution can be found here; http://blogs.oracle.com/enterprisetechtips/entry/configuring_json_for_restful_web
MyObject[] return json object instead of array when size < 2 In my REST webservice that produces json, I have a method that return an object that contains an array of MyObject. Now I have the problem that when the MyObject[] has only one item in it, it show a single object instead of an array. Example; If the object ha...
TITLE: MyObject[] return json object instead of array when size < 2 QUESTION: In my REST webservice that produces json, I have a method that return an object that contains an array of MyObject. Now I have the problem that when the MyObject[] has only one item in it, it show a single object instead of an array. Example...
[ "java", "json", "rest", "jax-ws" ]
2
1
2,736
2
0
2011-06-04T15:02:31.443000
2011-06-05T18:43:37.240000
6,237,472
6,237,501
mysql compare two tables
I have a mysql database that has 2 table. the first table contains the user information, and the second table contains the votes. there is a common field between the two (userid). but after checking the num rows in each table I found that the first table contains nearly 1000 users more than the second, so there are alm...
You need to join both tables and filter out which users don't have corresponding record in votes table. SELECT id FROM members LEFT JOIN votes ON userid=id WHERE votes.userid IS NULL
mysql compare two tables I have a mysql database that has 2 table. the first table contains the user information, and the second table contains the votes. there is a common field between the two (userid). but after checking the num rows in each table I found that the first table contains nearly 1000 users more than the...
TITLE: mysql compare two tables QUESTION: I have a mysql database that has 2 table. the first table contains the user information, and the second table contains the votes. there is a common field between the two (userid). but after checking the num rows in each table I found that the first table contains nearly 1000 u...
[ "mysql", "arrays", "compare" ]
0
2
504
1
0
2011-06-04T15:02:58.823000
2011-06-04T15:09:36.777000
6,237,484
6,237,547
How to concatenate two .wav files in R?
How do I concatenate two.wav files in R? I've checked sound and audio packages and I still don't know how to do it.
Have you tried appendSample(s1, s2,...) with saveSample(s, filename, overwrite) in sound package (CRAN)? appendSample: Description: Append two or more Sample objects or wav files. Usage: appendSample(s1, s2,...) Arguments: s1, s2,... Sample objects, or the names of wav files. Details: If the samples have different samp...
How to concatenate two .wav files in R? How do I concatenate two.wav files in R? I've checked sound and audio packages and I still don't know how to do it.
TITLE: How to concatenate two .wav files in R? QUESTION: How do I concatenate two.wav files in R? I've checked sound and audio packages and I still don't know how to do it. ANSWER: Have you tried appendSample(s1, s2,...) with saveSample(s, filename, overwrite) in sound package (CRAN)? appendSample: Description: Appen...
[ "r", "file" ]
1
9
1,520
1
0
2011-06-04T15:05:37.967000
2011-06-04T15:17:02.813000
6,237,486
6,237,519
need help understanding this code in book "jquery in action"
This code in the book jQuery in action, on page 156. I don't understand this part: {opacity:'toggle'} Can toggle be an opacity value? $.fn.fadeToggle = function(speed){ return this.animate({opacity:'toggle'},speed); };
From the documentation: In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'. These shortcuts allow for custom hiding and showing animations that take into account the display type of the element. Using toggle will animate the opacity of the element at the speed you specify -- ...
need help understanding this code in book "jquery in action" This code in the book jQuery in action, on page 156. I don't understand this part: {opacity:'toggle'} Can toggle be an opacity value? $.fn.fadeToggle = function(speed){ return this.animate({opacity:'toggle'},speed); };
TITLE: need help understanding this code in book "jquery in action" QUESTION: This code in the book jQuery in action, on page 156. I don't understand this part: {opacity:'toggle'} Can toggle be an opacity value? $.fn.fadeToggle = function(speed){ return this.animate({opacity:'toggle'},speed); }; ANSWER: From the docu...
[ "javascript", "jquery" ]
2
2
111
6
0
2011-06-04T15:05:45.567000
2011-06-04T15:11:46.253000
6,237,491
6,237,497
php mySQL insertion issue
Do you see something wrong in this insertion?? It does not work for me.. $insSubm = "INSERT INTO cR_Submissions memberID ='".$memberID."', RefNumb='".$RefNumb."', title ='".$title."', CopyRightNumb='".$copyRightNumbWork."', type='".$natureTypeWork."', OtherTitle='".$alternateTitleWork."', OwnershipTransfer='".$textarea...
That's invalid SQL syntax. The SQL syntax is: INSERT INTO table (field1, field2,..., fieldN) VALUES (val1, val2,..., valN) An alternative MySQL syntax for this is: INSERT INTO table SET field1 = val1, field2 = val2,..., fieldN = valN You're missing the SET keyword. Check out the INSERT Syntax documentation for more abo...
php mySQL insertion issue Do you see something wrong in this insertion?? It does not work for me.. $insSubm = "INSERT INTO cR_Submissions memberID ='".$memberID."', RefNumb='".$RefNumb."', title ='".$title."', CopyRightNumb='".$copyRightNumbWork."', type='".$natureTypeWork."', OtherTitle='".$alternateTitleWork."', Owne...
TITLE: php mySQL insertion issue QUESTION: Do you see something wrong in this insertion?? It does not work for me.. $insSubm = "INSERT INTO cR_Submissions memberID ='".$memberID."', RefNumb='".$RefNumb."', title ='".$title."', CopyRightNumb='".$copyRightNumbWork."', type='".$natureTypeWork."', OtherTitle='".$alternate...
[ "php", "mysql" ]
0
4
60
3
0
2011-06-04T15:06:35.033000
2011-06-04T15:09:01.410000
6,237,494
6,237,597
JQuery Animate function. Accessing the new "top" and "left" values
I'm trying to create a particular effect - where essentially various elements move around within a parent element. The overall intention is that I have a kind of PONG style movement, where the elements collide with the edge of the parent object and redirect themselves. (possibly even colliding with each other). This is...
The problem you are having is that you check an attribuate that never is changed. What you are really wanting is to check for the element's top value. Do this with the css property. if($(this).css("top") > 50) $(this).attr("yforce", -10); Suggestion Use the css("top") always instead of the.attr("top") because you are t...
JQuery Animate function. Accessing the new "top" and "left" values I'm trying to create a particular effect - where essentially various elements move around within a parent element. The overall intention is that I have a kind of PONG style movement, where the elements collide with the edge of the parent object and redi...
TITLE: JQuery Animate function. Accessing the new "top" and "left" values QUESTION: I'm trying to create a particular effect - where essentially various elements move around within a parent element. The overall intention is that I have a kind of PONG style movement, where the elements collide with the edge of the pare...
[ "jquery", "css", "jquery-animate" ]
0
1
1,091
3
0
2011-06-04T15:07:31.640000
2011-06-04T15:26:42.880000
6,237,513
6,237,551
Complex css menu
I have a menu: Home Home Page About About My Website Contact Get in touch My current CSS is as follow:.headerMenu{ width: 100%; }.headerMenu ul{ margin: 0; padding: 0; float: left; }.headerMenu ul li{ display: inline; }.headerMenu ul li a{ float: left; color: white; padding-top:25px; padding-left:50px; font-size:24pt; ...
1) How can i get the content in the span tag to be below the Main text. You need to use display: block on the span to have it appear on a new line:.headerMenu ul li a span { display: block; } 2) When i hover over the anchor, How do i add the hover image as shown in screen shot Try to center the arrow to the top. This m...
Complex css menu I have a menu: Home Home Page About About My Website Contact Get in touch My current CSS is as follow:.headerMenu{ width: 100%; }.headerMenu ul{ margin: 0; padding: 0; float: left; }.headerMenu ul li{ display: inline; }.headerMenu ul li a{ float: left; color: white; padding-top:25px; padding-left:50px;...
TITLE: Complex css menu QUESTION: I have a menu: Home Home Page About About My Website Contact Get in touch My current CSS is as follow:.headerMenu{ width: 100%; }.headerMenu ul{ margin: 0; padding: 0; float: left; }.headerMenu ul li{ display: inline; }.headerMenu ul li a{ float: left; color: white; padding-top:25px; ...
[ "css" ]
4
3
238
2
0
2011-06-04T15:11:07.947000
2011-06-04T15:17:50.220000
6,237,514
6,256,486
Write to a Remote file with Fabric
I am trying to backup databases and move them around to different servers using Fabric. When on a remote server, to open a file for writing it fails with the error. newFile = open('%s%s' % (dumpPath,newFileName),'w') IOError: [Errno 2] No such file or directory: '/home/ec2-user/dbbackup.sql.bz2' That files exists, and ...
I don't know if you can open a file remotely. But even if you can, it may not be a good idea in your case, since you will be fetching the large file over ssh (remember that Fabric is still running on your local machine). Why not compress the file remotely, and then get the compressed file? In case of mysqldump, it woul...
Write to a Remote file with Fabric I am trying to backup databases and move them around to different servers using Fabric. When on a remote server, to open a file for writing it fails with the error. newFile = open('%s%s' % (dumpPath,newFileName),'w') IOError: [Errno 2] No such file or directory: '/home/ec2-user/dbback...
TITLE: Write to a Remote file with Fabric QUESTION: I am trying to backup databases and move them around to different servers using Fabric. When on a remote server, to open a file for writing it fails with the error. newFile = open('%s%s' % (dumpPath,newFileName),'w') IOError: [Errno 2] No such file or directory: '/ho...
[ "python", "fabric" ]
4
5
11,697
3
0
2011-06-04T15:11:10.160000
2011-06-06T18:37:39.807000
6,237,515
6,237,558
Why do SVG images on a page cause Chrome to use 100% of the CPU?
I am using an SVG image on a page (via the CSS background-image property) and when I view this page in Chrome (version 11.0.696.71 on Windows), one of my CPU cores goes to 100% and stays there permanently. My SVG image is quite simple and is defined in its own XML file: Update: You may need to use the SVG in a specific...
This is caused by the implicit width and height of 100% on the svg element. Explicitly specifying width="100%" height="100%" on the svg element causes the same issue. I've discovered that the problem can be solved by using unit-less dimensions, e.g. width="1" height="1". Here is a modified version of my SVG file that f...
Why do SVG images on a page cause Chrome to use 100% of the CPU? I am using an SVG image on a page (via the CSS background-image property) and when I view this page in Chrome (version 11.0.696.71 on Windows), one of my CPU cores goes to 100% and stays there permanently. My SVG image is quite simple and is defined in it...
TITLE: Why do SVG images on a page cause Chrome to use 100% of the CPU? QUESTION: I am using an SVG image on a page (via the CSS background-image property) and when I view this page in Chrome (version 11.0.696.71 on Windows), one of my CPU cores goes to 100% and stays there permanently. My SVG image is quite simple an...
[ "google-chrome", "svg", "cpu-usage" ]
7
8
4,011
2
0
2011-06-04T15:11:13.283000
2011-06-04T15:19:11.657000
6,237,526
6,237,548
Android:Service Activity Start and Stop Control
Hello Android Gurus For API Level 7 and Above--> I am badly struck trying to figure out a solution for the following problem: I have an activity which i would use to Kick start an Service. This is an infinite loop service which can run forever. I would like to disconnect the Service from Activity and at a later point o...
Multiple questions: You can disconnect/reconnect from the Service using bind. Unfortunately the best advice to give there is to carefully read the documentation for Service at http://developer.android.com/reference/android/app/Service.html: look carefully at the Local Service example, as it demonstrates what you need t...
Android:Service Activity Start and Stop Control Hello Android Gurus For API Level 7 and Above--> I am badly struck trying to figure out a solution for the following problem: I have an activity which i would use to Kick start an Service. This is an infinite loop service which can run forever. I would like to disconnect ...
TITLE: Android:Service Activity Start and Stop Control QUESTION: Hello Android Gurus For API Level 7 and Above--> I am badly struck trying to figure out a solution for the following problem: I have an activity which i would use to Kick start an Service. This is an infinite loop service which can run forever. I would l...
[ "android", "service", "android-activity" ]
0
2
6,117
2
0
2011-06-04T15:12:26.813000
2011-06-04T15:17:06.180000
6,237,530
6,238,130
Crawling youtube user info
I'm trying to crawl Youtube to retrieve information about a group of users (approx. 200 people). I'm interested in looking for relationships between the users: contacts subscribers subscriptions what videos they commented on etc I've managed to get contact information with the following source: import gdata.youtube imp...
In order to access a user's subscriptions feed without the user being logged in, the user must check the "Subscribe to a channel" checkbox under his Account Sharing settings. Currently, there is no direct way to get a channel's subscribers through the gdata API. In fact, there has been an outstanding feature request fo...
Crawling youtube user info I'm trying to crawl Youtube to retrieve information about a group of users (approx. 200 people). I'm interested in looking for relationships between the users: contacts subscribers subscriptions what videos they commented on etc I've managed to get contact information with the following sourc...
TITLE: Crawling youtube user info QUESTION: I'm trying to crawl Youtube to retrieve information about a group of users (approx. 200 people). I'm interested in looking for relationships between the users: contacts subscribers subscriptions what videos they commented on etc I've managed to get contact information with t...
[ "python", "youtube", "gdata" ]
1
2
2,043
1
0
2011-06-04T15:13:30.357000
2011-06-04T17:00:43.080000
6,237,533
6,238,332
Issue with changing child div style using jQuery (via class selector)
this is more curiosity question rather than a problem) With my Rails 3 application I generate a lots of blocks, which contain div elements. One block looks like this: <%= link_to... %> <%= link_to... %> <%= link_to... %> <%= link_to... %> And now Im trying to toggle "ranking" div visibility on mouseOVER. It wasnt so ea...
Why are you doing this in javascript? This is clearly something that belongs in css. You will get a lot clearer code, A better separation between markup, content and behavior and a huge performance gain. example
Issue with changing child div style using jQuery (via class selector) this is more curiosity question rather than a problem) With my Rails 3 application I generate a lots of blocks, which contain div elements. One block looks like this: <%= link_to... %> <%= link_to... %> <%= link_to... %> <%= link_to... %> And now Im ...
TITLE: Issue with changing child div style using jQuery (via class selector) QUESTION: this is more curiosity question rather than a problem) With my Rails 3 application I generate a lots of blocks, which contain div elements. One block looks like this: <%= link_to... %> <%= link_to... %> <%= link_to... %> <%= link_to...
[ "jquery", "css", "html" ]
3
1
1,772
4
0
2011-06-04T15:14:21.297000
2011-06-04T17:34:11.703000
6,237,534
6,237,806
Get Facebook OAuth token from code parameter
I build a FB app which does the following: 1) redirect initial request to FB, in order to authenticate/login, as follows: https://www.facebook.com/dialog/oauth?client_id=MYAPPID&redirect_uri=http://localhost:8080/FB/servlet&scope=read_stream&response_type=code 2) in servlet, get the "code" parameter (which is the signe...
On the facebook docs it tells you to send it back to facebook: http://developers.facebook.com/docs/authentication/ Basically you do this: https://graph.facebook.com/oauth/access_token? client_id=YOUR_APP_ID&redirect_uri=YOUR_URL& client_secret=YOUR_APP_SECRET&code=THE_CODE_FROM_ABOVE This should work for you normally.
Get Facebook OAuth token from code parameter I build a FB app which does the following: 1) redirect initial request to FB, in order to authenticate/login, as follows: https://www.facebook.com/dialog/oauth?client_id=MYAPPID&redirect_uri=http://localhost:8080/FB/servlet&scope=read_stream&response_type=code 2) in servlet,...
TITLE: Get Facebook OAuth token from code parameter QUESTION: I build a FB app which does the following: 1) redirect initial request to FB, in order to authenticate/login, as follows: https://www.facebook.com/dialog/oauth?client_id=MYAPPID&redirect_uri=http://localhost:8080/FB/servlet&scope=read_stream&response_type=c...
[ "java", "facebook", "oauth", "access-token" ]
1
5
9,516
1
0
2011-06-04T15:14:39.220000
2011-06-04T16:00:54.273000
6,237,537
6,237,554
Finding matching objects in an array of objects?
var set = [{"color":"blue"},{"color":"green"},{"color":"red"},{"color":"green"}]; I'd like to be able to do something like a db call, set.find({"color":"green"}) and have it return an array full of objects that contain that property.
Using Array#filter, for this particular case the code would look like var results = set.filter(function (entry) { return entry.color === "green"; }); Array#filter is not implemented in some older browsers, so see the linked article for a backward compatibility shim, or better yet get a full-fledged ES5 shim. For the mo...
Finding matching objects in an array of objects? var set = [{"color":"blue"},{"color":"green"},{"color":"red"},{"color":"green"}]; I'd like to be able to do something like a db call, set.find({"color":"green"}) and have it return an array full of objects that contain that property.
TITLE: Finding matching objects in an array of objects? QUESTION: var set = [{"color":"blue"},{"color":"green"},{"color":"red"},{"color":"green"}]; I'd like to be able to do something like a db call, set.find({"color":"green"}) and have it return an array full of objects that contain that property. ANSWER: Using Arra...
[ "javascript" ]
49
90
127,169
5
0
2011-06-04T15:14:54.417000
2011-06-04T15:18:42.697000
6,237,549
6,237,566
How can I output an "&" in RoR without getting "&amp;"?
Controller code: class HelpController View code: And it redirects to THIS: example.com/auth?user_id=1234&redirect_to=http://google.ru This: http://example.com/auth?user_id=1234 & amp; redirect_to=http://google.ru (without spaces)
In Rails 3, you can call the.html_safe method to tell rails that you have verified the content is safe to send unescaped. See http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/ for an explanation of the motivation for the default escaping behavior. The idiom is reversed from older versions of rails, where you ...
How can I output an "&" in RoR without getting "&amp;"? Controller code: class HelpController View code: And it redirects to THIS: example.com/auth?user_id=1234&redirect_to=http://google.ru This: http://example.com/auth?user_id=1234 & amp; redirect_to=http://google.ru (without spaces)
TITLE: How can I output an "&" in RoR without getting "&amp;"? QUESTION: Controller code: class HelpController View code: And it redirects to THIS: example.com/auth?user_id=1234&redirect_to=http://google.ru This: http://example.com/auth?user_id=1234 & amp; redirect_to=http://google.ru (without spaces) ANSWER: In Rail...
[ "ruby-on-rails" ]
0
2
76
2
0
2011-06-04T15:17:11.387000
2011-06-04T15:21:07.550000
6,237,556
6,237,783
How to model the associations for a task application?
I'm working on a goal completion application, where there can be Goals, Milestones, and Tasks. Milestones belong to goals, goals can have many milestones, and tasks can belong to either goals, milestones, or stand on their own. The information I want to store in each model is as follows: Goal content:string, est_comple...
1) Your single table inheritance question is well answered here. 2) I recommend keeping it simple for your days column. Just store a string of digits, with each digit representing a day. So 245 might represent Monday, Wednesday & Thursday. To find tasks that occur on Wednesday you can query with a regular expression, e...
How to model the associations for a task application? I'm working on a goal completion application, where there can be Goals, Milestones, and Tasks. Milestones belong to goals, goals can have many milestones, and tasks can belong to either goals, milestones, or stand on their own. The information I want to store in eac...
TITLE: How to model the associations for a task application? QUESTION: I'm working on a goal completion application, where there can be Goals, Milestones, and Tasks. Milestones belong to goals, goals can have many milestones, and tasks can belong to either goals, milestones, or stand on their own. The information I wa...
[ "ruby-on-rails", "ruby-on-rails-3", "data-modeling" ]
0
0
86
1
0
2011-06-04T15:18:57.560000
2011-06-04T15:58:25.837000
6,237,559
6,261,930
How to get xml data using ajax in jquery?
I want to use ajax in jquery to get data for my page... The problem is that the url which i call has some query strings to be sent along with it... for example: the url which i call for getting data is:- http://mysite.in.dataengine.aspx?t=abcde&token=h34jk3&f=xml the data i get in response from this url can be in xml f...
Thanks for your help guys...but i have found the solution....Like i said...that i get in return either xml or javascript array...So..i'm using javascript arrays.. and using a function in jquery* ($.getScript) * which fetches an external javascript code via ajax...Thus i am getting all my data now through ajax in jquery...
How to get xml data using ajax in jquery? I want to use ajax in jquery to get data for my page... The problem is that the url which i call has some query strings to be sent along with it... for example: the url which i call for getting data is:- http://mysite.in.dataengine.aspx?t=abcde&token=h34jk3&f=xml the data i get...
TITLE: How to get xml data using ajax in jquery? QUESTION: I want to use ajax in jquery to get data for my page... The problem is that the url which i call has some query strings to be sent along with it... for example: the url which i call for getting data is:- http://mysite.in.dataengine.aspx?t=abcde&token=h34jk3&f=...
[ "ajax", "jquery" ]
0
0
14,909
4
0
2011-06-04T15:19:13.087000
2011-06-07T07:30:55.033000
6,237,560
6,237,681
Android static method plots background thread data nicely in real-time, but is it a good solution?
I've been asking a series of evolving questions regarding my Android project that continually plots Bluetooth data in real-time. And I haven't done a very good job of asking questions. So what I need to do is edit this question, clean it up, add important detail, and most importantly I need to add code fragments of rel...
I found the method in the background thread that writes BluetoothData to the Logcat. So I am leveraging this method to call a static method, plotData(BluetoothData), in the Plotting Activity. It works nicely plotting the incoming BluetoothData in real-time. This story does not add up, or BluetoothData is misnamed. In A...
Android static method plots background thread data nicely in real-time, but is it a good solution? I've been asking a series of evolving questions regarding my Android project that continually plots Bluetooth data in real-time. And I haven't done a very good job of asking questions. So what I need to do is edit this qu...
TITLE: Android static method plots background thread data nicely in real-time, but is it a good solution? QUESTION: I've been asking a series of evolving questions regarding my Android project that continually plots Bluetooth data in real-time. And I haven't done a very good job of asking questions. So what I need to ...
[ "android", "multithreading", "static", "android-activity", "real-time" ]
1
6
1,300
1
0
2011-06-04T15:19:47.223000
2011-06-04T15:39:15.243000
6,237,565
6,237,713
real time drawing - what to use
Hello I want to do a small web based game in which there will be 2 users and one of them needs to draw something in canvas and the second one needs to guess what is that. Both of the sides needs to see the process of drawing... very simple game. What should I use to make it? Javascript, Java, jQuery, or maybe something...
I would suggest to go with jQuery + some canvas plugin (like jCanvas) on the client side and anything you want (PHP/Java/C#/etc) on the server side.
real time drawing - what to use Hello I want to do a small web based game in which there will be 2 users and one of them needs to draw something in canvas and the second one needs to guess what is that. Both of the sides needs to see the process of drawing... very simple game. What should I use to make it? Javascript, ...
TITLE: real time drawing - what to use QUESTION: Hello I want to do a small web based game in which there will be 2 users and one of them needs to draw something in canvas and the second one needs to guess what is that. Both of the sides needs to see the process of drawing... very simple game. What should I use to mak...
[ "graphics", "drawing" ]
0
0
151
2
0
2011-06-04T15:21:06.753000
2011-06-04T15:45:01.497000
6,237,569
6,237,888
Python socket.send() can only send once, then socket.error: [Errno 32] Broken pipe occurred
I'm a newbie in network programming, so please forgive me if this is a dumb question:) I created 1 client and 1 SocketServer.ThreadingMixIn server on Ubuntu 10.04.2 using Python2.7, but it seems like I can only call sock.send() once in client, then I'll get a: Traceback (most recent call last): File "testClient1.py", l...
handle() is called in the SocketServer.StreamRequestHandler once for each connection. If you return from handle the connection is closed. If you want the server to handle more than one send/recv, you must loop until recv() returns 0, indicating the client closed the connection (or at least called shutdown() on sends). ...
Python socket.send() can only send once, then socket.error: [Errno 32] Broken pipe occurred I'm a newbie in network programming, so please forgive me if this is a dumb question:) I created 1 client and 1 SocketServer.ThreadingMixIn server on Ubuntu 10.04.2 using Python2.7, but it seems like I can only call sock.send() ...
TITLE: Python socket.send() can only send once, then socket.error: [Errno 32] Broken pipe occurred QUESTION: I'm a newbie in network programming, so please forgive me if this is a dumb question:) I created 1 client and 1 SocketServer.ThreadingMixIn server on Ubuntu 10.04.2 using Python2.7, but it seems like I can only...
[ "python", "socketserver", "broken-pipe" ]
12
17
27,360
1
0
2011-06-04T15:21:44.120000
2011-06-04T16:16:27.017000
6,237,577
6,237,653
How to display a dialogbox inside a tab control page?
How do i set another dialogbox visible inside the tab thats currently open in the Tab Control object? I'm creating the Tab Control in the Visual Studio 2008 resource editor (or how its called?), i created IDD_FORMVIEW dialogbox for the tab control. I know how to initialize the tab texts, handle the currently selected t...
All the 'tab pages' which are dialogues should be set as children to the tab that is created. When a tab is changed you will get a notify message which you can handle in your DialogProc like this: case WM_NOTIFY: { switch( ( ( LPNMHDR ) lParam) -> code ) { case TCN_SELCHANGE: { if( TabCtrl_GetCurSel( ( ( LPNMHDR ) lPar...
How to display a dialogbox inside a tab control page? How do i set another dialogbox visible inside the tab thats currently open in the Tab Control object? I'm creating the Tab Control in the Visual Studio 2008 resource editor (or how its called?), i created IDD_FORMVIEW dialogbox for the tab control. I know how to ini...
TITLE: How to display a dialogbox inside a tab control page? QUESTION: How do i set another dialogbox visible inside the tab thats currently open in the Tab Control object? I'm creating the Tab Control in the Visual Studio 2008 resource editor (or how its called?), i created IDD_FORMVIEW dialogbox for the tab control....
[ "c++", "visual-studio-2008", "winapi" ]
0
2
2,690
1
0
2011-06-04T15:23:52.057000
2011-06-04T15:34:10.793000
6,237,578
6,237,657
How to start a process when application run?
I want to add a process to my application, the process should be started to listen some events when the application run. I searched in Internet, and I didn't find answers... Some people said that could use "Application.Run", but I didn't find this function in VB.NET project. Did I miss it?
Use the Process.Start static method, under System.Diagnostics namespace. You should be able to just write the path to the file and it should start it.
How to start a process when application run? I want to add a process to my application, the process should be started to listen some events when the application run. I searched in Internet, and I didn't find answers... Some people said that could use "Application.Run", but I didn't find this function in VB.NET project....
TITLE: How to start a process when application run? QUESTION: I want to add a process to my application, the process should be started to listen some events when the application run. I searched in Internet, and I didn't find answers... Some people said that could use "Application.Run", but I didn't find this function ...
[ "vb.net", "process" ]
2
1
570
1
0
2011-06-04T15:24:08.733000
2011-06-04T15:36:08.640000
6,237,580
6,237,604
Adding projects to a project in Visual Studio 2010
I'm developing an application that uses Managed WiFi. Normally I would just add the.dll to the project, but this library comes as a regular VS project. How do I use it in my program? I tried adding Interop.sc and WlanApi.cs to my project, but WiFi classes are not recognised.
Just add the ManagedWifi project to your solution and then reference if from your main project (Add reference → Projects tab).
Adding projects to a project in Visual Studio 2010 I'm developing an application that uses Managed WiFi. Normally I would just add the.dll to the project, but this library comes as a regular VS project. How do I use it in my program? I tried adding Interop.sc and WlanApi.cs to my project, but WiFi classes are not recog...
TITLE: Adding projects to a project in Visual Studio 2010 QUESTION: I'm developing an application that uses Managed WiFi. Normally I would just add the.dll to the project, but this library comes as a regular VS project. How do I use it in my program? I tried adding Interop.sc and WlanApi.cs to my project, but WiFi cla...
[ "c#", "visual-studio" ]
3
3
6,623
4
0
2011-06-04T15:24:26.023000
2011-06-04T15:27:57.860000
6,237,589
6,237,613
How do I get event listeners to recognize new document elements?
How can I get jQuery event listeners to listen to elements loaded through ajax calls? I load comments into my document via ajax. Each comment has an ajax delete button. For comments that were loaded originally with the document, my function works fine. But any newly created comments, or comments retrieved through ajax,...
Updated Answer Today, the appropriate way to do this is to use the on method with an additional selector. For instance, if we wanted to listen for any click on images we could do this: $("img").on("click", function () { alert( "You clicked on " + this.src ); }); This will not work for any image elements added to the DO...
How do I get event listeners to recognize new document elements? How can I get jQuery event listeners to listen to elements loaded through ajax calls? I load comments into my document via ajax. Each comment has an ajax delete button. For comments that were loaded originally with the document, my function works fine. Bu...
TITLE: How do I get event listeners to recognize new document elements? QUESTION: How can I get jQuery event listeners to listen to elements loaded through ajax calls? I load comments into my document via ajax. Each comment has an ajax delete button. For comments that were loaded originally with the document, my funct...
[ "jquery" ]
6
13
2,580
2
0
2011-06-04T15:25:22.123000
2011-06-04T15:28:50.273000
6,237,607
6,237,787
Multiple xml feeds, sql match
I'm developing a store which gets its product info from lots of xml feed, I'll have maybe 3000 products in my database. I'll do it using a cronjob. What I'd like to do is write posts, lets say a general post about picking the best TV set for yor family. Then I'd make a mysql match whitch should take the posts title and...
What you are trying to do is awful with pure XML. I strongly suggest you to leave this task to your Database in this case MySQL, basically your 3rd point. With MyISAM table you can set up the full text search if you need a bit more complex query based on affinity.
Multiple xml feeds, sql match I'm developing a store which gets its product info from lots of xml feed, I'll have maybe 3000 products in my database. I'll do it using a cronjob. What I'd like to do is write posts, lets say a general post about picking the best TV set for yor family. Then I'd make a mysql match whitch s...
TITLE: Multiple xml feeds, sql match QUESTION: I'm developing a store which gets its product info from lots of xml feed, I'll have maybe 3000 products in my database. I'll do it using a cronjob. What I'd like to do is write posts, lets say a general post about picking the best TV set for yor family. Then I'd make a my...
[ "php", "mysql", "xml", "feed" ]
0
1
147
1
0
2011-06-04T15:28:21.280000
2011-06-04T15:58:37.877000
6,237,612
6,237,644
Class return NSMutabledata
I want to write a class which return NSMutableData, i have this code but couldn't manage how it return self. any help would be great. @interface ITumblr_QueryTumblr: NSMutableData { NSURLConnection* connection; NSMutableData* data; } -(void)loadImageFromURL:(NSURL*)url { if (connection!=nil) { [connection release];...
A class doesn't return anything, though a method can. To have a method that returns data, use -(NSMutableData *)returnSomeData { return data; } Alternately, you can just call the property.data from an instance of your class.
Class return NSMutabledata I want to write a class which return NSMutableData, i have this code but couldn't manage how it return self. any help would be great. @interface ITumblr_QueryTumblr: NSMutableData { NSURLConnection* connection; NSMutableData* data; } -(void)loadImageFromURL:(NSURL*)url { if (connection!=n...
TITLE: Class return NSMutabledata QUESTION: I want to write a class which return NSMutableData, i have this code but couldn't manage how it return self. any help would be great. @interface ITumblr_QueryTumblr: NSMutableData { NSURLConnection* connection; NSMutableData* data; } -(void)loadImageFromURL:(NSURL*)url { ...
[ "iphone", "xcode", "sdk", "nsmutabledata" ]
0
4
178
2
0
2011-06-04T15:28:48.300000
2011-06-04T15:33:07.050000
6,237,629
6,237,643
UTF-8 and HTML entities
I try to eject text from Word.DOC file with PHP. All seems ok, but the only trouble is something like СУДОВА БУХГАЛТЕРІЯ instead of russian text. I've tried to use html_entity_decode and utf8_encode, but they didn't help. Is there any simple solution?
html_entity_decode should work with the proper parameters (unless you’re using PHP 5.3.3 or later): html_entity_decode($str, ENT_QUOTES, 'UTF-8') This will convert the character references into UTF-8. Before PHP 5.3.3, the charset parameter’s default value was ISO-8859-1. In that case the cyrillic characters can’t be c...
UTF-8 and HTML entities I try to eject text from Word.DOC file with PHP. All seems ok, but the only trouble is something like СУДОВА БУХГАЛТЕРІЯ instead of russian text. I've tried to use html_entity_decode and utf8_encode, but they didn't help. Is there any simple solution?
TITLE: UTF-8 and HTML entities QUESTION: I try to eject text from Word.DOC file with PHP. All seems ok, but the only trouble is something like СУДОВА БУХГАЛТЕРІЯ instead of russian text. I've tried to use html_entity_decode and utf8_encode, but they didn't help. Is there any simple solution? ANSWER: html_entity_decod...
[ "php", "utf-8" ]
5
4
1,524
1
0
2011-06-04T15:31:08.733000
2011-06-04T15:33:03.833000
6,237,632
6,241,735
Orbeon Text Areas and RTEs as CDATA
Is there a way in Orbeon to save TextAreas and RTEs as CDATA sections so that line breaks and other formatting inputted by the user is preserved? In some use cases it's really important not to change what the user has entered and I haven't found a way to accomplish this to date. Thanks!
In general, formatting and line breaks should be preserved by default. If the input is modified, there are three possible "culprits": the RTE component itself, Tagsoup, and clean-html.xsl. There are certain limitations regarding the RTE component (AFAIK orbeon still uses YUI 2), for example it doesn't handle p elements...
Orbeon Text Areas and RTEs as CDATA Is there a way in Orbeon to save TextAreas and RTEs as CDATA sections so that line breaks and other formatting inputted by the user is preserved? In some use cases it's really important not to change what the user has entered and I haven't found a way to accomplish this to date. Than...
TITLE: Orbeon Text Areas and RTEs as CDATA QUESTION: Is there a way in Orbeon to save TextAreas and RTEs as CDATA sections so that line breaks and other formatting inputted by the user is preserved? In some use cases it's really important not to change what the user has entered and I haven't found a way to accomplish ...
[ "orbeon", "xforms" ]
1
2
288
1
0
2011-06-04T15:31:22.430000
2011-06-05T08:20:48.300000
6,237,635
6,237,670
Java - Get/set methods receiving and returning "null"
I'm a beginner in Java. I'm trying, for training purpose, to build myself a chess game application. Within my class Case, that will be used to instanciate all the 64 cases of my board, I write get/set methods to find if there's a Piece occupant in the instances of the case. I read that returning "null" is a bad practic...
A space on the board being unoccupied is not exceptional. Its normal and will always be true for the majority of the board. You should not be throwing exceptions here; exceptions should only be thrown for an unexpected event that signify a significant problem with what you are trying to do. You can certainly pass null ...
Java - Get/set methods receiving and returning "null" I'm a beginner in Java. I'm trying, for training purpose, to build myself a chess game application. Within my class Case, that will be used to instanciate all the 64 cases of my board, I write get/set methods to find if there's a Piece occupant in the instances of t...
TITLE: Java - Get/set methods receiving and returning "null" QUESTION: I'm a beginner in Java. I'm trying, for training purpose, to build myself a chess game application. Within my class Case, that will be used to instanciate all the 64 cases of my board, I write get/set methods to find if there's a Piece occupant in ...
[ "java", "null", "get", "set" ]
8
10
16,846
6
0
2011-06-04T15:31:37.730000
2011-06-04T15:37:38.173000
6,237,640
6,237,668
htaccesss redirect / google webmaster's "change of address"
so I have this in my.htaccess: Redirect / http://blabla.net/ (which redirects all pages from my old domain, blabla.com, to my new domain - blabla.net) I also wanted to use "change of address" from the google webmater tools, but it tells me that my old site is not verified (even though it is), and that's because it gets...
You can use RewriteCond to check for that specific request. RewriteCond %{REQUEST_URI}!=/google4befdedcf3629c8a.html Also, I would encourage you to update your Redirect to respond with a 301 if this is a permanent redirection (the default is 302). Redirect 301 / http://blabla.net/ UPDATE RewriteCond uses mod_rewrite, w...
htaccesss redirect / google webmaster's "change of address" so I have this in my.htaccess: Redirect / http://blabla.net/ (which redirects all pages from my old domain, blabla.com, to my new domain - blabla.net) I also wanted to use "change of address" from the google webmater tools, but it tells me that my old site is ...
TITLE: htaccesss redirect / google webmaster's "change of address" QUESTION: so I have this in my.htaccess: Redirect / http://blabla.net/ (which redirects all pages from my old domain, blabla.com, to my new domain - blabla.net) I also wanted to use "change of address" from the google webmater tools, but it tells me th...
[ ".htaccess", "redirect", "google-search-console" ]
2
2
2,721
2
0
2011-06-04T15:32:37.670000
2011-06-04T15:37:15.073000
6,237,642
6,237,687
How can I check the existence of a GitHub repo?
I coding a PHP script that has to check if exists a GitHub repo that the user enters. But I don't know how can I do it. I think the main matter is to know which HTTP code gives GitHub, but I can't find anything like that in cURL PHP documentation. How can I do it?
HTTP in istelf is a rather simple protocol, so just check if you get a 404. That'd mean it doesn't exist. As an alternative to cURL, you might want to consider using get_headers, that's less intensive to write.
How can I check the existence of a GitHub repo? I coding a PHP script that has to check if exists a GitHub repo that the user enters. But I don't know how can I do it. I think the main matter is to know which HTTP code gives GitHub, but I can't find anything like that in cURL PHP documentation. How can I do it?
TITLE: How can I check the existence of a GitHub repo? QUESTION: I coding a PHP script that has to check if exists a GitHub repo that the user enters. But I don't know how can I do it. I think the main matter is to know which HTTP code gives GitHub, but I can't find anything like that in cURL PHP documentation. How ca...
[ "php", "git", "http", "github" ]
0
4
2,086
4
0
2011-06-04T15:33:01.103000
2011-06-04T15:39:58.473000
6,237,646
6,237,730
how to close one instance of a tooltip if I click another using jQuery
I am using the http://jqueryfordesigners.com/coda-popup-bubbles/ Due to my lack of js knowledge and some custom needs from the client I have one page with two targets that can each open a popup bubble. I also have multiple messages available to each bubble and they simply cycle through var trigger = $('.trigger', this)...
The problem is that you are showing all the.popup classes every time $(".popup").html(messages_doll[messagecounter]).show(); I don't know if.popup is a child of the.trigger but you'll need to turn off all the other.popup s. $('.popup').hide(); $(this).find('.popup').html(messages_doll[messagecounter]).show();
how to close one instance of a tooltip if I click another using jQuery I am using the http://jqueryfordesigners.com/coda-popup-bubbles/ Due to my lack of js knowledge and some custom needs from the client I have one page with two targets that can each open a popup bubble. I also have multiple messages available to each...
TITLE: how to close one instance of a tooltip if I click another using jQuery QUESTION: I am using the http://jqueryfordesigners.com/coda-popup-bubbles/ Due to my lack of js knowledge and some custom needs from the client I have one page with two targets that can each open a popup bubble. I also have multiple messages...
[ "jquery", "tooltip" ]
1
1
257
1
0
2011-06-04T15:33:09.910000
2011-06-04T15:47:26.187000
6,237,666
6,241,622
How do I convert a Java byte array into a Scala byte array?
I am new to Scala and work currently on a project involving both Java and a Scala modules. Now I'd like to call a Scala method from Java using a parameter of type byte[]. The Scala method has the signature: def foo(data: Array[Byte]) The Java call looks like this: foo(x), where x has the type byte[]. The IDE tells me i...
As others pointed out, there is no problem in conversion. My IDE is behaving erroneous, and showing imaginary errors which compile without problems. At this moment the call of the receive Method in the main-method in following code is marked with the error: The method receive(Array) from the type ScalaByteReceiver refe...
How do I convert a Java byte array into a Scala byte array? I am new to Scala and work currently on a project involving both Java and a Scala modules. Now I'd like to call a Scala method from Java using a parameter of type byte[]. The Scala method has the signature: def foo(data: Array[Byte]) The Java call looks like t...
TITLE: How do I convert a Java byte array into a Scala byte array? QUESTION: I am new to Scala and work currently on a project involving both Java and a Scala modules. Now I'd like to call a Scala method from Java using a parameter of type byte[]. The Scala method has the signature: def foo(data: Array[Byte]) The Java...
[ "java", "scala", "arrays" ]
10
5
13,202
2
0
2011-06-04T15:37:00.570000
2011-06-05T07:49:06.300000
6,237,667
6,237,729
How to "clean" the rss description?
I have a list with RSS news. Im holding the description of every rss new in a list and then i open it in a dialog box...My problem is that the text that i m getting from the site has some html staff inside,like: <p><a href="http://feedads.g.doubleclick.net/~a/97Q3XX0K7wfcDV2VCcz5WcNCNK4/0/da"><img src="http://feedads.g...
Check this thread on google's android group: http://groups.google.com/group/android-developers/browse_thread/thread/5b3b0b74d3d64dfa/035b96bc4e06787e?show_docid=035b96bc4e06787e&pli=1 Should do the trick. So either Html.fromHtml().toString() or the mentioned regex.
How to "clean" the rss description? I have a list with RSS news. Im holding the description of every rss new in a list and then i open it in a dialog box...My problem is that the text that i m getting from the site has some html staff inside,like: <p><a href="http://feedads.g.doubleclick.net/~a/97Q3XX0K7wfcDV2VCcz5WcNC...
TITLE: How to "clean" the rss description? QUESTION: I have a list with RSS news. Im holding the description of every rss new in a list and then i open it in a dialog box...My problem is that the text that i m getting from the site has some html staff inside,like: <p><a href="http://feedads.g.doubleclick.net/~a/97Q3XX...
[ "android", "rss" ]
0
1
181
1
0
2011-06-04T15:37:02.083000
2011-06-04T15:47:04.550000
6,237,673
6,237,884
Cleanest way to get the next sibling in jQuery
http://jsfiddle.net/mplungjan/H9Raz/ After quite some tests with next('a') and such, I finally found one that worked. I just wonder why next('a') did not, or closest or similar. Are there cleaner ways to get at the href of the link after the checkbox I click? $('form input:checkbox').click(function () { alert($(this).n...
To elaborate on the comments above: You cannot write: next("a"), because next() only tries to match the very next element. It will hit the element and match nothing. closest("a"), because closest() walks up the ancestor chain, starting with the element itself, and therefore will miss the elements. You can write: next()...
Cleanest way to get the next sibling in jQuery http://jsfiddle.net/mplungjan/H9Raz/ After quite some tests with next('a') and such, I finally found one that worked. I just wonder why next('a') did not, or closest or similar. Are there cleaner ways to get at the href of the link after the checkbox I click? $('form input...
TITLE: Cleanest way to get the next sibling in jQuery QUESTION: http://jsfiddle.net/mplungjan/H9Raz/ After quite some tests with next('a') and such, I finally found one that worked. I just wonder why next('a') did not, or closest or similar. Are there cleaner ways to get at the href of the link after the checkbox I cl...
[ "jquery", "jquery-selectors" ]
44
63
55,703
3
0
2011-06-04T15:38:23.810000
2011-06-04T16:15:38.577000
6,237,678
6,237,694
Creating an array from query?
Is there a proper way to do this: $i = 0; while($row = mysql_fetch_array($queryResult)){ $queryArray[$i] = $row['instructionValue']; $i++; }
You can replace $queryArray[$i] = $row['instructionValue']; with $queryArray[] = $row['instructionValue']; and get rid of the $i variable. When you assign a value to an array this way (with braces, but no index) you automatically create a new item at the end of array and assign the value to it.
Creating an array from query? Is there a proper way to do this: $i = 0; while($row = mysql_fetch_array($queryResult)){ $queryArray[$i] = $row['instructionValue']; $i++; }
TITLE: Creating an array from query? QUESTION: Is there a proper way to do this: $i = 0; while($row = mysql_fetch_array($queryResult)){ $queryArray[$i] = $row['instructionValue']; $i++; } ANSWER: You can replace $queryArray[$i] = $row['instructionValue']; with $queryArray[] = $row['instructionValue']; and get rid of...
[ "php", "mysql" ]
2
3
114
3
0
2011-06-04T15:38:58.403000
2011-06-04T15:41:02.223000
6,237,685
6,238,617
How can I tell what Database format a file (or set of files) was created with (in Delphi)?
I have a number of data files created by many different programs. Is there a way to determine the database and version of the database that was used to create the data file. For example, I'd like to identify which files are created from Microsoft Access, dBASE, FileMaker, FoxPro, SQLite or others. I really just want to...
First of all, check the file extension. Take a look at the corresponding wikipedia article, or other sites. Then you can guess the file format from its so called "signature". This is mostly the first characters content, which is able to identify the file format. You've an updated list at this very nice Gary Kessler's w...
How can I tell what Database format a file (or set of files) was created with (in Delphi)? I have a number of data files created by many different programs. Is there a way to determine the database and version of the database that was used to create the data file. For example, I'd like to identify which files are creat...
TITLE: How can I tell what Database format a file (or set of files) was created with (in Delphi)? QUESTION: I have a number of data files created by many different programs. Is there a way to determine the database and version of the database that was used to create the data file. For example, I'd like to identify whi...
[ "database", "delphi", "file-structure", "identify" ]
9
10
11,278
3
0
2011-06-04T15:39:35.980000
2011-06-04T18:31:10.010000
6,237,692
6,237,722
Javascript: confused about how nested for loops work
Why do nested for loops work in the way that they do in the following example: var times = [ ["04/11/10", "86kg"], ["05/12/11", "90kg"], ["06/12/11", "89kg"] ]; for (var i = 0; i < times.length; i++) { var newTimes = []; for(var x = 0; x < times[i].length; x++) { newTimes.push(times[i][x]); console.log(newTimes); } ...
You are redefining newTimes on every single loop and you are outputting to the console on each column push. var times = [ ["04/11/10", "86kg"], ["05/12/11", "90kg"], ["06/12/11", "89kg"] ]; var newTimes = []; for (var i = 0; i < times.length; i++) { for(var x = 0; x < times[i].length; x++) { newTimes.push(times[i][x]);...
Javascript: confused about how nested for loops work Why do nested for loops work in the way that they do in the following example: var times = [ ["04/11/10", "86kg"], ["05/12/11", "90kg"], ["06/12/11", "89kg"] ]; for (var i = 0; i < times.length; i++) { var newTimes = []; for(var x = 0; x < times[i].length; x++) { ne...
TITLE: Javascript: confused about how nested for loops work QUESTION: Why do nested for loops work in the way that they do in the following example: var times = [ ["04/11/10", "86kg"], ["05/12/11", "90kg"], ["06/12/11", "89kg"] ]; for (var i = 0; i < times.length; i++) { var newTimes = []; for(var x = 0; x < times[i]...
[ "javascript", "arrays", "for-loop" ]
5
9
30,807
5
0
2011-06-04T15:40:40.053000
2011-06-04T15:45:56.107000
6,237,693
6,237,745
iOS adding tapGesture to multiple Views
I have multiple views defined in my main view. I want to add single tap gesture to all these views. Below is the code I have written, but this registers a tap gesture to the last view that I add. So in the code below, tap is registered only for messagesView & not for other views. I have 2 questions: How do I register t...
I had the same problem where it only added to the last view. There might be a better solution, but I just created a tag gesture for each view and linked them to the same selector method ( oneTap: in your case). In order to distinguish which view activated the method, you can just tag your views, feedsView.tag = 0; peop...
iOS adding tapGesture to multiple Views I have multiple views defined in my main view. I want to add single tap gesture to all these views. Below is the code I have written, but this registers a tap gesture to the last view that I add. So in the code below, tap is registered only for messagesView & not for other views....
TITLE: iOS adding tapGesture to multiple Views QUESTION: I have multiple views defined in my main view. I want to add single tap gesture to all these views. Below is the code I have written, but this registers a tap gesture to the last view that I add. So in the code below, tap is registered only for messagesView & no...
[ "objective-c", "ios", "uiview", "ios4", "uigesturerecognizer" ]
20
27
29,457
7
0
2011-06-04T15:40:54.057000
2011-06-04T15:49:41.750000
6,237,696
6,238,883
Flex Tree scrolling goes buggy after adding custom TreeItemRenderer
I have the follow code - as TreeItemRenderer import mx.containers.Canvas; import mx.containers.VBox; import mx.controls.Alert; import mx.controls.Button; import mx.controls.CheckBox; import mx.controls.Tree; import mx.controls.listClasses.BaseListData; import mx.controls.treeClasses.TreeListData; import mx.core.mx_inte...
Try Spark Tree, it's based on Spark List and is free of all the MX Tree bugs.
Flex Tree scrolling goes buggy after adding custom TreeItemRenderer I have the follow code - as TreeItemRenderer import mx.containers.Canvas; import mx.containers.VBox; import mx.controls.Alert; import mx.controls.Button; import mx.controls.CheckBox; import mx.controls.Tree; import mx.controls.listClasses.BaseListData;...
TITLE: Flex Tree scrolling goes buggy after adding custom TreeItemRenderer QUESTION: I have the follow code - as TreeItemRenderer import mx.containers.Canvas; import mx.containers.VBox; import mx.controls.Alert; import mx.controls.Button; import mx.controls.CheckBox; import mx.controls.Tree; import mx.controls.listCla...
[ "apache-flex", "actionscript-3", "tree", "itemrenderer" ]
0
3
1,921
3
0
2011-06-04T15:41:09.523000
2011-06-04T19:21:57.090000
6,237,697
6,238,015
How do I parse a plain HTML table with Nokogiri?
I'd like to parse a HTML page with the Nokogiri. There is a table in part of the page which does not use any specific ID. Is it possible to extract something like: Today,3,455,34 Today,1,1300,3664 Today,10,100000,3444, Yesterday,3454,5656,3 Yesterday,3545,1000,10 Yesterday,3411,36223,15 From this HTML: Today Yesterday ...
As a quick and dirty first pass I'd do: html = < Today Yesterday Qnty Size Length Length Size Qnty 3 455 34 3454 5656 3 1 1300 3664 3545 1000 10 10 100000 3444 3411 36223 15 EOT # Today Yesterday # Qnty Size Length Length Size Qnty # 3 455 34 3454 5656 3 # 1 1300 3664 3545 1000 10 # 10 100000 3444 3411 36223 15 requi...
How do I parse a plain HTML table with Nokogiri? I'd like to parse a HTML page with the Nokogiri. There is a table in part of the page which does not use any specific ID. Is it possible to extract something like: Today,3,455,34 Today,1,1300,3664 Today,10,100000,3444, Yesterday,3454,5656,3 Yesterday,3545,1000,10 Yesterd...
TITLE: How do I parse a plain HTML table with Nokogiri? QUESTION: I'd like to parse a HTML page with the Nokogiri. There is a table in part of the page which does not use any specific ID. Is it possible to extract something like: Today,3,455,34 Today,1,1300,3664 Today,10,100000,3444, Yesterday,3454,5656,3 Yesterday,35...
[ "ruby", "xpath", "html-parsing", "nokogiri" ]
5
10
3,037
1
0
2011-06-04T15:41:48.063000
2011-06-04T16:41:42.097000
6,237,700
6,237,709
Connecting to SQL Server 2005
I'm VS2005 installed with SQL Server. How can I use it to connect SQL Server 2005 and create new database? Am I missing SQL Server 2005's Management Studio to be able to make database queries?
In Visual Studio, you can do most of the database development tasks that you'd ever want to do without having to use Management Studio. Here's an article describing how to connect to your database in Server Explorer: How to use the Server Explorer in Visual Studio.NET and Visual Studio 2005 Here's what to do if you don...
Connecting to SQL Server 2005 I'm VS2005 installed with SQL Server. How can I use it to connect SQL Server 2005 and create new database? Am I missing SQL Server 2005's Management Studio to be able to make database queries?
TITLE: Connecting to SQL Server 2005 QUESTION: I'm VS2005 installed with SQL Server. How can I use it to connect SQL Server 2005 and create new database? Am I missing SQL Server 2005's Management Studio to be able to make database queries? ANSWER: In Visual Studio, you can do most of the database development tasks th...
[ "sql", "sql-server-2005", "visual-studio-2005" ]
0
1
100
2
0
2011-06-04T15:42:40.867000
2011-06-04T15:44:13.430000
6,237,702
6,237,714
php query(lowercase/uppercase letters) validate
I need select result from mysql regarding query string. Let's string will be: Z and z (uppercase and lowercase) How database look like: url_id test_char 1 Z 2 z Ok, in address bar entered: localhost/z This query always selecting 1 result, first one, so it returns always 1. If i try even z. The test_char is varchar. How...
MySQL uses case insensitive searching by default for non binary strings or certain collation types. Per OMG Ponies note, you could adjust this at the DB or Table level. Alternatively, you could adjust it inline for your specific query. Examples of each are in the docs linked above.
php query(lowercase/uppercase letters) validate I need select result from mysql regarding query string. Let's string will be: Z and z (uppercase and lowercase) How database look like: url_id test_char 1 Z 2 z Ok, in address bar entered: localhost/z This query always selecting 1 result, first one, so it returns always 1...
TITLE: php query(lowercase/uppercase letters) validate QUESTION: I need select result from mysql regarding query string. Let's string will be: Z and z (uppercase and lowercase) How database look like: url_id test_char 1 Z 2 z Ok, in address bar entered: localhost/z This query always selecting 1 result, first one, so i...
[ "mysql", "sql", "collation" ]
0
1
1,754
3
0
2011-06-04T15:42:41.273000
2011-06-04T15:45:09.753000
6,237,703
6,238,224
Get a COM object from another COM object
I have to get the Command Interface and Status interface as given below from VBScript in an ASP Page. The COM will be deployed in a Windows CE device Set polyColdObj=CreateObject("PolyCold.Main") Set statusObj = polyColdObj.StatusInterface() Set commandObj = polyColdObj.CommandInterface() I am going to use Atl for deve...
What should be the signature of StatusInterface and CommandInterface in ATL COM? By default, ATL methods will return an HRESULT value. In order to achieve what you want you can create a method without parameters using the ATL wizard. Then you can modify your IDL file manually, and the corresponding implementation, so t...
Get a COM object from another COM object I have to get the Command Interface and Status interface as given below from VBScript in an ASP Page. The COM will be deployed in a Windows CE device Set polyColdObj=CreateObject("PolyCold.Main") Set statusObj = polyColdObj.StatusInterface() Set commandObj = polyColdObj.CommandI...
TITLE: Get a COM object from another COM object QUESTION: I have to get the Command Interface and Status interface as given below from VBScript in an ASP Page. The COM will be deployed in a Windows CE device Set polyColdObj=CreateObject("PolyCold.Main") Set statusObj = polyColdObj.StatusInterface() Set commandObj = po...
[ "com", "vbscript", "asp-classic", "windows-ce", "atl" ]
2
2
317
1
0
2011-06-04T15:42:41.570000
2011-06-04T17:15:52.360000
6,237,706
6,238,603
LoadError in StoreController#add_to_cart
I am trying to learn Ruby on Rails using Agile Web Development with Rails third edition and I am completely stuck. I am using Ruby version 1.8.7 and rails 2.3.5 on Linux Mint. Just after the book recommended that I change from cookies to the SQLite database to manage sessions, the application no longer works. I get the...
Check your app/models/cart.rb, it should be like this class Cart < ActiveRecord::Base #stuff here end make sure its that.
LoadError in StoreController#add_to_cart I am trying to learn Ruby on Rails using Agile Web Development with Rails third edition and I am completely stuck. I am using Ruby version 1.8.7 and rails 2.3.5 on Linux Mint. Just after the book recommended that I change from cookies to the SQLite database to manage sessions, t...
TITLE: LoadError in StoreController#add_to_cart QUESTION: I am trying to learn Ruby on Rails using Agile Web Development with Rails third edition and I am completely stuck. I am using Ruby version 1.8.7 and rails 2.3.5 on Linux Mint. Just after the book recommended that I change from cookies to the SQLite database to ...
[ "ruby-on-rails", "ruby" ]
0
0
521
2
0
2011-06-04T15:43:28.007000
2011-06-04T18:27:46.867000
6,237,708
6,238,684
DbConnectionStringBuilder does not parse when used in PowerShell
I am trying to use capabilities of DbConnectionStringBuilder for parsing connection-string-like user input. This works just fine in C#: using System; using System.Data.Common; class Program { static void Main(string[] args) { var sb = new DbConnectionStringBuilder(); sb.ConnectionString = "server = 'smtp.gmail.com'; po...
System.Data.Common.DbConnectionStringBuilder implements IDictionary. Powershell has a shorthand for dictionaries using. that allows retrieval and assignment of key/value pairs as if the key was a property: $dict = @{} $dict["key1"] = 'value1' $dict.key2 = 'value2' You can see that it is storing the entire connection st...
DbConnectionStringBuilder does not parse when used in PowerShell I am trying to use capabilities of DbConnectionStringBuilder for parsing connection-string-like user input. This works just fine in C#: using System; using System.Data.Common; class Program { static void Main(string[] args) { var sb = new DbConnectionStri...
TITLE: DbConnectionStringBuilder does not parse when used in PowerShell QUESTION: I am trying to use capabilities of DbConnectionStringBuilder for parsing connection-string-like user input. This works just fine in C#: using System; using System.Data.Common; class Program { static void Main(string[] args) { var sb = ne...
[ "powershell" ]
8
9
3,434
3
0
2011-06-04T15:43:52.817000
2011-06-04T18:46:28.087000
6,237,717
6,237,924
Errors when running make
When I type this: make -f gcc.mak depend I get the following errors: /bin/sh: Syntax error: "(" unexpected /bin/sh: Syntax error: "(" unexpected /bin/sh: Syntax error: "(" unexpected /usr/include/../include/limits.h:125: error: no include path in which to search for limits.h /usr/include/../include/limits.h:125: error:...
Looks like you are trying to build STLport yourself. Why not use the version that comes with your distribution? Looks like Debian faced a similar problem and fixed it a few years ago: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468063
Errors when running make When I type this: make -f gcc.mak depend I get the following errors: /bin/sh: Syntax error: "(" unexpected /bin/sh: Syntax error: "(" unexpected /bin/sh: Syntax error: "(" unexpected /usr/include/../include/limits.h:125: error: no include path in which to search for limits.h /usr/include/../inc...
TITLE: Errors when running make QUESTION: When I type this: make -f gcc.mak depend I get the following errors: /bin/sh: Syntax error: "(" unexpected /bin/sh: Syntax error: "(" unexpected /bin/sh: Syntax error: "(" unexpected /usr/include/../include/limits.h:125: error: no include path in which to search for limits.h /...
[ "linux", "makefile" ]
0
2
799
1
0
2011-06-04T13:31:33.260000
2011-06-04T16:26:11.003000
6,237,725
6,237,845
Visual Studio not closing curled bracket
For some reason, on a new computer, Visual Studio won't auto-close curled brackets. if(Username.Text.Equals()) { And it doesn't auto-close. Works perfectly on all other machines I've installed VS2010 on. And now it just won't. And there doesn't seem to be a setting in the options menu to alter this behavior. What do I ...
I'm not sure if this is actually built in to vs2010. But you can install the MS Productivity Power Tools ( Productivity Power Tools for Visual Studio 2012 ) Which will give you brace auto completion. this is quite a common add in so maybe the other copies of VS you have tried have it installed??
Visual Studio not closing curled bracket For some reason, on a new computer, Visual Studio won't auto-close curled brackets. if(Username.Text.Equals()) { And it doesn't auto-close. Works perfectly on all other machines I've installed VS2010 on. And now it just won't. And there doesn't seem to be a setting in the option...
TITLE: Visual Studio not closing curled bracket QUESTION: For some reason, on a new computer, Visual Studio won't auto-close curled brackets. if(Username.Text.Equals()) { And it doesn't auto-close. Works perfectly on all other machines I've installed VS2010 on. And now it just won't. And there doesn't seem to be a set...
[ "visual-studio-2010" ]
8
8
7,320
2
0
2011-06-04T15:46:16.467000
2011-06-04T16:09:24.470000
6,237,734
6,237,761
How to request only the HTTP header with C#?
I want to check if the URL of a large file exists. I'm using the code below but it is too slow: public static bool TryGet(string url) { try { GetHttpResponseHeaders(url); return true; } catch (WebException) { } return false; } public static Dictionary GetHttpResponseHeaders(string url) { Dictionary headers = new Dict...
You need to set: webRequest.Method = "HEAD"; This way the server will respond with the header information only (no content). This is also useful to check if the server accepts certain operations (i.e. compressed data etc.).
How to request only the HTTP header with C#? I want to check if the URL of a large file exists. I'm using the code below but it is too slow: public static bool TryGet(string url) { try { GetHttpResponseHeaders(url); return true; } catch (WebException) { } return false; } public static Dictionary GetHttpResponseHeader...
TITLE: How to request only the HTTP header with C#? QUESTION: I want to check if the URL of a large file exists. I'm using the code below but it is too slow: public static bool TryGet(string url) { try { GetHttpResponseHeaders(url); return true; } catch (WebException) { } return false; } public static Dictionary Get...
[ "c#", ".net", "httpwebrequest", "system.net" ]
32
52
20,099
1
0
2011-06-04T15:48:21.950000
2011-06-04T15:53:43.850000
6,237,738
6,237,822
Visual C++ 2005 Express Edition - Where is MFC?
I'm trying to create a new MFC project using Microsoft Visual C++ 2005 Express Edition. When I chose File --> New --> Project, I did NOT find MFC! How can I add this feature? Thanks.
VS2005 Express doesn't include purposely excludes MFC or ATL. For that, you gotta' pay. Same with VS2008 Express.
Visual C++ 2005 Express Edition - Where is MFC? I'm trying to create a new MFC project using Microsoft Visual C++ 2005 Express Edition. When I chose File --> New --> Project, I did NOT find MFC! How can I add this feature? Thanks.
TITLE: Visual C++ 2005 Express Edition - Where is MFC? QUESTION: I'm trying to create a new MFC project using Microsoft Visual C++ 2005 Express Edition. When I chose File --> New --> Project, I did NOT find MFC! How can I add this feature? Thanks. ANSWER: VS2005 Express doesn't include purposely excludes MFC or ATL. ...
[ "visual-c++" ]
0
3
1,020
2
0
2011-06-04T15:49:00.663000
2011-06-04T16:04:25.163000
6,237,743
6,237,796
setBackgroundDrawable for ListView in Android
How do I set a drawable as the background for a list view in a class? if (array1.size() < 8) { lv1.setBackgroundDrawable(R.drawable.bgimghs2b); } is improper.
That's because you're not giving it a Drawable, but an ID of a drawable. Try: lv1.setBackgroundDrawable(getResources().getDrawable(R.drawable.bgimghs2b)) If you're in an activity. If not, then you need to get a Context and call getResources() on that.
setBackgroundDrawable for ListView in Android How do I set a drawable as the background for a list view in a class? if (array1.size() < 8) { lv1.setBackgroundDrawable(R.drawable.bgimghs2b); } is improper.
TITLE: setBackgroundDrawable for ListView in Android QUESTION: How do I set a drawable as the background for a list view in a class? if (array1.size() < 8) { lv1.setBackgroundDrawable(R.drawable.bgimghs2b); } is improper. ANSWER: That's because you're not giving it a Drawable, but an ID of a drawable. Try: lv1.setBac...
[ "android", "listview" ]
14
60
31,607
5
0
2011-06-04T15:49:23.063000
2011-06-04T15:59:28.190000
6,237,744
6,238,189
OpenGL: Drawing text in a 2d fashion on a 3d scene?
When I try to display text on my 3d scene it doesn't display the rest of the scene. What do I have to do to fix this? I tried the answer here: Opengl drawing a 2d overlay on a 3d scene problem but it didn't work for me. Here is my code: public class GunCraft { private boolean done = false; Texture texture; Camera cam; ...
You should really review how OpenGL work you have a bunch of truncated statements in your code that get overwritten a few lines later. You have to get what "OpenGL is a state machine" means. If you don't want to deal with that you should find a more abstract game engine that handles all the draw-calls. I just copypasta...
OpenGL: Drawing text in a 2d fashion on a 3d scene? When I try to display text on my 3d scene it doesn't display the rest of the scene. What do I have to do to fix this? I tried the answer here: Opengl drawing a 2d overlay on a 3d scene problem but it didn't work for me. Here is my code: public class GunCraft { private...
TITLE: OpenGL: Drawing text in a 2d fashion on a 3d scene? QUESTION: When I try to display text on my 3d scene it doesn't display the rest of the scene. What do I have to do to fix this? I tried the answer here: Opengl drawing a 2d overlay on a 3d scene problem but it didn't work for me. Here is my code: public class ...
[ "java", "opengl", "fonts", "lwjgl" ]
2
4
5,399
1
0
2011-06-04T15:49:36.413000
2011-06-04T17:11:59.403000
6,237,758
6,237,776
Objective-C: EXC_BAD_ACCESS and doesn't respond
Here's the header file: @interface calc: NSObject { IBOutlet NSTextField *tf1; IBOutlet NSTextField *tf2; IBOutlet NSTextField *ansr; int s; } - (IBAction)add:(id)sender; @end And here's the implementation file: @implementation calc - (IBAction)add:(id)sender { s = [tf1 intValue] + [tf2 intValue]; [ansr setStringVal...
s is an int, not an object. Try this instead: - (IBAction)add:(id)sender { s = [tf1 intValue] + [tf2 intValue]; [ansr setIntValue:s];
Objective-C: EXC_BAD_ACCESS and doesn't respond Here's the header file: @interface calc: NSObject { IBOutlet NSTextField *tf1; IBOutlet NSTextField *tf2; IBOutlet NSTextField *ansr; int s; } - (IBAction)add:(id)sender; @end And here's the implementation file: @implementation calc - (IBAction)add:(id)sender { s = [tf...
TITLE: Objective-C: EXC_BAD_ACCESS and doesn't respond QUESTION: Here's the header file: @interface calc: NSObject { IBOutlet NSTextField *tf1; IBOutlet NSTextField *tf2; IBOutlet NSTextField *ansr; int s; } - (IBAction)add:(id)sender; @end And here's the implementation file: @implementation calc - (IBAction)add:(i...
[ "objective-c", "cocoa" ]
0
3
128
2
0
2011-06-04T15:53:09.893000
2011-06-04T15:57:40.887000
6,237,765
6,238,293
Google app engine - login with Google, Facebook
I would like the users of my application, hosted in Google app engine, login the same way I do in StackExchange, using my Google account or Facebook account. I have some questions on this: I would like to see some tutorials on basic login only I would like to see some tutorial(s) on social login (Google, Facebook, etc....
You can use the Federated login API provided by Google to help users connect using Open ID providers (like Google, Windows Live, Yahoo, etc.). Check out these links: Using Federated Authentication via OpenID in Google App Engine A Simple OpenID Login Example on Appengine
Google app engine - login with Google, Facebook I would like the users of my application, hosted in Google app engine, login the same way I do in StackExchange, using my Google account or Facebook account. I have some questions on this: I would like to see some tutorials on basic login only I would like to see some tut...
TITLE: Google app engine - login with Google, Facebook QUESTION: I would like the users of my application, hosted in Google app engine, login the same way I do in StackExchange, using my Google account or Facebook account. I have some questions on this: I would like to see some tutorials on basic login only I would li...
[ "facebook", "google-app-engine", "authentication", "oauth" ]
14
9
13,109
4
0
2011-06-04T15:54:33.013000
2011-06-04T17:27:54.840000
6,237,766
6,237,915
Slicing Tools for Eclipse
Does anyone know if there are any open source tools for eclipse that can generate static program slices according to the slicing technique outlined by Mark Weiser ( http://en.wikipedia.org/wiki/Program_slicing )? I can only seem to find JSlice, which only works for Fedora. Any pointers about how I could tackle this (an...
Disclaimer: I haven't tried the tool listed below. Indus. It appears to make itself useful via the Kaveri plugin in Eclipse. It would be worth noting that apart from JSlice and Indus, no other known code slicers for Java appear to be available, although there are quite a few papers that discuss building a code slicer f...
Slicing Tools for Eclipse Does anyone know if there are any open source tools for eclipse that can generate static program slices according to the slicing technique outlined by Mark Weiser ( http://en.wikipedia.org/wiki/Program_slicing )? I can only seem to find JSlice, which only works for Fedora. Any pointers about h...
TITLE: Slicing Tools for Eclipse QUESTION: Does anyone know if there are any open source tools for eclipse that can generate static program slices according to the slicing technique outlined by Mark Weiser ( http://en.wikipedia.org/wiki/Program_slicing )? I can only seem to find JSlice, which only works for Fedora. An...
[ "java", "eclipse", "slice" ]
7
4
1,412
2
0
2011-06-04T15:54:48.997000
2011-06-04T16:24:18.197000
6,237,775
6,237,886
Why does Haskell force data constructor's first letter to be upper case?
Give an ugly example: data Bighead = Big little = 1 f1 = little:: Int f2 = Big:: BigHead In my opinion: f1 and f2 all point to some data. the only different of ( little and Big ) is little has a piece of code to do evaluation. but Big doesn't. They all have a rewritable body, little can be transformed from a collect...
From the Haskell 98 Language we see the core distinction in identifier tokens in Haskell: varid -> (small {small | large | digit | ' }) conid -> large {small | large | digit | ' } That is, the language fundamentally distinguish variable names ("varid") from constructor names ("conid"), at all levels of the language (bo...
Why does Haskell force data constructor's first letter to be upper case? Give an ugly example: data Bighead = Big little = 1 f1 = little:: Int f2 = Big:: BigHead In my opinion: f1 and f2 all point to some data. the only different of ( little and Big ) is little has a piece of code to do evaluation. but Big doesn't. ...
TITLE: Why does Haskell force data constructor's first letter to be upper case? QUESTION: Give an ugly example: data Bighead = Big little = 1 f1 = little:: Int f2 = Big:: BigHead In my opinion: f1 and f2 all point to some data. the only different of ( little and Big ) is little has a piece of code to do evaluation....
[ "haskell", "syntax", "functional-programming" ]
22
32
5,348
3
0
2011-06-04T15:57:37.300000
2011-06-04T16:16:05.750000
6,237,779
6,238,643
Does Generics give me some advantages in performance and pros and cons?
i'm trying to generate some methods like below, add crm and human resources. But i want to write Crm,humanResources,SupplChain etc. (5-6 Modules) how to write below codes simple(Below codes is skeleton:)) i'd written without generics first and then i've written with generics. Second usage differs from first. 1) Clear r...
Aside from my post explaining some things about generics, your situation here doesn't look like it really requires them at all. You should instead add a property to your class. public class Person { public string Name { get; set; } } public class Customer: Person { } public class Staff: Person { } public class HumanR...
Does Generics give me some advantages in performance and pros and cons? i'm trying to generate some methods like below, add crm and human resources. But i want to write Crm,humanResources,SupplChain etc. (5-6 Modules) how to write below codes simple(Below codes is skeleton:)) i'd written without generics first and then...
TITLE: Does Generics give me some advantages in performance and pros and cons? QUESTION: i'm trying to generate some methods like below, add crm and human resources. But i want to write Crm,humanResources,SupplChain etc. (5-6 Modules) how to write below codes simple(Below codes is skeleton:)) i'd written without gener...
[ "c#", ".net", "generics", "architecture" ]
4
2
2,556
5
0
2011-06-04T15:57:45.863000
2011-06-04T18:37:31.747000
6,237,784
6,258,652
Scroll along a curve
I'm trying to get the effect of scrolling a uitableview along a curved path. Basically it would be like a bulging tableview on the side of the screen as if it were the side of a large circle. I don't want to use a graphic effect to warp the tableview since the text would become harder to read. Items on the top and bott...
Here's what I came up with. Very rough demonstration here as proof of concept. First the connection to myScrollView is already set up with an IBOutlet and hooked to a scrollview in a xib. Then I set up the scrollview in viewDidLoad: int scrollItems = 20; viewSize = 120; viewItems = [[NSMutableArray alloc] init]; [myScr...
Scroll along a curve I'm trying to get the effect of scrolling a uitableview along a curved path. Basically it would be like a bulging tableview on the side of the screen as if it were the side of a large circle. I don't want to use a graphic effect to warp the tableview since the text would become harder to read. Item...
TITLE: Scroll along a curve QUESTION: I'm trying to get the effect of scrolling a uitableview along a curved path. Basically it would be like a bulging tableview on the side of the screen as if it were the side of a large circle. I don't want to use a graphic effect to warp the tableview since the text would become ha...
[ "iphone", "ios", "ipad", "uitableview", "uiscrollview" ]
0
5
1,660
2
0
2011-06-04T15:58:35.280000
2011-06-06T22:15:42.703000
6,237,785
6,241,748
Hibernate Query Tool
I am looking for a way to query a Hibernate database with an external tool (a kind of interactive query editor). I do not have the source code for the original application. It is maintained by a separate group. I attempted using Hibernate Tools from JBoss, but these tools appear to need the source code in order to reso...
One way I can think of is to use Hibernate Tools to reverse engineer he database schema and generate the mapping and the POJO classes for you. Make the necessary minor adjustments if needed Go and query This should work fine enough
Hibernate Query Tool I am looking for a way to query a Hibernate database with an external tool (a kind of interactive query editor). I do not have the source code for the original application. It is maintained by a separate group. I attempted using Hibernate Tools from JBoss, but these tools appear to need the source ...
TITLE: Hibernate Query Tool QUESTION: I am looking for a way to query a Hibernate database with an external tool (a kind of interactive query editor). I do not have the source code for the original application. It is maintained by a separate group. I attempted using Hibernate Tools from JBoss, but these tools appear t...
[ "hibernate" ]
0
0
555
1
0
2011-06-04T15:58:36.757000
2011-06-05T08:22:30.557000
6,237,790
6,237,840
Is PNG bad for Browser Compatibility
I just figured out that if I make image.PNG its smaller than if I make it.JPG. Since I try my best to make fastest website I can size of the images are pretty important too. So my question is that I believe phones doesn`t support.PNG pictures. Is it true or not? and Should I continue using.PNG instead.JPG? Is there any...
Old browsers like IE6 (which is now deprecated) don't support transparent PNG files, so it really depends on which browsers you plan to support. In general, PNG files are fine and will run on all major browsers. Unlike JPEGs, PNG is lossless and this may work against it at times when compressing. If the image is comple...
Is PNG bad for Browser Compatibility I just figured out that if I make image.PNG its smaller than if I make it.JPG. Since I try my best to make fastest website I can size of the images are pretty important too. So my question is that I believe phones doesn`t support.PNG pictures. Is it true or not? and Should I continu...
TITLE: Is PNG bad for Browser Compatibility QUESTION: I just figured out that if I make image.PNG its smaller than if I make it.JPG. Since I try my best to make fastest website I can size of the images are pretty important too. So my question is that I believe phones doesn`t support.PNG pictures. Is it true or not? an...
[ "image", "png", "cross-browser" ]
4
8
7,138
5
0
2011-06-04T15:59:03.393000
2011-06-04T16:08:56.573000
6,237,792
6,237,830
How to iterate unusual html element
I'm using CodeRay to generate html code and almost all text elements wrapped in span but some of them didn't. In the example you can see that primary_key_prefix_type doesn't wrap in at all. 1172 case primary_key_prefix_type 1173 when:table_name But I need to iterate through all elements by using next() and prev() funct...
You can use.contents() which includes text nodes as well. $("#test").contents().each(function() { //do something with each node }); Example on jsfiddle Update.nextSibling will get the next element regardless if it is an element or a text node. $(".r")[0].nextSibling; Example on jsfiddle
How to iterate unusual html element I'm using CodeRay to generate html code and almost all text elements wrapped in span but some of them didn't. In the example you can see that primary_key_prefix_type doesn't wrap in at all. 1172 case primary_key_prefix_type 1173 when:table_name But I need to iterate through all eleme...
TITLE: How to iterate unusual html element QUESTION: I'm using CodeRay to generate html code and almost all text elements wrapped in span but some of them didn't. In the example you can see that primary_key_prefix_type doesn't wrap in at all. 1172 case primary_key_prefix_type 1173 when:table_name But I need to iterate...
[ "javascript", "jquery", "html" ]
4
3
139
2
0
2011-06-04T15:59:06.423000
2011-06-04T16:06:41.150000
6,237,817
6,237,821
Should sub-objects be fetched in the Model or the Model Mapper?
This is a follow-up to my previous question: Should dependent rows be fetched in the Model or the Controller?. Let's say that a Patron can check out Books. If, given a Patron object, where and how should the Books they have checked out be fetched? Here are some possibilities I've considered: In the Patron Model, add a ...
I suggest you to go with: When a Patron is instantiated, automatically get its books and store it as the books property This way you don't have to manually worry about it
Should sub-objects be fetched in the Model or the Model Mapper? This is a follow-up to my previous question: Should dependent rows be fetched in the Model or the Controller?. Let's say that a Patron can check out Books. If, given a Patron object, where and how should the Books they have checked out be fetched? Here are...
TITLE: Should sub-objects be fetched in the Model or the Model Mapper? QUESTION: This is a follow-up to my previous question: Should dependent rows be fetched in the Model or the Controller?. Let's say that a Patron can check out Books. If, given a Patron object, where and how should the Books they have checked out be...
[ "php", "model-view-controller", "zend-framework" ]
0
1
76
1
0
2011-06-04T16:02:19.877000
2011-06-04T16:04:12.007000
6,237,825
6,238,211
Entity Framework and MVC3 Create and Update Model
So I've used EF Code First to successfully create my entities and query the database to display the items. I now want to provide a way to edit the records. I have a Post class which contains: (TypeName = "varchar")] [Required()] public string Headline { get; set; } public virtual PostType PostType { get; set; } PostTy...
I assume your repositories _pr and _ptr are using different contexts? Entity framework must read and update from the same context. Since you are getting the post types from another context EF treats it as a new entity hence the extra row in your database. You should share your context between repositories, session per ...
Entity Framework and MVC3 Create and Update Model So I've used EF Code First to successfully create my entities and query the database to display the items. I now want to provide a way to edit the records. I have a Post class which contains: (TypeName = "varchar")] [Required()] public string Headline { get; set; } pub...
TITLE: Entity Framework and MVC3 Create and Update Model QUESTION: So I've used EF Code First to successfully create my entities and query the database to display the items. I now want to provide a way to edit the records. I have a Post class which contains: (TypeName = "varchar")] [Required()] public string Headline ...
[ "c#", "asp.net", "asp.net-mvc-3", "entity-framework-4", "ef-code-first" ]
1
1
2,740
2
0
2011-06-04T16:05:02.517000
2011-06-04T17:14:27.247000
6,237,833
6,238,636
How to verify GPG signatures (.asc files) with .NET Framework System.Security.Cryptography routines
How can I verify the signature of a file that was signed by gpg? I have: the exported public key that signed it, the file, and the.asc file with the signature in it. This routine seems to be the guts of what I need, now it's basically a problem of format conversion: http://msdn.microsoft.com/en-us/library/system.securi...
"Format conversion" is merely writing part of OpenPGP code - take RFC 4880 and start writing. An alternative is to take an existing implementation of OpenPGP standard for.NET, such as our OpenPGPBlackbox or BouncyCastle.
How to verify GPG signatures (.asc files) with .NET Framework System.Security.Cryptography routines How can I verify the signature of a file that was signed by gpg? I have: the exported public key that signed it, the file, and the.asc file with the signature in it. This routine seems to be the guts of what I need, now ...
TITLE: How to verify GPG signatures (.asc files) with .NET Framework System.Security.Cryptography routines QUESTION: How can I verify the signature of a file that was signed by gpg? I have: the exported public key that signed it, the file, and the.asc file with the signature in it. This routine seems to be the guts of...
[ ".net", "cryptography", "digital-signature", "gnupg" ]
0
1
1,550
1
0
2011-06-04T16:07:46.287000
2011-06-04T18:35:54.003000
6,237,844
6,237,947
Where to dealloc pickerview?
In a modal view I have a UIPickerView that is allocated and initialized in viewDidLoad. It is deallocated in dealloc with the other objects used in this view. Is this an incorrect way of deallocating my picker? Why would it need to be accessed after the modal view is dismissed as the error message seems to be suggestin...
You should only call dealloc on super. Everything else should be release. This answer will explain why: iPhone SDK: Dealloc vs. Release?
Where to dealloc pickerview? In a modal view I have a UIPickerView that is allocated and initialized in viewDidLoad. It is deallocated in dealloc with the other objects used in this view. Is this an incorrect way of deallocating my picker? Why would it need to be accessed after the modal view is dismissed as the error ...
TITLE: Where to dealloc pickerview? QUESTION: In a modal view I have a UIPickerView that is allocated and initialized in viewDidLoad. It is deallocated in dealloc with the other objects used in this view. Is this an incorrect way of deallocating my picker? Why would it need to be accessed after the modal view is dismi...
[ "iphone", "objective-c", "ios4", "memory-management" ]
0
1
248
3
0
2011-06-04T16:09:22.337000
2011-06-04T16:29:48.467000
6,237,859
6,237,891
Rake 0.9.1 error
I have some problems with rake. My gemfile looks like this: gem 'rails', '3.1.0.rc1' gem "rake", "!= 0.9.0" I get this error while trying to migrate: [rake --prereqs] rake aborted! uninitialized constant Rake::DSL /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:2482:in const_missing' /Users/nacht...
Try Rake 0.8.7. Rake basically broke Rails with a backward-incompatible change. I have my Gemfile with rake '0.8.7'.
Rake 0.9.1 error I have some problems with rake. My gemfile looks like this: gem 'rails', '3.1.0.rc1' gem "rake", "!= 0.9.0" I get this error while trying to migrate: [rake --prereqs] rake aborted! uninitialized constant Rake::DSL /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:2482:in const_miss...
TITLE: Rake 0.9.1 error QUESTION: I have some problems with rake. My gemfile looks like this: gem 'rails', '3.1.0.rc1' gem "rake", "!= 0.9.0" I get this error while trying to migrate: [rake --prereqs] rake aborted! uninitialized constant Rake::DSL /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:...
[ "ruby-on-rails", "rubygems", "rake" ]
1
2
448
2
0
2011-06-04T16:10:58.047000
2011-06-04T16:17:42.113000
6,237,860
6,247,206
connect java to mysql using jdbc on osx
So I added the MySQL Connector/J 5.1.16 to my project's Build Path. I'm using the default OSX Java package and MAMP Pro 1.9.4 with MySQL 5.1.44 and Eclipse. I've set up a simple java app with the following function: private static String dbUrl = "jdbc:mysql://127.0.0.1:3306/mpp"; private static String dbUsername = "roo...
OK, this is just silly.:) You have open up MAMP, go to Server > MySQL and uncheck "Allow local access only" which is checked by default. This is weird since what I'm doing is local, but anyways... My program seems to work and the commands suggested by @JamesA also yield the expected output! Huzzah!
connect java to mysql using jdbc on osx So I added the MySQL Connector/J 5.1.16 to my project's Build Path. I'm using the default OSX Java package and MAMP Pro 1.9.4 with MySQL 5.1.44 and Eclipse. I've set up a simple java app with the following function: private static String dbUrl = "jdbc:mysql://127.0.0.1:3306/mpp";...
TITLE: connect java to mysql using jdbc on osx QUESTION: So I added the MySQL Connector/J 5.1.16 to my project's Build Path. I'm using the default OSX Java package and MAMP Pro 1.9.4 with MySQL 5.1.44 and Eclipse. I've set up a simple java app with the following function: private static String dbUrl = "jdbc:mysql://12...
[ "java", "mysql", "jdbc", "mamp" ]
9
15
25,207
5
0
2011-06-04T16:11:03.920000
2011-06-06T01:58:49.210000
6,237,862
6,237,889
paragraph and anchor as a button / how add server side event click
hi my dear firends: i have a button like below: and css: p.EnterParag, p.EnterParag a.EnterLink { width: 400px; height: 45px; display: block; } p#EnterToImagesParag { background: url(/Images/Admin/btnConfigImages.png) 0px -45px; } p#EnterToImagesParag a#EnterToImagesLink { background: url(/Images/Admin/btnConfigImages....
To clarify, that's not a button, it's an anchor. You can add a server side event by adding runat=server and an event handler for the OnServerClick event.
paragraph and anchor as a button / how add server side event click hi my dear firends: i have a button like below: and css: p.EnterParag, p.EnterParag a.EnterLink { width: 400px; height: 45px; display: block; } p#EnterToImagesParag { background: url(/Images/Admin/btnConfigImages.png) 0px -45px; } p#EnterToImagesParag a...
TITLE: paragraph and anchor as a button / how add server side event click QUESTION: hi my dear firends: i have a button like below: and css: p.EnterParag, p.EnterParag a.EnterLink { width: 400px; height: 45px; display: block; } p#EnterToImagesParag { background: url(/Images/Admin/btnConfigImages.png) 0px -45px; } p#En...
[ "asp.net", "button", "anchor", "server-side" ]
0
3
1,451
2
0
2011-06-04T16:12:05.437000
2011-06-04T16:16:30.290000
6,237,869
6,237,893
php Foreach Loop issue
I have a big form. This form contains some inputs that can be duplicated by the user. So they can choose for example how many Claimants have worked on a song and enter some fields for EACH claimant, with a limit of 10 Claimants. The form will look like this (I will show only 3 now) echo " "; //1 CLAIMANT echo " ".(_t('...
this happens beacuse in the form name you called it with an array style name="key[]" So you can't put into the SQL $key because $key at this point is an array. Also the correct INSERT syntax is INSERT INTO table (cols) VALUES (values) Addendum Also I think your form convetions it's pretty bad. I suggest you to go with ...
php Foreach Loop issue I have a big form. This form contains some inputs that can be duplicated by the user. So they can choose for example how many Claimants have worked on a song and enter some fields for EACH claimant, with a limit of 10 Claimants. The form will look like this (I will show only 3 now) echo " "; //1 ...
TITLE: php Foreach Loop issue QUESTION: I have a big form. This form contains some inputs that can be duplicated by the user. So they can choose for example how many Claimants have worked on a song and enter some fields for EACH claimant, with a limit of 10 Claimants. The form will look like this (I will show only 3 n...
[ "php", "foreach" ]
0
1
182
3
0
2011-06-04T16:13:10.510000
2011-06-04T16:17:46.057000
6,237,897
6,237,956
how to stream a camera to users with permission
I have a LAN at home. One machine runs a webserver. Another machine has a webcam. I would like to make a webpage on the hosting machine that provides a stream from the webcam on the other computer. The serving machine has it's own domain name/ip, but the computer with the webcam sits behind the router, using NAT. I am ...
You can setup a reverse proxy on the web server to access the webcam server. It might be sufficient to only enable mod_proxy and add this to your configuration: ProxyRequests off ProxyPass /webcam http://webcam-server/stream-url When a client connects to the web server requesting /webcam, the web server will in turn co...
how to stream a camera to users with permission I have a LAN at home. One machine runs a webserver. Another machine has a webcam. I would like to make a webpage on the hosting machine that provides a stream from the webcam on the other computer. The serving machine has it's own domain name/ip, but the computer with the...
TITLE: how to stream a camera to users with permission QUESTION: I have a LAN at home. One machine runs a webserver. Another machine has a webcam. I would like to make a webpage on the hosting machine that provides a stream from the webcam on the other computer. The serving machine has it's own domain name/ip, but the...
[ "apache", "streaming", "video-streaming", "webcam", "vlc" ]
1
2
2,533
1
0
2011-06-04T16:19:50.210000
2011-06-04T16:31:11.410000
6,237,898
6,238,377
Storing Time Ranges in MySQL and Determine if Current Time is within Time Range
I have a database table storing opening hours of a shop as a time range in TIME format. Eg if the shop's opening hours are '9am-5pm', there will be 2 columns 'hours_open' and 'hours_close' where I store 9:00 in 'hours_open' and 17:00 in 'hours_close'. To determine if the shop is currently open or closed, I will run the...
It would be easier to check the hours if they were stored in a separate table, something like shop_working_hours ( shop_id int FK, day_of_week int, hours_open time, hours close time, PK (shop_id, day_of_week) ) That way the query might be like this: SELECT s.* FROM shop s INNER JOIN shop_working_hours h ON s.id = h.sho...
Storing Time Ranges in MySQL and Determine if Current Time is within Time Range I have a database table storing opening hours of a shop as a time range in TIME format. Eg if the shop's opening hours are '9am-5pm', there will be 2 columns 'hours_open' and 'hours_close' where I store 9:00 in 'hours_open' and 17:00 in 'ho...
TITLE: Storing Time Ranges in MySQL and Determine if Current Time is within Time Range QUESTION: I have a database table storing opening hours of a shop as a time range in TIME format. Eg if the shop's opening hours are '9am-5pm', there will be 2 columns 'hours_open' and 'hours_close' where I store 9:00 in 'hours_open...
[ "php", "mysql", "sql", "codeigniter", "time" ]
4
4
2,703
4
0
2011-06-04T16:20:17.090000
2011-06-04T17:40:52.233000
6,237,908
6,237,984
how to write only one pattern to exchange two strings in two-ways in vim
xxx <=> zzz Original text: xxxyyyzzz Run command::s/???/???/ It becomes: zzzyyyxxx Run the same command above::s/???/???/ Back to the original text: xxxyyyzzz just like toggle case(~) aBCdeFg <=> AbcDEfG
Take a look at this: Can I substitute multiple items in a single regular expression in VIM or Perl?
how to write only one pattern to exchange two strings in two-ways in vim xxx <=> zzz Original text: xxxyyyzzz Run command::s/???/???/ It becomes: zzzyyyxxx Run the same command above::s/???/???/ Back to the original text: xxxyyyzzz just like toggle case(~) aBCdeFg <=> AbcDEfG
TITLE: how to write only one pattern to exchange two strings in two-ways in vim QUESTION: xxx <=> zzz Original text: xxxyyyzzz Run command::s/???/???/ It becomes: zzzyyyxxx Run the same command above::s/???/???/ Back to the original text: xxxyyyzzz just like toggle case(~) aBCdeFg <=> AbcDEfG ANSWER: Take a look at t...
[ "vim" ]
5
8
283
3
0
2011-06-04T16:22:48.783000
2011-06-04T16:36:00.883000
6,237,914
6,237,930
How to access a string using a dynamic string name in android (similar to eval in javascript)?
I'm trying to access string variables using dynamic names depending on what position my gallery is at. To get the value of a string using a fixed name I use the following which is fine (the string is called pic1info): String strTest = getResources().getString(R.string.pic1info); My strings are named pic1info, pic2info,...
No, there's no simple way to do that in Java, but you can create an array of ints, where each index represents the R-value of that string. private static final int[] LOOKUP_TABLE = new int[] { R.string.pic1info, R.string.pic2info, R.string.pic3info, R.string.pic4info }; Getting a string would then become: String strTes...
How to access a string using a dynamic string name in android (similar to eval in javascript)? I'm trying to access string variables using dynamic names depending on what position my gallery is at. To get the value of a string using a fixed name I use the following which is fine (the string is called pic1info): String ...
TITLE: How to access a string using a dynamic string name in android (similar to eval in javascript)? QUESTION: I'm trying to access string variables using dynamic names depending on what position my gallery is at. To get the value of a string using a fixed name I use the following which is fine (the string is called ...
[ "java", "android" ]
7
2
4,529
3
0
2011-06-04T16:24:16.120000
2011-06-04T16:27:17.460000
6,237,928
6,238,094
dates semantics in RSS
I'm reading the documentation of feedparser. It describes 4 attributes related to date published updated created expired What do these attributes mean in relation to RSS specification? It describes only pubDate thank you
Feedparser covers several syndication formats, for example Atom syndication format (RFC 4287). That is why you see a mis-match with the (relatively old) RSS standard. The documentation for feedparser has details about the semantics and where in the feed it picks up the values: Published: The date this entry was first p...
dates semantics in RSS I'm reading the documentation of feedparser. It describes 4 attributes related to date published updated created expired What do these attributes mean in relation to RSS specification? It describes only pubDate thank you
TITLE: dates semantics in RSS QUESTION: I'm reading the documentation of feedparser. It describes 4 attributes related to date published updated created expired What do these attributes mean in relation to RSS specification? It describes only pubDate thank you ANSWER: Feedparser covers several syndication formats, fo...
[ "rss", "feedparser" ]
1
1
66
1
0
2011-06-04T16:27:02.897000
2011-06-04T16:55:05.287000
6,237,934
6,237,994
DateTime formatting in Android?
I have a date/time that I get from a sqlite database and want to show in my Android app. I want it in the format: 9 November, 12:12. How do I do this? Is it best to format it before or after I enter it into the database?
See the answers to this question. In your database, I would suggest you keep timestamps in there rather than the formatted strings. That way your program would still work if you decide to change the format later.
DateTime formatting in Android? I have a date/time that I get from a sqlite database and want to show in my Android app. I want it in the format: 9 November, 12:12. How do I do this? Is it best to format it before or after I enter it into the database?
TITLE: DateTime formatting in Android? QUESTION: I have a date/time that I get from a sqlite database and want to show in my Android app. I want it in the format: 9 November, 12:12. How do I do this? Is it best to format it before or after I enter it into the database? ANSWER: See the answers to this question. In you...
[ "android", "sqlite", "datetime-format" ]
0
0
1,716
1
0
2011-06-04T16:27:40.587000
2011-06-04T16:37:54.443000
6,237,944
6,238,653
is there a better way to code a quotation form?
i am seeking advise and probably example code, links that will help me improve my quotation form. the current scenario is like that:- dynamic (select combo) rows are generated for items(from mysql database) along with empty input boxes for price and quantity. the user adds or deletes the rows based on no. if items requ...
I don't see where addRow and deleteRow are being called, but I will say here is where some of your inefficiencies may come: 1. var table = document.getElementById(tableID); 2. var rowCount = table.rows.length; 3. var row = table.insertRow(rowCount); 4. var colCount = table.rows[0].cells.length; Every time you add a row...
is there a better way to code a quotation form? i am seeking advise and probably example code, links that will help me improve my quotation form. the current scenario is like that:- dynamic (select combo) rows are generated for items(from mysql database) along with empty input boxes for price and quantity. the user add...
TITLE: is there a better way to code a quotation form? QUESTION: i am seeking advise and probably example code, links that will help me improve my quotation form. the current scenario is like that:- dynamic (select combo) rows are generated for items(from mysql database) along with empty input boxes for price and quan...
[ "php", "javascript", "mysql", "multiple-select" ]
3
0
317
2
0
2011-06-04T16:29:12.417000
2011-06-04T18:40:15.363000
6,237,951
6,237,973
HTML Input: uploading multiple files maxes at 20
I have an html input field, such as Files: And I want the user to be able to upload multiple files at once. My php for this uses a for loop to cycle through all the files, gathers information on each one, and then uploads them one by one. for($i = 0;$image['name'][$i] == true;$i++) { //code } But this won't upload more...
I'm a bit confused by the 'wont upload more than 20' part... what are you basing this on? You're getting an error either way it seems. Change your for loop to check for isset($image['name'][$i]) instead, and you will no longer get an error. for($i = 0; isset($image['name'][$i]); $i++) { //code } As mentioned by yes123,...
HTML Input: uploading multiple files maxes at 20 I have an html input field, such as Files: And I want the user to be able to upload multiple files at once. My php for this uses a for loop to cycle through all the files, gathers information on each one, and then uploads them one by one. for($i = 0;$image['name'][$i] ==...
TITLE: HTML Input: uploading multiple files maxes at 20 QUESTION: I have an html input field, such as Files: And I want the user to be able to upload multiple files at once. My php for this uses a for loop to cycle through all the files, gathers information on each one, and then uploads them one by one. for($i = 0;$im...
[ "php", "mysql", "input", "upload" ]
4
1
5,303
4
0
2011-06-04T16:30:28.480000
2011-06-04T16:34:25.537000
6,237,955
6,238,108
Error when generating an SSH key with Git: "no such file"
I continually run into the same error when I try to generate an SSH key: Generating public/private rsa key pair. Enter file in which to save the key (/home/konrad/.ssh/id_rsa): Here I press enter. Could not create directory '/home/konrad/.ssh' Then I enter my passphrases. open /home/konrad/.ssh/id_rsa failed: No such f...
On msysgit, you need first to set the user environment variable HOME (which isn't set by default in Windows). HOME can be set to any directory you want, you only have to make sure you have the right to write in it (and that the directory exists and a.ssh under it exists too).
Error when generating an SSH key with Git: "no such file" I continually run into the same error when I try to generate an SSH key: Generating public/private rsa key pair. Enter file in which to save the key (/home/konrad/.ssh/id_rsa): Here I press enter. Could not create directory '/home/konrad/.ssh' Then I enter my pa...
TITLE: Error when generating an SSH key with Git: "no such file" QUESTION: I continually run into the same error when I try to generate an SSH key: Generating public/private rsa key pair. Enter file in which to save the key (/home/konrad/.ssh/id_rsa): Here I press enter. Could not create directory '/home/konrad/.ssh' ...
[ "git" ]
12
9
18,885
2
0
2011-06-04T16:31:03.703000
2011-06-04T16:56:56.093000