unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
htaccess url rewrite and images and rewrite rules
===
Can you see a problem with my htaccess rewrite rules? because it allways matches images so the browser never can get to them
The images are in a folder `images` which is in the root of the web application.
Also the js and css files were redirected badly. This should have been solved by the `!-d` and `!-f` but it seems that it does noting to the url rewrite.
RewriteEngine On
RewriteBase /
RewriteRule ^.*mootools.*\.js$ mootools.v1.11.js
RewriteRule ^.*javascript\.js$ javascript.js
RewriteRule ^.*style\.css$ style.css
RewriteRule ^.*slimbox\.css$ slimbox.css
RewriteRule ^.*slimbox\.js$ slimbox.js
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?.html$ ?arg1=$1 [L,QSA] | 0 | [
2,
13,
9020,
20604,
287,
6362,
27891,
17,
3502,
17,
27891,
1761,
800,
3726,
3726,
92,
42,
196,
21,
1448,
29,
51,
13,
9020,
20604,
27891,
1761,
60,
185,
32,
65,
11000,
1717,
3502,
86,
14,
16495,
243,
92,
164,
20,
105,
14,
3502,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
"a" dateTimePattern doesn't work in Flex 4 spark DateTimeFormatter
===
I set dateTimePattern equals "a" for DateTimeFormatter, but it's doesn't work. I see nothing instead of "AM" or "PM". Other patterns like "hh", "mm", "M" etc work. Does anyone know how to make "a" pattern work? | 0 | [
2,
13,
7,
58,
7,
1231,
891,
5972,
8766,
1437,
22,
38,
170,
19,
14409,
268,
9026,
1231,
891,
23588,
815,
800,
3726,
3726,
31,
309,
1231,
891,
5972,
8766,
2747,
18,
13,
7,
58,
7,
26,
1231,
891,
23588,
815,
15,
47,
32,
22,
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... |
Android Bluetooth example & OBEX
===
I have a device which only support the OBEX Object Push Protocol. I want to transmit data from this device to my android device. After hours for reading, testing and frustration, I hope someone @ StackOverflow can help me out. So here it goes:
What I figured out:
1. I need to implement an server functionality in my android app.
2. Since I know the `MAC` address of the device I can connect directly to this device.
Can I use the Bluetooth classes in Android SDK to solve my problem? Because the phone should only pair with the device, connect and transmit data. I can't figure out anywhere whenever the Bluetooth classes in the Android SDK supports the OBEX Protocol.
Can I use the `Bluetooth chat example` to establish a connection between the phone and the device and transmit data? Does anyone have an example of how to write the server-side for listening to ports/channels and retrieving data? I have googled all week after a solution, so I am very greatful if someone knows how I can accomplish this task.
| 0 | [
2,
13005,
705,
15808,
823,
279,
14222,
396,
800,
3726,
3726,
31,
57,
21,
3646,
56,
104,
555,
14,
14222,
396,
3095,
3250,
8494,
9,
31,
259,
20,
18745,
1054,
37,
48,
3646,
20,
51,
13005,
3646,
9,
75,
974,
26,
1876,
15,
4431,
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... |
Is it possible to create variable in parent class, that would initialized once per derrived type?
===
I'm using IDataErrorInfo interface to validate my entities. As long as validation logic is reading metadata from attributes, it is the same for all entities, so I've created class
public class DataErrorInfo : IDataErrorInfo
And all entities are derriving from it. Thing is, that I wish to cache reflection info for derived classes to speed up validation, so every entity type should initialize this cache once per running application.
I was thinking to use `static readonly` field, but found out, that it is initialized with first used entity type's reflection info, so if there's entity A and entity B, and entity A is accessed first, entity B will have entity A reflection cache. | 0 | [
2,
25,
32,
938,
20,
1600,
7612,
19,
4766,
718,
15,
30,
83,
2104,
1333,
382,
416,
2223,
9655,
69,
1001,
60,
800,
3726,
3726,
31,
22,
79,
568,
31,
18768,
29992,
108,
4120,
6573,
20,
7394,
1373,
51,
12549,
9,
28,
175,
28,
27999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Smart way to implement a carousel slideshow
===
I am creating my own carousel slideshow for images, using Jquery.
Currently i have a div which act as viewport with overflow: invisible; and inside i have a veeery long div with all the different images one next to each other.
This mean that the div could be several thousands pixel wide. I am wondering what if this can be a problem.
I thought to load all the images indipendently and moving them only when needed rather than moving the whole set of slides.
What do you think is a good solution to implement for high performance and lightness?
Thanks | 0 | [
2,
3978,
161,
20,
8713,
21,
27374,
18066,
1544,
800,
3726,
3726,
31,
589,
2936,
51,
258,
27374,
18066,
1544,
26,
3502,
15,
568,
487,
8190,
93,
9,
871,
31,
57,
21,
13,
12916,
56,
601,
28,
1418,
1993,
29,
20285,
45,
8874,
73,
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... |
Get settings from machine.config in my MSbuild target
===
I would like to know if it's possible to get a setting from the machine.config in my MSBuild custom target ?
This is my custom target :
<Target Name="GeosysPublish" DependsOnTargets="Build">
<WebAppDeploy WebAppDestination="xxxxxxxxxxx" WebAppFileName="$(ProjectFileName)" WebAppRoot="$(ProjectDir)" />
</Target>
And this is my setting in the machine.config file :
<appSettings>
<add key="DeployFolder" value="C:\Deploy" />
</appSettings>
How can I get this setting ? | 0 | [
2,
164,
12410,
37,
1940,
9,
14093,
2816,
19,
51,
4235,
29361,
2935,
800,
3726,
3726,
31,
83,
101,
20,
143,
100,
32,
22,
18,
938,
20,
164,
21,
2697,
37,
14,
1940,
9,
14093,
2816,
19,
51,
4235,
29361,
5816,
2935,
13,
60,
48,
25,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Authorize.net SIM receive data and update database
===
I've signed up for Authorize.net and successfully:
1. Converted my shopping cart into data that sends TO Authorize.net and processes it.
2. Using Relay Response, sent user to my thank you page.
I cannot get my head wrapped around how to actually UPDATE my database once the transaction goes through. What terms do I search for to figure this out? Nearly all the documentation shows part of the solution but doesn't actually instruct on where to put it and how to receive it back.
On my Shopping Cart page, I have a list of hidden input fields that Authorize.net provides. I plugged in my dollar amount, description, etc. I assume I put another hidden field called "x_po_num" and have the value be my dynamic PO# in the database.
Isn't there a way to actually retrieve it on the Thank You page so I cross reference to the database and make simply add a value of "confirmed" or something?
How do I retrieve that value that was sent TO Authorize.net? | 0 | [
2,
1314,
2952,
9,
2328,
4861,
2588,
1054,
17,
11100,
6018,
800,
3726,
3726,
31,
22,
195,
908,
71,
26,
1314,
2952,
9,
2328,
17,
3673,
45,
137,
9,
3494,
51,
4884,
6420,
77,
1054,
30,
11350,
20,
1314,
2952,
9,
2328,
17,
5102,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 keep the 2D option while transitioning to 3D with JMonkey?
===
I made a 2D simple game and now I try make it 3D by adding in the JMonkey jars. Then instead of being a Frame my main class will by a jmonkeyengine.SimpleApplication but I still want to keep the option of the 2D while in development and for computers with no hardware acceleration. Java doesn't support multiple inheritance and I can't make it defined as an `Object`since it won't know what methods it has. So after some thought I could get it to work the way I wanted by adding this thing:
package adventure;
import java.awt.*;
public interface Playable {
public void playSound(String s);
public Image loadPicture(String s);
}
It is the first time I've been forced to write an interface knwoing no other way to handle this. Now I can play sounds and load pictures on a Playable that's either a JMonkey app or an AWT Frame:
`public class Dungeon3D extends SimpleApplication implements Playable {`
while keeping
`public class Adventure extends Frame implements Playable {`
So I can start either the 2D or the 3D version and they use the same World base. In the World class a have the composition:
` public Playable owner;`
then I don't need to test for 3D mode anymore:
public void createPlace(String name, String picture) {
Adventure adv = null;
Dungeon3D app = null;
if (use3D){
app = (Dungeon3D) owner;
places.put( name, new Place( name, app.loadPicture(picture) ) );
}
else{
adv = (Adventure) owner;
places.put( name, new Place( name, adv.loadPicture(picture) ) );
}
}
I can just run the same method on a Playable
/**
* Play `sound' in the Place `place'. The sound will be played by
* any Players currently watching `place'.
* Sound can for example be:
* "songs/what_a_wonderful_world" -- suitable when your key is accepted
* "effects/gong" -- suitable when Troll kills
*
* @param place Place at which the sound will be played.
* @param sound Filename of the sound.
*/
public void playAtPlace(Place place, String sound) {
synchronized (players) {
Iterator<Player> ls = players.iterator();
while ( ls.hasNext() ) {
Player p = ls.next();
if ( p.currentPlace() == place ) {
owner.playSound(sound);
}
}
}
}
}
| 0 | [
2,
184,
20,
643,
14,
172,
43,
4255,
133,
4513,
68,
20,
203,
43,
29,
487,
2111,
4237,
60,
800,
3726,
3726,
31,
117,
21,
172,
43,
1935,
250,
17,
130,
31,
1131,
233,
32,
203,
43,
34,
4721,
19,
14,
487,
2111,
4237,
5112,
18,
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... |
Should ServiceBroker conversations be inside transactions
===
We have some code that looks a bit like this (error handling and other things removed)
using (var tran = conn.BeginTransaction())
{
var client = new Service(...);
var dialog = client.GetConversation(null, conn, tran);
var response = dialog.Receive();
// do stuff with response, including database work
dialog.Send(message, conn, tran);
dialog.EndConversation(conn, tran);
tran.Commit();
conn.Close();
}
We've inherited this code and aren't experts in ServiceBroker, would there be problems if we moved the conversation outside of the transaction like this:
var client = new Service(...);
var dialog = client.GetConversation(null, conn, tran);
var response = dialog.Receive();
using (var tran = conn.BeginTransaction())
{
// do stuff with response, including database work
tran.Commit();
conn.Close();
}
dialog.Send(message, conn, tran);
dialog.EndConversation(conn, tran); | 0 | [
2,
378,
365,
27682,
139,
13527,
44,
572,
13147,
800,
3726,
3726,
95,
57,
109,
1797,
30,
1879,
21,
1142,
101,
48,
13,
5,
29992,
7988,
17,
89,
564,
1974,
6,
568,
13,
5,
3311,
12748,
800,
15201,
9,
17143,
108,
7028,
8645,
5,
6,
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... |
set color limits in python colormap
===
I need to display data from a 2D matrix in a gray colormap, but I need to define it in such a gray scale that white and black are not the colors for the min and max values of the matrix, in order to not saturate the image. What I need is a gray scale colormap with gray levels between 20% and 70%, with at least 20% difference between the levels of gray. Any suggestions?
I'm using the imshow task form matplotlib.
Thanks a lot! | 0 | [
2,
309,
1665,
5887,
19,
20059,
1665,
15022,
800,
3726,
3726,
31,
376,
20,
3042,
1054,
37,
21,
172,
43,
8187,
19,
21,
2030,
1665,
15022,
15,
47,
31,
376,
20,
9267,
32,
19,
145,
21,
2030,
3464,
30,
359,
17,
319,
50,
52,
14,
5268... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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: get dimensions of activity windows
===
in my certain activity, I am using theme -
> android:theme="@android:style/Theme.Dialog"
Is there any way how to find out, actual dimensions of this windows on the screen? My last efforts ended in:
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
which is giving me actual resolution of the whole screen. Any ideas?
Thx
| 0 | [
2,
13005,
45,
164,
9913,
16,
2358,
1936,
800,
3726,
3726,
19,
51,
1200,
2358,
15,
31,
589,
568,
3184,
13,
8,
13,
1,
13005,
45,
124,
790,
3726,
7,
1,
290,
18524,
45,
4381,
118,
124,
790,
9,
4286,
5567,
7,
25,
80,
186,
161,
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... |
Android: Change Background Color of Fragment
===
I tried changing the background color of a fragment, but a small problem occurred.
public class MainActivity extends FragmentActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
So, shown <b>above</b> is the code I had for my main class that calls the XML file for the fragment.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<fragment
android:id="@+id/fragment1"
android:name="com.northreal.practice.FirstFragment"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#CBA>
</fragment>
</LinearLayout>
<b>Above</b> is the main.xml layout that is called by the main class (MainActivity).
public class FirstFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.main, parent, false);
}
}
<b>Above</b> the XML file with the fragment calls this class.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BLAHHHH"
android:layout_gravity="center_vertical" />
</LinearLayout>
This layout <b>above</b> is inflated by the class FirstFragment
So, why doesn't this actually change the color of the background of my fragment?
| 0 | [
2,
13005,
45,
753,
2395,
1665,
16,
14847,
800,
3726,
3726,
31,
794,
4226,
14,
2395,
1665,
16,
21,
14847,
15,
47,
21,
284,
1448,
2437,
9,
317,
718,
407,
19348,
9073,
14847,
19348,
13,
1,
13,
1,
2549,
11891,
317,
11364,
27,
6037,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
should this be mocked or stubed?
===
I have the following method to test and i have written two tests, testing the scenario that an exception is thrown, and im wondering which is correct.
namespace JimBob.CsvImporter.Entity
{
public interface IIOManager
{
Stream OpenFile(string path);
TextReader ReturnReader(string path);
}
public class IOManager : IIOManager
{
public Stream OpenFile(string path)
{
return File.Open(path, FileMode.Open);
}
public TextReader ReturnReader(string filePath)
{
return new StreamReader(filePath);
}
}
public class EntityVerification
{
private IIOManager _iomgr;
public EntityVerification(IIOManager ioManager)
{
this._iomgr = ioManager;
}
...
/// <summary>
/// Ensures user can open file.
/// </summary>
/// <param name="errorMessageList">A running list of all errors encountered.</param>
public void ValidateAccessToFile(string filePath, List<string> errorMessageList)
{
try
{
using (FileStream fs = (FileStream)_iomgr.OpenFile(filePath))
{
if (fs.CanRead && fs.CanWrite) { }
else
{
errorMessageList.Add("Can not read/write to the specified file.");
}
}
}
catch (Exception e)
{
errorMessageList.Add(e.Message);
}
}
Tests:
[Test]
public void ValidateAccessToFile_CanReadWriteToFile_ThrowException()
{
List<String> errorMessageList = new List<string>();
StubService stub = new StubService();
EntityVerification testObject = new EntityVerification(stub);
testObject.ValidateAccessToFile("ergesrg", errorMessageList);
Assert.AreEqual(errorMessageList.Count, 0);
}
[Test]
public void ValidateAccessToFile_CanReadWriteToFile_ThrowsException()
{
Mock<IIOManager> mock = new Mock<IIOManager>();
mock.Setup(x => x.ReturnReader(It.IsAny<string>())).Throws(new InvalidOperation("throw baby."));
EntityVerification testObject = new EntityVerification(mock.Object);
List<String> errorMessageList = new List<string>();
testObject.ValidateAccessToFile("blabla.txt", errorMessageList);
Assert.AreEqual(errorMessageList.Count, 0);
}
public class StubService : IIOManager
{
public Exception ex;
public Stream OpenFile(String path)
{
throw ex;
}
}
Both tests just check that a local variable, in this case errorMessageList, to the test contains something so im not sure which i should be using.
Any comments would be appreciated.
Thanks | 0 | [
2,
378,
48,
44,
25900,
54,
21354,
69,
60,
800,
3726,
3726,
31,
57,
14,
249,
2109,
20,
1289,
17,
31,
57,
642,
81,
4894,
15,
4431,
14,
12705,
30,
40,
5391,
25,
6027,
15,
17,
797,
5712,
56,
25,
4456,
9,
204,
5582,
2170,
12570,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
particleEngine being drawn against a vector C# XNA
===
So i have a problem with calling a vector variable from my particleEmitter, I can draw the particle just fine if it was static or not moving so if i had a vector variable that was set to a fixed position of (x,y) its okay and draws on the screen but if it is one that has been set to move in the x or y axis it does not draw at all.
declared variables:
Vector2 shipPos;
float shipMovement;
ParticleEngine particleEngine;
and i have a method that loads stuff about what should happen with the vectors and the way it should behave:
public void loadEmitter(GameTime gameTime)
{
shipMovement = 2f;
shipPos.Y -= shipMovement;
particleEngine.EmitterLocation = new Vector2(shipPos.X,shipPos.Y);
}
Im trying to get the particleEngine to trail the movement of a ship, what i cant seem to do is get it to draw when i set this up to happen.
Other info : ParticleEngine is a class in itself and basically sets some parameters about how the particles i will be drawing should behave. I have other screens with the spritebatch begin and End calls. Other than that. Heres my main class code.
namespace PlanetDrill2
{
class LaunchScreen : Screen
{
Texture2D LaunchScreenTexture;
Texture2D shipLaunch;
Vector2 shipPos;
float shipMovement;
ParticleEngine particleEngine;
Vector2 smokePos;
public LaunchScreen(Game game, SpriteBatch batch, ChangeScreen changeScreen)
: base(game, batch, changeScreen)
{
}
protected override void SetupInputs()
{
base.SetupInputs();
}
public override void Activate()
{
base.Activate();
}
public void LaunchShip()
{
}
public void loadEmitter(GameTime gameTime)
{
shipMovement = 2f;
shipPos.Y -= shipMovement;
particleEngine.EmitterLocation = new Vector2(shipPos.X,shipPos.Y);
}
protected override void LoadScreenContent(ContentManager content)
{
LaunchScreenTexture = content.Load<Texture2D>("launchTest");
shipLaunch = content.Load<Texture2D>("shipLaunch");
List<Texture2D> textures = new List<Texture2D>();
textures.Add(content.Load<Texture2D>("smoketexture"));
particleEngine = new ParticleEngine(textures, new Vector2(0, 0));
base.LoadScreenContent(content);
}
protected override void UpdateScreen(GameTime gameTime, DisplayOrientation screenOrientation)
{
//if (gameTime.TotalGameTime.Seconds>10)
//{
// changeScreenDelegate(ScreenState.UMA);
//}
loadEmitter(gameTime);
particleEngine.Update();
base.UpdateScreen(gameTime, screenOrientation);
}
protected override void DrawScreen(SpriteBatch batch, DisplayOrientation screenOrientation)
{
batch.Draw(LaunchScreenTexture, Vector2.Zero, Color.White);
batch.Draw(shipLaunch, new Vector2(80, 450) +shipPos, Color.White);
particleEngine.Draw(batch);
base.DrawScreen(batch, screenOrientation);
}
protected override void SaveScreenState()
{
base.SaveScreenState();
}
}
}
| 0 | [
2,
11534,
16847,
142,
3160,
149,
21,
7497,
272,
5910,
993,
325,
800,
3726,
3726,
86,
31,
57,
21,
1448,
29,
2555,
21,
7497,
7612,
37,
51,
11534,
7411,
7986,
15,
31,
92,
2003,
14,
11534,
114,
1123,
100,
32,
23,
12038,
54,
52,
1219... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Geolocation with Google Maps not working using PhoneGap
===
I am using Phonegap (cordova-2.0.0) and I have put cordova-2.0.0.js in the assets/www directory with my other files, I have put cordova-2.0.0.jar in the referenced libraries. I have added the required code in the Android manifest and config.xml. And I have made an html file called 'storelocation.html', I want this file to get the user's current coordinates and pass those into Google maps which will make those coordinates at the centre of the maps. I am not sure what is wrong with the code in this file, could somebody please check to see if I am just being stupid?
<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Device Properties Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
<script src="http://maps.google.com/maps?file=api&v=2&key=AIzaSyBlNOgoh-8Xg9_OYqUUxReMJZk4syLFayM&sensor=true"type="text/javascript"></script>
<script type="text/javascript">
// Wait for Cordova to load
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
//
function onDeviceReady() {
navigator.geolocation.getCurrentPosition(onSuccess, onError, {enableHighAccuracy:true });
}
// onSuccess Geolocation
//
/* function onSuccess(position) {
var element = document.getElementById('geolocation');
element.innerHTML = 'Latitude: ' + position.coords.latitude + '<br />' +
'Longitude: ' + position.coords.longitude + '<br />' +
'Altitude: ' + position.coords.altitude + '<br />' +
'Accuracy: ' + position.coords.accuracy + '<br />' +
'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '<br />' +
'Heading: ' + position.coords.heading + '<br />' +
'Speed: ' + position.coords.speed + '<br />' +
'Timestamp: ' + position.timestamp + '<br />';
}
// onError Callback receives a PositionError object
//
function onError(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
} */
var element = document.getElementById('geolocation');
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(position.coords.latitude, position.coords.longitude), 13);
map.setUIToDefault();
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>
Many thanks in advance, I really do appreciate it if one of you geniuses could help me out, I have been trying to see what's wrong for like 2 days now. Btw, the user's coordinates could not be found and the only way to find them (that I found) is to use geo fix using telnet but I want the phone to find the coordinates and not me. | 0 | [
2,
6389,
19032,
29,
8144,
6867,
52,
638,
568,
1132,
1136,
306,
800,
3726,
3726,
31,
589,
568,
1132,
1136,
306,
13,
5,
17213,
3496,
8,
135,
9,
387,
9,
387,
6,
17,
31,
57,
442,
5429,
3496,
8,
135,
9,
387,
9,
387,
9,
728,
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... |
Create an RPM that can also manipulate files and add users
===
I'm trying to create an RPM in Fedora 15 that will install my software, but in order for my software to work correctly once installed, I also need to edit other (configuration) files on the system, add users/groups, etc. Performing some of these tasks is only allowed by the root user. I know to never create an RPM as the root user, and I understand why that is such a bad idea. However, if I add shell script statements to my spec file (%post, %prep... any section) to edit the necessary files, add users/groups, etc., my rpmbuild command fails with message "Permission denied" (not surprisingly).
What's the best way to handle this? Do I have to tell my users to install my package first, and then perhaps run a shell script as root to configure it all? That doesn't seem very elegant. I was hoping to allow a user to do everything with one simple command such as 'yum install mysoftware'.
Much of my research suggests that perhaps this shouldn't even be done via RPM. I've read many parts of [Maximum RPM][1], and lots of other good resources, but haven't found what I'm looking for. I'm new to creating RPMs, but have already been able to successfully create a simple spec file for my software... I just can't get everything configured properly after the package is unzipped and installed to the correct location. Any input is greatly appreciated!
[1]: http://www.rpm.org/max-rpm/ | 0 | [
2,
1600,
40,
12936,
30,
92,
67,
18468,
6488,
17,
3547,
3878,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
40,
12936,
19,
26726,
58,
357,
30,
129,
16146,
51,
2306,
15,
47,
19,
389,
26,
51,
2306,
20,
170,
12044,
382,
4066,
15,
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... |
Controlling touches in CCScrollLayer (cocos2d iOS)
===
I have a CCScrollLayer in my app which contains movable sprites (they can be dragged & dropped). The issue is that when dragging the sprites too far, the CCScrollLayer starts scrolling. I am trying to disable the CCScrollLayer from scrolling as long as I am dragging those sprites. The disabling works by using
[[CCTouchDispatcher sharedDispatcher] removeDelegate:sender];
I get the sender from method
- (void)scrollLayerScrollingStarted:(CCScrollLayer *)sender {
//...
}
I cannot enable the CSScrollLayer again, tried with this but no result:
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:scrollLayer priority:0 swallowsTouches:NO];
I am using v1.0.1 (stable version)
| 0 | [
2,
10106,
13935,
19,
8093,
3862,
8694,
15187,
13,
5,
716,
10460,
135,
43,
13,
7760,
6,
800,
3726,
3726,
31,
57,
21,
8093,
3862,
8694,
15187,
19,
51,
4865,
56,
1588,
29618,
27902,
18,
13,
5,
2077,
92,
44,
7465,
279,
1539,
6,
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... |
Needed material reference for shell script
===
I am writing shell script programs, but I am getting a lot of syntax errors. SO could anyone point me a good source of reference to my problem. Thank you | 0 | [
2,
851,
1492,
2801,
26,
3593,
3884,
800,
3726,
3726,
31,
589,
1174,
3593,
3884,
1726,
15,
47,
31,
589,
1017,
21,
865,
16,
22649,
11908,
9,
86,
110,
1276,
454,
55,
21,
254,
1267,
16,
2801,
20,
51,
1448,
9,
3531,
42,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How implementarion code exist just including header file
===
It's a theorical doubt.
Suppouse you have a little library with just two files: lib.h. the headers from lib.cpp, the implementation code.
By convention, in C++ we include the lib.h in lib.cpp, that is, the lib.h "doesn't know" about the "lib.cpp" existence.
So, to use our library in a program, suppouse: myprogram.cpp and myprogram.h, I have to include just the "lib.h"
So, how my program will load the implementation of headers? If the headers files "doesn't know" about the implementations files existence? | 0 | [
2,
184,
8713,
512,
872,
1797,
3182,
114,
215,
157,
106,
3893,
800,
3726,
3726,
32,
22,
18,
21,
14,
248,
4272,
3063,
9,
11128,
1638,
3699,
42,
57,
21,
265,
1248,
29,
114,
81,
6488,
45,
13,
8326,
9,
252,
9,
14,
157,
445,
37,
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... |
In an Asp.net MVC view, how do I use jQuery to parse the XML just returned from a controller
===
In my MVC view (using VS 2012 RC), I'm attempting to parse the XML freshly returned from my Controller.
Here is my view code:
**@model** RzMvc.Models.PortfolioResponse
@{
ViewBag.Title = "PortfolioList";
}
<script type="text/javascript">
$(displayXmlResponse);
function displayXmlResponse(){
var resp = $("#xmlResp");
$("#xmlTest").append(resp.children());
var xml = $("xmlResp").text;
xmlDoc = $.parseXML(xml),
$xml = $(xmlDoc),
$title = $xml.find("portfolioSummary");
$("#xmlTest").append($title.text());
}
</script>
<h2>PortfolioList</h2>
<div>
<p id="xmlTest"></p>
<p id="xmlResp" >@Model.XmlPortfolioResponse</p>
</div>
The browser output looks like this:
PortfolioList
Portfolio Listing
System.Xml.XmlDocument
Any guidance would be greatly appreciated. Here's part of my Controller code:
public ActionResult PortfolioList()
{
XmlDocument xmlResponse = new XmlDocument();
xmlResponse.LoadXml(portfoliosResponse);
var portf = new PortfolioResponse { XmlPortfolioResponse = xmlResponse };
return View(portf);
}
Model code is:
namespace RzMvc.Models
{
public class PortfolioResponse
{
public XmlDocument XmlPortfolioResponse { get; set; }
}
}
| 0 | [
2,
19,
40,
28,
306,
9,
2328,
307,
8990,
1418,
15,
184,
107,
31,
275,
487,
8190,
93,
20,
2017,
870,
14,
23504,
114,
587,
37,
21,
9919,
800,
3726,
3726,
19,
51,
307,
8990,
1418,
13,
5,
12655,
4611,
563,
16462,
6,
15,
31,
22,
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... |
ODBC or Registry Entry?
===
I support a group of developers that are telling me to setup a registry entry for an application that they made in asp.net to connect to our SQL backend. Would it not be better to do this from an ODBC connection? Is this lazy programming or is this common practice?
If all their connections are in registry entries how will I be able to spin up the DRP site in case we have an issue? Right now we replicate the content across and it would be a heck of a lot easier if the DB connections were in ODBC instead of having to redo all these registry entries. (there are multiple apps doing this).
Please fill me in. Thanks | 0 | [
2,
12340,
7229,
54,
18269,
2792,
60,
800,
3726,
3726,
31,
555,
21,
214,
16,
10168,
30,
50,
2497,
55,
20,
18161,
21,
18269,
2792,
26,
40,
3010,
30,
59,
117,
19,
28,
306,
9,
2328,
20,
6379,
20,
318,
4444,
255,
97,
2451,
9,
83,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Why is mysql_config reporting the wrong socket file location?
===
The mysql_config program is reporting the socket file location as:
/var/lib/mysql/mysql.sock
But in /etc/my.cnf, the location is clearly stated as:
/tmp/mysql.sock
When I use "mysqladmin variables" to check the socket, it is reported correctly. Why is mysql_config incorrect, and how can I fix it? | 0 | [
2,
483,
25,
51,
18,
22402,
1,
14093,
2816,
6670,
14,
1389,
18482,
3893,
1474,
60,
800,
3726,
3726,
14,
51,
18,
22402,
1,
14093,
2816,
625,
25,
6670,
14,
18482,
3893,
1474,
28,
45,
13,
118,
3311,
118,
8326,
118,
915,
18,
22402,
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... |
Rails - View files - How to avoid one html file and one js file per controller action?
===
Being quite new to rails and currently building a project, i'm begining to be in a situation where my view folder is growing a bit too much
I have for e.g :
/app/
../views/
..../comments/
....../_comment.html.erb
....../_comments_count.html.erb
....../_form.html.erb
....../create.js.erb
....../destroy.js.erb
....../edit.html.erb
....../edit.js.erb
....../index.html.erb
....../index.js.erb
....../new.html.erb
....../show.html.erb
....../update.js.erb
I would definitely prefer to have 2 files :
comments.html.erb
comments.js.erb
And inside of each (like in controller) have a part for each actions.
Currently it seems too much trouble to edit each files, even if they are skinny.
How do you manage your view files ? Is my comments view folder "normal" for a rails project ? Is there some templates engine like handlebar that can help address this problem ? | 0 | [
2,
2240,
18,
13,
8,
1418,
6488,
13,
8,
184,
20,
2658,
53,
13,
15895,
3893,
17,
53,
487,
18,
3893,
416,
9919,
1028,
60,
800,
3726,
3726,
142,
1450,
78,
20,
2240,
18,
17,
871,
353,
21,
669,
15,
31,
22,
79,
2348,
68,
20,
44,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Organising two column data
===
Hi I have a two column data stored in a file called "Cv_0.out", each column is separated by two spaces
12 454
232 123
879 2354
12312 23423
8794 1237
3245 34
I would like to then sort this data in ascending order based only on the right hand column values whilst at the same time keeping the pairs of values together, so reordering the left hand side values. I would like to get the following:
3245 34
232 123
12 454
8794 1237
879 2354
12312 23423
I have tried the following so far:
import sys,csv
import operator
reader = csv.reader(open('Cv_0.out'),delimiter=' ')
sort = sorted(reader, key=lambda row: int(row[0]))
print sort
Any help would be really appreciated
| 0 | [
2,
23826,
81,
4698,
1054,
800,
3726,
3726,
4148,
31,
57,
21,
81,
4698,
1054,
8214,
19,
21,
3893,
227,
13,
7,
12732,
1,
387,
9,
1320,
7,
15,
206,
4698,
25,
4196,
34,
81,
7644,
390,
2487,
300,
13,
20730,
390,
240,
469,
3399,
113... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Sonar Wall Display?
===
My employer has installed two large LCD panels to display build health and statistics.
I'd like to display Sonar graphs which update intra-day. How's the best way of going about this? I've had a look through the available plugins and haven't found a "wall display" facility yet | 0 | [
2,
433,
512,
769,
3042,
60,
800,
3726,
3726,
51,
11726,
63,
4066,
81,
370,
26827,
9449,
20,
3042,
1895,
853,
17,
5818,
9,
31,
22,
43,
101,
20,
3042,
433,
512,
7210,
18,
56,
11100,
14369,
8,
1185,
9,
184,
22,
18,
14,
246,
161,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 + jQuery Mobile + Chrome 20
===
Me and my team are experiencing a strange problem after updating google chrome to the latest version, can someone help us? we are getting out of ideas :S
We have several .aspx pages in wich we include jquery core (1.7.1) and jquery mobile (1.1.0) and some jqm plugins. everything worked perfectly until we updated google chrome... we started getting totaly **random** errors like:
"Uncaught TypeError: Cannot call method 'apply' of undefined"
"Uncaught TypeError: Cannot call method 'jqmData' of undefined"
in firefox, ie9/10 and safari everything works properly.
the exception is beeing thrown by jquery mobile in the initializePage function.
we created a basic page (structure and some basic elements)... still no luck.
we found this similar problem.. but is from 2010.. lol!
http://productforums.google.com/forum/#!msg/chrome/JDKZxXsQZiE/sdW9-g1rxYs
any ideas/sugestions?
tks in advance! ;) | 1 | [
2,
487,
8190,
93,
2754,
487,
8190,
93,
3241,
2754,
13,
12985,
434,
800,
3726,
3726,
55,
17,
51,
173,
50,
15138,
21,
2578,
1448,
75,
71,
43,
1880,
8144,
13,
12985,
20,
14,
5736,
615,
15,
92,
737,
448,
182,
60,
95,
50,
1017,
70,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
open and close javascript window
===
I want to close a browser window whether it is in open. Am new for javascript so help me to create the below logic using javascript. My javascript code is here..
if (myWindow.open() ==true)
{
myWindow.close();
}
else
{
myWindow=window.open('http://index.html','popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
} | 0 | [
2,
368,
17,
543,
8247,
8741,
1463,
800,
3726,
3726,
31,
259,
20,
543,
21,
16495,
1463,
1472,
32,
25,
19,
368,
9,
589,
78,
26,
8247,
8741,
86,
448,
55,
20,
1600,
14,
1021,
7085,
568,
8247,
8741,
9,
51,
8247,
8741,
1797,
25,
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... |
sound level rms
===
I have found some code to calculate microphone sound level (RMS):
public int calculateRMSLevel(byte[] audioData) {
// audioData might be buffered data read from a data line
long lSum = 0;
for (int i = 0; i < audioData.length; i++) {
lSum = lSum + audioData[i];
}
double dAvg = lSum / audioData.length;
double sumMeanSquare = 0d;
for (int j = 0; j < audioData.length; j++) {
sumMeanSquare = sumMeanSquare + Math.pow(audioData[j] - dAvg, 2d);
}
double averageMeanSquare = sumMeanSquare / audioData.length;
return (int) (Math.pow(averageMeanSquare, 0.5d) + 0.5);
}
But it only works for the following audio format:
private AudioFormat getAudioFormat() {
float sampleRate = 8000.0F;
int sampleSizeInBits = 8;
int channels = 1;
boolean signed = true;
boolean bigEndian = true;
return new AudioFormat(
sampleRate,
sampleSizeInBits,
channels,
signed,
bigEndian);
}
How to extend the code so it can work with different bitness? If I change the bitness to 16 it returns values of around 50 when silence where for 8 bits it returns 1 or 2.Also I would like to graph the sound levels on a graph, how are the sound level values related to time?
| 0 | [
2,
646,
662,
13,
6538,
18,
800,
3726,
3726,
31,
57,
216,
109,
1797,
20,
18469,
15403,
646,
662,
13,
5,
6538,
18,
6,
45,
317,
19,
38,
18469,
6538,
18,
3906,
5,
23246,
2558,
500,
4023,
18768,
6,
13,
1,
12894,
4023,
18768,
530,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 is the difference between IVT and IDT?
===
On Linux system, what is the difference between Interrupt Vector Table (IVT) and Interrupt Descriptor Table (IDT) ?
| 0 | [
2,
98,
25,
14,
2841,
128,
3761,
38,
17,
4924,
38,
60,
800,
3726,
3726,
27,
13024,
329,
15,
98,
25,
14,
2841,
128,
15811,
7497,
859,
13,
5,
3757,
38,
6,
17,
15811,
121,
8741,
248,
859,
13,
5,
1340,
38,
6,
13,
60,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How To use multiline textblock in wp7?
===
i wants to display my text in to multiline with use of textblock.i have one textblock and it text property is binding with webservices.and run time textblock display on long single line.but i wants to devide this single line in to multiline.
so what i can do? i also use text wrraping property but it is not working.
and my XMAL Code is
<TextBlock FontSize="22" Text="Address:" Height="Auto"/>
<TextBlock FontSize="22" Text="{Binding Address}" Height="Auto" Width="Auto" TextWrapping="Wrap" Margin="49,0,0,0" /> | 0 | [
2,
184,
20,
275,
1889,
1143,
1854,
12048,
19,
13,
13790,
465,
60,
800,
3726,
3726,
31,
2846,
20,
3042,
51,
1854,
19,
20,
1889,
1143,
29,
275,
16,
1854,
12048,
9,
49,
57,
53,
1854,
12048,
17,
32,
1854,
1354,
25,
8728,
29,
2741,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Font-face not working in IE9
===
I am facing font-face issue
I am using gotham font check below code:
@font-face{
font-family: Gotham MEDIUMITA;
src: url('Gotham_Font/GOTHAM-MEDIUMITA.OTF')format("truetype");
}
Its working in IE8,firefox,chrome. But in IE9 font is not applying...
is there any solution pls help regarding this....
Thanks
Ravi | 0 | [
2,
9978,
8,
6413,
52,
638,
19,
13,
660,
518,
800,
3726,
3726,
31,
589,
4325,
9978,
8,
6413,
1513,
31,
589,
568,
25244,
9978,
2631,
1021,
1797,
45,
13,
1,
21931,
8,
6413,
1,
9978,
8,
13819,
45,
25244,
4152,
3188,
73,
13,
18,
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... |
legacyCasModel with MVC imported project
===
I have found [this][1] question and while i do accept why the problem exists, i would like to know if anyone has got a work around.
basically my problem is this.
i have a VB.net website that is using the DevExpress V9.1.3 set of DLL's and we are trying to do is embed my MVC site into it. if I use
[1]: http://stackoverflow.com/questions/5541143/legacycasmodel-true-and-dynamic-data-operations
<trust level="Full" legacyCasModel="true" />
the MVC parts do not work but without this the DevExpress grids do not work.
the reason why i require the MVC to be part of the Webforms site is because there is session variables that we will need to have in both of the sites.
other things I have tried is having the MVC site at the root (/) of the IIS node and the webforms site under a different application (under the root) of /UI/ with the same machine key, sessionId and application name but I could not get the session to share across both sites. As we are going to start migrating the Webforms application to MVC i do not want to upgrade the DevExpress components as we will not be using them in the MVC setup.
Has anyone found a way around this problem?
| 0 | [
2,
7780,
5949,
13998,
29,
307,
8990,
11808,
669,
800,
3726,
3726,
31,
57,
216,
636,
1565,
500,
2558,
165,
500,
1301,
17,
133,
31,
107,
3440,
483,
14,
1448,
5636,
15,
31,
83,
101,
20,
143,
100,
1276,
63,
330,
21,
170,
140,
9,
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... |
Designing GDT for a small kernel
===
I am currently writing some small kernel code. The following is what I have copied from a kernel project somewhere. It contains code for loading the kernel to memory location 0x1000 and jumping to the location 0x1000:
;
; The Bootsector Code (First 512 bytes of the floppy)
;
;
; Define Code Segment and Data Segment Rights details for inputting to GDTFill function
;
%define CS_ACCES 10011011b ; CS and DS Access Rights (Details in GDT.INC)
%define DS_ACCES 10010011b
;
; 16 Bit Addressing initially
;
[bits 16]
;
; Code begins at 0x7c00
;
[org 0x7c00]
;
; Bios Jumps to 0xf000:0xffff
; Then it loads the first 512 bytes (BootSector)
; from first boot device to 0x0000:0x7c00
;
jmp boot
;
; Includes
;
%include "GDT.INC"
;
; Define Stack
;
boot:
mov ax,0x07C0
mov ds,ax
mov es,ax
mov ax,0x8FFF
mov ss,ax
;
; Stack begins at 0xf000 and fills from there downwards
;
mov sp,0xFFFF
;
; Note:
; Linear Address = Shift Segment by 1 byte and add Offset to it
;
; Read Kernel From Floppy to Memory location es:bx (0x1000 here)
; Cylinder Head Sector and Buffer are as follows:
;
; es:bx - buffer where to load Kernel to
; ch - track number
; cl - starting sector
; dh - head number
; dl - drive number (0 here)
; Then call interrupt 0x13
;
xor ax,ax
int 0x13
;
; Do the floppy int 13 reading
;
push es
mov ax,0x100
mov es,ax
mov bx,0
mov ah,2
mov al,30
mov ch,0
mov cl,2
mov dh,0
mov dl,0
int 0x13
;
; Now es holds stack addresss
;
pop es
;
; Fill GDT
; Refer to GDT.INC for details
;
GDTFill 0, 0xFFFFF,CS_ACCES,1101b,gdt_cs
GDTFill 0, 0xFFFFF,DS_ACCES,1101b,gdt_ds
;
; Store Limit of GDT beginning at location marked as gdtptr
; This has to be passed on to lgdt instruction
;
mov ax, gdtend
mov bx, gdt
sub ax,bx
mov word [gdtptr], ax
;
; Store Linear address of GDT at gdtptr after allowing space for the previous data
; Linear Address = Shift Segment by 1 byte and add Offset to it
;
xor ax,ax
mov ax,ds
mov bx,gdt
call LinearAdd
mov dword [gdtptr+2], ecx
;
; Load gdt using lgdt. Disable interrupts before that
;
cli
lgdt[gdtptr]
;
; Move to protected mode. Set cr0's first bit to 1 by or'ing it
;
mov eax,cr0
or ax,1
mov cr0,eax
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Once in Protected Mode,
; Except cs all are defined w.r.t DataSegment
; DataSegment Descriptor from beginning of GDT is 8 bytes
; CodeSegment Descriptor from beginning of GDT is 10 bytes
; Stack (Very important! - This is what i messed with initially:
; --------------------------------------------------------------
; Defined w.r.t Data segment
; Beginning - 0x9f000 (Fills downwards)
; Stack size is = 0x9f000 - DataSegment Value (= 0x0) (Have to change this)
; Quite enough for some small operations and LIBC Functions
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
jmp next
next:
mov ax,0x10
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov ss,ax
mov esp,0x9F000 ; Stack begins filling at this address
;
; protected mode segmented address = cs:0x1000
; This is nothing but 0x0:0x1000 in protected mode (Have to change these)
; Which is where kernel was loaded earlier from floppy
;
jmp dword 0x8:0x1000
end:
jmp end ; Just in case it slips the earlier step !
;
; Initially fill GDT with 0's
;
gdt:
gdt_null:
dw 0,0,0,0
gdt_cs:
dw 0,0,0,0
gdt_ds:
dw 0,0,0,0
gdtend:
;
; The following is the GDT Pointer
; This is used for passing it on to LGDT Instruction
;
gdtptr:
dw 0x0000 ; 16 bit size of GDT
dd 0 ; 32 bit linear address of GDT
;
; Filling the rest of space with NOP
; Or else boot sector might start executing invalid instructions there
; Because of Junk Data
;
times 510-($-$$) db 144
;
; The signature of boot sector
;
dw 0xaa55
The following is in GDT.INC:
; Calculate Linear Address
; Called with following Values:
; ax - has segment number
; bx - has offset number
;
; Output:
; ecx - has Linear Address
;
; We are in 16 bit mode
;
; Linear Address = Shift Segment by 1 byte and add Offset to it
; So 0x07c0:0x0 = 0x7c00
LinearAdd:
xor ecx,ecx
mov cx,ax
shl ecx,4
and ebx,0x0000FFFF
add ecx,ebx
ret
; Filling Global Descriptor Table
; -------------------------------
;
; Note:
; -----
; 1. Order of variables input: Base (32 bits),
; Limit (20 bits), Access Rights(8 bits), Flags(4 bits), Segment Address
; (32 bits)
;
; 2. Variables input to function are moved LS 4 bits First (Right to Left) to table
;
; 3. While reading LS 4 bits or MS 4 bits, read from left to right
;
; Base:
; -----
; Bits in Table Bits in Field 'Base' Location w.r.t Beginning of Segment
;---------------------------------------------------------------------------------------
; 16 - 31 0 - 15 +2 (2 bytes in length)
; 32 - 39 16 - 23 +4 (1 byte in length)
; 55 - 63 24 - 31 +7 (1 byte in length)
;
;
; Howto:
; ------
;
; Below %5 ie., the fifth variable input to function GDTFill is Beginning of GDT's Code Segment
; [%5+2] represents entry 1 in above table
; [%5+4] represents entry 2 in above table
; [$5+7] represents entry 3 in above table
; Entry 1 is 2 bytes (so ax is moved to word [%5+2]
; Entry 2 and 3 are 1 byte (so al is moved to byte[%5+4] and [%5+7] respectively
;
; Limit:
; ------
;
; Bits in Table Bits in Field 'Limit' Location w.r.t Beginning of Segment
;---------------------------------------------------------------------------------------
; 0 - 15 0 - 15 +0 (2 bytes in length)
; 16 - 20 48 - 51 +6 (1 byte in length)
;
; Refer 'Howto' above for detailed description
;
; Access Rights:
; --------------
;
; Access Rights (Bit 40 to Bit 47) = Type (Bit 40 to Bit 43) + System Flag (Bit 44) + DPL (Bit 45 and 46) + Reserved (Bit 47);
; Type - Your Call (Say A is Kernel Code and B is User code (Here it is 11 and 3 respectively)
; System Flag - Both Code and Data Segment have S Flag = 1
; DPL - Privilege level (Ring 0 or 3?) (Ring 0 - 00 and Ring 3 - 11)
;
; Flags:
; ------
; G B O AVL
;
; G - Granularity = 1 here (means Segment Size is 4096 bytes)
; B - Address offsets used for accessing segments are 32 bits long
; O - 0 (Don't know what it is!)
; AVL - 1 here (You Can Ignore it)
;
;
%macro GDTFill 5
push eax
; Base
mov eax,%1
mov word [%5+2],ax
shr eax,16 ; Shift Right to
mov byte [%5+4],al
shr eax,8
mov byte [%5+7],al
; Limit
mov eax,%2
and eax,0x000FFFFF
mov word [%5],ax ; ecrit (0..15)
shr eax,16 ; place (16..19) sur le nibble inferieur
mov byte [%5+6],0 ; initialise flags+lim(16..19) a 0
or [%5+6],al ; ecrit (16..19)
; flags :
mov al,%4
and al,0x0F
shl al,4
or [%5+6],al
; acces :
mov byte [%5+5],%3
pop eax
%endmacro
The above worked for a long time. However, when my kernel started becoming bigger, the data and code segments overlapped. Though both are starting at 0, the data in the data segment overlapped with the code in code segment or something like that. Because of this, I was not able to print messages completely.
Is there a way to change the base address of data segment and code segment such that there is some space between the bases to write a small kernel of about max 1 MB in size in binary? | 0 | [
2,
15026,
489,
43,
38,
26,
21,
284,
17007,
800,
3726,
3726,
31,
589,
871,
1174,
109,
284,
17007,
1797,
9,
14,
249,
25,
98,
31,
57,
18225,
37,
21,
17007,
669,
3493,
9,
32,
1588,
1797,
26,
12797,
14,
17007,
20,
1912,
1474,
713,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 encrypt parameters of URL in ASP.NET MVC with Routes
===
I have a very specific problem, I want to encrypt and decrypt my URL parameters in ASP.net MVC.
if my current url is like this -
http:/mywebsite/controler/Action/ParameterValue1/ParameterValue2/ParameterVale3
i want to appear it on user browser -
http:/mywebsite/controler/Action/EncryptedParameterValue1/EncryptedParameterValue2/EncryptedParameterValue3
With the help of Routes table.
Best Regards',
Hemant Shrivastava | 0 | [
2,
184,
20,
1957,
11435,
12905,
16,
287,
6362,
19,
28,
306,
9,
2328,
307,
8990,
29,
5050,
800,
3726,
3726,
31,
57,
21,
253,
1903,
1448,
15,
31,
259,
20,
1957,
11435,
17,
121,
11435,
51,
287,
6362,
12905,
19,
28,
306,
9,
2328,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
kernel32.dll symbolic link
===
ctypes.windll.LoadLibrary("kernel32.dll") is not creating symbolic links when not in admin mode. is it possible to copy this dll into D: and read from there. What are the repurcussions if any.
import ctypes
inpt = "D:/mayaslate/symlink/ssh0155_plate.0003.jpg"
output = "D:/imagesequence/ssh0155_plate/ssh0155_plate.1003.jpg"
kdll = ctypes.windll.LoadLibrary("D:/mayaslate/kernel32.dll") <--- is this possible
kdll.CreateSymbolicLinkA(inpt , output, 0) | 0 | [
2,
17007,
3125,
9,
43,
211,
12882,
3508,
800,
3726,
3726,
272,
4474,
18,
9,
7809,
211,
9,
8294,
1210,
2559,
622,
5,
7,
2429,
7440,
3125,
9,
43,
211,
7,
6,
25,
52,
2936,
12882,
6271,
76,
52,
19,
21,
43,
2160,
3740,
9,
25,
32,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 edit the HTML on my page
===
I know HTML and would like to add some things to my page, however, I do not know how to open and change the HTML part of Facebook.
Thank you | 1 | [
2,
184,
20,
9392,
14,
13,
15895,
27,
51,
2478,
800,
3726,
3726,
31,
143,
13,
15895,
17,
83,
101,
20,
3547,
109,
564,
20,
51,
2478,
15,
207,
15,
31,
107,
52,
143,
184,
20,
368,
17,
753,
14,
13,
15895,
141,
16,
9090,
9,
3531,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
In Emacs how do I edit multiple points at once?
===
There's two variations. I think you can select a rectangle and add stuff to the beginning and end of all lines.
I'd also like to know if it's possible to select multiple points that are on different offsets to where you edit all the points at once. I think Yasnippet provides something similar, but only when you use a predefined template. Something like this.
<div class="">
<a class="">
where i can mark a point on both class things and typing will edit both class attributes. Is it possible? | 0 | [
2,
19,
13,
62,
6893,
18,
184,
107,
31,
9392,
1886,
819,
35,
382,
60,
800,
3726,
3726,
80,
22,
18,
81,
8194,
9,
31,
277,
42,
92,
5407,
21,
27181,
17,
3547,
3217,
20,
14,
997,
17,
241,
16,
65,
1560,
9,
31,
22,
43,
67,
101,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
lxml: add namespace to input file
===
I am parsing an xml file generated by an external [program][1]. I would then like to add custom annotations to this file, using my own namespace. The issue being that lxml only declares namespaces when they are used, which means the declaration is repeated many times, like so:
<sbml xmlns="namespace" xmlns:celldesigner="morenamespace" level="2" version="4">
<listOfSpecies>
<species>
<kjw:test xmlns:kjw="http://this.is.some/custom_namespace"/>
<celldesigner:data>Some important data which must be kept</celldesigner:data>
</species>
<species>
<kjw:test xmlns:kjw="http://this.is.some/custom_namespace"/>
</species>
....
</listOfSpecies>
</sbml>
Is it possible to force lxml to write this declaration only once in a parent element, such as `sbml` or `listOfSpecies`? Or is there a good reason not to do so? The result I want would be:
<sbml xmlns="namespace" xmlns:celldesigner="morenamespace" level="2" version="4" xmlns:kjw="http://this.is.some/custom_namespace">
<listOfSpecies>
<species>
<kjw:test/>
<celldesigner:data>Some important data which must be kept</celldesigner:data>
</species>
<species>
<kjw:test/>
</species>
....
</listOfSpecies>
</sbml>
The important problem is that the existing data which is read from a file must be kept, so I cannot just make a new root element (I think?).
[1]: http://celldesigner.org/ | 0 | [
2,
13,
24560,
8184,
45,
3547,
204,
5582,
20,
6367,
3893,
800,
3726,
3726,
31,
589,
2017,
18,
68,
40,
23504,
3893,
6756,
34,
40,
4886,
636,
19746,
500,
2558,
165,
500,
9,
31,
83,
94,
101,
20,
3547,
5816,
40,
1270,
7504,
20,
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... |
Ruby on rails: ActionController::RoutingError in Posts#index
===
In routes.rb =>
get "categories/listarchive"
resources :posts
resources :categories
In categories_controller.rb i have def listarchive end; and there is a view listarchive.html.erb
But i got this error: ActionController::RoutingError in Posts#index
Thanks | 0 | [
2,
10811,
27,
2240,
18,
45,
1028,
12898,
1252,
45,
45,
8821,
1203,
29992,
19,
9868,
5910,
25671,
800,
3726,
3726,
19,
5050,
9,
7549,
800,
1,
164,
13,
7,
14375,
1596,
118,
5739,
23941,
7,
2566,
13,
45,
6962,
18,
2566,
13,
45,
143... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Constructor invocation without parentheses
===
Is there any difference between
var obj1 = new Constructor;
and
var obj2 = new Constructor();
given that `Constructor` is a constructor function? | 0 | [
2,
6960,
248,
19,
2625,
16893,
366,
28273,
800,
3726,
3726,
25,
80,
186,
2841,
128,
4033,
5122,
728,
165,
800,
78,
6960,
248,
73,
17,
4033,
5122,
728,
135,
800,
78,
6960,
248,
5,
6,
73,
504,
30,
13,
1,
1126,
10346,
248,
1,
25,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Inner Join Pivot SQL
===
I have 2 tables, tblClient and tblDB.
CREATE TABLE tblBD(
[ID] INT PRIMARY KEY,
[DataBase] nVARCHAR (30) NOT NULL,
[ClientID] INT NOT NULL,
FOREIGN KEY ([ClientID]) REFERENCES tblClient(ID)
)
CREATE TABLE tblClient(
[ID] INT PRIMARY KEY,
[Name] nVARCHAR(30),
[Status] BIT,
[Number] INT,
)
I want a way to get for each client all his databases.
Something like this :
Client1 Client2 ClientX
BD1 BD1 BD1
BD2 BD2 BD2
BDX BDX BDX
I can do it easily for one client by executing this script :
Select tblBD.[DataBase] from tblBD
inner join tblCLient on tblBD.ClientID = tblClient.ID Where tblClient.ID = 1234
But, I can't figure How to get the result for all clients in 1 table.
Thank you | 0 | [
2,
3754,
1865,
20670,
4444,
255,
800,
3726,
3726,
31,
57,
172,
7484,
15,
13,
11872,
6109,
18513,
38,
17,
13,
38,
6287,
9007,
9,
1600,
859,
13,
11872,
10819,
43,
5,
636,
1340,
500,
19,
38,
1256,
1246,
15,
636,
18768,
8436,
500,
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... |
XCode Multiple implementations in separate views with UITextView not updating
===
Hey I just had a question regarding XCode's behavior with multiple views implementing the same UIView class of my own creation. I am working with a tabbed application and controller, and I have multiple views on the storyboard, all of which implement a class that I created. On one of the views, I have a text field and a button, and on another, I have a text view with a startup text reading "Waiting...". As you can probably guess, I want to enter text into the text field on the first view, press the button, then display the proper output text in the textview on the other view. My question is: is there a problem with implementing the same class between multiple views? I have researched numerous discussions on the TextView method of setting text inside of it, but all of the suggestions between the forums say something different, and none of the methods seem to work appropriately.
[textView setText string] doesn't want to work when I switch to the other tab
textView.text = @"Message here" doesn't work either
I'd appreciate your help, and I've attached my code for reference. Cheers!
#import "MasterController.h"
@interface MasterController ()
@end
@implementation MasterController
@synthesize input;
@synthesize output;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)viewDidUnload
{
[self setInput:nil];
[self setOutput:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (IBAction)generate:(id)sender {
[output setText:input.text];
}
- (IBAction)textFieldReturn:(id)sender{
[sender resignFirstResponder];
}
- (void)dealloc {
[input release];
[output release];
[super dealloc];
}
@end
//MasterController.h
#import <UIKit/UIKit.h>
@interface MasterController : UIViewController
- (IBAction)generate:(id)sender;
- (IBAction)textFieldReturn:(id)sender;
@property (retain, nonatomic) IBOutlet UITextField *input;
@property (retain, nonatomic) IBOutlet UITextView *output;
@end
| 0 | [
2,
993,
9375,
1886,
6123,
18,
19,
1725,
4146,
29,
13,
5661,
11969,
4725,
52,
71,
43,
1880,
800,
3726,
3726,
8409,
31,
114,
41,
21,
1301,
3467,
993,
9375,
22,
18,
3257,
29,
1886,
4146,
17333,
14,
205,
13,
5661,
4725,
718,
16,
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,
1,
1,
1,
1,
1,
1,
1,
1... |
Using liquibase changelog to create a table with a datetime field, how come that field become a text type
===
I created a table using liquibase databaseChangeLog:
<changeSet id="1" author="person1">
<createTable tableName="schedule">
<column name="id" type="varchar(20)">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="worktime" type="datetime">
</column>
</createTable>
</changeSet>
However when verifying my sqlite database, the table schema becomed below:
sqlite> .schema schedule
CREATE TABLE schedule (
id TEXT NOT NULL,
worktime TEXT,
CONSTRAINT PK_SCHEDULE
PRIMARY KEY (id));
You see both varchar and datatime were changed to text type. What I should add into changeSet table definition to make it work right. Now I have to correct them directly from sqlite DB. Thanks. | 0 | [
2,
568,
2093,
3003,
8436,
753,
5567,
20,
1600,
21,
859,
29,
21,
1231,
891,
575,
15,
184,
340,
30,
575,
533,
21,
1854,
1001,
800,
3726,
3726,
31,
679,
21,
859,
568,
2093,
3003,
8436,
6018,
16229,
5567,
45,
13,
1,
16229,
3554,
492... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 it normal for iCloud's iOS "Manage Storage" settings to show the CONTENTS of file packages instead of the package names?
===
My app uses custom file packages (UTI conforms to com.apple.package) to store individual "notebooks", each package (directory) containing various individual files. I would expect the "Manage Storage" section of iCloud settings on my iPad to show the names of the packages, NOT the contents of these packages. It makes more sense for the user to be able to delete an entire "notebook" instead of the component files inside.
So is this normal, or did I do something wrong when I uploaded the package to iCloud? I've created and exported the UTI for my custom file type (and it seems to work, since the email app recognizes my new files and associates them with my app). Do I somehow have to tell iCloud about my UTI definition?
Finally, if this behavior is "normal", is there a way to force it to work like I want it to?
Thank you! | 0 | [
2,
25,
32,
1826,
26,
31,
19174,
22,
18,
13,
7760,
13,
7,
177,
1303,
4326,
7,
12410,
20,
298,
14,
8478,
16,
3893,
16875,
700,
16,
14,
6030,
1817,
60,
800,
3726,
3726,
51,
4865,
2027,
5816,
3893,
16875,
13,
5,
11267,
13620,
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... |
Escape mysql table name
===
How do I escape a table name named `log\'; WAITFOR DELAY \'0:0:5\';--`?
I want to delete the table.
None of these works:
SHOW TABLES LIKE 'log\\\'; WAITFOR DELAY \\\'0:0:5\\\';--';
SHOW TABLES LIKE "log\\'; WAITFOR DELAY \\'0:0:5\\';--";
SHOW TABLES LIKE `log\\'; WAITFOR DELAY \\'0:0:5\\';--`; | 0 | [
2,
2220,
51,
18,
22402,
859,
204,
800,
3726,
3726,
184,
107,
31,
2220,
21,
859,
204,
377,
13,
1,
5567,
1,
22,
73,
1760,
1106,
7255,
13,
1,
22,
387,
45,
387,
45,
264,
1,
22,
73,
8,
8,
1,
60,
31,
259,
20,
27448,
14,
859,
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... |
Why my codes failed to update JTextArea in real time?
===
Hi I'm new to Java programming. I am trying to execute an external command from Java and then show the command prompt output in JTextArea `in real time`. That external program will generate 1 line of output every second and then exit after 10 seconds.
The following are my Java codes:
JTextArea output;
String command = "program.exe arg1 arg2 arg3 arg4";
List<String> items = Arrays.asList(command.split("\\s+"));
builder = new ProcessBuilder(items);
builder.redirectErrorStream(true);
process = builder.start();
input = new BufferedReader(new InputStreamReader(process.getInputStream()));
String input_line = null;
while ((input_line = input.readLine()) != null)
{
output.append(input_line + "\n");
output.setCaretPosition(output.getDocument().getLength());
}
When I run program.exe manually in command prompt window, the output is updated in real time like this:
<some warning message of the .exe program
which should not affect the output of the program> // shown at t=0
output line 1 //shown at t=1
output line 2 //shown at t=2
output line 3 //shown at t=3
output line 4 //shown at t=4
output line 5 //shown at t=5
output line 6 //shown at t=6
output line 7 //shown at t=7
output line 8 //shown at t=8
output line 9 //shown at t=9
output line 10 //shown at t=10
Done. //shown at t=10.
When I run my Java program at above, I hope the output in `JTextArea` will be similar to the command prompt output. I thought the output will be updated in real time. Unfortunately, it is not working. The actual output is like this:
<some warning message of the .exe program
which should not affect the output of the program> // shown at t=0
From t=0 until t=10, the JTextArea get stuck at the above output. At t=11, it suddenly show the complete output:
<some warning message of the .exe program
which should not affect the output of the program> // shown at t=0
output line 1 //shown at t=11
output line 2 //shown at t=11
output line 3 //shown at t=11
output line 4 //shown at t=11
output line 5 //shown at t=11
output line 6 //shown at t=11
output line 7 //shown at t=11
output line 8 //shown at t=11
output line 9 //shown at t=11
output line 10 //shown at t=11
Done. //shown at t=11
May I know what's wrong with my codes? Can anyone teach me how to display command prompt output in JTextArea `in real time`? Thanks.
| 0 | [
2,
483,
51,
11358,
1702,
20,
11100,
487,
11969,
17760,
19,
683,
85,
60,
800,
3726,
3726,
4148,
31,
22,
79,
78,
20,
8247,
3143,
9,
31,
589,
749,
20,
15644,
40,
4886,
1202,
37,
8247,
17,
94,
298,
14,
1202,
11443,
4417,
5196,
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... |
php foearch with array
===
what do i need to change for my codes?
the echo is just 1 letter `m`
this is my code :
$string = 'mars@email.com,123,12,1|art@hur.com,321,32,2';
$output = array();
foreach (explode('|', $string) as $key => $person) {
$output[] = array(
'email' => $person[0],
'score' => $person[1],
'street' => $person[2],
'rank' => $person[3]
);
echo $output[0]['email'];
}
OUTPUT : `m`
the output should be:
$email1 = mars@email.com
$score1 = 123
$street1 = 12
$rank1 = 1
$email2 = art@hur.com
$score2 = 321
$street2 = 21
$rank2 = 2
is it possible to do this code to output the email1 and email2?
is my code correct or do i need to change something?
thank you.
| 0 | [
2,
13,
26120,
16823,
8027,
29,
7718,
800,
3726,
3726,
98,
107,
31,
376,
20,
753,
26,
51,
11358,
60,
14,
8117,
25,
114,
137,
1748,
13,
1,
79,
1,
48,
25,
51,
1797,
13,
45,
5579,
11130,
800,
13,
22,
1615,
18,
1,
62,
8079,
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... |
how to display sticky reply form at the bottom?
===
How will I display a sticky reply form for chat?
the markup is this:
<div id="container">
<div class="messages_container">
<ol class="messages">
<li>sample message here</li>
<li>sample message here</li>
<li>sample message here</li>
</ol>
</div>
<div class="reply">
<form>
<fieldset>
<textarea cols="60" rows="1" name="message"></textarea>
<input type="checkbox" checked="checked">
<input type="submit" value="Submit"/>
</fieldset>
</form>
</div>
</div> | 0 | [
2,
184,
20,
3042,
19087,
6504,
505,
35,
14,
2129,
60,
800,
3726,
3726,
184,
129,
31,
3042,
21,
19087,
6504,
505,
26,
6615,
60,
14,
943,
576,
25,
48,
45,
13,
1,
12916,
4924,
3726,
7,
1126,
5851,
106,
7,
1,
13,
1,
12916,
718,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
handling multiple submits in php
===
This is my code.
<?php
$qry5=mysql_query("SELECT * FROM `questions` WHERE `questnTime`=curdate()");
$quest=mysql_fetch_array($qry5);
?>
<form id="form" name="form" action="">
<textarea name="questn" id="questn" readonly="readonly" cols="45" rows="5"><?php echo $quest['questnId']; ?>. <?php echo $quest['question'];?></textarea>
<input type="submit" class="myButton" name="option" onclick="handleSubmit(this)" value="<?php echo $quest['optiona'];?>"/>
<input type="submit" class="myButton" name="option" onclick="handleSubmit(this)" value="<?php echo $quest['optionb'];?>"/>
<input type="submit" class="myButton" name="option" onclick="handleSubmit(this)" value="<?php echo $quest['optionc'];?>"/>
<input type="submit" class="myButton" name="option" onclick="handleSubmit(this)" value="<?php echo $quest['optiond'];?>"/>
</form>
<?php
if($quest['answer']==$_GET['option']){
$option=$_GET['option'];
}
Javascript code:
<script type="text/javascript">
function handleSubmit(current){
var list = document.getElementsByName('option');
for(var i=0;i<list.length;i++){
if(list[i]!=current)
list[i].disabled=true;
}
alert('all disabled');
}
</script>
CSS:
<style>
input.myButton{
background-image: url('option.png');
background-color:#FFF;
height:32;
width:32;
border-style:hidden;
color: #FFFFFF;
}
</style>
What I require is when user clicks on an option all other options must be disabled. When an option is clicked, I want to get the value. Also I dont want the page to be refreshed. How to do this? The following code dosenot disable the options. Please help me!!! | 0 | [
2,
7988,
1886,
12298,
18,
19,
13,
26120,
800,
3726,
3726,
48,
25,
51,
1797,
9,
13,
1,
60,
26120,
5579,
1251,
622,
264,
3726,
915,
18,
22402,
1,
8190,
93,
5,
7,
18,
16964,
1637,
37,
13,
1,
24652,
18,
1,
113,
13,
1,
10351,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 any Sql Helper class for 4tier Architecture in Asp.net C#?
===
I am creating my WebApplication in 4 tier Architecture.
- Presentation Layer
- Business Layer
- Business Object Layer
- Data Access Layer
I want to know if there is any Sql Helper class through which i can pass business objects in that class and get the output . I am creating application in Asp.Net 4.0 with C# | 1 | [
2,
25,
80,
186,
4444,
255,
448,
106,
718,
26,
268,
5259,
2607,
19,
28,
306,
9,
2328,
272,
5910,
60,
800,
3726,
3726,
31,
589,
2936,
51,
2741,
2552,
20669,
19,
268,
7197,
2607,
9,
13,
8,
6364,
5385,
13,
8,
508,
5385,
13,
8,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 style sheet in opera
===
I have site, that is work perfectly in all browsers, except opera. The main page works fine, but when i open any node page(drupal 7) opera just simply doesnt download css file. Tried to clear cache, but didnt work. Any ideas what to do? | 0 | [
2,
272,
18,
18,
1034,
6125,
19,
1877,
800,
3726,
3726,
31,
57,
689,
15,
30,
25,
170,
5759,
19,
65,
16495,
18,
15,
1613,
1877,
9,
14,
407,
2478,
693,
1123,
15,
47,
76,
31,
368,
186,
15421,
2478,
5,
43,
7964,
192,
453,
6,
1877... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Tools required for Selenium to run on a php based web application
===
As i am new to Selenium and i have been asked to implement Selenium in my company. I am trying to understand what are components that needs to be installed. So far i have understood that Selenium IDE and Selenium RC is a must. Can someone please explain what is TestNG tool? What is the use of it? Also, is there anything specific i have to learn or take care of, as the web app is a Php based?
Looking forward the reply.
Regards,
Sashi | 0 | [
2,
4672,
1390,
26,
23027,
14311,
20,
485,
27,
21,
13,
26120,
432,
2741,
3010,
800,
3726,
3726,
28,
31,
589,
78,
20,
23027,
14311,
17,
31,
57,
74,
411,
20,
8713,
23027,
14311,
19,
51,
237,
9,
31,
589,
749,
20,
1369,
98,
50,
509... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Rails: HABTM - find all records with no association
===
I have 2 models (Workout, Equipment) in a has and belongs to many relationship. If I use `Workout.find(:all, :joins => :equipment, :conditions => "equipment.id = 5")` it works, but if I use `Workout.find(:all, :joins => :equipment, :conditions => "equipment.id = null")` it doesn't return the records with no association. Any ideas? | 0 | [
2,
2240,
18,
45,
13,
9075,
38,
79,
13,
8,
477,
65,
742,
29,
90,
607,
800,
3726,
3726,
31,
57,
172,
2761,
13,
5,
3783,
1320,
15,
2181,
6,
19,
21,
63,
17,
7034,
20,
151,
1429,
9,
100,
31,
275,
13,
1,
3783,
1320,
9,
19811,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
PhoneGap FileTransfer.upload params no longer posting
===
I just upgraded from Cordova (PhoneGap) 1.5 to 1.9 today and suddenly my FileTransfer params stopped posting. I can tell because I have the server side debugging the $_POST parameters, and they are now blank. Here is the code being run:
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType="image/jpeg";
options.chunkedMode=false;
var params = new Object();
params.client_token = "This will not make it across, sadly...";
options.params = params;
var ft = new FileTransfer();
rs = ft.upload(imageURI, "http://www.mysite.com/api/uploadimage",
function() { alert('Yay!'); },
function() { alert('Fail happens..'); }, options, true);
Has this happened to anyone else? Maybe there's a new setting that has to be set? | 0 | [
2,
1132,
1136,
306,
3893,
7028,
2407,
9,
576,
8294,
2258,
79,
18,
90,
1045,
15669,
800,
3726,
3726,
31,
114,
9958,
37,
5429,
3496,
13,
5,
7709,
1136,
306,
6,
137,
9,
264,
20,
137,
9,
518,
786,
17,
1605,
51,
3893,
7028,
2407,
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... |
Update a record in asp.net using LINQ (the right way)
===
Sounds easy, right? Here's the scenario...
Private dbQuery As New ReefEntities
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CurrentCoral = (From c In dbQuery.Corals Where c.CoralID = intCoralID).FirstOrDefault
txtCommonName.Text = CurrentCoral.CommonName
End If
End Sub
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
'how do I access the coral from the page load to update it?
CurrentCoral.CommonName = strName
dbQuery.SaveChanges()
End Sub
I don't want to re-query my result, I want to update the query from the page load and then save the changes, right? How do I access that original object to update it? | 0 | [
2,
11100,
21,
571,
19,
28,
306,
9,
2328,
568,
6294,
1251,
13,
5,
124,
193,
161,
6,
800,
3726,
3726,
2795,
2010,
15,
193,
60,
235,
22,
18,
14,
12705,
9,
9,
9,
932,
13,
9007,
8190,
93,
28,
78,
10159,
2291,
3808,
3803,
972,
247... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Form must be submitted twice to update checkbox
===
Still relatively new to PHP. Trying to build a privacy settings page for members to opt out of automatic emails for triggered events (i.e. private message notification). Want the checkbox set automatically based on database setting. As of now, the form does update the database correctly, but the checkbox checked status does not show the correct setting unless the Submit button is pressed twice, or the page is reloaded. Setting would be '0' for unchecked, '1' for checked. I'd love to use AJAX or JQuery to handle this, but don't know those well at all.
**privacysettings.php**
<?php
//query to get checkbox status
$sql = mysql_query("SELECT * FROM members WHERE id='$id'");
while($row = mysql_fetch_array($sql)){
$pm_mail_able = $row['pm_mail_able'];
}
switch ($pm_mail_able) {
case 0:
$pm_setting = NULL;
break;
case 1:
$pm_setting = "checked=\"checked\"";
break;
}
if(isset($_GET['pm_email']) && !empty($_GET['pm_email'])) {
$updateqry = mysql_query("UPDATE members SET pm_mail_able='1' WHERE id='$id'");
} else {
$updateqry = mysql_query("UPDATE members SET pm_mail_able='0' WHERE id='$id'");
}
?>
<html>
Email Notifications<br />
<form name="testform" method="get" action="PvResult.php">
When a friend sends me a private message
<input type="checkbox" name="pm_email" value="on"<?php echo $pm_setting;?> />
<br /><br />
<input type="submit" value="Submit" />
</form>
</html>
**PvResult.php**
<?php
$url = 'http://www.xploritall.com';
//If the form isn't submitted, redirect to the form
if(!isset($_GET['Submit']))
header('Location: '.$url.'/privacysettings.php');
//Redirect to the correct location based on form input
$pm_email = $_GET['pm_email'];
$url .= '/privacysettings.php?pm_email='.$pm_email;
header('Location: '.$url);
?> | 0 | [
2,
13,
26120,
505,
491,
44,
7368,
2088,
20,
11100,
2631,
5309,
800,
3726,
3726,
174,
3109,
78,
20,
13,
26120,
9,
749,
20,
1895,
21,
9226,
12410,
2478,
26,
443,
20,
17034,
70,
16,
6715,
8517,
18,
26,
15164,
963,
13,
5,
49,
9,
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... |
Fedora 14 x86_64 implicit declaration of function 'sync'
===
I have the `#include <unistd.h>` header included in my source as specified in the man pages `sync(2)`. However when I compile my program I am getting the following warning.
> ./test.c:25:3: warning: implicit declaration of function ‘sync’
Am I missing something here? Below is the source code for my small test program.
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
// Open file ./test.txt and append to it
int fd = open("./test.txt", O_RDWR | O_CREAT | O_TRUNC, 0);
if (fd < 0) {
perror("Failure to open file: ");
close(fd);
return(1);
}
// Write Hello World\n\0 100 time to ./test.txt
for (int i = 0; i < 100; ++i) {
ssize_t bytes = write(fd, "Hello World\n", 12); // 12 for Null '\0'
if (bytes != 12) {
perror("Failure to write to file");
close(fd);
return(1);
}
}
// Close the file for the exercise
sync();
close(fd);
// This will allow lseek to go back
fd = open("./test.txt", O_RDWR, 0);
// This will not allow lseek to go back
//fd = open("./test.txt", O_RDWR | O_APPEND, 0);
if (fd < 0) {
perror("Failure to open files: ");
close(fd);
return(1);
}
if (lseek(fd, -500, SEEK_END) == -1) {
perror("Test failed: ");
close(fd);
return(1);
}
ssize_t bytes = write(fd, "\n\nHello Dog\n\n", 14);
if(bytes != 14) {
perror("Failure to write: ");
close(fd);
return(1);
}
write(1, "Done!!!\n", 9);
close(fd);
return(0);
}
| 0 | [
2,
26726,
58,
513,
993,
3274,
1,
3470,
20290,
7098,
16,
1990,
13,
22,
9507,
150,
22,
800,
3726,
3726,
31,
57,
14,
13,
1,
5910,
22640,
13,
1,
1020,
702,
43,
9,
252,
1,
157,
106,
506,
19,
51,
1267,
28,
9931,
19,
14,
169,
4434,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon Key not found in Windows 7
===
I am using the following key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
in an application.
The problem is, this particular key is not found in Windows 7.
Someone who knows where this key has been moved in Windows 7 will be a great help! | 0 | [
2,
746,
4237,
1,
15580,
1,
20442,
1,
12980,
5011,
1,
22019,
12980,
1,
27508,
18,
13,
2877,
1,
17657,
10898,
1,
4181,
5567,
218,
1246,
52,
216,
19,
1936,
453,
800,
3726,
3726,
31,
589,
568,
14,
249,
1246,
746,
4237,
1,
15580,
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... |
WampSever is red and is online?
===
My wampservr is no longer working. I don't know what is wrong. I know that port 80 is unused , also I have my firewall disabled. I don't Skype running either, but my Wamp icon stays red and it says online! When I click stop all services it still reads online. Any ideas to what is going on? Any input would be greatly appreciated! Thanks | 2 | [
2,
619,
10158,
18,
5221,
25,
402,
17,
25,
2087,
60,
800,
3726,
3726,
51,
619,
10158,
10321,
139,
25,
90,
1045,
638,
9,
31,
221,
22,
38,
143,
98,
25,
1389,
9,
31,
143,
30,
1295,
2972,
25,
18927,
13,
15,
67,
31,
57,
51,
535,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 make custom-data-attribute value numeric with javascript
===
Hi I am reading two numbers from html data-tags stored in a div. When I try to add the numbers together they are appended as strings. Is there anyways to include numbers in a data attribute and access them as numbers or convert them back into non - string numbers with javascript thanks.
Example
<div data-Lon1="1.3" data-Lat1="-1.2"></div>
<script>
lon1 = $('#zoom1').attr('data-lon1');
lat1 = $('#zoom1').attr('data-lat1');
console.log(lat1+lon1);
//returns '1.3-1.2' (I want .1 in this example)
</script> | 0 | [
2,
184,
20,
233,
5816,
8,
18768,
8,
721,
14755,
1923,
15764,
596,
29,
8247,
8741,
800,
3726,
3726,
4148,
31,
589,
1876,
81,
2116,
37,
13,
15895,
1054,
8,
8628,
18,
8214,
19,
21,
13,
12916,
9,
76,
31,
1131,
20,
3547,
14,
2116,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 show a warning window before opening a combobox items list?
===
My requirement is to show a warning window (in some specific conditions) when clicking on a WPF combobox, just before it shows a list of available items to choose from. The window asks the user if he proceeds or not.
The problem is that after showing this warning window, the combobox popup that should appear to select an item is not open, no matter if I set the property IsDropDownOpen to do so. See the code for details.
<Window x:Class="ComboBoxTester.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<ComboBox Height="20" PreviewMouseDown="ComboBox_PreviewMouseDown">
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
<ComboBoxItem>Item 3</ComboBoxItem>
</ComboBox>
<CheckBox x:Name="warningConditionCheckBox" >Is warning condition?</CheckBox>
</StackPanel>
</Window>
and the code behind contains:
namespace ComboBoxTester {
using System.Windows.Input;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
}
private void ComboBox_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
if (warningConditionCheckBox.IsChecked == true)
{
// Warn about this situation
var window = new MyDialog { Owner = GetWindow(this) };
// Confirm to proceed
if (window.ShowDialog() != true) {
e.Handled = true;
}
else {
comboBox.IsDropDownOpen = true;
}
}
}
}
}
MyDialog is just a Dialog Window:
<Window x:Class="ComboBoxTester.MyDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MyDialog" Height="150" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border Background="Silver">
<TextBlock Text="Warning! Sure to proceed?" TextAlignment="Center"/>
</Border>
<StackPanel Grid.Row="1">
<Button Width="100" Content="OK" IsDefault="True" Click="ButtonOkClick"/>
<Button Width="100" Content="Cancel" IsCancel="True"/>
</StackPanel>
</Grid>
</Window>
----
namespace ComboBoxTester {
using System.Windows;
/// <summary>
/// Interaction logic for MyDialog.xaml
/// </summary>
public partial class MyDialog
{
public MyDialog()
{
InitializeComponent();
}
private void ButtonOkClick(object sender, RoutedEventArgs e)
{
DialogResult = true;
}
}
}
My idea is to use the WPF combobox to deal with this requirement. And to not create another control, if this is possible. So... How can I see the list of items from this combobox after showing a window? Any suggestion helps. | 0 | [
2,
184,
20,
298,
21,
3590,
1463,
115,
1214,
21,
22621,
5309,
3755,
968,
60,
800,
3726,
3726,
51,
8981,
25,
20,
298,
21,
3590,
1463,
13,
5,
108,
109,
1903,
2039,
6,
76,
25590,
27,
21,
619,
7721,
22621,
5309,
15,
114,
115,
32,
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... |
How can I protect password on PHP Symfony form
===
I have simple sing in form in my project on PHP Symfony.
But I found this problem.
when I will use this command
$("#signin_password").val()
in Chrome it shows me password not secured.
How can I to protect user password in this way? | 0 | [
2,
184,
92,
31,
2196,
20884,
27,
13,
26120,
13,
7261,
10229,
93,
505,
800,
3726,
3726,
31,
57,
1935,
4481,
19,
505,
19,
51,
669,
27,
13,
26120,
13,
7261,
10229,
93,
9,
47,
31,
216,
48,
1448,
9,
76,
31,
129,
275,
48,
1202,
55... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Find the fewest turning path
===
Tiles = {
{0,0,0,0,0,0,0,0,0,0},
{0,2,2,2,2,2,2,2,2,0},
{0,3,0,0,2,4,2,2,2,0},
{0,0,2,0,0,0,2,2,2,0},
{0,0,2,2,2,0,2,2,2,0},
{0,0,0,0,2,0,2,2,2,0},
{0,0,2,2,2,0,2,2,2,0},
{0,0,0,0,0,0,0,0,0,0}
}
0 is not clickable, other is clickable, otherways 0 is walkable an other is not, weh i click Tiles[3][2] (number 3) then Tiles[3][6] (number 4), i want to connect that 2 tile through walkable tile, the problem is i dont need a shortest solution, instead i need solution that have 2 or less corner (turning), i have spent 3 days to imagine and googling the algorithm, but no luck, can someone give me a clue or article about that, and i use lua but other language is still i appreciate.
Finding the route with the
fewest corners IS finding
the shortest route, just for
a different definition of
'short' than the one you
originally had in mind. In any case, Dijkstra's
algorithm (essentially,
floodfilling the array
taking the best tiles first)
is fine. You just have to
remember to follow paths with the fewest corners
first, rather than shortest
paths. Alternatively, you
can floodfill using the
normal distance rubric, so
long as you remember to overwrite tiles as
necessary if they are
found along a path with
fewer corners. Either way,
you also have to keep
track of the direction from which each tile was
explored, so you can tell
when a corner is being
turned. | 1 | [
2,
477,
14,
310,
1430,
2101,
2013,
800,
3726,
3726,
14836,
800,
13,
1,
13,
1,
387,
15,
387,
15,
387,
15,
387,
15,
387,
15,
387,
15,
387,
15,
387,
15,
387,
15,
387,
1,
15,
13,
1,
387,
15,
135,
15,
135,
15,
135,
15,
135,
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... |
v8: make errors be written to stderr and not stdout
===
I've built v8 engine as described [here][1]. I execute script like this `./d8 file.js`. All is fine, however it seems that by default errors are written to stdout. I there a way to instruct compiler to write them to stderr?
[1]: http://stackoverflow.com/a/4568662/579026 | 0 | [
2,
566,
457,
45,
233,
11908,
44,
642,
20,
354,
1157,
139,
17,
52,
354,
43,
1320,
800,
3726,
3726,
31,
22,
195,
392,
566,
457,
1406,
28,
745,
636,
6836,
500,
2558,
165,
500,
9,
31,
15644,
3884,
101,
48,
13,
1,
9,
118,
43,
457... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Equal operator overloading
===
The following codes try to show how to use equal operator overloading function:
#include <iostream>
using namespace std;
template <typename T>
class A
{
public:
A() {};
A( T &obj) {value = obj;};
~A() {};
T value;
template <typename E>
A<T>& operator = ( A<E> &obj)
{
if(this == &obj)
return *this;
value = obj.value;
return *this;
}
};
int main()
{
int temp;
temp = 3;
A<int> myobjects(temp);
cout<<myobjects.value<<endl;
float f_value;
f_value = 10.7;
A<float> fobjects(f_value);
myobjects = fobjects;
cout<<myobjects.value<<endl;
return 0;
}
However, when I compile it with VC10, I have found the following error:
error C2440: '==' : cannot convert from 'A<T> *' to 'A<T> *const '
If I change the overloading function in the following way:
template <typename E>
A<T>& operator = ( A<E> &obj)
{
// if(this == &obj)
// return *this;
value = obj.value;
return *this;
}
It will work. Any ideas? | 1 | [
2,
2747,
6022,
84,
16866,
800,
3726,
3726,
14,
249,
11358,
1131,
20,
298,
184,
20,
275,
2747,
6022,
84,
16866,
1990,
45,
6926,
22640,
13,
1,
1963,
11260,
1,
568,
204,
5582,
354,
43,
73,
22894,
13,
1,
4474,
7259,
13,
38,
1,
718,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Loading array in preg_replace
===
Im trying to load my classes array in preg_replace but I am unable to get it to loop through the array. My 1st thought is, because I have a break in my code that is stopping the class from looping, however if i dont have a break in my loop the whole code will loop over and over instead of just the class string looping through.
This is what I have as my code, any suggestions?
include('simple_html_dom.php');
$classes = array('red', 'blue', 'yellow', 'green', 'black');
$i=0;
$html = file_get_html('http://finance.yahoo.com/q/hp?s=^DJI&a=05&b=4&c=2012&d=06&e=6&f=2012&g=d');
$symbol_gainers = '';
foreach ($html->find('.yfnc_datamodoutline1 td') as $element){
$symbol_gainers .= $element->outertext;
$sym_gainers = preg_replace('~(class="yfnc_tabledata1")~', 'class="'.$classes[$i++].'"', $symbol_gainers);
print_r($sym_gainers);
break;
}
Thanks | 0 | [
2,
12797,
7718,
19,
782,
263,
1,
99,
5119,
800,
3726,
3726,
797,
749,
20,
6305,
51,
2684,
7718,
19,
782,
263,
1,
99,
5119,
47,
31,
589,
2343,
20,
164,
32,
20,
5293,
120,
14,
7718,
9,
51,
137,
384,
289,
25,
15,
185,
31,
57,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Apache Derby nature" with Apache Derby plug-in for Eclipse Juno produces error
===
**Using**
* jdk1.7.0_03
* Eclipse IDE for Java EE Developers (Win32) version Juno (build from 2012/06/14)
* derby-core-plugin 10.8.2 and -ui-plugin 1.1.3 (as there is no eclipse plugin for the latest version 10.9.1.0)
**Problem**
When trying to add a new derby nature (right-click on the java project -> "Apache Derby" -> "Add Apache Derby nature") I only get the following message:
Apache Derby Ui Plug-in
Error adding Derby jars to the project:
org.eclipse.ui.internal.WorkbenchWindow cannot be cast to
org.eclipse.jface.window.ApplicationWindow
Any ideas? | 0 | [
2,
13,
7,
14854,
17140,
6473,
1444,
7,
29,
17140,
6473,
10922,
8,
108,
26,
11652,
21715,
6700,
7019,
800,
3726,
3726,
13,
1409,
12655,
1409,
1637,
487,
43,
197,
165,
9,
465,
9,
387,
1,
3601,
1637,
11652,
13,
3448,
26,
8247,
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... |
efficiently dstack arrays from dictionary python
===
I have a dictionary that is keyed by date and filled with classes that have an attribute that is a numpy.array. I want to use np.dstack to make one large array from all the arrays in the dictionary. My current code is like this:
import numpy as np
#PARTS is my dictionary
#the .partposit is the attribute that is an array of shape (50000, 12)
ks = sorted(PARTS.keys())
p1 = PARTS[ks[0]].partposit
for k in ks[1:]:
p1 = np.dstack((p1, PP[k].partposit))
My result is as I expect:
In [67]: p1.shape
Out[67]: (50000, 12, 163)
However, it is quite slow. Is there a more efficient way to do this? | 0 | [
2,
20519,
13,
43,
25325,
7718,
18,
37,
9186,
20059,
800,
3726,
3726,
31,
57,
21,
9186,
30,
25,
1246,
69,
34,
1231,
17,
1943,
29,
2684,
30,
57,
40,
35,
14755,
30,
25,
21,
13,
6336,
6448,
9,
8576,
93,
9,
31,
259,
20,
275,
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... |
can't login in phpmyadmin and mysql after fresh installation of lamp server and phpmyadmin on ubuntu 12.04 LTS
===
I am trying to search a solution for this problem, but didn't find a solution. I am getting an error while login in phpmyadmin
#1045 Cannot log in to the MySQL server
Connection for controluser as defined in your configuration failed.
I am trying to configure config-db.php and config.inc.php files reside in /etc/phpmyadmin/ directory. There i am changing $dbname and $dbpass in config-db.php as my root user and password but still can't login. After google, i get some clue and uncommented a line in config.inc.php:
/* Uncomment the following to enable logging in to passwordless accounts,
* after taking note of the associated security risks. */
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
These things are so ridiculous, follow articles like [Lamp server installation][1]
shows step by step things and i do the same thing, but i get this error thrice times. Even i can't login through shell.
Please help me to sort out this problem and know the actual reason why this happen when i am enter password twice time while installing mysql.
[1]: https://help.ubuntu.com/community/ApacheMySQLPHP | 2 | [
2,
92,
22,
38,
6738,
108,
19,
13,
26120,
915,
1283,
2160,
17,
51,
18,
22402,
75,
3180,
7758,
16,
6792,
8128,
17,
13,
26120,
915,
1283,
2160,
27,
287,
12968,
2473,
390,
9,
3277,
7137,
18,
800,
3726,
3726,
31,
589,
749,
20,
2122,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 point a subdomain to subdirectory hosted elsewhere
===
I have blog on blogspot with a custom domain I bought from BigRock, http://www.thebloggieman.com , I recently bought a shared hosting account with Host1plus.
I am planning to migrate to WordPress soon, before I migrate I wanted to make test my blog on WordPress, so I made a subdomain, http://wordpress.thebloggieman.com, through my domain registrar service and added a A record to point to my hosting servers. I even made that same subdomain in the cPanel provided by Host1plus. I installed WordPress in my hosting service under a subdirectory named, wordpress. Still its not working, I know I am doing something wrong here.
I have searched the internet over million times to find a proper way to do this thing, but am unable to find a suitable answer. I am a newbie with these DNS settings as I have only used blogspot for my sites.
Please can anyone tell me, how to do this thing? to point the subdomain to the subdirectory but the url must be `wordpress.thebloggieman.com` not `thebloggieman.com/wordpress` , get it?
| 0 | [
2,
184,
92,
31,
454,
21,
972,
537,
6232,
20,
972,
10197,
93,
2812,
6040,
800,
3726,
3726,
31,
57,
8146,
27,
8146,
18,
4296,
29,
21,
5816,
4603,
31,
2448,
37,
580,
4651,
15,
7775,
6903,
6483,
9,
124,
7091,
19086,
12955,
9,
960,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
maintaining data in google chrome extension
===
I know that Chrome Extensions use localStorage for data persistence.but as I use this?
**Example**
1) I click on my extension
2) opens the html page of my extension (popup.html)
![enter image description here][1]
3) I add an element that has the text, the text of the prompt
![enter image description here][2]
4) "abandoned" the extension
5) Control the listbox and the new first element inserted is not in the listbox
![enter image description here][1]
there is my
[popup.html][3]
[1]: http://i.stack.imgur.com/BbDVB.png
[2]: http://i.stack.imgur.com/rjyoi.png
[3]: http://pastebin.com/X65V9n5w | 0 | [
2,
8215,
1054,
19,
8144,
13,
12985,
3896,
800,
3726,
3726,
31,
143,
30,
13,
12985,
17529,
275,
375,
18,
2153,
1303,
26,
1054,
28584,
9,
811,
28,
31,
275,
48,
60,
13,
1409,
29041,
1409,
137,
6,
31,
10840,
27,
51,
3896,
172,
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... |
Facebook PHP SDK: $facebook->getUser() sometimes returning 0
===
This is a very frustrating problem for me as I am unable to recreate the problem and I have nothing to test off of. For some reason random users of my Facebook app will have their UID returned as 0. It doesn't appear to be a specific browser issue from what I can tell.
Here's how my app works. I have a homepage where a user can click and Enter Now link. This button triggers the `oauth();` JS function and should pop open the OAuth login window. See my JS code below..
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxxxxxxxxx', // App ID
channelUrl : '//channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.Canvas.scrollTo(0,0); //makes window scroll to top when loading page within iframe
FB.Canvas.setAutoGrow(); //resize the height of the iframe automatically
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
function oauth() {
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
console.log('Good to see you, ' + response.name + '.');
//window.location.reload();
//alert("bing bong bing");
$.fancybox.open("#entry-form", {
width: 645,
minHeight: 920,
padding: 0,
scrolling: 'no',
wrapCSS: 'enternow-form',
type: 'iframe',
href: 'upload',
helpers : {
overlay : {
opacity: 0.95,
css : {
'background-color' : '#fff'
}
}
}
});
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
});
}//end oauth function
If the oauth login is successful I pop open a FancyBox iframe that has a form in it. Here is the Facebook PHP code on the iframe page to get the UID...
<?php header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); ?>
<?php session_start(); ?>
<?php require_once("../src/facebook.php"); ?>
<?php
$config = array();
$config["appId"] = 'xxxxxxxxxxxxxx';
$config["secret"] = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$config["fileUpload"] = false; // optional
$facebook = new Facebook($config);
// get signed request to help determine if user is an admin
$signedRequest = $facebook->getSignedRequest();
// Get User ID
$user = $facebook->getUser();
// We may or may not have this data based on whether the user is logged in.
//
// If we have a $user id here, it means we know the user is logged into
// Facebook, but we don't know if the access token is valid. An access
// token is invalid if the user logged out of Facebook.
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
// Login or logout url will be needed depending on current user state.
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$loginUrl = $facebook->getLoginUrl();
}
?>
<?php echo $user //this is the user's ID ?> | 0 | [
2,
9090,
13,
26120,
13,
18,
43,
197,
45,
5579,
6413,
5199,
8,
1,
3060,
16704,
5,
6,
1030,
2485,
713,
800,
3726,
3726,
48,
25,
21,
253,
25568,
1448,
26,
55,
28,
31,
589,
2343,
20,
21119,
14,
1448,
17,
31,
57,
626,
20,
1289,
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... |
How do I make every class generated by Struct.new to have a class method?
===
My problem is, I have a bunch of classes that extend Struct.new. And now I need add a common class method to all of them.
If Struct was a 'normal' superclass, I would be able to define a class method on it and then every subclass would also have that method.
Given, that it is not, how do I replicate this behaviour?
For example,
class Foo < Struct.new(:foo); end
Foo.respond_to?(:perform) #=> true
class Bar < Struct.new(:bar); end
Bar.respond_to?(:perform) #=> true | 0 | [
2,
184,
107,
31,
233,
352,
718,
6756,
34,
13,
10346,
9,
2681,
20,
57,
21,
718,
2109,
60,
800,
3726,
3726,
51,
1448,
25,
15,
31,
57,
21,
7653,
16,
2684,
30,
7206,
13,
10346,
9,
2681,
9,
17,
130,
31,
376,
3547,
21,
757,
718,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 ' ' around all values in hash
===
Im trying to surround all values in my hash with single quotes. here is my code.
foreach(values(%properties_hash))
{
print "'".$_."'\n";
}
Right now I'm printing. How would I actually augment the value. Also this prints
'logs
'format/systemout-2010-format.txt
'analyze
It is only
printing the first '. Why would that be?
Thanks! | 0 | [
2,
4721,
13,
22,
13,
22,
140,
65,
4070,
19,
19170,
800,
3726,
3726,
797,
749,
20,
12215,
65,
4070,
19,
51,
19170,
29,
345,
18901,
9,
235,
25,
51,
1797,
9,
26,
14322,
5,
15165,
18,
5,
11881,
10890,
106,
3915,
1,
25436,
6,
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... |
Visual Web Developer 2010 Express Launching A Non-Existent Page
===
I am developing a web page in Visual Web Developer 2010 Express. Recently, when I run the project, I am bounced to a login page that doesn't exist. I haven't written any code to do with login and authentication. Here is the URL that I get bounced to:
http://localhost:1746/WebApp/Account/Login?ReturnUrl=%2fWebApp%2fNetworkOperationsReport.aspx
and this is the URL I should be going to:
http://localhost:1746/WebApp/NetworkOperationsReport.aspx
but even putting the second address in the address bar gets me bounced to the first address.
Here is my web.config file:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;"/>
<add key="webpages:Enabled" value="true"/>
</appSettings>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<authentication mode="Windows" />
<authorization>
<deny users="?"/>
</authorization>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<handlers>
<remove name="ChartImageHandler"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
<system.net>
<mailSettings>
<smtp>
<network host="ecmcmx1.tdbank.ca" password="" userName=""/>
</smtp>
</mailSettings>
</system.net>
</configuration>
I am completely unable to find what the problem is. Something is pointing to this missing page but I have not made any changes that should affect this.
Any advice is appreciated.
Regards.
| 0 | [
2,
3458,
2741,
10058,
498,
2999,
13762,
21,
538,
8,
20788,
2478,
800,
3726,
3726,
31,
589,
3561,
21,
2741,
2478,
19,
3458,
2741,
10058,
498,
2999,
9,
1989,
15,
76,
31,
485,
14,
669,
15,
31,
589,
15035,
20,
21,
6738,
108,
2478,
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... |
how do i know if a submodule has changed in git?
===
Currently I have a few submodules in my parent project. How can I tell if one of the submodules has recently changed and I need to do a
git submodule foreach git pull origin master | 0 | [
2,
184,
107,
31,
143,
100,
21,
972,
19673,
62,
63,
1015,
19,
13,
10404,
60,
800,
3726,
3726,
871,
31,
57,
21,
310,
972,
19673,
160,
19,
51,
4766,
669,
9,
184,
92,
31,
494,
100,
53,
16,
14,
972,
19673,
160,
63,
1989,
1015,
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 can a client cancel an active Oracle query?
===
I have an active Oracle operation which is taking too long. How can I programmatically cancel the operation without terminating the session? | 0 | [
2,
184,
92,
21,
6819,
14815,
40,
1348,
15759,
25597,
60,
800,
3726,
3726,
31,
57,
40,
1348,
15759,
1453,
56,
25,
741,
266,
175,
9,
184,
92,
31,
625,
6732,
1326,
14815,
14,
1453,
366,
25724,
14,
3723,
60,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
how i can remove quotes around string
===
Hi i want to remove quotes around this string
str = "[Date.UTC(2012,07,03,04,07,09),2.0]"
and want result like this
[Date.UTC(2012,07,03,04,07,09),2.0]
Any help will be apperciated...
Thanks | 0 | [
2,
184,
31,
92,
4681,
18901,
140,
3724,
800,
3726,
3726,
4148,
31,
259,
20,
4681,
18901,
140,
48,
3724,
13,
9729,
800,
13,
7,
2558,
8209,
9,
11440,
5,
3212,
15,
2984,
15,
3601,
15,
3277,
15,
2984,
15,
2545,
6,
15,
135,
9,
387,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Showing Image -GUI
===
I'm trying to make a simple GUI using JAVA
no image is shown
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.swing.*;
import javax.imageio.*;
public class EmiloLadderSnack {
public JFrame frame=new JFrame("EmiloLadderSnack");
public Image img;
public Graphics g;
public EmiloLadderSnack()
{
frame.setBounds(0, 0, Toolkit.getDefaultToolkit().getScreenSize().width, Toolkit.getDefaultToolkit().getScreenSize().height);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
try
{
img= ImageIO.read(new File("/media/01CCE00FA6888D80/Achieve/Eclipse/EmiloLadderSnack/src/photo.jpg"));
g.drawImage(img, 50, 50, null);
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
public static void main(String args[])
{
new EmiloLadderSnack();
}
}
please help me to show an image in my simple GUI using JAVA
I'm using Eclipse | 0 | [
2,
8247,
3187,
1961,
13,
8,
7215,
800,
3726,
3726,
31,
22,
79,
749,
20,
233,
21,
1935,
9457,
568,
8247,
90,
1961,
25,
1721,
9010,
8247,
9,
3885,
38,
9,
2483,
73,
9010,
8247,
9,
3885,
38,
9,
4943,
38,
9,
2483,
73,
9010,
8247,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
spring download test suites
===
How do i download the test suites that spring developers wrote. I found this site http://git.springsource.org/sandbox/cbeams/trees/5519df3491b0c420f312253348fb93110aea99d3/org.springframework.expression/src/test/java/org/springframework/expression/spel but not sure how to download it to my drive. | 0 | [
2,
1573,
7121,
1289,
6160,
18,
800,
3726,
3726,
184,
107,
31,
7121,
14,
1289,
6160,
18,
30,
1573,
10168,
738,
9,
31,
216,
48,
689,
7775,
6903,
10404,
9,
15827,
12097,
9,
5583,
118,
18,
290,
5309,
118,
150,
17869,
18,
118,
8101,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Django - Keeping the original method's work and add new custom validation
===
This is supposed to be a Django-specific, but I guess it's Python anyway.
Basically, I don't want to override the work of the original method in the class I am inheriting (could be a Model class), but I'd like to add additional validation. **Is this possible?** Any hint?
class MyUserAdminForm(forms.ModelForm):
class Meta:
model = User
def clean(self):
// do some additional work even though it's cleaned by parent's clean method
| 0 | [
2,
3857,
14541,
13,
8,
2882,
14,
501,
2109,
22,
18,
170,
17,
3547,
78,
5816,
27999,
800,
3726,
3726,
48,
25,
2293,
20,
44,
21,
3857,
14541,
8,
9219,
15,
47,
31,
2321,
32,
22,
18,
20059,
2774,
9,
11374,
15,
31,
221,
22,
38,
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 convert address to Lat and Lng from an XML file?
===
i saw your example of the geocoder and work great, but im building the map from a XML file, how can i use geocoder with xml.
<script type="text/javascript">
var geocoder = new google.maps.Geocoder();
var address = "new york";
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latitude = results[0].geometry.location.lat();
var longitude = results[0].geometry.location.lng();
alert(latitude);
}
});
</script>
this is my actual code.
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="jquery-1.4.1.min.js"></script>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
#map { height: 70% }
</style>
<apputil:css/>
<script type="text/javascript">
var myIcons = [];
myIcons['0'] = 'images/oneclick_flag_green.png';
myIcons['1'] = 'images/oneclick_flag_yellow.png';
myIcons['2'] = 'images/oneclick_flag_brown.png';
myIcons['3'] = 'images/oneclick_flag_orange.png';
myIcons['4'] = 'images/oneclick_flag_red.png';
myIcons['5'] = 'images/oneclick_flag_blue.png';
myIcons['6'] = 'images/oneclick_flag_gray.png';
$(document).ready(function() {
var myLatLng = new google.maps.LatLng(17.74033553, 83.25067267);
MYMAP.init('#map', myLatLng, 11);
MYMAP.placeMarkers('gmaps/markers.xml');
});
var MYMAP = {
map: null,
bounds: null
}
MYMAP.init = function(selector, latLng, zoom) {
var myOptions = {
zoom:zoom,
center: latLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.map = new google.maps.Map($(selector)[0], myOptions);
this.bounds = new google.maps.LatLngBounds();
}
MYMAP.placeMarkers = function(filename) {
$.get(filename, function(xml){
$(xml).find("marker").each(function(){
var name = $(this).find('name').text();
var address = $(this).find('address').text();
// create a new LatLng point for the marker
var lat = $(this).find('lat').text();
var lng = $(this).find('lng').text();
var icontype = $(this).find('icon').text();
var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
// extend the bounds to include the new point
MYMAP.bounds.extend(point);
var marker = new google.maps.Marker({
position: point,
icon: myIcons[icontype],
map: MYMAP.map
});
var infoWindow = new google.maps.InfoWindow();
var html='<strong>'+name+'</strong.><br />'+address;
google.maps.event.addListener(marker, 'click', function() {
infoWindow.setContent(html);
infoWindow.open(MYMAP.map, marker);
});
MYMAP.map.fitBounds(MYMAP.bounds);
});
});
}
</script>
`
the xml file look like
<markers>
<marker>
<name>Kenny</name>
<address>Suipacha 400, buenos aires, argentina.</address>
<icon>0</icon>
</marker>
</markers>
but is to much work get coordinates manualy.
Thanks !
| 0 | [
2,
184,
8406,
3218,
20,
14303,
17,
644,
2723,
37,
40,
23504,
3893,
60,
800,
3726,
3726,
31,
441,
154,
823,
16,
14,
6389,
716,
1157,
17,
170,
374,
15,
47,
797,
353,
14,
2942,
37,
21,
23504,
3893,
15,
184,
92,
31,
275,
6389,
716... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
navigationController is null with Tab Bars
===
I've had a good look at the Apple docs as well as similar Stack Overflow questions, but I am stuck on why my navigationController is null when using tab bars. I am trying to build most of the app from code, and am not using XIBs to insert a navigationController.
While debugging I have greatly simplified my app, down to two tabs. One tab holds a tableview and when a row is touched I'm expecting a detail page (from a XIB) to appear. Should be pretty simple. I am finding the value of self.navigationController is NULL when attempting to push the detail view, and of course it is then not working. I took the tab bar our completely and it works fine from a single view (the tableview). In this instance self.navigationController has a value.
**AppDelegate.m**
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// With Tab Bars
self.tabBarController = [[UITabBarController alloc] init];
ViewController *vc1 = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
vc1.tabBarItem.title = @"Words";
vc1.tabBarItem.image = [UIImage imageNamed:@"tab_feed.png"];
TextTableViewController *vc2 = [[TextTableViewController alloc] init];
vc2.tabBarItem.title = @"Text";
vc2.tabBarItem.image = [UIImage imageNamed:@"tab_live.png"];
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:vc1];
NSArray* controllers = [NSArray arrayWithObjects:vc2, navController, nil];
tabBarController.viewControllers = controllers;
tabBarController.delegate = self;
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.rootViewController = self.tabBarController;
[window makeKeyAndVisible];
return YES;
}
**From TextTableViewController.m**
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
TextViewController *detailViewController = [[TextViewController alloc] initWithNibName:@"TextViewController" bundle:nil];
Text *text = [[Text alloc] init];
text = [textArray objectAtIndex:indexPath.row];
detailViewController.TextID = text.textID;
NSLog(@"Nav Controller: %@",self.navigationController);
[self.navigationController pushViewController:detailViewController animated:YES];
NSLog(@"pushed");
}
I've also got two questions related to this problem.
(1) What is the purpose of this line. It doesn't appear to make a difference if it is in or out, and is absent from the Apple example.
tabBarController.delegate = self;
(2) When creating an array of tabs, one of the views is made the navigationController. Does it matter which tab it is or should this be a different view altogether not related to any tab and not visible. Is this where the problem lies? | 0 | [
2,
8368,
12898,
1252,
25,
16203,
29,
6523,
6062,
800,
3726,
3726,
31,
22,
195,
41,
21,
254,
361,
35,
14,
4037,
9765,
18,
28,
134,
28,
835,
7566,
20285,
2346,
15,
47,
31,
589,
4549,
27,
483,
51,
8368,
12898,
1252,
25,
16203,
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... |
Fill up parent window fields with modelbox popup
===
I want to make a form in parent (main) window with some fields that will have a hyperlink beside it, and when this hyperlink is clicked, it'll open a "modelbox" popup with options to fill that field. So I'll click in some option in this modelbox popup and it value is filled to parent window respective field.
My question is how to do this?
Can anyone give me an example code to do it?
Thanks. | 0 | [
2,
3509,
71,
4766,
1463,
2861,
29,
1061,
5309,
1675,
576,
800,
3726,
3726,
31,
259,
20,
233,
21,
505,
19,
4766,
13,
5,
6232,
6,
1463,
29,
109,
2861,
30,
129,
57,
21,
5443,
6258,
2113,
32,
15,
17,
76,
48,
5443,
6258,
25,
15802,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 capture back key event from activity opened from browser intent while opening twitter
===
I am using twitter4j in android app to integrate twitter, i am calling twittershare activity of twitter4j from my app activity, it openes browser for twitter login, when i clicked back key it is going back to PrepareRequestTokenActivity Activity but not in
onNewIntent(Intent intent) , so how do i capture back key event from browser
| 0 | [
2,
184,
20,
3683,
97,
1246,
807,
37,
2358,
520,
37,
16495,
6936,
133,
1214,
10623,
800,
3726,
3726,
31,
589,
568,
10623,
300,
728,
19,
13005,
4865,
20,
18399,
10623,
15,
31,
589,
2555,
10623,
16608,
2358,
16,
10623,
300,
728,
37,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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) Create a search query with mutiple choices but with MONTHNAME and YEAR
===
So i have a form that has 3 dropdown lists with diferent criterias, one is to search the month (mes), the year (ano) and the type (tipo_id).
what i want to do, and thanks to many questions in here i was able to advance to this place, is that when you select something from the 3 dropdowns, 2 or 1, it shows a table referring the information about it, i can do it, but just for tipo_id, i think the problem is in using MONTHNAME and YEAR the way am using in my code, i wanted to know how can i make this work, thanks in advance
$mes = mysql_real_escape_string($_POST['mes']);
$ano = mysql_real_escape_string($_POST['ano']);
$tipo = mysql_real_escape_string($_POST['tipo_id']);
$meses = array(
Janeiro => 'January',
Fevereiro =>'February',
Março =>'March',
Abril =>'April',
Maio =>'May',
Junho =>'June',
Julho => 'July',
Agosto =>'August',
Setembro =>'September',
Outubro =>'October',
Novembro =>'November',
Dezembro =>'December'
);
$sql4 = "SELECT * FROM fluxo";
$searches = array();
if ($mes != '') $searches[] = "WHERE MONTHNAME(data) = '".$meses[$mes]."'";
if ($ano != '') $searches[] = "WHERE YEAR(data) = '".$ano."'";
if ($tipo != '') $searches[] = "tipo = '".$tipo."'";
if (count($searches) > 0) {
$sql4 .= " WHERE " . implode(" AND ", $searches);
}
$sql4 .= ';';
$result4=mysql_query($sql4); | 0 | [
2,
13,
5,
26120,
6,
1600,
21,
2122,
25597,
29,
22072,
5106,
10978,
47,
29,
1617,
7259,
17,
159,
800,
3726,
3726,
86,
31,
57,
21,
505,
30,
63,
203,
2804,
2968,
7227,
29,
926,
2407,
2291,
9157,
18,
15,
53,
25,
20,
2122,
14,
1617... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Dynamically change src in Google docs embedded viewer
===
<iframe src="http://docs.google.com/viewer?url=http://url.com&embedded=true" width="620" height="780" style="border: none;" id="document-preview"></iframe>
</div>
I have an embedded google docs viewer. Everything works fine, but now I want to change the iframe src when I click a certain link to display another document.
This gives me `Refused to display document because display forbidden by X-Frame-Options.`
Does anyone know how to solve this ? | 0 | [
2,
7782,
1326,
753,
13,
18,
5453,
19,
8144,
9765,
18,
12138,
16812,
800,
3726,
3726,
13,
1,
49,
8361,
13,
18,
5453,
3726,
7,
21127,
6903,
13799,
18,
9,
16111,
4875,
9,
960,
118,
4725,
106,
60,
911,
255,
3726,
21127,
6903,
911,
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... |
Has anyone used Indexed DB?
===
Since websql is depreciated so I was looking into IndexedDB for browser offline storage facility,but I found that indexedDB has undergone major design change after the example showed in HTML5Rocks(http://www.html5rocks.com/en/tutorials/indexeddb/todo/) and this(http://www.kristofdegrave.be/2011/10/indexed-db-creating-opening-and.html) is the new tutorial of indexedDB. The code seems to be bit complicated. I want to ask has anyone used it for offline storage of data?My requirement is the application which I am developing should work even if there is no internet connectivity and and all data will be sync to remote DB when internet connectivity is available.is it possible? | 1 | [
2,
63,
1276,
147,
4348,
69,
13,
9007,
60,
800,
3726,
3726,
179,
2741,
18,
22402,
25,
13,
17309,
15110,
1669,
86,
31,
23,
699,
77,
4348,
69,
9007,
26,
16495,
168,
1143,
4326,
2646,
15,
811,
31,
216,
30,
4348,
69,
9007,
63,
20301,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 happens if a proper design has been not followed for an enterprise application
===
I’ve been outsourced for an ASP.Net project of another organization to build a large enterprise application. Currently almost 80% of the work has been completed. I found that the developers did not implemented any architecture in this application. All the work is done in the code behind file (*.aspx.cs). Even the database calls, sql scripts, etc. are on the code behind file. The entire solution has only one project, which is a Website. All the coding, .aspx file etc. comes under it.
I know that the maintainability , catering to change requests, etc. of this project will be a nightmare.
But I would like know about the impact for the functionality of this project once the no of users increased from hundreds to thousands and more.
Will it be an issue, for not having a Data access layer and maintaining db connections in a once single place?
What will be the overall impact of the project from the functionality wise due to not implementing proper system architecture?
I need some hard point to convince them to go for a proper system architecture, which may be a whole system rewrite. So would be grateful if you are able to share your expertise of this matter.
Thanks.
| 0 | [
2,
98,
5531,
100,
21,
4119,
704,
63,
74,
52,
709,
26,
40,
6002,
3010,
800,
3726,
3726,
31,
1,
195,
74,
70,
12097,
43,
26,
40,
28,
306,
9,
2328,
669,
16,
226,
1165,
20,
1895,
21,
370,
6002,
3010,
9,
871,
557,
15254,
16,
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... |
Android database sqlite error
===
when I run my code (a creation of a database mysqlite) I have an error:
07-25 11:36:25.797: D/AndroidRuntime(364): Shutting down VM
07-25 11:36:25.797: W/dalvikvm(364): threadid=1: thread exiting with uncaught exception (group=0x40015560)
07-25 11:36:25.818: E/AndroidRuntime(364): FATAL EXCEPTION: main
07-25 11:36:25.818: E/AndroidRuntime(364): java.lang.RuntimeException: Unable to start activity ComponentInfo{evolution.web/evolution.web.HOME}: java.lang.NullPointerException
07-25 11:36:25.818: E/AndroidRuntime(364): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
07-25 11:36:25.818: E/AndroidRuntime(364): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-25 11:36:25.818: E/AndroidRuntime(364): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-25 11:36:25.818: E/AndroidRuntime(364): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-25 11:36:25.818: E/AndroidRuntime(364): at android.os.Handler.dispatchMessage(Handler.java:99)
07-25 11:36:25.818: E/AndroidRuntime(364): at android.os.Looper.loop(Looper.java:123)
07-25 11:36:25.818: E/AndroidRuntime(364): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-25 11:36:25.818: E/AndroidRuntime(364): at java.lang.reflect.Method.invokeNative(Native Method)
07-25 11:36:25.818: E/AndroidRuntime(364): at java.lang.reflect.Method.invoke(Method.java:507)
07-25 11:36:25.818: E/AndroidRuntime(364): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-25 11:36:25.818: E/AndroidRuntime(364): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-25 11:36:25.818: E/AndroidRuntime(364): at dalvik.system.NativeStart.main(Native Method)
07-25 11:36:25.818: E/AndroidRuntime(364): Caused by: java.lang.NullPointerException
07-25 11:36:25.818: E/AndroidRuntime(364): at evolution.web.db.Database$DbHelper.onCreate(Database.java:46)
07-25 11:36:25.818: E/AndroidRuntime(364): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:126)
07-25 11:36:25.818: E/AndroidRuntime(364): at evolution.web.db.Database.open(Database.java:58)
07-25 11:36:25.818: E/AndroidRuntime(364): at evolution.web.HOME.onCreate(HOME.java:54)
07-25 11:36:25.818: E/AndroidRuntime(364): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-25 11:36:25.818: E/AndroidRuntime(364): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
07-25 11:36:25.818: E/AndroidRuntime(364): ... 11 more
Any idea? | 1 | [
2,
13005,
6018,
4444,
10601,
7019,
800,
3726,
3726,
76,
31,
485,
51,
1797,
13,
5,
58,
2502,
16,
21,
6018,
51,
18,
1251,
10601,
6,
31,
57,
40,
7019,
45,
13,
2984,
8,
1811,
547,
22841,
45,
1811,
9,
3399,
465,
45,
13,
43,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Custom AlertDialog with Themed Dialog crashing when added View.onClickListener
===
I am using an Activity with a Theme.Dialog to do my AlertDialog as i'm trying to use this dialog inside a BroadcastReceiver but when i added a OnClickListener the application crashes everytime it launches.
Code:
package nyp.android.project;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class PasswordDialog extends Activity {
private static final String TAG = "Logging Activity";
Context context;
Button login;
private static final int MY_PASSWORD_DIALOG_ID = 0;
protected void onCreate(Bundle savedInstanceState)
{
this.context = context;
super.onCreate(savedInstanceState);
setContentView (R.layout.password_dialog);
//SharedPreferences passwdfile = context.getSharedPreferences(
// PhoneFinder.PASSWORD_PREF_KEY, 0);
//String correctSHA1 = passwdfile.getString(PhoneFinder.PASSWORD_PREF_KEY, null);
login = (Button) findViewById(R.id.loginPassword);
login.setOnClickListener(myhandler1);
}
View.OnClickListener myhandler1 = new View.OnClickListener() {
public void onClick(View v) {
Toast.makeText(context, "Hello World!", Toast.LENGTH_LONG).show();
}
};
}
Logcat:
07-25 11:59:03.044: W/dalvikvm(364): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
07-25 11:59:03.054: E/AndroidRuntime(364): FATAL EXCEPTION: main
07-25 11:59:03.054: E/AndroidRuntime(364): java.lang.RuntimeException: Unable to start activity ComponentInfo{nyp.android.project/nyp.android.project.PasswordDialog}: java.lang.NullPointerException
07-25 11:59:03.054: E/AndroidRuntime(364): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
07-25 11:59:03.054: E/AndroidRuntime(364): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-25 11:59:03.054: E/AndroidRuntime(364): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-25 11:59:03.054: E/AndroidRuntime(364): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-25 11:59:03.054: E/AndroidRuntime(364): at android.os.Handler.dispatchMessage(Handler.java:99)
07-25 11:59:03.054: E/AndroidRuntime(364): at android.os.Looper.loop(Looper.java:123)
07-25 11:59:03.054: E/AndroidRuntime(364): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-25 11:59:03.054: E/AndroidRuntime(364): at java.lang.reflect.Method.invokeNative(Native Method)
07-25 11:59:03.054: E/AndroidRuntime(364): at java.lang.reflect.Method.invoke(Method.java:521)
07-25 11:59:03.054: E/AndroidRuntime(364): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-25 11:59:03.054: E/AndroidRuntime(364): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-25 11:59:03.054: E/AndroidRuntime(364): at dalvik.system.NativeStart.main(Native Method)
07-25 11:59:03.054: E/AndroidRuntime(364): Caused by: java.lang.NullPointerException
07-25 11:59:03.054: E/AndroidRuntime(364): at nyp.android.project.PasswordDialog.onCreate(PasswordDialog.java:32)
07-25 11:59:03.054: E/AndroidRuntime(364): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-25 11:59:03.054: E/AndroidRuntime(364): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-25 11:59:03.054: E/AndroidRuntime(364): ... 11 more | 0 | [
2,
5816,
7863,
4286,
5567,
29,
14,
4688,
28223,
14604,
76,
905,
1418,
9,
218,
150,
10129,
13891,
106,
800,
3726,
3726,
31,
589,
568,
40,
2358,
29,
21,
3184,
9,
4286,
5567,
20,
107,
51,
7863,
4286,
5567,
28,
31,
22,
79,
749,
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... |
Sort a string array alphabetically but ignore numbers and symbols
===
I'm trying to sort a string array that contains numbers just by the letters so for example:
`Original array = {"09Bananas", "Pears2", "Mangoes39Bad", "100Apples", "Mangoes38Good"}`
Should become:
`Sorted array = {"100Apples", "09Bananas", "Mangoes39Bad", "Mangoes38Good", "Pears2"}`
However when I try to use `Array.sort(original)` it would come out like this:
`{"09Bananas", "100Apples", "Mangoes38Good", "Mangoes39Bad", "Pears2"}`
Is there an overload of `Array.sort` that would make it ignore numbers?
Thanks | 0 | [
2,
2058,
21,
3724,
7718,
27169,
102,
47,
7174,
2116,
17,
9794,
800,
3726,
3726,
31,
22,
79,
749,
20,
2058,
21,
3724,
7718,
30,
1588,
2116,
114,
34,
14,
2516,
86,
26,
823,
45,
13,
1,
13989,
7718,
800,
13,
1,
7,
2545,
14361,
616... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
setTimeout not adding a delay
===
This is my code:
function transition(index){
$("#right-panel").find("img").each(function(){
if ($(this).index() === index){
setTimeout(function(){
$(this).fadeIn(750);
}, 100000000);
}else{
$(this).fadeOut(750);
}
});
}
For some reason, the setTimeout in the function is not causing a delay for the fadeIn. What am I doing wrong? | 0 | [
2,
309,
891,
1320,
52,
4721,
21,
7255,
800,
3726,
3726,
48,
25,
51,
1797,
45,
1990,
4513,
5,
25671,
6,
1,
5579,
5,
7,
5910,
4183,
8,
3206,
532,
7,
6,
9,
19811,
5,
7,
1660,
263,
7,
6,
9,
14322,
5,
22359,
5,
6,
1,
100,
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... |
why a boarders has different color in different sides
===
I found that the left and above boarder color is grey (160, 160, 160), but the bottom and right boarder color is white, when I use WS_EX_STATICEDGE.
Can we make the whole edge to be of color grey? (pure winapi) | 0 | [
2,
483,
21,
686,
445,
63,
421,
1665,
19,
421,
2570,
800,
3726,
3726,
31,
216,
30,
14,
225,
17,
784,
686,
106,
1665,
25,
2682,
13,
5,
11580,
15,
9379,
15,
9379,
6,
15,
47,
14,
2129,
17,
193,
686,
106,
1665,
25,
359,
15,
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... |
Google Maps show location based on user inputs
===
Hi I have an web application where in I have 4 fields in the form, like streetname,nearest street,zip,state and country.Based on this I need to show the location of this address in the google maps.I have to implement this functionality for GoogleMaps/Bing/ and Yahoo maps.
Can someone point to correct api's for these.This is my first implementation of maps,so need some inputs.Appreciate if someone can point me to right direction. | 0 | [
2,
8144,
6867,
298,
1474,
432,
27,
4155,
6367,
18,
800,
3726,
3726,
4148,
31,
57,
40,
2741,
3010,
113,
19,
31,
57,
268,
2861,
19,
14,
505,
15,
101,
446,
7259,
15,
14114,
1430,
446,
15,
2553,
306,
15,
3859,
17,
475,
9,
1281,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Should we EVER use explicit dp values for width/height?
===
I've come across a project done by some other team which I have to fix. They used `dp` values for images' width/height. When I tried to adopt the layout for some tablets and/or mobiles, I've faced a lot of troubles.
For example, the image of `40x40 dp` has top padding of `15dp`. When such image is loaded by some new mobile screen, the image is not where is was supposed to be - it's either shifted or distorted or of the wrong size.
Now I need to propose a redesign of the whole app and I need some advise from the more experienced community.
Should I abandon such layout policy (described abobe) and do like this:
1. make the image with the size of 40x40 px
2. position the image for the mdpi screen
3. set its height/width to wrap_content
4. do like this for other images
5. after I finish layout for mdpi, resize each image for ldpi, hdpi and xhdpi screens
6. in case of a special mobile/tablet, make a special set of images + xml files and place them in a narrowed-down resource folder (like `/res/drawable-large-hdpi`).
Is there a way when you would advise to use **the explicit size of some images**?
Do you advise setting the size of images in **xml layout** or setting size via **photoshop or similar graphics tools** and then resize images for other screen sizes or screen densities? | 0 | [
2,
378,
95,
462,
275,
14990,
13,
7431,
4070,
26,
9456,
118,
252,
7748,
60,
800,
3726,
3726,
31,
22,
195,
340,
464,
21,
669,
677,
34,
109,
89,
173,
56,
31,
57,
20,
6098,
9,
59,
147,
13,
1,
7431,
1,
4070,
26,
3502,
22,
9456,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 left align Mathjax elements
===
Mathjax elements are by default, center aligned.
How can I make Mathjax elements left aligned? | 0 | [
2,
184,
20,
225,
23389,
5057,
1004,
396,
2065,
800,
3726,
3726,
5057,
1004,
396,
2065,
50,
34,
12838,
15,
459,
13,
12740,
9,
184,
92,
31,
233,
5057,
1004,
396,
2065,
225,
13,
12740,
60,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How to VLOOKUP across several columns?
===
I've been googling this for a while, and I've found some information on this but I can't seem to relate them back to what I'm doing here. Basically I have a large data set, in column A, there is a list of unique ID tags (a combination of letters and numbers, each referencing a gene, with each column being a strain of bacteria). The table has 24 columns for 24 different strains.
If there is a gene from a different strain (i.e. not strain A) which is sufficiently similar to one from column A in a certain strain, than the ID code for that gene is put in the same row as whichever one it is similar to from strain A in the column for whatever strain of bacteria it is from.
Now here's the tricky part, not every gene in column A has a corresponding gene in another strain. If there is not a corresponding gene the value is #N/A (This was automatically generated by excel earlier when I was using the vlookup function)
I have to find a way to just pick out the rows where there are genes from column A, which have corresponding genes in strains C,D,E and F, and only those strains, and no other
Is it possible to use VLOOKUP for this? Or possible INDEX and MATCH?? | 0 | [
2,
184,
20,
566,
5810,
576,
464,
238,
7498,
60,
800,
3726,
3726,
31,
22,
195,
74,
162,
5598,
802,
48,
26,
21,
133,
15,
17,
31,
22,
195,
216,
109,
676,
27,
48,
47,
31,
92,
22,
38,
2260,
20,
16464,
105,
97,
20,
98,
31,
22,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Why does setjmp(3) not save all registers on AMD64?
===
I was browsing through the source of various `setjmp` and `longjmp` implementations and noticed that not all of the CPU registers are saved in the `jmp_buf` structure. After reviewing the AMD64 ABI, I noticed that only the callee-saved registers are saved.
I do not understand how the function state can be fully resumed when only some of the registers have been saved. Surely the unsaved registers must have been clobbered many times over and over until I call `longjmp` later on?
Everything works perfectly however, so there's definitely something that I don't understand. I was hoping someone could shed some light on this.
Thanks! | 0 | [
2,
483,
630,
309,
728,
2554,
5,
240,
6,
52,
2079,
65,
2243,
18,
27,
589,
43,
3470,
60,
800,
3726,
3726,
31,
23,
10175,
68,
120,
14,
1267,
16,
617,
13,
1,
3554,
728,
2554,
1,
17,
13,
1,
2701,
728,
2554,
1,
6123,
18,
17,
271... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Copy Chart & Print Very Slow VBA
===
I have a performance problem and google doesn't help me.
This person has the same problem :
http://excel.bigresource.com/Copy-Chart-Print-Very-Slow-1eeSa883.html
When I copy an excel chart with VBA : This is so slooooow.
Dim myChart As ChartObject
For Each myChart In consoPDC.ChartObjects
myChart.Copy
...
Next
Any idea that makes it faster ?
For information the objective is to paste them in powerpoint.
The weird thing is that making it manually isn't slow at all
Thanks.
Nico. | 0 | [
2,
4344,
1795,
279,
4793,
253,
2276,
566,
969,
800,
3726,
3726,
31,
57,
21,
956,
1448,
17,
8144,
1437,
22,
38,
448,
55,
9,
48,
840,
63,
14,
205,
1448,
13,
45,
7775,
6903,
1706,
11040,
9,
6407,
99,
12097,
9,
960,
118,
19625,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.