unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Turn.js can't seem to center flipbook in browser window
===
Turn.js's autoCenter property changes the margin-left of the #flipbook, in order to keep the _images_ inside the flipbook virtually centered. However, I want the flipbook centered within my _browser_, but autoCenter affects putting margin: 0 auto; on the #flipbook.
Is there any way I can make both the flipbook centered in the browser window, _and_ have the autoCenter property turned on so that I don't have to write the double-page view autoCenter'ing functionality myself with JavaScript? | 0 | [
2,
805,
9,
728,
18,
92,
22,
38,
2260,
20,
459,
8805,
5199,
19,
16495,
1463,
800,
3726,
3726,
805,
9,
728,
18,
22,
18,
3108,
12641,
1354,
1693,
14,
5440,
8,
9742,
16,
14,
6926,
410,
6013,
5199,
15,
19,
389,
20,
643,
14,
13,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Extract Url using Regex
===
I've been searching for at least 2hrs but I can't find any pattern to extract following Urls using regex. I went with too many patterns which described in many articles. But I couldn't find something useful.
http://google.com
http://www.google.com
http://www.image.google.com
http://google.com:8080
http://google.com:8080/default.aspx?param=1
http://google.com/default.aspx?param=1¶m1=2
And any Url pattern you guess.
Please, Any advice will be helpful.
| 0 | [
2,
10962,
287,
6362,
568,
7953,
1706,
800,
3726,
3726,
31,
22,
195,
74,
5792,
26,
35,
639,
172,
3112,
18,
47,
31,
92,
22,
38,
477,
186,
3732,
20,
10962,
249,
13,
911,
7532,
568,
7953,
1706,
9,
31,
296,
29,
266,
151,
6282,
56,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sax-parser from head first Android doesn't retrieve image from rss
===
I'm following a guid in Head First Android Development, and I cant seem to get this part right. The code is supposed to get a image with title and description from a Nasa RSS, but it does not retrieve the image. Any help would be awesome :)
package com.olshausen.nasadailyimage;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
import android.os.Bundle;
import android.widget.ImageView;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.Menu;
import android.widget.TextView;
public class DailyImage extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_daily_image);
IotdHandler handler = new IotdHandler ();
handler.processFeed();
resetDisplay (handler.getTitle(), handler.getDate(), handler.getImage(), handler.getDescription());
}
public class IotdHandler extends DefaultHandler {
private String url = "http://www.nasa.gov/rss/image_of_the_day.rss";
private boolean inUrl = false;
private boolean inTitle = false;
private boolean inDescription = false;
private boolean inItem = false;
private boolean inDate = false;
private Bitmap image = null;
private String title = null;
private StringBuffer description = new StringBuffer();
private String date = null;
public void processFeed() {
try {
SAXParserFactory factory =
SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
XMLReader reader = parser.getXMLReader();
reader.setContentHandler(this);
InputStream inputStream = new URL(url).openStream();
reader.parse(new InputSource(inputStream));
} catch (Exception e) { }
}
private Bitmap getBitmap(String url) {
try {
HttpURLConnection connection = (HttpURLConnection)new URL(url).openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap bilde = BitmapFactory.decodeStream(input);
input.close();
return bilde;
} catch (IOException ioe) { return null; }
}
public void startElement(String url, String localName, String qName, Attributes attributes) throws SAXException {
if (localName.endsWith(".jpg")) { inUrl = true; }
else { inUrl = false; }
if (localName.startsWith("item")) { inItem = true; }
else if (inItem) {
if (localName.equals("title")) { inTitle = true; }
else { inTitle = false; }
if (localName.equals("description")) { inDescription = true; }
else { inDescription = false; }
if (localName.equals("pubDate")) { inDate = true; }
else { inDate = false; }
}
}
public void characters(char ch[], int start, int length) { String chars = new String(ch).substring(start, start + length);
if (inUrl && url == null) { image = getBitmap(chars); }
if (inTitle && title == null) { title = chars; }
if (inDescription) { description.append(chars); }
if (inDate && date == null) { date = chars; }
}
public Bitmap getImage() { return image; }
public String getTitle() { return title; }
public StringBuffer getDescription() { return description; }
public String getDate() { return date; }
}
private void resetDisplay (String title, String date, Bitmap image, StringBuffer description) {
TextView titleView = (TextView) findViewById (R.id.image_title);
titleView.setText(title);
TextView dateView = (TextView) findViewById(R.id.image_date);
dateView.setText(date);
ImageView imageView = (ImageView) findViewById (R.id.image_display);
imageView.setImageBitmap(image);
TextView descriptionView = (TextView) findViewById (R.id.image_description);
descriptionView.setText(description);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_daily_image, menu);
return true;
}
}
I must honestly say that I copied most of this code without checking it, the parser was "ready bake code", so its not really what is supposed to be tought in this chapter :)
| 0 | [
2,
16070,
8,
3574,
4104,
37,
157,
64,
13005,
1437,
22,
38,
11917,
1961,
37,
13,
1224,
18,
800,
3726,
3726,
31,
22,
79,
249,
21,
9457,
43,
19,
157,
64,
13005,
522,
15,
17,
31,
2973,
2260,
20,
164,
48,
141,
193,
9,
14,
1797,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Getting statuses and wall pictures through single Graph API call
===
I'm accessing the Facebook API through the JavaScript API and need the users statuses and wall photos. I'm getting the statuses through /me/statuses, but I do not really have a clue how to include the picture statuses instead of merging the data with the pictures that can be found in the album "Wall Photos". It would be great if that would work with a single request to enable proper pagination. | 0 | [
2,
1017,
1782,
160,
17,
769,
3104,
120,
345,
7210,
21,
2159,
645,
800,
3726,
3726,
31,
22,
79,
1381,
68,
14,
9090,
21,
2159,
120,
14,
8247,
8741,
21,
2159,
17,
376,
14,
3878,
1782,
160,
17,
769,
7064,
9,
31,
22,
79,
1017,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Integrating multimedia with LibGDX
===
According to the LibGDX web page:
> Android applications can have multiple activities. Libgdx games should usually only consist of a single activity. Different screens of the game are implemented within libgdx, not as separate activities. The reason for this is that creating a new Activity also implies creating a new OpenGL context, which is time consuming and also means that all graphical resources have to be reloaded.
However, this isn't impossible to do - just undesirable.
I'm building an app that is designed to hold a few games built in LibGDX, as well as some information alongside it - video/audio, text with illustrations, and so on, describing the development of the games.
Is it a better idea to build this as a native android application that launches and tears down LibGDX whenever the user wants to play a game? Or should I write the entire app through LibGDX and do try and do the non-game stuff using UI libraries and so on?
I'm sorry I can't nail this down to a more specific question. I'm really interested to know before I embark down the wrong road. | 0 | [
2,
24529,
17090,
29,
13,
8326,
263,
43,
396,
800,
3726,
3726,
496,
20,
14,
13,
8326,
263,
43,
396,
2741,
2478,
45,
13,
1,
13005,
3767,
92,
57,
1886,
1648,
9,
13,
8326,
263,
43,
396,
466,
378,
951,
104,
7929,
16,
21,
345,
2358,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Activity of Tabactivity didn't get destroy properly
===
So I have a Tabhost that host activity A.
And the flow work like this:
activity A-->activity B(finish)-->activity C(finish) and it will go back to activity A since both B and C finished.
When I was in activity A, and I press Back button, both activity A and Tabhost destroyed properly. But When I finished from actB or actC, and then press Back button on Activity A, both activity A and TabHost are not destroyed.
Anyone know why?? | 0 | [
2,
2358,
16,
6523,
19348,
223,
22,
38,
164,
4407,
7428,
800,
3726,
3726,
86,
31,
57,
21,
6523,
11694,
30,
2015,
2358,
21,
9,
17,
14,
3312,
170,
101,
48,
45,
2358,
21,
8,
8,
1,
19348,
334,
5,
23858,
6,
8,
8,
1,
19348,
272,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MySQL INSERT INTO doesn't do anything - not even error
===
I have this query:
mysql_query("INSERT INTO `63_Activity` (`username`, `time`) VALUES (`$usernann2`, `$date`)");
However, it doesn't do anything. Even when I tried correcting the variables to
". $variable ."
I checked the variables.
I copied the little line of code from somewhere it works.
The database and tables are existing.
I just thought I had things under control, then that happened -.-
Thank you in advance.
PS: I tried adding or die() - but no error. Nothing. | 0 | [
2,
51,
18,
22402,
14692,
77,
1437,
22,
38,
107,
602,
13,
8,
52,
166,
7019,
800,
3726,
3726,
31,
57,
48,
25597,
45,
51,
18,
22402,
1,
8190,
93,
5,
7,
108,
18,
6767,
77,
13,
1,
3891,
1,
19348,
1,
13,
5,
1,
16704,
7259,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Setting the border color of text boxes on the form
===
I want to set all text boxes border color on the form to red. I tried using
$('*').css('border', 'black');
also
var all = document.getElementsByTagName('*');
for(var i=0;i<all.length;i++)
{
all[i].style.backgroundColor = "Red";
}
Nothing is working for me.
In the CSS file all text boxes
input[type=text], .htmlplusinput {
border: 1px solid #C79988;
padding:1px;
width:120px;
cursor: text;
}
input[type=text]:focus, .htmlplusinput:focus {
border:2px solid #25a3fc;
padding:0px;
} | 0 | [
2,
2697,
14,
1862,
1665,
16,
1854,
8120,
27,
14,
505,
800,
3726,
3726,
31,
259,
20,
309,
65,
1854,
8120,
1862,
1665,
27,
14,
505,
20,
402,
9,
31,
794,
568,
5579,
5,
22,
2483,
22,
6,
9,
6824,
18,
5,
22,
24389,
22,
15,
13,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
android accesses database server without wireless
===
So I need to develop an android application with a SQL_Lite db. Several times a week there must be a synchronisation between androids DB and a MySql BD located on WAMP server.
The condition is that this sync must be done when the android device is docked to a "docking station".
How can I transfer data from my android application to mysql DB without using the wireless option?
Thank you for your suggestions | 0 | [
2,
13005,
1381,
160,
6018,
8128,
366,
10149,
800,
3726,
3726,
86,
31,
376,
20,
2803,
40,
13005,
3010,
29,
21,
4444,
255,
1,
10601,
13,
9007,
9,
238,
436,
21,
877,
80,
491,
44,
21,
13,
16023,
4330,
128,
13005,
18,
13,
9007,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to formulate this C# control?
===
I want to get a string (str) by using below statements, it works but any suggestions to formulate this control?
because count can be "n".
if (a.count== 0)
{
str += a.Name;
}
else if (a.count== 1)
{
str += a.Parent.Name + "/" + a.Name;
}
else if (a.count== 2)
{
str += a.Parent.Parent.Name + "/" + a.Parent.Name + "/" + a.Name;
}
else if (a.count== 3)
{
str += a.Parent.Parent.Parent.Name + "/" +a.Parent.Parent.Name + "/" + a.Parent.Name + "/" + a.Name;
}
.
.
.
else if(a.count = n)
{
//n times..
}
| 2 | [
2,
184,
20,
3729,
591,
48,
272,
5910,
569,
60,
800,
3726,
3726,
31,
259,
20,
164,
21,
3724,
13,
5,
9729,
6,
34,
568,
1021,
9015,
15,
32,
693,
47,
186,
18389,
20,
3729,
591,
48,
569,
60,
185,
2468,
92,
44,
13,
7,
103,
7,
9,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
call server side method on jquery price slider event which change the datasource of repater control
===
i am trying to filter results based on user price range selection . so i choose the jquery slider for showing range of price. and i have decided to call web method using jquery `ajax` on slider `stop event` .
everything is fine at this stage .here is code for my web method which filter the records basis on min and max range passed by jquery `ajax` call
[WebMethod]
public static void FilterByPrice(double min,double max)
{
List<BALHotelList> searchresult =(List<BALHotelList>) HttpContext.Current.Session["searchresult"];
searchresult = searchresult.Where(t => (double)t.totalPrice >= min && (double)t.totalPrice <= max).ToList();
HttpContext.Current.Session["searchresult"] = searchresult;
SearchResult s = new SearchResult();
s.Paging();
}
Now problem is with `Paging` method which is used to set the `datasource` of repeater control . Paging method as follow :
protected void Paging()
{
List<BALHotelList> searchresult = (List<BALHotelList>)Session["searchresult"];
PagedDataSource objPds = new PagedDataSource();
objPds.DataSource = searchresult;
objPds.AllowPaging = true;
objPds.PageSize = Convert.ToInt32(ddlPageNo.SelectedValue);
objPds.CurrentPageIndex = CurrentPage;
lblCurrentPage.Text = "Page: " + (CurrentPage + 1).ToString() + " of "
+ objPds.PageCount.ToString();
// Disable Prev or Next buttons if necessary
cmdPrev.Enabled = !objPds.IsFirstPage;
cmdNext.Enabled = !objPds.IsLastPage;
rptHotels.DataSource = objPds;
rptHotels.DataBind();
}
when this method is called its through error that **object reference not set** . I understand that this time page controls can not be accessed. as i read some answers which are deny completely this [issue regarding access page control][1]
Now i want to know what approach should i use to complete my task which is
**use jquery price slider to filter the records ?**
[1]: http://stackoverflow.com/questions/10914336/issue-regarding-access-page-control-from-static-method-asp-net-4-0 | 0 | [
2,
645,
8128,
270,
2109,
27,
487,
8190,
93,
2162,
3295,
106,
807,
56,
753,
14,
1054,
12097,
16,
302,
5972,
106,
569,
800,
3726,
3726,
31,
589,
749,
20,
11945,
1736,
432,
27,
4155,
2162,
978,
3155,
13,
9,
86,
31,
3538,
14,
487,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
mysql query with group by and order
===
table structure:
country
season
points
current query
"SELECT SUM(points) AS total, country FROM table WHERE season>=X GROUP BY country ORDER BY total desc"
This gives me a nice list ordered by a total points collected by a given country. BUT, if a country is tied with another country, I want to sort by their points in the latest season given, is that possible within the same query? And if so, how? (Remember its grouped at the moment) | 0 | [
2,
51,
18,
22402,
25597,
29,
214,
34,
17,
389,
800,
3726,
3726,
859,
1411,
45,
475,
198,
819,
866,
25597,
13,
7,
18,
16964,
3907,
5,
3132,
18,
6,
28,
600,
15,
475,
37,
859,
113,
198,
1,
3726,
396,
214,
34,
475,
389,
34,
600,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to calculate and change treeview with
===
How to let the treeview to change its width when expanding node so that the label of node will completely show. | 0 | [
2,
184,
20,
18469,
17,
753,
1541,
4725,
29,
800,
3726,
3726,
184,
20,
408,
14,
1541,
4725,
20,
753,
82,
9456,
76,
9393,
15421,
86,
30,
14,
1899,
16,
15421,
129,
1524,
298,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Excel columns of several worksheets - copy, sort, hyperlink
===
Need some help with the following:
I have several worksheets with the same structure and within each worksheet I have two columns (let's call them X & Y) that I need to copy with their cellvalues (letter-number combination) and also copy the values of Column A-F to an own sheet for X and Y.
On the "new" sheet I want to put X/Y to column A sort the values after A and attach a constant hyperlink to each cellvalue in A.
So X or Y goes to A and A-F to B-G.
Then I want to make column F or the new G clickable so that it will take me to the row in the according worksheet.
X and Y don't always happen to be in column X or Y but I think this can be solved with a "name search".
When I execute my code then for example worksheet3 will overwrite the values of worksheet1 and my hyperlink structure is wrong too. The sorting is left out since that is working.
Function CopyAndSort(ByRef mySheet As Worksheet)
' If mySheet.Name <> "Sheet1" Then
' Exit Function
' End If
mySheet.Activate
Set sheetCS = Sheets("CopyAndSort Sheet")
sheetCS.Range("A:A").Value = ""
lastRowCS = Range("X:X").Cells.Find("*", , , , , xlPrevious).Row
rowNumber = 1
For rowCopy = 5 To lastRowFO
sheetCopy = Range("BE" & rowCopy)
If Trim(sheetCopy) <> "" Then
sheetCopy = Replace(sheetCopy, """", "")
If InStr(1, sheetCopy, ",", vbTextCompare) <> 0 Then
sheetCopyArray = Split(sheetCopy, ",")
Else
sheetCopyArray = Array(sheetCopy)
End If
For Each copy In sheetCopyArray
rowNumber = rowNumber + 1
copy_Value = copy
' test for url
' sheetCS.Cells(rowNumber, 1).Formula = "=HYPERLINK(""ConstURL & copyValue"")"
sheetCS.Cells(rowNumber, 1) = copy_Value
copy_Value = Cells(rowCopy, 1)
sheetCS.Cells(rowNumber, 2) = copy_Value
copy_Value = Cells(rowCopy, 2)
sheetCS.Cells(rowNumber, 3) = copy_Value
copy_Value = Cells(rowCopy, 3)
sheetCS.Cells(rowNumber, 4) = copy_Value
copy_Value = Cells(rowCopy, 4)
sheetCS.Cells(rowNumber, 5) = copy_Value
copy_Value = Cells(rowCopy, 5)
sheetCS.Cells(rowNumber, 6) = copy_Value
Next
End If
Next
So how can I manage to not overwrite the values and attach the correct hyperlink syntax, plus making colum G clickable?
And can I use one function for X and Y?
Some code examples would help me alot.
Thank you. | 0 | [
2,
20700,
7498,
16,
238,
170,
17627,
18,
13,
8,
4344,
15,
2058,
15,
5443,
6258,
800,
3726,
3726,
376,
109,
448,
29,
14,
249,
45,
31,
57,
238,
170,
17627,
18,
29,
14,
205,
1411,
17,
363,
206,
170,
17627,
31,
57,
81,
7498,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NullPointerException: SetOnClickListener in Fragment Class
===
I facing a problem when i add setOnClickListener for ImageView in the Fragment Class. The error occur when i click on the ImageView due to NullPointerException.
Below is my code:
public final class TestFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ImageView image = new ImageView(getActivity());
image.setTag(mContent);
image.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
HomeActivity h = new HomeActivity();
String url = h.getEventUrl();
Intent childClass = new Intent(getActivity(), HomeEventDetailActivity.class);
childClass.putExtra("eventUrl",url);
TabGroupActivity parentActivity = (TabGroupActivity)h.getParent();
parentActivity.startChildActivity("Child_Main1", childClass);
}
});
imageManager.displayImage(mContent, image, R.drawable.icon);
image.setScaleType(ScaleType.FIT_XY);
LinearLayout layout = new LinearLayout(getActivity());
layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
layout.setGravity(Gravity.CENTER);
layout.addView(image);
return layout;
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(KEY_CONTENT, mContent);
setUserVisibleHint(true);
}
}
Please HELP!!!! | 0 | [
2,
16203,
3132,
106,
10066,
872,
45,
309,
218,
150,
10129,
13891,
106,
19,
14847,
718,
800,
3726,
3726,
31,
4325,
21,
1448,
76,
31,
3547,
309,
218,
150,
10129,
13891,
106,
26,
1961,
4725,
19,
14,
14847,
718,
9,
14,
7019,
3744,
76,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Disable keyboard animation on pushViewController?
===
Is it possible to disable the keyboard animation on `pushViewController` so that the keyboard slides off with the rest of the screen (instead of sliding down while the rest of the screen slides off)?
I currently call `[[self view] endEditing: YES]` in `- (void)viewWillDisappear:(BOOL)animated` which is causing the keyboard to slide down. I don't know of a way around this. | 0 | [
2,
1460,
579,
8896,
6236,
27,
3250,
4725,
12898,
1252,
60,
800,
3726,
3726,
25,
32,
938,
20,
1460,
579,
14,
8896,
6236,
27,
13,
1,
26973,
4725,
12898,
1252,
1,
86,
30,
14,
8896,
18066,
168,
29,
14,
760,
16,
14,
2324,
13,
5,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Accessing lists.asmx from silverlight
===
We are using following steps to get data from Sharepoint list i.e. Lists.asmx.
1. Added WCF service in "SPBirthdayWebPart.Web".
2. Added Web Reference for Share point list i.e. Lists.asmx in "SPBirthdayWebPart.Web" project
3. We have used this web reference in WCF service to get the data from Lists.asmx.
3. Then added service reference in "SPBirthdayWebPart" for WCF service.
4. Then hosted the "SPBirthdayWebPart.Web" on server IIS.
This is perfectly working on our local envioronment.
We have proper "clientaccesspolicy.xml" and "crossdomain.xml" in the root folder.
End point address is also of hosted web service address.
But while accessing the same from server it gives us following error:
Timestamp: 7/12/2012 4:22:18 PM
Error: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at SPBirthdayWebPart.ServiceReference1.GetListCompletedEventArgs.get_Result()
at SPBirthdayWebPart.MainPage.Completed_List(Object sender, GetListCompletedEventArgs e)
at SPBirthdayWebPart.ServiceReference1.Service1Client.OnGetListCompleted(Object state)
Can anyone guide on this?
Thanks,
Hemant. | 0 | [
2,
1381,
68,
7227,
9,
472,
79,
396,
37,
1172,
3130,
800,
3726,
3726,
95,
50,
568,
249,
2382,
20,
164,
1054,
37,
1891,
3132,
968,
31,
9,
62,
9,
7227,
9,
472,
79,
396,
9,
137,
9,
905,
11801,
410,
365,
19,
13,
7,
3401,
21587,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java Desktop Class with Apache Wicket
===
I have written a Java program that is now web integrated using Apache Wicket and HTML.
Now I wanted to write an Email Function with the Desktop Library. I dont seem to get it working though. Does anyone know if the Desktop will work if I am using Wicket as well? | 0 | [
2,
8247,
17404,
718,
29,
17140,
14414,
800,
3726,
3726,
31,
57,
642,
21,
8247,
625,
30,
25,
130,
2741,
5547,
568,
17140,
14414,
17,
13,
15895,
9,
130,
31,
417,
20,
2757,
40,
8517,
1990,
29,
14,
17404,
1248,
9,
31,
1049,
2260,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SFML 1.6 Linker errors with xcode
===
I have downgraded , upgraded, reinstalled xcode and i keep getting these issue:
class sf::RenderWindow has no member named "IsOpened"
and 7 other errors that all seem to be linked to the linker not being able to find anything to do with sfml frameworks. I have just used a sfml 1.6 template for xcode 3 and it works just fine on xcode 3, but then when i open the project on xcode 4, it fails.
Can anyone help on this issue? | 0 | [
2,
15025,
8184,
137,
9,
379,
3508,
106,
11908,
29,
993,
9375,
800,
3726,
3726,
31,
57,
125,
8031,
43,
13,
15,
9958,
15,
7102,
21300,
69,
993,
9375,
17,
31,
643,
1017,
158,
1513,
45,
718,
15025,
45,
45,
99,
16706,
27508,
63,
90,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
httprequest fails on "external get"
===
Im trying to make a webapplication which gets an image and stores it to my device.
Then it needs to use the picture as an link to another page.
i receive a success if i try it on my local machine (the webservice). but when i put i to my domain (same code+tested with advanced rest client) then it fails.
I tried making an appcache file, and under NETWORK write * or my domain name:
Here is my code for the httprequest (**javascript**):
var startUrl = "http://localhost:8080";
function getStuff(theUrl){
startUrl = "http://mobilitycms.lector.dk:9090";
alert(startUrl+theUrl);
$(document).ready(function() {
$.ajax({
url: startUrl+theUrl,
type: 'GET',
dataType: 'json',
success: function(data) {
alert('success');
createMainMenu(data);
alert('new cursor created:' + cursor);
/* $.each(data.list, function(i, object) {
alert(i+"="+object);
var array = new Array();
for (property in object) {
var value = object[property];
alert(property + "=" + value);
}
});*/
},
error: function() {
alert('boo!');
},
beforeSend: setHeader
});
});
}
function setHeader(xhr) {
xhr.setRequestHeader('app', '1');
}
**html**
<div data-role="page" id="first">
<div data-role="header">
<a href="#" data-rel="back" data-role="button" ><img align="middle"src="images/back.png" alt="beskeder" vspace="2"/></a>
<h1><img onclick="getStuff('/product/5')" align="middle"src="images/main_header.png" alt="beskeder" vspace="2"/></h1>
</div><!-- /header -->
<div data-role="content" id="firstPageContent">
<p>I'm first in the source order so I'm shown as the page.</p>
<p>View internal page called <a href="#second">second</a></p>
<a href="#second" id="mapLink" name="mapLink"><img id="mapLinkImage" alt="a map which links to the mapPage" src="images/beskeder.png"/></a>
<Button id="loadButton" onClick="load()"/>
</div><!-- /content -->
</div><!-- /page -->
Why does it fail?
Ps. If anyone have some good guides/Patterns about this kind of "webapp" then it's most welcomed as well, since im new to this js/webapp development. | 0 | [
2,
7775,
99,
10351,
13614,
27,
13,
7,
1706,
8766,
192,
164,
7,
800,
3726,
3726,
797,
749,
20,
233,
21,
2741,
2552,
20669,
56,
3049,
40,
1961,
17,
4134,
32,
20,
51,
3646,
9,
94,
32,
2274,
20,
275,
14,
2151,
28,
40,
3508,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a quick way to add gettext() calls to strings in PyDev?
===
Is there a quick way to add a `gettext()` call to a literal string in the PyDev editor under running under Eclipse? I.e. when I place the cursor on any literal `'string'` in a Python file, I want to turn this into `_('string')` with a single keypress. Can I use macros or something like that to add such functions? | 0 | [
2,
25,
80,
21,
2231,
161,
20,
3547,
164,
11969,
5,
6,
3029,
20,
7887,
19,
7103,
14438,
60,
800,
3726,
3726,
25,
80,
21,
2231,
161,
20,
3547,
21,
13,
1,
3060,
11969,
5,
6,
1,
645,
20,
21,
20665,
3724,
19,
14,
7103,
14438,
183... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Derivatives in Java?
===
Im making a calculator app for Android, and a user requested for a derivatives calculator. Is there any preloaded function or a custom method available? Thanks. | 0 | [
2,
19527,
19,
8247,
60,
800,
3726,
3726,
797,
544,
21,
28539,
4865,
26,
13005,
15,
17,
21,
4155,
6602,
26,
21,
19527,
28539,
9,
25,
80,
186,
782,
22546,
1990,
54,
21,
5816,
2109,
904,
60,
3669,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Android How to setWeight of a RemoteView?
===
I need to know the code that allow me to set the Weight of a RemoteView.
I tried with this code but this doesn't work:
RemoteViews remoteViews = new RemoteViews(c.getPackageName(), R.layout.notification);
remoteViews.setInt(R.id.ll_notification, "setWeight", 12);
There is a way to do this?
Many thanks....
| 0 | [
2,
13005,
184,
20,
309,
8696,
16,
21,
5388,
4725,
60,
800,
3726,
3726,
31,
376,
20,
143,
14,
1797,
30,
1655,
55,
20,
309,
14,
1763,
16,
21,
5388,
4725,
9,
31,
794,
29,
48,
1797,
47,
48,
1437,
22,
38,
170,
45,
5388,
4725,
18,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ActiveRecord #increment! returns false, but no errors
===
Here's a piece of code in my controller:
@post.increment!(:views_count) # => false, record not saved, views_count is 0
@post.errors # => is empty
@post.save! # => true, views_count magically incremented to 1
The problem is, that without #save! it doesn't really work: record is not updated, views_count is 0. Any ideas? | 0 | [
2,
1348,
14953,
6926,
28461,
187,
4815,
4997,
15,
47,
90,
11908,
800,
3726,
3726,
235,
22,
18,
21,
1855,
16,
1797,
19,
51,
9919,
45,
13,
1,
6962,
9,
28461,
187,
5,
45,
4725,
18,
1,
16549,
6,
6926,
800,
1,
4997,
15,
571,
52,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error 14 The type or namespace name 'Document' could not be found (are you missing a using directive or an assembly reference?)
===
Document document = new Document();
MemoryStream stream = new MemoryStream();
try
{
PdfWriter pdfWriter = PdfWriter.GetInstance(document, stream);
pdfWriter.CloseStream = false;
document.Open();
document.Add(new Paragraph("Hello World"));
}
catch (DocumentException de)
{
Console.Error.WriteLine(de.Message);
}
catch (IOException ioe)
{
Console.Error.WriteLine(ioe.Message);
}
document.Close();
stream.Flush(); //Always catches me out
stream.Position = 0; //Not sure if this is required
return File(stream, "application/pdf");
i got the same error for pdf writer and Paragraph | 0 | [
2,
7019,
513,
14,
1001,
54,
204,
5582,
204,
13,
22,
28132,
22,
110,
52,
44,
216,
13,
5,
1509,
42,
2863,
21,
568,
15626,
54,
40,
1475,
2801,
60,
6,
800,
3726,
3726,
4492,
4492,
800,
78,
4492,
5,
6,
73,
1912,
11260,
3766,
800,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Game Center Invitation handler, Where does it belong?
===
I already searched the site and found this:
http://stackoverflow.com/questions/4639284/gamecenter-invitation-handler
He says:
"
> As stated in the docs
>
> Your application should set the
> invitation handler as early as
> possible after your application is
> launched; an appropriate place to set
> the handler is in the completion block
> you provided that executes after the
> local player is authenticated.
"
.. OK, that's cool, but!
I would like Authenticate the player ONLY if an invitation was received .. Example:
Scenarios:
The player launches the game, plays single player mode, exits the game. [No Game center authentication].
The player accepts an invite, the game launches, invitation handler receives an invitation notification, authenticates the player, game starts.
The player chooses an online game, Game center authenticates the player.
..
So, My point is, I don't want to authenticate the player unnecessarily .. if possible. Which leads to the question, where should I place the invitation handler code? Obviously not after the authentication, since, as I already said, I don't want to authenticate the player unnecessarily ...
Thanks =) | 0 | [
2,
250,
459,
7470,
24641,
15,
113,
630,
32,
6219,
60,
800,
3726,
3726,
31,
614,
9036,
14,
689,
17,
216,
48,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
3516,
3412,
25110,
118,
5128,
12641,
8,
108,
8901,
857,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Guard executes shell scripts twice
===
I setup an example project with the following structure:
Gemfile
Guardfile
The contents of these files are:
# Gemfile
source :rubygems
gem "guard"
gem "guard-shell"
and
# Guardfile
guard 'shell' do
watch(/^test\.txt$/) {|m| `echo #{m.inspect} #{File.mtime(m[0])}` }
end
I then continue to run `guard`. Whenever I echo something into that file, guard registers a change twice. In one shell:
$ echo blah >> test.txt
In the shell running guard:
> [test.txt] 2012-06-26 00:40:22 +0200
> [test.txt] 2012-06-26 00:40:22 +0200
The same behaviour accounts for vim/nano etc. Interestingly, when I just run `echo blah > test.txt`, guard only fires once.
Any idea how I can prevent this from happening or whether this is expected behaviour?
| 0 | [
2,
1611,
15644,
18,
3593,
17505,
2088,
800,
3726,
3726,
31,
18161,
40,
823,
669,
29,
14,
249,
1411,
45,
8551,
16877,
1611,
16877,
14,
8478,
16,
158,
6488,
50,
45,
6926,
8551,
16877,
1267,
13,
45,
1820,
779,
20231,
18,
8551,
13,
7,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Moving to OpenGL 2.0, getting a black screen
===
I'm trying to modernize my OpenGL code a little bit by bringing it to OpenGL 2.0 time, but all I get is a black screen... perhaps someone spots a mistake in my code (not that much of code).
Here is a snip of the relevant bits of my old, fully working code.
// Send color data into GPU memory
glEnableClientState(GL_COLOR_ARRAY);
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, colorsHandle);
GL15.glBufferData(GL15.GL_ARRAY_BUFFER, colors, GL15.GL_DYNAMIC_DRAW);
glColorPointer(4, GL_FLOAT, 0, 0);
// Send vertex data into GPU memory
glEnableClientState(GL_VERTEX_ARRAY);
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, verticesHandle);
GL15.glBufferData(GL15.GL_ARRAY_BUFFER, GL15.GL_DYNAMIC_DRAW);
glVertexPointer(3, GL_FLOAT, 0, 0);
// Send texcoords data into GPU memory
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, texcoordsHandle);
GL15.glBufferData(GL15.GL_ARRAY_BUFFER, GL15.GL_DYNAMIC_DRAW);
glTexCoordPointer(2, GL_FLOAT, 0, 0);
for (Batch batch : batches) batch.render();
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
... batch calls glDrawArrays (amongst doing some opengl state changes) ...
glDrawArrays(GL_QUADS, spriteOffset * 4, spriteCount * 4);
And here is the new code:
// Send color data into GPU memory
GL20.glEnableVertexAttribArray(0);
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, colorsHandle);
GL15.glBufferData(GL15.GL_ARRAY_BUFFER, colors, GL15.GL_DYNAMIC_DRAW);
GL20.glVertexAttribPointer(0, 4, GL_FLOAT, false, 0, 0);
// Send vertex data into GPU memory
GL20.glEnableVertexAttribArray(1);
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, verticesHandle);
GL15.glBufferData(GL15.GL_ARRAY_BUFFER, vertices, GL15.GL_DYNAMIC_DRAW);
GL20.glVertexAttribPointer(1, 3, GL_FLOAT, false, 0, 0);
// Send texcoords data into GPU memory
GL20.glEnableVertexAttribArray(2);
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, texcoordsHandle);
GL15.glBufferData(GL15.GL_ARRAY_BUFFER, texcoords,GL15.GL_DYNAMIC_DRAW);
GL20.glVertexAttribPointer(2, 2, GL_FLOAT, false, 0, 0);
for (Batch batch : batches) batch.render();
GL20.glDisableVertexAttribArray(0);
GL20.glDisableVertexAttribArray(1);
GL20.glDisableVertexAttribArray(2);
Like I said the first bit of code works perfectly, but the second does not draw anything at all. Those are the only lines of code I changed in my renderer, and they look correct to me. But obviously there is a problem somewhere... What could possibly cause the absence of rendering? | 0 | [
2,
1219,
20,
368,
8430,
172,
9,
387,
15,
1017,
21,
319,
2324,
800,
3726,
3726,
31,
22,
79,
749,
20,
773,
2952,
51,
368,
8430,
1797,
21,
265,
1142,
34,
3657,
32,
20,
368,
8430,
172,
9,
387,
85,
15,
47,
65,
31,
164,
25,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I get a width/height of Dialog with FILL_PARENT layout?
===
I have an activity with
android:theme="@android:style/Theme.Dialog"
to show it as float window. Also I have a line
getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
And I need a width/height of this window to show content correctly.
I've tested four options and did not get an answer:
//1
int width = getWindowManager().getDefaultDisplay().getWidth();
//2
int width = getWindow().getDecorView().getWidth();
//3
getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
//4
int width = getWindow().getAttributes().width;
Thanks!
| 0 | [
2,
184,
92,
31,
164,
21,
9456,
118,
252,
7748,
16,
28223,
29,
3509,
1,
18908,
9106,
60,
800,
3726,
3726,
31,
57,
40,
2358,
29,
13005,
45,
124,
790,
3726,
7,
1,
290,
18524,
45,
4381,
118,
124,
790,
9,
4286,
5567,
7,
20,
298,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jQuery Sortable - View Order by ID
===
I know that there are currently questions on SO already pertaining to saving jQuery sortable lists to a database. How can I query my 2 tables, grab the "order" string, and then display the sortable list in the correct order. My tables are:
Table name: clothing_category
id name order
-----------------------------------------
5 Headwear 29,22,26
And:
Table name: clothing_type
id name clothing_id (relational with to 'clothing_category')
-----------------------------------------
22 Hat 5
26 Beanie 5
29 Visor 5
So, seeing as how the "order" of headwear is stored as `29,22,26', I would want the HTML to output like this:
<ul id="sortable">
<li id="29">Visor</li>
<li id="22">Hat</li>
<li id="26">Beanie</li>
</ul>
How can I achieve this? And is my method of storing the order a good way to do this? | 0 | [
2,
487,
8190,
93,
2058,
579,
13,
8,
1418,
389,
34,
4924,
800,
3726,
3726,
31,
143,
30,
80,
50,
871,
2346,
27,
86,
614,
22561,
20,
7599,
487,
8190,
93,
2058,
579,
7227,
20,
21,
6018,
9,
184,
92,
31,
25597,
51,
172,
7484,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Python 3.2 Tic Tac Toe Game Replay?
===
i programmed a tic tac toe game in python and it works perfectly fine and everything. so i was wondering, can you somehow program the game to say, "Do you wish to play again?" after the computer wins or if you win? in my game, once the computer wins or you win, it doesn't say anything and i want the game to ask the player if they want to play again. gracias(: | 1 | [
2,
20059,
203,
9,
135,
13,
1786,
13,
6981,
20,
62,
250,
13942,
60,
800,
3726,
3726,
31,
2866,
43,
21,
13,
1786,
13,
6981,
20,
62,
250,
19,
20059,
17,
32,
693,
5759,
1123,
17,
796,
9,
86,
31,
23,
5712,
15,
92,
42,
3625,
625,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Setting UIViewGroupOpacity on a View by View Basis
===
Is it possible to set `UIViewGroupOpacity` (see [documentation][1]) for a single or set of views in an application? Thanks.
[1]: http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html | 0 | [
2,
2697,
13,
5661,
4725,
8024,
11490,
5788,
27,
21,
1418,
34,
1418,
2239,
800,
3726,
3726,
25,
32,
938,
20,
309,
13,
1,
5661,
4725,
8024,
11490,
5788,
1,
13,
5,
1798,
636,
28132,
857,
500,
2558,
165,
500,
6,
26,
21,
345,
54,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Email confirmation best practices for mobile apps
===
So I'm writing a mobile app and have reached a point where I need to allow users to register a username. I'm doing this by asking for an email address, username and password.
Typically, it's been normal to set this sort of thing up on the web by having the user confirm his email address by clicking on a link sent to his inbox.
Needless to say, on a mobile app this is a bit clunky as the user will be redirected out of your app and into his browser.
So I had a look at how other mobile apps are doing it (WP7) and was surprised to see that DropBox and Evernote both allow you to sign up without confirming your email address. The end result of this is that I was able to sign up with completely bogus email addresses and/or valid email addresses that don't belong to me.
I assume this is done on purpose.
Your thoughts? | 0 | [
2,
8517,
15939,
246,
5242,
26,
3241,
4865,
18,
800,
3726,
3726,
86,
31,
22,
79,
1174,
21,
3241,
4865,
17,
57,
664,
21,
454,
113,
31,
376,
20,
1655,
3878,
20,
2243,
21,
4155,
7259,
9,
31,
22,
79,
845,
48,
34,
3379,
26,
40,
85... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Create dictionary(hash table) maintaining order
===
I have the following class:
private class NodeTemp
{
public string Content;
public NodeTemp Next;
public NodeTemp Prev;
}
as you can see I have `NodeTemp Next` in order to be able to have a reference to the next element on the hash table just like the `NodeTemp Prev` will have a reference to the previos element on the hash table.
So I have a very large "xml" like text file that I have to parse. I looks something like:
<1><a5>: Abbrev Number: 2 (DW_TAG_base_type)
<a6> DW_AT_name : unsigned short
<b5> DW_AT_byte_size : 2
<b6> DW_AT_encoding : 7 (unsigned)
<1><b7>: Abbrev Number: 2 (DW_TAG_base_type)
<b8> DW_AT_name : unsigned int
<c5> DW_AT_byte_size : 4
<c6> DW_AT_encoding : 7 (unsigned)
<1><c7>: Abbrev Number: 2 (DW_TAG_base_type)
<c8> DW_AT_name : unsigned char
<d6> DW_AT_byte_size : 1
<d7> DW_AT_encoding : 8 (unsigned char)
<1><d8>: Abbrev Number: 4 (DW_TAG_pointer_type)
<d9> DW_AT_type : DW_FORM_ref4 <0x552>
<1><de>: Abbrev Number: 2 (DW_TAG_base_type)
<df> DW_AT_name : void
<e4> DW_AT_byte_size : 0
<e5> DW_AT_encoding : 5 (signed)
<1><e6>: Abbrev Number: 4 (DW_TAG_pointer_type)
<e7> DW_AT_type : DW_FORM_ref_udata <0xde>
<1><ea>: Abbrev Number: 4 (DW_TAG_pointer_type)
<eb> DW_AT_type : DW_FORM_ref4 <0x180>
<1><f0>: Abbrev Number: 4 (DW_TAG_pointer_type)
<f1> DW_AT_type : DW_FORM_ref4 <0x4cb>
<1><f6>: Abbrev Number: 4 (DW_TAG_pointer_type)
<f7> DW_AT_type : DW_FORM_ref4 <0x4efb>
<1><fc>: Abbrev Number: 2 (DW_TAG_base_type)
<fd> DW_AT_name : char
<102> DW_AT_byte_size : 1
<103> DW_AT_encoding : 8 (unsigned char)
.....
....
I have a method that will search through it and return me one chunk at a time. The reason why I am creating a `Dictionary<string, NodeTemp>` instead of a `List<NodeTemp>` is for performance cause I have to make several queries in order to look for the node that I need.
so what I have right now is:
var mtch = Regex.Match(GetUnparsedDebugInfo(), @"(?s)<\d+><\w+>.*?(?=\n <)");
int ctr = 0; // counter
NodeTemp[] nodes = new NodeTemp[3]; // circular array
while (mtch.Success)
{
/* mtch.value should = something like:
<1><a5>: Abbrev Number: 2 (DW_TAG_base_type)
<a6> DW_AT_name : unsigned short
<b5> DW_AT_byte_size : 2
<b6> DW_AT_encoding : 7 (unsigned)
*/
var index = ctr % 3; // current possition in circular array
//get key
var k = Regex.Match(mtch.Value, @"><(\w+)>").Groups[1].Value;
var cNode = new NodeTemp() { Content = mtch.Value };
dictionary.Add(k, cNode);
nodes[index] = cNode;
if (ctr > 0)
{
var lastIndex = index - 1;
if (lastIndex < 0)
lastIndex = 2;
nodes[lastIndex].Next = cNode;
cNode.Prev = nodes[lastIndex];
}
ctr++;
mtch = mtch.NextMatch();
}
This is not working because `nodes[index]` contains a reference to a object and at the end if I change it it will change all. How can I fix this while loop? I don't want to create a List then convert that large list to a dictionary. I think that will not be efficient.
Or maybe I can create some other type of data sctucture that will enable me to query quickly for the node that I need and I will also be able to maintain the order. | 0 | [
2,
1600,
9186,
5,
25436,
859,
6,
8215,
389,
800,
3726,
3726,
31,
57,
14,
249,
718,
45,
932,
718,
15421,
9577,
13,
1,
317,
3724,
2331,
73,
317,
15421,
9577,
328,
73,
317,
15421,
9577,
782,
710,
73,
13,
1,
28,
42,
92,
196,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Local variable in closure changing from outside of it.This is a javascript bug or I am doing something wrong?
===
I am using closure for privacy.
I dont understand why and how to change local variable from outside of closure.
I wrote a script for explain problem to you.
var MyAjax=(function(){
//Create a local variable for privacy
var _opts={
cache:true
}
,getDefaultOptions=function(){
return _opts
};
//return only getDefaultOptions function
return {
getDefaultOptions:getDefaultOptions
}
})()
//I am merging new ajax options with default options.
var defaults=MyAjax.getDefaultOptions();
var reqOptions= $.extend(defaults,{cache:false});
// I am getting expected result
console.log("extended var",reqOptions) //{cache:false}
// I am getting non expected result
// I should get {cache:true} but I am getting { cache:false }
console.log("defaults",MyAjax.getDefaultOptions()) //{cache:false}
Why this happening and how ?
| 0 | [
2,
375,
7612,
19,
7790,
4226,
37,
719,
16,
32,
9,
1565,
25,
21,
8247,
8741,
6256,
54,
31,
589,
845,
301,
1389,
60,
800,
3726,
3726,
31,
589,
568,
7790,
26,
9226,
9,
31,
1049,
1369,
483,
17,
184,
20,
753,
375,
7612,
37,
719,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Share memory to Process large Datatable
===
I have 50 Million records in a database which i in turn load in a data table to process them in c# windows application.
Now my question is there any technology or any methods in which i can use the memory of other pcs in a network to store the data table and then retrieve the data table accordingly to process it | 0 | [
2,
1891,
1912,
20,
953,
370,
1054,
5924,
800,
3726,
3726,
31,
57,
1222,
507,
742,
19,
21,
6018,
56,
31,
19,
805,
6305,
19,
21,
1054,
859,
20,
953,
105,
19,
272,
5910,
1936,
3010,
9,
130,
51,
1301,
25,
80,
186,
1099,
54,
186,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to determine if file is remote in Python
===
I want to determine whether or not a file is located on a local hard drive or a drive mounted from the network. So I'd be looking to produce code a bit like the following:
file_name = '/Somewhere/foo.bar'
if is_local_file(file_name):
do_local_thing()
else:
do_remote_thing()
I've not been able to find anything that works like `is_local_file()` in the example above. Ideally I'd like to use an existing function if there is one but failing that how could I implement it myself? The best I've come up with is the following but this treats mounted dmgs as though they're remote which isn't what I want. Also I suspect I might be reinventing the wheel!
def is_local_file(path):
path = path.split('/')[1:]
for index in range(1,len(path)+1):
if os.path.ismount('/' + '/'.join(path[:index])):
return False
return True
| 0 | [
2,
184,
20,
3746,
100,
3893,
25,
5388,
19,
20059,
800,
3726,
3726,
31,
259,
20,
3746,
1472,
54,
52,
21,
3893,
25,
335,
27,
21,
375,
552,
1493,
54,
21,
1493,
4897,
37,
14,
982,
9,
86,
31,
22,
43,
44,
699,
20,
2213,
1797,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android custom Listview containing different sub lists with header images
===
I want to display a custom listview containing different lists with header images(like for Contacts grouped alphabetically). Similar to the list shown in this link: https://code.google.com/p/android-amazing-listview/
And, I want to add the items to the listview at the runtime. Also, want to filter the listview accordingly. Any suggestions... | 0 | [
2,
13005,
5816,
968,
4725,
3503,
421,
972,
7227,
29,
157,
106,
3502,
800,
3726,
3726,
31,
259,
20,
3042,
21,
5816,
968,
4725,
3503,
421,
7227,
29,
157,
106,
3502,
5,
1403,
26,
11894,
19511,
27169,
102,
6,
9,
835,
20,
14,
968,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
nullreferenceexception when using "not StartWith" in Linq
===
Im trying to remove all elements that have attribute value doesn't start with specific text
Thanks to Jon Skeet i got the first part however some elements doesn't contain this attribute therefore i got nullreference expection with the message: "Object reference not set to an instance of an object"
I added and extra check for null value but it doesn't work any idea?
elements =(from el in xmlFile.Root.Elements(elementName) where ( !el.Attribute(attributeName).Value.Equals(DBNull.Value) && !el.Attribute(attributeName).Value.StartsWith(searchBeforeStar))select el);
| 0 | [
2,
16203,
28018,
10066,
872,
76,
568,
13,
7,
1270,
799,
1410,
7,
19,
6294,
1251,
800,
3726,
3726,
797,
749,
20,
4681,
65,
2065,
30,
57,
35,
14755,
1923,
1437,
22,
38,
799,
29,
1903,
1854,
3669,
20,
3938,
13,
5835,
1198,
31,
330,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Writing a PNG using zlib
===
I am trying to write a PNG using zlib directly. However, the output file is not correct. Looking at it in frhed, the IDAT chunk shows periodic patterns and a large block of zeros. This indicates that something is wrong when calling zlib. Here's the code:
#include "FrameGrabber.h"
#include "Image.h"
#include "crc.h"
#include <zlib.h>
#include <stdint.h>
#include <cstdio>
#include <cassert>
template<class T>
void assign(void* addr,T x)
{
T* p_out= (T*)addr ;
*p_out=x;
}
inline int32_t swap_bytes(int32_t x)
{
asm("bswap %1":"=r"(x):"r"(x):);
return x;
}
//Input is BGRx (convert to BGR (should be swapped to RGB later) and add a byte in the beginning)
void filterApply(const unsigned char* const* scanlines,char* buffer_png,int width,int height)
{
for(int k=0;k<height;++k)
{
*buffer_png=0;
++buffer_png;
for(int l=0;l<width;l+=4)
{
assign(buffer_png,*( (int32_t*)(scanlines[k]) ) );
buffer_png+=3;
}
}
}
size_t compress(const char* buffer_uncompressed,char* buffer_compressed,size_t length_in)
{
z_stream stream;
memset(&stream,0,sizeof(stream));
// 15 bits=32K?
deflateInit2(&stream,6,Z_DEFLATED,15,9,Z_FILTERED);
stream.avail_in=length_in;
stream.next_in=(unsigned char*)buffer_uncompressed;
stream.avail_out=length_in;
stream.next_out =(unsigned char*)buffer_compressed;
do
{
deflate(&stream, Z_FINISH);
}
while (stream.avail_out == 0);
deflateEnd(&stream);
return stream.total_out;
}
const size_t CHUNK_BASE_SIZE=12;
void Chunk_sizeSet(char* chunk,uint32_t size)
{assign(chunk,swap_bytes(size));}
void Chunk_IDSet(char* chunk,uint32_t id)
{assign(chunk+4,swap_bytes(id));}
void Chunk_CRCSet(char* chunk,const PngCRC& crc,uint32_t size_chunk_data)
{assign(chunk+8+size_chunk_data, swap_bytes(crc(chunk+4,size_chunk_data+4)) );}
const size_t IHDR_SIZE=13;
const int IHDR_COLORTYPE_RGB=2;
void IHDR_widthSet(char* chunk,int32_t width)
{assign(chunk+8,swap_bytes(width));}
void IHDR_heightSet(char* chunk,int32_t height)
{assign(chunk+12,swap_bytes(height));}
void IHDR_bitDepthSet(char* chunk,char bd)
{chunk[16]=bd;}
void IHDR_colorTypeSet(char* chunk,char ct)
{chunk[17]=ct;}
void IHDR_compressionMethodSet(char* chunk,char cmprm)
{chunk[18]=cmprm;}
void IHDR_filterMethodSet(char* chunk,char filter)
{chunk[19]=filter;}
void IHDR_interlaceMethodSet(char* chunk,char interlace)
{chunk[20]=interlace;}
int main()
{
PngCRC crc; //The CRC code works
char signature[8]={137,80,78,71,13,10,26,10};
char IEND[CHUNK_BASE_SIZE];
Chunk_sizeSet(IEND,0);
Chunk_IDSet(IEND,0x49454e44);
Chunk_CRCSet(IEND,crc,0);
FrameGrabber grabber(GetDesktopWindow()); //Grab the desktop (works)
Image img(grabber);
grabber.grab();
char IHDR[CHUNK_BASE_SIZE+IHDR_SIZE];
Chunk_sizeSet(IHDR,CHUNK_BASE_SIZE+IHDR_SIZE);
Chunk_IDSet(IHDR,0x49484452);
IHDR_widthSet(IHDR,grabber.widthGet());
IHDR_heightSet(IHDR,grabber.heightGet());
IHDR_bitDepthSet(IHDR,8);
IHDR_colorTypeSet(IHDR,IHDR_COLORTYPE_RGB);
IHDR_compressionMethodSet(IHDR,0);
IHDR_filterMethodSet(IHDR,0);
IHDR_interlaceMethodSet(IHDR,0);
Chunk_CRCSet(IHDR,crc,IHDR_SIZE);
size_t size_uncompressed=(1+3*grabber.widthGet())*grabber.heightGet();
char* img_png_uncompressed=(char*)malloc(size_uncompressed);
filterApply(img.rowsGet(),img_png_uncompressed,grabber.widthGet(),grabber.heightGet());
//The compressed chunk should not be larger than the uncompressed one.
char* IDAT=(char*)malloc(size_uncompressed+CHUNK_BASE_SIZE);
int32_t size_idat=compress(img_png_uncompressed,IDAT+CHUNK_BASE_SIZE,size_uncompressed);
Chunk_sizeSet(IDAT,size_idat);
Chunk_IDSet(IDAT,0x49444154);
Chunk_CRCSet(IDAT,crc,size_idat);
FILE* file_out=fopen("test.png","wb");
fwrite(signature,1,sizeof(signature),file_out);
fwrite(IHDR,1,sizeof(IHDR),file_out);
fwrite(IDAT,1,size_idat,file_out);
fwrite(IEND,1,sizeof(IEND),file_out);
free(IDAT);
fclose(file_out);
return 0;
}
| 0 | [
2,
1174,
21,
351,
2723,
568,
2052,
8326,
800,
3726,
3726,
31,
589,
749,
20,
2757,
21,
351,
2723,
568,
2052,
8326,
1703,
9,
207,
15,
14,
5196,
3893,
25,
52,
4456,
9,
699,
35,
32,
19,
6034,
438,
43,
15,
14,
13,
3405,
38,
15009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Check if string is valid html tag.
===
Is there any Native Javascript Functions to check if html tag exists?
I mean :
var tag = "div";
alert(isValidTag(tag)) // true;
alert(isValidTag("foo")) // false;
*If there is no native function for that, I will keep my function :*
function isValidTag(tagName) {
var tags = ["div","span","a","link" ... "body"];
for(var i=0, len = tags.length; i++ < len; ) {
if(tags[i] == tagName) return true;
}
return false;
} | 0 | [
2,
2631,
100,
3724,
25,
7394,
13,
15895,
3383,
9,
800,
3726,
3726,
25,
80,
186,
1275,
8247,
8741,
3719,
20,
2631,
100,
13,
15895,
3383,
5636,
60,
31,
884,
13,
45,
4033,
3383,
800,
13,
7,
12916,
7,
73,
7863,
5,
403,
18506,
43,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Determine if a .pdf file has any form elements of any type
===
I need to determine if a given .pdf file has any form element in it (could be text input, check box, list, etc...)
I don't need to know what kind they are or how many there are, I just need to know that there is more than 1 field of any type in the file.
I already have PHP (5.3), Zend_Pdf and tcpdf at my disposal.
It does not appear that Zend_Pdf offers anything to simply list or count form fields.
My option seems to be to convert the pdf to html and parse the result for form fields or convert the pdf to a text file and parse it.
Are there any better solutions out there?
| 0 | [
2,
3746,
100,
21,
13,
9,
11124,
3893,
63,
186,
505,
2065,
16,
186,
1001,
800,
3726,
3726,
31,
376,
20,
3746,
100,
21,
504,
13,
9,
11124,
3893,
63,
186,
505,
4520,
19,
32,
13,
5,
13431,
44,
1854,
6367,
15,
2631,
1649,
15,
968,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Comparing two arrays in jQuery regarding CSS classes
===
I have two arrays. One looks like this:
var array_one = [".a", ".b", ".c", ".d"];
`.a`, `.b`, `.c` & `.d` are CSS-classes that can be found in the DOM.
Then I got another array `array_two` which holds all elements with class `.lorem` currently in the DOM.
Now how do I find the elements that have `.a`, `.b`, `.c` or `.d` **and** `.lorem` by comparing the two arrays? | 0 | [
2,
15047,
81,
7718,
18,
19,
487,
8190,
93,
3467,
272,
18,
18,
2684,
800,
3726,
3726,
31,
57,
81,
7718,
18,
9,
53,
1879,
101,
48,
45,
4033,
7718,
1,
849,
800,
636,
7,
9,
58,
7,
15,
13,
7,
9,
220,
7,
15,
13,
7,
9,
150,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Galaxy s3 emulator
===
Starting emulator for AVD 's3'
Failed to allocate memory: 8 T
his application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I AM GETting this problem while running s3 emulator with this ocomfiguration
Target: Google APIs - API Level 15 Skin: Built-in WXGA720
Hardware Back/Home: yes
Abstracted LCD density: 320
Keyboard lid support: no
Max VM application heap size: 48
Device ram size: 512 | 0 | [
2,
9358,
13,
18,
240,
3579,
14868,
800,
3726,
3726,
1422,
3579,
14868,
26,
14026,
43,
13,
22,
18,
240,
22,
1702,
20,
65,
111,
9530,
1912,
45,
469,
13,
38,
33,
3010,
63,
6602,
14,
485,
891,
20,
17952,
32,
19,
40,
4706,
161,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Download file in form of byte array and then redirect to different url with ASP MVC3
===
As title says.
I've got photo in form of byte array. When user clicks a button download file dialog should show and meanwhile page should get redirected.
So: Click button then get dialog and get redirected at same time or just after accepting/denying file.
It's probably easy thing, but actions can't return Redirect and File at same time, while Javascript and Ajax are of no help, so I'm outta ideas. | 0 | [
2,
7121,
3893,
19,
505,
16,
34,
591,
7718,
17,
94,
302,
14706,
20,
421,
287,
6362,
29,
28,
306,
307,
8990,
240,
800,
3726,
3726,
28,
581,
898,
9,
31,
22,
195,
330,
3056,
19,
505,
16,
34,
591,
7718,
9,
76,
4155,
10840,
18,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
std::result_of simple function
===
#include <iostream>
#include <type_traits>
double f(int i)
{
return i+0.1;
}
struct F
{
public:
double operator ()(int i) { return i+0.1; }
};
int
main(int, char**)
{
std::result_of<F(int)>::type x; // ok
// std::result_of<f(int)>::type x; // error: template argument 1 is invalid
x = 0.1;
std::cerr << x << std::endl;
}
Please explain why `std::result_of<f(int)>::type x;` is invalid...
cppreference says "(`std::result_of`) Deduces the return type of a function call expression at compile type.".
what's the problem? | 0 | [
2,
354,
43,
45,
45,
29955,
1,
1041,
1935,
1990,
800,
3726,
3726,
6926,
22640,
13,
1,
1963,
11260,
1,
6926,
22640,
13,
1,
4474,
1,
1939,
7363,
1,
1494,
398,
5,
6391,
31,
6,
13,
1,
788,
31,
2430,
387,
9,
165,
73,
13,
1,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding a Pushpin on MapControl Tap event
===
I'm trying to add a Pushpin to my MapControl on Tap. The problem I am facing is, the GestureEventArgs passes a Map relative co-ordinate for eg:
X = 216
Y = 197
Due to this I am not able to assign the Co-ods on a Pushpin to Add into the map. Here's exactly what I am doing.
private void MainMap_Tap(object sender, GestureEventArgs e)
{
Point p = e.GetPosition(this.MainMap);
GeoCoordinate g = new GeoCoordinate();
g = MainMap.ViewportPointToLocation(p);
MyPin.Location = g;
MainMap.Children.Add(MyPin);
}
My code breaks due to a Null Reference Error at MyPin.Location = g. In g I get values like
g = {-0.00446319579627641, 0.00369071960449219} | 0 | [
2,
4721,
21,
3250,
3489,
27,
2942,
12898,
5526,
807,
800,
3726,
3726,
31,
22,
79,
749,
20,
3547,
21,
3250,
3489,
20,
51,
2942,
12898,
27,
5526,
9,
14,
1448,
31,
589,
4325,
25,
15,
14,
7222,
4943,
38,
10663,
18,
3789,
21,
2942,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android - How to make slide menu like facebook, spotify and Google +
===
I want to add a slide menu to my app like the facebook app. I read alot of things on the internet about librarys but none worked for me.
What is the best thing/library that i can use for this and can someone maybe explain me how to use it?
| 0 | [
2,
13005,
13,
8,
184,
20,
233,
6464,
11379,
101,
9090,
15,
1999,
8612,
17,
8144,
2754,
800,
3726,
3726,
31,
259,
20,
3547,
21,
6464,
11379,
20,
51,
4865,
101,
14,
9090,
4865,
9,
31,
1302,
21,
5639,
16,
564,
27,
14,
2620,
88,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Equivalent code for Intel TBB for_each
===
I want to use Intel TBB for my c++ program. I have a loop
for_each(make.at(level).begin(),make.at(level).end(),Function);
in which make.at(level) is a set, and therefore the pointers stored in the set at a level are being sent to the Function. Now I want an equivalent code for compilation with TBB parallel_for_each. What is the way out? And what are the libraries to be included in TBB? And what are the compilation directive requirements?
I have imported:
#include "tbb/parallel_for.h"
#include "tbb/blocked_range.h"
#include "tbb/parallel_do.h"
using namespace tbb; | 0 | [
2,
4602,
1797,
26,
14635,
13,
38,
3490,
26,
1,
14322,
800,
3726,
3726,
31,
259,
20,
275,
14635,
13,
38,
3490,
26,
51,
272,
20512,
625,
9,
31,
57,
21,
5293,
26,
1,
14322,
5,
11115,
9,
721,
5,
3906,
6,
9,
17143,
108,
5,
6,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Save live video stream in VlC command prompt(execute in bat file)
===
i tried the record live stream video url in VLC gui mode its working fine (in network streaming mode) but i need to open and save to disk in command prompt mode.
I tried like below
"C:\Program Files\VideoLAN\VLC\vlc.exe" "http://ngmcpl.live.cdn.bitgravity.com/ngmcpl/secure/live/feed02?e=0%26h=4d935b8d20e351d1a8f02d9a14f8a70c" :sout=#duplicate{dst=std{access=file,dst="somename_%date:~7,2%_%date:~4,2%_%date:~10,4%.mp4"}}
but iam getting
Your input can't be opened: VLC is unable to open the MRL 'http://ngmcpl.live.cdn.bitgravity.com/ngmcpl/secure/live/feed02?e=06h=4d935b8d20e351d1a8f02d9a14f8a70c'
I got this command string from vlc stream output string
:sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:file{dst=OUTPUT.mp4} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
but i dont know how to link above url and this string to make as batch file in windows xp.
get me out if any one done before.
| 0 | [
2,
2079,
515,
763,
3766,
19,
566,
6109,
1202,
11443,
4417,
5,
1706,
17194,
591,
19,
3570,
3893,
6,
800,
3726,
3726,
31,
794,
14,
571,
515,
3766,
763,
287,
6362,
19,
566,
6109,
9457,
3740,
82,
638,
1123,
13,
5,
108,
982,
11920,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CSS centered divs side by side
===
I have this following chunk of my page.<br>
Style:
.featuredcontainer {
width: 450px;
height: 700px;
margin-left: auto;
margin-right: auto;
position: relative;
right: 160px;
top: 30px;
border: 1px groove grey;
}
.navcontainer
{
margin-left: auto;
margin-right: -8px;
position: relative;
top: 75px;
height: 600px;
width: 300px;
}
And example HTML:
<div class="featuredcontainer">
content
</div>
<div class="lessonnavcontainer">
menu
</div>
When the page is displayed. the navcontainer is to the right of (as it should) but under the featuredcontainer. When I move the navcontainer up using relative positioning, it looks right, but there is a bunch of empty space at the bottom of the page. What do I do?
| 0 | [
2,
272,
18,
18,
10583,
13,
12916,
18,
270,
34,
270,
800,
3726,
3726,
31,
57,
48,
249,
15009,
16,
51,
2478,
9,
1,
5145,
1,
1034,
45,
13,
9,
26956,
43,
1126,
5851,
106,
13,
1,
9456,
45,
15402,
306,
396,
73,
2947,
45,
10954,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
R seeds after a run; gbm;
===
This is the situation:
1) I have a random sample, but want to know what seed generated the outcome. Is there a way I can find out? I know you can set it prior to the run, but how about after the experiment?
2) Has anyone tried replicating a gbm fit after a model fit has been created?
Thanks | 0 | [
2,
761,
7945,
75,
21,
485,
73,
14857,
79,
73,
800,
3726,
3726,
48,
25,
14,
1858,
45,
137,
6,
31,
57,
21,
5477,
5717,
15,
47,
259,
20,
143,
98,
5134,
6756,
14,
9774,
9,
25,
80,
21,
161,
31,
92,
477,
70,
60,
31,
143,
42,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
My Javascript database app works in android 2.3 but not in 4.0
===
I have a database app that I use to enter movies on one page then they display on another page. I am using Javascript with phonegap. I haven't had any problems getting my app to work on android 2.3 but when I load it on a 4.0 device it doesn't work... meaning when I type in a movie and hit submit, it doesn't submit. It does however work on the 4.0 emulator. I get a few errors which are:
**Uncaught TypeError: Cannot read property 'style' of null at file:** ..... (Im using iscroll and it is referencing the iscroll.js file.)
and:
**call to openGL ES API with no current context** (this error happens when I open the page that is supposed to hold the movie titles. The error happens when I debug on the emulator even tho the app does work on the emulator. | 0 | [
2,
51,
8247,
8741,
6018,
4865,
693,
19,
13005,
172,
9,
240,
47,
52,
19,
268,
9,
387,
800,
3726,
3726,
31,
57,
21,
6018,
4865,
30,
31,
275,
20,
2830,
4795,
27,
53,
2478,
94,
59,
3042,
27,
226,
2478,
9,
31,
589,
568,
8247,
874... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Wordpress Multisite
===
I have install wordpress multisite I have 4 other sites installed using master site
<br>
1 master
--subsite
--subsite
--subsite
--subsite
What i need to do is any post publish on **subsite** will be auto publish on **master site**
Thanks
Gurpreet | 0 | [
2,
833,
5890,
1889,
9097,
800,
3726,
3726,
31,
57,
16146,
833,
5890,
1889,
9097,
31,
57,
268,
89,
3259,
4066,
568,
1129,
689,
13,
1,
5145,
1,
137,
1129,
13,
8,
8,
7563,
9097,
13,
8,
8,
7563,
9097,
13,
8,
8,
7563,
9097,
13,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
I need to be able to depopulate a listbox
===
I know what's wrong, I don't know how to fix it.
I get "NullReferenceException was unhandled by user code: Object reference not set to an instance of an object." Error, this is because I have a populated Listbox, when you select a fil name in the listbox the contents of that file are then displayed in a textbox.
Now, I have a depopulate button that clears all the files form the listbox, if a fle is selected, then I get the error.
I want to be able to click the depopulate button and clear both boxes.
My Code:
private void DE_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
myScaleTransform2.ScaleX = myScaleTransform2.ScaleX * .9833333333333333333333333333333333333333333333333333333333;
myScaleTransform2.ScaleY = myScaleTransform2.ScaleY * .9833333333333333333333333333333333333333333333333333333333;
lbz.Items.Clear();
}
private void lbz_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
tb1.Text = File.ReadAllText(lbz.SelectedItem.ToString());
} | 0 | [
2,
31,
376,
20,
44,
777,
20,
121,
6057,
12383,
21,
968,
5309,
800,
3726,
3726,
31,
143,
98,
22,
18,
1389,
15,
31,
221,
22,
38,
143,
184,
20,
6098,
32,
9,
31,
164,
13,
7,
4215,
211,
28018,
10066,
872,
23,
367,
3203,
1294,
34,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can I give my app entitlements to all data in a user's iCloud?
===
For example, is it possible the storage container key in the entitlements dictionary would accept "*" or "/", allowing me to access any and all data in that user's iCloud?
I am not worried about getting this app accepted into the app store. | 0 | [
2,
92,
31,
590,
51,
4865,
1957,
22235,
6601,
20,
65,
1054,
19,
21,
4155,
22,
18,
31,
19174,
60,
800,
3726,
3726,
26,
823,
15,
25,
32,
938,
14,
4326,
12147,
1246,
19,
14,
1957,
22235,
6601,
9186,
83,
3440,
13,
7,
2483,
7,
54,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Add/Remove Select Lists using jQuery - selectID not being sent in POST
===
I'm using the code from this site: [Add/Remove Select Lists Using jQuery][1]
I've got the display portion all set up, but when I submit the form, there's nothing set in the $_POST that would allow me to read the users' selection(s).
Here's the form I've got set up:
<?php
<form id='setTasks' action='?action=ae&view=departmentTasks' method='post'>
<table>
<tr>
<td valign='top'>
<select name='selectfrom' id='select-from' multiple size='5'>";
for ($i = 0; $i < count($unusedTasks); $i++)
echo "<option value='" . $unusedTasks[$i]['taskID'] . "'>" . $unusedTasks[$i]['taskName'] . "</option>";
echo "</select>
</td>
<td valign='top'><a href='JavaScript:void(0);' id='btn-add'>Add »</a></td>
<td valign='bottom'><a href='JavaScript:void(0);' id='btn-remove'>« Remove</a></td>
<td>
<select name='selectto' id='select-to' multiple size='5'>";
for ($i = 0; $i < count($departmentTasks); $i++)
echo "<option value='" . $departmentTasks[$i]['taskID'] . "'>" . $departmentTasks[$i]['taskName'] . "</option>";
echo "</select>
</td>
</tr>
<tr>
<td>
<input type='hidden' name='departmentID' value='" . $departmentID . "' />
<input type='hidden' name='submitFinal' value='1' />
<input type='submit' name='submitForm' value='Assign Tasks' />
<input type='button' value='Cancel' onclick='javascript:history.go(-1);' />
</td>
</tr>
</table>
</form>";
?>
And the function:
$(document).ready(function() {
$('#btn-add').click(function(){
$('#select-from option:selected').each( function() {
$('#select-to').append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option>");
$(this).remove();
});
});
$('#btn-remove').click(function(){
$('#select-to option:selected').each( function() {
$('#select-from').append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option>");
$(this).remove();
});
});
});
The front end (moving items back a forth) works fine, but when i do a var_dump($_POST) I don't get any information from the select fields. Anybody able to see what i'm missing?
[1]: http://www.designchemical.com/blog/index.php/jquery/create-add-remove-select-lists-using-jquery/ | 0 | [
2,
3547,
118,
99,
16598,
5407,
7227,
568,
487,
8190,
93,
13,
8,
5407,
1340,
52,
142,
795,
19,
678,
800,
3726,
3726,
31,
22,
79,
568,
14,
1797,
37,
48,
689,
45,
636,
14854,
118,
99,
16598,
5407,
7227,
568,
487,
8190,
93,
500,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to scale ImageData using HTML5?
===
Particularly i have this example but it does not seem to work :
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;">
your browser does not support the canvas tag </canvas>
<canvas id="myCanvas2" width="300" height="150" style="border:1px solid #d3d3d3;">
your browser does not support the canvas tag </canvas>
<script type="text/javascript">
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var c2=document.getElementById("myCanvas2");
var ctx2=c2.getContext("2d");
ctx.strokeRect(5,5,25,15);
var imageData = ctx.getImageData(0,0,c.width, c.height);
ctx2.putImageData(imageData, 100, 100);
ctx2.scale(2,2);
</script>
</body>
</html>
Shouldn't the rect get scaled in the second canvas ? | 0 | [
2,
184,
20,
3464,
1961,
18768,
568,
13,
15895,
264,
60,
800,
3726,
3726,
1653,
31,
57,
48,
823,
47,
32,
630,
52,
2260,
20,
170,
13,
45,
13,
1,
187,
13799,
4474,
13,
15895,
1,
13,
1,
15895,
1,
13,
1,
9760,
1,
13,
1,
1245,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Backbone views can't access jQuery selectors
===
I have a Backbone View which handles a registration component, because this required a lot of form access I had the idea to store the form selectors in an object property.
define(["models/security/user", 'text!templates/security/registration.html'], function(SecurityUserModel, Template){
var SecurityRegistrationView;
SecurityRegistrationView = Backbone.View.extend({
initialize: function(){
this.model = new SecurityUserModel();
this.model.bind("validated:valid", this.valid);
this.model.bind("validated:invalid", this.invalid);
Backbone.Validation.bind(this);
this.render();
},
render: function(){
$(this.el).append(Template);
},
events: {
"submit form": "submit"
},
form: {
"username": $("#_user_username")
, "email": $("#_user_email")
, "password": $("#_user_password")
},
submit: function(e){
e.preventDefault();
this.model.set("username", this.form.username.val());
this.model.set("password", this.form.email.val());
this.model.set("email", this.form.password.val());
this.model.validate();
// debug
console.log([this.form, this.form.username.val(), this.form.email.val()]);
if (this.model.isValid) {
this.model.save();
}
},
valid: function(model, attrs){
// error
this.form.attrs[0].username.parent("div.control-group").addClass("success");
},
invalid: function(model, attrs){
// error
this.form.attrs[0].username.parent("div.control-group").addClass("error");
}
});
return SecurityRegistrationView;
});
When I console.log this.form, I get an object which looks quite good nothing undefined or weird:
[
Object
email: e.fn.e.init[0]
context: HTMLDocument
selector: "#_user_email"
__proto__: Object[0]
password: e.fn.e.init[0]
context: HTMLDocument
selector: "#_user_password"
__proto__: Object[0]
username: e.fn.e.init[0]
context: HTMLDocument
selector: "#_user_username"
__proto__: Object[0]
__proto__: Object
]
Loggin an jquery function accessing the selectors (this.form.username.val()) fails with undefined.
Why can't use jQuery functions on properties ($el uses this to) where is the thinking error? | 0 | [
2,
24036,
4146,
92,
22,
38,
1381,
487,
8190,
93,
23946,
18,
800,
3726,
3726,
31,
57,
21,
24036,
1418,
56,
3053,
18,
21,
8587,
5912,
15,
185,
48,
1390,
21,
865,
16,
505,
1381,
31,
41,
14,
882,
20,
1718,
14,
505,
23946,
18,
19,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Change title on html with setInterval
===
I'm trying to set an effect to the title of my page, that it appear letter by letter but i can't undestand why does `setInterval()` function didn't work. <br>
Here is the code i tryed.
<script type="text/javascript">
var namee=document.title
var i=0
function changeTit(){
document.title=namee.substring(0,i)
i++
if(i>namee.length)
i=0
}
setInterval(changeTit(),1000)
</script>
This is running the `changeTit()` function only one time, i also tryed to call it in a button but one letter appear every time i hit the button and i want it to be changing all the time.
This code is in the head section but i also tryed in several different parts of the document, please tell if this gotta be in some specific part, i also tryed separating in diferent sections. | 0 | [
2,
753,
581,
27,
13,
15895,
29,
309,
6280,
3377,
800,
3726,
3726,
31,
22,
79,
749,
20,
309,
40,
1590,
20,
14,
581,
16,
51,
2478,
15,
30,
32,
1893,
1748,
34,
1748,
47,
31,
92,
22,
38,
13,
12239,
10731,
483,
630,
13,
1,
3554,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Paypal payments standard - Encrypted buttons with mobile optimized checkout
===
I am running a Django app that is hooked up to paypal payments standard and that generates encrypted 'Buy Now' buttons. Everything works as it should on desktop, but when I use a mobile device (android and IOS), I do not get sent to the mobile optimized checkout page.
If I go to [this non-encrypted test page][1], I actually get the mobile checkout page.
I looked at the documentation on [x.com][2]. They mention that the mobile checkout page is not compatible with these use cases:
- Instant Update API
- Buyer Supplied Price, Desc, Qty
- Profile Based Shipping & Tax Discounts
- Payment Type: Auth, Order
- Inventory Management
I originally had shipping rules, so I deleted those. I don't think I have any of the other things enabled, but its hard to tell seeing as these unsupported use cases are really vague. I've also read [this][3] SO post, and I have disabled my tax rules, but it did not fix the issue for me.
Does anyone have experience with this? Is there a way to force the mobile version of the checkout page, using paypal payments standard?
[1]: https://paypal.com/cgi-bin/webscr?cmd=_xclick&business=bacon@example.com&item_name=Bacon&amount=5
[2]: https://www.x.com/developers/paypal/products/mobile-paypal-payments-standard#usecases
[3]: http://stackoverflow.com/questions/9538548/mobile-optimized-checkout-for-paypal-website-payments-standard | 0 | [
2,
1372,
6720,
11161,
1236,
13,
8,
29403,
12861,
29,
3241,
22864,
43,
2631,
1320,
800,
3726,
3726,
31,
589,
946,
21,
3857,
14541,
4865,
30,
25,
14988,
71,
20,
1372,
6720,
11161,
1236,
17,
30,
7920,
18,
29403,
13,
22,
2345,
93,
130... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java alternatives with toString conversion from StringBuilder
===
Hi I have this piece of code where it will convert an ArrayList with stringbuilder elements into ArrayList string
Code:
public ArrayList<String> convGenSeqToString(ArrayList<StringBuilder> buff){
ArrayList<String> convBuf = new ArrayList<String>();
for (StringBuilder xVar: buff){
convBuf.add(xVar.toString());
}
return convBuf;
}
My code just works fine for all other files which are 15-20MB txt files. However I have a text file which is 44MB and whenever I ran my program with that text file I always have this error code generated.
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2746)
at java.util.ArrayList.ensureCapacity(ArrayList.java:187)
at java.util.ArrayList.add(ArrayList.java:378)
at Recognition.convGenSeqToString(Recognition.java:157)
at Recognition.genSeq(Recognition.java:145)
at Recognition.Recognitions(Recognition.java:96)
at ChainDetection.main(Detection.java:25)
I already increase the memory Run Configuration as -Xmx2048M and still I have the same error. I pinpointed the error to the code I displayed above and its highlighting this line:
convBuf.add(xVar.toString());
Are there any other ways to convert a StringBuilder to a string without using .toString method? I have seen in other forums and here as well that they created custom classes for toString but am not yet well versed with Generics and some "@" keywords. Anyone suggestions or guidelines how to solve this?
| 0 | [
2,
8247,
2676,
18,
29,
20,
11130,
6263,
37,
3724,
20904,
800,
3726,
3726,
4148,
31,
57,
48,
1855,
16,
1797,
113,
32,
129,
8406,
40,
7718,
5739,
29,
3724,
20904,
2065,
77,
7718,
5739,
3724,
1797,
45,
317,
7718,
5739,
1,
11130,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Having trouble running a custom jar on Amazon AWS
===
I'm having trouble running a custom jar on Elastic Map-Reduce
I'm using jdk1.6.0_26, Hadoop 0.20.205, and compiling with Eclipse on my computer and everything works perfectly fine
for example if I ran the following on my computer it would be successful
hadoop jar MaxTemperature.jar input/temperature.txt output
I specified the jar as the following on AWS
s3n://chrishadoop/MaxTemperature.jar
and I specified the arguments as
s3n://chrishadoop/input/temperature.txt s3n://chrishadoop/output
I did not specify the main class because I pointed to it in the manifest
Here is the jar I'm using, I will make it public for a little while
https://s3.amazonaws.com/chrishadoop/MaxTemperature.jar
Here is the error I'm getting
2012-07-08 19:31:39,824 INFO com.amazonaws.elasticmapreduce.statepusher.StatePusher (main): Pusher awoke, starting to push data into simpledb...
2012-07-08 19:31:40,552 FATAL com.amazonaws.elasticmapreduce.statepusher.StatePusher (main): Fatal Exception raised while extracting data from hadoop and pushing to simpledb
java.lang.NoClassDefFoundError: org/codehaus/jackson/map/JsonMappingException
at com.amazonaws.elasticmapreduce.statepusher.StatePusher.run(StatePusher.java:65)
at com.amazonaws.elasticmapreduce.statepusher.StatePusher.main(StatePusher.java:205)
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 2 more
Thanks for any help in advance
| 0 | [
2,
452,
2572,
946,
21,
5816,
5112,
27,
8059,
21,
10268,
800,
3726,
3726,
31,
22,
79,
452,
2572,
946,
21,
5816,
5112,
27,
931,
9428,
2942,
8,
99,
16041,
31,
22,
79,
568,
487,
43,
197,
165,
9,
379,
9,
387,
1,
2409,
15,
41,
217... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
When to call glEnable(GL_FRAMEBUFFER_SRGB)?
===
I have a rendering system where I draw to an FBO with a multisampled renderbuffer, then blit it to another FBO with a texture in order to resolve the samples in order to read off the texture to perform post-processing shading while drawing to the backbuffer (FBO index 0).
Now I'd like to get some correct sRGB output... The problem is the behavior of the program is rather inconsistent between when I run it on OS X and Windows and this also changes depending on the machine: On Windows with the Intel HD 3000 it will not apply the sRGB nonlinearity but on my other machine with a Nvidia GTX 670 it does. On the Intel HD 3000 in OS X it will also apply it.
So this probably means that I'm not setting my `GL_FRAMEBUFFER_SRGB` enable state at the right points in the program. However I can't seem to find any tutorials that actually tell me when I ought to enable it, they only ever mention that it's dead easy and comes at no performance cost.
I am currently not loading in any textures so I haven't had a need to deal with linearizing their colors yet.
To force the program to not simply spit back out the linear color values, what I have tried is simply comment out my `glDisable(GL_FRAMEBUFFER_SRGB)` line, which effectively means this setting is enabled for the entire pipeline, and I actually redundantly force it back on every frame.
I don't know if this is correct or not. It certainly does apply a nonlinearization to the colors but I can't tell if this is getting applied twice (which would be bad). It could apply the gamma as I render to my first FBO. It could do it when I blit the first FBO to the second FBO. Why not?
I've gone so far as to take screen shots of my final frame and compare raw pixel color values to the colors I set them to in the program:
I set the input color to RGB(1,2,3) and the output is RGB(13,22,28).
That seems like quite a lot of color compression at the low end and leads me to question if the gamma is getting applied multiple times.
I have just now gone through the sRGB equation and I can verify that the conversion seems to be only applied once as linear 1/255, 2/255, and 3/255 do indeed map to sRGB 13/255, 22/255, and 28/255 using the equation `1.055*C^(1/2.4)+0.055`. Given that the expansion is so large for these low color values it really should be obvious if the sRGB color transform is getting applied more than once.
So, I still haven't determined what the right thing to do is. does `glEnable(GL_FRAMEBUFFER_SRGB)` only apply to the final framebuffer values, in which case I can just set this during my GL init routine and forget about it hereafter?
Thanks. | 0 | [
2,
76,
20,
645,
4467,
579,
5,
8430,
1,
8361,
2345,
6866,
1,
18,
139,
11400,
6,
60,
800,
3726,
3726,
31,
57,
21,
15307,
329,
113,
31,
2003,
20,
40,
398,
1192,
29,
21,
1889,
18,
10158,
1294,
16535,
2345,
6866,
15,
94,
334,
6864,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Git Push Not Working
===
I am working with two branches **test** and **main**.
So, being on the **main** branch, I did :
git merge test
And everything went fine. All the changes were merged.
Then to push it to the remote **main**, I did :
git push
But it seems like that did nothing, it said :
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:Company/My-App.git
b878c9d..0dc7fbe main -> main
How can I push my **main** branch ? | 0 | [
2,
13,
10404,
3250,
52,
638,
800,
3726,
3726,
31,
589,
638,
29,
81,
4395,
13,
1409,
10543,
1409,
17,
13,
1409,
6232,
1409,
9,
86,
15,
142,
27,
14,
13,
1409,
6232,
1409,
1686,
15,
31,
144,
13,
45,
13,
10404,
12666,
1289,
17,
79... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Implementing back-forward in a Flex application
===
I'm responsible for a Flex application which shows cards/tiles. A click on each card sends a request to the server and then the Flex app renders new cards from the data returned from the server.
Now I need to add a back-forward functionality, so that after several clicks on cards, I will be able to return to the previous requests. As I understand it, I just need to save some kind of a stack of URLs which were sent to the server.
The need is for regular back-forward, so that if I'm viewing card X, then click back and then click on a different tile, I can drop card X from my data structure and forget it.
What data structure would you recommend using? Any examples?
Thanks. | 0 | [
2,
17333,
97,
8,
21216,
19,
21,
14409,
3010,
800,
3726,
3726,
31,
22,
79,
1864,
26,
21,
14409,
3010,
56,
1285,
4092,
118,
9802,
18,
9,
21,
10840,
27,
206,
2056,
11350,
21,
3772,
20,
14,
8128,
17,
94,
14,
14409,
4865,
16535,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CryptoJS and Pycrypto working together
===
I'm encrypting a string in a web application using CryptoJS (v 2.3), and I need to decrypt it on the server in Python, so I'm using PyCrypto. I feel like I'm missing something because I can't can it working.
Here's the JS:<br>
Crypto.AES.encrypt('1234567890123456', '1234567890123456',
{mode: new Crypto.mode.CBC(Crypto.pad.ZeroPadding)})
// output: "wRbCMWcWbDTmgXKCjQ3Pd//aRasZ4mQr57DgTfIvRYE="
The python:<br>
from Crypto.Cipher import AES
import base64
decryptor = AES.new('1234567890123456', AES.MODE_CBC)
decryptor.decrypt(base64.b64decode("wRbCMWcWbDTmgXKCjQ3Pd//aRasZ4mQr57DgTfIvRYE="))
# output: '\xd0\xc2\x1ew\xbb\xf1\xf2\x9a\xb9\xb6\xdc\x15l\xe7\xf3\xfa\xed\xe4\xf5j\x826\xde(m\xdf\xdc_\x9e\xd3\xb1'
Eek. Any ideas? | 0 | [
2,
16277,
728,
18,
17,
7103,
11435,
111,
638,
429,
800,
3726,
3726,
31,
22,
79,
1957,
11435,
68,
21,
3724,
19,
21,
2741,
3010,
568,
16277,
728,
18,
13,
5,
710,
172,
9,
240,
6,
15,
17,
31,
376,
20,
121,
11435,
32,
27,
14,
812... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Writing long stream of characters to text file QT C++
===
I am trying to write a program that will create a text file and write a stream of characters that I read from a serial port. I am just trying to understand how I can get the code to continuously write the data and not overwrite the previously written data because I will need it to keep every character sent. I wrote this code as a test but I can't get it to continuously write the text. It writes it once and then stops.
#include <QFile>
#include <QTextStream>
int main() {
int test = 0;
while(test < 2){
QString filename = "Data.txt";
QFile file(filename);
if (file.open(QIODevice::ReadWrite)) {
QTextStream stream(&file);
stream << "one thing to test" << endl;
test++;
}
}
}
Anyone have any suggestions?
-Thanks | 0 | [
2,
1174,
175,
3766,
16,
1766,
20,
1854,
3893,
2593,
38,
272,
20512,
800,
3726,
3726,
31,
589,
749,
20,
2757,
21,
625,
30,
129,
1600,
21,
1854,
3893,
17,
2757,
21,
3766,
16,
1766,
30,
31,
1302,
37,
21,
5956,
1295,
9,
31,
589,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
mysql returns nothing whenever one of my concatenated values is null
===
Ok so i have tried all that i have come across, starting with concat_ws, IFNULL, and a combination of the two, nothing has worked so far. Here's to hoping that i'm missing a bit of syntax somewhere
thanks for the help in advance
CREATE DEFINER=`gbpint2`@`localhost` PROCEDURE `Summary`(number varchar(12))
BEGIN
DECLARE sessid int(11);
DECLARE uid int(11);
SET uid = (SELECT User_ID FROM user WHERE Phone_Number=number);
SET sessid = (SELECT Session_ID FROM session WHERE User_ID = uid AND Active_Session='T');
SELECT concat(Answer_Body,', ',IFNULL(Answer_Text,'sklajdfso')) AS Question_Text FROM answer a
JOIN questionAnswer qa ON a.Question_ID = qa.Question_ID
AND qa.Answer_Key = a.Answer_Body WHERE Session_ID = sessid;
END | 0 | [
2,
51,
18,
22402,
4815,
626,
6634,
53,
16,
51,
1065,
793,
1316,
1669,
4070,
25,
16203,
800,
3726,
3726,
5854,
86,
31,
57,
794,
65,
30,
31,
57,
340,
464,
15,
1422,
29,
1065,
5782,
1,
10268,
15,
100,
4215,
211,
15,
17,
21,
3733,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
php $_POST variable
===
I have a php script where I need to handle variables that are submitted via a post method.
But now there is something strange happening;
when I use this:
foreach ($_POST as $var => $value) {
echo "$var = $value<br>\n";
}
I can see my variables names and values. For instance:
name=matthijs<br>
age=36<br>
city=amsterdam<br>
but if I try something like this:
echo $_POST['name']."<BR>";
I see nothing... weird isn't it?
Any ideas why this occurs?
Regards,
Matthijs | 0 | [
2,
13,
26120,
5579,
1,
6962,
7612,
800,
3726,
3726,
31,
57,
21,
13,
26120,
3884,
113,
31,
376,
20,
3053,
12157,
30,
50,
7368,
1197,
21,
678,
2109,
9,
47,
130,
80,
25,
301,
2578,
4942,
73,
76,
31,
275,
48,
45,
26,
14322,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Velocity PagerTool is creating incorrect links in my pagination
===
I'm trying to use the velocity PagerTool to add pagination to my velocity template. I followed the instructions on their website and even used their sample code. I populate the pager items and set the number of items per page in my controller before forwarding to my template.
Everything "looks" like it worked when I navigate to that page, however, when I click on the pagination numbers it doesn't work. I know my items made it to the pager because it displays the items on the page correctly.
The pagination looks like this:
< 1 2 3 4 5 6 >
When I click on 1 it refreshes the page and displays a different set of values for the page. When I click on anything greater than 1, it breaks. Any ideas?
I'm guessing I'm either not using the links correctly (even though I did it exactly as they said to) or there is something I'm not populating correctly in my controller.
Here's what I have in my controller:
PagerTool pager = new PagerTool();
pager.setItemsPerPage(10);
pager.setItems(myListOfItems);
request.setAttribute("pager", pager);
request.setAttribute("new.items", myListOfItems);
I used the code from the sample they gave in the docs: [PagerTool][1]
Here's the code I'm using in my vm template:
#if( $pager.hasItems() )
Showing $!pager.pageDescription<br>
#set( $i = $pager.index )
#foreach( $item in $pager.page )
${i}. $!item <br>
#set( $i = $i + 1 )
#end
<br>
#if ( $pager.pagesAvailable > 1 )
#set( $pagelink = $link.self.param("show",$!pager.itemsPerPage) )
#if( $pager.prevIndex )
<a href="$pagelink.param('index',$!pager.prevIndex)">Prev</a>
#end
#foreach( $index in $pager.slip )
#if( $index == $pager.index )
<b>$pager.pageNumber</b>
#else
<a href="$pagelink.param('index',$!index)">$!pager.getPageNumber($index)</a>
#end
#end
#if( $pager.nextIndex )
<a href="$pagelink.param('index',$!pager.nextIndex)">Next</a>
#end
#end
#else
No items in list.
#end
I've searched all over for the answers but haven't found anything that works yet. Please help!
| 0 | [
2,
10700,
2478,
139,
20799,
25,
2936,
18867,
6271,
19,
51,
19006,
108,
857,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
14,
10700,
2478,
139,
20799,
20,
3547,
19006,
108,
857,
20,
51,
10700,
22894,
9,
31,
709,
14,
7650,
27,
66,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Vertical line between matching curly braces for java in eclipse
===
Hi I am new to eclipse IDE<br />
Can we do following in eclipse for java editor.<br />
{<br/>
|<br/>
|<br/>
}
How it is configured in eclipse to show vertical lines between matching curly braces in java editor.Is it possible ? | 0 | [
2,
7035,
293,
128,
10120,
21056,
15646,
18,
26,
8247,
19,
11652,
800,
3726,
3726,
4148,
31,
589,
78,
20,
11652,
13,
3448,
1,
5145,
13,
118,
1,
92,
95,
107,
249,
19,
11652,
26,
8247,
1835,
9,
1,
5145,
13,
118,
1,
13,
1,
5145,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I use the old iostream.h in gcc
===
I am about to do a C++ test. But their example uses iostream.h
#include <iostream.h>
int main()
{
int i;
for(i=1;i<=100;i++)
{
if(i%15==0)
cout<<"FizzBuzz";
else if(i%5==0)
cout<<"Buzz";
else if(i%3==0)
cout<<"Fizz";
else
cout<<i;
cout<<"\n";
}
}
I remember in the old days that iostream.h contained
#include <iostream>
using namespace std;
I don't want to be writing lots of wrappers, as the test is timed. Does any one know how to put it in to the mode for this old dialect? | 0 | [
2,
184,
92,
31,
275,
14,
315,
13,
1963,
11260,
9,
252,
19,
489,
3384,
800,
3726,
3726,
31,
589,
88,
20,
107,
21,
272,
20512,
1289,
9,
47,
66,
823,
2027,
13,
1963,
11260,
9,
252,
6926,
22640,
13,
1,
1963,
11260,
9,
252,
1,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Methods to deploy AMQ remotely - AS or standalone JVM?
===
I need to host an Active MQ Broker remotely so that several clients (consumers and producers) have access to it.
I am currently looking for hosting - but would like to know whether I need to 'contain' the AMQ broker within an Application Server like Tomcat or Geronimo - or whether I could just deploy the broker to run on the server's JVM?
My client use Spring extensively, I just wondered why, in this instance - I would need to deploy the AMQ broker within an container??
Thanks
| 0 | [
2,
3195,
20,
17617,
589,
1251,
23288,
13,
8,
28,
54,
26986,
487,
20147,
60,
800,
3726,
3726,
31,
376,
20,
2015,
40,
1348,
307,
1251,
14930,
23288,
86,
30,
238,
7421,
13,
5,
12124,
723,
445,
17,
5836,
6,
57,
1381,
20,
32,
9,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Merge multiple columns in bulkloader
===
I'm using app engine's `bulkloader` to import a CSV file into my datastore. I've got a number of columns that I want to merge into one, for example they're all URLs, but not all of them are supplied and there is a superseding order, eg:
url_main
url_temp
url_test
I want to say: "Ok, if `url_main` exists, use that, otherwise user `url_test` and then use `url_temp`"
Is it, therefore, possible to create a custom import transform that references columns and merges them into one based on conditions? | 0 | [
2,
12666,
1886,
7498,
19,
7238,
8294,
106,
800,
3726,
3726,
31,
22,
79,
568,
4865,
1406,
22,
18,
13,
1,
9077,
197,
8294,
106,
1,
20,
9010,
21,
272,
18,
710,
3893,
77,
51,
1054,
16828,
9,
31,
22,
195,
330,
21,
234,
16,
7498,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
error in logic calling one PHP function from another PHP function
===
We have a "gotItem" function which, if run on an Item with an "on_hand" value of "1", should also call the "outItem" function. For some reason, the "gotItem" function is calling the "outItem" function whether or not the "on_hand" value is "1" or "0". Any ideas why? Code is below;
function gotItem( $user_item_id, $user_id ) {
$user_item = $this->getUserItem( $user_id, $user_item_id );
if ( ( ! is_null( $user_item ) ) && ( $user_item['on_hand'] = '1' ) )
$this->outItem( $user_item_id, $user_id ); | 0 | [
2,
7019,
19,
7085,
2555,
53,
13,
26120,
1990,
37,
226,
13,
26120,
1990,
800,
3726,
3726,
95,
57,
21,
13,
7,
7597,
2119,
79,
7,
1990,
56,
15,
100,
485,
27,
40,
9101,
29,
40,
13,
7,
218,
1,
3203,
7,
1923,
16,
13,
7,
165,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Set foreground text color of checkbox items in a wpf listbox
===
I have several lists containing data from a db. The listboxes serves as filters for a chart, and the appearance of the listboxes should change depending on what is selected in other listboxes.
Here is a simplified example of what I'm trying to do specifically:
Class Region
{
public int RegionID { get; set; }
public string RegionName { get; set; }
}
Class Country
{
public int CountryID { get; set; }
public string CountryName { get; set; }
public int RegionID { get; set; }
}
private void fillListBoxes()
{
List<Region> allRegions = getRegions();
lstRegionsFilter.ItemsSource = allRegions;
}
A country obviously belongs to a region, and I also have for example Ports, which is then located in a country etc etc.
All listbox items are checkboxes defined like this:
<ListBox Name="lstRegionsFilter">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Content="{Binding Path=RegionName}"
Tag="{Binding Path=RegionID}"
Click="CheckBox_Click"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
As items in any listbox is clicked they are added to a list of filters which will filter the data displaying the chart. So for example if "Europe" is selected under Regions then all Countries that belongs to Europe should be colored differently in the listbox for countries, for example blue.
So in code I want to loop through the **check boxes** in the country-listbox and set its foreground color to something depending on if the value displayed/tagged to that checkbox is a country that belongs to the selected Region so typically in a foreach loop. However the items in the listbox is of type Region so how can I access the underlying checkbox? This should be pretty basic stuff I know, but its driving me nuts!
| 0 | [
2,
309,
26,
62,
8810,
1854,
1665,
16,
2631,
5309,
3755,
19,
21,
619,
7721,
968,
5309,
800,
3726,
3726,
31,
57,
238,
7227,
3503,
1054,
37,
21,
13,
9007,
9,
14,
968,
5309,
160,
2589,
28,
21062,
26,
21,
1795,
15,
17,
14,
1468,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to pass Event as a parameter in JQuery function
===
Hi I am learning JQuery and I have written a small function where I am attaching a function with a button's click event.
this is the head element of the HTML
<script type ="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(pageLoaded);
function pageLoaded()
{
$("#Button1").bind("click",
{ key1: "value1", key2: "value2" },
function buttonClick(event)
{
$("#displayArea").text(event.data.key1);
}
);
}
</script>
This is the body of the HTML
<input id="Button1" type="button" value="button" />
<div id = "displayArea" style="border:2px solid black; width:300px; height:200px">
This code works fine. But when I try to write the buttonClick function outside the anonymus method, it does not work anymore.
I tried to call it this way:
$("#Button1").bind("click",
{ key1: "value1", key2: "value2" },
buttonClick(event));
function buttonClick(var event)
{
$("#displayArea").text(event.data.key1);
}
This is not working. Am I doing some mistake while passing the Event as parameter? what is the correct way to do it without using anonymous methods? | 0 | [
2,
184,
20,
1477,
807,
28,
21,
18906,
19,
487,
8190,
93,
1990,
800,
3726,
3726,
4148,
31,
589,
2477,
487,
8190,
93,
17,
31,
57,
642,
21,
284,
1990,
113,
31,
589,
19514,
68,
21,
1990,
29,
21,
5167,
22,
18,
10840,
807,
9,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to Covert RGB Value To Color object in Windows phone Application?
===
i get some Color Value like #FF6100.
now i was need Covert #FF6100 to a Color Object in my Windows phone Application?
is There have any suggestion?
TX
| 0 | [
2,
184,
20,
19953,
761,
11400,
1923,
20,
1665,
3095,
19,
1936,
1132,
3010,
60,
800,
3726,
3726,
31,
164,
109,
1665,
1923,
101,
6926,
2460,
379,
4031,
9,
130,
31,
23,
376,
19953,
6926,
2460,
379,
4031,
20,
21,
1665,
3095,
19,
51,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... |
Error of popupbox: unable to locate element, using
===
I whrite this code in console: @b.text_field(:name => 'popupbox[title]').set 'Title'
I become no error, all works.
I whrite this code in test-code: @b.text_field(:name => 'popupbox[title]').set 'Title'
I become this error: unable to locate element, using...
Where ist problem? Can you please help me? This would be nice! | 0 | [
2,
7019,
16,
1675,
576,
5309,
45,
2343,
20,
12717,
4520,
15,
568,
800,
3726,
3726,
31,
11153,
8011,
48,
1797,
19,
8650,
45,
13,
1,
220,
9,
11969,
1,
1109,
5,
45,
7259,
800,
1,
13,
22,
6057,
576,
5309,
2558,
22235,
500,
22,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sencha Touch 2 native app along with Phonegap for Android
===
I have a project that I created with Phonegap and Sencha. I can create an apk file with Eclipse, but I want to try to build and package the app natively with Sencha touch 2. I created the config.json file and ran the sencha package command, but the apk it generated does not want to install. This makes me think I'm missing something or things..
Should the app.json folder be created or does the sencha builder generate it somehow?
I am completely lost with this and none of the sencha documentation has really helped so far. There's some question left unanswered every time.
Can anyone explain what the requirement for a project is for this to work or direct me to a step by step explanation, please? | 0 | [
2,
8252,
1651,
1723,
172,
1275,
4865,
303,
29,
1132,
1136,
306,
26,
13005,
800,
3726,
3726,
31,
57,
21,
669,
30,
31,
679,
29,
1132,
1136,
306,
17,
8252,
1651,
9,
31,
92,
1600,
40,
21,
17244,
3893,
29,
11652,
15,
47,
31,
259,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Regex to match separate integer list in c#
===
I want to match comma separate integer list using Regex. I have used bellow pattern but it doesn't work for me.
if (!Regex.IsMatch(textBox_ImportRowsList.Text, @"^([0-9]+(,[0-9]+))*"))
{
errorProvider1.SetError(label_ListRowPosttext, "Row Count invalid!");
}
Valid Inputs:
1
1,2
1,4,6,10
Invalid Inputs:
1,
1.1
1,A
2,/,1
,1,3
Please help me.
| 0 | [
2,
7953,
1706,
20,
730,
1725,
13820,
968,
19,
272,
5910,
800,
3726,
3726,
31,
259,
20,
730,
11951,
58,
1725,
13820,
968,
568,
7953,
1706,
9,
31,
57,
147,
23040,
3732,
47,
32,
1437,
22,
38,
170,
26,
55,
9,
100,
13,
5,
187,
1246... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
angularjs jsonp don't work localy
===
I tried out one of Angulars demo and wanted to play with jsonp. And i could not get it to work, so i pasted the same code into jsbin so i can ask you guys whats wrong with it. And notice that it worked.
Tried the exact same code again on my dev-site. and it dose not work. i can see the network log in webkit that i get a valid json back with http code 200. but no callback is executed.
I ended up trying out jQuery-Ajax on the same request and that worked fine. for me
$(document).ready(function() {
$.getJSON('http://angularjs.org/greet.php?callback=?&name=Super%20Hero', function(data) {
console.log(data); // Works
});
});
Here is a demo of my code that dosn't work localy
http://jsbin.com/ojibel/edit#html,live | 0 | [
2,
18270,
728,
18,
487,
528,
306,
221,
22,
38,
170,
375,
93,
800,
3726,
3726,
31,
794,
70,
53,
16,
18270,
18,
8376,
17,
417,
20,
418,
29,
487,
528,
306,
9,
17,
31,
110,
52,
164,
32,
20,
170,
15,
86,
31,
640,
69,
14,
205,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PyDev code analysis missing
===
I have installed Eclipse 3.7.2 from APT in Ubuntu 12.04, and installed PyDev in Eclipse. First, it warns unused import and unused wild import, but it no longer displays them today. However, it can display errors like missing parenthesis.
I created a new user, and installed PyDev using that user, problem still happens. How can I enable them for warnings? I have not change the code analysis settings. | 0 | [
2,
7103,
14438,
1797,
2495,
2863,
800,
3726,
3726,
31,
57,
4066,
11652,
203,
9,
465,
9,
135,
37,
21,
4417,
19,
287,
12968,
2473,
390,
9,
3277,
15,
17,
4066,
7103,
14438,
19,
11652,
9,
64,
15,
32,
9296,
18,
18927,
9010,
17,
18927... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
google-tv development Environment
===
Hi am an android developer and now I want to learn google TV development.
I want to know how to set up development environment and emulator for execution.
I already have android Development environment using Eclipse 3.5 on ubuntu 10.10
one more thing is it possible to develop google tv App using iOS. | 0 | [
2,
8144,
8,
1709,
522,
2307,
800,
3726,
3726,
4148,
589,
40,
13005,
10058,
17,
130,
31,
259,
20,
2484,
8144,
983,
522,
9,
31,
259,
20,
143,
184,
20,
309,
71,
522,
2307,
17,
3579,
14868,
26,
5769,
9,
31,
614,
57,
13005,
522,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to handle figure overlapping in Graphiti?
===
I have a big rectangle and a small rectangle made of graphiti, now when I drag small rectangle over big rectangle then I am not able to select that small rectangle instead big rectangle got selected.
In short that small rectangle doesn't has mouse event until it is on big rectangle.
So is there any way when we drag any figure1 over other figure2, then figure1 should be draggable instead of figure2.
I have remove all selectable properties and draggable properties from big rectangle ( figure2 ) but its not working.Please help me for the same as it is very important.
Thanks in advance:) | 0 | [
2,
184,
20,
3053,
1465,
23854,
19,
7210,
8793,
60,
800,
3726,
3726,
31,
57,
21,
580,
27181,
17,
21,
284,
27181,
117,
16,
7210,
8793,
15,
130,
76,
31,
5501,
284,
27181,
84,
580,
27181,
94,
31,
589,
52,
777,
20,
5407,
30,
284,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error HRESULT 0x88982F72 when trying streaming image file
===
I'm trying to stream an image file with the simple code below.
Stream stream = File.OpenRead(myFileInfo.ToString());
When I do it, Visual Studio send me an exception.
This file is a simple jpeg.
In Debug mode, I see with the BitmapDecoder class that my file has not Frames. In comparission with other files of same extension, all have one Frame.
Thanks.
My excpetion detail below:
System.IO.IOException was unhandled by user code
HResult=-2146232800
Message=Impossible de lire à partir du flux.
Source=PresentationCore
StackTrace:
à System.Windows.Media.ColorContext.GetColorContextsHelper(GetColorContextsDelegate getColorContexts)
à System.Windows.Media.Imaging.BitmapFrameDecode.get_ColorContexts()
à System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
à System.Windows.Media.Imaging.BitmapImage.EndInit()
à EDIs.Imaging.Converter.UriToBitmapSourceConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture) dans C:\Users\Gaet\Documents\Visual Studio 2010\Projects\DotNet\MDP.EDIs\EDIs.Imaging\Converter\UriToBitmapSourceConverter.cs:ligne 40
à System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
à System.Windows.Data.BindingExpression.Activate(Object item)
à System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
à System.Windows.Data.BindingExpression.AttachOverride(DependencyObject target, DependencyProperty dp)
à System.Windows.Data.BindingExpressionBase.OnAttach(DependencyObject d, DependencyProperty dp)
à System.Windows.StyleHelper.GetInstanceValue(UncommonField`1 dataField, DependencyObject container, FrameworkElement feChild, FrameworkContentElement fceChild, Int32 childIndex, DependencyProperty dp, Int32 i, EffectiveValueEntry& entry)
à System.Windows.FrameworkTemplate.ReceivePropertySet(Object targetObject, XamlMember member, Object value, DependencyObject templatedParent)
à System.Windows.FrameworkTemplate.<>c__DisplayClass6.<LoadOptimizedTemplateContent>b__4(Object sender, XamlSetValueEventArgs setArgs)
à System.Xaml.XamlObjectWriter.OnSetValue(Object eventSender, XamlMember member, Object value)
à System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
à System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
à System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(ObjectWriterContext ctx)
à System.Xaml.XamlObjectWriter.WriteEndObject()
à System.Xaml.XamlWriter.WriteNode(XamlReader reader)
à System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
InnerException: System.Runtime.InteropServices.COMException
HResult=-2003292302
Message=Exception de HRESULT : 0x88982F72
ErrorCode=-2003292302
InnerException: | 0 | [
2,
7019,
746,
29955,
713,
396,
3020,
3804,
135,
410,
4009,
76,
749,
11920,
1961,
3893,
800,
3726,
3726,
31,
22,
79,
749,
20,
3766,
40,
1961,
3893,
29,
14,
1935,
1797,
1021,
9,
3766,
3766,
800,
3893,
9,
10157,
10647,
5,
915,
16877,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jQuery smooth-scrolling navigation menu bar
===
So I have been experimenting with RootsTheme (which uses Bootstrap), Wordpress (from Joomla! background) and Pagodabox;
here's the result of it: http://ajmalafif.com/
However I am having some known issues with the navigation bar with any javascript solution that I've tried:
route #1) Chris Coyier's smooth-scrolling
Currently my site runs on this one.
what doesn't work
- for smaller screen or when browser resized, the nav will stop at awkwardly at much higher height (since it's set to offset at -90px on > 1200px screen width)
what works
- the next & previous link button for images work (click on mysite.com#link doesn't conflict between the nav bar anchor and the image link click anchor)
example of the code: http://jsfiddle.net/ajmalafif/LvPUC/1/
route #2) William Malo's getElementbyId
I like and used this solution at first.
what doesn't work
- it doesn't have offset solution so it stops directly on the h1 title and blocks the view of it.
- it conflicts with the bootstrap-carousel.js where upon click the image carousel, the screen/navbar will moves and align the image with the top of the browser.
what works
- It works with any browser size (and upon resized) and targets/arrives accordingly.
example of the code: http://jsfiddle.net/ajmalafif/bReUF/
--
It may looks like route#1 is the clear winner but like what's currently running on my site, it has few glitches especially when view, say inside an iPad. So is there any pointer/help I can get to make this works either by;
- a href target is accurately offset regardless of the browser width (maybe a solution to have diff offset based on diff browser's width)?, OR
- a way to offset when using getElementbyId solution (see route#2) AND to make it compatible with bootstrap-carousel.js (so it doesn't move itself when click another image carousel # anchor tag)?
Thanks for your concern and time for taking a look at this. | 0 | [
2,
487,
8190,
93,
3905,
8,
28166,
8368,
11379,
748,
800,
3726,
3726,
86,
31,
57,
74,
5737,
68,
29,
5163,
124,
790,
13,
5,
2140,
2027,
5894,
16514,
6,
15,
833,
5890,
13,
5,
2665,
2640,
2636,
531,
187,
2395,
6,
17,
26298,
5309,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Google maps, panel with all ballons to drag/drop on the map
===
I am developing a web page which embedded a "Google maps" view.
In this web page, the user must specify several positions on the maps
At this time, I am able to spread the balloons on the map displayed when the user click on a button to be dragged, but according to the zoom it can be very painful to zoom in and out to drag the balloon to a place.
I would like to know if it could be possible to have a panel with all balloons to drag/drop on the map?
My current development :
![enter image description here][1]
My target :
![enter image description here][2]
[1]: http://i.stack.imgur.com/m08hZ.jpg
[2]: http://i.stack.imgur.com/gyR9Q.jpg | 0 | [
2,
8144,
6867,
15,
4113,
29,
65,
1592,
4710,
20,
5501,
118,
12361,
27,
14,
2942,
800,
3726,
3726,
31,
589,
3561,
21,
2741,
2478,
56,
12138,
21,
13,
7,
16111,
4875,
6867,
7,
1418,
9,
19,
48,
2741,
2478,
15,
14,
4155,
491,
19077,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Two Forms One Submission
===
My site has three columns. I have two fields within a form that need to be in the left column and 1 field of what is currently a different form that needs to be in the middle column. The thing is, I want them to behave as one form... (or be one form if that is possible).
When The form is submitted, the data from all the fields, needs to be passed to the action page.
What is the best way of achieving this? h | 0 | [
2,
81,
1997,
53,
10923,
800,
3726,
3726,
51,
689,
63,
132,
7498,
9,
31,
57,
81,
2861,
363,
21,
505,
30,
376,
20,
44,
19,
14,
225,
4698,
17,
137,
575,
16,
98,
25,
871,
21,
421,
505,
30,
2274,
20,
44,
19,
14,
772,
4698,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jasper ireport query design
===
I need to draw a chart in Jasper iReport that can sum the results based on user selection.
Let's say I have the fruits table:
id (pk) town bananas orange cherry
1 boston 5 0 11
2 paris 100 18 12
3 bucharest 10 3 9
4 barcelona 9 4 12
From a Jasper input control with a parameter associated (java.util.collection) user will select the fruit/fruits.
I need to sum all the fruits selected by users and plot the chart.
The problem is:
I can't do
`select sum(bananas,orange) from fruits`.
sum function doesn't work this way, but this is the way jasper input control return the user selection back to report query.
I've tried SELECT (SELECT REPLACE('bananas,orange', ',', '+')) from fruits, but MySQL doesn't recognize the replace statement as column name.
Any idea?
Thanks!
| 0 | [
2,
16750,
31,
17437,
25597,
704,
800,
3726,
3726,
31,
376,
20,
2003,
21,
1795,
19,
16750,
31,
17437,
30,
92,
3907,
14,
1736,
432,
27,
4155,
3155,
9,
408,
22,
18,
395,
31,
57,
14,
12505,
859,
45,
4924,
13,
5,
17244,
6,
286,
136... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ILookup how can I use a Where method?
===
My lookup:
var myLookup = myList.ToLookUp(x=> new {x.Name, x.Job, x.Phone});
What I'm trying to do:
`x.Name` can contain a string of a job, or a string of a list of jobs, i.e. `"Programmer"` or `"QA, Programmer"`.
The below statement will loop thru available jobs, and match them with what is in my lookup:
foreach(var j in jobs)
{
foreach(var m in myLookup[new {j.Name, j.Job, j.Phone}])
{
//do whatever
}
}
Now, this works fine for any job Name that isn't set up with a comma, so then I tried this:
foreach(var j in jobs)
{
foreach(var m in myLookup[new {j.Name, j.Job, j.Phone}].Where(x=>x.Name.Contains(j.Name))
{
//do whatever
}
}
But that still doesnt seem to work. It just matches the Names exactly like the other way.
How can I incorporate a contains or a Where on my lookup? | 0 | [
2,
31,
5810,
576,
184,
92,
31,
275,
21,
113,
2109,
60,
800,
3726,
3726,
51,
361,
576,
45,
4033,
51,
5810,
576,
800,
51,
5739,
9,
262,
5810,
576,
5,
396,
3726,
1,
78,
13,
1,
396,
9,
7259,
15,
993,
9,
1636,
220,
15,
993,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript add to value if smaller than another value error for more than one digit
===
I've got a javascript function that adds one to a quantity if the current value is less than another value. Here is the javascript function:
function addQty()
{
if(document.getElementById("quantity").value < document.getElementById("stock").value)
document.getElementById("quantity").value++;
else
return;
}
And here are the form elements that the values are taken from:
<input type='text' id="quantity" name='quantity' value ='0' />
<input type='hidden' id="stock" name="stock" value="<?php echo $adjustedStock; ?>" />
So basically the user can add one to their quantity of a product to order only if there is enough in stock.
Now, this works absolutely fine if the number in stock is 1-9, but if the stock level is in double digits, the maximum the user can add to their basket (ie the 'quantity' in the code) returns as the first digit + 1. So if the stock is 13 then the max quantity is 2, or if the stock is 63 the max quantity is 7.
I've tried converting the integer value of $adjustedStock to a string before it is used in the form as I read sometimes browsers can behave weirdly in this situation, but this didn't work. Any ideas why this is happening?
Thanks in advance! | 0 | [
2,
8247,
8741,
3547,
20,
1923,
100,
2012,
119,
226,
1923,
7019,
26,
91,
119,
53,
15611,
800,
3726,
3726,
31,
22,
195,
330,
21,
8247,
8741,
1990,
30,
10621,
53,
20,
21,
12881,
100,
14,
866,
1923,
25,
787,
119,
226,
1923,
9,
235,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
BeagleBoard C5 Building u-boot
===
I am trying to successfully build u-boot for my BeagleBoard C5 board. I am using Ubuntu 10.04 and the Crosstool-NG toolchain. I have working images for Xloader (MLO), u-boot.bin, and uImage that I found prebuilt from the AngstromBB project for which the boards boots Angstrom successfully.
I can successfully build the u-boot.bin file by doing the following:
git clone git://git.denx.de/u-boot.git u-boot/
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- omap3_beagle_config
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
I then copy my just built u-boot.bin to replace the working version of u-boot.bin on the SD card and attempt to boot the board but it fails by hanging at:
Reading boot sector
Loading u-boot.bin from mmc
It will just sit there forever! I cannot seem to find any clear instructions on building u-boot for the C5 BeagleBoard other than that it is different then previous versions or requiring something called 'SPL' built with u-boot. Does anybody know how I might succeed in building my own u-boot.bin image for the BeagleBoard C5? | 0 | [
2,
334,
19799,
2806,
272,
264,
353,
287,
8,
10858,
38,
800,
3726,
3726,
31,
589,
749,
20,
3673,
1895,
287,
8,
10858,
38,
26,
51,
334,
19799,
2806,
272,
264,
686,
9,
31,
589,
568,
287,
12968,
2473,
332,
9,
3277,
17,
14,
919,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
In-memory Unit Testing: LINQ to SQL: Repository TDD
===
I have a repository implemented using LINQ to SQL. I need to do Unit Testing though I don't have a database. How can I write the UT for GetAllAccountsForUser method using in memory Data Context? Can you please show an example?
Repository Layer
namespace RepositoryLayer
{
public interface ILijosBankRepository
{
System.Data.Linq.DataContext Context { get; set; }
List<DBML_Project.BankAccount> GetAllAccountsForUser(int userID);
void UpdateBankAccountUsingStoredProcedure();
}
public class LijosSimpleBankRepository : ILijosBankRepository
{
public System.Data.Linq.DataContext Context
{
get;
set;
}
public List<DBML_Project.BankAccount> GetAllAccountsForUser(int userID)
{
IQueryable<DBML_Project.BankAccount> queryResultEntities = Context.GetTable<DBML_Project.BankAccount>().Where(p => p.AccountOwnerID == userID);
return queryResultEntities.ToList();
}
public virtual void UpdateBankAccountUsingStoredProcedure()
{
//Context.GetStroedProcedures();
}
}
}
| 0 | [
2,
19,
8,
790,
5171,
93,
1237,
4431,
45,
6294,
1251,
20,
4444,
255,
45,
24869,
15596,
43,
800,
3726,
3726,
31,
57,
21,
24869,
6807,
568,
6294,
1251,
20,
4444,
255,
9,
31,
376,
20,
107,
1237,
4431,
362,
31,
221,
22,
38,
57,
21,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JavaFX NumberAxis turn off Auto Hide/Scale behavior
===
Using JavaFX 2.1 the NumberAxis, when used with a chart such as a ScatterChart, has a feature that as the viewable is resized the chart is resized.The NumberAxis resizes and as it gets smaller it will hide Labels that don't fit, or as it gets bigger will add new ticks between labels that are show. (Even if setMinorTickVisible(false) is called).
In my case I have specific labels I want to use for certain numeric values. So I wrote my own StringConverter<Number> and called setTickLabelFormatter() on the NumberAxis
The problem is as it resizes I want to make sure exactly ALL of the labels show up in the display. However resizing will hide the labels I want to show (if it gets too small) or add unwanted ticks if it gets too large.
How can I override the behavior of the Number Axis to not do this?
Or alternatively How can I properly size my chart to show just the labels I need/want (adding a scroll pane if needed).
Thanks for the help I am a long time Java Developer that is just learning JavaFX | 0 | [
2,
8247,
16488,
234,
19676,
805,
168,
3108,
3077,
118,
5093,
3257,
800,
3726,
3726,
568,
8247,
16488,
172,
9,
165,
14,
234,
19676,
15,
76,
147,
29,
21,
1795,
145,
28,
21,
27465,
5433,
38,
15,
63,
21,
1580,
30,
28,
14,
1418,
579,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
since c# how to do, mydate between date1 and date2
===
i am using
c#,sqlce,datatable,
well i need something as this:
select price from products where productid=myproduct and mydate between startdate and finaldate and
clientid=myclient
so if i do this query for all my products it's going to take much time
so i need something as this
datatable prices = new datatable();
prices=this.returntable("select productid,startdate,finaldate,client from products")
for(int i=0;i<allproductsihave;i++) {
product.newprice=this.getmyprice(prices,product.client,product.id,product.date);
}
private decimal getmyprice(datatable products,string myclient, string
myproduct, datetime mydate) { //how do i do at here the equivalent to
first sql query? //for select a product from a datatable where my date
is between 2 dates, //and client=myclient and productid=myproduct
return Convert.Todecimal(
datatable.prices[something]["price"].tostring()); }
so i dont conect to database for everyproduct
is it posible?
> maybe doing convert.todatetime to startdate and finaldate?
| 0 | [
2,
179,
272,
5910,
184,
20,
107,
15,
51,
8209,
128,
1231,
165,
17,
1231,
135,
800,
3726,
3726,
31,
589,
568,
272,
5910,
15,
18,
22402,
1105,
15,
18768,
5924,
15,
134,
31,
376,
301,
28,
48,
45,
5407,
2162,
37,
1985,
113,
2374,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to diagnose leaked http connections (org.apache.http.impl.conn.tsccm.ConnPoolByRoute)
===
I have a multithreaded java program that runs on Amazon's EC2. It queries and fetches data items from a vendor via HttpPost and HttpGet, using a org.apache.http.impl.client.DefaultHttpClient. Concurrently, it pushes the retrieved data items into S3 using AWS's Java SDK.
After a few days of running, I get the symptoms that normally come with http connection leaks:
org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection
at org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:417)
at org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolByRoute.java:300)
at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnection(ThreadSafeClientConnManager.java:224)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:391)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
Since both AWS and my requests to the data vendor use Http connections, I am not quite sure where exactly I forget to `HttpEntity.consume()`, or `S3ObjectInputStream.close()` (unless it is yet something else...).
So here is my question: are there ways to monitor `org.apache.http.impl.conn.tsccm.ConnPoolByRoute` so that at least I can **detect** when I am starting to leak connections/entities not properly consumed/http streams not closed? (I have a feeling it happens only under certain conditions, e.g. when certain exceptions are being thrown, by-passing the logic in my code that consumes HttpEntities, closes streams, etc.) Any idea on how to diagnose what eventually causes all my http connections to fail with that ConnectionPoolTimeoutException would be most welcome. I don't feel like waiting 4+ days between attempts to fix the root cause of the problem.
| 0 | [
2,
184,
20,
28438,
17719,
7775,
6760,
13,
5,
5583,
9,
7738,
2569,
9,
21127,
9,
8983,
255,
9,
1126,
103,
9,
38,
18,
3384,
79,
9,
1126,
103,
13378,
779,
20179,
6,
800,
3726,
3726,
31,
57,
21,
1889,
96,
10647,
69,
8247,
625,
30,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Iterating over all tags in a string containing HTML using javascript/jquery
===
I'm using a rich text editor type control, which is a written as a jquery plugin. It basically inserts an IFrame onto the page, and makes it editable - fairly standard for rich text controls.
Now, what I'm looking to do is improve upon an option which removes all formatting from the text editor. Currently it is being done with a large list of regular expressions, and a quick google search suggests that this is not the correct way to go about it. I'm looking to allow this unformatting some degree of flexability, so that I can leave certain tags in (like paragraph tags).
I was trying to use the jqeury built in DOM parsing to do this easily, but I seem to be having trouble. Some sample code
//Some very simple HTML obtained from an editable iframe
var text = '<Body><p>One <strong>Two</strong> <em>Three</em></p></Body>';
var $text = $(text);
//All tags which are not paragraphs
$(':not(p)',$text).each(function() {
//Replace the tag + content with just content
$(this).html($(this).text());
});
//I'll be honest, I found this snippet somewhere else on stackoverflow,
//It seems to parse the jquery object back into an HTML string.
var returnVal = "";
$text.each(function(){
returnVal += $(this).clone().wrap('<p>').parent().html();
});
//Should be equal to '<p>One Two Three</p>'
return returnVal;
This seems like it should work, but unfortunately it doesn't. In the above example, 'returnVal' is the same as the input (minus the 'body' header tags). Is there anything I'm obviously doing wrong here? | 0 | [
2,
32,
106,
1880,
84,
65,
3383,
18,
19,
21,
3724,
3503,
13,
15895,
568,
8247,
8741,
118,
728,
8190,
93,
800,
3726,
3726,
31,
22,
79,
568,
21,
2042,
1854,
1835,
1001,
569,
15,
56,
25,
21,
642,
28,
21,
487,
8190,
93,
10922,
108,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the proper way to represent sports results in a database
===
e.g. _Barcelona - Madrid 4:1_ or _Arsenal - Chelsea 2:0_
Which data types are good to represent 4:1 and 2:0 etc?
The options that come to mind are:
1. Two smallints
2. One decimal (i.e. 4.1 and 2.0)
3. One point (i.e. 4,1 and 2,0)
Anything else? How'd you do it? It must be easy to retrieve who's won the game and what the difference in goals was, which makes me tend to the first option but maybe there is more (memory considerations...)?
| 0 | [
2,
98,
22,
18,
14,
4119,
161,
20,
3501,
1059,
1736,
19,
21,
6018,
800,
3726,
3726,
13,
62,
9,
263,
9,
13,
1,
1850,
11040,
5207,
13,
8,
6307,
13,
28379,
1,
54,
13,
1,
512,
1264,
192,
13,
8,
9526,
4274,
387,
1,
56,
1054,
255... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.