unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
TextView size in dp when wrap_content
===
I'm creating a widget for which I need to calculate the `minHeight` and `minWidth`.
Now if I have a `TextView` which has a width and height of `wrap_content`, and a text size of `18sp`, how can I find out what size the `TextView` will become in `dp`? | 0 | [
2,
1854,
4725,
1072,
19,
13,
7431,
76,
8118,
1,
25424,
800,
3726,
3726,
31,
22,
79,
2936,
21,
4807,
43,
3060,
26,
56,
31,
376,
20,
18469,
14,
13,
1,
2160,
252,
7748,
1,
17,
13,
1,
2160,
3976,
43,
96,
1,
9,
130,
100,
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... |
Moving a function from code behind to Business Logic Layer Class
===
I am using `ASP.NET Web Forms/C#`.
I am having this function in my `code behind` which fills Cities `DropDownList` based on the State `DropDownList` selection.
Here is my function.
public void CityFill(int index,int id)
{
//This function calls GetCities method which will get all cities of a state.
var city = CustomerBLL.GetCities(index);
//If id=0 then clear all dropdown before filling
//or else they get appended.
if (id == 0)
{
NewCustomerddlResidentialCity.Items.Clear();
NewCustomerddlOfficeCity.Items.Clear();
NewCustomerddlNativeCity.Items.Clear();
NewCustomerddlNomineeCity.Items.Clear();
}
else
{
//If 1 then clear residential city
if(id==1)
NewCustomerddlResidentialCity.Items.Clear();
//If 2 then clear Office city.
if(id==2)
NewCustomerddlOfficeCity.Items.Clear();
//If id=3 then clear Native City.
if(id==3)
NewCustomerddlNativeCity.Items.Clear();
//If id=4 then clear Nominee City
if(id==4)
NewCustomerddlNomineeCity.Items.Clear();
}
//Loop through all the cities in st object
foreach (var c in city)
{
//If id=0 then fill all dropdowns
if (id == 0)
{
NewCustomerddlResidentialCity.Items.Add(c.city_name.Trim());
NewCustomerddlOfficeCity.Items.Add(c.city_name.Trim());
NewCustomerddlNativeCity.Items.Add(c.city_name.Trim());
NewCustomerddlNomineeCity.Items.Add(c.city_name.Trim());
}
else
{
//If 1 then fill Res City
if(id==1)
NewCustomerddlResidentialCity.Items.Add(c.city_name.Trim());
//If 2 then fill Off City
if(id==2)
NewCustomerddlOfficeCity.Items.Add(c.city_name.Trim());
//If 3 then fill nat city
if(id==3)
NewCustomerddlNativeCity.Items.Add(c.city_name.Trim());
//If 4 then fill nominee city
if(id==4)
NewCustomerddlNomineeCity.Items.Add(c.city_name.Trim());
}
}
}
The arguments passed to the function are index and id.
index is `SelectedIndex` of State `DropDownList`.
id is which City `DropDownList` needs to be filled.
Here is BLL class
namespace CwizBankApp
{
public class CustomerBLL
{
public IList<mem_city> GetCities(int index)
{
using (var db = new DataClasses1DataContext())
{
var city = db.mem_cities.Where(c => c.state_id.Equals(index)).ToList();
return city;
}
}
}
}
I need to move the function from code behind to BLL class.
How do I go about this.
Can anyone help me out with this?
Any suggestions are welcome.
| 0 | [
2,
1219,
21,
1990,
37,
1797,
439,
20,
508,
7085,
5385,
718,
800,
3726,
3726,
31,
589,
568,
13,
1,
472,
306,
9,
2328,
2741,
1997,
118,
150,
5910,
1,
9,
31,
589,
452,
48,
1990,
19,
51,
13,
1,
9375,
439,
1,
56,
3509,
18,
1920,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Python 3 null terminated string to list?
===
Python 3 really complicated the whole file reading process, when you have a binary file with some strings in it.
I can do `string.decode('ascii')` when I'm sure what I read is ascii text, but in my file I have strings with null `('\x00')` terminated strings I must read an convert to list of strings.
How would be the new way to do it, without going byte-by-byte and checking if it's a null or not?
mylist = chunkFromFile.split('\x00')
TypeError: Type str doesn't support the buffer API | 0 | [
2,
20059,
203,
16203,
13780,
3724,
20,
968,
60,
800,
3726,
3726,
20059,
203,
510,
8343,
14,
979,
3893,
1876,
953,
15,
76,
42,
57,
21,
14171,
3893,
29,
109,
7887,
19,
32,
9,
31,
92,
107,
13,
1,
11130,
9,
546,
9375,
5,
22,
472,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 add options in select in ROR.?
===
I am trying to add options in the select field. but it will not work as i m expected.
Below i post my code. Please help to solve this one.
<select id='address_select' name='address_select' style="width: 100%; border-radius: 9px 9px 0 0; padding-top: 6px;">
<% OrganizationSettings.getInstance().fetch() %>
<% @addresses = OrganizationSettings.getInstance().valueForField('addresses') %>
<option value="123" selected="selected">Facility</option>
<% for address in @addresses: %>
<% @val = address.label %>
<option value='<% address.id %>'> <% @val %> </option>
<% end %>
</select>
Here, in @addresses i m getting the value of the address class. I am getting the answer with `<% alert(address.label) %>` but when i pass the same value in the option it will not shown. It create the same number of options in the select but could not fill the value in the options.
Please help me.. Thanks in advance. | 0 | [
2,
184,
20,
3547,
6368,
19,
5407,
19,
761,
248,
9,
60,
800,
3726,
3726,
31,
589,
749,
20,
3547,
6368,
19,
14,
5407,
575,
9,
47,
32,
129,
52,
170,
28,
31,
307,
1727,
9,
1021,
31,
678,
51,
1797,
9,
2247,
448,
20,
8402,
48,
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... |
How do i checkout an android project from an SVN repository
===
I have an android project and I have added it to an SVN repository. These are the directories/files I have added
directories : res, src, lib,
files : AndroidManiFest.xml, project.properties, proguard.cfg, and 2 launch files
However, when i do the following, I'm not able to create the file as an android project
1. Import project by checking out from SVN (this is a project A)
2. Using the create new project in eclipse to create the new project - steps are : Create New Projects -> Android Project from Existing Source Code
Are thee some files that I have not committed or am I doing something wrong when I'm creating the new project?
| 0 | [
2,
184,
107,
31,
2631,
1320,
40,
13005,
669,
37,
40,
13,
18,
16578,
24869,
800,
3726,
3726,
31,
57,
40,
13005,
669,
17,
31,
57,
905,
32,
20,
40,
13,
18,
16578,
24869,
9,
158,
50,
14,
559,
1596,
118,
16877,
18,
31,
57,
905,
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... |
Using .htaccess file to hide page extension in cPanel
===
I learnt that .htaccess file can be used to hide the page url. Example : www.mydomain.com/mypage1.html can be made to appear as www.mydomain.com or www.mydomain.com/mypage1. So I have a few questions regarding this. I have three pages say mypage1.html, mypage2.html and mypage3.html; all within the same folder in cPanel. Is there a way I can hide all three urls, like it would only appear as www.mydomain.com. Or can I have all the three pages appearing under www.mydomain.com/mycustomname/. Or will the three files appear as www.mydomain.com/mypage1/, www.mydomain.com/mypage2/ and www.mydomain.com/mypage3/ respectively.
Can anyone provide the .htaccess code for this please? Also do I need to make any changes in my html file codes? Like page1.html redirects to page2.html on click of a button; or will it be okay with the existing code.
One more question is, can I upload .htaccess file inside subfolders in cPanel? Because I have a lot of addon domains added to my cPanel.
Thanks. | 0 | [
2,
568,
13,
9,
9020,
20604,
3893,
20,
3077,
2478,
3896,
19,
272,
3206,
532,
800,
3726,
3726,
31,
2484,
38,
30,
13,
9,
9020,
20604,
3893,
92,
44,
147,
20,
3077,
14,
2478,
287,
6362,
9,
823,
13,
45,
13,
6483,
9,
915,
537,
6232,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Gameloop: End Game and start Activity
===
I have a problem with my GameLoop in my Android projekt (my first Android projekt):
I have an Activity that the GameView (SurfaceView) starts.
setContentView(new GameView(this));
The GameView (SurfaceView) starts the GameThread.
public void surfaceCreated(SurfaceHolder holder) {
Log.d("GameView", "surfaceCreate");
surfaceHolder = holder;
synchronized (this) { //Must be executed exclusively
if (gameLoop == null) {
gameLoop = new GameLoop(); //Start animation here
gameLoop.start();
}
}
}
private class GameLoop extends Thread {
public boolean running = true;
public void run() {
Canvas canvas = null;
final SurfaceHolder surfaceHolder = GameView.this.surfaceHolder;
while (running) {
try {
canvas = surfaceHolder.lockCanvas();
synchronized (surfaceHolder) {
update();
checkCollision();
render(canvas);
}
} finally {
if (canvas != null)
surfaceHolder.unlockCanvasAndPost(canvas);
}
}
}
}
And now I can play. Up to this point and everything is OK.
If the player loses a new Activity (GameOver) started and the GameThread stoped.
Here he crashes!
public void endgame() {
Log.d("GameView", "ENDGAME");
this.score.setStopscoring(true);
this.box.stop();
synchronized (surfaceHolder) {
boolean retry = true;
if (gameLoop != null) {
gameLoop.running = false;
while (retry) {
try {
gameLoop.join();
retry = false;
} catch (Exception e) {
}
}
}
}
Context context = getContext();
context.startActivity(new Intent(context, _1GameOver.class));
}
Afte the `gameLoop.join();` it freezes.
I've tried a lot but nothing worked.
Thank you before for your help | 0 | [
2,
13005,
250,
18786,
45,
241,
250,
17,
799,
2358,
800,
3726,
3726,
31,
57,
21,
1448,
29,
51,
250,
18786,
19,
51,
13005,
895,
1969,
197,
38,
13,
5,
915,
64,
13005,
895,
1969,
197,
38,
6,
45,
31,
57,
40,
2358,
30,
14,
250,
47... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 compare Joda DateTime objects with acceptable offset (tolerance)?
===
I wonder is there any standard API in `JodaTime` to compare 2 `DateTime` objects with specified tolerance?
I am looking for a one-liner preferably by using `Joda` standard API. Not for time-aritmethic expressions like in [this post][1].
Ideally, it would be something like:
boolean areNearlyEqual = SomeJodaAPIClass.equal(dt1, dt2, maxTolerance);
Thanks!
[1]: http://stackoverflow.com/questions/4809939/how-can-i-test-that-two-joda-time-datetime-objects-are-nearly-equal | 0 | [
2,
184,
20,
11590,
2640,
593,
1231,
891,
3916,
29,
12513,
17493,
13,
5,
262,
1252,
2416,
6,
60,
800,
3726,
3726,
31,
2666,
25,
80,
186,
1236,
21,
2159,
19,
13,
1,
1636,
593,
891,
1,
20,
11590,
172,
13,
1,
8209,
891,
1,
3916,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Memcache PHP Extension on Windows
===
I have found plenty of tutorials covering how to install memcache in Windows and install the PHP extension. My situation though is slightly unusual:
I'm using iis, not apache.
I don't need to install memcache on the server (it has its own dedicated server already setup). I ONLY need to install the extension.
I thought I simply needed to add the PHP_memcache.dll extension to the PHP extension folder and add it to PHP.ini
This causes an error loading the PHP module (unable to load dynamic library).
Is this error likely to be caused because memcache isn't installed on the server and what can I do to solve it? | 0 | [
2,
55,
4829,
9616,
13,
26120,
3896,
27,
1936,
800,
3726,
3726,
31,
57,
216,
7062,
16,
29724,
18,
3846,
184,
20,
16146,
55,
4829,
9616,
19,
1936,
17,
16146,
14,
13,
26120,
3896,
9,
51,
1858,
362,
25,
1847,
4706,
45,
31,
22,
79,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GAE/Java: How to check whether an image of a specified URL is exits and return its height and width
===
I'm using GAE[JAVA] do some image processing. GAE will not allow write file to disk.
I want to my App allow type a URL, then I want to check whether this specified URL represents an image, if it is, I want to get the height and width of this image.
Do anyone provide some solution to show me how to implement this function?
Thanks.
| 0 | [
2,
13,
17721,
118,
1004,
1385,
45,
184,
20,
2631,
1472,
40,
1961,
16,
21,
9931,
287,
6362,
25,
4350,
18,
17,
788,
82,
2947,
17,
9456,
800,
3726,
3726,
31,
22,
79,
568,
13,
17721,
2558,
1004,
1385,
500,
107,
109,
1961,
5511,
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 bind month drop down value after form post?
===
This is how we implement cascade drop down for year and month. After selecting year/month the form is submitted. When the View back after Submit, the selected Year value is persist (as we have handling for this in Model), but the selected Month value is not persist. What need to do to persist the value?
**Model**
public class MyViewModel
{
public int? Year { get; set; }
public int? Month { get; set; }
public IEnumerable<SelectListItem> Years
{
get
{
return Enumerable.Range(2000, 12).Select(x => new SelectListItem
{
Value = x.ToString(),
Text = x.ToString()
});
}
}
}
**Controller**
The HttpGet and HttpPost action,
//
// GET: /MenuSix/
public ActionResult Index()
{
var model = new MyViewModel();
return View(model);
}
public ActionResult Months(int year)
{
if (year == 2011)
{
return Json(
Enumerable.Range(1, 3).Select(x => new { value = x, text = x }),
JsonRequestBehavior.AllowGet
);
}
return Json(
Enumerable.Range(1, 12).Select(x => new { value = x, text = x }),
JsonRequestBehavior.AllowGet
);
}
//
// POST: /MenuSix/
[HttpPost]
public ActionResult Index(MyViewModel myViewModel)
{
var month = myViewModel.Month; //11
var year = myViewModel.Year; //2011
return View(myViewModel);
}
**View**
What need to change here to persist month value "Enumerable.Empty<SelectListItem>()"?
@model DemoWeb.Models.MenuSix.MyViewModel
@using (Html.BeginForm())
{
@Html.DropDownListFor(x => x.Year, new SelectList(Model.Years, "Value", "Text"), "-- select year --")
@Html.DropDownListFor(x => x.Month, Enumerable.Empty<SelectListItem>(), "-- select month --")
<div align="center">
<input type="submit" id="valSubmit" value="Save"/>
</div>
}
@section PageScriptsAndCSS{
<script type="text/javascript">
$(document).ready(function () {
$('#Year').change(function () {
debugger;
var selectedYear = $(this).val();
if (selectedYear != null && selectedYear != '') {
$.getJSON('@Url.Action("Months")', { year: selectedYear }, function (months) {
var monthsSelect = $('#Month');
monthsSelect.empty();
$.each(months, function (index, month) {
monthsSelect.append($('<option/>', {
value: month.value,
text: month.text
}));
});
});
}
});
});
</script>
}
| 0 | [
2,
184,
20,
10193,
1617,
2804,
125,
1923,
75,
505,
678,
60,
800,
3726,
3726,
48,
25,
184,
95,
8713,
13542,
2804,
125,
26,
159,
17,
1617,
9,
75,
20764,
159,
118,
6444,
14,
505,
25,
7368,
9,
76,
14,
1418,
97,
75,
12298,
15,
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... |
If I order two products, it will ony save one product in my database
===
When I click on checkout, it will send me an email with my order and send the products I ordered to mysql database. But only one product is send and saved in the database. How can I fix this?
//connect to database
$connection = mysql_connect("localhost","root","") or die ("Can't connect");
mysql_select_db("shoppingcart", $connection) or die ("Can't connect");
//get order id
$vol = mysql_query("SELECT orderid FROM ordertracking WHERE email='$email'");
while($volume=mysql_fetch_array($vol))
{
$orderid = $volume['orderid'];
}
// add new order
$order = "INSERT INTO `order` (orderid, customerid, productid, brand, model, price, amount, totalcost, image) VALUES ('$orderid', '$customerid', '$productid', '$brand' , '$model', '$price', '$amount', '$totalcost', '$image')";
if (!mysql_query($order,$connection))
{
die('Error: ' . mysql_error());
echo "Sorry, there was an error";
}
echo "New order added" . "<br />";
mysql_close($connection); | 0 | [
2,
100,
31,
389,
81,
1985,
15,
32,
129,
27,
93,
2079,
53,
2374,
19,
51,
6018,
800,
3726,
3726,
76,
31,
10840,
27,
2631,
1320,
15,
32,
129,
2660,
55,
40,
8517,
29,
51,
389,
17,
2660,
14,
1985,
31,
1905,
20,
51,
18,
22402,
601... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
onKeyUp doesn't work in child view
===
I have this hierarchy of the views:
Activity -> ViewPager -> MyViewGroup
In MyViewGroup (and only there) I override onKeyUp event:
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Log.i(TAG, "Back");
return true;
} else {
return super.onKeyUp(keyCode, event);
}
}
But when I press "Back" key, this override is not called and the app is closed. Why? | 0 | [
2,
27,
4237,
576,
1437,
22,
38,
170,
19,
850,
1418,
800,
3726,
3726,
31,
57,
48,
14417,
16,
14,
4146,
45,
2358,
13,
8,
1,
1418,
6486,
139,
13,
8,
1,
51,
4725,
8024,
19,
51,
4725,
8024,
13,
5,
290,
104,
80,
6,
31,
84,
11891... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 mouseenter mouseleave bug when fast moving on/off item
===
I have pretty simple jquery code :
$(document).ready(function(){
$('img.marqFl').on({
mouseenter: function() {
$(this).animate({height: 300}, 600);
},
mouseleave: function() {
$(this).animate({height: 150}, 600);
}
});
});
But its not doing what I want..
I have 10 images with the same class - marqFl. They all have 150height.
When users move mouse over some image, it should start increasing height to 300.
But if they move mouse out from the image it should stop and start decreasing back to 150.
And if they move mouse back to the image it should stop decreasing and start increasing again.
For those both cases the old animation must be breaked. Users should not wait for the previous animation to end to start the new one.
If they move mouse to other image the first 1 must go directly (no animation) to 150 and the new image should start increasing. | 0 | [
2,
487,
8190,
93,
7567,
13679,
7567,
14416,
6256,
76,
1512,
1219,
27,
118,
1299,
9101,
800,
3726,
3726,
31,
57,
1772,
1935,
487,
8190,
93,
1797,
13,
45,
5579,
5,
28132,
6,
9,
15193,
5,
22359,
5,
6,
1,
5579,
5,
22,
1660,
263,
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... |
What happens in System.Data.SqlClient.SqlTransaction.Dispose?
===
I looked at the Dispose() method in System.Data.SqlClient.SqlTransaction (using a decompiler):
protected override void Dispose(bool disposing)
{
if (disposing)
{
SNIHandle target = (SNIHandle) null;
RuntimeHelpers.PrepareConstrainedRegions();
try
{
target = SqlInternalConnection.GetBestEffortCleanupTarget(this._connection);
if (!this.IsZombied)
{
if (!this.IsYukonPartialZombie)
this._internalTransaction.Dispose();
}
}
catch (OutOfMemoryException ex)
{
this._connection.Abort((Exception) ex);
throw;
}
catch (StackOverflowException ex)
{
this._connection.Abort((Exception) ex);
throw;
}
catch (ThreadAbortException ex)
{
this._connection.Abort((Exception) ex);
SqlInternalConnection.BestEffortCleanup(target);
throw;
}
}
base.Dispose(disposing);
}
Why does everyone say in forums that it is Rolling back in the dispose? Where does it rollback? | 0 | [
2,
98,
5531,
19,
329,
9,
18768,
9,
18,
22402,
150,
18513,
38,
9,
18,
22402,
7028,
8645,
9,
2906,
15690,
60,
800,
3726,
3726,
31,
292,
35,
14,
17913,
5,
6,
2109,
19,
329,
9,
18768,
9,
18,
22402,
150,
18513,
38,
9,
18,
22402,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Redesign handset application for tablet using Fragments
===
I have a well-developed application for a phone, but I would like to add support for a tablet. The main view consists of a ListView which uses a SimpleCursorAdapter to get a list from the database. When a user taps an item, an Activity (**SPECIFIC TO THAT ID!**) is started. Some Activities share the same view, but with different information. Every activity extends FragmentAcivity. In a tablet, since I have more screen real-estate, I would like to display the ListView on the left side, and when a user taps an item, the **SPECIFIC** Activity would be shown on the left. It would mimic the image found [here][1] about half-way down the page. I don't have a good knowledge of Fragments, but how could I accomplish this? Please let me know if you need any more information.
[1]: http://developer.android.com/guide/practices/tablets-and-handsets.html | 0 | [
2,
23903,
473,
1198,
3010,
26,
16394,
568,
10837,
800,
3726,
3726,
31,
57,
21,
134,
8,
20102,
3010,
26,
21,
1132,
15,
47,
31,
83,
101,
20,
3547,
555,
26,
21,
16394,
9,
14,
407,
1418,
2043,
16,
21,
968,
4725,
56,
2027,
21,
1935... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
CodeIgniter Active Record: prevent duplicate on insert
===
I'm trying out CodeIgniter with a simple users table in SQLLite, which comprises of id, name, email.
How can I prevent duplicates from being inserted when using Active Record?
I've tried the following, but it just keep creating duplicates...
$data = array(
'email' => 'd@d.com' ,
'name' => 'dave'
);
$this->db->where('users.email != ', 'd@d.com');
$this->db->insert('users', $data); | 0 | [
2,
1797,
9693,
242,
106,
1348,
571,
45,
2501,
19429,
27,
14692,
800,
3726,
3726,
31,
22,
79,
749,
70,
1797,
9693,
242,
106,
29,
21,
1935,
3878,
859,
19,
4444,
211,
2119,
15,
56,
8595,
16,
4924,
15,
204,
15,
8517,
9,
184,
92,
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... |
Difference between self.navigationController.navigationItem and self.navigationItem
===
What is the difference between self.navigationController.navigationItem and self.navigationItem? I am using a UINavigationController throughout the app and when I use self.navigationController.navigationItem.rightBarButtonItems, in one of the viewDidLoad methods of one of the viewControllers, the array is empty. However if I use self.navigationItem.rightBarButtonItems, I see my bar button items. What is the difference between the two calls? Thanks! | 0 | [
2,
2841,
128,
1119,
9,
325,
13227,
857,
12898,
1252,
9,
325,
13227,
857,
2119,
79,
17,
1119,
9,
325,
13227,
857,
2119,
79,
800,
3726,
3726,
98,
25,
14,
2841,
128,
1119,
9,
325,
13227,
857,
12898,
1252,
9,
325,
13227,
857,
2119,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 I call render after each collection change in BackboneJS
===
I'm learning BackboneJS. I have a few questions.
Is it a common thing to rerender the complete view after the contoller or model is changed? And do I need to clear to container at the start of the render function?
| 0 | [
2,
378,
31,
645,
16535,
75,
206,
1206,
753,
19,
24036,
728,
18,
800,
3726,
3726,
31,
22,
79,
2477,
24036,
728,
18,
9,
31,
57,
21,
310,
2346,
9,
25,
32,
21,
757,
584,
20,
302,
99,
16706,
14,
1279,
1418,
75,
14,
1065,
13741,
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... |
MongoDB / PHP query- if current time/date is in schedule
===
I have entries that store the start and end time of an event. I'm trying to query with MongoDate to find all events that are happening at the current time of the query.
The same question is answered here, but for MongoDB instead of MySQL:
http://stackoverflow.com/questions/9801112/php-mysql-query-if-current-time-date-is-in-schedule
So far, all I can find is the reverse kind of query for MongoDate:
$start = new MongoDate(strtotime("2010-01-15 00:00:00"));
$end = new MongoDate(strtotime("2010-01-30 00:00:00"));
// find dates between 1/15/2010 and 1/30/2010
$collection->find(array("ts" => array('$gt' => $start, '$lte' => $end)));
| 0 | [
2,
3521,
5474,
220,
13,
118,
13,
26120,
25597,
8,
100,
866,
85,
118,
8209,
25,
19,
4345,
800,
3726,
3726,
31,
57,
11399,
30,
1718,
14,
799,
17,
241,
85,
16,
40,
807,
9,
31,
22,
79,
749,
20,
25597,
29,
3521,
839,
8209,
20,
47... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 ruby forcing me to instantiate/store these (code incld) classes inside of local variables instead of instance variables?
===
Before I changed my code to make it functional, I had this:
require 'test/unit'
require 'converter'
class TestConverter < Test::Unit::TestCase
@cv = Convert.new
def test_celsius
assert_equal(100.0, @cv.celsius(212))
assert_equal(0.0, @cv.@celsius(32))
end
def test_fahrenheit
assert_equal(212.0, @cv.fahrenheit(100))
assert_equal(32.0, @cv.fahrenheit(0))
end
end
which threw this error:
% ruby -I. converter_test.rb ✭
Run options:
# Running tests:
EE
Finished tests in 0.000616s, 3246.7638 tests/s, 0.0000 assertions/s.
1) Error:
test_celsius(TestConverter):
NoMethodError: undefined method `celsius' for nil:NilClass
converter_test.rb:9:in `test_celsius'
2) Error:
test_fahrenheit(TestConverter):
NoMethodError: undefined method `fahrenheit' for nil:NilClass
converter_test.rb:14:in `test_fahrenheit'
2 tests, 0 assertions, 0 failures, 2 errors, 0 skips
I decided to try instantiating the class (Convert) inside of each method and was successful:
require 'test/unit'
require 'converter'
class TestConverter < Test::Unit::TestCase
#@cv = Convert.new
#instantiated the class in each method instead of here
def test_celsius
cv = Convert.new
assert_equal(100.0, cv.celsius(212))
assert_equal(0, cv.celsius(32))
end
def test_fahrenheit
cv = Convert.new
assert_equal(212, cv.fahrenheit(100))
assert_equal(32, cv.fahrenheit(0))
end
end
ddouglas@coders:~/Develop/davincicoders$ ruby -I. converter_test.rb
Run options:
# Running tests:
..
Finished tests in 0.001894s, 1055.9149 tests/s, 2111.8298 assertions/s.
2 tests, 4 assertions, 0 failures, 0 errors, 0 skips
Why wouldn't Ruby recognize the instance variable as an object in the first try? | 0 | [
2,
483,
25,
10811,
6135,
55,
20,
6322,
15882,
118,
16828,
158,
13,
5,
9375,
19,
5316,
43,
6,
2684,
572,
16,
375,
12157,
700,
16,
4851,
12157,
60,
800,
3726,
3726,
115,
31,
1015,
51,
1797,
20,
233,
32,
7652,
15,
31,
41,
48,
45,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Design a JSON interface
===
I need to design a JSON interface which when implemented on my end will produce a JSON packet (JSON formatted document) - which could be consumed by remote websites (they will use their webservices to consume it). Where should I start from.
Thanks | 0 | [
2,
704,
21,
487,
528,
6573,
800,
3726,
3726,
31,
376,
20,
704,
21,
487,
528,
6573,
56,
76,
6807,
27,
51,
241,
129,
2213,
21,
487,
528,
12795,
13,
5,
728,
528,
13,
29850,
4492,
6,
13,
8,
56,
110,
44,
10936,
34,
5388,
13931,
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... |
FB.login broken flow for iOS WebApp
===
I'm making an iOS Webapp (i.e. an HTML page that runs in standalone mode - none of the Safari chrome - when the bookmark of the page is added to the homescreen).
I have a button that onclick calls FB.login(). When in standalone mode, the webapp redirects to the facebook login page (as expected), however afterwards, I get stuck on a white screen (I don't get asked to authenticate since I already have, but I imagine that the authentication screen would happen before the white screen) and don't get put back into the webapp.
The same flow within the Safari app works as expected. Clicking login calls FB.login(), which opens a new page where you are asked to login to Facebook, once you login and authenticate the app, that page closes and you are put back into the original page.
It seems that in standalone mode, there's a problem with the "second page" with the FB login closing and redirecting back to the app (it doesn't). And the flow is broken.
Is there any sort of workaround for this?
Thanks,
-Esa | 0 | [
2,
13,
13478,
9,
5567,
108,
2023,
3312,
26,
13,
7760,
2741,
7753,
800,
3726,
3726,
31,
22,
79,
544,
40,
13,
7760,
2741,
7753,
13,
5,
49,
9,
62,
9,
40,
13,
15895,
2478,
30,
1461,
19,
26986,
3740,
13,
8,
2369,
16,
14,
25055,
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... |
Colorbox item-specific div below/next-to image
===
I've found this question on StackOverflow
[http://stackoverflow.com/questions/6957886/adding-div-below-images-in-colorbox][1]
[1]: http://stackoverflow.com/questions/6957886/adding-div-below-images-in-colorbox
But it explains how to put a generic (one for all images) div below image,
what if i want to display some image specific information?
Is there a way to know from a callback the item it's going to show? | 0 | [
2,
1665,
5309,
9101,
8,
9219,
13,
12916,
1021,
118,
20021,
8,
262,
1961,
800,
3726,
3726,
31,
22,
195,
216,
48,
1301,
27,
7566,
2549,
9990,
636,
21127,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
3680,
4219,
3020,
12626,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 a correct approach to using strong/em tags when localising strings?
===
I know some languages emphasise words differently to English, e.g. via changing word endings rather than stressing words with inflection of the voice.
If you are localising a site, would you trust that <strong> and <em> tags (and their placement) will have the same meaning in other languages — would you maintain this emphasis, check with your translator or leave them out?
What I'm wondering is how this translates (excuse the pun) into the semantics of the web? — Strong and em tags carry semantic meaning that is used within SEO, screen-readers etc. So should they be left in place so this isn't lost, or dropped to better conform with the target language? | 0 | [
2,
98,
25,
21,
4456,
2141,
20,
568,
966,
118,
1503,
3383,
18,
76,
375,
7552,
7887,
60,
800,
3726,
3726,
31,
143,
109,
2556,
6238,
62,
715,
12670,
20,
486,
15,
13,
62,
9,
263,
9,
1197,
4226,
833,
3119,
18,
864,
119,
5384,
68,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Program to an interface not an implementation confusion
===
I'm trying to get into the habit of coding to an interface rather than an implementation and whilst in most cases I can see the reasoning there are a few where I struggle.
Take this really simple example:
public interface IAuditLog
{
void AddLog(string log);
}
public class AuditLog : IAuditLog
{
public void AddLog(string log)
{
//implementation
}
}
To call the audit log class:
public partial class AuditLogPage : System.Web.UI.Page
{
protected void btnAddLog_Click(object sender, EventArgs e)
{
IAuditLog objAuditLog = new AuditLog();
objAuditLog.AddLog("test log");
}
}
I still have to use AuditLog when instantiating, so what's the point? If the AddLog method signature changes i'm still going to have to go through all my pages that use it and amend the code. Am I missing the point?
Thanks for any help in advance,
Wilky.
| 0 | [
2,
625,
20,
40,
6573,
52,
40,
6123,
5677,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
77,
14,
9474,
16,
13,
15458,
20,
40,
6573,
864,
119,
40,
6123,
17,
4575,
19,
127,
1871,
31,
92,
196,
14,
15543,
80,
50,
21,
310,
113,
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... |
Change space between div tags in CSS
===
I have a website in which I want to change the space between some elements.I dont know much about CSS.I am a newbie to it. You can see the website here.This is now on a temporary domain name : timepasssite.hostoi.com.
1.I want to reduce the space between logo and main menu1...Home..Add a Listing..I have to move it up by a small distance. 2.I also want to move the search box up in the line of the Main Menu1.. 3.I want to move up the Featured Listing up near the earth's photo 4 px distance should be enough.. Listing Categories move Up close to Featured Listings 2 px distance..
Can anybody guide me how to do this ?
Here are the Common.css and Style.css files..
Download [Common.css][1] [Style.css][2]
Image : i.stack.imgur.com/R91fy.jpg
I cant paste the files here...I dont know how to...Please download the files for me and provide me the solution!!!!
Thanks...!!!
[1]: http://timepasssite.hostoi.com/download/common.css
[2]: http://timepasssite.hostoi.com/download/style.css | 0 | [
2,
753,
726,
128,
13,
12916,
3383,
18,
19,
272,
18,
18,
800,
3726,
3726,
31,
57,
21,
2271,
19,
56,
31,
259,
20,
753,
14,
726,
128,
109,
2065,
9,
49,
1049,
143,
212,
88,
272,
18,
18,
9,
49,
589,
21,
78,
5893,
20,
32,
9,
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... |
SELECT @billingMeterID = TOP 1 bmt.BillingMeterTypeID ......... does not work in MsSQL any idea?
===
I want to allocate result of SELECT TOP 1...... to a local variable in my MsSQL Stored Procedure. Please find the section of the stored procedure below:
SELECT
(
SELECT @billingMeterID = TOP 1 bmt.BillingMeterTypeID
FROM SDP_BillingMeterType bmt
JOIN SDP_Series s ON s.SeriesID = bmt.SeriesID
WHERE s.EngineID = SDP_PricePointBase.EngineID
) AS BillingMeterTypeID,
dbo.fn_GetTotalStreetCost(EngineID, ProgramID, ConsumableTypeID, @billingMeterID) AS StreetCost,
[PricePointBaseID] AS PricePointBaseID,
(SELECT TOP 1 CountryID FROM SDP_Country) AS CountryID,-- Only US is considered for now
dbo.fn_GetTotalStreetCost(EngineID, ProgramID, ConsumableTypeID, @billingMeterID) * 0.5 AS StatedCost
@dummyCost AS StreetCostUSD,
@dummyCost AS StreetCostEURO,
@dummyCost AS StatedCostUSD,
@dummyCost AS StatedCostEURO,
@exchangeRateSourceID AS ExchangeRateSourceID -- populating dummy value as the source is unknown at present
FROM SDP_PricePointBase
Any clue will be greatly appriciated. | 0 | [
2,
5407,
13,
1,
9580,
68,
7307,
1340,
800,
371,
137,
13,
13178,
38,
9,
9580,
68,
7307,
4474,
1340,
13,
9,
9,
9,
9,
9,
9,
9,
9,
9,
630,
52,
170,
19,
4235,
18,
22402,
186,
882,
60,
800,
3726,
3726,
31,
259,
20,
65,
111,
95... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Eclipse 7.1 won't create Android Activity
===
I downloaded Eclipse 7.1 Java EE edition and installed ADT plugin. I created a new Android Application Project from Eclipse and in the wizard I created an activity called TaskariActivity. After I pressed finish, it created the project but not the activity and the wizard didn't close. I pressed cancel. No activity or anything in the src folder. I created a new activity by right clicking on src, selecting new -> other -> Android -> activity. I selected BlankActivity (as earlier when I was creating the project), selected the earlier created project in the Project combo box. I set the Activity name as TaskariActivity, layout name as activity_main and title as TaskariActivity. Next I selected navigation type and I set it to Tabs + Swipe (I thought this would make me tabs and everything I had to do would be just inserting the elements and the actions for them). I pressed next, nothing happened. Finish didn't also do anything. I pressed cancel and an activity wasn't created.
So, how can I create an Android application like in the earlier version of Eclipse? It automatically created the activity and it was ready be run out of the box. Now it won't generate any files and the new activity wizard doesn't work. Help? | 0 | [
2,
11652,
453,
9,
165,
230,
22,
38,
1600,
13005,
2358,
800,
3726,
3726,
31,
23887,
11652,
453,
9,
165,
8247,
13,
2851,
1322,
17,
4066,
21,
43,
38,
10922,
108,
9,
31,
679,
21,
78,
13005,
3010,
669,
37,
11652,
17,
19,
14,
10276,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 App Engine with spring & JPA
===
i am getting the below error, when trying to run my application on Google app engine. This application was running fine on my local environment.
> javax.servlet.ServletContext log: Initializing Spring root
> WebApplicationContext W 2012-06-29 14:39:09.923
> [s~classifi/1.359961436918803566].<stderr>: log4j:WARN No appenders
> could be found for logger
> (org.springframework.web.context.ContextLoader). W 2012-06-29
> 14:39:09.924 [s~classifie/1.359961436918803566].<stderr>: log4j:WARN
> Please initialize the log4j system properly.
>
> W 2012-06-29 14:39:09.924
>
> [s~classifie/1.359961436918803566].<stderr>: log4j:WARN See
> http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
>
> W 2012-06-29 14:39:18.117 Failed startup of context
> com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@1b29f80{/,/base/data/home/apps/s~classified-rba/1.359961436918803566}
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'homeController' defined in ServletContext
> resource [/WEB-INF/mvc-dispatcher-servlet.xml]: Initialization of bean
> failed; nested exception is java.lang.StackOverflowError at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
> at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
> at
> org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)
> at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
> at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
> at
> org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
> at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
> at
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
> at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
> at
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
> at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:202)
> at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:171)
> at
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
> at
> com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:477)
> at
> com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
> at
> com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
> at
> com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
> at
> com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
> at
> com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
> at
> com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
> at
> com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
> at java.lang.Thread.run(Thread.java:679) Caused by:
> java.lang.StackOverflowError at
> java.lang.String.endsWith(String.java:1477) at
> sun.security.provider.PolicyFile.canonPath(PolicyFile.java:1846) at
> java.io.FilePermission$1.run(FilePermission.java:203) at
> java.io.FilePermission$1.run(FilePermission.java:200) at
> java.security.AccessController.doPrivileged(Native Method) at
> java.io.FilePermission.init(FilePermission.java:200) at
> java.io.FilePermission.<init>(FilePermission.java:266) at
> sun.net.www.protocol.file.FileURLConnection.getPermission(FileURLConnection.java:215)
> at sun.misc.URLClassPath.check(URLClassPath.java:487) at
> sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1257)
> at
> sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1238)
> at sun.misc.URLClassPath.findResource(URLClassPath.java:202) at
> java.net.URLClassLoader$2.run(URLClassLoader.java:379)
My spring configuration file is given below:
<beans>
<context:component-scan base-package="com.rbasystems.dealbyoffer" />
<mvc:annotation-driven />
<mvc:interceptors>
<bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor" >
<property name="paramName" value="theme" />
</bean>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" >
<property name="paramName" value="preferedLanguage" />
</bean>
</mvc:interceptors>
<tx:annotation-driven/>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean" lazy-init="true">
<property name="persistenceUnitName" value="transactions-optional"/>
</bean>
<bean id="entityManager" factory-bean="entityManagerFactory" factory-method="createEntityManager">
</bean>
<bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<mvc:resources location="WEB-INF/assets/" mapping="/assets/**" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource" >
<property name="basename" value="classpath:messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver" >
<property name="defaultLocale" value="en_US" />
</bean>
<bean id="themeSource" class="org.springframework.ui.context.support.ResourceBundleThemeSource">
<property name="basenamePrefix" value="theme-" />
</bean>
<bean id="themeResolver" class="org.springframework.web.servlet.theme.CookieThemeResolver" >
<property name="defaultThemeName" value="default" />
</bean>
<bean id="navigationMenuDao" class="com.rbasystems.dealbyoffer.classified.dao.impl.NavigationMenuDaoImpl">
<constructor-arg ref="entityManager"></constructor-arg>
</bean>
<bean id="applicationInstallationDao" class="com.rbasystems.dealbyoffer.classified.dao.impl.ApplicationInstallDaoImpl">
<property name="navigationService" ref="navigationMenuDao"/>
</bean>
<bean id="homeController" class="com.rbasystems.dealbyoffer.classified.web.HomeController"><property name="master" ref="applicationInstallationDao"></property>
<property name="navigationDao" ref="navigationMenuDao"></property>
</bean>
</beans>
Below is the code for my Controller
@Controller
public class HomeController {
//@Autowired //since autowiring was throwing error so i have removed it
private ApplicationInstallationDao master;
//@Autowired
public NavigationMenuDao navigationDao;
@RequestMapping("/")
public String loadInitialPage(Model model){
// some business logic
return "index";
}
| 0 | [
2,
8144,
4865,
1406,
29,
1573,
279,
487,
1060,
800,
3726,
3726,
31,
589,
1017,
14,
1021,
7019,
15,
76,
749,
20,
485,
51,
3010,
27,
8144,
4865,
1406,
9,
48,
3010,
23,
946,
1123,
27,
51,
375,
2307,
9,
13,
1,
8247,
396,
9,
10321,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to pass a django model object to modal window
===
I m looping over model object. and for every record i have a button to show respective modal window with specific record. but i dont know how to pass the object to that window.
{% for q in options %}
<tr id="{{q.name}}" class="trow">
<td>
<button id="btn_{{q.name}}" alt="{{q}}" class="btn modaleditbutton">Edit</button>
</td>
</tr>
{% endfor %}
in following code i m trying to capture object but it is appearing as string.
('.modaleditbutton').click(function(){
var a = $(this).attr("alt");
$('#editmodal').modal('toggle');
return false;
}); | 0 | [
2,
184,
20,
1477,
21,
3857,
14541,
1061,
3095,
20,
13,
20756,
1463,
800,
3726,
3726,
31,
307,
5293,
68,
84,
1061,
3095,
9,
17,
26,
352,
571,
31,
57,
21,
5167,
20,
298,
7390,
13,
20756,
1463,
29,
1903,
571,
9,
47,
31,
1049,
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... |
Filter Jquery Checkbox
===
I trying do a checkbox filter like this >> http://www.dfs.co.uk/sofas/leather-sofas/
Anyone have idea how i do this ?
Thanks :) | 1 | [
2,
11945,
487,
8190,
93,
2631,
5309,
800,
3726,
3726,
31,
749,
107,
21,
2631,
5309,
11945,
101,
48,
13,
1,
7775,
6903,
6483,
9,
8736,
18,
9,
716,
9,
2185,
118,
18,
1041,
472,
118,
7199,
7171,
8,
18,
1041,
472,
118,
1276,
57,
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,
0,
0,
0,
0,
0,
0,
0... |
Starting a new Activity OnClick (Android)
===
I'm trying to start an activity on the onclick of a button but can't seem te get it to work.
The app freezes when the button is pressed.
This is the code I use:
From the button:
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="ExecJson"
android:text="Button" />
In the current Activity:
public void ExecJson (View view) {
Intent intent = new Intent(this, Listviewer.class);
startActivity(intent);
}
And the Activity I want to start:
package com.pxr.tutorial.json;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import com.pxr.tutorial.xmltest.R;
@SuppressWarnings("unused")
public class Listviewer extends ListActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listplaceholder);
ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();
JSONObject json = JSONfunctions.getJSONfromURL("http://oranjelan.nl/deelnemers.txt");
try{
JSONArray deelnemers = json.getJSONArray("deelnemers");
for(int i=0;i<deelnemers.length();i++){
HashMap<String, String> map = new HashMap<String, String>();
JSONObject e = deelnemers.getJSONObject(i);
map.put("id", String.valueOf(i));
map.put("name", "Alias: " + e.getString("alias"));
map.put("city", "Woonplaats: " + e.getString("woonplaats"));
map.put("sex", "Geslacht: " + e.getString("geslacht"));
mylist.add(map);
}
}catch(JSONException e) {
Log.e("log_tag", "Error parsing data "+e.toString());
}
ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.main,
new String[] { "name", "city", "sex" },
new int[] { R.id.item_title, R.id.item_subtitle2, R.id.item_subtitle });
setListAdapter(adapter);
final ListView lv = getListView();
lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
@SuppressWarnings("unchecked")
HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position);
Toast.makeText(Listviewer.this, "ID '" + o.get("id") + "' was clicked.", Toast.LENGTH_SHORT).show();
}
});
}
}
Can anyone tell me what I'm doing wrong?
| 0 | [
2,
1422,
21,
78,
2358,
27,
150,
10129,
13,
5,
290,
18524,
6,
800,
3726,
3726,
31,
22,
79,
749,
20,
799,
40,
2358,
27,
14,
27,
150,
10129,
16,
21,
5167,
47,
92,
22,
38,
2260,
2392,
164,
32,
20,
170,
9,
14,
4865,
11551,
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... |
Set the value of an object in a complex plist file
===
I want to change the value of an object in a Dictionary, however, the Dictionary structure is complex. That is;
<dict>
<key>Content</key>
<array>
<dict>
<key>Description</key>
<string></string>
<key>Duration</key>
<string></string>
<key>Image</key>
<string></string>
</dict>
<dict>
<key>Description</key>
<string></string>
<key>Duration</key>
<string></string>
<key>Image</key>
<string></string>
</dict>
</array>
</dict>
I can access an element with (Where the plist file is called Data)
[Data objectForKey:[[[Data objectForKey:@"Content"]objectAtIndex:selectedIndex]objectForKey:@"Description"]]
How do I set the value at for this object?
| 0 | [
2,
309,
14,
1923,
16,
40,
3095,
19,
21,
1502,
351,
5739,
3893,
800,
3726,
3726,
31,
259,
20,
753,
14,
1923,
16,
40,
3095,
19,
21,
9186,
15,
207,
15,
14,
9186,
1411,
25,
1502,
9,
30,
25,
73,
13,
1,
16315,
1,
13,
1,
4237,
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... |
Reference cursor and Stored procedures in Oracle
===
I have written a simple stored procedure in PL/SQL to perform the equivalent of
SELECT * FROM tablename
Here is the procedure that returns a reference cursor
create or replace
procedure proc_name (outVal OUT sys_refcursor) as
myCursor sys_refcursor;
myRecords records%ROWTYPE;
l_sql VARCHAR(2000);
begin
l_sql := 'SELECT * FROM RECORDS';
open myCursor for l_sql;
loop
FETCH myCursor INTO myRecords;
EXIT WHEN myCursor%NOTFOUND;
"DBMS_OUTPUT.put_line('myRecords.name =' || myRecords.name);"
end loop;
close myCursor;
end;
Now when i want to execute my procedure in the SQL Command Prompt without including the **line in quotes** in my code , I go about doing it this way
VARIABLE cr REFCURSOR
EXEC proc_name(:cr)
Now i get a prompt saying
PL/SQL procedure successfully completed
Now when i try executing the command
print cr;
I get an error
ORA-24338: Statement handle not executed
Please help me with this . I need to know how to print the table using just this reference cursor returned by my stored procedure . I do not want to print anything within the procedure itself and hence want to remove the **line in quotes** from the procedure all together . | 0 | [
2,
2801,
29588,
17,
8214,
8876,
19,
15759,
800,
3726,
3726,
31,
57,
642,
21,
1935,
8214,
7004,
19,
12443,
118,
18,
22402,
20,
2985,
14,
4602,
16,
5407,
1637,
37,
859,
7259,
235,
25,
14,
7004,
30,
4815,
21,
2801,
29588,
1600,
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... |
Ant build successfull, cant display servlet
===
I'm trying to work through:
http://developer.android.com/guide/google/gcm/demo.html#server-setup
installed ant, downloaded appengine sdk, ran cmd as administrator and put in:
ant -Dsdk.dir=C:\appengine-java-sdk-1.7.0 -Dserver.host=10.0.19.185
at example dir.
I got build success and still cant connect to the site:
http://10.19.185:8080/home
as stated in tutorial.
Where have I failed? | 0 | [
2,
40,
38,
1895,
1300,
255,
15,
2973,
3042,
13,
10321,
1336,
800,
3726,
3726,
31,
22,
79,
749,
20,
170,
120,
45,
7775,
6903,
26051,
106,
9,
290,
18524,
9,
960,
118,
17599,
118,
16111,
4875,
118,
10362,
79,
118,
19274,
9,
15895,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 HTTP 302 Moved Temporarily requests in netty
===
I am using netty http client to fetch urls using netty. However, for some urls which are redirecting to some other page, I am unable to fetch the content of the final page using my client. Please help. | 0 | [
2,
7988,
7775,
13,
22863,
385,
7866,
12279,
19,
4275,
1084,
800,
3726,
3726,
31,
589,
568,
4275,
1084,
7775,
6819,
20,
18312,
13,
911,
7532,
568,
4275,
1084,
9,
207,
15,
26,
109,
13,
911,
7532,
56,
50,
302,
14706,
68,
20,
109,
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... |
Django changing app name of Photologue
===
i have installed photologue - A customizable plug-in photo management application for the Django web framework [here][1] into my project without problem...
now i want to change app name in admin page which is **photologue**. for this i have used ugettext_lazy but i got an error when i define this to all Meta:
from django.utils.translation import ugettext_lazy as _
class Meta:
app_label = _('newappname')
Error:
ValueError at /admin/
Cannot create form field for 'effect' yet, because its related model
'PhotoEffect' has not been loaded yet
Is there any easy way for changing app name, i have looked a lot but didnt find...
[1]: http://code.google.com/p/django-photologue/ | 0 | [
2,
3857,
14541,
4226,
4865,
204,
16,
3056,
21392,
800,
3726,
3726,
31,
57,
4066,
3056,
21392,
13,
8,
21,
5816,
3186,
579,
10922,
8,
108,
3056,
1097,
3010,
26,
14,
3857,
14541,
2741,
6596,
636,
6836,
500,
2558,
165,
500,
77,
51,
66... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Delphi with NetBeans 7.1.2
===
I have already installed NetBeans 7.1.2 and i am looking for Delphi plugin. Is it available at this version or in earlier ones (and which one)? Can I import delphi projects in netbeans?
| 0 | [
2,
23030,
29,
4275,
863,
5950,
453,
9,
165,
9,
135,
800,
3726,
3726,
31,
57,
614,
4066,
4275,
863,
5950,
453,
9,
165,
9,
135,
17,
31,
589,
699,
26,
23030,
10922,
108,
9,
25,
32,
904,
35,
48,
615,
54,
19,
1201,
53,
18,
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... |
jQuery draggable and Firefox Issue
===
Kindly note that when using jquery UI draggable with Firefox v13.0.1, i am not able to edit the textboxes.
Sample code : [jsfiddle sample][1]
[1]: http://jsfiddle.net/saravanan/gsebN/8/
Is there a workaround for this issue.
jQuery: 1.7.1, jQuery UI: 1.8.16 | 0 | [
2,
487,
8190,
93,
5501,
263,
579,
17,
535,
18219,
1513,
800,
3726,
3726,
22215,
1945,
30,
76,
568,
487,
8190,
93,
13,
5661,
5501,
263,
579,
29,
535,
18219,
566,
1543,
9,
387,
9,
165,
15,
31,
589,
52,
777,
20,
9392,
14,
1854,
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... |
Paging in Listview with enitity framework
===
I am doing paging in Listview with Entity framework and struck in passing startindex and maxrows after clicking the next/prev button
below is my code
private List<WorkItem> Data(int startindex, int maxrows)
{
return (from x in ss.WorkItem
select x).OrderBy(p => p.WorkItemID).Skip(startindex).Take(maxrows).ToList();
}
protected void lvWorkItems_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
{
this.DataPager1.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
lvWorkItems.DataSource = Data(e.StartRowIndex,e.MaximumRows);
lvWorkItems.DataBind();
}
my problem is how to pass startindex and maxrows when I click on next/Previous button. Please help
| 0 | [
2,
19006,
68,
19,
968,
4725,
29,
1957,
242,
856,
6596,
800,
3726,
3726,
31,
589,
845,
19006,
68,
19,
968,
4725,
29,
9252,
6596,
17,
3395,
19,
2848,
799,
25671,
17,
2049,
5417,
18,
75,
25590,
14,
328,
118,
3515,
710,
5167,
1021,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Check box android
===
I added two check box in the on create method
checkBox1 = (CheckBox) findViewById(R.id.checkBox1);
checkBox2 = (CheckBox) findViewById(R.id.checkBox2);
checkBox1.setOnCheckedChangeListener(this) ;
the main function of the check boxes that when ischeck() a picture will be added to the mainlayout and when uncheck the picture will be removed >> I used the code bellow, the first check box is working fine the second check box when I do check it shows the pics and then they I can remove them even with uncheck ... where is the wrong in my code ??
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
if(checkBox1.isChecked())
{
custom = new MapItemizedOverlay ( drawable , MapA.this) ;
OverlayItem overlayItem ;
for ( int i=0 ; i<3 ; i++) {
overlayItem = new OverlayItem (LGP[i] , "STR1 " , "STR2") ;
custom.insertPinpoint(overlayItem) ;
}
mapOverlays.add(custom);
}
else {
mapOverlays.remove(custom) ;
}
if (checkBox2.isChecked())
{
MapItemizedOverlay custom2 = new MapItemizedOverlay ( drawable2 , MapA.this) ;
OverlayItem overlayItem ;
for ( int i=3 ; i<6 ; i++) {
overlayItem = new OverlayItem (LGP[i] , "STR1 " , "STR2") ;
custom2.insertPinpoint(overlayItem) ;
}
mapOverlays.add(custom2);
}
if (checkBox2.isChecked())
{
mapOverlays.remove(custom2) ;
}
}
} | 0 | [
2,
2631,
1649,
13005,
800,
3726,
3726,
31,
905,
81,
2631,
1649,
19,
14,
27,
1600,
2109,
2631,
5309,
165,
800,
13,
5,
12542,
5309,
6,
477,
4725,
779,
1340,
5,
139,
9,
1340,
9,
12542,
5309,
165,
6,
73,
2631,
5309,
135,
800,
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... |
Weird behaviour of RedirectToAction
===
I'm developing portal in MVC 3. Have controller (`MyController`) with three methods `Add` (get and post verssion) and `Index` and part of add method looks like:
[HttpPost]
public virtual RedirectToRouteResult AddItem(Item item)
{
(...)
return RedirectToAction("Index");
}
Simple? Not fot me:)
Item is added properly and when redirecting comes url looks like:
MyController/Index not:
mySite/MyController/Index
and of course that is bad news. This situation happens only in one case in one place in the whole portal. What's wrong?
| 0 | [
2,
5455,
7727,
16,
302,
14706,
262,
8645,
800,
3726,
3726,
31,
22,
79,
3561,
8281,
19,
307,
8990,
203,
9,
57,
9919,
13,
5,
1,
915,
12898,
1252,
1,
6,
29,
132,
3195,
13,
1,
14854,
1,
13,
5,
3060,
17,
678,
13,
5498,
5991,
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... |
Is this Java in "The Art of Multiprocessor Programming" or fancy pseudocode?
===
I've started reading "The Art of Multiprocessor Programming". Seems like a great book. It claims to have examples written in Java, and it really seems this way in the beginning, to the level that they can be copied and run as-is. However, quite quickly I start to see features which I had no idea were in Java. I guess they're not and the book simply uses fancy Java-like pseudocode, but it still doesn't hurt to verify.
I'm talking about things like:
1. Using the existential quantifier in a while condition, e.g.
> while(\exists k != me) (level[k] >= i && victim[i] == me)
(replace \exists with the actual mathematical sign; recall that Haskell has similar things).
2. Using tuples and lexicographical ordering built-in to the syntax, e.g.
> (label[k], k) << (label[i], i)
Which compares the left component and if needed, the right component.
As far as I know this is pseudocode and not Java, but I'm hardly familiar with this language. | 0 | [
2,
25,
48,
8247,
19,
13,
7,
124,
415,
16,
1889,
16835,
248,
3143,
7,
54,
12251,
8452,
9375,
60,
800,
3726,
3726,
31,
22,
195,
373,
1876,
13,
7,
124,
415,
16,
1889,
16835,
248,
3143,
7,
9,
2206,
101,
21,
374,
360,
9,
32,
2810... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
openGL - creating a bending surface
===
I've been studying openGL for a while, I'd like to create a book with the page turning effect, but the pages should "bend" themselves. So now I'm wondering how one could bend a surface and animate it in openGL. Sounds like a multiple-per-vertex-shaders depending on the position of the vertex, isn't it?
Or perhaps a single shader with multiple branches | 0 | [
2,
368,
8430,
13,
8,
2936,
21,
16879,
1490,
800,
3726,
3726,
31,
22,
195,
74,
4493,
368,
8430,
26,
21,
133,
15,
31,
22,
43,
101,
20,
1600,
21,
360,
29,
14,
2478,
2101,
1590,
15,
47,
14,
4434,
378,
13,
7,
21091,
7,
1366,
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... |
WS02 GREG ERROR when deploying carbon archive
===
I am trying to upload a carbon archive in the registry. Everything seems to be OK when I add a new application, but the log show the following error:
An error occurred while determining the latest version of the resource at the given path: /_system/governance/trunk/wsdls/.... (path to the wsld deployed)
org.wso2.carbon.registry.core.exceptions.RegistryException: Failed to obtain the user realm for tenant: -1
I log with the admin user and everything that should be upload is in the registry.
Any help?
| 0 | [
2,
619,
18,
3564,
5488,
7019,
76,
17617,
68,
4778,
9250,
800,
3726,
3726,
31,
589,
749,
20,
71,
8294,
21,
4778,
9250,
19,
14,
18269,
9,
796,
2206,
20,
44,
5854,
76,
31,
3547,
21,
78,
3010,
15,
47,
14,
6738,
298,
14,
249,
7019,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Python3 pdf parsing
===
I have python3.2 installed (I'm not sure if it matters, but it's a 64-bit version) on a Windows machine. I need to open a bunch of pdf files, find certain numbers from the text and store them. Work I should have to ( and the maximum I'd like to) put in is one day.
- Can I parse the pdf with plain python without too much of a hassle?
- Is there a library that would achieve this easily?
If it's too complicated to do it with this python installation I can install a different set, but that requires alot of extra work, so other solutions appreciated. | 0 | [
2,
20059,
240,
13,
11124,
2017,
18,
68,
800,
3726,
3726,
31,
57,
20059,
240,
9,
135,
4066,
13,
5,
49,
22,
79,
52,
562,
100,
32,
4556,
15,
47,
32,
22,
18,
21,
4384,
8,
3326,
615,
6,
27,
21,
1936,
1940,
9,
31,
376,
20,
368,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 slide toggle api issues
===
I have an application in which i want to toggle the **div** on click of **button**.But when i click on button for first time the div display for some seconds and disappears immediately but after on each click it works perfectly ,please help me to resolve this problem . | 0 | [
2,
487,
8190,
93,
6464,
20,
263,
4875,
21,
2159,
1549,
800,
3726,
3726,
31,
57,
40,
3010,
19,
56,
31,
259,
20,
20,
263,
4875,
14,
13,
1409,
12916,
1409,
27,
10840,
16,
13,
1409,
811,
444,
1409,
9,
811,
76,
31,
10840,
27,
5167,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Moodle 2.x task automation for create / copy course
===
is there a good clean way in moodle to programmatically create new courses and copy old courses? At the moment I try to figure out whats possible with moodles webservices, since the cli scripts are lousy. But it seems that with webservices only the creation of courses is possible. Copying one is not a possible task.
Thanks | 0 | [
2,
5190,
413,
172,
9,
396,
3005,
23217,
26,
1600,
13,
118,
4344,
674,
800,
3726,
3726,
25,
80,
21,
254,
2745,
161,
19,
5190,
413,
20,
625,
6732,
1326,
1600,
78,
4392,
17,
4344,
315,
4392,
60,
35,
14,
688,
31,
1131,
20,
1465,
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... |
How to i configure MultipartResolver
===
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<!-- Enables the Spring MVC @Controller programming model -->
<annotation-driven />
<!-- Handles HTTP GET requests for /resources/** by efficiently serving
up static resources in the ${webappRoot}/resources/ directory -->
<resources mapping="/resources/**" location="/resources/" />
<bean class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
id="multipartResolver"> <property name="maxUploadSize" value="500000" />
</bean>
the is my context.xml file but when i include the multipartResolver configruation i get the following error :-
"cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'bean'.".
please help me i am new to spring.. | 0 | [
2,
184,
20,
31,
1065,
15951,
1889,
3091,
99,
5594,
2304,
800,
3726,
3726,
13,
1,
60,
396,
8184,
615,
3726,
7,
165,
9,
387,
7,
19608,
3726,
7,
1982,
410,
8,
457,
7,
60,
1,
13,
1,
863,
5950,
45,
863,
5950,
23504,
2172,
3726,
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... |
MS SQL Trigger conflict with reference table after delete
===
hello i created a trigger which creates a new row with a new ID after a change. when i use the trigger with 1 table it works but when i use it on a table which has reference to another table. i get an error: DELETE statement conflicted with the REFERENCE constraint.
the tables look like this:
Table1:
ID BEZEICHNUNG MENGENEINHEIT PREIS .....
1 Harry Potter Book 20
2 iPod Music 150
Table2:
DIENSTLEISTUNG_ID RAUM_ID
1 2
2 1
Table 3:
ID Raumname ....
1 Elbe
2 Main
my trigger looks like this:
USE [Book-IT-LH]
GO
/****** Object: Trigger [dbo].[DIENSTLEISTUNG_Update] Script Date: 07/16/2012 08:39:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[DIENSTLEISTUNG_Update]
ON [dbo].[DIENSTLEISTUNG]
AFTER UPDATE
AS
BEGIN
SET NOCOUNT ON;
DECLARE @MAX_ID INT;
SELECT @MAX_ID=MAX(ID) FROM [DIENSTLEISTUNG];
declare @tmp Table(ID numeric, BEZEICHNUNG nvarchar(64), MENGENEINHEIT nvarchar(64),
PREIS numeric(19,5), BESCHREIBUNG nvarchar(64), VORLAUFZEIT numeric(10),
AZ_MO nvarchar(22), AZ_DI nvarchar(22),AZ_MI nvarchar(22),AZ_DO nvarchar(22),AZ_FR nvarchar(22),
AZ_SA nvarchar(22),AZ_SO nvarchar(22),DIENSTLEISTUNGSART_ID numeric(38),
UPDATE_USER numeric(38), UPDATE_DATE datetime, RUESTZEIT numeric(38),
PERMISSIONS numeric (38), KONTRAKTPOSITION numeric(38),ARTIKELNUMMER nvarchar(64),
ANZAHL numeric(10), BUCHUNGSHINWEIS nvarchar(255), SONDERWUNSCH char(1),
FLAG bit)
insert into @tmp
select
ID, BEZEICHNUNG, MENGENEINHEIT,
PREIS, BESCHREIBUNG, VORLAUFZEIT,
AZ_MO, AZ_DI,AZ_MI,AZ_DO,AZ_FR,
AZ_SA,AZ_SO,DIENSTLEISTUNGSART_ID,
UPDATE_USER, UPDATE_DATE, RUESTZEIT,
PERMISSIONS, KONTRAKTPOSITION,ARTIKELNUMMER,
ANZAHL, BUCHUNGSHINWEIS, SONDERWUNSCH,
1 [flag] from deleted;
delete T from DIENSTLEISTUNG T JOIN @tmp I
ON T.ID=I.ID
SET IDENTITY_INSERT [DIENSTLEISTUNG] ON
INSERT INTO [DIENSTLEISTUNG] (ID, BEZEICHNUNG, MENGENEINHEIT,
PREIS, BESCHREIBUNG, VORLAUFZEIT,
AZ_MO, AZ_DI,AZ_MI,AZ_DO,AZ_FR,
AZ_SA,AZ_SO,DIENSTLEISTUNGSART_ID,
UPDATE_USER, UPDATE_DATE, RUESTZEIT,
PERMISSIONS, KONTRAKTPOSITION,ARTIKELNUMMER,
ANZAHL, BUCHUNGSHINWEIS, SONDERWUNSCH,
FLAG)
SELECT @MAX_ID+ROW_NUMBER() OVER(ORDER BY ID) [ID],BEZEICHNUNG, MENGENEINHEIT,
PREIS, BESCHREIBUNG, VORLAUFZEIT,
AZ_MO, AZ_DI,AZ_MI,AZ_DO,AZ_FR,
AZ_SA,AZ_SO,DIENSTLEISTUNGSART_ID,
UPDATE_USER,GETDATE(),RUESTZEIT,
PERMISSIONS, KONTRAKTPOSITION,ARTIKELNUMMER,
ANZAHL, BUCHUNGSHINWEIS, SONDERWUNSCH,
0
FROM INSERTED
union all
select * from @tmp
SET IDENTITY_INSERT dbo.DIENSTLEISTUNG OFF
SET NOCOUNT OFF;
END; | 0 | [
2,
4235,
4444,
255,
7286,
2930,
29,
2801,
859,
75,
27448,
800,
3726,
3726,
10975,
31,
679,
21,
7286,
56,
9695,
21,
78,
3131,
29,
21,
78,
4924,
75,
21,
753,
9,
76,
31,
275,
14,
7286,
29,
137,
859,
32,
693,
47,
76,
31,
275,
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... |
Grails resource warning log entry when using images with absolute:true
===
Using Grails 2.0.4. In building emails, I use a lot of images with absolute paths. Each one results in an annoying log entry. Is there an easy fix? They DO exist, it just seems the resource plugin doesn't like absolute paths. This happens outside of localhost / dev environment too.
<img src="${resource(dir: 'images/brochure', file: 'arrow_up.png', absolute: 'true')}" alt="Up" />
results in
WARN resource.ResourceTagLib - Invocation of <r:resource> for a resource that apparently doesn't exist: http://localhost:8080/images/brochure/arrow_up.png
| 0 | [
2,
489,
7301,
18,
6577,
3590,
6738,
2792,
76,
568,
3502,
29,
7070,
45,
13398,
800,
3726,
3726,
568,
489,
7301,
18,
172,
9,
387,
9,
300,
9,
19,
353,
8517,
18,
15,
31,
275,
21,
865,
16,
3502,
29,
7070,
12074,
9,
206,
53,
1736,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
JSF selectOneButton with ajax update - setter 2 times invoked
===
I use Primefaces 3.2 with ApacheMyfaces on WebSphere Application Server 8.
I have a selectOneButton with an ajax update inside.
When I switch the button, my setter firsts sets the value (int) to 0 and then to the value which is selected:
<p:selectOneButton value="#{graph.view}" id="view">
<f:selectItem itemLabel="W" itemValue="1" />
<f:selectItem itemLabel="M" itemValue="2" />
<f:selectItem itemLabel="Y" itemValue="3" />
<p:ajax event="change" update=":optform:datecol"/>
</p:selectOneButton>
datecol is another selectComponent inside my form (optform).
Why does JSF first set the value to 0 and then to e.g. 2?
Best Regards
Veote | 0 | [
2,
487,
18,
410,
5407,
849,
811,
444,
29,
20624,
11100,
13,
8,
309,
815,
172,
436,
26252,
800,
3726,
3726,
31,
275,
1621,
6413,
18,
203,
9,
135,
29,
17140,
915,
6413,
18,
27,
2741,
14079,
3010,
8128,
469,
9,
31,
57,
21,
5407,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Decision tree from Image clusters
===
I have image clusters based on color and edge segmentation. I want to create a decision tree classifier to predict the the output from these clustered images. I am confused how to begin with it? Please let me know if you have suggestions.
Thanks. | 0 | [
2,
1401,
1541,
37,
1961,
14497,
800,
3726,
3726,
31,
57,
1961,
14497,
432,
27,
1665,
17,
1407,
5631,
857,
9,
31,
259,
20,
1600,
21,
1401,
1541,
718,
16292,
20,
9584,
14,
14,
5196,
37,
158,
7460,
69,
3502,
9,
31,
589,
4230,
184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0... |
Target element in Overlapping element
===
In my project, I need to create a html5 CMS, my problem is how to target a element in overlapping elements? like
<div id='L1'>
<!--some text -->
<div id='L2'>
<!--some text -->
<div id='L3'>
<!--some text -->
</div>
<div id='L4'>
<!--some text -->
</div>
</div>
</div>
I would like to target L1,L2,L3 and L4. Now the problem comes to I can use $(L1, L1 *) to target each element in L1, include L1 and bind 'click' event handler for them.
However when I click, let's say L4, then not only contents of L4 comes out but also L1 and L2. I want to see contains of just that element, do not need is's parent, what should I do?
| 0 | [
2,
2935,
4520,
19,
23854,
4520,
800,
3726,
3726,
19,
51,
669,
15,
31,
376,
20,
1600,
21,
13,
15895,
264,
2390,
18,
15,
51,
1448,
25,
184,
20,
2935,
21,
4520,
19,
23854,
2065,
60,
101,
13,
1,
12916,
4924,
3726,
22,
255,
165,
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... |
Using Regex to find values after a specific string of variable length and drop into array
===
I'm trying to parse through text files that contain several pieces of data that I need to drop into a growing array. The text files look something like this:
Blah blah blah
Location 1
Results:
Error = 0
Centration:(dist,x,y) mm
E0: 0.059, -0.056, 0.021
P1: 0.098, -0.098, -0.002
P2: 0.095, -0.080, 0.051
Distance: mm
E0-P1: 0.047
E0-P2: 0.039
P1-P2: 0.056
Location 2
Results:
Error = 0
Centration:(dist,x,y) mm
E0: 0.025, -0.015, 0.020
P1: 0.070, -0.069, 0.013
P2: 0.068, -0.047, 0.049
Distance: mm
E0-P1: 0.054
E0-P2: 0.044
P1-P2: 0.041
I need to find and store in an array the x and y measurements for the "P1" values under the heading "Centration". So for example, the text file above would yield an array that would look like:
-0.098, -0.002
-0.069, 0.013
The values can be either positive or negative (and i need the positive or negative information to be kept with the values), so I can't just set the regex to find blank number of characters after a string because it may vary. Also, the section named "Error" may contain more lines depending on the text file (it's a results output from a machine)...
Mind you, I have never used regex for anything other than finding certain specific text and returning a true or false value...so I'm very new at this/don't know how to. I was thinking that something could be done to find and store text occurring after "P1:", but I don't know how to do express it.
Any help would be great...I am lost and learning...but it's not happening as fast as I want it to and I'm a little stuck.
Thanks! I appreciate the help.
Al
| 0 | [
2,
568,
7953,
1706,
20,
477,
4070,
75,
21,
1903,
3724,
16,
7612,
1476,
17,
2804,
77,
7718,
800,
3726,
3726,
31,
22,
79,
749,
20,
2017,
870,
120,
1854,
6488,
30,
3717,
238,
2491,
16,
1054,
30,
31,
376,
20,
2804,
77,
21,
1991,
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... |
ASP.NET MVC route fails with “No type was found that matches the controller named 'Product'.”
===
Here's the quick situation ...
I am trying to get the following url to work ...
http://localhost:57732/Power-Drills/DeWalt
I have the following Controller defined ...
namespace MvcApplication1.Controllers
{
public class ProductController : Controller
{
public ActionResult PowerDrills(string brandName)
{
...
}
public ActionResult ProductLine(Int64 id)
{
...
}
}
}
In the global.asax I have define the following routes ...
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "PowerDrill",
url: "Power-Drills/{brandName}",
defaults: new { controller = "Product", action = "PowerDrills", brandName= "RYOBI" },
namespaces: new[] { "MvcApplication1.Controllers" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
I am getting the following error ... "*No type was found that matches the controller named" 'Product'.*"
So it appears to be indicating that it cannot find the Product controller but ... *this* url works just fine (using the default route) and *is* handled by the Product controller ...
http://localhost:57732/Product/ProductLine/4
I have read up on routing and understand (at least I think I do) url segments, how they map to the controllers and actions and how order in the global.asax is important; I have seen and read several previous posts regarding this issue for others but their solutions have not worked or applied to my situation (lots of Ruby for Rails posts).
**[This][1]** post points out that the Controller class needs to inherit from "Controller" and not "ApiController" which, as you can see, mine already does.
So I am not sure what's happening and would welcome any guidance!
Thank You,
-G
[1]: http://stackoverflow.com/questions/638362/asp-net-mvc-mapping-urls-different-to-controller-action-with-areas?rq=1 | 0 | [
2,
28,
306,
9,
2328,
307,
8990,
858,
13614,
29,
13,
1,
251,
1001,
23,
216,
30,
1717,
14,
9919,
377,
13,
22,
14086,
22,
9,
1,
800,
3726,
3726,
235,
22,
18,
14,
2231,
1858,
13,
9,
9,
9,
31,
589,
749,
20,
164,
14,
249,
287,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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: How do I get the integer (x,y) of a specify coordinate from a 2d double array
===
I have an array of 2d double data say [100][100]. Most of it is fill with '0.0' while there is a block of '1.0' located somewhere inside. I make a loop and are able to locate the '1.0' but have no idea how to extract the x and y (not the value which is '1.0') from it. Am new to java and had spend hours searching for a solution. Even tried Arrays.binarySearch method but keep giving me error. Below is my code to loop through the array.
for (int i = 0; i < data.length; i++) {
for (int j = 0; j < data[i].length; j++) {
if (data[i][j] == 1.0) {
int x = i;
}
break; //stop search once I found the first '1.0' as there are a couple of them
}
}
return x;
Please help, any advice are greatly appreciated. Thank you. | 0 | [
2,
8247,
45,
184,
107,
31,
164,
14,
13820,
13,
5,
396,
15,
93,
6,
16,
21,
19077,
15154,
37,
21,
172,
43,
1494,
7718,
800,
3726,
3726,
31,
57,
40,
7718,
16,
172,
43,
1494,
1054,
395,
636,
4031,
500,
2558,
4031,
500,
9,
127,
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 automate a zeus rewrite script
===
**Hey guys,**
What I am trying to do is be able to redirect mysite.com/ProfileName to mysite.com/profiles.php?uid=ProfileName
I have it working using zeus (only option from my hosting company) with the following code:
RULE_0_START:
match URL into $ with ^/ProfileName$
if matched then
set URL=/profiles.php?uid=ProfileName
endif
RULE_0_END:
RULE_1_START:
match URL into $ with ^/SecondProfileName$
if matched then
set URL=/profiles.php?uid=SecondProfileName
endif
RULE_1_END:
However my issue is that I need to be able to some how use PHP to update or edit this when a user creates their profilename. Any idea how to achieve this?
If I could use .htaccess i would experiment with using php to read and write the file however I have no idea how zeus rewrite works. All i know is i can manually edit the rewrite code in the control panel every time but that would become inconvenient when large numbers of people create profiles.
Ant help is appreciated. | 0 | [
2,
184,
92,
31,
3108,
5281,
21,
17879,
27891,
3884,
800,
3726,
3726,
13,
1409,
3909,
2776,
15,
1409,
98,
31,
589,
749,
20,
107,
25,
44,
777,
20,
302,
14706,
51,
9097,
9,
960,
118,
14503,
7259,
20,
51,
9097,
9,
960,
118,
14503,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Chrome-sandbox goes zombie
===
Platform: Fedora 17, 32-bit, fully updated, AMD Athlon XP+, GeForce NV18
The recent update to Google Chrome browser goes zombie instantly on startup, specifically it is the chrome-sandbox PID. I did a little looking around elsewhere, and it looks like the common thread is this only happens on older CPUs that DO NOT have SSE2. The zombie issue might be avoided if you disable the built in flash support.
Question: Is Google Chrome (or just the flash support part) compiled to use SSE2? If SSE2 is needed somehow, then the startup should check for it and issue a sensible error message so it is obvious why.
| 0 | [
2,
13,
12985,
8,
18,
290,
5309,
1852,
13007,
800,
3726,
3726,
2452,
45,
26726,
58,
369,
15,
2512,
8,
3326,
15,
2337,
6372,
15,
589,
43,
21,
96,
3226,
23045,
2430,
15,
3168,
8774,
13,
20763,
1087,
14,
1764,
11100,
20,
8144,
13,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Single Instance for Shared Library Project Activity?
===
[This answer][1] recommends using AndroidManifest's `android:launchMode="singleTask"` to limit an activity to a single instance.
That's great for applications in which all activities are part of the project, but when I have several application using a [Library Project][2] in which the application's main activity is defined, the Library Project's AndroidManifest **is ignored** and so I can't really use that `android:launchMode="singleTask"` attribute there.
If I use that `android:launchMode="singleTask"` in the application's AndroidManifest.xml, then each activity has a different name and this attribute will limit to a single instance only the *same application*, not different applications using this shared activity (used as a Library Project).
What I really want is that at any given moment, only one application (among the *different applications* using that shared Library Project's activity) can run.
Is this doable using the `android:launchMode="singleTask"` attribute?
If this isn't possible, what other approach is recommended?
[1]: http://stackoverflow.com/a/6706810/869501
[2]: http://developer.android.com/tools/projects/index.html#LibraryProjects | 0 | [
2,
345,
4851,
26,
2592,
1248,
669,
2358,
60,
800,
3726,
3726,
636,
1565,
1623,
500,
2558,
165,
500,
12360,
18,
568,
13005,
8002,
9962,
22,
18,
13,
1,
290,
18524,
45,
18494,
15570,
3726,
7,
14031,
38,
20310,
7,
1,
20,
4496,
40,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
getting started with an Online Mulltiplayer Game (C# VS2010) of Blackjack
===
I just developed a C# black jack game that is working perfectly well. I'd like to set up a server so I could be able to play multiplayer. My question is, where do i start? What should I read about? (Excuse my english) | 1 | [
2,
1017,
373,
29,
40,
2087,
13262,
1388,
14049,
250,
13,
5,
150,
5910,
4611,
2751,
6,
16,
319,
6994,
800,
3726,
3726,
31,
114,
885,
21,
272,
5910,
319,
1040,
250,
30,
25,
638,
5759,
134,
9,
31,
22,
43,
101,
20,
309,
71,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Python NameError: global name 'NAME' is not not defined! (But it is defined)
===
Hey there stackoverflow users! I am on my way to create an Counter-Strike Source menu there can give you self and other players weapons when i got this error when i tested it:
NameError: global name 'bilbodogOther' is not not defined
This is my code:
import es, popuplib, cmdlib
info = es.AddonInfo()
info['name'] = "bilbodog Vaaben Menu"
info['version'] = "1.1"
info['author'] = "bilbodog"
info['url'] = ""
info['description'] = "En vaaben menu der kan give vaaben til spillere"
def load():
es.regclientcmd('bm_version', 'bm/bm_version')
cmdlib.registerSayCommand('!wpa', sendBmMenu, 'Send BM Menu')
es.msg('#multi', '#green[bilbodog Vaaben Menu] #defaultblev loaded!')
global bilbodog, bilbodogSelf, bilbodogOther, bilbodogSelf2, bilbodogSelf3, bilbodogSelf4, bilbodogSelf5, bilbodogSelf6, bilbodogSelf7, bilbodogSelf8, bilbodogSelf9, bilbodogOther2, bilbodogOther3, bilbodogOther4, bilbodogOther5, bilbodogOther6, bilbodogOther7, bilbodogOther8, bilbodogOther9, bilbodogadmins
bilbodogadmins = ('STEAM_0:1:25150824', 'STEAM_ID_LAN', 'STEAM_ID_PENDING')
bilbodog = popuplib.create('bilbodog')
bilbodog.addline('---------------bilbodog Vaaben Menu---------------')
bilbodog.addline('Weapon Menu - Hvem vil De give et vaaben?')
bilbodog.addline('->1. Mig selv')
bilbodog.addline('->2. Andre spillere')
bilbodog.addline('------------------------------')
bilbodog.addline('0 Luk')
bilbodog.menuselect = bilbodogscript
bilbodogSelf = popuplib.create('bilbodogSelf')
bilbodogSelf.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogSelf.addline('Weapon Menu - Mig selv')
bilbodogSelf.addline('->1. Haandpistoler')
bilbodogSelf.addline('->2. Stormgevaerer')
bilbodogSelf.addline('->3. Haglgevaerer')
bilbodogSelf.addline('->4. Maskinepistoler')
bilbodogSelf.addline('->5. Sniper Vaaben')
bilbodogSelf.addline('->6. Maskingevaer')
bilbodogSelf.addline('->7. Udstyr')
bilbodogSelf.addline('->8. Vaaben Saet')
bilbodogSelf.addline('------------------------------')
bilbodogSelf.addline('0 Luk')
bilbodogSelf.menuselect = bilbodogSelfscript
bilbodogSelf2 = popuplib.create('bilbodogSelf2')
bilbodogSelf2.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogSelf2.addline('Weapon Menu - Mig selv - Haandpistoler')
bilbodogSelf2.addline('->1.G18')
bilbodogSelf2.addline('->2.USP45')
bilbodogSelf2.addline('->3.P228')
bilbodogSelf2.addline('->4.Desert Eagle')
bilbodogSelf2.addline('->5.Five-Seven')
bilbodogSelf2.addline('->6.Dual Elite')
bilbodogSelf2.addline('------------------------------')
bilbodogSelf2.addline('->8.Tilbage')
bilbodogSelf2.addline('0.Luk')
bilbodogSelf2.menuselect = bilbodogSelf2script
bilbodogSelf3 = popuplib.create('bilbodogSelf3')
bilbodogSelf3.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogSelf3.addline('Weapon Menu - Mig selv - Assault Rifles')
bilbodogSelf3.addline('->1.Galil')
bilbodogSelf3.addline('->2.Famas')
bilbodogSelf3.addline('->3.AK-47')
bilbodogSelf3.addline('->4.M4A1')
bilbodogSelf3.addline('->5.SG-552 Commando')
bilbodogSelf3.addline('->6.AUG')
bilbodogSelf3.addline('------------------------------')
bilbodogSelf3.addline('->8.Tilbage')
bilbodogSelf3.addline('0.Luk')
bilbodogSelf3.menuselect = bilbodogSelf3script
bilbodogSelf4 = popuplib.create('bilbodogSelf4')
bilbodogSelf4.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogSelf4.addline('Weapon Menu - Mig selv - Haglgevaerer')
bilbodogSelf4.addline('->1.Benelli M3')
bilbodogSelf4.addline('->2.Benelli XM1014')
bilbodogSelf4.addline('------------------------------')
bilbodogSelf4.addline('->8.Tilbage')
bilbodogSelf4.addline('0.Luk')
bilbodogSelf4.menuselect = bilbodogSelf4script
bilbodogSelf5 = popuplib.create('bilbodogSelf5')
bilbodogSelf5.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogSelf5.addline('Weapon Menu - Mig selv - Maskingevaerer')
bilbodogSelf5.addline('->1.TMP')
bilbodogSelf5.addline('->2.MAC-10')
bilbodogSelf5.addline('->3.MP5')
bilbodogSelf5.addline('->4.UMP45')
bilbodogSelf5.addline('->5.P90')
bilbodogSelf5.addline('------------------------------')
bilbodogSelf5.addline('->8.Tilbage')
bilbodogSelf5.addline('0.Luk')
bilbodogSelf5.menuselect = bilbodogSelf5script
bilbodogSelf6 = popuplib.create('bilbodogSelf6')
bilbodogSelf6.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogSelf6.addline('Weapon Menu - Mig selv - Sniper Vaaben')
bilbodogSelf6.addline('->1.Scout')
bilbodogSelf6.addline('->2.SG-550 Sniper')
bilbodogSelf6.addline('->3.AWP')
bilbodogSelf6.addline('->4.G3/SG-1 Sniper Rifle')
bilbodogSelf6.addline('------------------------------')
bilbodogSelf6.addline('->8.Tilbage')
bilbodogSelf6.addline('0.Luk')
bilbodogSelf6.menuselect = bilbodogSelf6script
bilbodogSelf7 = popuplib.create('bilbodogSelf7')
bilbodogSelf7.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogSelf7.addline('Weapon Menu - Mig selv - Maskingevaer')
bilbodogSelf7.addline('->1.Para')
bilbodogSelf7.addline('------------------------------')
bilbodogSelf7.addline('->8.Tilbage')
bilbodogSelf7.addline('0.Luk')
bilbodogSelf7.menuselect = bilbodogSelf7script
bilbodogSelf8 = popuplib.create('bilbodogSelf8')
bilbodogSelf8.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogSelf8.addline('Weapon Menu - Mig selv - Udstyr')
bilbodogSelf8.addline('->1.Flashbang')
bilbodogSelf8.addline('->2.HE Grenade')
bilbodogSelf8.addline('->3.Smoke Grenade')
bilbodogSelf8.addline('->4.100 HP')
bilbodogSelf8.addline('->5.100 Armor')
bilbodogSelf8.addline('->6.Kniv')
bilbodogSelf8.addline('------------------------------')
bilbodogSelf8.addline('->8.Tilbage')
bilbodogSelf8.addline('0.Luk')
bilbodogSelf8.menuselect = bilbodogSelf8script
bilbodogSelf9 = popuplib.create('bilbodogSelf9')
bilbodogSelf9.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogSelf9.addline('Weapon Menu - Mig selv - Udstyr')
bilbodogSelf9.addline('->1.M4A1, Deagle, Nades, Armor')
bilbodogSelf9.addline('->2.M4A1, Elite, Nades, Armor')
bilbodogSelf9.addline('->3.AK47, Deagle, Nades, Armor')
bilbodogSelf9.addline('->4.AK47, Elite, Nades, Armor')
bilbodogSelf9.addline('->5.AWP, Deagle, Nades, Armor')
bilbodogSelf9.addline('->6.AWP, Elite, Nades, Armor')
bilbodogSelf9.addline('------------------------------')
bilbodogSelf9.addline('->8.Tilbage')
bilbodogSelf9.addline('0.Luk')
bilbodogSelf9.menuselect = bilbodogSelf9script
bilbodogOther = popuplib.create('bilbodogOther')
bilbodogOther.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogOther.addline('Weapon Menu - Andre spillere')
bilbodogOther.addline('->1. Haandpistoler')
bilbodogOther.addline('->2. Stormgevaerer')
bilbodogOther.addline('->3. Haglgevaerer')
bilbodogOther.addline('->4. Maskinepistoler')
bilbodogOther.addline('->5. Sniper Vaaben')
bilbodogOther.addline('->6. Maskingevaer')
bilbodogOther.addline('->7. Udstyr')
bilbodogOther.addline('->8. Vaaben Saet')
bilbodogOther.addline('------------------------------')
bilbodogOther.addline('0 Luk')
bilbodogOther.menuselect = bilbodogOtherscript
bilbodogOther2 = popuplib.create('bilbodogOther2')
bilbodogOther2.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogOther2.addline('Weapon Menu - Andre spillere - Haandpistoler')
bilbodogOther2.addline('->1.G18')
bilbodogOther2.addline('->2.USP45')
bilbodogOther2.addline('->3.P228')
bilbodogOther2.addline('->4.Desert Eagle')
bilbodogOther2.addline('->5.Five-Seven')
bilbodogOther2.addline('->6.Dual Elite')
bilbodogOther2.addline('------------------------------')
bilbodogOther2.addline('->8.Tilbage')
bilbodogOther2.addline('0.Luk')
bilbodogOther2.menuselect = bilbodogOther2script
bilbodogOther3 = popuplib.create('bilbodogOther3')
bilbodogOther3.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogOther3.addline('Weapon Menu - Andre spillere - Assault Rifles')
bilbodogOther3.addline('->1.Galil')
bilbodogOther3.addline('->2.Famas')
bilbodogOther3.addline('->3.AK-47')
bilbodogOther3.addline('->4.M4A1')
bilbodogOther3.addline('->5.SG-552 Commando')
bilbodogOther3.addline('->6.AUG')
bilbodogOther3.addline('------------------------------')
bilbodogOther3.addline('->8.Tilbage')
bilbodogOther3.addline('0.Luk')
bilbodogOther3.menuselect = bilbodogOther3script
bilbodogOther4 = popuplib.create('bilbodogOther4')
bilbodogOther4.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogOther4.addline('Weapon Menu - Andre spillere - Haglgevaerer')
bilbodogOther4.addline('->1.Benelli M3')
bilbodogOther4.addline('->2.Benelli XM1014')
bilbodogOther4.addline('------------------------------')
bilbodogOther4.addline('->8.Tilbage')
bilbodogOther4.addline('0.Luk')
bilbodogOther4.menuselect = bilbodogOther4script
bilbodogOther5 = popuplib.create('bilbodogOther5')
bilbodogOther5.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogOther5.addline('Weapon Menu - Andre spillere - Maskingevaerer')
bilbodogOther5.addline('->1.TMP')
bilbodogOther5.addline('->2.MAC-10')
bilbodogOther5.addline('->3.MP5')
bilbodogOther5.addline('->4.UMP45')
bilbodogOther5.addline('->5.P90')
bilbodogOther5.addline('------------------------------')
bilbodogOther5.addline('->8.Tilbage')
bilbodogOther5.addline('0.Luk')
bilbodogOther5.menuselect = bilbodogOther5script
bilbodogOther6 = popuplib.create('bilbodogOther6')
bilbodogOther6.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogOther6.addline('Weapon Menu - Andre spillere - Sniper Vaaben')
bilbodogOther6.addline('->1.Scout')
bilbodogOther6.addline('->2.SG-550 Sniper')
bilbodogOther6.addline('->3.AWP')
bilbodogOther6.addline('->4.G3/SG-1 Sniper Rifle')
bilbodogOther6.addline('------------------------------')
bilbodogOther6.addline('->8.Tilbage')
bilbodogOther6.addline('0.Luk')
bilbodogOther6.menuselect = bilbodogOther6script
bilbodogOther7 = popuplib.create('bilbodogOther7')
bilbodogOther7.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogOther7.addline('Weapon Menu - Andre spillere - Maskingevaer')
bilbodogOther7.addline('->1.Para')
bilbodogOther7.addline('------------------------------')
bilbodogOther7.addline('->8.Tilbage')
bilbodogOther7.addline('0.Luk')
bilbodogOther7.menuselect = bilbodogOther7script
bilbodogOther8 = popuplib.create('bilbodogOther8')
bilbodogOther8.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogOther8.addline('Weapon Menu - Andre spillere - Udstyr')
bilbodogOther8.addline('->1.Flashbang')
bilbodogOther8.addline('->2.HE Grenade')
bilbodogOther8.addline('->3.Smoke Grenade')
bilbodogOther8.addline('->4.100 HP')
bilbodogOther8.addline('->5.100 Armor')
bilbodogOther8.addline('->6.Kniv')
bilbodogOther8.addline('------------------------------')
bilbodogOther8.addline('->8.Tilbage')
bilbodogOther8.addline('0.Luk')
bilbodogOther8.menuselect = bilbodogOther8script
bilbodogOther9 = popuplib.create('bilbodogOther9')
bilbodogOther9.addline('---------------bilbodog Vaaben Menu---------------')
bilbodogOther9.addline('Weapon Menu - Andre spillere - Udstyr')
bilbodogOther9.addline('->1.M4A1, Deagle, Nades, Armor')
bilbodogOther9.addline('->2.M4A1, Elite, Nades, Armor')
bilbodogOther9.addline('->3.AK47, Deagle, Nades, Armor')
bilbodogOther9.addline('->4.AK47, Elite, Nades, Armor')
bilbodogOther9.addline('->5.AWP, Deagle, Nades, Armor')
bilbodogOther9.addline('->6.AWP, Elite, Nades, Armor')
bilbodogOther9.addline('------------------------------')
bilbodogOther9.addline('->8.Tilbage')
bilbodogOther9.addline('0.Luk')
bilbodogOther9.menuselect = bilbodogOther9script
def sendBmMenu(userid, args):
steam = es.getplayersteamid(userid)
if steam in bilbodogadmins:
bilbodog.send(userid)
else:
es.tell(event_var['userid'], '#multi', '#greenDe har ikke adgang til denne kommando!')
def bilbodogscript(userid, choice, popupid):
if choice == 1:
bilbodogSelf.send(userid)
elif choice == 2:
bilbodogOther.send(userid)
def bilbodogSelfscript(userid, choice, popupid):
if choice == 1:
bilbodogSelf2.send(userid)
elif choice == 2:
bilbodogSelf3.send(userid)
elif choice == 3:
bilbodogSelf4.send(userid)
elif choice == 4:
bilbodogSelf5.send(userid)
elif choice == 5:
bilbodogSelf6.send(userid)
elif choice == 6:
bilbodogSelf7.send(userid)
elif choice == 7:
bilbodogSelf8.send(userid)
elif choice == 8:
bilbodogSelf9.send(userid)
def bilbodogOtherscript(userid, choice, popupid):
if choice == 1:
bilbodogOther2.send(userid)
elif choice == 2:
bilbodogOther3.send(userid)
elif choice == 3:
bilbodogOther4.send(userid)
elif choice == 4:
bilbodogOther5.send(userid)
elif choice == 5:
bilbodogOther6.send(userid)
elif choice == 6:
bilbodogOther7.send(userid)
elif choice == 7:
bilbodogOther8.send(userid)
elif choice == 8:
bilbodogOther9.send(userid)
def bm_version():
es.msg('#multi', '#green[bilbodog Vaaben Menu] #defaultVersion 1.0')
es.msg('#multi', '#green[bilbodog Vaaben Menu] #defaultLavet af bilbodog')
def unload():
cmdlib.unregisterSayCommand('!wpa')
And the error er going on right here:
def bilbodogscript(userid, choice, popupid):
if choice == 1:
bilbodogSelf.send(userid)
elif choice == 2:
bilbodogOther.send(userid)
But i don't understand it because it is defined by here:
global bilbodog, bilbodogSelf, bilbodogOther, bilbodogSelf2, bilbodogSelf3, bilbodogSelf4, bilbodogSelf5, bilbodogSelf6, bilbodogSelf7, bilbodogSelf8, bilbodogSelf9, bilbodogOther2, bilbodogOther3, bilbodogOther4, bilbodogOther5, bilbodogOther6, bilbodogOther7, bilbodogOther8, bilbodogOther9, bilbodogadmins
I'll hoop you can help me!
Best Regards bilbodog (Casper Thomsen) | 0 | [
2,
20059,
204,
29992,
45,
2062,
204,
13,
22,
7259,
22,
25,
52,
52,
2811,
187,
13,
5,
811,
32,
25,
2811,
6,
800,
3726,
3726,
8409,
80,
7566,
2549,
9990,
3878,
187,
31,
589,
27,
51,
161,
20,
1600,
40,
2105,
8,
18827,
1267,
11379... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 different partial views returning from the same MVC methjod via jQuery Ajax.
===
Setup:
ASP.NET MVC3, jQuery, C#
Has anyone got a clean solution to handle different partial views returning from the same action method? One for the next stage, one for returning the view again with validation errors and the other for display an unhandled exception.
I have a **controller method** that does something like:
public ActionResult SomeMethod(MyModel model)
{
if(_service.Validate(model))
{
if(_service.Update(model))
{
// return next view once success
return PartialView("EverythingIsGood"); // This should be pushed into #somediv
}else{
throw new HardException("Tell the client something bad has happened");
}
}
else
{
// Return the same view to highlight the validation
HttpContext.Response.StatusCode = 500;
return PartialView("SomeMethod", model); // This should be pushed into #anotherdiv
}
}
**Client Script**
$.ajax({
url: baseUrl + "Home/SomeMethod",
type: "GET",
success: function (data) {
$("#somediv").html(data);
},
error: function (data) {
handleError(data);
}
});
I guessing I need something like **softerror**:
$.ajax({
url: baseUrl + "Home/SomeMethod",
type: "GET",
success: function (data) {
$("#somediv").html(data);
},
softerror: function (data) {
$("#anotherdiv").html(data);
},
error: function (data) {
handleError(data);
}
});
I was thinking of maybe returning a different status code for the soft validation errors but this feels quick hacky. | 0 | [
2,
7988,
421,
7284,
4146,
2485,
37,
14,
205,
307,
8990,
55,
96,
1636,
43,
1197,
487,
8190,
93,
20624,
9,
800,
3726,
3726,
18161,
45,
28,
306,
9,
2328,
307,
8990,
240,
15,
487,
8190,
93,
15,
272,
5910,
63,
1276,
330,
21,
2745,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Serial interface initialisation with arduino and C
===
I want to "talk" with my arduino using C on my mac. I first used the code in the link given on the arduino official website: http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/
Using the "blink" example it simply doesn't work, I know that newer arduinos reset when the serial port is open but even with adding a delay (up to 4s) it simply blinks once whatever character I send.
I also tried to change the code by disabling HUPCL (should prevent the reset) in the termios flags but it doesn't change anything.
The *funny* thing is that it is working if I load the serial monitor of the Arduino official app in the background. The command screen is also fully functional. So I guess it has something to do with the initialisation of the serial communication. I then tried to get the flags (l, i, o and c) used by the monitor using **stty -a** and used them in my C program... without luck!
Thanks for any help!
PS: this is a chinese clone bought on ebay... maybe it can be relevant | 0 | [
2,
5956,
6573,
2104,
4330,
29,
13,
1514,
291,
3252,
17,
272,
800,
3726,
3726,
31,
259,
20,
13,
7,
9718,
7,
29,
51,
13,
1514,
291,
3252,
568,
272,
27,
51,
1572,
9,
31,
64,
147,
14,
1797,
19,
14,
3508,
504,
27,
14,
13,
1514,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 use my Cookie class properly
===
I just started with OOP programming in PHP and i have made a cookie class.
With doing that i have got a few questions unanswered
- is my class correct?
- how do i use it properly in my page? ( lets think i want to see how many times the visitor visited my website before and output the result for the user )
i already tested it after loging in and using this code:
$cookie = new Cookie();
$cookie->store();
print_r($_COOKIE);
(i had a result thrown back but i don;t know if its the good result)
Bellow you can find my Cookie class.
<?php
class Cookie
{
/*
* cookie $id
*/
private $id = false;
/*
* cookie life $time
*/
private $time = false;
/*
* cookie $domain
*/
private $domain = false;
/*
* cookie $path
*/
private $path = false;
/*
* cookie $secure (true is https only)
*/
private $secure = false;
public function __construct($id, $time = 3600, $path = false, $domain = false, $secure = false)
{
$this->id = $id;
$this->time = $time;
$this->path = $path;
$this->domain = $domain;
$this->secure = $secure;
}
public function store()
{
foreach ($this->parameters as $parameter => $validator)
{
setcookie($this->id . "[" . $parameter . "]", $validator->getValue(), time() + $this->time, $this->path, $this->domain, $this->secure, true);
}
}
public function restore()
{
if (isset($_COOKIE[$this->id]))
{
foreach ($_COOKIE[$this->id] as $parameter => $value)
{
$this->{$parameter} = $value;
}
}
}
public function destroy()
{
$this->time = -1;
}
}
?>
i hope someone can give me a good example! thanks for the help in advance! | 0 | [
2,
184,
20,
275,
51,
19980,
718,
7428,
800,
3726,
3726,
31,
114,
373,
29,
13,
21709,
3143,
19,
13,
26120,
17,
31,
57,
117,
21,
19980,
718,
9,
29,
845,
30,
31,
57,
330,
21,
310,
2346,
29920,
13,
8,
25,
51,
718,
4456,
60,
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... |
Slider in Android
===
I am currently developing an android application with Eclipse. I would like to be able to slide in or out in order to go to next screen(Activity). Does anyone have any idea of how to create this control or any 3rd party to do this?
Thanks,
Charles | 0 | [
2,
3295,
106,
19,
13005,
800,
3726,
3726,
31,
589,
871,
3561,
40,
13005,
3010,
29,
11652,
9,
31,
83,
101,
20,
44,
777,
20,
6464,
19,
54,
70,
19,
389,
20,
162,
20,
328,
2324,
5,
19348,
6,
9,
630,
1276,
57,
186,
882,
16,
184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 extract the title and meta description using simple html dom parser
===
how to extract the title and meta description using simple html dom parser
I just need the title of the page and the keywords in plain text.
How can I do that? | 0 | [
2,
184,
20,
10962,
14,
581,
17,
7618,
5318,
568,
1935,
13,
15895,
11859,
2017,
4104,
800,
3726,
3726,
184,
20,
10962,
14,
581,
17,
7618,
5318,
568,
1935,
13,
15895,
11859,
2017,
4104,
31,
114,
376,
14,
581,
16,
14,
2478,
17,
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,
0,
0,
0,
0,
0,
0,
0... |
Flex : How to right align cells in s:DataGrid?
===
I have an s:DataGrid with 3 columns. I'd like to right align the text in the last two columns but can't find a way to get it working. I've tried creating a custom renderer and setting the textAlign to right, but it doesn't work.
Here's my custom renderer:
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" clipAndEnableScrolling="true">
<fx:Script>
<![CDATA[
]]>
</fx:Script>
<s:Label id="lblData" top="9" left="7" text="{data.outgoingCount}" fontWeight="bold" textAlign="right"/>
</s:GridItemRenderer>
I would really like to know how to right align cells in the grid. Thanks for anyone who can help. | 0 | [
2,
14409,
13,
45,
184,
20,
193,
23389,
2934,
19,
13,
18,
45,
18768,
16375,
60,
800,
3726,
3726,
31,
57,
40,
13,
18,
45,
18768,
16375,
29,
203,
7498,
9,
31,
22,
43,
101,
20,
193,
23389,
14,
1854,
19,
14,
236,
81,
7498,
47,
92... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
onClick function call using scriptlet
===
I want to use scriptlet to write the function called when clicking the Execute Test button This code didn't work :
Here's my jsp code :
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<html:file properties="tonFichier" name="tonForm"/>
<%!
public void executeTest() {
java.util.Date d = new java.util.Date();
System.out.println(d.toString()); }
%>
<form enctype="multipart/form-data" method="get">
<div>
<input type="submit" value="Execute Test" onclick="executeTest()" >
</div>
</form>
</body>
</html>
Any help please
Cheers | 0 | [
2,
27,
150,
10129,
1990,
645,
568,
3884,
1336,
800,
3726,
3726,
31,
259,
20,
275,
3884,
1336,
20,
2757,
14,
1990,
227,
76,
25590,
14,
15644,
1289,
5167,
48,
1797,
223,
22,
38,
170,
13,
45,
235,
22,
18,
51,
487,
3401,
1797,
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... |
Schema XML restrictions
===
I have XML elements are which associated with two date attributes begin and end
how to restrict the begin date attribute of a given element must be less than end date attribute of the element in Schema definition
| 0 | [
2,
23874,
23504,
9245,
800,
3726,
3726,
31,
57,
23504,
2065,
50,
56,
1598,
29,
81,
1231,
13422,
2348,
17,
241,
184,
20,
15436,
14,
2348,
1231,
35,
14755,
16,
21,
504,
4520,
491,
44,
787,
119,
241,
1231,
35,
14755,
16,
14,
4520,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Cluster similar names in a database/vector
===
I have a table with lots of names of people (millions of rows), e.g.:
1. Linda Cartway
2. L Cartway
3. Miri Cartway
4. M D Cartoway
5. ...
What is the best way to cluster these names? Is there a ready-made solution for this?
There is Levenshtein distance and it can implemented in R or Perl or something else, but with this task there are other things to consider as well, e.g. the initials (like "A B" and "A J") even though have small Levenshtein distances actually correspond to different people.
I will be grateful for any suggestions!
| 0 | [
2,
7460,
835,
1817,
19,
21,
6018,
118,
28033,
800,
3726,
3726,
31,
57,
21,
859,
29,
7503,
16,
1817,
16,
148,
13,
5,
14428,
18,
16,
11295,
6,
15,
13,
62,
9,
263,
9,
45,
137,
9,
8325,
6420,
1443,
172,
9,
644,
6420,
1443,
203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 a horizontal scrollbar with mouseover effects?
===
Helo to all, i have been searching all over the web for some jquery or javascript tutorial or plugin for a horizontal scrollbar and i have found many of plugin asnd tutorial but not the one i want.
Now im using tinyscroll and i have found it has alot of bugs, can somebody help me with the next effects.
Mouseover: At mouseover at the right or left it scrolls by itself.
Shadow at hiding: When a image hides at the left or right a shadow effect that gives a "it got in the bottom of this layer" effect.
Scrollbar: simple bar that has a 80% opacity
mouse scroll: that mouse scroll can be used with it.
I need something like the movie scroller in this page:
Cuevana.tv
And i know html and css but css -webkit styling can't do this effects.
I really dont have any codes to start with, please help. | 0 | [
2,
184,
20,
233,
21,
10095,
12159,
1850,
29,
7567,
2549,
2292,
60,
800,
3726,
3726,
24,
1415,
20,
65,
15,
31,
57,
74,
5792,
65,
84,
14,
2741,
26,
109,
487,
8190,
93,
54,
8247,
8741,
29724,
54,
10922,
108,
26,
21,
10095,
12159,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
web page refresh twice issue
===
My web page refreshes twice in the following scenario:
Come to the site. Close browser. Don't visit the site in a few hours. Visit the site again.
If I clear my cache, web page only loads once. If I revisit the site in a few mins, web page also only loads once.
Here is the access log when it loads twice. I used php, codeigniter. Also not sure why some css and js are loaded before controller is called. I have been working on it for quite while. Any help will be really appreciated.
71.198.230.32 - - [06/Jul/2012:23:16:33 -0400] "GET / HTTP/1.1" 301 232
71.198.230.32 - - [06/Jul/2012:23:16:34 -0400] "GET / HTTP/1.1" 302 -
71.198.230.32 - - [06/Jul/2012:23:16:35 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/SpryAssets/SpryTabbedPanels.css HTTP/1.1" 200 8966
71.198.230.32 - - [06/Jul/2012:23:16:35 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/jquery.livequery.js HTTP/1.1" 200 6688
71.198.230.32 - - [06/Jul/2012:23:16:35 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/css/styles.css HTTP/1.1" 200 65987
71.198.230.32 - - [06/Jul/2012:23:16:35 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/jquery.oauthpopup.js HTTP/1.1" 200 996
71.198.230.32 - - [06/Jul/2012:23:16:36 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/SpryAssets/SpryTabbedPanels.js HTTP/1.1" 200 11759
71.198.230.32 - - [06/Jul/2012:23:16:36 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/upclick-min.js HTTP/1.1" 200 3294
71.198.230.32 - - [06/Jul/2012:23:16:36 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/util_function.js HTTP/1.1" 200 275
**71.198.230.32 - - [06/Jul/2012:23:16:34 -0400] "GET topic/recent_topics HTTP/1.1" 200 73869**
71.198.230.32 - - [06/Jul/2012:23:16:36 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/util/util.js HTTP/1.1" 200 389
71.198.230.32 - - [06/Jul/2012:23:16:36 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/follow/reply_thank.js HTTP/1.1" 200 1993
71.198.230.32 - - [06/Jul/2012:23:16:36 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/follow/follow_topic.js HTTP/1.1" 200 1656
71.198.230.32 - - [06/Jul/2012:23:16:36 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/follow/follow_category.js HTTP/1.1" 200 1677
71.198.230.32 - - [06/Jul/2012:23:16:35 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/jquery.min.js HTTP/1.1" 200 85260
71.198.230.32 - - [06/Jul/2012:23:16:36 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/follow/follow_user.js HTTP/1.1" 200 1645
71.198.230.32 - - [06/Jul/2012:23:16:36 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/jquery-ui.min.js HTTP/1.1" 200 186181
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/header_bg.png HTTP/1.1" 200 3748
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/logo.png HTTP/1.1" 200 9578
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/cloud.png HTTP/1.1" 200 7256
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/close-button.png HTTP/1.1" 200 35893
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/postt.png HTTP/1.1" 200 2876
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/buttons/searchicon.png HTTP/1.1" 200 1353
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /upload/users/201207/06/6b1e4dfcec3de93210c846788a39426a/dr._chan_lol_.jpg HTTP/1.1" 200 77818
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /upload/users/201207/06/9b8c2d07c379295bc90e2eb14b9b37cf/174228_689795644_1823315134_q.jpg HTTP/1.1" 200 2849
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/hot.gif HTTP/1.1" 200 591
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/bag.png HTTP/1.1" 200 941
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/tropy.png HTTP/1.1" 200 3233
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/leaderboard.png HTTP/1.1" 200 3210
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/seemore-arrow.png HTTP/1.1" 200 967
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/category/bookmark.png HTTP/1.1" 200 2872
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /upload/users/201207/03/b0e6072d037e46da47d1246cdfc0e94b/369355_1559173343_206783333_q.jpg HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/favicon.ico HTTP/1.1" 200 1150
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/css/styles.css HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/js/jquery.min.js HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/logo.png HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /upload/users/201203/10/8fccc2b98958e0cfa280116c3045fe9e/i.jpg HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /upload/users/201207/03/b0e6072d037e46da47d1246cdfc0e94b/369355_1559173343_206783333_q.jpg HTTP/1.1" 200 3065
**71.198.230.32 - - [06/Jul/2012:23:16:37 -0400] "GET /topic/recent_topics HTTP/1.1" 200 73869**
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /upload/users/201207/06/6b1e4dfcec3de93210c846788a39426a/dr._chan_lol_.jpg HTTP/1.1" 206 1
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/close-button.png HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /upload/users/201206/26/b2d5ce5ec830416c52217bbffbb26a87/372069_1551541701_197411608_q.jpg HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /upload/users/201207/06/9b8c2d07c379295bc90e2eb14b9b37cf/174228_689795644_1823315134_q.jpg HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:38 -0400] "GET /upload/users/201203/31/b1694942a609a437aa13a1dd505f67b3/161245_1476470148_1441827706_q.jpg HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /upload/site/default_profile_image.png HTTP/1.1" 200 4099
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /upload/users/201207/02/6f5ff87064a82fd79592d297aabfdc1e/49940_9027065_2598_n.jpg HTTP/1.1" 200 6479
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /upload/users/201204/02/0b4bcac00a203c51aa7bccd1be8a6b97/nikhil.jpg HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /upload/users/201204/16/d959d2192425af0a6b8399a535e5e52c/asdf.jpg HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /upload/users/201207/01/f7ddcb246cedddc04d9e1f7d6a5caa8f/img_5678.jpg HTTP/1.1" 200 15433
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/tropy.png HTTP/1.1" 200 3233
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/leaderboard.png HTTP/1.1" 200 3210
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /upload/users/201203/12/b7cf1b70563c040db000eed9ecc6d380/rabbit.jpg HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/bag.png HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/background/hot.gif HTTP/1.1" 304 -
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /893e96673717fd8b25bfe61dacb8fa38bbb0fcba/img/category/bookmark.png HTTP/1.1" 200 2872
71.198.230.32 - - [06/Jul/2012:23:16:39 -0400] "GET /upload/users/201207/06/6b1e4dfcec3de93210c846788a39426a/dr._chan_lol_.jpg HTTP/1.1" 206 5722
::1 - - [06/Jul/2012:23:16:46 -0400] "OPTIONS * HTTP/1.0" 200 -
::1 - - [06/Jul/2012:23:16:47 -0400] "OPTIONS * HTTP/1.0" 200 -
| 0 | [
2,
2741,
2478,
24905,
2088,
1513,
800,
3726,
3726,
51,
2741,
2478,
24905,
160,
2088,
19,
14,
249,
12705,
45,
340,
20,
14,
689,
9,
543,
16495,
9,
221,
22,
38,
2139,
14,
689,
19,
21,
310,
974,
9,
2139,
14,
689,
188,
9,
100,
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... |
linq to sql or linq to entities in .net 3.5?
===
I have not worked in entity framework before but I am starting a new project and am forced to work with .net 3.5 for now. I was wondering if anyone can tell me which would be better to learn linq to sql or linq to entities if I have to use .net 3.5? | 0 | [
2,
6294,
1251,
20,
4444,
255,
54,
6294,
1251,
20,
12549,
19,
13,
9,
2328,
203,
9,
264,
60,
800,
3726,
3726,
31,
57,
52,
577,
19,
9252,
6596,
115,
47,
31,
589,
1422,
21,
78,
669,
17,
589,
1292,
20,
170,
29,
13,
9,
2328,
203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Internet stops working after sleep using racoon for VPN
===
I was connected to my institutes network over VPN using racoon . After I put the laptop on sleep mode , the Internet has stopped working . Can somebody help ? | 0 | [
2,
2620,
6604,
638,
75,
1742,
568,
13,
5797,
5709,
26,
13,
10924,
103,
800,
3726,
3726,
31,
23,
2587,
20,
51,
17416,
982,
84,
13,
10924,
103,
568,
13,
5797,
5709,
13,
9,
75,
31,
442,
14,
12294,
27,
1742,
3740,
13,
15,
14,
2620... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0... |
OpenSSL trouble with Ruby 1.9.3
===
I am having a semi-serious problem with OpenSSL 1.0.1 + Ruby 1.9.3 on Ubuntu 12.04.
All rubies are installed with rvm
require 'uri'
require 'net/http'
require 'net/https'
endpoint = "https://secure.mmoagateway.com/api/transact.php"
RUBY_184_POST_HEADERS = { "Content-Type" => "application/x-www-form-urlencoded" }
body = "orderid=ae5dd847d9f31209cbffeeea076ed966&orderdescription=Active+Merchant+Remote+Test+Purchase&ccnumber=4111111111111111&ccexp=0913&cvv=123&company=Widgets+Inc&address1=1234+My+Street&address2=Apt+1&city=Ottawa&state=ON&zip=K1C2N6&country=CA&phone=%28555%29555-5555&firstname=&lastname=&email=&amount=1.00&type=auth&username=demo&password=password"
headers = {}
endpoint = endpoint.is_a?(URI) ? endpoint : URI.parse(endpoint)
http = Net::HTTP.new(endpoint.host, endpoint.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.set_debug_output(STDOUT)
result = http.post(endpoint.request_uri, body, RUBY_184_POST_HEADERS.merge(headers))
puts(result)
On Ubuntu 12.04 + Ruby 1.9.3 + Openss 1.0.1 I get the following output:
% ruby test.rb
opening connection to secure.mmoagateway.com...
opened
Conn close because of connect error Connection reset by peer - SSL_connect
/usr/lib/ruby/1.9.1/net/http.rb:799:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
from /usr/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
from /usr/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from /usr/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from /usr/lib/ruby/1.9.1/net/http.rb:799:in `connect'
from /usr/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from /usr/lib/ruby/1.9.1/net/http.rb:744:in `start'
from /usr/lib/ruby/1.9.1/net/http.rb:1284:in `request'
from /usr/lib/ruby/1.9.1/net/http.rb:1307:in `send_entity'
from /usr/lib/ruby/1.9.1/net/http.rb:1096:in `post'
from test.rb:17:in `<main>'
With Ruby 1.8.7 I get the correct output:
$ ruby test.rb
opening connection to secure.mmoagateway.com...
opened
<- "POST /api/transact.php HTTP/1.1\r\nAccept: */*\r\nContent-Type: application/x-www-form-urlencoded\r\nConnection: close\r\nContent-Length: 347\r\nHost: secure.mmoagateway.com\r\n\r\n"
<- "orderid=ae5dd847d9f31209cbffeeea076ed966&orderdescription=Active+Merchant+Remote+Test+Purchase&ccnumber=4111111111111111&ccexp=0913&cvv=123&company=Widgets+Inc&address1=1234+My+Street&address2=Apt+1&city=Ottawa&state=ON&zip=K1C2N6&country=CA&phone=%28555%29555-5555&firstname=&lastname=&email=&amount=1.00&type=auth&username=demo&password=password"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Wed, 04 Jul 2012 01:26:35 GMT\r\n"
-> "Server: Apache\r\n"
-> "Content-Length: 240\r\n"
-> "Connection: close\r\n"
-> "Content-Type: text/html\r\n"
-> "\r\n"
reading 240 bytes...
-> "response=1&responsetext=SUCCESS&authcode=123456&transactionid=1648894346&avsresponse=N&cvvresponse=N&orderid=ae5dd847d9f31209cbffeeea076ed966&type=auth&response_code=100&merchant_defined_field_6=&merchant_defined_field_7=&customer_vault_id="
read 240 bytes
Conn close
#<Net::HTTPOK:0xb74175c8>
response=1&responsetext=SUCCESS&authcode=123456&transactionid=1648894346&avsresponse=N&cvvresponse=N&orderid=ae5dd847d9f31209cbffeeea076ed966&type=auth&response_code=100&merchant_defined_field_6=&merchant_defined_field_7=&customer_vault_id=
I have the same issue in arch with 1.9.3 and 1.0.1.
If I install 1.0.0e from oneiric on my 12.04 system it also works fine with ruby 1.9.3
I think this may be related to ubuntu bug here: [https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/965371][1]
[1]: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/965371
Although I downloaded the packages from Debian where they said it was fixed and had no luck.
Has anyone else experienced a similar problem? | 0 | [
2,
8965,
18,
255,
2572,
29,
10811,
137,
9,
518,
9,
240,
800,
3726,
3726,
31,
589,
452,
21,
1922,
8,
29119,
1448,
29,
8965,
18,
255,
137,
9,
387,
9,
165,
2754,
10811,
137,
9,
518,
9,
240,
27,
287,
12968,
2473,
390,
9,
3277,
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... |
Java : Using parent class method to access child class variable
===
I have the following scenario :
public class A {
private int x = 5;
public void print()
{
System.out.println(x);
}
}
public class B extends A {
private int x = 10;
/*public void print()
{
System.out.println(x);
}*/
public static void main(String[] args) {
B b = new B();
b.print();
}
}
On executing the code, the output is : 5.
How to access the child class(B's) variable(x) via the parent class method?
Could this be done **without** overriding the print() method (i.e. uncommenting it in B)?
[This is important because on overriding we will have to rewrite the whole code for the print() method again] | 0 | [
2,
8247,
13,
45,
568,
4766,
718,
2109,
20,
1381,
850,
718,
7612,
800,
3726,
3726,
31,
57,
14,
249,
12705,
13,
45,
317,
718,
21,
13,
1,
932,
19,
38,
993,
800,
331,
73,
317,
11364,
4793,
5,
6,
13,
1,
329,
9,
1320,
9,
10299,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Support Vector Machine library for C#
===
Is there any Support Vector Machine library already implemented which I could use in my C# projects? | 0 | [
2,
555,
7497,
1940,
1248,
26,
272,
5910,
800,
3726,
3726,
25,
80,
186,
555,
7497,
1940,
1248,
614,
6807,
56,
31,
110,
275,
19,
51,
272,
5910,
2314,
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,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
ViewPager not loading items after using scrollto(x,y)
===
I`m using view pager, in previous question i asked about synchronizing two ViewPagers, i've done it with onPageChangeListener()
public void onPageScrolled(int arg0, float arg1, int arg2) {
mainscreenViewPager.scrollTo(arg0*screenWidth + arg2, 0);
}
Now i have 2 ViewPagers synchronized, but when i move the one by scrollTo, it does not load any views. | 0 | [
2,
1418,
6486,
139,
52,
12797,
3755,
75,
568,
12159,
262,
5,
396,
15,
93,
6,
800,
3726,
3726,
31,
1,
79,
568,
1418,
2478,
139,
15,
19,
1158,
1301,
31,
411,
88,
13,
16023,
3335,
81,
1418,
6486,
1224,
15,
31,
22,
195,
677,
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... |
Xcode IOS5 retrieve filemanes
===
I wish to retrieve all filenames from the root directory with the extension *.gs and store them in an array.
I tried using directoryContentsAtPath.. but it says that this method has been deprecated in ios5. Do you know any alternatives? | 0 | [
2,
993,
9375,
13,
7760,
264,
11917,
3893,
177,
160,
800,
3726,
3726,
31,
2536,
20,
11917,
65,
3893,
7259,
18,
37,
14,
5900,
16755,
29,
14,
3896,
1637,
9,
5447,
17,
1718,
105,
19,
40,
7718,
9,
31,
794,
568,
16755,
25424,
10833,
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... |
Improve the LINQ query returning indexes of items meeting a certain condition
===
I have this LINQ query which returns the indexes of all the items in an array whose time value (which is a `double`) meets a certain condition as in the below query.
var sonicIndices = completeLog.Select((item, index) => new { Item = item, Index = index })
.Where(x => Math.Abs(x.Item.time - nullValue) > 0.001)
.Select(item => item.Index).ToArray();
I am pretty sure that this can be improved but how? I am stumped. Can anyone help me in this? | 0 | [
2,
3545,
14,
6294,
1251,
25597,
2485,
4348,
160,
16,
3755,
1235,
21,
1200,
2874,
800,
3726,
3726,
31,
57,
48,
6294,
1251,
25597,
56,
4815,
14,
4348,
160,
16,
65,
14,
3755,
19,
40,
7718,
1196,
85,
1923,
13,
5,
2140,
25,
21,
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... |
google.visualization.LineChart format axis labels to M / K (M-bytes / K-bytes)
===
Can I foramt the axis labels to be with the M (Mega) or K (Kilo) suffix?
This is a problem as I don't have the values when I drow the graph.
Thanks.
| 0 | [
2,
8144,
9,
20893,
1829,
9,
1143,
5433,
38,
2595,
8577,
13173,
20,
307,
13,
118,
680,
13,
5,
79,
8,
23246,
18,
13,
118,
680,
8,
23246,
18,
6,
800,
3726,
3726,
92,
31,
26,
765,
38,
14,
8577,
13173,
20,
44,
29,
14,
307,
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... |
ViewPager with ContextMenu which is different for each view
===
I have a `ViewPagerActivity` with two views. I want to register a context menu, different for each view. I tried a few things (`registerForContextMenu()`) but I always ended up with both views behaving like the second one. Any ideas?
public class ViewPagerActivity extends UomeActivity {
private ViewPager viewPager;
private ViewPagerAdapter viewPagerAdapter;
private ListAdapter adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.view_pager);
refreshAdapter();
}
private class ViewPagerAdapter extends PagerAdapter {
private final List<Transaction> accountTransactions;
private final List<User> accountUsers;
public ViewPagerAdapter() {
// initialize lists
}
@Override
public Object instantiateItem(View collection, int viewPosition) {
View layout;
ListView listView;
switch (viewPosition) {
case 0:
layout = LayoutInflater.from(getApplicationContext()).inflate(
R.layout.list_account_paired_transactions, null);
List<PairedTransaction> pairedTransactions = getPairedTransactions();
adapter = new AccountPairedTransactionItemAdapter(ViewPagerActivity.this,
R.layout.list_account_paired_transactions, pairedTransactions);
listView = (ListView) layout.findViewById(android.R.id.list);
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
// do something
}
});
registerForContextMenu(listView);
break;
case 1:
layout = LayoutInflater.from(getApplicationContext()).inflate(
R.layout.list_account_transactions, null);
initViewPagerInfo(layout, R.string.paired_transactions,
R.string.all_account_transactions, R.string.empty, viewPosition);
adapter = new TransactionItemAdapter(ViewPagerActivity.this,
R.layout.list_account_transactions, accountTransactions,
new UserDaoImpl(
getApplicationContext()));
listView = (ListView) layout.findViewById(android.R.id.list);
registerForContextMenu(listView);
break;
default:
throw new IllegalArgumentException("Unsupported number of views.");
}
listView.setAdapter(adapter);
listView.setDivider(new ColorDrawable(R.color.list_separator));
listView.setDividerHeight(1);
listView.setBackgroundColor(Color.WHITE);
listView.setCacheColorHint(Color.WHITE);
((ViewPager) collection).addView(layout);
return layout;
}
// omitted
}
@Override
protected void onResume() {
refreshAdapter();
super.onResume();
}
private void refreshAdapter() {
viewPagerAdapter = new ViewPagerAdapter();
viewPager = findById(R.id.view_pager);
viewPager.setAdapter(viewPagerAdapter);
}
@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
menu.add(R.string.show_info);
}
@Override
public boolean onContextItemSelected(MenuItem item) {
// TODO: toast which object has been selected
}
} | 0 | [
2,
1418,
6486,
139,
29,
4141,
755,
291,
56,
25,
421,
26,
206,
1418,
800,
3726,
3726,
31,
57,
21,
13,
1,
4725,
6486,
139,
19348,
1,
29,
81,
4146,
9,
31,
259,
20,
2243,
21,
4141,
11379,
15,
421,
26,
206,
1418,
9,
31,
794,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Ajax request cross domain json data and display?
===
I have a function nid to call json data from other domain but i dun noe what is wrong with my page.It cannot go success function and find the json data return to me,and no any error return .
$.ajax({
url: "http://other-domain.com/sample/Json.aspx",
dataType: "jsonp",
type: 'get',
crossDomain: true,
jsonp: 'jsonp_callback',
success: function() {
alert('abc'); //when success take json data string but i din get in here
}
}); | 0 | [
2,
20624,
3772,
919,
4603,
487,
528,
1054,
17,
3042,
60,
800,
3726,
3726,
31,
57,
21,
1990,
1781,
43,
20,
645,
487,
528,
1054,
37,
89,
4603,
47,
31,
4731,
90,
62,
98,
25,
1389,
29,
51,
2478,
9,
242,
1967,
162,
1280,
1990,
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... |
Use CSS to automatically add 'required field' asterisk to form inputs
===
What is a good way to overcome the unfortunate fact that this code will not work as desired:
<div class="required">
<label>Name:</label>
<input type="text">
</div>
<style>
.required input:after { content:"*"; }
</style>
In a perfect world, all required `input`s would get the little asterisk indicating that the field is required. This solution impossible since the CSS is inserted after the element content, not after the element itself, but something like it would be ideal. On a site with thousands of required fields, I can move the asterisk in front of the input with one change to one line (`:after` to `:before`) or I can move it to the end of the label (`.required label:after`) or in front of the label, or to a position on the containing box, etc...
This is important not just in case I change my mind about where to place the asterisk everywhere, but also for odd cases where the form layout doesn't allow the asterisk in the standard position. It also plays well with validation that checks the form or highlights improperly completed controls.
Lastly, it doesn't add additional markup.
Are there any good solutions that have all or most of the advantages of the impossible code? | 0 | [
2,
275,
272,
18,
18,
20,
7499,
3547,
13,
22,
99,
3003,
2095,
575,
22,
28,
591,
20989,
20,
505,
6367,
18,
800,
3726,
3726,
98,
25,
21,
254,
161,
20,
9059,
14,
17362,
837,
30,
48,
1797,
129,
52,
170,
28,
9264,
45,
13,
1,
12916... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 return a sys_refcursor from oracle SP in java?
===
I have a stored procedure (SP) in oracle:
CREATE OR REPLACE
PROCEDURE "SP_SEL_LOGIN_INFO" (
p_username IN varchar2,
p_ResultSet OUT sys_refcursor
) AS
begin
OPEN p_ResultSet FOR
SELECT * FROM user_accounts
WHERE p_username = username;
end;
In my java class I have the following lines of code to call the SP:
currentCon = connectionpackage.ConnectionManager.getConnection(dbSource);
CallableStatement stmt = currentCon.prepareCall("{call SP_SEL_LOGIN_INFO(?, ?)}");
stmt.setString(1, username);
stmt.registerOutParameter(2, OracleTypes.CURSOR); //REF CURSOR
stmt.execute();
rs = stmt.getCursor(2);
That is what I have found online to call a SP and return a cursor. When I try to compile I get the following two errors:
`error: cannot find symbol stmt.registerOutParameter(2, OracleTypes.CURSOR);` AND `error: cannot find symbol rs = stmt.getCursor(2);` Where it says it cannot find OracleTypes and getCursor.
I tried importing `import oracle.jdbc.driver.*;` or `import oracle.jdbc.*;` and got the errors `error: package oracle.jdbc does not exist import oracle.jdbc.driver.*;` and `error: package oracle.jdbc does not exist import oracle.jdbc.*;` respectively.
I also have the ojdbc14.jar file in the proper folder and can connect using a query string. It is just when trying to use the SP that it is giving me trouble.
The SP is one we use on our current CF website, so I would like to just reuse it as is. Could someone please shed some light on why this may not be working? Or if there is an alternative bit of code to use to return a cursor from an Oracle SP? Thanks. | 0 | [
2,
184,
107,
31,
788,
21,
10315,
18,
1,
14057,
4734,
18,
248,
37,
15759,
3782,
19,
8247,
60,
800,
3726,
3726,
31,
57,
21,
8214,
7004,
13,
5,
3401,
6,
19,
15759,
45,
1600,
54,
3934,
7004,
13,
7,
3401,
1,
3434,
1,
5567,
108,
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... |
Aligning HTML Inputs
===
Im trying to align a number of inputs and select boxes within a single form.
ive tried various css styles to try to align them but everything seems to fail (??).
My html can be found here.
http://jsfiddle.net/felix001/kA8cd/3/
Does anyone known any easy methods for aligning these elements.
Thanks,
| 0 | [
2,
23389,
68,
13,
15895,
6367,
18,
800,
3726,
3726,
797,
749,
20,
23389,
21,
234,
16,
6367,
18,
17,
5407,
8120,
363,
21,
345,
505,
9,
5568,
794,
617,
272,
18,
18,
6443,
20,
1131,
20,
23389,
105,
47,
796,
2206,
20,
7476,
13,
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... |
JQuery Each Selector Ajax Call
===
I am trying to grab all the id's that are part_number and feed them 1 at a time into my ajax call:
The html for a single item looks like this:
<div class="item">
<p class="image"><a onmousedown="return SearchSpring.Catalog.intellisuggest(this, 'eJyzNCvJT8thcDRwNDG2NDTXNXR1MdI1sTR21bW0NDDQdXa1cDI2cTE0d3RxY2AwBENjAwZzMyOG9KLMFAC61g1R', 'd1f18f7e3b14f73ded97ff0a97db67a2eb19b128322804efbe2f46bd5fcd3c1f')" href="http://208.69.47.49/ProductSearch/ProductDetail.aspx?ID=KEL-AF24-SR"><img onerror="this.onerror=null;this.src='//d1qhbfo7yqnkif.cloudfront.net/ajax_search/img/missing-image-75x75.gif';" src="//208.69.47.49/Contents/Images/PART18_100PX.GIF"></a></p>
<p class="name"><a onmousedown="return SearchSpring.Catalog.intellisuggest(this, 'eJyzNCvJT8thcDRwNDG2NDTXNXR1MdI1sTR21bW0NDDQdXa1cDI2cTE0d3RxY2AwBENjAwZzMyOG9KLMFAC61g1R', 'd1f18f7e3b14f73ded97ff0a97db67a2eb19b128322804efbe2f46bd5fcd3c1f')" href="http://208.69.47.49/ProductSearch/ProductDetail.aspx?ID=KEL-AF24-SR">VM2327T23A00T</a></p>
<p class="price">$388.00</p>
<p id="part_number">VM2327T23A00T</p>
</div>
Here is my Jquery that is breaking on the .each line:
var parts = [];
var listPrices = [];
SearchSpring.jQuery('id').each(function () {
parts.push(SearchSpring.jQuery(this).attr('part_number'));
//listPrices.push(SearchSpring.jQuery(this).attr('list_price_baan'));
});
//skus = skus.join(',');
SearchSpring.jQuery.ajax(
{
type: "POST",
url: "RealTimePricing.aspx/GetCustomerPrice",
data: "{partNumber:' " + parts + "', listPrice: ' " + listPrices + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (data) {
for (var id in data) {
var prices = data[id]['prices'];
SearchSpring.jQuery('#' + id).text(prices);
}
}
}
);
| 0 | [
2,
487,
8190,
93,
206,
23946,
20624,
645,
800,
3726,
3726,
31,
589,
749,
20,
4931,
65,
14,
4924,
22,
18,
30,
50,
141,
1,
16299,
17,
4063,
105,
137,
35,
21,
85,
77,
51,
20624,
645,
45,
14,
13,
15895,
26,
21,
345,
9101,
1879,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Fatal error: Wrong parameters for Exception base_facebook.php on line 54
===
I am getting the following error inside my WordPress (v3.4) blog site with Facebook (v1.0.1) plugin installed:
Fatal error: Wrong parameters for Exception([string $exception [, long $code ]]) in /home/content/.../html/SavedByGraceNET/wp-content/plugins/facebook/includes/facebook-php-sdk/base_facebook.php on line 54
At first the errors were sporadic. Now, I get the error every time I attempt to update/publish my post(s). This has effectively brought my site down if I am no longer able to edit posts. Please help. | 0 | [
2,
8773,
7019,
45,
1389,
12905,
26,
5391,
1000,
1,
6413,
5199,
9,
26120,
27,
293,
5896,
800,
3726,
3726,
31,
589,
1017,
14,
249,
7019,
572,
51,
833,
5890,
13,
5,
710,
240,
9,
300,
6,
8146,
689,
29,
9090,
13,
5,
710,
165,
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... |
Moving get/set methods in another class
===
Is it possible to move the get set methods in another class ?
I'm using an options form which basically reflects all the changes directly in the main form (mostly for changing controls colors,fonts and so on.
The issue starts when you start modifying quite a lot of controls since the main class fills with get set methods, so I was wondering if it's possible to refactor the code to increase the readability of the class a bit, or even better, if it's possible to move the methods in another class somehow (partial classes ?)
Here's a small example of just two controls
public Font TreeFont
{
get { return customTreeView1.Font; }
set { customTreeView1.Font = value; }
}
public Font TextBoxFont
{
get { return customTextBox1.Font; }
set { customTextBox1.Font = value; }
}
public Font MenusFont
{
get { return menuStrip1.Font; }
set
{
menuStrip1.Font = value;
statusStrip1.Font = value;
contextMenuStripForSnippetContent.Font = value;
contextMenuStripTreeViewMenu.Font = value;
}
}
public Color TreeFontForeColor
{
get { return customTreeView1.ForeColor; }
set { customTreeView1.ForeColor = value; }
}
public Color TextBoxFontForeColor
{
get { return customTextBox1.ForeColor; }
set { customTextBox1.ForeColor = value; }
}
public Color TreeFontBackgroundColor
{
get { return customTreeView1.BackColor; }
set { customTreeView1.BackColor = value; }
}
public Color TextBoxFontBackgroundColor
{
get { return customTextBox1.BackColor; }
set { customTextBox1.BackColor = value; }
}
So as you can imagine since there are quite a lot of them that need to be changed the lines just pile up.
In addition, would it be a better practice to just return the control and just work on that instead on the other form or do get/set methods considered a better practice ?
Thanks in advance. | 0 | [
2,
1219,
164,
118,
3554,
3195,
19,
226,
718,
800,
3726,
3726,
25,
32,
938,
20,
780,
14,
164,
309,
3195,
19,
226,
718,
13,
60,
31,
22,
79,
568,
40,
6368,
505,
56,
11374,
11967,
65,
14,
1693,
1703,
19,
14,
407,
505,
13,
5,
183... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Facebook web application getting Acess Token
===
I am creating a web application using php. I have a closed group in facebook. When a user login to my application I am showing them a page. I want to stream data grom my facebook group and display in that page. Since this is a closed group I am not able to stream data from that using php SDK. I am using the following code.
This code workes if the group is public.
$facebook = new Facebook(array('appId' => FB_APP_ID, 'secret' => FB_SECRET_KEY, 'cookie' => true,));
return $facebook->api('/' . FB_GROUP_ID . '/feed');
I think that we have to pass access token with extended permission to get that data. But how to generate that token without user intevention ?
Any Ideas? | 0 | [
2,
9090,
2741,
3010,
1017,
21,
5052,
18,
20,
2853,
800,
3726,
3726,
31,
589,
2936,
21,
2741,
3010,
568,
13,
26120,
9,
31,
57,
21,
827,
214,
19,
9090,
9,
76,
21,
4155,
6738,
108,
20,
51,
3010,
31,
589,
3187,
105,
21,
2478,
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... |
Need Help in choosing an API(Example: GOOGLE API) to find the nearest locations from my current location in India
===
I am working on an Web App, if the user enters a given location(Ex: Street, Address, Country) it should bring all the retail locations which are nearer to the given location and the user should have the ability to click and view the map of the resulted retail locations and get the directions of the locations. I have done some research on Google Maps API, but i am not sure how efficient will Google Maps API will have the ability to provide Latitude and Longitude of any rural location in India.(The API should also work for Mobile devices(Android and Iphone etc.))
Is there any alternatives other than Google Maps API which will accomplish the above task.
Please suggest. | 0 | [
2,
376,
448,
19,
10883,
40,
21,
2159,
5,
29041,
45,
8144,
21,
2159,
6,
20,
477,
14,
6557,
4095,
37,
51,
866,
1474,
19,
739,
800,
3726,
3726,
31,
589,
638,
27,
40,
2741,
4865,
15,
100,
14,
4155,
8104,
21,
504,
1474,
5,
1706,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 issue in storing the values in sqlserver Db as a commasepeared values
===
Is there any issue in storing the values in sqlserver Db as a commasepeared values?
I have 100 catagories and for each catagory I have 500 products. My intial thinking is store the product codes in a comma seperated values so that only 100 records will come in table.
catagcd1 - prod1,prod2,prod3......
catagcd2 - prod2,prod3,prod5......
But when I ask my friend dont store it as a comma seperated store as a normal structure. That means.
catagcd1 - prod1
catagcd1 - prod2
catagcd1 - prod3
catagcd2 - prod2
----------------
----------------
What is the diffrence between mine and him.. and what is the difference wrt performanca point of view also.. can you pls expalin
Regards,
Abhi
| 0 | [
2,
25,
80,
186,
1513,
19,
25615,
14,
4070,
19,
4444,
255,
10321,
106,
13,
9007,
28,
21,
11951,
472,
3492,
21511,
4070,
800,
3726,
3726,
25,
80,
186,
1513,
19,
25615,
14,
4070,
19,
4444,
255,
10321,
106,
13,
9007,
28,
21,
11951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Parse all variables at function declaration instead of run-time
===
I want to attach an event coming from a string. The problem I am having is that the function names are not passing in as strings but rather being compiled when the function is called which is resulting in an undefined variable error (temp).
if(attributes._onClick) {
temp = attributes._onClick ;
var x = 0 ;
while(temp[x] != '') {
temp[x] = temp[x].replace(')','').split('(') ;//remove paranthesis and separate func name from args
temp[x][1] = temp[x][1].split(',') ;//turn string of args into array
func = function() { window[temp[x][0]].apply(el,[]) ; }
el.addEventListener('click',function(){
window[temp[x][0]].apply(el,[]) ; }
,false) ;
x++ ;
}
} | 0 | [
2,
2017,
870,
65,
12157,
35,
1990,
7098,
700,
16,
485,
8,
891,
800,
3726,
3726,
31,
259,
20,
19514,
40,
807,
880,
37,
21,
3724,
9,
14,
1448,
31,
589,
452,
25,
30,
14,
1990,
1817,
50,
52,
2848,
19,
28,
7887,
47,
864,
142,
931... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Hibernate - StalestateException when saving entity in database having Complex Relations
===
I have a problem that I have been struggling a lot.
The hibernate entity I am saving in databease (Oracle) has very complex (in the sense that it has many related entities) relations. It looks something like this...
`@Table(name = "t_HOP_CommonContract")`
`public class Contract {`
`@Id`
`private ContractPK id;`
`@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)`
`@PrimaryKeyJoinColumn`
`private ContractGroupMember contractGroupMember;`
`@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)`
`@JoinColumns( { @JoinColumn(name = "TransactionId", referencedColumnName = "TransactionId"),@JoinColumn(name = "PrimaryContractId", referencedColumnName = "PrimaryContractId") })`
`@Fetch(FetchMode.SUBSELECT)`
`private List<ContractLink> contractLinks;`
`. . . . . . . `
`//A couple of more one to may relationships`
`//Entity getters etc.`
}`
I also have a couple of more entities such as...
`@Table(name = "t_HOP_TRS")`
`public class TotalReturnSwap {`
`@Id`
`private ContractPK id;`
`//Entity Getters etc.
`}`
The trick is that I have to do persistence of Contract and TotalReturnSwap entities in the same transaction.
Sometimes it could be a bunch of entities that have to be persisted in same transaction.
I have noticed following exception when I save TotalReturnSwap entity... (and this is always done after I have saved Contract entity).
Now a few points that may help while answering questions:
- I am only saving (inserting) entities in database - never updating/ deleting/ reading
- I have been able to isolate this exception even in single threaded environment - so it does not look like multi- threading issue [our application is multi-threaded]
`org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:675) at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:793) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:664) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147) at com.rbs.fcg.publishing.DownstreamContractBusinessEventPostingService.performTDWPersistenceForContracts(DownstreamContractBusinessEventPostingService.java:102) at com.rbs.fcg.publishing.DownstreamContractBusinessEventPostingService.persistContractBusinessEvent(DownstreamContractBusinessEventPostingService.java:87)
at com.rbs.fcg.publishing.DownstreamContractBusinessEventPostingService.publish(DownstreamContractBusinessEventPostingService.java:67)
at com.rbs.fcg.publishing.PublishingProcessor.publish(PublishingProcessor.java:76)
at com.rbs.fcg.publishing.PublishingProcessor.process(PublishingProcessor.java:52)
at com.rbs.are.MultiThreadedQueueItemProcessor$2.run(MultiThreadedQueueItemProcessor.java:106)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:85)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70)`
Quick help will be appreciated - we are on critical path and this issue is absolutely important. | 0 | [
2,
4148,
2102,
8820,
13,
8,
13,
18,
10481,
3859,
10066,
872,
76,
7599,
9252,
19,
6018,
452,
1502,
2649,
800,
3726,
3726,
31,
57,
21,
1448,
30,
31,
57,
74,
7587,
21,
865,
9,
14,
4148,
2102,
8820,
9252,
31,
589,
7599,
19,
1054,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Delayed function calls in ruby or rails
===
I'm coding a poker variant game, and need either ruby or rails to run one big loop to keep the game automated. Ie:
- check every 10 seconds or so that there are enough players in the game;
- when there are, deal the cards, then count down ~45 seconds, upon which showdown will happen;
- in my poker variant there are 3 consecutive showdowns - therefore each showdown needs to happen slowly so the players know what's going on: ie 5 seconds to show down the first portion of the hand and declare the winner of that showdown, 5 seconds for the second and 5 seconds the third
- pause a few seconds after the hand
- start loop from the top again
I've had a quick look at delayed_job and resque, but they look quite complicated for what I'm trying to do. I've also considered using a javascript/jquery loop to push the server along the loop, but that seems inelegant, seeing as each of the potentially numerous players on a table will be seeking to push the loop along, rather than the server doing it centrally.
Am I missing a fairly simple function, or is it time to look deeper into delayed_job? | 0 | [
2,
8241,
1990,
3029,
19,
10811,
54,
2240,
18,
800,
3726,
3726,
31,
22,
79,
13,
15458,
21,
12453,
8320,
250,
15,
17,
376,
694,
10811,
54,
2240,
18,
20,
485,
53,
580,
5293,
20,
643,
14,
250,
14904,
9,
13,
660,
45,
13,
8,
2631,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Codeigniter 2.1.2 + Sparks + HMVC installation problems
===
While installing sparks with HMVC extension i get an error message
Fatal error: Call to undefined method User::all() in E:\wamp\www\cisparks\application\modules\User\Controllers\user.php on line 15
Here's my controller code.........
<?php if(! defined('BASEPATH')) exit('No direct script access allowed');
class User extends MX_Controller
{
public function __construct()
{
parent::__construct();
$this->load->spark('php-activerecord/0.0.2');
}
public function index()
{
$user = User::all();
echo "<pre>";
print_r($user);
}
}
Here's my Model code.........
<?php if(! defined('BASEPATH')) exit('No direct script access allowed');
class User extends ActiveRecord\Model
{
}
Please help me i dont know how to solve this problem
| 0 | [
2,
1797,
9693,
242,
106,
172,
9,
165,
9,
135,
2754,
14296,
2754,
13,
7015,
8990,
7758,
1716,
800,
3726,
3726,
133,
25429,
14296,
29,
13,
7015,
8990,
3896,
31,
164,
40,
7019,
2802,
8773,
7019,
45,
645,
20,
367,
13439,
2109,
4155,
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... |
get wrapping element using preg_match php
===
I want a preg_match code that will detect a given string and get its wrapping element.
I have a string and a html code like:
$string = "My text";
$html = "<div><p class='text'>My text</p><span>My text</span></div>";
So i need to create a function that will return the element wrapping the string like:
$element = get_wrapper($string, $html);
function get_wrapper($str, $code){
//code here that has preg_match and return the wrapper element
}
The returned value will be array since it has 2 possible returning values which are `<p class='text'></p>` and `<span></span>`
Thanks! Answers are greatly appreciated. | 0 | [
2,
164,
13437,
4520,
568,
782,
263,
1,
12280,
13,
26120,
800,
3726,
3726,
31,
259,
21,
782,
263,
1,
12280,
1797,
30,
129,
9092,
21,
504,
3724,
17,
164,
82,
13437,
4520,
9,
31,
57,
21,
3724,
17,
21,
13,
15895,
1797,
101,
45,
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... |
Arithmatic on freed pointer
===
While reading the answers to [this SO question](http://stackoverflow.com/questions/11732862/memory-allocated-without-allocation-using-malloc-how), I learned that out-of-bounds pointer arithmatic is undefined. Indeed, according to C99 6.5.6 paragraph 8
> If both the
pointer operand and the result point to elements of the same
array object, or one past the last element of the array
object, the evaluation shall not produce an overflow;
otherwise, the behavior is undefined.
Does freeing that object invalidate that guarantee? 7.20.3.2 "The Free Function" Doesn't seem to mention it, simply mentioning that "the space is deallocated". Since 6.5.6 specifically mentions overflow, it seems like an integer overflow issue, which free wouldn't affect. Is arithmatic on a pointer to an object an act of "referring to it"?
In other words, is:
char *foo = malloc(10);
free(foo);
foo++;
Undefined? Or is the usage of "overflow" a different one? | 0 | [
2,
9647,
96,
6732,
27,
9292,
454,
106,
800,
3726,
3726,
133,
1876,
14,
6709,
20,
636,
1565,
86,
1301,
500,
5,
21127,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
11698,
17170,
24046,
9298,
790,
5171,
93,
8,
192,
18215,
8,
1450... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.