PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
47
30.1k
OpenStatus_id
int64
0
4
4,113,757
11/06/2010 15:37:36
81,896
03/24/2009 00:30:02
517
6
So what's the deal with F#, now that it's been open-sourced?
I got pretty excited after finding out that F# will be released under the Apache license. But I am still not sure, whether the language/ecosystem is something worth investing my time in. So - what do you think will happen now? The F# team publishes only "source drops" and doesn't take contributions for now (I doubt they ever will). On the other hand there's F# PowerPack, where one can try to make F# world better (I hope they do take contributions). There's the http://fsharp.net site with lots of links but no open mailing list/forum. http://cs.hubfs.net seems empty and dead - is it really the center of the community? Is there a community? Mono seems to be interested in F#, but will they adapt it? Plus - if MS itself tries really hard not to replace C#/VB with F#, what is the language really for? You don't get Code Cotracts support, no mstest runner in visual studio, no GUI designers etc. So is F# just another MS product or something more?
.net
visual-studio-2010
f#
mono
null
11/07/2010 00:37:21
not constructive
So what's the deal with F#, now that it's been open-sourced? === I got pretty excited after finding out that F# will be released under the Apache license. But I am still not sure, whether the language/ecosystem is something worth investing my time in. So - what do you think will happen now? The F# team publishes only "source drops" and doesn't take contributions for now (I doubt they ever will). On the other hand there's F# PowerPack, where one can try to make F# world better (I hope they do take contributions). There's the http://fsharp.net site with lots of links but no open mailing list/forum. http://cs.hubfs.net seems empty and dead - is it really the center of the community? Is there a community? Mono seems to be interested in F#, but will they adapt it? Plus - if MS itself tries really hard not to replace C#/VB with F#, what is the language really for? You don't get Code Cotracts support, no mstest runner in visual studio, no GUI designers etc. So is F# just another MS product or something more?
4
5,712,904
04/19/2011 07:20:23
91,953
04/17/2009 03:51:14
93
9
empty dictionary as default value for keyword argument in python function: dictionary seems to not be initialised to {} on subsequent calls?
Here's a function. My intent is to use keyword argument defaults to make the dictionary an empty dictionary if it is not supplied. >>> def f( i, d={}, x=3 ) : ... d[i] = i*i ... x += i ... return x, d ... >>> f( 2 ) (5, {2: 4}) But when I next call f, I get: >>> f(3) (6, {2: 4, 3: 9}) It looks like the keyword argument d at the second call does not point to an empty dictionary, but rather to the dictionary as it was left at the end of the preceding call. The number x is reset to three on each call. Now I can work around this, but I would like your help understanding this. I believed that keyword arguments are in the local scope of the function, and would be deleted once the function returned. (Excuse and correct my terminology if I am being imprecise.) So the local value pointed to by the name d should be deleted, and on the next call, if I don't supply the keyword argument d, then d should be set to the default {}. But as you can see, d is being set to the dictionary that d pointed to in the preceding call. What is going on? Is the literal {} in the def line in the enclosing scope? This behaviour is seen in 2.5, 2.6 and 3.1. Thanks for your help!
python
dictionary
scope
keyword-argument
null
null
open
empty dictionary as default value for keyword argument in python function: dictionary seems to not be initialised to {} on subsequent calls? === Here's a function. My intent is to use keyword argument defaults to make the dictionary an empty dictionary if it is not supplied. >>> def f( i, d={}, x=3 ) : ... d[i] = i*i ... x += i ... return x, d ... >>> f( 2 ) (5, {2: 4}) But when I next call f, I get: >>> f(3) (6, {2: 4, 3: 9}) It looks like the keyword argument d at the second call does not point to an empty dictionary, but rather to the dictionary as it was left at the end of the preceding call. The number x is reset to three on each call. Now I can work around this, but I would like your help understanding this. I believed that keyword arguments are in the local scope of the function, and would be deleted once the function returned. (Excuse and correct my terminology if I am being imprecise.) So the local value pointed to by the name d should be deleted, and on the next call, if I don't supply the keyword argument d, then d should be set to the default {}. But as you can see, d is being set to the dictionary that d pointed to in the preceding call. What is going on? Is the literal {} in the def line in the enclosing scope? This behaviour is seen in 2.5, 2.6 and 3.1. Thanks for your help!
0
8,461,424
12/11/2011 02:04:29
1,091,820
12/11/2011 01:25:05
1
0
shortest path from A to B without superfluous edges (in Java)
I have an assignment where I need to build a simple undirected graph, calculate the path between two points, and calculate the capacity of the resulting path. I've gotten the capacity calculation working. And the path printout shows that a path between two points can also be found, but I can't get rid of edges resulting in dead-ends without breaking my code entirely. I've tried specifying bouncing back from dead-ends, but i hasn't worked so far. Any path using multiple-edged vertexes currently shows all of the edges connected to that vertex, whether or not that point is in the middle of the path or set as start/end. Basically, it covers all of the edges in-between the given points, even the superfluous ones. My code so far is below. My attempts at removing the dead-end edges from the path are commented out, but still there. Can anyone help me with fixing this? ----------------------------- import java.util.*; public class prax6 { public static void main (String[] args) { prax6 a = new prax6(); a.run(); } // main public void run() { Graph g = new Graph ("G"); Vertex a = new Vertex ("A"); // tipp A Vertex b = new Vertex ("B"); // tipp B Vertex c = new Vertex ("C"); // tipp C Vertex d = new Vertex ("D"); Vertex e = new Vertex ("E"); Vertex f = new Vertex ("F"); g.first = a; // graafi esimene tipp a.next = b; b.next = c; c.next = d; d.next = e; e.next = f; Edge ab = new Edge ("AB", 5); Edge ba = new Edge ("BA", 5); Edge ac = new Edge ("AC", 5); Edge ca = new Edge ("CA", 5); Edge bf = new Edge ("BF", 5); Edge fb = new Edge ("FB", 5); Edge cd = new Edge ("CD", 5); Edge dc = new Edge ("DC", 5); Edge ce = new Edge ("CE", 5); Edge ec = new Edge ("EC", 5); a.first = ab; b.first = ba; c.first = ca; d.first = dc; e.first = ec; f.first = fb; ba.next = bf; ab.next = ac; ca.next = cd; cd.next = ce; ab.target = b; ba.target = a; ac.target = c; ca.target = a; cd.target = d; dc.target = c; ec.target = c; ce.target = e; bf.target = f; fb.target = b; System.out.println (g); Queue<Edge> rada = f.SearchPaths(c, null); a.printPath(rada); } // run() class Vertex { String id; Vertex next; Edge first; Queue<Edge> rajad = new LinkedList<Edge>(); ArrayList<Vertex> visited = new ArrayList<Vertex>(); Vertex lopp; Vertex (String s, Vertex v, Edge e) { id = s; next = v; first = e; } Vertex (String s) { this (s, null, null); } @Override public String toString() { return id; } /** Võrdleb tippe * @param v millega võrreldakse * @return true or false */ public boolean isEquals(Vertex v) { return v.id.equals(id); } /** Moodustab serva * @param x etteantud tipp * @return x ühendatud serv */ public Edge leiaServ(Vertex x) { if(x == null || x.first == null) { return null; } Edge serv = x.first; while (serv != null) { if(serv.target.isEquals(x)) return serv; serv = serv.next; } return null; } /* depth-first search või brute-force search */ public Queue<Edge> SearchPaths(Vertex x, Vertex eelmine) { // kui üheski tipus ei ole käidud? if(visited.isEmpty()) lopp = x; // ?? start = x; ?? // kas x on külastatud punktide listis? if(visited.indexOf(x) > -1) return null; // leiad indeksi, ei tee midagi // kui x on lõpu leidnud if(x.isEquals(lopp)) { Edge serv = x.leiaServ(eelmine); // moodusta serv if(serv != null) rajad.add(serv); // lisa radadesse } // kui ei ole veel lõppu jõudnud Edge serv = x.first; // esimene serv selle tipu küljes while (serv != null) { if(visited.indexOf(serv.target) == -1) // ei ole visited if(serv != null) rajad.add(serv); //TODO ?? start new edge from old serv = serv.next; // ?? serv += serv.next } visited.add(x); // külastatud tipp lisa listi // otsi uuest tipust järgmine serv if(visited.indexOf(x.first.target) == -1) { Vertex jarg = x.first.target; Edge uusserv = jarg.leiaServ(x); if(uusserv != null) rajad.add(uusserv); SearchPaths(jarg, x); /* TODO "dead-end edges" // nt. x=C, jarg=D, D != lopp ... jarg.jarg == C (C-D-C) if(jarg!=lopp && visited.indexOf(jarg.first.target) != -1) jarg.equals(x); // x=C, jarg=E, E == lopp ... x == jarg // x=C, jarg=A, A != lopp ... jarg.jarg == B (C-A-B) if(jarg!=lopp && visited.indexOf(jarg.first.target) == -1) { jarg.leiaServ(x); rajad.add(serv); x.equals(jarg); // liiguta x edasi SearchPaths(jarg, x); }*/ } return rajad; } Queue<Edge> uus = new LinkedList<Edge>(); public void printPath(Queue<Edge> q) { if(q == null) throw new RuntimeException("Radade kogumik on tühi."); // while sööb raja ära... // salvesta uude queue-sse samal ajal kui vanast kustutad System.out.println("Läbitud rada: "); while (!q.isEmpty()) { uus.add(q.element()); // lisa kustutamisele minev element System.out.print(q.remove().id); System.out.print(" => "); } System.out.println(); System.out.println("Läbilaskevõime: " + ArvutaLLV(uus)); } /** * Leian terve raja läbilaskevõime. * @param q list radadest * @return llv ehk läbilaskevõime */ public int ArvutaLLV(Queue<Edge> q) { q = uus; if(uus == null) throw new RuntimeException("Radade kogumik on tühi."); int llv = 0; while(!uus.isEmpty()) { // leian llv ja liidan kokku llv+= uus.remove().Capacity(); } return llv; } } // Vertex ehk Tipp class Edge { String id; Vertex target; Edge next; private int llv = 0; Edge (String s, Vertex v, Edge e) { id = s; target = v; next = e; } Edge (String s) { this (s, null, null); } Edge (String s, int n) { this (s, null, null); llv = n; /// salvestab suuruse } Edge (Vertex x, Vertex y) { // this (x, y) } @Override public String toString() { return id; } // serva läbilaskevõime public int Capacity() { return llv; } /* public int ChangeCapacity(int n) { llv = n; return n; } // ChangeCapacity on poolik */ } // Edge ehk Serv class Graph { String id; Vertex first; Graph (String s, Vertex v) { id = s; first = v; } Graph (String s) { this (s, null); } @Override public String toString() { String nl = System.getProperty ("line.separator"); StringBuffer sb = new StringBuffer (nl); sb.append (id + nl); Vertex v = first; while (v != null) { sb.append (v.toString() + " --> "); Edge e = v.first; while (e != null) { sb.append (e.toString()); sb.append ("(" + v.toString() + "->" + e.target.toString() + ", " + e.Capacity() + ") "); e = e.next; } sb.append (nl); v = v.next; } return sb.toString(); } } // Graph }
graph-algorithm
shortest-path
null
null
null
12/11/2011 15:31:21
not a real question
shortest path from A to B without superfluous edges (in Java) === I have an assignment where I need to build a simple undirected graph, calculate the path between two points, and calculate the capacity of the resulting path. I've gotten the capacity calculation working. And the path printout shows that a path between two points can also be found, but I can't get rid of edges resulting in dead-ends without breaking my code entirely. I've tried specifying bouncing back from dead-ends, but i hasn't worked so far. Any path using multiple-edged vertexes currently shows all of the edges connected to that vertex, whether or not that point is in the middle of the path or set as start/end. Basically, it covers all of the edges in-between the given points, even the superfluous ones. My code so far is below. My attempts at removing the dead-end edges from the path are commented out, but still there. Can anyone help me with fixing this? ----------------------------- import java.util.*; public class prax6 { public static void main (String[] args) { prax6 a = new prax6(); a.run(); } // main public void run() { Graph g = new Graph ("G"); Vertex a = new Vertex ("A"); // tipp A Vertex b = new Vertex ("B"); // tipp B Vertex c = new Vertex ("C"); // tipp C Vertex d = new Vertex ("D"); Vertex e = new Vertex ("E"); Vertex f = new Vertex ("F"); g.first = a; // graafi esimene tipp a.next = b; b.next = c; c.next = d; d.next = e; e.next = f; Edge ab = new Edge ("AB", 5); Edge ba = new Edge ("BA", 5); Edge ac = new Edge ("AC", 5); Edge ca = new Edge ("CA", 5); Edge bf = new Edge ("BF", 5); Edge fb = new Edge ("FB", 5); Edge cd = new Edge ("CD", 5); Edge dc = new Edge ("DC", 5); Edge ce = new Edge ("CE", 5); Edge ec = new Edge ("EC", 5); a.first = ab; b.first = ba; c.first = ca; d.first = dc; e.first = ec; f.first = fb; ba.next = bf; ab.next = ac; ca.next = cd; cd.next = ce; ab.target = b; ba.target = a; ac.target = c; ca.target = a; cd.target = d; dc.target = c; ec.target = c; ce.target = e; bf.target = f; fb.target = b; System.out.println (g); Queue<Edge> rada = f.SearchPaths(c, null); a.printPath(rada); } // run() class Vertex { String id; Vertex next; Edge first; Queue<Edge> rajad = new LinkedList<Edge>(); ArrayList<Vertex> visited = new ArrayList<Vertex>(); Vertex lopp; Vertex (String s, Vertex v, Edge e) { id = s; next = v; first = e; } Vertex (String s) { this (s, null, null); } @Override public String toString() { return id; } /** Võrdleb tippe * @param v millega võrreldakse * @return true or false */ public boolean isEquals(Vertex v) { return v.id.equals(id); } /** Moodustab serva * @param x etteantud tipp * @return x ühendatud serv */ public Edge leiaServ(Vertex x) { if(x == null || x.first == null) { return null; } Edge serv = x.first; while (serv != null) { if(serv.target.isEquals(x)) return serv; serv = serv.next; } return null; } /* depth-first search või brute-force search */ public Queue<Edge> SearchPaths(Vertex x, Vertex eelmine) { // kui üheski tipus ei ole käidud? if(visited.isEmpty()) lopp = x; // ?? start = x; ?? // kas x on külastatud punktide listis? if(visited.indexOf(x) > -1) return null; // leiad indeksi, ei tee midagi // kui x on lõpu leidnud if(x.isEquals(lopp)) { Edge serv = x.leiaServ(eelmine); // moodusta serv if(serv != null) rajad.add(serv); // lisa radadesse } // kui ei ole veel lõppu jõudnud Edge serv = x.first; // esimene serv selle tipu küljes while (serv != null) { if(visited.indexOf(serv.target) == -1) // ei ole visited if(serv != null) rajad.add(serv); //TODO ?? start new edge from old serv = serv.next; // ?? serv += serv.next } visited.add(x); // külastatud tipp lisa listi // otsi uuest tipust järgmine serv if(visited.indexOf(x.first.target) == -1) { Vertex jarg = x.first.target; Edge uusserv = jarg.leiaServ(x); if(uusserv != null) rajad.add(uusserv); SearchPaths(jarg, x); /* TODO "dead-end edges" // nt. x=C, jarg=D, D != lopp ... jarg.jarg == C (C-D-C) if(jarg!=lopp && visited.indexOf(jarg.first.target) != -1) jarg.equals(x); // x=C, jarg=E, E == lopp ... x == jarg // x=C, jarg=A, A != lopp ... jarg.jarg == B (C-A-B) if(jarg!=lopp && visited.indexOf(jarg.first.target) == -1) { jarg.leiaServ(x); rajad.add(serv); x.equals(jarg); // liiguta x edasi SearchPaths(jarg, x); }*/ } return rajad; } Queue<Edge> uus = new LinkedList<Edge>(); public void printPath(Queue<Edge> q) { if(q == null) throw new RuntimeException("Radade kogumik on tühi."); // while sööb raja ära... // salvesta uude queue-sse samal ajal kui vanast kustutad System.out.println("Läbitud rada: "); while (!q.isEmpty()) { uus.add(q.element()); // lisa kustutamisele minev element System.out.print(q.remove().id); System.out.print(" => "); } System.out.println(); System.out.println("Läbilaskevõime: " + ArvutaLLV(uus)); } /** * Leian terve raja läbilaskevõime. * @param q list radadest * @return llv ehk läbilaskevõime */ public int ArvutaLLV(Queue<Edge> q) { q = uus; if(uus == null) throw new RuntimeException("Radade kogumik on tühi."); int llv = 0; while(!uus.isEmpty()) { // leian llv ja liidan kokku llv+= uus.remove().Capacity(); } return llv; } } // Vertex ehk Tipp class Edge { String id; Vertex target; Edge next; private int llv = 0; Edge (String s, Vertex v, Edge e) { id = s; target = v; next = e; } Edge (String s) { this (s, null, null); } Edge (String s, int n) { this (s, null, null); llv = n; /// salvestab suuruse } Edge (Vertex x, Vertex y) { // this (x, y) } @Override public String toString() { return id; } // serva läbilaskevõime public int Capacity() { return llv; } /* public int ChangeCapacity(int n) { llv = n; return n; } // ChangeCapacity on poolik */ } // Edge ehk Serv class Graph { String id; Vertex first; Graph (String s, Vertex v) { id = s; first = v; } Graph (String s) { this (s, null); } @Override public String toString() { String nl = System.getProperty ("line.separator"); StringBuffer sb = new StringBuffer (nl); sb.append (id + nl); Vertex v = first; while (v != null) { sb.append (v.toString() + " --> "); Edge e = v.first; while (e != null) { sb.append (e.toString()); sb.append ("(" + v.toString() + "->" + e.target.toString() + ", " + e.Capacity() + ") "); e = e.next; } sb.append (nl); v = v.next; } return sb.toString(); } } // Graph }
1
6,916,768
08/02/2011 18:28:08
286,618
03/04/2010 20:55:10
305
13
How To Check IIS 7 Redirects
We have a webserver running Windows Server 2008 and IIS7 that has had updates upon updates for years on it. Some sub-folders and files have redirects to other URLs, some of which are no longer needed but never cleaned out. We are migrating to another server and will want to clean up the redirects that have been used. We need a way to find out what folders and pages are setup with redirects and where they are redirecting to. I tried searching the `applicationHost.config` file in `C:\Windows\System32\inetsrv\config` but that doesn't seem to store them. Am I looking in the right place? Is there a file I can open and manually look through it to find these redirects? Is there a script (C#, VBS, other) I can run to determine these redirects? Or is there some other method to find these? Thanks in advance.
c#
iis
iis7
redirect
null
08/02/2011 23:58:34
off topic
How To Check IIS 7 Redirects === We have a webserver running Windows Server 2008 and IIS7 that has had updates upon updates for years on it. Some sub-folders and files have redirects to other URLs, some of which are no longer needed but never cleaned out. We are migrating to another server and will want to clean up the redirects that have been used. We need a way to find out what folders and pages are setup with redirects and where they are redirecting to. I tried searching the `applicationHost.config` file in `C:\Windows\System32\inetsrv\config` but that doesn't seem to store them. Am I looking in the right place? Is there a file I can open and manually look through it to find these redirects? Is there a script (C#, VBS, other) I can run to determine these redirects? Or is there some other method to find these? Thanks in advance.
2
1,696,773
11/08/2009 14:54:42
137,685
07/13/2009 20:33:04
1
0
How to detect sound frequency / pitch on an iPhone?
I'm trying to find a way to detect sound frequency being recorded by iPhone's Microphone. I'd like to detect whether the sound frequency is going up or down.
iphone
audio
frequency
pitch
null
null
open
How to detect sound frequency / pitch on an iPhone? === I'm trying to find a way to detect sound frequency being recorded by iPhone's Microphone. I'd like to detect whether the sound frequency is going up or down.
0
11,369,668
07/06/2012 21:08:12
636,656
02/27/2011 17:23:21
9,620
217
How to match all internationalized text?
I'm on a search-and-destroy mission for anything Amazon finds distasteful. In the past I've dealt with this by using `iconv` to convert from "UTF-8" to "latin1", but I can't do that here because it's encoded as "unknown": test <- "Gwena\xeblle M" > gsub("\xeb","", df[306,"primauthfirstname"] ) [1] "Gwenalle M" > Encoding(df[306,"primauthfirstname"]) [1] "unknown" So what regex eliminates all the \x## codes?
regex
r
internationalization
null
null
null
open
How to match all internationalized text? === I'm on a search-and-destroy mission for anything Amazon finds distasteful. In the past I've dealt with this by using `iconv` to convert from "UTF-8" to "latin1", but I can't do that here because it's encoded as "unknown": test <- "Gwena\xeblle M" > gsub("\xeb","", df[306,"primauthfirstname"] ) [1] "Gwenalle M" > Encoding(df[306,"primauthfirstname"]) [1] "unknown" So what regex eliminates all the \x## codes?
0
3,405,059
08/04/2010 11:32:47
178,301
09/24/2009 08:05:52
466
33
how to show youtube video thumbnails
my site lets users upload the youtube video codes. I am trying to make playlist by showing the thumbnails of the uploaded videos and play the respective video after clicking on specific thumbnail. i would like to know the method of getting the caption and the thumbnail pictures of those videos which has been uploaded using embed code of youtube?
php
youtube
thumbnail
null
null
null
open
how to show youtube video thumbnails === my site lets users upload the youtube video codes. I am trying to make playlist by showing the thumbnails of the uploaded videos and play the respective video after clicking on specific thumbnail. i would like to know the method of getting the caption and the thumbnail pictures of those videos which has been uploaded using embed code of youtube?
0
7,638,452
10/03/2011 17:24:26
957,627
09/21/2011 18:33:11
27
0
How come my ExecuteScalar isn't working?
I'm trying to return the result as a string and I keep erring out at the cmd.ExecuteScalar() Any suggestions? static public string GetScalar(string sql) { string result = ""; SqlConnection conn = new SqlConnection(ConnectionString); SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); try { result = cmd.ExecuteScalar().ToString(); } catch (SqlException ex) { DBUtilExceptionHandler(ex, sql); throw ex; } finally { conn.Close(); } return result; } I'm passing the following sql statement into sql: select count(LeadListID) from LeadLists WHERE SalesPersonID = 1 AND LeadListDateCreated BETWEEN '9/1/11' AND '10/1/11 23:59:59' which works fine as a query in Server Management Studio.
c#
asp.net
sql-server
null
null
10/03/2011 18:06:44
not a real question
How come my ExecuteScalar isn't working? === I'm trying to return the result as a string and I keep erring out at the cmd.ExecuteScalar() Any suggestions? static public string GetScalar(string sql) { string result = ""; SqlConnection conn = new SqlConnection(ConnectionString); SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); try { result = cmd.ExecuteScalar().ToString(); } catch (SqlException ex) { DBUtilExceptionHandler(ex, sql); throw ex; } finally { conn.Close(); } return result; } I'm passing the following sql statement into sql: select count(LeadListID) from LeadLists WHERE SalesPersonID = 1 AND LeadListDateCreated BETWEEN '9/1/11' AND '10/1/11 23:59:59' which works fine as a query in Server Management Studio.
1
9,801,206
03/21/2012 08:46:44
466,139
10/04/2010 18:52:14
40
0
Combining Two Regular Expressions
<!-- language-all: lang-js --> Hello Everyone, I've got a question about accomplishing something in regular expressions i.e is it possible and if so how. Mind you regular expressions start to make my head spin after a while :-P Short synopsis of what I am doing: >I read Manga online (took Japanese in high school got addicted...) >I like to open up the current issue in a new tab but I don't always remember to click the link with a middle click >So I decided to write a Greasemonkey script that would run on any of the sites pages adding a target="_blank" to any anchor tag that references a manga or an issue of that manga so a regular click would open it in a new tab. >The script itself is working fine nothing spectacular about it Now on to I'll call it the caveat >The link patterns we'll call it for each manga is as follows <language of manga>/<manga name> links to the main about page for the manga <language of manga>/<manga name>/<issue number> links to the issue number itself <language of manga>/<manga name>/<issue number>/<page number> links to the specific page of the issue Now I want it to always make the first two open in a new tab but I do NOT want the last one to open in a new tab. The reason for this is when reading the actual manga each click to advance the page would open a new tab. So to accomplish this I have two regular expressions <!-- language: lang-js --> var MangaIssueRegex = /en-manga\/[A-Za-z0-9\-]+\//; var MangaIssuePageRegex = /en-manga\/[A-Za-z0-9\-]+\/(\d+\/){2}/ The first regex picks up any of the three manga link patterns. The second regex picks up only the third manga link pattern (the one for a specific page) In a nutshell the greasemonkey script loops through all the anchor tags on the page when it loads and if the href attribute of the anchor tag passes the MangaIssueRegex AND fails the MangaIssuePageRegex the anchor tag is modified to open in a new tab otherwise the anchor tag is not modified. Now is it possible to combine both regular expressions into a single one that will match the first two patterns but fail if the third pattern is encountered? If so please explain how I would really love to expand my knowledge about regular expressions even if it is just a little at a time. Thanks in advance for the help everyone. Going to include the whole script just because I know someone usually asks to see it to help them give good advice. var MangaIssueRegex = /en-manga\/[A-Za-z0-9\-]+\//; var MangaIssuePageRegex = /en-manga\/[A-Za-z0-9\-]+\/(\d+\/){2}/ var elements = document.getElementsByTagName("a"); for (var i = 0; i < elements.length; i++) { if (MangaIssueRegex.test(elements[i].getAttribute("href")) && !MangaIssuePageRegex.test(elements[i].getAttribute("href"))) { elements[i].setAttribute("target","_blank"); elements[i].setAttribute("title","Opens in another tab"); } }
javascript
regex
greasemonkey
null
null
null
open
Combining Two Regular Expressions === <!-- language-all: lang-js --> Hello Everyone, I've got a question about accomplishing something in regular expressions i.e is it possible and if so how. Mind you regular expressions start to make my head spin after a while :-P Short synopsis of what I am doing: >I read Manga online (took Japanese in high school got addicted...) >I like to open up the current issue in a new tab but I don't always remember to click the link with a middle click >So I decided to write a Greasemonkey script that would run on any of the sites pages adding a target="_blank" to any anchor tag that references a manga or an issue of that manga so a regular click would open it in a new tab. >The script itself is working fine nothing spectacular about it Now on to I'll call it the caveat >The link patterns we'll call it for each manga is as follows <language of manga>/<manga name> links to the main about page for the manga <language of manga>/<manga name>/<issue number> links to the issue number itself <language of manga>/<manga name>/<issue number>/<page number> links to the specific page of the issue Now I want it to always make the first two open in a new tab but I do NOT want the last one to open in a new tab. The reason for this is when reading the actual manga each click to advance the page would open a new tab. So to accomplish this I have two regular expressions <!-- language: lang-js --> var MangaIssueRegex = /en-manga\/[A-Za-z0-9\-]+\//; var MangaIssuePageRegex = /en-manga\/[A-Za-z0-9\-]+\/(\d+\/){2}/ The first regex picks up any of the three manga link patterns. The second regex picks up only the third manga link pattern (the one for a specific page) In a nutshell the greasemonkey script loops through all the anchor tags on the page when it loads and if the href attribute of the anchor tag passes the MangaIssueRegex AND fails the MangaIssuePageRegex the anchor tag is modified to open in a new tab otherwise the anchor tag is not modified. Now is it possible to combine both regular expressions into a single one that will match the first two patterns but fail if the third pattern is encountered? If so please explain how I would really love to expand my knowledge about regular expressions even if it is just a little at a time. Thanks in advance for the help everyone. Going to include the whole script just because I know someone usually asks to see it to help them give good advice. var MangaIssueRegex = /en-manga\/[A-Za-z0-9\-]+\//; var MangaIssuePageRegex = /en-manga\/[A-Za-z0-9\-]+\/(\d+\/){2}/ var elements = document.getElementsByTagName("a"); for (var i = 0; i < elements.length; i++) { if (MangaIssueRegex.test(elements[i].getAttribute("href")) && !MangaIssuePageRegex.test(elements[i].getAttribute("href"))) { elements[i].setAttribute("target","_blank"); elements[i].setAttribute("title","Opens in another tab"); } }
0
10,519,427
05/09/2012 15:41:08
1,023,100
11/01/2011 05:01:20
8
0
Why should we use JooMFish in Joomla 2.5, if Joomla 2.5 provides multilingual support?
I installed JooMFish alpha version successfully. I am new to Joomla. My question is. If joomla 2.5 has multilingual support then why will go for joomfish. What is main difference between JoomFish and Joomla 2.5 multilingual feature that will prompt people to go for JoomFish? Regards,
joomla
joomfish
null
null
null
null
open
Why should we use JooMFish in Joomla 2.5, if Joomla 2.5 provides multilingual support? === I installed JooMFish alpha version successfully. I am new to Joomla. My question is. If joomla 2.5 has multilingual support then why will go for joomfish. What is main difference between JoomFish and Joomla 2.5 multilingual feature that will prompt people to go for JoomFish? Regards,
0
7,755,466
10/13/2011 14:12:50
993,634
10/13/2011 14:05:58
1
0
Not working Javascript in any browser except IE
I have following code.. <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Automatic Resize TextBox</title> <script type="text/javascript"> function setHeight(txtdesc) { txtdesc.style.height = txtdesc.scrollHeight + "px"; } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="txtDesc" runat= "server" TextMode="MultiLine" Onkeyup="setHeight(this);" onkeydown="setHeight(this);" /> </div> </form> </body> </html> This is a javascript for Resize the Textbox while writing in text box.means if textbox will fill completely then it will be expand automatically but if we remove the textbox then the textbox will be collapsed...its working fine in IE but not in other browser plz help me....
javascript
null
null
null
null
null
open
Not working Javascript in any browser except IE === I have following code.. <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Automatic Resize TextBox</title> <script type="text/javascript"> function setHeight(txtdesc) { txtdesc.style.height = txtdesc.scrollHeight + "px"; } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="txtDesc" runat= "server" TextMode="MultiLine" Onkeyup="setHeight(this);" onkeydown="setHeight(this);" /> </div> </form> </body> </html> This is a javascript for Resize the Textbox while writing in text box.means if textbox will fill completely then it will be expand automatically but if we remove the textbox then the textbox will be collapsed...its working fine in IE but not in other browser plz help me....
0
10,917,103
06/06/2012 15:12:17
277,465
02/20/2010 01:30:30
1,449
10
understanding the ssh login using PKI
I have generated a keypair(public and private) and copied over the public key over to a remote server, `ssh-copy-id` the public key and disabled password based login. Now I can ssh into the machine without providing a passphrase. I've been looking around for the protocol or message exchanges that might happen on the occasion that I ssh into the remote machine I have been looking around but could not find articles that describe how exactly the identity is confirmed in such a situation. I understand PKI, and Diffie-Hellman at a very high level but I'm not able to get the big picture about what exactly happens what i ssh into the remote machine. Could someone explain/link me to articles that do the same? Thanks!
ssh
cryptography
rsa
public-key-encryption
pki
null
open
understanding the ssh login using PKI === I have generated a keypair(public and private) and copied over the public key over to a remote server, `ssh-copy-id` the public key and disabled password based login. Now I can ssh into the machine without providing a passphrase. I've been looking around for the protocol or message exchanges that might happen on the occasion that I ssh into the remote machine I have been looking around but could not find articles that describe how exactly the identity is confirmed in such a situation. I understand PKI, and Diffie-Hellman at a very high level but I'm not able to get the big picture about what exactly happens what i ssh into the remote machine. Could someone explain/link me to articles that do the same? Thanks!
0
9,532,352
03/02/2012 11:13:05
1,244,920
03/02/2012 11:10:18
1
0
Windows 8 and F#
So, since one cannot build metro style apps with F# and it isn’t possible to reference a F# library from within a metro style app, where is the place of F# in Windows 8? I mean what is its future? Won’t F# have the same fate as Silverlight after a while? Does Microsoft have the will to develop it farther? I know, I know I can still develop asp.net, WCF and desktop applications in F#, but the question is what are the long term plans of the Microsoft with it? Will it perish some day, or will live forever? Thanks and best regards.
f#
styles
winrt
metro
null
03/02/2012 12:57:45
not constructive
Windows 8 and F# === So, since one cannot build metro style apps with F# and it isn’t possible to reference a F# library from within a metro style app, where is the place of F# in Windows 8? I mean what is its future? Won’t F# have the same fate as Silverlight after a while? Does Microsoft have the will to develop it farther? I know, I know I can still develop asp.net, WCF and desktop applications in F#, but the question is what are the long term plans of the Microsoft with it? Will it perish some day, or will live forever? Thanks and best regards.
4
2,382,770
03/04/2010 21:15:46
31,017
10/23/2008 23:29:59
46
7
Can we get a canthrow statment in C# ?
As a good programmer and code reviewer, I am always cringing when I see a developer catch "Exception". I was going to suggest C# add the "throws" clause from Java, but after reading the Anders Hejlsberg interview (http://www.artima.com/intv/handcuffs.html) I see why it is not there. Instead, I would like to suggest the **canthrow** statement. The **canthrow** statement would have the following properties 1. canthrow statement would be declared on the method and list the exceptions that this method throws. 2. canthrow would report to the calling methods or intellisense the exceptions that can be thrown, as well as any exceptions that a called method could throw and are not handled locally. 3. canthrow is **not** contractual, so versioning is not a problem. The idea here is that most developers want to catch and handle the proper exceptions, but they simply don't know what they are. If we have a way to inspect the methods a design time, developers will be more likely to add and handle the exceptions that are relevant and let the unhandled exceptions bubble up. Now as final thought, you probably can say that this could all be done by Intellisense using reflection, but that would return every and all exception possible. The canthrow would be allow the library developer to emphasize the exceptions that are expected to be handled by the callers. What do you think?
c#
language-features
java
null
null
03/04/2010 21:26:57
not constructive
Can we get a canthrow statment in C# ? === As a good programmer and code reviewer, I am always cringing when I see a developer catch "Exception". I was going to suggest C# add the "throws" clause from Java, but after reading the Anders Hejlsberg interview (http://www.artima.com/intv/handcuffs.html) I see why it is not there. Instead, I would like to suggest the **canthrow** statement. The **canthrow** statement would have the following properties 1. canthrow statement would be declared on the method and list the exceptions that this method throws. 2. canthrow would report to the calling methods or intellisense the exceptions that can be thrown, as well as any exceptions that a called method could throw and are not handled locally. 3. canthrow is **not** contractual, so versioning is not a problem. The idea here is that most developers want to catch and handle the proper exceptions, but they simply don't know what they are. If we have a way to inspect the methods a design time, developers will be more likely to add and handle the exceptions that are relevant and let the unhandled exceptions bubble up. Now as final thought, you probably can say that this could all be done by Intellisense using reflection, but that would return every and all exception possible. The canthrow would be allow the library developer to emphasize the exceptions that are expected to be handled by the callers. What do you think?
4
9,295,910
02/15/2012 15:13:01
959,734
09/22/2011 17:56:57
584
2
Layout element: one on top of the other
I would like to create a **ad banner** which shows at the **bottom** of the screen, and the page of the screen is **scrollable** except the banner. Banner stay at bottom constantly. So, I need a `<ScrollView>` element, and I need a `<LinearLayout>` element positioned on top of the `<ScrollView>`. and located at the **bottom** of the screen. How can I implement the layout for ad banner in Android ??? (I am developing **Android 2.1 API 7** app) , can someone give me some hints?? ***************UPDATE*************** I figured out to use `<FrameLayout>` , but still interested to hear other opinions.
android
android-layout
android-intent
android-emulator
android-widget
null
open
Layout element: one on top of the other === I would like to create a **ad banner** which shows at the **bottom** of the screen, and the page of the screen is **scrollable** except the banner. Banner stay at bottom constantly. So, I need a `<ScrollView>` element, and I need a `<LinearLayout>` element positioned on top of the `<ScrollView>`. and located at the **bottom** of the screen. How can I implement the layout for ad banner in Android ??? (I am developing **Android 2.1 API 7** app) , can someone give me some hints?? ***************UPDATE*************** I figured out to use `<FrameLayout>` , but still interested to hear other opinions.
0
7,249,719
08/30/2011 20:56:58
250,000
01/13/2010 16:32:41
6
1
How safe are Doctrine's save and trysave methods?
I searched the whole net trying to find the answer to my question but I didn't find it: will I have problems using save and trysave methods with user inputs or will Doctrine take care of the possible SQL Injections for me?? Thanks in advance!!
php
security
doctrine
null
null
08/30/2011 22:23:10
not constructive
How safe are Doctrine's save and trysave methods? === I searched the whole net trying to find the answer to my question but I didn't find it: will I have problems using save and trysave methods with user inputs or will Doctrine take care of the possible SQL Injections for me?? Thanks in advance!!
4
4,811,834
01/27/2011 00:39:09
327,073
04/27/2010 16:56:12
253
7
How to get IP address with a host name?
I am making a client that connect to a server that is locally hosted that gets stock numbers from the server. The program does work if i use this code below but the way it works is by getting the dns name so in theory it only takes www.website.com and I cant figure out how I can get it to recognize a normal ip of 127.0.0.1 or localhost IP: IPHostEntry ipHostInfo = Dns.GetHostEntry("www.website.com"); IPAddress ipAddress = ipHostInfo.AddressList[0]; IPEndPoint remoteEP = new IPEndPoint(ipAddress, port); Attached is my attemp to get this to resolve the ip but I dont think I am approaching this right the full code can be seen here:[StockReader Client Code][1] public class AsynchronousClient { private const int port = 21; // ManualResetEvent instances signal completion. private static ManualResetEvent connectDone = new ManualResetEvent(false); private static ManualResetEvent sendDone = new ManualResetEvent(false); private static ManualResetEvent receiveDone = new ManualResetEvent(false); // The response from the remote device. private static String response = String.Empty; private static void StartClient() { // Connect to a remote device. try { // Establish the remote endpoint for the socket. // The name of the //******************ISSUE BEGINS HERE********************************* string sHostName = Dns.GetHostName(); IPHostEntry ipHostInfo = Dns.GetHostEntry(sHostName); IPAddress [] ipAddress = ipHostInfo.AddressList; IPEndPoint remoteEP = new IPEndPoint(ipAddress, port); // Create a TCP/IP socket. Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // Connect to the remote endpoint. client.BeginConnect(remoteEP, new AsyncCallback(ConnectCallback), client); connectDone.WaitOne(); // Send test data to the remote device. Send(client, "This is a test<EOF>"); sendDone.WaitOne(); // Receive the response from the remote device. Receive(client); receiveDone.WaitOne(); // Write the response to the console. Console.WriteLine("Response received : {0}", response); // Release the socket. client.Shutdown(SocketShutdown.Both); client.Close(); } catch (Exception e) { Console.WriteLine(e.ToString()); } } [1]: http://www.cutitclan.com/pasteme/index.php?s
c#
c#-4.0
null
null
null
null
open
How to get IP address with a host name? === I am making a client that connect to a server that is locally hosted that gets stock numbers from the server. The program does work if i use this code below but the way it works is by getting the dns name so in theory it only takes www.website.com and I cant figure out how I can get it to recognize a normal ip of 127.0.0.1 or localhost IP: IPHostEntry ipHostInfo = Dns.GetHostEntry("www.website.com"); IPAddress ipAddress = ipHostInfo.AddressList[0]; IPEndPoint remoteEP = new IPEndPoint(ipAddress, port); Attached is my attemp to get this to resolve the ip but I dont think I am approaching this right the full code can be seen here:[StockReader Client Code][1] public class AsynchronousClient { private const int port = 21; // ManualResetEvent instances signal completion. private static ManualResetEvent connectDone = new ManualResetEvent(false); private static ManualResetEvent sendDone = new ManualResetEvent(false); private static ManualResetEvent receiveDone = new ManualResetEvent(false); // The response from the remote device. private static String response = String.Empty; private static void StartClient() { // Connect to a remote device. try { // Establish the remote endpoint for the socket. // The name of the //******************ISSUE BEGINS HERE********************************* string sHostName = Dns.GetHostName(); IPHostEntry ipHostInfo = Dns.GetHostEntry(sHostName); IPAddress [] ipAddress = ipHostInfo.AddressList; IPEndPoint remoteEP = new IPEndPoint(ipAddress, port); // Create a TCP/IP socket. Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // Connect to the remote endpoint. client.BeginConnect(remoteEP, new AsyncCallback(ConnectCallback), client); connectDone.WaitOne(); // Send test data to the remote device. Send(client, "This is a test<EOF>"); sendDone.WaitOne(); // Receive the response from the remote device. Receive(client); receiveDone.WaitOne(); // Write the response to the console. Console.WriteLine("Response received : {0}", response); // Release the socket. client.Shutdown(SocketShutdown.Both); client.Close(); } catch (Exception e) { Console.WriteLine(e.ToString()); } } [1]: http://www.cutitclan.com/pasteme/index.php?s
0
1,310,050
08/21/2009 04:09:53
144,259
07/24/2009 06:22:08
24
0
PHP Function Comments
Just a quick question: I've seen that some PHP functions are commented at the top, using a format that is unknown to me: /** * * Convert an object to an array * * @param object $object The object to convert * @return array * */ My IDE gives me a dropdown selection for the things such as @param and @return, so it must be documented somewhere. I've tried searching google but it won't include the @ symbol in its search. What is this format of commenting and where can I find some information on it?
php
format
function
comments
null
null
open
PHP Function Comments === Just a quick question: I've seen that some PHP functions are commented at the top, using a format that is unknown to me: /** * * Convert an object to an array * * @param object $object The object to convert * @return array * */ My IDE gives me a dropdown selection for the things such as @param and @return, so it must be documented somewhere. I've tried searching google but it won't include the @ symbol in its search. What is this format of commenting and where can I find some information on it?
0
4,129,883
11/09/2010 02:08:03
339,860
05/13/2010 00:55:51
33
0
Starting jython program from python using subprocess module?
I have a jython server script (called rajant_server.py) that interacts with a java api file to communicate over special network radios. I have a python program which acts as a client (and does several other things as well). Currently, I have to start the server first by opening a command/terminal window and typing: cd [path to directory containing rajant_server.py jython rajant_server.py Once the server successfully connects it waits for the client, which I start by running: cd [path to directory containing python client program] python main.py When the client connects, the server prints out information (currently for debug) in it's command/terminal window, and the client program prints out debug information in it's command/terminal window. **What I want to do is do away with the complex process by calling jython from my 'main.py' program using the subprocess module.** The problem is two fold: 1 - I need the rajant_server.py program to open in it's own terminal/command window 2 - jython needs to be run in the directory where the rajant_server.py file is stored, in other words, typing the following into the command/Terminal Window doesn't work (don't ask me why): jython C:/code_dir/comm/server/rajant_server.py but: cd C:/code_dir/comm/server jython rajant_server.py does work. --- Okay... I just got something to work. It seems like a bit of a hack, so I would still love ideas on a better approach. Here is what I am currently doing: serverfile = r'rajant_server_v2.py' serverpath = os.path.join(os.path.realpath('.'),'Comm',serverfile) serverpath = os.path.normpath(serverpath) [path,file] = os.path.split(serverpath) command = '/C jython '+file+'\n' savedir = os.getcwd() os.chdir(path) rajantserver = subprocess.Popen(["cmd",command],\ creationflags = subprocess.CREATE_NEW_CONSOLE) #Change Directory back os.chdir(savedir) #Start Client rajant = rajant_comm.rajant_comm() rajant.start() If you have a solution that will work in both linux & windows you would be my hero. For some reason I couldn't change the stdin or stdout specifications on the subprocess when I added creationflags = subprocess.CREATE_NEW_CONSOLE.
python
subprocess
jython
null
null
null
open
Starting jython program from python using subprocess module? === I have a jython server script (called rajant_server.py) that interacts with a java api file to communicate over special network radios. I have a python program which acts as a client (and does several other things as well). Currently, I have to start the server first by opening a command/terminal window and typing: cd [path to directory containing rajant_server.py jython rajant_server.py Once the server successfully connects it waits for the client, which I start by running: cd [path to directory containing python client program] python main.py When the client connects, the server prints out information (currently for debug) in it's command/terminal window, and the client program prints out debug information in it's command/terminal window. **What I want to do is do away with the complex process by calling jython from my 'main.py' program using the subprocess module.** The problem is two fold: 1 - I need the rajant_server.py program to open in it's own terminal/command window 2 - jython needs to be run in the directory where the rajant_server.py file is stored, in other words, typing the following into the command/Terminal Window doesn't work (don't ask me why): jython C:/code_dir/comm/server/rajant_server.py but: cd C:/code_dir/comm/server jython rajant_server.py does work. --- Okay... I just got something to work. It seems like a bit of a hack, so I would still love ideas on a better approach. Here is what I am currently doing: serverfile = r'rajant_server_v2.py' serverpath = os.path.join(os.path.realpath('.'),'Comm',serverfile) serverpath = os.path.normpath(serverpath) [path,file] = os.path.split(serverpath) command = '/C jython '+file+'\n' savedir = os.getcwd() os.chdir(path) rajantserver = subprocess.Popen(["cmd",command],\ creationflags = subprocess.CREATE_NEW_CONSOLE) #Change Directory back os.chdir(savedir) #Start Client rajant = rajant_comm.rajant_comm() rajant.start() If you have a solution that will work in both linux & windows you would be my hero. For some reason I couldn't change the stdin or stdout specifications on the subprocess when I added creationflags = subprocess.CREATE_NEW_CONSOLE.
0
10,049,972
04/06/2012 22:30:02
1,098,146
12/14/2011 15:34:43
1
0
C++ : array of coordinates?
I have a problem with my code. Actually it works, but I want to clean it to make it more proper. So I have a class Coord which contains a float x and a foat y. The constructor is : void Coord::Coord (float x,float y) { this->x = x; this->y = y; } I create all the points that I need in that way : Coord pt1(0,1); Coord pt2(20,0); ... Coord pt61(12,14); .... ` After I have to make an array of some points , for exemple the fifth five points will be assignated in an array, 4 other points in an other array, 2 other points in another one... Coord pts_weakhealth[3] = {pt1,pt2,pt3}; This array, i'll have to give as arguments for the constructor of a class for exemple : Sef health(pts_weakhealth,3); Sef strenght(pts_weak,4);` I'll create some Sef in the same way and then make an array of them Sef spec[2] = {health,strenght}; and a class universe will contains some sef : Universe hlth(spec); You can imagine that when i have a lot of points, a lot of sef, it's a lot of dirty code... How can I improve that? to make my code better.... Thanks !!!
c++
arrays
refactoring
code-cleanup
null
04/09/2012 05:56:20
too localized
C++ : array of coordinates? === I have a problem with my code. Actually it works, but I want to clean it to make it more proper. So I have a class Coord which contains a float x and a foat y. The constructor is : void Coord::Coord (float x,float y) { this->x = x; this->y = y; } I create all the points that I need in that way : Coord pt1(0,1); Coord pt2(20,0); ... Coord pt61(12,14); .... ` After I have to make an array of some points , for exemple the fifth five points will be assignated in an array, 4 other points in an other array, 2 other points in another one... Coord pts_weakhealth[3] = {pt1,pt2,pt3}; This array, i'll have to give as arguments for the constructor of a class for exemple : Sef health(pts_weakhealth,3); Sef strenght(pts_weak,4);` I'll create some Sef in the same way and then make an array of them Sef spec[2] = {health,strenght}; and a class universe will contains some sef : Universe hlth(spec); You can imagine that when i have a lot of points, a lot of sef, it's a lot of dirty code... How can I improve that? to make my code better.... Thanks !!!
3
8,503,669
12/14/2011 11:22:58
782,411
06/03/2011 09:01:34
5
2
Rails has_and_belongs_to_many always inserts into database
Here is my problem: class Facility < ActiveRecord::Base ... has_and_belongs_to_many :languages, :autosave => false, :join_table => 'facilities_languages' ... end When I do something like this: facility = Facility.find(1) language = Language.find(1) facility.languages << language Rails always do the SQL request: "INSERT INTO `facilities_languages` (`language_id`,`facility_id`) VALUES (1, 1)" Is there a way to avoid database requests unless I call 'facility.save' ? Apparently, :autosave option here does something else.
ruby-on-rails
database
activerecord
has-and-belongs-to-many
null
null
open
Rails has_and_belongs_to_many always inserts into database === Here is my problem: class Facility < ActiveRecord::Base ... has_and_belongs_to_many :languages, :autosave => false, :join_table => 'facilities_languages' ... end When I do something like this: facility = Facility.find(1) language = Language.find(1) facility.languages << language Rails always do the SQL request: "INSERT INTO `facilities_languages` (`language_id`,`facility_id`) VALUES (1, 1)" Is there a way to avoid database requests unless I call 'facility.save' ? Apparently, :autosave option here does something else.
0
11,745,102
07/31/2012 16:47:07
1,301,703
03/29/2012 19:20:45
1
0
SIP OPTIONS in c#
I have a very specific requirement of sending sip options request to sip server from my c sharp application. I do not want to do anything else with sip. I have no problem in doing so using konnetic sip stack sdk. However, i need to do the same thing using Asterisk.net. i.e I need to send a sip options message from my application which is the client to the sip server which runs asterisk. I need to switch from konnetic because it is not free and it looked bad to spend few hundred dollars just to send a sip message and at the same time I cant implement my own sip stack. How can I make use of the Asterisk.Net to do this? Can I have a sample code? if not possible, what are the other sdk options which are free? I have also tried SIPEK, it is of no good for this purpose. Thanks!
sip
null
null
null
null
07/31/2012 19:36:09
not a real question
SIP OPTIONS in c# === I have a very specific requirement of sending sip options request to sip server from my c sharp application. I do not want to do anything else with sip. I have no problem in doing so using konnetic sip stack sdk. However, i need to do the same thing using Asterisk.net. i.e I need to send a sip options message from my application which is the client to the sip server which runs asterisk. I need to switch from konnetic because it is not free and it looked bad to spend few hundred dollars just to send a sip message and at the same time I cant implement my own sip stack. How can I make use of the Asterisk.Net to do this? Can I have a sample code? if not possible, what are the other sdk options which are free? I have also tried SIPEK, it is of no good for this purpose. Thanks!
1
8,726,718
01/04/2012 12:15:51
926,512
04/22/2011 14:59:15
1
0
Smoot scrollin in android
i m using scroller.on scroller draw bitmap that time it scrolled very slow(jerky). but when i remove bitmap then it work properly. plz hlp me how to solve this problem. Thank you, Rajesh Patil
java
android
java-ee
null
null
01/04/2012 19:35:17
not a real question
Smoot scrollin in android === i m using scroller.on scroller draw bitmap that time it scrolled very slow(jerky). but when i remove bitmap then it work properly. plz hlp me how to solve this problem. Thank you, Rajesh Patil
1
3,791,662
09/24/2010 23:11:02
457,832
09/24/2010 23:11:02
1
0
IE not implemented javascript error
I'm using some basic jQuery at http://s329880999.onlinehome.us/ and I'm getting a "not implemented" error in Internet Explorer. I'm guessing that this is to do with my using top (var s2). How can I make it work in IE?
javascript
jquery
null
null
null
null
open
IE not implemented javascript error === I'm using some basic jQuery at http://s329880999.onlinehome.us/ and I'm getting a "not implemented" error in Internet Explorer. I'm guessing that this is to do with my using top (var s2). How can I make it work in IE?
0
4,560,755
12/30/2010 07:12:21
552,521
12/23/2010 15:22:15
6
2
Eclipse web browser based plug-in
I am very new in eclipse plug-in development. I want to develop a eclipse web browser based plugin. Scenario is like - I would like to add a menu "Abhishek" and on click on that menu a .html file should open in the eclipse web browser and there will be hyperlinks and all
eclipse-plugin
null
null
null
null
07/16/2011 22:14:17
not a real question
Eclipse web browser based plug-in === I am very new in eclipse plug-in development. I want to develop a eclipse web browser based plugin. Scenario is like - I would like to add a menu "Abhishek" and on click on that menu a .html file should open in the eclipse web browser and there will be hyperlinks and all
1
8,919,170
01/18/2012 23:38:28
597,992
02/01/2011 06:45:42
1,138
20
rails 3.1: scaffold not creating CRUD actions; creates controllers with <InheritedResources::Base instead of <ApplicationController
Building a new rails 3.1 app. Started with a basic blog_entries model to get the hang of it. No surprises. Then I added ActiveAdmin, got that working okay with my existing model. But now when I try to scaffold a new model/etc with this: rails g scaffold Community name:string guid:string everything seems right (views, migration) except the controller does not have CRUD options and looks like this: class CommunitiesController < InheritedResources::Base end (checked my gem list and there is a gem called inherited_resources which must have been installed by another gem, but that is not listed in my Gemfile, but IS listed in my Gemfile.lock under activeadmin. So somehow installking activeadmin is overriding my default rails scaffold behaviour?)
ruby-on-rails
scaffolding
null
null
null
null
open
rails 3.1: scaffold not creating CRUD actions; creates controllers with <InheritedResources::Base instead of <ApplicationController === Building a new rails 3.1 app. Started with a basic blog_entries model to get the hang of it. No surprises. Then I added ActiveAdmin, got that working okay with my existing model. But now when I try to scaffold a new model/etc with this: rails g scaffold Community name:string guid:string everything seems right (views, migration) except the controller does not have CRUD options and looks like this: class CommunitiesController < InheritedResources::Base end (checked my gem list and there is a gem called inherited_resources which must have been installed by another gem, but that is not listed in my Gemfile, but IS listed in my Gemfile.lock under activeadmin. So somehow installking activeadmin is overriding my default rails scaffold behaviour?)
0
8,763,844
01/06/2012 20:11:36
847,186
07/15/2011 21:02:00
1
2
ZF2 Dependency Injection in Ancesor Objects
My goal is to use DI in ancestor objects using setters so I have a common DI for ancestor objects. e.g. an abstract model class my other models inherit from, preconfigured with an entity manager etc. So far, after configuring the ancestor and creating it with DI successfully, changing it to an abstract class, then instantiating an ancestor of that class the DI for the abstract (whether set to abstract or not) doesn't run. <code> namespace Stuki; use Doctrine\ORM\EntityManager; # abstract class Model { protected $em; public function setEm(EntityManager $em) { $this->em = $em; } } </code> The DI for this class <code> 'di' => array( 'instance' => array( 'Stuki\Model' => array( 'parameters' => array( 'em' => 'doctrine_em' ) ), </code> The above class and DI will work. But I want that to run on ancestor objects so <code> namespace Stuki\Model; use Stuki\Model as StukiModel; class Authentication extends StukiModel { public function getIdentity() { return 'ħ'; #die('get identity'); } } $auth = $e->getTarget()->getLocator()->get('Stuki\Authentication'); </code> The last line, $auth = , doesn't run the DI. How can I setup DI for ancestor objects, without using introspection?
dependencies
injection
zend-framework2
null
null
null
open
ZF2 Dependency Injection in Ancesor Objects === My goal is to use DI in ancestor objects using setters so I have a common DI for ancestor objects. e.g. an abstract model class my other models inherit from, preconfigured with an entity manager etc. So far, after configuring the ancestor and creating it with DI successfully, changing it to an abstract class, then instantiating an ancestor of that class the DI for the abstract (whether set to abstract or not) doesn't run. <code> namespace Stuki; use Doctrine\ORM\EntityManager; # abstract class Model { protected $em; public function setEm(EntityManager $em) { $this->em = $em; } } </code> The DI for this class <code> 'di' => array( 'instance' => array( 'Stuki\Model' => array( 'parameters' => array( 'em' => 'doctrine_em' ) ), </code> The above class and DI will work. But I want that to run on ancestor objects so <code> namespace Stuki\Model; use Stuki\Model as StukiModel; class Authentication extends StukiModel { public function getIdentity() { return 'ħ'; #die('get identity'); } } $auth = $e->getTarget()->getLocator()->get('Stuki\Authentication'); </code> The last line, $auth = , doesn't run the DI. How can I setup DI for ancestor objects, without using introspection?
0
2,323,612
02/24/2010 04:10:45
756,597
12/11/2009 05:30:07
29
0
jQuery image carousel - How can I repeat the images?
I've written an image slideshow in jQuery that speeds up/down based on where the mouse is hovering over the images. I'd like to have the images 'repeat' as the slideshow ends. So the user scrolls through the slideshow, it reaches the end of the image LI's and then seamlessly repeats from the start. Here's the current code: <b>jQuery</b> $(document).ready(function() { $('#products ul').css('width', ($('#products ul li').length * 185)); var $products = $('#products div'); var posLeft = 0; // Add 5 DIV overlays to use as 'hover buttons' for the slideshow speed for (i = 0; i <= 4; i++) { $('#products').append('<div class="hover-' + i + '" style="background: transparent; width: 100px; height: 167px; position: absolute; left: ' + posLeft + 'px; top: 15px;"></div>'); posLeft += 100; } // Function animate the scrolling DIV in the appropriate direction with the set speed function plz2scroll(direction, scrollSpeed) { var scrollDir = (direction == 'left') ? '-=' : '+='; var scrollOffset = (direction == 'right') ? '-10' : '+' + $products.css('width').substring(0, -2) + 10; // Fix the '+100px10' issue - Seems substring don't support negative offsets $products.animate({scrollLeft: scrollDir + $products.css('width')}, scrollSpeed, 'linear', function() { $products.scrollLeft(scrollOffset); plz2scroll(direction, scrollSpeed); }); } // Create the 'hover buttons' $('div.hover-0').hover(function() { $products.stop(); plz2scroll('right', 2000); }); $('div.hover-1').hover(function() { $products.stop(); plz2scroll('right', 3500); }); $('div.hover-2').hover(function() { $products.stop(); }); $('div.hover-3').hover(function() { $products.stop(); plz2scroll('left', 3500); }); $('div.hover-4').hover(function() { $products.stop(); plz2scroll('left', 2000); }); }); <b>HTML</b> <div id="products"> <div> <ul> <li><img src="images/1.jpg" /></li> <li><img src="images/2.jpg" /></li> <li><img src="images/3.jpg" /></li> <li><img src="images/4.jpg" /></li> <li><img src="images/5.jpg" /></li> </ul> </div> </div> The scroller works and the speed/direction works nicely with the overlayed DIV buttons. My animate() callback to repeat is slow, buggy and just bad :/ My overuse of .stop() also looks like a potential problem >.< Any ideas?
jquery
carousel
slideshow
image
null
null
open
jQuery image carousel - How can I repeat the images? === I've written an image slideshow in jQuery that speeds up/down based on where the mouse is hovering over the images. I'd like to have the images 'repeat' as the slideshow ends. So the user scrolls through the slideshow, it reaches the end of the image LI's and then seamlessly repeats from the start. Here's the current code: <b>jQuery</b> $(document).ready(function() { $('#products ul').css('width', ($('#products ul li').length * 185)); var $products = $('#products div'); var posLeft = 0; // Add 5 DIV overlays to use as 'hover buttons' for the slideshow speed for (i = 0; i <= 4; i++) { $('#products').append('<div class="hover-' + i + '" style="background: transparent; width: 100px; height: 167px; position: absolute; left: ' + posLeft + 'px; top: 15px;"></div>'); posLeft += 100; } // Function animate the scrolling DIV in the appropriate direction with the set speed function plz2scroll(direction, scrollSpeed) { var scrollDir = (direction == 'left') ? '-=' : '+='; var scrollOffset = (direction == 'right') ? '-10' : '+' + $products.css('width').substring(0, -2) + 10; // Fix the '+100px10' issue - Seems substring don't support negative offsets $products.animate({scrollLeft: scrollDir + $products.css('width')}, scrollSpeed, 'linear', function() { $products.scrollLeft(scrollOffset); plz2scroll(direction, scrollSpeed); }); } // Create the 'hover buttons' $('div.hover-0').hover(function() { $products.stop(); plz2scroll('right', 2000); }); $('div.hover-1').hover(function() { $products.stop(); plz2scroll('right', 3500); }); $('div.hover-2').hover(function() { $products.stop(); }); $('div.hover-3').hover(function() { $products.stop(); plz2scroll('left', 3500); }); $('div.hover-4').hover(function() { $products.stop(); plz2scroll('left', 2000); }); }); <b>HTML</b> <div id="products"> <div> <ul> <li><img src="images/1.jpg" /></li> <li><img src="images/2.jpg" /></li> <li><img src="images/3.jpg" /></li> <li><img src="images/4.jpg" /></li> <li><img src="images/5.jpg" /></li> </ul> </div> </div> The scroller works and the speed/direction works nicely with the overlayed DIV buttons. My animate() callback to repeat is slow, buggy and just bad :/ My overuse of .stop() also looks like a potential problem >.< Any ideas?
0
8,990,602
01/24/2012 16:42:56
737,640
05/04/2011 08:56:43
78
2
Network planing
I would like to use a satellite internet, I would like to establish the following network topology. ![enter image description here][1] I have a satellite internet, and I would like to share the internet through WiFi. I would like to use a switch which supports PoE because in this case I can supply the WiFi module through PoE. Does it enough a switch in the place of ??? or do I need a router. [1]: http://i.stack.imgur.com/IJuRF.png
networking
router
null
null
null
01/24/2012 17:11:28
off topic
Network planing === I would like to use a satellite internet, I would like to establish the following network topology. ![enter image description here][1] I have a satellite internet, and I would like to share the internet through WiFi. I would like to use a switch which supports PoE because in this case I can supply the WiFi module through PoE. Does it enough a switch in the place of ??? or do I need a router. [1]: http://i.stack.imgur.com/IJuRF.png
2
11,639,285
07/24/2012 21:04:30
1,549,879
07/24/2012 21:02:46
1
0
vba code with right style?
Option Explicit Sub Report_Click() Dim totalRow As Integer Dim range1 As range Dim range2 As range Dim i As Integer Dim j As Integer Dim foundrow As range Dim foundrowNmb As Integer Dim searchrange As range Dim searchstr As String Dim totalsearchrow As Integer Set range1 = Sheet1.range("A65536") totalRow = range1.End(xlUp).Row - 1 Set range1 = Sheet2.range("A65536") totalsearchrow = range1.End(xlUp).Row Sheet3.Cells(4, 2).Value = totalRow For i = 1 To totalRow Sheet3.Cells(5 + i, 1).Value = Replace(Sheet1.Cells(1 + i, 2).Value, "chr", "") Sheet3.Cells(5 + i, 2).Value = Sheet1.Cells(1 + i, 3).Value Sheet3.Cells(5 + i, 3).Value = Int(Sheet1.Cells(1 + i, 3).Value) + Len(Sheet1.Cells(1 + i, 8).Value) - 1 Sheet3.Cells(5 + i, 4).Value = Sheet1.Cells(1 + i, 8).Value + "/" + Sheet1.Cells(1 + i, 9).Value searchstr = Sheet1.Cells(1 + i, 4).Value foundrowNmb = 0 For j = 1 To totalsearchrow If (StrComp(Replace(Sheet2.Cells(j, 1).Value, " ", ""), searchstr, vbTextCompare) = 0) Then foundrowNmb = j End If Next j If (foundrowNmb > 0) Then If UCase(Mid(Sheet2.Cells(foundrowNmb, 5).Value, 5, 1)) = UCase("P") Then Sheet3.Cells(5 + i, 5).Value = "+" Else If UCase(Mid(Sheet2.Cells(foundrowNmb, 5).Value, 5, 1)) = UCase("M") Then Sheet3.Cells(5 + i, 5).Value = "-" Else Sheet3.Cells(5 + i, 5).Value = "NA" End If End If End If Next i End Sub
excel-vba
null
null
null
null
07/30/2012 02:45:48
not a real question
vba code with right style? === Option Explicit Sub Report_Click() Dim totalRow As Integer Dim range1 As range Dim range2 As range Dim i As Integer Dim j As Integer Dim foundrow As range Dim foundrowNmb As Integer Dim searchrange As range Dim searchstr As String Dim totalsearchrow As Integer Set range1 = Sheet1.range("A65536") totalRow = range1.End(xlUp).Row - 1 Set range1 = Sheet2.range("A65536") totalsearchrow = range1.End(xlUp).Row Sheet3.Cells(4, 2).Value = totalRow For i = 1 To totalRow Sheet3.Cells(5 + i, 1).Value = Replace(Sheet1.Cells(1 + i, 2).Value, "chr", "") Sheet3.Cells(5 + i, 2).Value = Sheet1.Cells(1 + i, 3).Value Sheet3.Cells(5 + i, 3).Value = Int(Sheet1.Cells(1 + i, 3).Value) + Len(Sheet1.Cells(1 + i, 8).Value) - 1 Sheet3.Cells(5 + i, 4).Value = Sheet1.Cells(1 + i, 8).Value + "/" + Sheet1.Cells(1 + i, 9).Value searchstr = Sheet1.Cells(1 + i, 4).Value foundrowNmb = 0 For j = 1 To totalsearchrow If (StrComp(Replace(Sheet2.Cells(j, 1).Value, " ", ""), searchstr, vbTextCompare) = 0) Then foundrowNmb = j End If Next j If (foundrowNmb > 0) Then If UCase(Mid(Sheet2.Cells(foundrowNmb, 5).Value, 5, 1)) = UCase("P") Then Sheet3.Cells(5 + i, 5).Value = "+" Else If UCase(Mid(Sheet2.Cells(foundrowNmb, 5).Value, 5, 1)) = UCase("M") Then Sheet3.Cells(5 + i, 5).Value = "-" Else Sheet3.Cells(5 + i, 5).Value = "NA" End If End If End If Next i End Sub
1
7,760,386
10/13/2011 21:02:00
856,307
07/21/2011 15:33:15
16
1
RedLaser Android Unstability
Has anyone observed that the Android RedLaser Scanner is unstable to some extent? When I say unstable I mean, that invoking or returning (using the back button for example) from a RedLaser Scan Activity forces the previous activity to bounce and then appear. The transition, in general, between the Scan Activity and other activites (custom) is not smooth. Would this be attributed to the way the scanner was implemented?
android
activity
barcode-scanner
null
null
10/17/2011 07:17:12
off topic
RedLaser Android Unstability === Has anyone observed that the Android RedLaser Scanner is unstable to some extent? When I say unstable I mean, that invoking or returning (using the back button for example) from a RedLaser Scan Activity forces the previous activity to bounce and then appear. The transition, in general, between the Scan Activity and other activites (custom) is not smooth. Would this be attributed to the way the scanner was implemented?
2
9,344,601
02/18/2012 22:09:30
854,317
07/20/2011 15:57:07
70
4
A simple Explanation of β-reduction
I'm trying to implement lambda calculus in something and i need to implement β-reduction, i cant ask for help with that or show it since its coursework. But it seems Ive made a huge mistake in what it actually is, can anyone please explain to me how β-reduction works in simple terms (not a maths student)?
homework
lambda-calculus
null
null
null
null
open
A simple Explanation of β-reduction === I'm trying to implement lambda calculus in something and i need to implement β-reduction, i cant ask for help with that or show it since its coursework. But it seems Ive made a huge mistake in what it actually is, can anyone please explain to me how β-reduction works in simple terms (not a maths student)?
0
11,181,469
06/24/2012 21:48:42
538,570
12/11/2010 02:01:40
288
7
Is it ok if the main CSS code is generated client-side?
I have a build process that compiles LESS code into CSS, which will then be injected into a JavaScript string litteral, and concatenated with the main minified .js code. And that main code will then inject the CSS string onto the page. One advantage to this is it will require just a single HTTP request to get the styles and scripts up and running. However, are there any caveats to doing it this way?
javascript
css
performance
client-side
null
06/25/2012 22:13:42
not constructive
Is it ok if the main CSS code is generated client-side? === I have a build process that compiles LESS code into CSS, which will then be injected into a JavaScript string litteral, and concatenated with the main minified .js code. And that main code will then inject the CSS string onto the page. One advantage to this is it will require just a single HTTP request to get the styles and scripts up and running. However, are there any caveats to doing it this way?
4
10,960,636
06/09/2012 11:32:17
1,446,121
06/09/2012 11:23:08
1
0
ARM Issues and problems
I have developed a streaming client in C. The software is working well over desktop Linux environment but when it comes to the embedded target, it isn't able to stream properly. The stream obtained appears to be corrupted. The target seems to be sufficient enough to capture the streams. The embedded target belongs to the ARM family 1GHz processor What can be the problems behind this? How can I solve this problem? Thanks.
streaming
client
arm
null
null
06/10/2012 04:36:33
not a real question
ARM Issues and problems === I have developed a streaming client in C. The software is working well over desktop Linux environment but when it comes to the embedded target, it isn't able to stream properly. The stream obtained appears to be corrupted. The target seems to be sufficient enough to capture the streams. The embedded target belongs to the ARM family 1GHz processor What can be the problems behind this? How can I solve this problem? Thanks.
1
8,119,569
11/14/2011 09:33:53
806,379
06/20/2011 09:32:16
81
4
MV3 Duplicate Query String Values for CheckBox (true,false for boolean)
I've created a fairly straight forward page with a check box: @using (Html.BeginForm("MyController", "MyAction", FormMethod.Get)) { @Html.CheckBoxFor(x => x.MyCheckBox) <input type="submit" value="Go!" /> } The URL is populated with the MyCheckBox value twice!? As such: MyAction?MyCheckBox=true&MyCheckBox=false It only duplicates the value if the check box is true. If set to false it will only appear once in the query string. The code above is simplified as I have a couple of drop downs and a textbox on the form which work fine. I don't think there's anything unusual about the code which I've left out from this question. Has anyone had a similar issue with query string parameters being duplicated?
asp.net-mvc-3
razor
query-string
null
null
null
open
MV3 Duplicate Query String Values for CheckBox (true,false for boolean) === I've created a fairly straight forward page with a check box: @using (Html.BeginForm("MyController", "MyAction", FormMethod.Get)) { @Html.CheckBoxFor(x => x.MyCheckBox) <input type="submit" value="Go!" /> } The URL is populated with the MyCheckBox value twice!? As such: MyAction?MyCheckBox=true&MyCheckBox=false It only duplicates the value if the check box is true. If set to false it will only appear once in the query string. The code above is simplified as I have a couple of drop downs and a textbox on the form which work fine. I don't think there's anything unusual about the code which I've left out from this question. Has anyone had a similar issue with query string parameters being duplicated?
0
6,776,806
07/21/2011 13:27:49
430,112
08/24/2010 23:02:12
1,093
102
Print invoice pdf of pending orders in magento
I want to print Invoice of both pending and complete status orders in pdf.But right now it prints only complete status orders invoice only. How can i change it. Any help would be appreciated. Thanks
magento
null
null
null
null
null
open
Print invoice pdf of pending orders in magento === I want to print Invoice of both pending and complete status orders in pdf.But right now it prints only complete status orders invoice only. How can i change it. Any help would be appreciated. Thanks
0
895,596
05/21/2009 22:32:35
19,074
09/19/2008 16:57:20
2,002
82
Can anyone recomend a Python PDF generator with OpenType support?
After asking [this question][1] back in November, I've been very happy with ReportLab for all of my python pdf-generation needs. However, it turns out that while ReportLab will use regular TrueType (TTF) fonts, it does not support OpenType (OTF) fonts. One of the current widgets I'm working on is going to need to use some OpenType fonts, and so sadly, ReportLab just removed itself from the running. Can anyone recommend an OpenType-compatible PDF generator for Python? It doesn't need to be fancy - I just need to be able to drop UTF-8 text onto a page. [1]: http://stackoverflow.com/questions/279129/can-anyone-recommend-a-decent-foss-pdf-generator-for-python
python
pdf-generation
opentype
null
null
06/08/2012 15:08:04
not constructive
Can anyone recomend a Python PDF generator with OpenType support? === After asking [this question][1] back in November, I've been very happy with ReportLab for all of my python pdf-generation needs. However, it turns out that while ReportLab will use regular TrueType (TTF) fonts, it does not support OpenType (OTF) fonts. One of the current widgets I'm working on is going to need to use some OpenType fonts, and so sadly, ReportLab just removed itself from the running. Can anyone recommend an OpenType-compatible PDF generator for Python? It doesn't need to be fancy - I just need to be able to drop UTF-8 text onto a page. [1]: http://stackoverflow.com/questions/279129/can-anyone-recommend-a-decent-foss-pdf-generator-for-python
4
11,570,368
07/19/2012 22:40:37
1,480,899
06/25/2012 19:26:46
58
1
Access 2010 Query results with image next to it
I have a query that returns a list of items. What I would like is to be able to display this on a form with an image (green/red circle) to indicate if the item is working or not. I'm not sure this is possible but if it is I would appreciate a pointer. Example of form: (Green) Truck1 (Green) Truck2 (Red) Truck3 (Red) Car1 (Green) Car2
image
query
ms-access-2010
null
null
null
open
Access 2010 Query results with image next to it === I have a query that returns a list of items. What I would like is to be able to display this on a form with an image (green/red circle) to indicate if the item is working or not. I'm not sure this is possible but if it is I would appreciate a pointer. Example of form: (Green) Truck1 (Green) Truck2 (Red) Truck3 (Red) Car1 (Green) Car2
0
8,736,516
01/05/2012 01:30:40
1,088,649
12/08/2011 21:55:05
3
1
how to echo all products in shopping cart to paypal
I am just learning the ropes of php and am building an e-commerce site for a uni project, I have the whole thing built and setup payment via paypal, which I've done through a few tutorials. When I am transferring to paypal I want to display; the item name, price and quantity for each item in the cart, within the order summary. In its current state http://pastie.org/3127790 , the code is only displaying the top item in the cart in the order summary on paypal, I think I need to implement a foreach loop to tell the code to echo all rows in the cart, but am unsure what exactly to loop and how. Any help would be greatly appreciated! Thanks in advance, Michael
php
mysql
foreach
paypal
shopping-cart
null
open
how to echo all products in shopping cart to paypal === I am just learning the ropes of php and am building an e-commerce site for a uni project, I have the whole thing built and setup payment via paypal, which I've done through a few tutorials. When I am transferring to paypal I want to display; the item name, price and quantity for each item in the cart, within the order summary. In its current state http://pastie.org/3127790 , the code is only displaying the top item in the cart in the order summary on paypal, I think I need to implement a foreach loop to tell the code to echo all rows in the cart, but am unsure what exactly to loop and how. Any help would be greatly appreciated! Thanks in advance, Michael
0
11,740,269
07/31/2012 12:39:29
1,250,101
03/05/2012 14:53:39
1
0
Need help to construct a cryptographic line-finder script in Flash AS3
In many old publications from the middle ages and up, the printers included cryptograms in form of lines between letters of certain types to form geometry. The script I ask for would help significantly for historians to find these lines and solve cryptograms. Please help to write this script if you can and have the time. All is explained on the below page, with suggestions for code layout. Thank you.... [Cryptographic line-finder script description][1] [1]: https://docs.google.com/document/d/1soV-mCpUIz9Vsp4nY9UhDowH0tuUGqkk3B2VZuPV_9E/edit
actionscript-3
flash
graphics
script
cryptography
08/01/2012 12:30:24
not constructive
Need help to construct a cryptographic line-finder script in Flash AS3 === In many old publications from the middle ages and up, the printers included cryptograms in form of lines between letters of certain types to form geometry. The script I ask for would help significantly for historians to find these lines and solve cryptograms. Please help to write this script if you can and have the time. All is explained on the below page, with suggestions for code layout. Thank you.... [Cryptographic line-finder script description][1] [1]: https://docs.google.com/document/d/1soV-mCpUIz9Vsp4nY9UhDowH0tuUGqkk3B2VZuPV_9E/edit
4
1,109,768
07/10/2009 14:09:30
5,777
09/11/2008 11:10:19
380
8
How to use output caching on .ashx handler
How can I use output caching with a .ashx handler? In this case I'm doing some heavy image processing and would like the handler to be cached for a minute or so. Also, does anyone have any recommendations on how to prevent dogpiling?
asp.net
caching
ashx
null
null
null
open
How to use output caching on .ashx handler === How can I use output caching with a .ashx handler? In this case I'm doing some heavy image processing and would like the handler to be cached for a minute or so. Also, does anyone have any recommendations on how to prevent dogpiling?
0
6,403,450
06/19/2011 15:53:12
182,808
10/01/2009 23:09:37
330
1
SELECTing non-indexed column increases 'sending data' 25x - why and how to improve?
Given this table on *local* MySQL instance 5.1 with query caching off: show create table product_views\G *************************** 1. row *************************** Table: product_views Create Table: CREATE TABLE `product_views` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `dateCreated` datetime NOT NULL, `dateModified` datetime DEFAULT NULL, `hibernateVersion` bigint(20) DEFAULT NULL, `brandName` varchar(255) DEFAULT NULL, `mfrModel` varchar(255) DEFAULT NULL, `origin` varchar(255) NOT NULL, `price` float DEFAULT NULL, `productType` varchar(255) DEFAULT NULL, `rebateDetailsViewed` tinyint(1) NOT NULL, `rebateSearchZipCode` int(11) DEFAULT NULL, `rebatesFoundAmount` float DEFAULT NULL, `rebatesFoundCount` int(11) DEFAULT NULL, `siteSKU` varchar(255) DEFAULT NULL, `timestamp` datetime NOT NULL, `uiContext` varchar(255) DEFAULT NULL, `siteVisitId` bigint(20) NOT NULL, `efficiencyLevel` varchar(255) DEFAULT NULL, `siteName` varchar(255) DEFAULT NULL, `clicks` varchar(1024) DEFAULT NULL, `rebateFormDownloaded` tinyint(1) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `siteVisitId` (`siteVisitId`,`siteSKU`), KEY `FK52C29B1E3CAB9CC4` (`siteVisitId`), KEY `rebateSearchZipCode_idx` (`rebateSearchZipCode`), KEY `FIND_UNPROCESSED_IDX` (`siteSKU`,`siteVisitId`,`timestamp`), CONSTRAINT `FK52C29B1E3CAB9CC4` FOREIGN KEY (`siteVisitId`) REFERENCES `site_visits` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=32909504 DEFAULT CHARSET=latin1 1 row in set (0.00 sec) This query takes ~3s: select pv.id, pv.siteSKU from product_views pv cross join site_visits sv where pv.siteVisitId=sv.id and pv.siteSKU='foo' and sv.siteId='bar' an d sv.postProcessed=1 and pv.timestamp>='2011-05-19 00:00:00' and pv.timestamp<'2011-06-18 00:00:00'; But this one (non-indexed column added to SELECT) takes ~65s: select pv.id, pv.siteSKU, pv.hibernateVersion from product_views pv cross join site_visits sv where pv.siteVisitId=sv.id and pv.siteSKU='foo' and sv.siteId='bar' an d sv.postProcessed=1 and pv.timestamp>='2011-05-19 00:00:00' and pv.timestamp<'2011-06-18 00:00:00'; Nothing in 'where' or 'from' clauses is different. All the extra time is spent in 'sending data': mysql> show profile for query 1; +--------------------+-----------+ | Status | Duration | +--------------------+-----------+ | starting | 0.000155 | | Opening tables | 0.000029 | | System lock | 0.000007 | | Table lock | 0.000019 | | init | 0.000072 | | optimizing | 0.000032 | | statistics | 0.000316 | | preparing | 0.000034 | | executing | 0.000002 | | Sending data | 63.530402 | | end | 0.000044 | | query end | 0.000005 | | freeing items | 0.000091 | | logging slow query | 0.000002 | | logging slow query | 0.000109 | | cleaning up | 0.000004 | +--------------------+-----------+ 16 rows in set (0.00 sec) **I understand that using a non-indexed column in where clause would slow things down, but why here? What can be done to improve the latter case - given that I will actually want to SELECT(*) from product_views?**
mysql
query
null
null
null
null
open
SELECTing non-indexed column increases 'sending data' 25x - why and how to improve? === Given this table on *local* MySQL instance 5.1 with query caching off: show create table product_views\G *************************** 1. row *************************** Table: product_views Create Table: CREATE TABLE `product_views` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `dateCreated` datetime NOT NULL, `dateModified` datetime DEFAULT NULL, `hibernateVersion` bigint(20) DEFAULT NULL, `brandName` varchar(255) DEFAULT NULL, `mfrModel` varchar(255) DEFAULT NULL, `origin` varchar(255) NOT NULL, `price` float DEFAULT NULL, `productType` varchar(255) DEFAULT NULL, `rebateDetailsViewed` tinyint(1) NOT NULL, `rebateSearchZipCode` int(11) DEFAULT NULL, `rebatesFoundAmount` float DEFAULT NULL, `rebatesFoundCount` int(11) DEFAULT NULL, `siteSKU` varchar(255) DEFAULT NULL, `timestamp` datetime NOT NULL, `uiContext` varchar(255) DEFAULT NULL, `siteVisitId` bigint(20) NOT NULL, `efficiencyLevel` varchar(255) DEFAULT NULL, `siteName` varchar(255) DEFAULT NULL, `clicks` varchar(1024) DEFAULT NULL, `rebateFormDownloaded` tinyint(1) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `siteVisitId` (`siteVisitId`,`siteSKU`), KEY `FK52C29B1E3CAB9CC4` (`siteVisitId`), KEY `rebateSearchZipCode_idx` (`rebateSearchZipCode`), KEY `FIND_UNPROCESSED_IDX` (`siteSKU`,`siteVisitId`,`timestamp`), CONSTRAINT `FK52C29B1E3CAB9CC4` FOREIGN KEY (`siteVisitId`) REFERENCES `site_visits` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=32909504 DEFAULT CHARSET=latin1 1 row in set (0.00 sec) This query takes ~3s: select pv.id, pv.siteSKU from product_views pv cross join site_visits sv where pv.siteVisitId=sv.id and pv.siteSKU='foo' and sv.siteId='bar' an d sv.postProcessed=1 and pv.timestamp>='2011-05-19 00:00:00' and pv.timestamp<'2011-06-18 00:00:00'; But this one (non-indexed column added to SELECT) takes ~65s: select pv.id, pv.siteSKU, pv.hibernateVersion from product_views pv cross join site_visits sv where pv.siteVisitId=sv.id and pv.siteSKU='foo' and sv.siteId='bar' an d sv.postProcessed=1 and pv.timestamp>='2011-05-19 00:00:00' and pv.timestamp<'2011-06-18 00:00:00'; Nothing in 'where' or 'from' clauses is different. All the extra time is spent in 'sending data': mysql> show profile for query 1; +--------------------+-----------+ | Status | Duration | +--------------------+-----------+ | starting | 0.000155 | | Opening tables | 0.000029 | | System lock | 0.000007 | | Table lock | 0.000019 | | init | 0.000072 | | optimizing | 0.000032 | | statistics | 0.000316 | | preparing | 0.000034 | | executing | 0.000002 | | Sending data | 63.530402 | | end | 0.000044 | | query end | 0.000005 | | freeing items | 0.000091 | | logging slow query | 0.000002 | | logging slow query | 0.000109 | | cleaning up | 0.000004 | +--------------------+-----------+ 16 rows in set (0.00 sec) **I understand that using a non-indexed column in where clause would slow things down, but why here? What can be done to improve the latter case - given that I will actually want to SELECT(*) from product_views?**
0
828,582
05/06/2009 08:26:14
82,004
03/24/2009 13:09:43
392
28
SQL: To primary key or not to primary key?
I have a table with user sets of settings for users, it has the following columns: UserID INT Set VARCHAR(50) Key VARCHAR(50) Value NVARCHAR(MAX) TimeStamp DATETIME UserID together with Set and Key are unique. So a specific user cannot have two of the same keys in a particular set of settings. The settings are retrieved by set, so if a user requests a certain key from a certain set, the whole set is downloaded, so that the next time a key from the same set is needed, it doesn't have to go to the database. Should I create a primary key on all three columns (userid, set, and key) or should I create an extra field that has a primary key (for example an autoincrement integer called SettingID, bad idea i guess), or not create a primary key, and just create a unique index?
sql
primary-key
indexing
null
null
null
open
SQL: To primary key or not to primary key? === I have a table with user sets of settings for users, it has the following columns: UserID INT Set VARCHAR(50) Key VARCHAR(50) Value NVARCHAR(MAX) TimeStamp DATETIME UserID together with Set and Key are unique. So a specific user cannot have two of the same keys in a particular set of settings. The settings are retrieved by set, so if a user requests a certain key from a certain set, the whole set is downloaded, so that the next time a key from the same set is needed, it doesn't have to go to the database. Should I create a primary key on all three columns (userid, set, and key) or should I create an extra field that has a primary key (for example an autoincrement integer called SettingID, bad idea i guess), or not create a primary key, and just create a unique index?
0
9,610,394
03/07/2012 22:55:06
1,255,865
03/07/2012 22:45:45
1
0
Building basic website with HTML, CSS, JavaScript
I am an experienced programmer, who has never done any web or graphic design. I want to build a website that display my personal profile. Furthermore, I want my website to act like a Dropbox website, that allow me to access my files after logging in. I know basic syntax of HTML,CSS and JavaScript but I do not know how to combine them together. My initial design look pretty ugly... Please give me some suggestion about where should I start and what technology will satisfy the wanted features for my website?
javascript
html
css
null
null
03/08/2012 08:02:11
not constructive
Building basic website with HTML, CSS, JavaScript === I am an experienced programmer, who has never done any web or graphic design. I want to build a website that display my personal profile. Furthermore, I want my website to act like a Dropbox website, that allow me to access my files after logging in. I know basic syntax of HTML,CSS and JavaScript but I do not know how to combine them together. My initial design look pretty ugly... Please give me some suggestion about where should I start and what technology will satisfy the wanted features for my website?
4
8,436,916
12/08/2011 20:02:27
630,973
02/23/2011 19:40:35
97
7
Advanced RegEx - grouping a string
Can't seem to figure out an expression which handles this line of text: 'SOME_TEXT','EVEN_MORE_TEXT','EXPRESSION IS IN (''YES'',''NO'')' To this groupings SOME_TEXT EVEN_MORE_TEXT EXPRESSION IS IN ('YES', 'NO') ....I'd rather have a nifty regex than solving this by string functions like indexOf(), etc..
regex
null
null
null
null
null
open
Advanced RegEx - grouping a string === Can't seem to figure out an expression which handles this line of text: 'SOME_TEXT','EVEN_MORE_TEXT','EXPRESSION IS IN (''YES'',''NO'')' To this groupings SOME_TEXT EVEN_MORE_TEXT EXPRESSION IS IN ('YES', 'NO') ....I'd rather have a nifty regex than solving this by string functions like indexOf(), etc..
0
10,492,559
05/08/2012 04:29:33
1,381,153
05/08/2012 04:13:50
1
0
I want to run google calendar Project on android emulator from google website. But it doesn't work
05-08 11:04:12.336: E/AndroidRuntime(678): FATAL EXCEPTION: main 05-08 11:04:12.336: E/AndroidRuntime(678): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android/com.android.Calendar_googleActivity}: android.os.NetworkOnMainThreadException 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.access$600(ActivityThread.java:123) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.os.Handler.dispatchMessage(Handler.java:99) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.os.Looper.loop(Looper.java:137) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.main(ActivityThread.java:4424) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.lang.reflect.Method.invokeNative(Native Method) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.lang.reflect.Method.invoke(Method.java:511) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 05-08 11:04:12.336: E/AndroidRuntime(678): at dalvik.system.NativeStart.main(Native Method) 05-08 11:04:12.336: E/AndroidRuntime(678): Caused by: android.os.NetworkOnMainThreadException 05-08 11:04:12.336: E/AndroidRuntime(678): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.net.InetAddress.lookupHostByName(InetAddress.java:391) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.net.InetAddress.getAllByName(InetAddress.java:220) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:71) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:460) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:432) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:164) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:88) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:814) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.googleapis.json.GoogleJsonResponseException.execute(GoogleJsonResponseException.java:182) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.googleapis.services.GoogleClient.executeUnparsed(GoogleClient.java:115) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.http.json.JsonHttpRequest.executeUnparsed(JsonHttpRequest.java:112) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.services.calendar.Calendar$CalendarList$List.execute(Calendar.java:510) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.Calendar_googleActivity.onAuthToken(Calendar_googleActivity.java:267) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.Calendar_googleActivity.gotAccount(Calendar_googleActivity.java:118) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.Calendar_googleActivity.onCreate(Calendar_googleActivity.java:108) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.Activity.performCreate(Activity.java:4465) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 05-08 11:04:12.336: E/AndroidRuntime(678): ... 11 more
android
google
calendar
project
emulator
05/08/2012 05:04:28
not a real question
I want to run google calendar Project on android emulator from google website. But it doesn't work === 05-08 11:04:12.336: E/AndroidRuntime(678): FATAL EXCEPTION: main 05-08 11:04:12.336: E/AndroidRuntime(678): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android/com.android.Calendar_googleActivity}: android.os.NetworkOnMainThreadException 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.access$600(ActivityThread.java:123) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.os.Handler.dispatchMessage(Handler.java:99) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.os.Looper.loop(Looper.java:137) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.main(ActivityThread.java:4424) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.lang.reflect.Method.invokeNative(Native Method) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.lang.reflect.Method.invoke(Method.java:511) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 05-08 11:04:12.336: E/AndroidRuntime(678): at dalvik.system.NativeStart.main(Native Method) 05-08 11:04:12.336: E/AndroidRuntime(678): Caused by: android.os.NetworkOnMainThreadException 05-08 11:04:12.336: E/AndroidRuntime(678): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.net.InetAddress.lookupHostByName(InetAddress.java:391) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242) 05-08 11:04:12.336: E/AndroidRuntime(678): at java.net.InetAddress.getAllByName(InetAddress.java:220) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:71) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:460) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:432) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80) 05-08 11:04:12.336: E/AndroidRuntime(678): at libcore.net.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:164) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:88) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:814) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.googleapis.json.GoogleJsonResponseException.execute(GoogleJsonResponseException.java:182) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.googleapis.services.GoogleClient.executeUnparsed(GoogleClient.java:115) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.client.http.json.JsonHttpRequest.executeUnparsed(JsonHttpRequest.java:112) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.google.api.services.calendar.Calendar$CalendarList$List.execute(Calendar.java:510) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.Calendar_googleActivity.onAuthToken(Calendar_googleActivity.java:267) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.Calendar_googleActivity.gotAccount(Calendar_googleActivity.java:118) 05-08 11:04:12.336: E/AndroidRuntime(678): at com.android.Calendar_googleActivity.onCreate(Calendar_googleActivity.java:108) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.Activity.performCreate(Activity.java:4465) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 05-08 11:04:12.336: E/AndroidRuntime(678): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 05-08 11:04:12.336: E/AndroidRuntime(678): ... 11 more
1
10,072,850
04/09/2012 11:58:30
1,097,717
12/14/2011 11:52:52
128
1
Internet Explorer 9/JavaScript: Disable confirm alert/pop-up for ActiveX
![I do not want this to appear each time][1] [1]: http://i.stack.imgur.com/K81Wz.png I have already enabled scripts from Tools->Security->Custom... ...Please help migrate to proper forum/sub-site if not relevant here.
javascript
script
activex
internet-explorer-9
settings
04/09/2012 23:46:14
off topic
Internet Explorer 9/JavaScript: Disable confirm alert/pop-up for ActiveX === ![I do not want this to appear each time][1] [1]: http://i.stack.imgur.com/K81Wz.png I have already enabled scripts from Tools->Security->Custom... ...Please help migrate to proper forum/sub-site if not relevant here.
2
9,256,045
02/13/2012 05:37:02
1,206,106
02/13/2012 05:35:20
1
0
Dividing post by Date and seperator in wordpress
I have a site http://designingway.com/fun_deals in this what I want that post should appear by date, for example right now on front page, there are some deals from today, and one from last week, if they were seperated by a divider with the date somehow that would be awesome. Kindly see the example what I am looking http://www.creativedesignperth.com/example.jpg Thanks Ranbir
wordpress
posts
null
null
null
02/14/2012 08:48:33
not a real question
Dividing post by Date and seperator in wordpress === I have a site http://designingway.com/fun_deals in this what I want that post should appear by date, for example right now on front page, there are some deals from today, and one from last week, if they were seperated by a divider with the date somehow that would be awesome. Kindly see the example what I am looking http://www.creativedesignperth.com/example.jpg Thanks Ranbir
1
9,558,091
03/04/2012 19:28:26
436,524
09/01/2010 01:42:56
30
1
How to make a slider using LWJGL?
I have searched but not found any useful tutorials. Does anyone know how?
lwjgl
null
null
null
null
null
open
How to make a slider using LWJGL? === I have searched but not found any useful tutorials. Does anyone know how?
0
11,416,408
07/10/2012 15:11:39
1,125,972
01/02/2012 09:17:09
113
3
Callbacks cases in java
What are the callbacks and which cases do exist? There are different cases of callbacks but i cant find them anywhere. Whats the event of each callback. Anyone who can provide some examples pointing out the part of code that gives birth to the event(if it exists) and the code part that handles the event. Thanks in advance!
java
callback
null
null
null
07/10/2012 15:17:07
not a real question
Callbacks cases in java === What are the callbacks and which cases do exist? There are different cases of callbacks but i cant find them anywhere. Whats the event of each callback. Anyone who can provide some examples pointing out the part of code that gives birth to the event(if it exists) and the code part that handles the event. Thanks in advance!
1
52,168
09/09/2008 15:32:18
2,991
08/26/2008 10:42:06
1
1
Operating system features
Let's say, in a perfect world where everything is possible. What features would you like to have in your operating system, IDE, Compiler or computer in general. of course everybody wants reduced boot times and super faaaaaast processors, anything else? I personally really would like to have human language recognition. the question may sound a bit silly, but if you don't have a long distance goal you also don't know where to go now.
operating-system
features
future
null
null
05/05/2012 13:29:31
not constructive
Operating system features === Let's say, in a perfect world where everything is possible. What features would you like to have in your operating system, IDE, Compiler or computer in general. of course everybody wants reduced boot times and super faaaaaast processors, anything else? I personally really would like to have human language recognition. the question may sound a bit silly, but if you don't have a long distance goal you also don't know where to go now.
4
3,809,732
09/28/2010 04:42:40
447,097
09/14/2010 08:02:46
1
0
SR Flip Flop and D Flip Flop
I know this isn't really a programming question, but it is definitely computer related and someone might know this. How do you construct a SR flip-flop with a D flip-flop and other logic gates? I understand that ultimately, what you want is logic gates (with S and R as inputs) connecting in to the D input of the D flip-flop, but I am not quite sure how to figure out which logic gates. Thanks!
design
logic
flip-flop
null
null
03/11/2012 14:51:24
off topic
SR Flip Flop and D Flip Flop === I know this isn't really a programming question, but it is definitely computer related and someone might know this. How do you construct a SR flip-flop with a D flip-flop and other logic gates? I understand that ultimately, what you want is logic gates (with S and R as inputs) connecting in to the D input of the D flip-flop, but I am not quite sure how to figure out which logic gates. Thanks!
2
10,795,388
05/29/2012 08:13:48
1,423,168
05/29/2012 08:06:18
1
0
Android MediaPlayer error: MediaPlayer error(1, -2147483648) on Stream from internet
i'm trying to stream audio from a URL, the code works fine with other URL's but, in one of those fails in OnPrepared method returning me this error codes: 1, -2147483648, I've read some people saying it's because permissions but, it's a remote file, so I can't set permissions, I've tried the URL with another apps like VLC and iTunes and it's working fine, my code is here, thanks!: private void prepareradio() { player = new MediaPlayer(); player.setAudioStreamType(MODE_WORLD_READABLE); try { player.setDataSource(url); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } player.setOnErrorListener(new OnErrorListener(){ public boolean onError(MediaPlayer arg0, int arg1, int arg2) { Toast.makeText(getApplicationContext(),"An error happened while preparing radio",Toast.LENGTH_LONG).show(); prepareradio(); playe.setEnabled(true); hidenot(); return false; } });
android
stream
mp3
mediaplayer
null
null
open
Android MediaPlayer error: MediaPlayer error(1, -2147483648) on Stream from internet === i'm trying to stream audio from a URL, the code works fine with other URL's but, in one of those fails in OnPrepared method returning me this error codes: 1, -2147483648, I've read some people saying it's because permissions but, it's a remote file, so I can't set permissions, I've tried the URL with another apps like VLC and iTunes and it's working fine, my code is here, thanks!: private void prepareradio() { player = new MediaPlayer(); player.setAudioStreamType(MODE_WORLD_READABLE); try { player.setDataSource(url); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } player.setOnErrorListener(new OnErrorListener(){ public boolean onError(MediaPlayer arg0, int arg1, int arg2) { Toast.makeText(getApplicationContext(),"An error happened while preparing radio",Toast.LENGTH_LONG).show(); prepareradio(); playe.setEnabled(true); hidenot(); return false; } });
0
8,634,704
12/26/2011 10:04:13
118,500
06/06/2009 11:05:38
4,658
463
XSLT: Control call-templaterecursion depending upon recursion result
I have an XSLT with recursion and I call the recursion within a for-each loop <xsl:for-each select="$ChildList"> <!-- Get the new elNodeList here and recurse --> <xsl:variable name="inp" select="current()"></xsl:variable> <xsl:variable name="NewNode" select="/node()/pro:simple_instance[pro:name=$inp]"></xsl:variable> <xsl:variable name="uniqueNode" select="$NewNode/pro:name except ($BeatenPath)"></xsl:variable> <xsl:if test="count($uniqueNode) > 0"> <xsl:call-template name="Recurse2Find"> <xsl:with-param name="AppNode" select="$AppNode"></xsl:with-param> <xsl:with-param name="elNode" select="$NewNode"></xsl:with-param> <xsl:with-param name="thisProduct" select="$thisProduct"></xsl:with-param> <xsl:with-param name="BeatenPath" select="$BeatenPath|$NewNode/pro:name"></xsl:with-param> <xsl:with-param name="rev" select="$rev+1"></xsl:with-param> <xsl:with-param name="Found" select="0"></xsl:with-param> </xsl:call-template> </xsl:if> </xsl:for-each> I am basically searching for something in a graph and I go down one level of the graph in each recursion while I follow different legs of the graph in each iteration in the `for-each` loop. If I find the item I am searchin for in any of the leg, I wish to stop searching further for that root. I can return a value from the call-template, but do not know how to implement it and put it as a parameter further. The parameter `Found` in the template will play otherwise. If I can update the value of the parameter from the earlier recursion, it will help me. But how can I do it?
xml
xslt
xpath
xslt-2.0
essential-viewer
null
open
XSLT: Control call-templaterecursion depending upon recursion result === I have an XSLT with recursion and I call the recursion within a for-each loop <xsl:for-each select="$ChildList"> <!-- Get the new elNodeList here and recurse --> <xsl:variable name="inp" select="current()"></xsl:variable> <xsl:variable name="NewNode" select="/node()/pro:simple_instance[pro:name=$inp]"></xsl:variable> <xsl:variable name="uniqueNode" select="$NewNode/pro:name except ($BeatenPath)"></xsl:variable> <xsl:if test="count($uniqueNode) > 0"> <xsl:call-template name="Recurse2Find"> <xsl:with-param name="AppNode" select="$AppNode"></xsl:with-param> <xsl:with-param name="elNode" select="$NewNode"></xsl:with-param> <xsl:with-param name="thisProduct" select="$thisProduct"></xsl:with-param> <xsl:with-param name="BeatenPath" select="$BeatenPath|$NewNode/pro:name"></xsl:with-param> <xsl:with-param name="rev" select="$rev+1"></xsl:with-param> <xsl:with-param name="Found" select="0"></xsl:with-param> </xsl:call-template> </xsl:if> </xsl:for-each> I am basically searching for something in a graph and I go down one level of the graph in each recursion while I follow different legs of the graph in each iteration in the `for-each` loop. If I find the item I am searchin for in any of the leg, I wish to stop searching further for that root. I can return a value from the call-template, but do not know how to implement it and put it as a parameter further. The parameter `Found` in the template will play otherwise. If I can update the value of the parameter from the earlier recursion, it will help me. But how can I do it?
0
6,753
08/09/2008 12:57:29
13
08/01/2008 04:18:04
794
34
Any IcedTea war stories?
Okay, my first serious question. :-D I'm playing around with [OpenJDK](http://openjdk.java.net/) (7, not 6), and am about to start trying to build [IcedTea](http://icedtea.classpath.org/) on my Ubuntu system. I'm keen to hear from those who have played with IcedTea and have stories (successes, pitfalls, etc.) to tell. All stories welcome, whatever distribution you use. Chances are, I'll very soon have my own stories to add to the list…. :-)
linux
openjdk
icedtea
null
null
05/18/2012 11:11:49
not constructive
Any IcedTea war stories? === Okay, my first serious question. :-D I'm playing around with [OpenJDK](http://openjdk.java.net/) (7, not 6), and am about to start trying to build [IcedTea](http://icedtea.classpath.org/) on my Ubuntu system. I'm keen to hear from those who have played with IcedTea and have stories (successes, pitfalls, etc.) to tell. All stories welcome, whatever distribution you use. Chances are, I'll very soon have my own stories to add to the list…. :-)
4
4,201,285
11/17/2010 03:44:52
5,728
09/11/2008 05:20:15
13,899
714
What's the difference between GetService and GetInstance in CSL
I'm coding against Common Service Locator and I'm having trouble figuring out the semantic differences between GetInstance, GetAllInstances, and GetService (GetAllInstances is pretty obvious, but both GetInstance and GetService seem to return an object). For example, what are the MEF equivalents of these three methods?
untagged
null
null
null
null
null
open
What's the difference between GetService and GetInstance in CSL === I'm coding against Common Service Locator and I'm having trouble figuring out the semantic differences between GetInstance, GetAllInstances, and GetService (GetAllInstances is pretty obvious, but both GetInstance and GetService seem to return an object). For example, what are the MEF equivalents of these three methods?
0
7,599,877
09/29/2011 15:42:27
971,337
09/29/2011 14:20:31
1
0
How to launch a URL string in GWT
I am looking to send a request to a webpage, with parameters and retrieve the results. I am not sure how to go about that. Any Help would be great! Thanks!
java
gwt
servlets
null
null
09/30/2011 04:35:49
not a real question
How to launch a URL string in GWT === I am looking to send a request to a webpage, with parameters and retrieve the results. I am not sure how to go about that. Any Help would be great! Thanks!
1
11,554,875
07/19/2012 06:09:35
1,485,554
06/27/2012 12:02:05
1
0
Android Lifecycle and Password Activity
I do my first app in android. I use API 10 right now. I had some Javaexperience before (JDK1.4->7). In my app I want to ask for a password, so curious people will not see the images that the app displays in three activities. Of course I am asking for the password when the main activity is started (with a intent in onCreate()). But I want to be shure that the App will ask for the password again after inactivity (e.g. device lying around, screensaver on and someone picks up the phone (and the phone has no pin or other protection)). Another situation where I want to ask for the password is when I start another activity. When someone then presses the Homebutton, gets the last tasks and selects my App, and this is not destroyed until then, and comes back from the stack. In this case a password should be required. Important is, that I dont want to have password questions during normal use of my app. I studied Q&A at SO and the guides on lifecycles and did some testing but no matter where I exactly place a call to the password activity, it always happened that it it will (randomly) appear in situations I don't wanted it to appear (orientation changes, between a normal-use-switch between activities etc.), or that it does not appear when I want it to appear. I guess it is not done with placing the check/call to the password activity in the right method of the lifecycle of an app. There must be a way to check for especially the circumstances described above? So what do you think is the best place for this check, and what system values should be inspected?
android
passwords
lifecycle
null
null
07/19/2012 12:38:02
not a real question
Android Lifecycle and Password Activity === I do my first app in android. I use API 10 right now. I had some Javaexperience before (JDK1.4->7). In my app I want to ask for a password, so curious people will not see the images that the app displays in three activities. Of course I am asking for the password when the main activity is started (with a intent in onCreate()). But I want to be shure that the App will ask for the password again after inactivity (e.g. device lying around, screensaver on and someone picks up the phone (and the phone has no pin or other protection)). Another situation where I want to ask for the password is when I start another activity. When someone then presses the Homebutton, gets the last tasks and selects my App, and this is not destroyed until then, and comes back from the stack. In this case a password should be required. Important is, that I dont want to have password questions during normal use of my app. I studied Q&A at SO and the guides on lifecycles and did some testing but no matter where I exactly place a call to the password activity, it always happened that it it will (randomly) appear in situations I don't wanted it to appear (orientation changes, between a normal-use-switch between activities etc.), or that it does not appear when I want it to appear. I guess it is not done with placing the check/call to the password activity in the right method of the lifecycle of an app. There must be a way to check for especially the circumstances described above? So what do you think is the best place for this check, and what system values should be inspected?
1
5,635,926
04/12/2011 13:26:24
284,757
03/02/2010 20:48:42
57
5
Apache Migration POST Now doesn't work
I recently migrated a website from one Ubuntu Server to another and for some reason now I can't do a HTTP POST to send data to the web server. I have an iPhone application that POSTS XML data to the web server and every time it attempts to do that, the web server says it didn't get any data. When I try and do the same thing on the old server, it works fine. Is there something else I need to do on the new server to enable HTTP POST?
apache2
http-post
null
null
null
null
open
Apache Migration POST Now doesn't work === I recently migrated a website from one Ubuntu Server to another and for some reason now I can't do a HTTP POST to send data to the web server. I have an iPhone application that POSTS XML data to the web server and every time it attempts to do that, the web server says it didn't get any data. When I try and do the same thing on the old server, it works fine. Is there something else I need to do on the new server to enable HTTP POST?
0
788,920
04/25/2009 13:28:36
67,405
02/17/2009 14:43:49
308
4
Compress multiple files individually with Gzip
I have several directories that look like this: dir1/ |_foo.txt |_bar.txt dir2/ |_qux.txt |_bar.txt For each of this directory I want to compress the files inside it into *.gz format then delete the uncompressed ones. So finally we hope to get something like this: dir1/ |_foo.gz |_bar.gz dir2/ |_qux.gz |_bar.gz Is there a simple Unix way to do it?
gzip
unix
linux
compression
null
null
open
Compress multiple files individually with Gzip === I have several directories that look like this: dir1/ |_foo.txt |_bar.txt dir2/ |_qux.txt |_bar.txt For each of this directory I want to compress the files inside it into *.gz format then delete the uncompressed ones. So finally we hope to get something like this: dir1/ |_foo.gz |_bar.gz dir2/ |_qux.gz |_bar.gz Is there a simple Unix way to do it?
0
1,834,825
12/02/2009 18:21:10
205,521
11/07/2009 10:34:53
13
1
How do ldexp and frexp work in python?
The python frexp and ldexp functions splits floats into mantissa and exponent. Do anybody know if this process exposes the actual float structure, or if it requires python to do expensive logarithmic calls?
float
python
ieee
mantissa
exponent
null
open
How do ldexp and frexp work in python? === The python frexp and ldexp functions splits floats into mantissa and exponent. Do anybody know if this process exposes the actual float structure, or if it requires python to do expensive logarithmic calls?
0
11,384,780
07/08/2012 16:35:50
624,814
02/09/2011 17:57:13
321
24
Where is the Firefox Cache?
With all the big changes with Firefox recently, all the info about their cache location has become outdated. Or has Firefox changed so much that this question is moot? Running mac osx 10.6.8 (Snow Leopard). I need to recover some files that are most likely still in the cache. Thanks!
osx
firefox
browser-cache
null
null
07/09/2012 01:09:21
off topic
Where is the Firefox Cache? === With all the big changes with Firefox recently, all the info about their cache location has become outdated. Or has Firefox changed so much that this question is moot? Running mac osx 10.6.8 (Snow Leopard). I need to recover some files that are most likely still in the cache. Thanks!
2
367,956
12/15/2008 10:27:25
24,995
10/03/2008 21:06:29
2,839
125
Escaping out of the Find and Replace box in Visual Studio 2008
I'm in Visual Studio 2008, and I'm editing a CSS file. I use ctrl+f a lot to find stuff around the file. Once I find something, I'm used to using the Esc key get out of the find window and back into the editor. I'd swear this is how it works when I'm at the office, but at home, I have to hit ctrl+tab to get back to the editor windo and I hate it! Anyone know what's going on here, or if I'm just going crazy?
visual-studio
text-editor
null
null
null
12/15/2008 12:24:18
off topic
Escaping out of the Find and Replace box in Visual Studio 2008 === I'm in Visual Studio 2008, and I'm editing a CSS file. I use ctrl+f a lot to find stuff around the file. Once I find something, I'm used to using the Esc key get out of the find window and back into the editor. I'd swear this is how it works when I'm at the office, but at home, I have to hit ctrl+tab to get back to the editor windo and I hate it! Anyone know what's going on here, or if I'm just going crazy?
2
2,671,338
04/19/2010 22:23:58
295,213
03/16/2010 22:09:24
82
5
C# how to use timer ?
I made a student check_list program thats using bluetooth adapter searches students cell phones bluetooth and checks that are they present or not and saves students informtion with date in table on data base.all them works gereat.But I want to make it automatic that I will put my program on some computer like works as an server and program will make search every lessons start time like 08.30 , 10.25 ... My question is how to use timer? I know how to use timer but How can I use it on every lessons start time?I have table that includes start time of lessons. Also am I have to stop timer after search ends?And If I stop timer could I re-run timer againg? And one additional question that how can I track that new students come or some body left class room?
c#
timer
tracking
null
null
null
open
C# how to use timer ? === I made a student check_list program thats using bluetooth adapter searches students cell phones bluetooth and checks that are they present or not and saves students informtion with date in table on data base.all them works gereat.But I want to make it automatic that I will put my program on some computer like works as an server and program will make search every lessons start time like 08.30 , 10.25 ... My question is how to use timer? I know how to use timer but How can I use it on every lessons start time?I have table that includes start time of lessons. Also am I have to stop timer after search ends?And If I stop timer could I re-run timer againg? And one additional question that how can I track that new students come or some body left class room?
0
6,941,681
08/04/2011 12:47:06
362,417
06/09/2010 12:42:03
302
12
Ivy - Doesn't download from Maven Repo
I have a problem with IVY. I configured the mvnrepository correctly in the config file, ivysettings. Here is the config file: <ibiblio name="maven" root="http://repo1.maven.org/maven2/" m2compatible="true" /> Here is the dep request: <dependency org="net.sf.json-lib" name="Json-lib" rev="2.4" conf="default->compile"/> Here is the module: http://mvnrepository.com/artifact/net.sf.json-lib/json-lib/2.4 Here is the POM file for json-lib: http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.4/json-lib-2.4.pom So as you can see, everything is in its place and works properly. BUT!! It doesn't download this module. No files what so ever. :SSS Do you have any advice on why is he doing this?? Thanks!!!!
ivy
null
null
null
null
08/06/2011 04:36:58
too localized
Ivy - Doesn't download from Maven Repo === I have a problem with IVY. I configured the mvnrepository correctly in the config file, ivysettings. Here is the config file: <ibiblio name="maven" root="http://repo1.maven.org/maven2/" m2compatible="true" /> Here is the dep request: <dependency org="net.sf.json-lib" name="Json-lib" rev="2.4" conf="default->compile"/> Here is the module: http://mvnrepository.com/artifact/net.sf.json-lib/json-lib/2.4 Here is the POM file for json-lib: http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.4/json-lib-2.4.pom So as you can see, everything is in its place and works properly. BUT!! It doesn't download this module. No files what so ever. :SSS Do you have any advice on why is he doing this?? Thanks!!!!
3
11,638,844
07/24/2012 20:32:19
346,744
05/21/2010 04:17:25
577
28
Repair Missing Tree
My git repo has become corrupted and unfortunately it only exists locally. $ git fsck --full Checking object directories: 100% (256/256), done. broken link from tree 54b4ff576b2e39831a298e58a38d91890f622b63 to tree d564d0bc3dd917926892c55e3706cc116d5b165e missing tree d564d0bc3dd917926892c55e3706cc116d5b165e I checked into what `d564d0bc` is, and it is my `log/` folder in a rails project. This folder only contains `*.log` files (which are ignored) and a `.gitkeep` file. I tried following the steps mentioned in this [post](http://stackoverflow.com/questions/7236738/how-can-i-recover-my-git-repository-for-a-missing-tree-error), but I'm using GitHub for Windows and powershell is screaming at me over an empty pipe. Any help is appreciated.
git
null
null
null
null
null
open
Repair Missing Tree === My git repo has become corrupted and unfortunately it only exists locally. $ git fsck --full Checking object directories: 100% (256/256), done. broken link from tree 54b4ff576b2e39831a298e58a38d91890f622b63 to tree d564d0bc3dd917926892c55e3706cc116d5b165e missing tree d564d0bc3dd917926892c55e3706cc116d5b165e I checked into what `d564d0bc` is, and it is my `log/` folder in a rails project. This folder only contains `*.log` files (which are ignored) and a `.gitkeep` file. I tried following the steps mentioned in this [post](http://stackoverflow.com/questions/7236738/how-can-i-recover-my-git-repository-for-a-missing-tree-error), but I'm using GitHub for Windows and powershell is screaming at me over an empty pipe. Any help is appreciated.
0
7,294,584
09/03/2011 17:10:02
926,572
09/03/2011 11:41:04
1
0
Which technology is suitable for building scalable websites?
I want to know which technology is most appropriate for developing efficient websites which can be easily scaled in future? By technology I mean, which: Language: Java/Jsp ; PHP ; or a Ruby andd Rails etc. Server: Apache etc. OS DataBase etc. Thank You
java
php
apache
web-applications
null
09/03/2011 17:19:05
not constructive
Which technology is suitable for building scalable websites? === I want to know which technology is most appropriate for developing efficient websites which can be easily scaled in future? By technology I mean, which: Language: Java/Jsp ; PHP ; or a Ruby andd Rails etc. Server: Apache etc. OS DataBase etc. Thank You
4
5,804,881
04/27/2011 13:27:28
407,594
07/31/2010 18:08:38
46
0
How to pass a constructor arg of one bean to a nested bean
I have two classes A and B. A holds B as a class field b.<br/> A has two arguments in its constructor : public A(C c, D d){}.<br/> B has two arguments in its constructor : public B(C c, D d){}.<br/> A has a setter for B.<br/> in the spring xml, I defined the Bean B nested inside A :<br/> <-bean id="B" class="java.util.B"/><br/> <-bean id="A" class="java.util.A><br/> <-property name="b" ref="B"/><br/> <-/bean> if I load A as follows: (A)SpringManager.getInstance().loadBean("A",new Object[] {c,d}) <br/>(assume that c and d are defined in the class that calles the loadBean function)<br/> How do I pass the args that A got to B's constructor?
spring
null
null
null
null
null
open
How to pass a constructor arg of one bean to a nested bean === I have two classes A and B. A holds B as a class field b.<br/> A has two arguments in its constructor : public A(C c, D d){}.<br/> B has two arguments in its constructor : public B(C c, D d){}.<br/> A has a setter for B.<br/> in the spring xml, I defined the Bean B nested inside A :<br/> <-bean id="B" class="java.util.B"/><br/> <-bean id="A" class="java.util.A><br/> <-property name="b" ref="B"/><br/> <-/bean> if I load A as follows: (A)SpringManager.getInstance().loadBean("A",new Object[] {c,d}) <br/>(assume that c and d are defined in the class that calles the loadBean function)<br/> How do I pass the args that A got to B's constructor?
0
1,970,594
12/28/2009 17:40:51
107,862
05/15/2009 18:15:11
37
7
Enums or Tables?
I am making this a community wiki, as I would appreciate peoples approach and not necessarily an answer. I am in the situation where I have a lot of lookup type data fields, that do not change. An example would be: >**Yearly Salary** >Option: 0 - 25K >Option: 25K - 100K >Option: 100K + I would like to have these options easily available through an enum, but would also like to textual values available in the DB, as I will do reporting on the textual values and not a ID. Also, since they are static I do not want to be making calls to the DB. I was thinking duplicating this in an enum and table, but would like to hear some alternate thoughts. Thanks
c#
enums
null
null
null
null
open
Enums or Tables? === I am making this a community wiki, as I would appreciate peoples approach and not necessarily an answer. I am in the situation where I have a lot of lookup type data fields, that do not change. An example would be: >**Yearly Salary** >Option: 0 - 25K >Option: 25K - 100K >Option: 100K + I would like to have these options easily available through an enum, but would also like to textual values available in the DB, as I will do reporting on the textual values and not a ID. Also, since they are static I do not want to be making calls to the DB. I was thinking duplicating this in an enum and table, but would like to hear some alternate thoughts. Thanks
0
5,607,116
04/09/2011 18:56:34
700,090
04/09/2011 15:59:20
1
0
How to select XML node by attribute and use it's child nodes data?
Here is my XML file <?xml version="1.0" encoding="utf-8" ?> <storage> <Save Name ="Lifeline"> <Seconds>12</Seconds> <Minutes>24</Minutes> <Hours>9</Hours> <Days>25</Days> <Months>8</Months> <Years>2010</Years> <Health>90</Health> <Mood>100</Mood> </Save> <Save Name ="Hellcode"> <Seconds>24</Seconds> <Minutes>48</Minutes> <Hours>18</Hours> <Days>15</Days> <Months>4</Months> <Years>1995</Years> <Health>50</Health> <Mood>50</Mood> </Save> </storage> Here is a code which get's data from XML and loads it into application. System.IO.StreamReader sr = new System.IO.StreamReader(@"Saves.xml"); System.Xml.XmlTextReader xr = new System.Xml.XmlTextReader(sr); System.Xml.XmlDocument save = new System.Xml.XmlDocument(); save.Load(xr); XmlNodeList saveItems = save.SelectNodes("Storage/Save"); XmlNode seconds = saveItems.Item(0).SelectSingleNode("Seconds"); sec = Int32.Parse(seconds.InnerText); XmlNode minutes = saveItems.Item(0).SelectSingleNode("Minutes"); min = Int32.Parse(minutes.InnerText); XmlNode hours = saveItems.Item(0).SelectSingleNode("Hours"); hour = Int32.Parse(hours.InnerText); XmlNode days = saveItems.Item(0).SelectSingleNode("Days"); day = Int32.Parse(days.InnerText); XmlNode months = saveItems.Item(0).SelectSingleNode("Months"); month = Int32.Parse(months.InnerText); XmlNode years = saveItems.Item(0).SelectSingleNode("Years"); year = Int32.Parse(years.InnerText); XmlNode health_ = saveItems.Item(0).SelectSingleNode("Health"); health = Int32.Parse(health_.InnerText); XmlNode mood_ = saveItems.Item(0).SelectSingleNode("Mood"); mood = Int32.Parse(mood_.InnerText); The problem is that this code loads data inly from "Lifeline" node. I would like to use a listbox and be able to choose from which node to load data. I've tried to take string from listbox item content and then use such a line XmlNodeList saveItems = save.SelectNodes(string.Format("storage/Save[@Name = '{0}']", name)); variable "name" is a string from listboxe's item. While compiled this code gives exception. Do somebody knows a way how to select by attribute and load nedeed data from that XML?
c#
xml
attributes
null
null
null
open
How to select XML node by attribute and use it's child nodes data? === Here is my XML file <?xml version="1.0" encoding="utf-8" ?> <storage> <Save Name ="Lifeline"> <Seconds>12</Seconds> <Minutes>24</Minutes> <Hours>9</Hours> <Days>25</Days> <Months>8</Months> <Years>2010</Years> <Health>90</Health> <Mood>100</Mood> </Save> <Save Name ="Hellcode"> <Seconds>24</Seconds> <Minutes>48</Minutes> <Hours>18</Hours> <Days>15</Days> <Months>4</Months> <Years>1995</Years> <Health>50</Health> <Mood>50</Mood> </Save> </storage> Here is a code which get's data from XML and loads it into application. System.IO.StreamReader sr = new System.IO.StreamReader(@"Saves.xml"); System.Xml.XmlTextReader xr = new System.Xml.XmlTextReader(sr); System.Xml.XmlDocument save = new System.Xml.XmlDocument(); save.Load(xr); XmlNodeList saveItems = save.SelectNodes("Storage/Save"); XmlNode seconds = saveItems.Item(0).SelectSingleNode("Seconds"); sec = Int32.Parse(seconds.InnerText); XmlNode minutes = saveItems.Item(0).SelectSingleNode("Minutes"); min = Int32.Parse(minutes.InnerText); XmlNode hours = saveItems.Item(0).SelectSingleNode("Hours"); hour = Int32.Parse(hours.InnerText); XmlNode days = saveItems.Item(0).SelectSingleNode("Days"); day = Int32.Parse(days.InnerText); XmlNode months = saveItems.Item(0).SelectSingleNode("Months"); month = Int32.Parse(months.InnerText); XmlNode years = saveItems.Item(0).SelectSingleNode("Years"); year = Int32.Parse(years.InnerText); XmlNode health_ = saveItems.Item(0).SelectSingleNode("Health"); health = Int32.Parse(health_.InnerText); XmlNode mood_ = saveItems.Item(0).SelectSingleNode("Mood"); mood = Int32.Parse(mood_.InnerText); The problem is that this code loads data inly from "Lifeline" node. I would like to use a listbox and be able to choose from which node to load data. I've tried to take string from listbox item content and then use such a line XmlNodeList saveItems = save.SelectNodes(string.Format("storage/Save[@Name = '{0}']", name)); variable "name" is a string from listboxe's item. While compiled this code gives exception. Do somebody knows a way how to select by attribute and load nedeed data from that XML?
0
8,988,355
01/24/2012 14:18:42
503,866
11/10/2010 22:34:36
31
3
Too long vertical lines in LaTeX table
Ok, I've looked at this code too long and need some fresh eyes and ideas. **Question:** Why do I get too long vertical lines on my LaTeX table? Looks to me like some sort of overflow, but the document is much wider, so I don't think it is the problem. *Code:* \begin{table}[h] \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|} \hline ContainsPrize & \multicolumn{3}{|c|}{A} & \multicolumn{3}{|c|}{B} & \multicolumn{3}{|c|}{C} \\ \hline MyChoice      & A   & B & C & A & B   & C & A & B & C   \\ \hline openA         & 0   & 0 & 0 & 0 & 0.5 & 1 & 0 & 1 & 0.5 \\ openB         & 0.5 & 0 & 1 & 0 & 0   & 0 & 1 & 0 & 0.5 \\ openC         & 0.5 & 1 & 0 & 1 & 0.5 & 0 & 0 & 0 & 0   \\ \hline \end{tabular} \caption{A nice caption text here...} \end{table} **Which generates:** ![The generated table][1] Any ideas? [1]: http://i.stack.imgur.com/9assL.png
latex
tex
null
null
null
01/24/2012 19:13:35
off topic
Too long vertical lines in LaTeX table === Ok, I've looked at this code too long and need some fresh eyes and ideas. **Question:** Why do I get too long vertical lines on my LaTeX table? Looks to me like some sort of overflow, but the document is much wider, so I don't think it is the problem. *Code:* \begin{table}[h] \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|} \hline ContainsPrize & \multicolumn{3}{|c|}{A} & \multicolumn{3}{|c|}{B} & \multicolumn{3}{|c|}{C} \\ \hline MyChoice      & A   & B & C & A & B   & C & A & B & C   \\ \hline openA         & 0   & 0 & 0 & 0 & 0.5 & 1 & 0 & 1 & 0.5 \\ openB         & 0.5 & 0 & 1 & 0 & 0   & 0 & 1 & 0 & 0.5 \\ openC         & 0.5 & 1 & 0 & 1 & 0.5 & 0 & 0 & 0 & 0   \\ \hline \end{tabular} \caption{A nice caption text here...} \end{table} **Which generates:** ![The generated table][1] Any ideas? [1]: http://i.stack.imgur.com/9assL.png
2
4,828,421
01/28/2011 12:53:19
128,618
06/25/2009 04:43:13
315
6
Sum elements of array the same key?
My function function array_push_assoc(&$array, $key, $value){ echo $key.".".$value."<p>"; $array[$key] = $value; return $array; } OUTPUT USD.736.00 USD.100.00 Array ( [USD] => 100.00 ) EUR.736.00 USD.100.00 Array ( [EUR] => 736.00 [USD] => 100.00 ) I WANT OUTPUT USD.736.00 USD.100.00 Array ( [USD] => 836.00 // sum all the same currency ) EUR.736.00 USD.100.00 Array ( [EUR] => 736.00 [USD] => 100.00 ) Anybody Know how to do this?Please help .Thanks
php
null
null
null
null
null
open
Sum elements of array the same key? === My function function array_push_assoc(&$array, $key, $value){ echo $key.".".$value."<p>"; $array[$key] = $value; return $array; } OUTPUT USD.736.00 USD.100.00 Array ( [USD] => 100.00 ) EUR.736.00 USD.100.00 Array ( [EUR] => 736.00 [USD] => 100.00 ) I WANT OUTPUT USD.736.00 USD.100.00 Array ( [USD] => 836.00 // sum all the same currency ) EUR.736.00 USD.100.00 Array ( [EUR] => 736.00 [USD] => 100.00 ) Anybody Know how to do this?Please help .Thanks
0
5,369,368
03/20/2011 15:20:24
522,234
11/27/2010 12:19:08
3
2
Compare all file sizes of 2 directories in bash
Sometimes it happens that for some reason the process of copying many files (i.e. to external HDD; using Nautilus file manager) crashes. If I then start it again, I use to ignore already existing files, though some of them were not copied 100%. So the properties window shows me "460 Files (225 GB)" in source folder and "460 Files (222 GB)" in destination folder... How do I now find out which files have only been copied partially (maybe using `ls` and `diff`)?
bash
file
diff
size
folder
null
open
Compare all file sizes of 2 directories in bash === Sometimes it happens that for some reason the process of copying many files (i.e. to external HDD; using Nautilus file manager) crashes. If I then start it again, I use to ignore already existing files, though some of them were not copied 100%. So the properties window shows me "460 Files (225 GB)" in source folder and "460 Files (222 GB)" in destination folder... How do I now find out which files have only been copied partially (maybe using `ls` and `diff`)?
0
6,747,797
07/19/2011 13:19:06
186,643
10/08/2009 18:58:37
497
10
How do I pass function delegates to be called with LINQ?
I think I'm asking the right question here... I have 4 stored procedures that return different subsets of the same data. I map this data to the same object in my server application. I've set my code up as follows: internal static List<MyObj> getData(DataType data) { List<MyObj> obj = null; switch (data) { case DataType.Type1: obj = mapObj(delegateForType1); break; case DateType.Type2: obj = mapObj(delegateForType2); break; ... } } // This gives me an error that type T cannot be defined // private static List<MyObj> mapObj(Func<T> getDataForObj) // This gives me an error calling the function (Cannot find implementation of query pattern for source type T private static List<MyObj> mapObj<T>(Func<T> getDataForObj) { List<MyObj> obj = new List<MyObj>(); var result = from a in getDataForObj() select a; foreach (var row in result) { ... // map objs } return obj; } Please see my comments regarding the method declaration for the issues I'm having. How would I accomplish this correctly? My goal was to just not have the same code copy/pasted multiple times...trying to follow DRY principles. Thanks in advance for your help.
c#
linq
generics
.net-4.0
delegates
07/20/2011 11:43:05
not a real question
How do I pass function delegates to be called with LINQ? === I think I'm asking the right question here... I have 4 stored procedures that return different subsets of the same data. I map this data to the same object in my server application. I've set my code up as follows: internal static List<MyObj> getData(DataType data) { List<MyObj> obj = null; switch (data) { case DataType.Type1: obj = mapObj(delegateForType1); break; case DateType.Type2: obj = mapObj(delegateForType2); break; ... } } // This gives me an error that type T cannot be defined // private static List<MyObj> mapObj(Func<T> getDataForObj) // This gives me an error calling the function (Cannot find implementation of query pattern for source type T private static List<MyObj> mapObj<T>(Func<T> getDataForObj) { List<MyObj> obj = new List<MyObj>(); var result = from a in getDataForObj() select a; foreach (var row in result) { ... // map objs } return obj; } Please see my comments regarding the method declaration for the issues I'm having. How would I accomplish this correctly? My goal was to just not have the same code copy/pasted multiple times...trying to follow DRY principles. Thanks in advance for your help.
1
5,554,475
04/05/2011 15:36:36
630,412
02/23/2011 15:06:48
36
0
Objective C: use instance class in other class
In my code, in a class I have FirstClass *first; and I can use first in my class, but if I want use first in other class? How can I do?
objective-c
xcode
class
null
null
null
open
Objective C: use instance class in other class === In my code, in a class I have FirstClass *first; and I can use first in my class, but if I want use first in other class? How can I do?
0
2,864,904
05/19/2010 11:07:44
333,294
05/05/2010 10:05:41
1
0
How to save to two tables using one SQLAlchemy model
I have an SQLAlchemy ORM class, linked to MySQL, which works great at saving the data I need down to the underlying table. However, I would like to also save the identical data to a ***second*** archive table. Here's some psudocode to try and explain what I mean my_data = Data() #An ORM Class my_data.name = "foo" #This saves just to the 'data' table session.add(my_data) #This will save it to the identical 'backup_data' table my_data_archive = my_data my_data_archive.__tablename__ = 'backup_data' session.add(my_data_archive) #And commits them both session.commit() Just a heads up, I am not interested in mapping a class to a JOIN, as in: http://www.sqlalchemy.org/docs/05/mappers.html#mapping-a-class-against-multiple-tables
python
sqlalchemy
sql
mysql
null
null
open
How to save to two tables using one SQLAlchemy model === I have an SQLAlchemy ORM class, linked to MySQL, which works great at saving the data I need down to the underlying table. However, I would like to also save the identical data to a ***second*** archive table. Here's some psudocode to try and explain what I mean my_data = Data() #An ORM Class my_data.name = "foo" #This saves just to the 'data' table session.add(my_data) #This will save it to the identical 'backup_data' table my_data_archive = my_data my_data_archive.__tablename__ = 'backup_data' session.add(my_data_archive) #And commits them both session.commit() Just a heads up, I am not interested in mapping a class to a JOIN, as in: http://www.sqlalchemy.org/docs/05/mappers.html#mapping-a-class-against-multiple-tables
0
7,452,454
09/17/2011 04:34:56
833,416
07/07/2011 11:32:22
15
1
Why are we allowed to harass an iterating variable in a for loop
Sorry about the question being so generic, but I've always wondered about this. In a for loop why doesn't a compiler determine the number of times it has to run based on the initializer, condition and increment and then run the loop for the predetermined number of times?? Even the advanced for in Java and the for in python which allow us to iterate over collections would act funny if we modified the collection. If we do want to change the iterating variable or the object we are iterating upon, we might as well use a while loop instead of a for. Are there any advantages to using a for loop in such a case?? Since no language does a for loop the way I have described, there must be a lot of things I haven't thought about. Please point out the same.
for-loop
null
null
null
null
09/17/2011 13:22:24
not constructive
Why are we allowed to harass an iterating variable in a for loop === Sorry about the question being so generic, but I've always wondered about this. In a for loop why doesn't a compiler determine the number of times it has to run based on the initializer, condition and increment and then run the loop for the predetermined number of times?? Even the advanced for in Java and the for in python which allow us to iterate over collections would act funny if we modified the collection. If we do want to change the iterating variable or the object we are iterating upon, we might as well use a while loop instead of a for. Are there any advantages to using a for loop in such a case?? Since no language does a for loop the way I have described, there must be a lot of things I haven't thought about. Please point out the same.
4
9,051,191
01/29/2012 05:36:26
779,158
06/01/2011 10:06:14
960
83
Setup failed with following error
Component SQL Server 2008 Express has failed to install with the following error message: "An error occurred attempting to install SQL Server 2008 Express Service Pack 1." The following components failed to install: - SQL Server 2008 Express See the setup log file located at 'C:\DOCUME~1\India\LOCALS~1\Temp\VSD11D.tmp\install.log' for more information. I have created a window setup in vs 2010 when i install that setup on client machine the above error is coming.
visual-studio-2010
sql-server-2008
c#-4.0
setup
null
01/31/2012 15:41:14
too localized
Setup failed with following error === Component SQL Server 2008 Express has failed to install with the following error message: "An error occurred attempting to install SQL Server 2008 Express Service Pack 1." The following components failed to install: - SQL Server 2008 Express See the setup log file located at 'C:\DOCUME~1\India\LOCALS~1\Temp\VSD11D.tmp\install.log' for more information. I have created a window setup in vs 2010 when i install that setup on client machine the above error is coming.
3
5,500,143
03/31/2011 12:52:40
672,938
03/23/2011 11:43:19
23
0
Raise an error in SWI Prolog
I'd like to print a message and stop the evaluation of the predicate. How do I do that?
swi-prolog
null
null
null
null
null
open
Raise an error in SWI Prolog === I'd like to print a message and stop the evaluation of the predicate. How do I do that?
0
10,605,183
05/15/2012 16:38:07
200,399
11/01/2009 07:01:06
1,327
21
how to change firefox proxy settings using xpcom
I have a proxy server running on localhost (127.0.0.1) and i have **grown tired** of having to train users on how to switch proxies in firefox to bypass blocked websites. I decided to write an addon. I wonder how to use **xpcom** to tell firefox to use a certain proxy eg for http, use 127.0.0.1 port 8080. Examples on the internet are scarce. Thanks
javascript
firefox-addon
xpcom
null
null
null
open
how to change firefox proxy settings using xpcom === I have a proxy server running on localhost (127.0.0.1) and i have **grown tired** of having to train users on how to switch proxies in firefox to bypass blocked websites. I decided to write an addon. I wonder how to use **xpcom** to tell firefox to use a certain proxy eg for http, use 127.0.0.1 port 8080. Examples on the internet are scarce. Thanks
0
6,665,436
07/12/2011 14:04:07
805,100
06/19/2011 05:56:09
1
0
autocomplete not working in keypress event
I am stuck with this piece of code in which i am trying to take the input not on click event but on keypress event.The autocomplete list must scroll thru' by the keys and not to click on the data.After selecting thru' key the enter key must be pressed to put the data into the textbox. PLEASE HELP. this is the code for the main form:- -------------------------------------------------- <script type="text/javascript"> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { $.post("rpc.php", {queryString: ""+inputString+""}, function(data) { if(data.length >0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } // lookup function fill(thisValue) { $('#inputString').val(thisValue); setTimeout("$('#suggestions').hide();", 200); ---------------------------------------------------------------------------- this is the code for the css </script> <style type="text/css"> body { font-family: Helvetica; font-size: 11px; color: #000; } h3 { margin: 0px; padding: 0px; } .suggestionsBox { position: absolute; top: 41px; left: 450px; margin: 10px 0px 0px 0px; width: 200px; background-color: #ccc; -moz-border-radius: 7px; -webkit-border-radius: 7px; border: 2px solid #000; color: #fff; z-index:100; } .suggestionsBox2 { position: absolute; top: 82px; left: 450px; margin: 10px 0px 0px 0px; width: 200px; background-color: #ccc; -moz-border-radius: 7px; -webkit-border-radius: 7px; border: 2px solid #000; color: #fff; z-index:100; } .suggestionList { position: absolute; margin: 0px; padding: 0px; } .suggestionList2 { position: absolute; margin: 0px; padding: 0px; z-index:100; } .suggestionList li { margin: 0px 0px 3px 0px; padding: 3px; cursor: pointer; display:block; list-style-type:none; } .suggestionList2 li { margin: 0px 0px 3px 0px; padding: 3px; cursor: pointer; display:block; list-style-type:none; } .suggestionList li:hover { background-color: #bbb; color:#111; } .suggestionList2 li:hover { background-color: #bbb; color:#111; } </style> ------------------------------------------------------------------- this is the code for the database query <?php // PHP5 Implementation - uses MySQLi. // mysqli('localhost', 'yourUsername', 'yourPassword', 'yourDatabase'); $db = new mysqli("localhost", "***", "***", "***"); if (!$db) { // Show error if we cannot connect. echo 'ERROR: Could not connect to the database.'; } else { // Is there a posted query string? if (isset($_POST['queryString'])) { $queryString = $db->real_escape_string($_POST['queryString']); // Is the string length greater than 0? if (strlen($queryString) > 0) { $query = $db->query("SELECT first_name FROM info WHERE first_name LIKE '$queryString%' LIMIT 5"); if ($query) { while ($result = $query->fetch_object()) { // The onClick function fills the textbox with the result. // YOU MUST CHANGE: $result->value to $result->your_colum echo '<li onclick ="fill(\'' . $result->first_name . '\');">' . $result->first_name . '</li>'; } } else { echo 'ERROR: There was a problem with the query.'; } } else { // Dont do anything. } // There is a queryString. } else { echo 'There should be no direct access to this script!'; } } ?>
php
jquery
autocomplete
null
null
07/12/2011 16:08:13
not a real question
autocomplete not working in keypress event === I am stuck with this piece of code in which i am trying to take the input not on click event but on keypress event.The autocomplete list must scroll thru' by the keys and not to click on the data.After selecting thru' key the enter key must be pressed to put the data into the textbox. PLEASE HELP. this is the code for the main form:- -------------------------------------------------- <script type="text/javascript"> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { $.post("rpc.php", {queryString: ""+inputString+""}, function(data) { if(data.length >0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } // lookup function fill(thisValue) { $('#inputString').val(thisValue); setTimeout("$('#suggestions').hide();", 200); ---------------------------------------------------------------------------- this is the code for the css </script> <style type="text/css"> body { font-family: Helvetica; font-size: 11px; color: #000; } h3 { margin: 0px; padding: 0px; } .suggestionsBox { position: absolute; top: 41px; left: 450px; margin: 10px 0px 0px 0px; width: 200px; background-color: #ccc; -moz-border-radius: 7px; -webkit-border-radius: 7px; border: 2px solid #000; color: #fff; z-index:100; } .suggestionsBox2 { position: absolute; top: 82px; left: 450px; margin: 10px 0px 0px 0px; width: 200px; background-color: #ccc; -moz-border-radius: 7px; -webkit-border-radius: 7px; border: 2px solid #000; color: #fff; z-index:100; } .suggestionList { position: absolute; margin: 0px; padding: 0px; } .suggestionList2 { position: absolute; margin: 0px; padding: 0px; z-index:100; } .suggestionList li { margin: 0px 0px 3px 0px; padding: 3px; cursor: pointer; display:block; list-style-type:none; } .suggestionList2 li { margin: 0px 0px 3px 0px; padding: 3px; cursor: pointer; display:block; list-style-type:none; } .suggestionList li:hover { background-color: #bbb; color:#111; } .suggestionList2 li:hover { background-color: #bbb; color:#111; } </style> ------------------------------------------------------------------- this is the code for the database query <?php // PHP5 Implementation - uses MySQLi. // mysqli('localhost', 'yourUsername', 'yourPassword', 'yourDatabase'); $db = new mysqli("localhost", "***", "***", "***"); if (!$db) { // Show error if we cannot connect. echo 'ERROR: Could not connect to the database.'; } else { // Is there a posted query string? if (isset($_POST['queryString'])) { $queryString = $db->real_escape_string($_POST['queryString']); // Is the string length greater than 0? if (strlen($queryString) > 0) { $query = $db->query("SELECT first_name FROM info WHERE first_name LIKE '$queryString%' LIMIT 5"); if ($query) { while ($result = $query->fetch_object()) { // The onClick function fills the textbox with the result. // YOU MUST CHANGE: $result->value to $result->your_colum echo '<li onclick ="fill(\'' . $result->first_name . '\');">' . $result->first_name . '</li>'; } } else { echo 'ERROR: There was a problem with the query.'; } } else { // Dont do anything. } // There is a queryString. } else { echo 'There should be no direct access to this script!'; } } ?>
1
7,347,875
09/08/2011 12:17:32
934,758
09/08/2011 12:17:32
1
0
Android version on Google TV devices
As per my understanding Google TV devices available in markets donot yet run on HoneyComb. If thats right, could you please let me know the Android version they run on? Would the HoneyComb update to Google TV be released as a new API level or a revision version for Honeycomb?When can we expect the same?
google-tv
null
null
null
null
09/08/2011 22:58:32
off topic
Android version on Google TV devices === As per my understanding Google TV devices available in markets donot yet run on HoneyComb. If thats right, could you please let me know the Android version they run on? Would the HoneyComb update to Google TV be released as a new API level or a revision version for Honeycomb?When can we expect the same?
2
10,909,922
06/06/2012 07:28:55
1,147,004
01/13/2012 05:25:41
1
0
How to go to phonegap after authenticating from Facebook IOS Native app
I want to be able to create a native Facebook connect thingy on ios5 and once I get the authToken, I want to pass that authToken to a phonegap method which will do the web stuff for me. Any tips?
ios
phonegap
null
null
null
06/08/2012 06:54:30
not constructive
How to go to phonegap after authenticating from Facebook IOS Native app === I want to be able to create a native Facebook connect thingy on ios5 and once I get the authToken, I want to pass that authToken to a phonegap method which will do the web stuff for me. Any tips?
4
10,532,128
05/10/2012 10:28:21
912,319
08/25/2011 14:26:52
89
4
Difference between JSP and WEBSTART
Friends, Previously i have worked with EJB-WEBSTART CLIENT project, and Now i have joined with project using JSP. I could understand WEBSTART which is a implementation of JNLP and will be responsible for downloading client jars. But Why we need JSP? Why TWO different technology? Which is best at what environment? IS it both work together? Please help.
java
jsp
webstart
null
null
05/11/2012 15:58:59
not a real question
Difference between JSP and WEBSTART === Friends, Previously i have worked with EJB-WEBSTART CLIENT project, and Now i have joined with project using JSP. I could understand WEBSTART which is a implementation of JNLP and will be responsible for downloading client jars. But Why we need JSP? Why TWO different technology? Which is best at what environment? IS it both work together? Please help.
1
11,462,030
07/12/2012 23:08:37
79,623
03/18/2009 17:05:00
185
9
How to run ANTS memory profiler from the command line
I'm trying to use ANTS memory profiler to monitor the memory consumption while i'm running automated test without luck. I understand that ANTS Memory Profiler wants to be responsible for launching the application. My approach was to create an ANTS memory profiler project that would call my app, and then set ants to autolaunch my app using the following: "C:\Program Files\Red Gate\ANTS Memory Profiler 7\RedGate.MemoryProfiler.UI.exe" /nowizard /startimmediately This come from the only command line docs i could find that is for version 4. I'm running version 7 and these don't work http://www.red-gate.com/supportcenter/content/ANTS_Profiler/help/4.0/AP_startup_parameters if I try running RedGate.MemoryProfiler.UI.exe /help from the command line I just get the app launching. is command line support still in this product? I'm also exploring regular support channels but was hoping someone here might know.
red-gate-ants
null
null
null
null
null
open
How to run ANTS memory profiler from the command line === I'm trying to use ANTS memory profiler to monitor the memory consumption while i'm running automated test without luck. I understand that ANTS Memory Profiler wants to be responsible for launching the application. My approach was to create an ANTS memory profiler project that would call my app, and then set ants to autolaunch my app using the following: "C:\Program Files\Red Gate\ANTS Memory Profiler 7\RedGate.MemoryProfiler.UI.exe" /nowizard /startimmediately This come from the only command line docs i could find that is for version 4. I'm running version 7 and these don't work http://www.red-gate.com/supportcenter/content/ANTS_Profiler/help/4.0/AP_startup_parameters if I try running RedGate.MemoryProfiler.UI.exe /help from the command line I just get the app launching. is command line support still in this product? I'm also exploring regular support channels but was hoping someone here might know.
0
747,879
04/14/2009 14:32:01
72,136
02/28/2009 05:19:19
68
12
New to iphone dev any examples
I got a iphone and i had a idea for a few apps that i wanted to produce Does anyoen have any hits and tips also i would love to see some hello world type apps that would help me getting started
iphone
null
null
null
null
10/28/2011 23:02:53
not a real question
New to iphone dev any examples === I got a iphone and i had a idea for a few apps that i wanted to produce Does anyoen have any hits and tips also i would love to see some hello world type apps that would help me getting started
1
2,782,546
05/06/2010 16:05:02
278,818
02/22/2010 15:54:57
23
0
Working with a Java Mail Server for Testing
I'm in the process of testing an application that takes mail out of a mailbox, performs some action based on the content of that mail, and then sends a response mail depending on the result of the action. I'm looking for a way to write tests for this application. Ideally, I'd like for these tests to bring up their own mail server, push my test emails to a folder on this mail server, and have my application scrape the mail out of the mail server that my test started. Configuring the application to use the mailserver is not difficult, but I do not know where to look for a programatic way of starting a mail server in Java. I've looked at JAMES, but I am unable to figure out how to start the server from within my test. So the question is this: What can I use for a mail server in Java that I can configure and start entirely within Java?
java
email
testing
mail-server
null
null
open
Working with a Java Mail Server for Testing === I'm in the process of testing an application that takes mail out of a mailbox, performs some action based on the content of that mail, and then sends a response mail depending on the result of the action. I'm looking for a way to write tests for this application. Ideally, I'd like for these tests to bring up their own mail server, push my test emails to a folder on this mail server, and have my application scrape the mail out of the mail server that my test started. Configuring the application to use the mailserver is not difficult, but I do not know where to look for a programatic way of starting a mail server in Java. I've looked at JAMES, but I am unable to figure out how to start the server from within my test. So the question is this: What can I use for a mail server in Java that I can configure and start entirely within Java?
0
11,193,492
06/25/2012 16:39:52
79,631
03/18/2009 17:13:15
662
0
how to design sharepoint user form
Hi I am planning to move from access to sharepoint. my requirement is like I have a data entry form in access and my data is getting saved in excel as rows. I want to move to sharepoint where my team can enter the data from SharePoint and getting saved in sharepoint list. How can I achieve this? Do I need to create a user form for this using sharepoint designer.
sharepoint
null
null
null
null
06/25/2012 18:42:43
off topic
how to design sharepoint user form === Hi I am planning to move from access to sharepoint. my requirement is like I have a data entry form in access and my data is getting saved in excel as rows. I want to move to sharepoint where my team can enter the data from SharePoint and getting saved in sharepoint list. How can I achieve this? Do I need to create a user form for this using sharepoint designer.
2
6,854,820
07/28/2011 06:20:59
865,052
07/27/2011 09:33:27
1
0
Hosted PHP CMS - Protect against XSS
I am making a hosted PHP content management system with a WYSIWYG editor. How do I protect against cross-site scripting attacks?
php
content-management-system
xss
xss-prevention
null
07/28/2011 13:43:36
not constructive
Hosted PHP CMS - Protect against XSS === I am making a hosted PHP content management system with a WYSIWYG editor. How do I protect against cross-site scripting attacks?
4
11,607,624
07/23/2012 06:47:16
1,263,490
03/12/2012 07:06:54
154
10
detail study of prototype in js
Consider those codes below: //for extend classes function extend(subClass,superClass){ var F=function(){}; F.prototype=superClass.prototype; subClass.prototype=new F(); subClass.prototype.constructor=subClass; } //basic sender object function Sender(){} Sender.prototype = { ... }; //interface //extend method 1: function BackendAdmin(){} BackendAdmin.prototype.Sender = function(){}; extend(BackendAdmin.Sender,Sender); //will generate prototype of undefined error //extend method 2: function BackendAdmin(){ this.Sender = function(){}; extend(this.Sender,Sender);// Seems can not be extended } // instance var myadmin=new BackendAdmin(); myadmin.Sender.StartLoading(); // do not have method for method 2. In this case, I would like to create a sender instance, which inhire the methods of basic sender class, in BackendAdmin, also, I need to override the method of sender in BackendAdmin if necessary. But, it seems it doesn't work in both cases unless I use something like this: this.sender = new Sender(); How can I use the extend function?
javascript
prototypejs
null
null
null
null
open
detail study of prototype in js === Consider those codes below: //for extend classes function extend(subClass,superClass){ var F=function(){}; F.prototype=superClass.prototype; subClass.prototype=new F(); subClass.prototype.constructor=subClass; } //basic sender object function Sender(){} Sender.prototype = { ... }; //interface //extend method 1: function BackendAdmin(){} BackendAdmin.prototype.Sender = function(){}; extend(BackendAdmin.Sender,Sender); //will generate prototype of undefined error //extend method 2: function BackendAdmin(){ this.Sender = function(){}; extend(this.Sender,Sender);// Seems can not be extended } // instance var myadmin=new BackendAdmin(); myadmin.Sender.StartLoading(); // do not have method for method 2. In this case, I would like to create a sender instance, which inhire the methods of basic sender class, in BackendAdmin, also, I need to override the method of sender in BackendAdmin if necessary. But, it seems it doesn't work in both cases unless I use something like this: this.sender = new Sender(); How can I use the extend function?
0
11,354,301
07/06/2012 00:19:07
1,334,130
04/15/2012 05:07:54
1
0
If statements in java
This may be a simple question but... In java is it possible to check if an integer for example is equal to one or another values without repeating the variables check.. e.g. This should work int n = 0; if ((n == 1) || (n == 2)) { //do stuff } but is it possible to create something like this? int n = 0; if (n == 1 || 0) { //do stuff }
java
null
null
null
null
null
open
If statements in java === This may be a simple question but... In java is it possible to check if an integer for example is equal to one or another values without repeating the variables check.. e.g. This should work int n = 0; if ((n == 1) || (n == 2)) { //do stuff } but is it possible to create something like this? int n = 0; if (n == 1 || 0) { //do stuff }
0
5,950,134
05/10/2011 12:38:55
242,076
01/01/2010 22:53:54
2,050
136
Optimizing this double comparison result for sorting in javascript
Usually while sorting you do: if (x < y) return -1 else if (x > y) return 1 else return 0 or return ((x > y) ? 1 : ((x < y)) ? -1 : 0)) Two comparisons for what seems can be accomplished with only one. In assembly all you have to do is subtract both to a register, check if is negative, check if is zero. The problem is in javascript if we were to subtract: var sub = (x - y); return (sub == 0 ? 0 : ((sub < 0) ? -1 : 1)) This would end up with even more code to be executed. So, some questions: - Is there a way of simplifying or speedying this in javascript? - Can compiled javascript interpretors like chrome's optimize this kind of comparison? - What about other languages?
javascript
optimization
sorting
comparison
null
null
open
Optimizing this double comparison result for sorting in javascript === Usually while sorting you do: if (x < y) return -1 else if (x > y) return 1 else return 0 or return ((x > y) ? 1 : ((x < y)) ? -1 : 0)) Two comparisons for what seems can be accomplished with only one. In assembly all you have to do is subtract both to a register, check if is negative, check if is zero. The problem is in javascript if we were to subtract: var sub = (x - y); return (sub == 0 ? 0 : ((sub < 0) ? -1 : 1)) This would end up with even more code to be executed. So, some questions: - Is there a way of simplifying or speedying this in javascript? - Can compiled javascript interpretors like chrome's optimize this kind of comparison? - What about other languages?
0
6,374,681
06/16/2011 15:46:01
684,514
03/30/2011 18:36:08
17
1
FLVPlayback component and a playpause button - autohide?
I'm using a FLvPlayBack component and I have the skin setting set to none. I've dragged a PlayPauseButton from my library to my stage in a movieclip. The button pauses and plays the video, but now what i want to do is mimic the "autohide" feature in a normal skin. Does anyone know how i might accomplish this?
flash
actionscript-3
null
null
null
null
open
FLVPlayback component and a playpause button - autohide? === I'm using a FLvPlayBack component and I have the skin setting set to none. I've dragged a PlayPauseButton from my library to my stage in a movieclip. The button pauses and plays the video, but now what i want to do is mimic the "autohide" feature in a normal skin. Does anyone know how i might accomplish this?
0
8,859,780
01/14/2012 02:54:29
1,142,321
01/11/2012 04:10:41
9
0
Placing Items in Rails Index in Multiple <div>s
I have a question about CSS and the Rails scaffold index page. I have the default rails index page as follows: ><% @items.each do |item| %> > <tr> > <td><%= item.name %></td> > <td><%= item.votes %></td> > <td><%= item.location %></td> > <td><%= link_to 'Show', item %></td> > <td><%= link_to 'Edit', edit_item_path(item) %></td> > <td><%= link_to 'Destroy', item, confirm: 'Are you sure?', method: :delete %></td> > </tr> > <% end %> At any time, I'm only expecting two items to be passed through to the page. The problem is that I would like the first item placed within a different div then the second, so I can use CSS to change each one individually. Any suggestions?
ruby-on-rails
ruby-on-rails-3.1
null
null
null
null
open
Placing Items in Rails Index in Multiple <div>s === I have a question about CSS and the Rails scaffold index page. I have the default rails index page as follows: ><% @items.each do |item| %> > <tr> > <td><%= item.name %></td> > <td><%= item.votes %></td> > <td><%= item.location %></td> > <td><%= link_to 'Show', item %></td> > <td><%= link_to 'Edit', edit_item_path(item) %></td> > <td><%= link_to 'Destroy', item, confirm: 'Are you sure?', method: :delete %></td> > </tr> > <% end %> At any time, I'm only expecting two items to be passed through to the page. The problem is that I would like the first item placed within a different div then the second, so I can use CSS to change each one individually. Any suggestions?
0
11,032,572
06/14/2012 11:57:34
649,528
03/08/2011 09:02:04
992
72
Implement dot notation Getter/Setter
I have an easy dot notation getter function and I would love to have a setter that works in the same way. Any ideas? var person = { name : { first : 'Peter', last : 'Smith' } }; // --- var dotGet = function(str, obj) { return str.split('.').reduce(function(obj, i) { return obj[i]; }, obj); }; var dotSet = function(str, value, obj) { // ??? // set value // return updated obj // ??? } // returns `Peter` var a = dotGet('person.name.first', person); // should set `person.name.first` to 'Bob' var b = dotSet('person.name.first', 'Bob', person);
javascript
getter-setter
dot-notation
null
null
null
open
Implement dot notation Getter/Setter === I have an easy dot notation getter function and I would love to have a setter that works in the same way. Any ideas? var person = { name : { first : 'Peter', last : 'Smith' } }; // --- var dotGet = function(str, obj) { return str.split('.').reduce(function(obj, i) { return obj[i]; }, obj); }; var dotSet = function(str, value, obj) { // ??? // set value // return updated obj // ??? } // returns `Peter` var a = dotGet('person.name.first', person); // should set `person.name.first` to 'Bob' var b = dotSet('person.name.first', 'Bob', person);
0
11,265,393
06/29/2012 16:16:46
1,474,723
06/22/2012 11:58:16
7
0
php path issue, solution needed
The following code works when I place this script in the root if (file_exists("pics/2012/Blackhall Primary/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } but if I move my script to a folder /teacher/ it no longer works. I thought make the path ~/pics/2012/blackhall primary/ would work but it does. Any ideas? Thanks
php
null
null
null
null
null
open
php path issue, solution needed === The following code works when I place this script in the root if (file_exists("pics/2012/Blackhall Primary/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } but if I move my script to a folder /teacher/ it no longer works. I thought make the path ~/pics/2012/blackhall primary/ would work but it does. Any ideas? Thanks
0
6,231,415
06/03/2011 18:53:58
761,145
05/19/2011 13:24:59
11
0
want to develop an iphone app
I am newbie and wish to develop an iphone application.I was amazed to know that we need to pay $99 to register in order to get xcode and then start creating applications.However, One of my friend suggested to get Xcode for $4.99 at appstore.I want to know whether the xcode + macbook is all I need to build an app or I need to have any other tools. please help
xcode
null
null
null
null
06/03/2011 18:57:04
not a real question
want to develop an iphone app === I am newbie and wish to develop an iphone application.I was amazed to know that we need to pay $99 to register in order to get xcode and then start creating applications.However, One of my friend suggested to get Xcode for $4.99 at appstore.I want to know whether the xcode + macbook is all I need to build an app or I need to have any other tools. please help
1
7,508,227
09/22/2011 00:25:35
221,023
11/29/2009 23:35:32
3,309
11
How to wrap Class into an object?
I need to store a `Class` in NSDictionary. Is there any other way than doing it with NSStringFromClass?
ios
class
wrapper
null
null
null
open
How to wrap Class into an object? === I need to store a `Class` in NSDictionary. Is there any other way than doing it with NSStringFromClass?
0
1,299,540
08/19/2009 12:15:10
115,305
06/01/2009 06:19:23
1,339
120
Any good, new Delphi books?
I've noticed that the number of good Delphi books is slowly going down to zero. Of course, there are plenty of books that explain the basics but good titles like the "Tomes of Delphi" series seem to have stopped. What I am looking for are *recent*, new book titles about Delphi that are useful for Delphi experts, not newbies. There are plenty of older books that are useful but I just wonder if there are still enough authors interested in supporting Delphi. Well, Marco Cantu still seems to publish his Delphi handbooks. But are there more, or is the Delphi book business now officially dead?
delphi
books
null
null
null
09/27/2011 14:57:30
not constructive
Any good, new Delphi books? === I've noticed that the number of good Delphi books is slowly going down to zero. Of course, there are plenty of books that explain the basics but good titles like the "Tomes of Delphi" series seem to have stopped. What I am looking for are *recent*, new book titles about Delphi that are useful for Delphi experts, not newbies. There are plenty of older books that are useful but I just wonder if there are still enough authors interested in supporting Delphi. Well, Marco Cantu still seems to publish his Delphi handbooks. But are there more, or is the Delphi book business now officially dead?
4
9,592,509
03/06/2012 21:52:15
913,071
08/25/2011 22:34:44
40
0
How do I reshape these data in R?
So -- I'm working with a df that's got these groups of repeated observations indexed by an id, like so: id | x1 | x2 | y1 | y2 1 a b c 2 1 a b d 3 1 a b e 4 2 ... 2 ... ... i.e., all the variables within each group are identical, save for y1 and y2 (generally speaking, y2 'modifies' y1.) All these variables that I've listed here are factors. What I'd like to do is to turn each one of these groups into something that resembles the following: id | x1 | x2 | y1' | y2' | y3' 1 a b c-2 d-3 e-4 2 ... where the y1's (y1-prime) are concatenations of adjacent values of y1 and y2, with a dash in between. However, the number of y1's differs from id-group to id-group, but I'd be happy with a very wide data frame that allows for these extras as a solution. Anyhow, I've (rather futilely, I must confess) tried melting and casting these data with reshape2, but at this point, I'm not sure whether I'm not going about this right, or that package just isn't a fit for what I'm trying to do here. Any advice would be appreciated -- thanks!
r
reshape
null
null
null
null
open
How do I reshape these data in R? === So -- I'm working with a df that's got these groups of repeated observations indexed by an id, like so: id | x1 | x2 | y1 | y2 1 a b c 2 1 a b d 3 1 a b e 4 2 ... 2 ... ... i.e., all the variables within each group are identical, save for y1 and y2 (generally speaking, y2 'modifies' y1.) All these variables that I've listed here are factors. What I'd like to do is to turn each one of these groups into something that resembles the following: id | x1 | x2 | y1' | y2' | y3' 1 a b c-2 d-3 e-4 2 ... where the y1's (y1-prime) are concatenations of adjacent values of y1 and y2, with a dash in between. However, the number of y1's differs from id-group to id-group, but I'd be happy with a very wide data frame that allows for these extras as a solution. Anyhow, I've (rather futilely, I must confess) tried melting and casting these data with reshape2, but at this point, I'm not sure whether I'm not going about this right, or that package just isn't a fit for what I'm trying to do here. Any advice would be appreciated -- thanks!
0