unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Where claus in Dynamic TSQL and prevent SQL Injection
===
I have a stored procedure for selecting rows.i want to pass a parameter to filtering rows dynamically like this :
<!-- language: lang-sql-->
Create Procedure CustomerSelectAll
@FilterExpresion NVARCHAR(MAX)
DECLARE @CMD NVARCHAR(MAX)
SET @CMD = N'SELECT * FROM dbo.Customers '+@FilterExpresion;
EXEC(@CMD)
GO
The above code works fine, but it is potential for SQL injection,
i want to be able pass multiple column whit any where statement shuch as :
exec CustomerSelectAll
@FilterExpresion = N' where Name = 'abc' and family = ''xyz'''
| 0 | [
2,
113,
17831,
19,
7782,
13,
38,
18,
22402,
17,
2501,
4444,
255,
13646,
800,
3726,
3726,
31,
57,
21,
8214,
7004,
26,
20764,
11295,
9,
49,
259,
20,
1477,
21,
18906,
20,
25272,
11295,
7782,
1326,
101,
48,
13,
45,
13,
1,
187,
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... |
Android ListView - Refresh and sort?
===
I am doing this:
items.add(NewItem);
adapter.notifyDataSetChanged();
My List is in Alphabetical order. When I add an item, it simply puts it at the bottom. Any way to put it in the proper place?
(Yes it will be in proper order the second time you come back to this page, but not on adding it)
Edit: I am first putting it in order through a SQL script call. | 0 | [
2,
13005,
968,
4725,
13,
8,
24905,
17,
2058,
60,
800,
3726,
3726,
31,
589,
845,
48,
45,
3755,
9,
14854,
5,
2681,
2119,
79,
6,
73,
9924,
106,
9,
1270,
8612,
18768,
3554,
16229,
43,
5,
6,
73,
51,
968,
25,
19,
27169,
389,
9,
76... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Trying to display Hello World character on android phone using native code
===
using stdout library it will maybe pass data to logcat or somewhere else which is not heading toward to display screen.
How can I manage to display what I want using native code with out passing dalvik...T_T
| 0 | [
2,
749,
20,
3042,
10975,
126,
925,
27,
13005,
1132,
568,
1275,
1797,
800,
3726,
3726,
568,
354,
43,
1320,
1248,
32,
129,
913,
1477,
1054,
20,
6738,
5782,
54,
3493,
962,
56,
25,
52,
4582,
729,
20,
3042,
2324,
9,
184,
92,
31,
4705... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Type inference creating undesired constraint
===
Since I have a ton of `IDisposable`s that I need to take care of a while down the line, I set up a list of disposables and a pass-through function to add items to it as a side effect:
let mutable disposables = []
let (~-) (x:'a) = disposables <- x :: disposables; x
So that I could hopefully do this:
let thing1 = -new Form()
let thing2 = -new Control()
for i in disposables do i.Dispose()
The problem is that F# automatically constrains `'a` to `IDisposable`, with the warning message:
> This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type 'IDisposable'.
So then the return type of `operator ~-` becomes IDisposable, which defeats the convenience of the function.
Is there a way to prevent F# from creating this constraint? | 0 | [
2,
1001,
25883,
2936,
13,
12239,
9982,
69,
28804,
800,
3726,
3726,
179,
31,
57,
21,
13,
444,
16,
13,
1,
19405,
12551,
579,
1,
18,
30,
31,
376,
20,
247,
781,
16,
21,
133,
125,
14,
293,
15,
31,
309,
71,
21,
968,
16,
29854,
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... |
belongs_to won't associate records even with the correct Id stored
===
When a User is created a Team is created and the User is set as the owner of that team and also set as a member of that team.
A User can be a member of many Teams and Teams can have many members.
Each User can own only one team and a Team can have only owner.
now I'm getting some strange behavior, that I can figure out
1.9.3p194 :001 > user = User.first
User Load (0.1ms) SELECT "users".* FROM "users" LIMIT 1
=> #<User id: 1, email: "test@example.com", encrypted_password: "$2a$10$KhQ7z3Qb6QXdsBA/MmPLuecrbIV4cGEaMGhIepLjuzla...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 1, current_sign_in_at: "2012-07-28 01:33:31", last_sign_in_at: "2012-07-28 01:33:31", current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1", created_at: "2012-07-28 01:33:31", updated_at: "2012-07-28 01:33:31">
1.9.3p194 :002 > user.teams
Team Load (0.1ms) SELECT "teams".* FROM "teams" INNER JOIN "teams_users" ON "teams"."id" = "teams_users"."team_id" WHERE "teams_users"."user_id" = 1
=> [#<Team id: 1, name: "username", dept_no: nil, created_at: "2012-07-28 01:33:31", updated_at: "2012-07-28 01:33:31", user_id: 1>]
1.9.3p194 :003 > user.owned_team
Team Load (0.2ms) SELECT "teams".* FROM "teams" WHERE "teams"."user_id" = 1 LIMIT 1
=> #<Team id: 1, name: "username", dept_no: nil, created_at: "2012-07-28 01:33:31", updated_at: "2012-07-28 01:33:31", user_id: 1>
Up to this point it all works as expected, but when I try to access the association form the other end, the connection isn't made.
See below I have pulled out the same team record as user.owned_team and user team.owner it returns nil
1.9.3p194 :004 > team = Team.first
Team Load (0.1ms) SELECT "teams".* FROM "teams" LIMIT 1
=> #<Team id: 1, name: "username", dept_no: nil, created_at: "2012-07-28 01:33:31", updated_at: "2012-07-28 01:33:31", user_id: 1>
1.9.3p194 :005 > team.owner
=> nil
1.9.3p194 :006 > user.owned_team == team.owner
=> false
1.9.3p194 :007 >
User.rb
class User < ActiveRecord::Base
has_and_belongs_to_many :teams
has_one :owned_team, :class_name => "Team"
after_create :set_user_on_team
private
def set_user_on_team
self.owned_team = self.teams.create(:name => 'username' )
end
end
Team.rb
class Team < ActiveRecord::Base
attr_accessible :name
has_and_belongs_to_many :users
belongs_to :owner, :class_name => "User"
end
| 0 | [
2,
7034,
1,
262,
230,
22,
38,
4169,
742,
166,
29,
14,
4456,
4924,
8214,
800,
3726,
3726,
76,
21,
4155,
25,
679,
21,
173,
25,
679,
17,
14,
4155,
25,
309,
28,
14,
2410,
16,
30,
173,
17,
67,
309,
28,
21,
322,
16,
30,
173,
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... |
firefox extension to record http request urls for each tab
===
I'm trying to develop a firefox extension to record all resource loading urls for each browser tab/window. I searched for hours but couldn't find a way to associate each intercepted http request to its originating tab. Here is what I have so far.
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.addObserver({
observe: function(aSubject, aTopic, aData) {
if ("http-on-modify-request" == aTopic) {
var url = aSubject
.QueryInterface(Components.interfaces.nsIHttpChannel)
.originalURI.spec;
alert(url);
}
}
}, "http-on-modify-request", false);
I can get the url of the http request, but I don't know there is way to link it to a browser window/tab.
I read through MDN's documentation but it didn't mention it. (https://developer.mozilla.org/en/XUL_School/Intercepting_Page_Loads)
Any suggestions? | 0 | [
2,
535,
18219,
3896,
20,
571,
7775,
3772,
13,
911,
7532,
26,
206,
6523,
800,
3726,
3726,
31,
22,
79,
749,
20,
2803,
21,
535,
18219,
3896,
20,
571,
65,
6577,
12797,
13,
911,
7532,
26,
206,
16495,
6523,
118,
27508,
9,
31,
9036,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 find a Date from a List of Dates
===
I am looking for a better way of finding a date from a List (ArrayList, which is returned to me). The scenario is, I am returned a List of dates, and I would like to find out if a date I have on hand is within the List od Dates I was returned.
Currently what I am doing is looping the List and using JodaTime to compare the dates. | 0 | [
2,
8247,
477,
21,
1231,
37,
21,
968,
16,
4076,
800,
3726,
3726,
31,
589,
699,
26,
21,
574,
161,
16,
3007,
21,
1231,
37,
21,
968,
13,
5,
8576,
93,
5739,
15,
56,
25,
587,
20,
55,
6,
9,
14,
12705,
25,
15,
31,
589,
587,
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... |
glLoadIdentity and glPushMatrix/glPopMatrix, why not just use the former?
===
I am very new to OpenGL. When applying transformations to objects we use glPushMatrix/glPopMatrix, ok understood. But why don't we use glLoadIdentity only instead?
Thus
glPushMatrix()
..apply tranformations
...draw object
glPopMatrix()
glPushMatrix()
..apply tranformations
...draw object
glPopMatrix()
This is how its supposed to be done right?
can become
glLoadIdentity()
..apply tranformations
...draw object
glLoadIdentity()
..apply tranformations
...draw object
| 0 | [
2,
13,
8430,
8294,
13384,
856,
17,
13,
8430,
26973,
540,
17224,
118,
8430,
6057,
540,
17224,
15,
483,
52,
114,
275,
14,
336,
60,
800,
3726,
3726,
31,
589,
253,
78,
20,
368,
8430,
9,
76,
11989,
6978,
18,
20,
3916,
95,
275,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
XMLHttpRequest in chrome/firefox/IE
===
In order to show XML response from a REST web service (in this case eventful), I provided following code. However the problem is that the XML response does not show in Chrome/Firefox.
function searchEventful(){
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "http://api.eventful.com/rest/events/search?app_key=dNfXvzSRCSQz2rcp&where=62.40545,17.33865&within=25",false);
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.send();
var xx = xmlhttp.responseXML;
var i = xx.getElementsByTagName("page_size")[0].childNodes[0].nodeValue;
for(x=0;x<i;x++){
document.write(xx.getElementsByTagName("title")[x].childNodes[0].nodeValue + "<br />");
document.write(xx.getElementsByTagName("venue_name")[x].childNodes[0].nodeValue+ "<br />");
document.write(xx.getElementsByTagName("venue_id")[x].childNodes[0].nodeValue+ "<br />");
document.write(xx.getElementsByTagName("url")[x].childNodes[0].nodeValue+ "<br />");
document.write(xx.getElementsByTagName("city_name")[x].childNodes[0].nodeValue+ "<br />");
document.write(xx.getElementsByTagName("region_name")[x].childNodes[0].nodeValue+ "<br />");
document.write(x + " -------------------<br />");
}
I searched a lot and I came up with the following solution in order to get result. However, it's not possible to get XML response from the provided URL with the following method. Can anyone let me know where is the source of problem. Firefox and Chrome show "Invocation Errors Occurred" and IE does make any alert at all.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head>
<title></title>
</head>
<body>
<script>
var invocation = getHTTPObject();
var url = 'http://api.eventful.com/rest/events/search?app_key=dNfXvzSRCSQz2rcp&where=62.40545,17.33865&within=25';
var invocationHistoryText;
function getHTTPObject() {
if (typeof XMLHttpRequest != 'undefined') {
return new XMLHttpRequest();
}
try {
return new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
return false;
}
function callOtherDomain(){
if(invocation)
{
invocation.open('GET', url, true);
invocation.onreadystatechange = handler;
invocation.setRequestHeader('Access-Control-Allow-Origin', '*');
invocation.send();
} else {
invocationHistoryText = "No Invocation TookPlace At All";
var textNode = document.createTextNode(invocationHistoryText);
var textDiv = document.getElementById("textDiv");
textDiv.appendChild(textNode);
}
}
function handler(evtXHR)
{
if (invocation.readyState == 4)
{
if (invocation.status == 200)
{
var response = invocation.responseXML;
var invocationHistory = response.getElementsByTagName('invocationHistory').item(0).firstChild.data;
invocationHistoryText = document.createTextNode(invocationHistory);
var textDiv = document.getElementById("textDiv");
textDiv.appendChild(invocationHistoryText);
} else
alert("Invocation Errors Occurred -- " + invocation.readyState + " -- " + invocation.status + " -- " + invocation.responseText);
} else
dump("currently the application is at" + invocation.readyState);
}
</script>
<input type='button' onclick='callOtherDomain()' value='Search Eventful'/>
<div id="textDiv">Text</div>
</body>
</html>
| 0 | [
2,
23504,
21127,
99,
10351,
19,
13,
12985,
118,
5929,
18219,
118,
660,
800,
3726,
3726,
19,
389,
20,
298,
23504,
1627,
37,
21,
760,
2741,
365,
13,
5,
108,
48,
610,
807,
1566,
6,
15,
31,
1173,
249,
1797,
9,
207,
14,
1448,
25,
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... |
Rendering Obj Groups in OpenGL ES
===
I am new to OpenGL ES, and I'm writing an iPad app that requires me to load a Wavefront Obj file, draw them in OpenGL. My question is about the most efficient way to render the Obj file groups.
A little background on what I have. All the parsing/loading of the Obj model is working (I used GLM to load the file), so the tedious stuff is out of the way. For the base project, I've expanded off the OpenGL ES game template in XCode, and removed all the calls into the shaders. I'm using GLKit's BaseEffect for my shaders, and loading all my vertex data using VAO and VBO. For a model with say 16 groups, at init time I'm separating each group into a VAO, with each VAO having a VBO for vertex data and normals (interleaved), and a second VBO for Texture coordinates. Each group has a material (and sometimes a texture, but for the sake of the question assume only materials).
In my rendering routine (pseudo code below), I am looping through all the VAO's I created for each group, applying the material for the group to the BaseEffect, and then drawing it using DrawArrays (not using DrawElements because I've set the VBO's up so the data is already in indexed order, although it's probably not as efficient as it could be on graphics memory). This works, and I'm able to draw each model with different materials, but as the group count goes up, my framerate goes down, as I have to spend more time looping through each group in my render function. For a low model count this is fine, but as I'm adding more models to the app, the frame rate gets well below 30fps, which is my baseline.
for (groups in model)
{
Bind VAO for this group
Apply Material or Texture (if one exists) for this group using GLKBaseEffect
Call PrepareToDraw for GLKBaseEffect
DrawArrays passing it the vertex count for this group
glBindVertexArray(0)
}
The obvious answer is to simplify the model so that there are less groups, but I am curious if there are any improvements to the rendering routine that could allow me to do the same thing but less Draw calls. I'd like to still have a detailed obj file, but also have the most efficient rendering I can.
Is this the best method for drawing an obj file where I have to use multiple materials/textures for each group in the file, or is there a way this can be done without looping through each group and drawing them individually? I'd love to be able to have each obj model have only 1 call into DrawArrays/DrawElements, but I don't see how this can be done and still apply multiple materials/textures to the object. I keep looking at this code and thinking "there has to be a better way", however I'm not sure what that is. If I'm missing a blatantly obvious piece of the puzzle, or if you have any suggestions you can provide to optimize this I would be forever grateful. | 0 | [
2,
15307,
5122,
728,
1170,
19,
368,
8430,
13,
160,
800,
3726,
3726,
31,
589,
78,
20,
368,
8430,
13,
160,
15,
17,
31,
22,
79,
1174,
40,
31,
8240,
4865,
30,
4781,
55,
20,
6305,
21,
2367,
8068,
5122,
728,
3893,
15,
2003,
105,
19,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I get Eclipse to recognize "inline declarations"?
===
I put "inline declarations" in quotes in the title because part of my problem is I don't know what to call this. I'm very new to Java and to programming in general, so the phrase "inline declarations" is the closest I can come to describing what I'm talking about to Google or other search engines, and I haven't found any answers. For all I know, it isn't a "declaration" at all (though I think it is, since I looked up the difference between declaration, instantiation, and initialization). Hopefully, I'll have better luck actually explaining what I mean here.
What I mean is this: If I declare an object in Java, and then initialize it separately, like this:
BufferedImage buffImg;
buffImg = ImageIO.read("MyImage.jpg");
Then Eclipse will turn the object name (buffImg in this case) a special color, add it to the Outline, and generally treat it like an object. It can do the same thing with keywords, strings, comments... you get the idea.
But if I do an "inline declaration", where I declare, instantiate, and initialize the object all on one line, like this:
BufferedImage buffImg = ImageIO.read("MyImage.jpg");
Then Eclipse doesn't turn it that special color, doesn't add it to the Outline, and generally treats it like any random, unspecial word, with one exception: code highlighting will still pick out all the instances of that word throughout the code.
My questions, then, are:
1. What do you call this sort of "all-on-one-line" declaration, so that I know what words to put in Google in the future?
2. How do I get Eclipse to recognize it?
Thank you! | 0 | [
2,
184,
107,
31,
164,
11652,
20,
5844,
13,
7,
108,
1143,
7098,
18,
7,
60,
800,
3726,
3726,
31,
442,
13,
7,
108,
1143,
7098,
18,
7,
19,
18901,
19,
14,
581,
185,
141,
16,
51,
1448,
25,
31,
221,
22,
38,
143,
98,
20,
645,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why it won't display process name?
===
What's wrong? Why do i get 0x0000etc on output? (your question cannot be submitted because blabalbalablablabalbalbalbalbalbalablabblaba)
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if( !hSnapshot )
return -1;
PROCESSENTRY32W pe32w;
memset( &pe32w, 0, sizeof( pe32w ) );
pe32w.dwSize = sizeof( PROCESSENTRY32W );
Process32First( hSnapshot, &pe32w );
do
{
std::cout << pe32w.szExeFile << std::endl;
} while( Process32Next( hSnapshot, &pe32w ) );
CloseHandle( hSnapshot );
return 0;
} | 0 | [
2,
483,
32,
230,
22,
38,
3042,
953,
204,
60,
800,
3726,
3726,
98,
22,
18,
1389,
60,
483,
107,
31,
164,
713,
396,
21903,
1198,
150,
27,
5196,
60,
13,
5,
4314,
1301,
1967,
44,
7368,
185,
4768,
3817,
15537,
10754,
10754,
3817,
3817... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PHP DOMDocument without the DTD, head, and body tags?
===
Is it possible to use the DOMDocument class and not allow it to add doc type declarations, head, and body tags? I am writing my current bit of code for a server side include, and it is being rendered on an already well formed page. I don't need additional tags. | 0 | [
2,
13,
26120,
11859,
28132,
366,
14,
13,
43,
38,
43,
15,
157,
15,
17,
358,
3383,
18,
60,
800,
3726,
3726,
25,
32,
938,
20,
275,
14,
11859,
28132,
718,
17,
52,
1655,
32,
20,
3547,
9765,
1001,
7098,
18,
15,
157,
15,
17,
358,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I get the full local path of a file uploaded with $_FILES
===
I am uploaded a file through the file input. If I print_r($_FILES), I can get several pieces of info, but it doesn't give me the full LOCAL path of the file (the path on my computer, not the server). How do I get this?
I need this to use the FTP library in CodeIgniter. Documentation is [here][1] on how to use it to upload a file.
[1]: http://codeigniter.com/user_guide/libraries/ftp.html
As you can see, it requires the full local path, although I'm not sure why. | 0 | [
2,
184,
107,
31,
164,
14,
503,
375,
2013,
16,
21,
3893,
23782,
29,
5579,
1,
16877,
18,
800,
3726,
3726,
31,
589,
23782,
21,
3893,
120,
14,
3893,
6367,
9,
100,
31,
4793,
1,
139,
5,
4403,
1,
16877,
18,
6,
15,
31,
92,
164,
238,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Find local groups that a domain user belongs to?
===
I'm using the System.DirectoryServices.AccountManagement namespace to find domain users and their corresponding AD security groups. This works well.
I'm also using that namespace to query the local security groups on a remote server. I am able to find a security group and then list the users of that group no problem.
What I'm having issues with is displaying which LOCAL groups a DOMAIN user belongs to:
PrincipalContext localmachine = new PrincipalContext(ContextType.Machine, "ServerName");
PrincipalContext domain = new PrincipalContext(ContextType.Domain);
// find the user using the domain context (Works fine)
UserPrincipal user = UserPrincipal.FindByIdentity(domain, userName);
// if found - grab its groups
if (user != null)
{
// The get groups method is the only method that would accept a new context
PrincipalSearchResult<Principal> groups = user.GetGroups(localMachine);
// no groups are returned .... removed rest of code
}
I'm attempting to use the GetGroups method passing in the localMachine PrincipalContext but no groups are returned.
The users exists only in the Domain AD. There is not an entry for this user in the local users on the localMachine. The domain users are added to local security groups.
Any ideas? I'd like to be able to pull a list of all local groups this domain user belongs to and then see if a certain groups exists in that list. The only option that is working now is for me to search certain groups on the system and see if the domain user belongs to that group. | 0 | [
2,
477,
375,
1170,
30,
21,
4603,
4155,
7034,
20,
60,
800,
3726,
3726,
31,
22,
79,
568,
14,
329,
9,
10197,
93,
11449,
18,
9,
29148,
23502,
204,
5582,
20,
477,
4603,
3878,
17,
66,
7265,
21,
43,
1221,
1170,
9,
48,
693,
134,
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... |
Variable in Variable (?)- php loop
===
I'm relatively knew to php loops, been learning them and they sure do make my life easier. However, I came across a bit of a struggle when trying to create a new variable for the php loop.
Background:
I declared 21 variables such as
$q1W = 5;
$q2W = 10;
$q3W = 2;
Then I grabbed the $_GET (q1,q2,q3) variables and put them into variables with their values
foreach($_GET as $qinput => $value) {
$$qinput = $value ;
}
Now essentially I want to turn this code:
$q1final = $q1 * $q1W;
$q2final = $q2 * $q2W;
$q3final = $q3 * $q3W;
Into a loop so I dont need to type out that all the way to 21. This is what I have thus far:
<?php for ($i=1; $i<=21; $i++) {
$q.$i.final = $q.$i * $q.$i.W
}
What am I missing?
| 0 | [
2,
7612,
19,
7612,
13,
5,
60,
6,
8,
13,
26120,
5293,
800,
3726,
3726,
31,
22,
79,
3109,
404,
20,
13,
26120,
19661,
15,
74,
2477,
105,
17,
59,
562,
107,
233,
51,
201,
4950,
9,
207,
15,
31,
281,
464,
21,
1142,
16,
21,
4697,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Loading two pages instead of 1 and how about the loading image?
===
I've made a script to load products when an user hits the bottom of the screen. Everything works fine instead of two things:
A) the script loads two pages at once instead of 1
B) I really can't get a "loading" div to show up beneath the products or centered in the screen (preferable beneath the products)
I've been working to long on this, so I can't really see what is going wrong.
Any help more then welcome.
Script
<script type="text/javascript">
var currentPage = {{ collection.page }};
var collectionPages = {{ collection.pages }};
var category = '{{ collection.internal.url }}';
var appendProduct = function(product) {
$('<div class="product"></div>')
.html(product)
.appendTo($(".productsGrid"));
var i = 1;
$('.product').each(function() {
if(i++ % 3 == 0)
$(this).addClass('last');
});
};
var loadProducts = function() {
var url = "http://meules1.webshopapp.com/"+category+"/page"+currentPage+".ajax";
$.getJSON(url,function(data) {
$.each(data.products, function(index, product) {
var imageUrl = product.image.replace('50x50x2', '180x150x2');
var itemHtml = '' +
'<a href="' + product.url + '" title="'+ product.fulltitle +'"><img src="'+imageUrl+'" width="180" height="150" alt="'+product.fulltitle+'" title="'+product.fulltitle+'"'+'</a>' +
'<div class="info">' +
'<h3>' + '<a href="' + product.url + '" title="'+ product.fulltitle +'">' + product.fulltitle + '</a>' + '</h3>' +
'<div class="price">' + product.price.price_money + '';
if(product.price.price_old){
itemHtml = itemHtml + ' <span>' + '<del>' + product.price.price_old_money + '</del>' + '</span>';
}
itemHtml = itemHtml +
'</div>' + // price
'<div class="gridAddToCart">' +
'<a class="button grey" href="'+product.url+'" title="'+product.fulltitle+'" rel="nofollow">'+'<span>Details</span></a>' +
'<div style="margin-top:2px;"></div>' +
'<a class="opener button blue" href="http://meules1.webshopapp.com/cart/add/'+product.vid+'" title="'+product.fulltitle+'" rel="nofollow"><span>In winkelwagen</span></a>'
itemHtml = itemHtml +
'</div>' + // gridAddToCart
'</div>' + // info
'<div class="clear"></div>' +
'</div>';
appendProduct(itemHtml)
});
$("#overlay").fadeOut();
$(window).scroll(function() { update(); });
});
};
loadProducts();
var update = function() {
if($(window).height() + $(window).scrollTop() >= $(document).height() - 350) {
if(currentPage < collectionPages) {
currentPage++;
$("#overlay").fadeIn();
$(window).unbind('scroll');
loadProducts();
}
}
};
$(window).scroll(function() { update(); } );
</script>
My HTML:
<div class="productsGrid"></div>
<div id="overlay">
<img src="https://shop.com/ajax-loader.gif?1" />
</div>
My CSS:
#overlay {
width: 100%;
height: 100%;
top: 0px;
left: 0px;
position: fixed;
display: block;
opacity: 0.7;
background-color: #fff;
z-index: 99;
text-align: center;
}
#overlay img {
position: absolute;
top: 100px;
left: 240px;
z-index: 100;
}
#content .productsGrid {
float: left;
width: 558px;
}
| 0 | [
2,
12797,
81,
4434,
700,
16,
137,
17,
184,
88,
14,
12797,
1961,
60,
800,
3726,
3726,
31,
22,
195,
117,
21,
3884,
20,
6305,
1985,
76,
40,
4155,
3858,
14,
2129,
16,
14,
2324,
9,
796,
693,
1123,
700,
16,
81,
564,
45,
21,
6,
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... |
jquery tabs not working inside dialog as partial view
===
I am opening a dialog with the following:
This is my Appliation Details.cshmtl
<script type="text/javascript">
$.ajaxSetup({ cache: false });
$(document).ready(function () {
$(".display tr:odd").addClass("odd");
$(".display tr:even").addClass("even");
//modal popup
$("#dialog-confirm").dialog({
autoOpen: false,
resizable: false,
height: 200,
width: 400,
modal: true,
buttons: {
"Delete": function () {
$(this).dialog("close");
$('#deleteApplication').submit();
},
Cancel: function () {
$(this).dialog("close");
}
}
});
$(".deleteLink").click(function (e) {
e.preventDefault();
$("#dialog-confirm").dialog("open");
});
$(".openDialog").live("click", function (e) {
e.preventDefault();
$("<div></div>")
.addClass("dialog")
.attr("id", $(this).attr("data-dialog-id"))
.appendTo("body")
.dialog({
title: $(this).attr("data-dialog-title"),
close: function () { $(this).remove() },
modal: true,
width: "90%",
height: "500",
buttons: {
"Close": function () {
$(this).dialog("close");
}
}
})
.load(this.href);
});
$(".close").live("click", function (e) {
e.preventDefault();
$(this).closest(".dialog").dialog("close");
});
});
</script>
<div class="tabset">
<ul class="tab_labels">
<li><span>Details</span></li>
<li><span>Versions</span></li>
<li><span>History</span></li>
<li><span>Log</span></li>
</ul>
<div class="tab_content">
<table id="detailsView" class="display">
<tbody>
<tr>
<td>@Html.LabelFor(model => model.ApplicationName)</td>
<td>@Html.DisplayFor(model => model.ApplicationName)</td>
</tr>
<tr>
<td>@Html.LabelFor(model => model.Description)</td>
<td>@Html.DisplayFor(model => model.Description)</td>
</tr>
</tbody>
</table>
</div>
<div class="tab_content">
@Html.Partial("_Versions", versions, new ViewDataDictionary {{ "applicationId", Model.ApplicationId}})
</div>
<div class="tab_content">
@Html.Partial("_RecordHistory", history)
</div>
<div class="tab_content">
@Html.Partial("_RecordLog", log)
</div>
</div>
<br />
<div class="button_wrapper_center">
<a href="@Url.Action("Index", "Application")" class="button_black_medium"><span style="white-space:nowrap;">Return to List</span></a>
</div>
<div id="dialog-confirm" title="Delete the item?" style="display:none" >
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>This item will be deleted. Are you sure?</p>
</div>
The partial view _Versions contains the link to open the dialog
This is _Versions.cshtml
@model IEnumerable<WebDevelopment.SqlData.Version>
@{
var applicationId = ViewData["applicationId"];
}
<script type="text/javascript">
$(document).ready(function () {
var recordId;
$(".deleteVersionLink").click(function (e) {
e.preventDefault();
var frm = $(this);
recordId = frm.attr("id");
$("#dialog-confirmVersion").dialog("open");
});
$("#dialog-confirmVersion").dialog({
autoOpen: false,
resizable: false,
height: 200,
width: 400,
modal: true,
buttons: {
"Delete": function () {
$("#deleteVersion" + recordId).submit();
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
$('#versions').dataTable({
"bFilter": false,
"bPaginate": false,
"bInfo": false,
"bSort": false
});
});
</script>
<table>
<tr>
<td>
<a href="@Url.Action("Create", "Version", new { applicationId = applicationId })" class="button_black_medium"><span style="white-space:nowrap;">Create New</span></a>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="versions">
<thead>
<tr>
<th>
@Html.LabelFor(p => Model.FirstOrDefault().VersionNumber)
</th>
<th>
@Html.LabelFor(p => Model.FirstOrDefault().ReleaseDate)
</th>
<th>
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ActionLink(item.VersionNumber, "Details", "Version", new { id = item.VersionId }, new { @class = "openDialog", data_dialog_id = "detailsDialog", data_dialog_title = "Version Details" })
</td>
<td>
@Html.DisplayFor(modelItem => item.ReleaseDate)
</td>
<td>
@Html.ActionLink("Edit", "Edit", "Version", new { id = item.VersionId }, null) |
@Html.ActionLink("Delete", "DeleteConfirmed", "Version", new { id = item.VersionId }, new { @class = "deleteVersionLink", @id = item.VersionId })
@using (Html.BeginForm("DeleteConfirmed", "Version", new { id = item.VersionId }, FormMethod.Post, new { @id = "deleteVersion" + item.VersionId })){}
</td>
</tr>
}
</tbody>
</table>
<div id="dialog-confirmVersion" title="Delete the item?" style="display:none" >
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>This item will be deleted. Are you sure?</p>
</div>
Here is the Version Contoller
public ActionResult Details(int id)
{
ViewBag.History = recordHistoryRepository.GetRecordHistory("ConnectionString", "Version", id);
ViewBag.Log = recordLogRepository.GetRecordLog("ConnectionString", "Version", id);
var version = versionRepository.GetVersionById(id);
if (Request.IsAjaxRequest())
{
return PartialView("_DetailsDialog", version);
}
return View(version);
}
Here is Version Details.cshtml
@model WebDevelopment.SqlData.Version
@Html.Partial("_DetailsDialog")
Here is _DetailsDialog
@model WebDevelopment.SqlData.Version
@{
var history = ViewBag.History as IEnumerable<WebDevelopment.SqlData.RecordHistory>;
var log = ViewBag.Log as IEnumerable<WebDevelopment.SqlData.RecordLog>;
}
<table width="100%">
<tr>
<td><h1 class="first">@Html.DisplayTextFor(_ => Model.Application.ApplicationName)</h1></td>
</tr>
</table>
<div class="tabset">
<ul class="tab_labels">
<li><span>Details</span></li>
<li><span>History</span></li>
<li><span>Log</span></li>
</ul>
<div class="tab_content">
<table id="detailsDialogView" class="display">
<tbody>
<tr>
<td>@Html.LabelFor(model => model.VersionNumber)</td>
<td>@Html.DisplayFor(model => model.VersionNumber)</td>
</tr>
<tr>
<td>@Html.LabelFor(model => model.ReleaseDate)</td>
<td>@Html.DisplayFor(model => model.ReleaseDate)</td>
</tr>
</tbody>
</table>
</div>
<div class="tab_content">
@Html.Partial("_RecordHistory", history)
</div>
<div class="tab_content">
@Html.Partial("_RecordLog", log)
</div>
</div>
The dialog opens and I see the html for the _DetailsDialog page in firebug, but the tabs are not functioning. The datatables in partial views _RecordHistory and _RecordLog from _DetailsDialog.cshtml do not function as well. | 0 | [
2,
487,
8190,
93,
6523,
18,
52,
638,
572,
28223,
28,
7284,
1418,
800,
3726,
3726,
31,
589,
1214,
21,
28223,
29,
14,
249,
45,
48,
25,
51,
4865,
1210,
857,
3289,
9,
6824,
7015,
7786,
13,
1,
8741,
1001,
3726,
7,
11969,
118,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Zend framework installation issues on the IIS 6 Server
===
I have downloaded the latest version of Zend for php and I'm seem to be having some issues with the installation. After downloading the frameworks, I did the install per the instructions i.e. setting the include in the php.ini file.
I ran installation checker and it is giving me the following error message: Exception thrown trying to access Zend/Loader.php using 'use_include_path' = true. Make sure you include Zend Framework in your include_path which currently contains: ....
Is there a reason why I'm getting that message.. The type of web server that I'm running is IIS 6 server.
Thank you,
Kevin Davis | 0 | [
2,
10526,
43,
6596,
7758,
1549,
27,
14,
595,
18,
400,
8128,
800,
3726,
3726,
31,
57,
23887,
14,
5736,
615,
16,
10526,
43,
26,
13,
26120,
17,
31,
22,
79,
2260,
20,
44,
452,
109,
1549,
29,
14,
7758,
9,
75,
7121,
68,
14,
6596,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 change a socket's IP_MULTICAST_IF
===
I have a Computer with 5 interfaces: 3 with public IPs and 2 local IPs. I am trying to send "HELLO" to a UDP server, but I would like to change the interface to one of the local IP addresses. I did some research and this is the line I need to add in python:
sock.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_IF, socket.inet_aton("64.195.10.11"))
with 64.195.10.11 being the IP I want to change to
So my python code looks like this:
import socket
MCAST_GRP = '224.0.0.1'
MCAST_PORT = 10222
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_IF, socket.inet_aton("64.195.10.10"))
sock.sendto("HELLO", (MCAST_GRP, MCAST_PORT))
It works perfectly when I change between my 3 public IP addresses. However, it does not work if I put a local IP in the argument. I am not sure if the script does not send, or the server does not receive. What is happening?
SL | 0 | [
2,
184,
20,
753,
21,
18482,
22,
18,
15735,
1,
21531,
6146,
1,
821,
800,
3726,
3726,
31,
57,
21,
1428,
29,
331,
6573,
18,
45,
203,
29,
317,
31,
1919,
17,
172,
375,
31,
1919,
9,
31,
589,
749,
20,
2660,
13,
7,
11515,
7,
20,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android dual sim card detection
===
After reading a lot of documentation, I understood that there is no official way to detect whether the android phone uses dual or just a single card, but obviously many apps are using that feature, so I decided to ask does anyone know how can I implement that ?
thanks a lot | 0 | [
2,
13005,
5747,
4861,
2056,
11643,
800,
3726,
3726,
75,
1876,
21,
865,
16,
13945,
15,
31,
4014,
30,
80,
25,
90,
989,
161,
20,
9092,
1472,
14,
13005,
1132,
2027,
5747,
54,
114,
21,
345,
2056,
15,
47,
4409,
151,
4865,
18,
50,
568,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Json in HighCharts
===
I am using a ViewModel to create the series as follows:
namespace AESSmart.ViewModels
{
public class HighChartsPoint
{
public double x { set; get; }
public double y { set; get; }
public string color { set; get; }
public string id { set; get; }
public string name { set; get; }
}
public class HighChartsSeries
{
public List<HighChartsPoint> data { set; get; }
public string name { set; get; }
public string type { set; get; }
}
public class HomeIndexViewModel
{
public string HCSeries {get;set;}
public void setChartData()
{
List<HighChartsSeries> allSeries = new List<HighChartsSeries>();
List<HighChartsPoint> allPoint = new List<HighChartsPoint>();
allPoint.Add(new HighChartsPoint { x = 49.9, y = 1 });
allPoint.Add(new HighChartsPoint { x = 71.5, y = 2 });
allPoint.Add(new HighChartsPoint { x = 106.4, y = 3 });
allPoint.Add(new HighChartsPoint { x = 129.2, y = 4 });
allSeries.Add(new HighChartsSeries {
data = new List<HighChartsPoint>(allPoint),
name = "Series 1",
type = "column"
});
JavaScriptSerializer oSerializer = new JavaScriptSerializer();
HCSeries = oSerializer.Serialize(allSeries);
}
}
}
Then in my view I am setting the `series: [@Model.HCSeries]` like so:
@section HeadContent {
<script type="text/javascript">
(function ($) { // encapsulate jQuery
var chart;
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container4',
type: 'column'
},
series: [@Model.HCSeries]
});
});
})(jQuery);
</script>
}
When I run the program it is not displaying the HighChart. If I look at the view source it looks like the following:
<script type="text/javascript">
(function ($) { // encapsulate jQuery
var chart;
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container4',
type: 'column'
},
series: [[{"data":[
{"x":49.9,"y":1,"color":null,"id":null,"name":null},
{"x":71.5,"y":2,"color":null,"id":null,"name":null},
{"x":106.4,"y":3,"color":null,"id":null,"name":null},
{"x":129.2,"y":4,"color":null,"id":null,"name":null}],
"name":"Series 1",
"type":"column"}]]
});
});
})(jQuery);
</script>
If I manually enter the data directly into the view then the chart does display. However, I will be needing to create the series dynamically. **What do I need to do to fix my code so that the chart will display?**
| 0 | [
2,
568,
487,
528,
19,
183,
5433,
38,
18,
800,
3726,
3726,
31,
589,
568,
21,
1418,
13998,
20,
1600,
14,
231,
28,
2415,
45,
204,
5582,
21,
160,
18,
9534,
9,
4725,
13998,
18,
13,
1,
317,
718,
183,
5433,
38,
18,
3132,
13,
1,
317... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Prevent jQuery mobile button default behaviour
===
I'm currently building a Phonegap/Cordova app using jQuery as framework. Most is well - except one scenario.
I have a fixed footer (works great) with navbar and three buttons.
Two buttons go to regular pages no ajax and they work great.
One buttons hooks to the Camera interface and triggers the camera on the (i.e.) iPhone. If I cancel i get back to the screen but the button for the camera now has active state and styling.
I am triggering a changePage on failure and the page get's activate but it does not change the button state!? I've tried to manually remove the classes without success!? Something seems to delay the adding of classes for active state until or something.
Am I doing it wrong? Shouldn't the changePage() find and trigger it's anchor?
In the album page the footer looks like this:
<div class="footer" data-role="footer" data-position="fixed" data-id="footer-tab">
<div data-role="navbar" class="nav-glyphish">
<ul>
<li><a id="welcome" href="#welcome"></a></li>
<li><a id="capture-photo"></a></li>
<li><a id="show-album" href="#album" class="ui-btn-active ui-state-persist"></a></li>
</ul>
</div>
</div>
So again - the #capture-photo button does NOT have a corresponding page, but when I click it gets activated, if I cancel the camera - jqm catchers a changePage and goes to the #show-album, but the #capture-photo button is still marked as active.
P.S I do have an identical footer (data-role='footer') on both pages except their respective anchor has the ui-btn-active and ui-state-persist set. I feel a bit uncomfortable with this duplicate code but it seems the only way to solve the persisted headers/footers? | 0 | [
2,
2501,
487,
8190,
93,
3241,
5167,
12838,
7727,
800,
3726,
3726,
31,
22,
79,
871,
353,
21,
1132,
1136,
306,
118,
17213,
3496,
4865,
568,
487,
8190,
93,
28,
6596,
9,
127,
25,
134,
13,
8,
1613,
53,
12705,
9,
31,
57,
21,
3535,
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... |
WebSQL and Javascript Order of Operation
===
My application is using the javascript webSQL and I am having some issue with the order of command execution. No matter what order my code is in the querys get executed last. For example in the following code 2 will be alerted before 1:
db.transaction(
function (transaction) {
transaction.executeSql(
'SELECT * FROM contacts WHERE id = ?;',
[id],
function (transaction, result) {
alert("1");
if (result.rows.length != 0) {
user = result.rows.item(0).name;
} else {}
},
errorHandler);
});
alert("2");
message = id + '%1E' + name;
Any ideas why this is happen? | 0 | [
2,
2741,
18,
22402,
17,
8247,
8741,
389,
16,
1453,
800,
3726,
3726,
51,
3010,
25,
568,
14,
8247,
8741,
2741,
18,
22402,
17,
31,
589,
452,
109,
1513,
29,
14,
389,
16,
1202,
5769,
9,
90,
1161,
98,
389,
51,
1797,
25,
19,
14,
2559... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Please critique my column chart concept
===
Folks,
What I came up with (see below) doesn't quite look right, and I was wondering if someone could please help me refine my idea.
I was given the following requirement:
Design a column chart that shows the follow data for each of the past 7 days:
- **Average** volume received for that day of the week (i.e. on Fridays).
- **Current** volume received on that specific day (i.e. Friday, July 27).
- **Average** and **Current** volume accepted.
- **Average** and **Current** volume rejected.
- **Average** and **Current** volume still processing or otherwise unknown.
Here's what I mocked up with so far:
http://jsfiddle.net/yybbE/
(Only the "Friday" bar group works correctly when clicked.)
(Also, callouts will be displayed when the mouse hovers, but that's not in the mock-up.)
Thank you in advance. | 2 | [
2,
2247,
14791,
51,
4698,
1795,
2420,
800,
3726,
3726,
14563,
15,
98,
31,
281,
71,
29,
13,
5,
1798,
1021,
6,
1437,
22,
38,
1450,
361,
193,
15,
17,
31,
23,
5712,
100,
737,
110,
2247,
448,
55,
302,
7509,
51,
882,
9,
31,
23,
50... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Simple chrome extension URL to send/show
===
I am trying to do something simple and somehow it does not work...
I am trying to build a simple chrome extension that when you click on it it is showing the URL of the TAB in a simple HTML. How can I do it? this is the code:
manifest.json
=============
{
"name": "MY EXTENSION",
"version": "1.0",
"description": "the DESCRIPTION",
"browser_action": {
"default_icon": "icon.png",
"popup": "main.html"
},
"permissions": [
"tabs"
]
}
End of manifest.json
=============
Main.html:
==========
<html>
<head>
<script type="text/javascript">
function get(){
chrome.tabs.getSelected(null, function(tab) {
pageUrl = tab.url;
pageTitle = tab.title;
$('#bkmk').attr('value',pageUrl);
$('#title').attr('value',pageTitle);
});
}
</script>
</head>
<body onload="get()">
<tr><td align="right">Link (URL): </td><td><input id='bkmk' name='bkmk' type="text"
value="" size="50">
<br><span style="color: red;"></span>
</td></tr>
<script>document.write($bkmk)</script>
</body>
</html>
=============
Anything I do I cannot make the HTML to show the URL..
Thanks!!
Elikd | 0 | [
2,
1935,
13,
12985,
3896,
287,
6362,
20,
2660,
118,
9303,
800,
3726,
3726,
31,
589,
749,
20,
107,
301,
1935,
17,
3625,
32,
630,
52,
170,
9,
9,
9,
31,
589,
749,
20,
1895,
21,
1935,
13,
12985,
3896,
30,
76,
42,
10840,
27,
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... |
Interfacing with legacy Nortel Norstar to obtain call-information
===
Our business uses the good ol' Nortel Norstar (with MICS) phone system. I am tasked with bridging it to our network: the intention is for a LAMP-based web-server to display a list of the most-recent callers (for call tracking/analytical purposes.)
I have no problem on the LAMP-end, but I'm totally out of my depth when it comes to interfacing with the Norstar to obtain this sort of information.
Is this even possible? Anyone got any pointers where to start?
Thanks in advance! | 0 | [
2,
1480,
17231,
29,
7780,
2127,
3454,
2127,
2265,
20,
5545,
645,
8,
22793,
800,
3726,
3726,
318,
508,
2027,
14,
254,
6304,
22,
2127,
3454,
2127,
2265,
13,
5,
1410,
13,
5410,
18,
6,
1132,
329,
9,
31,
589,
14605,
29,
22885,
68,
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... |
Not getting readyKey on NIO connection disconnection
===
I get a very strange NIO behavior, on very rare occasions I don't get selected readyKey on disconnection (due to VM kill) when I call select() as followed:
while (selector.isOpen()){
selector.select(SELECT_TIMEOUT);
Set<SelectionKey> readyKeys = selector.selectedKeys();
if(!readyKeys.isEmpty()){
System.out.println("Selected...");
}
}
The key is registered as followed:
key.interestOps(SelectionKey.OP_READ);
OS: CentOS 6.2
VM: XEN
Java: JDK_1.6u17
Keep_ALIVE is set to run every 1sec | 0 | [
2,
52,
1017,
1451,
4237,
27,
13,
15042,
2760,
29363,
872,
800,
3726,
3726,
31,
164,
21,
253,
2578,
13,
15042,
3257,
15,
27,
253,
2890,
5795,
31,
221,
22,
38,
164,
1704,
1451,
4237,
27,
29363,
872,
13,
5,
12633,
20,
13,
20147,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ListView Android, how to always show complete elements
===
Is there a way to configure a ListView in such a way that it always shows the top element of the list on the screen complete?
In other words, whenever the list stops scrolling it should continue scrolling up or down until the element on the top shows entirely. | 0 | [
2,
968,
4725,
13005,
15,
184,
20,
550,
298,
1279,
2065,
800,
3726,
3726,
25,
80,
21,
161,
20,
1065,
15951,
21,
968,
4725,
19,
145,
21,
161,
30,
32,
550,
1285,
14,
371,
4520,
16,
14,
968,
27,
14,
2324,
1279,
60,
19,
89,
715,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 prevent the jquery dataTable plugin from adding row and message when there is no data
===
Our product owner would like the our empty tables to display just table header when there is no data in table. I can't seem to prevent dataTable from creating a row with "empty..." message.
Here is the code I use to initialize the dataTable. I know some things here are wrong. I have been experimenting. :)
$('#InBox').dataTable({
"bFilter": false,
"bPaginate": false,
"bLengthChange": false,
"bInfo": false,
"oLanguage": {
"sEmptyTable": '',
"sInfoEmpty": ''
}
});
Here is some code I tried to put in the init function of the dataTable, but I am not sure how to get it to work.
/* Table is empty - create a row with an empty message in it */
var anRows[0] = document.createElement('tr');
if (typeof oSettings.asStripClasses[0] != 'undefined') {
anRows[0].className = oSettings.asStripClasses[0];
}
var nTd = document.createElement('td');
nTd.setAttribute('valign', "top");
nTd.colSpan = oSettings.aoColumns.length;
nTd.className = oSettings.oClasses.sRowEmpty;
if (oSettings.fnRecordsTotal() > 0) {
if (oSettings.oLanguage.sZeroFilterRecords.indexOf("_MAX_") != -1)
oSettings.oLanguage.sZeroFilterRecords = oSettings.oLanguage.sZeroFilterRecords.replace("_MAX_", oSettings.fnRecordsTotal());
nTd.innerHTML = oSettings.oLanguage.sZeroFilterRecords;
} else {
nTd.innerHTML = oSettings.oLanguage.sZeroRecords;
}
anRows[iRowCount].appendChild(nTd);
Dan | 0 | [
2,
184,
92,
31,
2501,
14,
487,
8190,
93,
1054,
5924,
10922,
108,
37,
4721,
3131,
17,
2802,
76,
80,
25,
90,
1054,
800,
3726,
3726,
318,
2374,
2410,
83,
101,
14,
318,
2424,
7484,
20,
3042,
114,
859,
157,
106,
76,
80,
25,
90,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Titanium TableViewRow removes background color of subview when selected
===
I have a custom TableViewRow with a subview for an image. The imageView is inside a container so I can display the image as a square. The container has a white background and the image may not fill the container view. I removed the image from the container to explain the problem better. Please see the images below.


As you can see, when the bottom row is selected the background of the white square disappears. In my case, when the image is inside the container, the white color that fills the square is removed and I have a square border with a smaller image inside it.
Has anyone dealt with this before?
Thanks. | 0 | [
2,
26398,
859,
4725,
5417,
4681,
18,
2395,
1665,
16,
972,
4725,
76,
1704,
800,
3726,
3726,
31,
57,
21,
5816,
859,
4725,
5417,
29,
21,
972,
4725,
26,
40,
1961,
9,
14,
1961,
4725,
25,
572,
21,
12147,
86,
31,
92,
3042,
14,
1961,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Shall I use PHP's unset function every time I am done working with variables?
===
My question is really simple, I fetch data from database and store them as variable for future use. After done working with the variables, is it cost-efficient to use the unset function of PHP to free up the memory? What I mean by 'cost-efficient' is whether is it worth calling the function multiple times in hope of clearing the memory to reduce up page load time. | 0 | [
2,
3004,
31,
275,
13,
26120,
22,
18,
367,
3554,
1990,
352,
85,
31,
589,
677,
638,
29,
12157,
60,
800,
3726,
3726,
51,
1301,
25,
510,
1935,
15,
31,
18312,
1054,
37,
6018,
17,
1718,
105,
28,
7612,
26,
1022,
275,
9,
75,
677,
638,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WinRT calling wait() or get() on Async method gives: Unhandled exception 0xc0000409
===
I have been experimenting a lot lately with Windows 8, writing C# XAML Metro style apps using WinRT components written in C++/CX for better performance and to use functionality not available in C#, specifically DirectX.
While loading resources from my app package in my WinRT component, my app threw the following:
Unhandled exception at 0x0fd58ae3 (MSVCR110D.dll) in TestResources.exe: 0xC0000409: 0xc0000409.
I was trying to make asynchronous calls to the new StorageFile API (Windows::Storage::StorageFile::GetFileFromApplicationUriAsync chained to other calls for reading the file contents) and synchronize the resulting task chain using concurrency::task.get().
It didn't seem to be working. If I didn't call concurrency::task.get() or concurrency::task.wait(), then the problem did not occur, but I needed the result synchronously because of how my DirectX code was written. | 0 | [
2,
628,
5256,
2555,
1760,
5,
6,
54,
164,
5,
6,
27,
21,
9507,
150,
2109,
2352,
45,
367,
3203,
1294,
5391,
713,
21550,
21903,
300,
2545,
800,
3726,
3726,
31,
57,
74,
5737,
68,
21,
865,
10434,
29,
1936,
469,
15,
1174,
272,
5910,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
insert base64 encoded image into AR.ImageResource in Wikitude SDK for iOS
===
Im looking to insert a base64 encoded image when creating a new AR.ImageResource in Wikitude SDK iOS.
I can do this directly in HTML img src attribute using javascript as follows
document.getElementById("imageFooterId").src = "data:image/png;base64," + jsonObject[id].picData;
But to render images in the aug view of Wikitude it is required to use the AR.ImageResource and it is a little more difficult to insert a base64 encode image.
I am using the following function call with no luck
tmpImage = new AR.ImageResource("data:image/png;base64," + jsonObject[i].picData, {onError: errorLoadingImage});
Are they any suggestions out there for performing this action?
| 0 | [
2,
14692,
1000,
3470,
13665,
1961,
77,
13,
512,
9,
22039,
99,
12097,
19,
13,
26593,
16731,
13,
18,
43,
197,
26,
13,
7760,
800,
3726,
3726,
797,
699,
20,
14692,
21,
1000,
3470,
13665,
1961,
76,
2936,
21,
78,
13,
512,
9,
22039,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
zf2 way to set up a navigation bar
===
I'm struggling to connect the dots between the ZF1 way of initializing things in a bootstrap, and the ZF2 way of injecting things from a config file (seemingly).
To wit, in ZF1, I had something like this in my boostrap:
protected function _initNavigation()
{
$this->bootstrap('layout');
$this->bootstrap('view');
$navigation = new Zend_Navigation();
// ...code to add pages...
$layout = $this->getResource('layout');
$view = $layout->getView();
$view->navigation($navigation);
}
In ZF2, I'm not even sure what to start looking for, to accomplish something similar.
I've read the posts that refer to:
public function onBootstrap (Event $e)
{
}
and the way that you can do things like:
$application = $e->getApplication();
$services = $application->getServiceManager();
But, what's the equivalent of:
$layout = $this->getResource('layout');
$view = $layout->getView();
$view->navigation($navigation);
Would I do this in Module, or is it better done in the config file and injected? If injected, how?
I've read Rob Allen's tutorial, and have been searching the net for examples of things that go beyond tutorial-level code. The things that I've found (like other ZF2 modules) have been more oriented toward being working modules (understandably), than being examples through to convey the nuances to others... Since I can't find much on this topic, I'm assuming that there's some small, fundamental thing I'm missing that -- when I see it -- will have it all make sense. | 0 | [
2,
2052,
410,
135,
161,
20,
309,
71,
21,
8368,
748,
800,
3726,
3726,
31,
22,
79,
7587,
20,
6379,
14,
17900,
128,
14,
2052,
410,
165,
161,
16,
2104,
3335,
564,
19,
21,
5894,
16514,
15,
17,
14,
2052,
410,
135,
161,
16,
20316,
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... |
NDK build error with cygwin
===
i am tying to build a tesseract project to use as a library for my project. I am getting this error with cygwin when trying to build on windows 7 with User Account Controls turned off.
$ /cygdrive/c/android-ndk-r8/ndk-build
SharedLibrary : liblept.so
C:/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libgnustl_static.a: No such file: Permission denied
collect2: ld returned 1 exit status
/cygdrive/c/android-ndk-r8/build/core/build-binary.mk:369: recipe for target `obj/local/armeabi/liblept.so' failed
make: *** [obj/local/armeabi/liblept.so] Error 1
please let me know what i should do to build the project.
| 0 | [
2,
13,
706,
197,
1895,
7019,
29,
6728,
263,
4181,
800,
3726,
3726,
31,
589,
19160,
20,
1895,
21,
13338,
106,
5183,
669,
20,
275,
28,
21,
1248,
26,
51,
669,
9,
31,
589,
1017,
48,
7019,
29,
6728,
263,
4181,
76,
749,
20,
1895,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
New ArrayList filtering from another ArrayList using a String as Filter
===
In my program, a Die (dice for embroidery) is a class with different fields. One of them is of the type String and it is called haveIt. So, if the user of the program enters the word "Yes" on the haveIt field, he should be able to track a list of all the Dies he has, on the myInventory list.
How do I do this? Should I create the myInventory ArrayList<Die> on the fields and constructor of my Contoller class or should I built it inside a special method in that class?
I have tryed everything and nothing works. But I am really new on this.
Here is my last attempt, creating a loop to create the new ArrayList<Die> (that has "Yes" on the haveIt field) from a special getMyInventory method in my Controller class:
public ArrayList<Die> getMyInventory(Die anyDie) {
for (int counting = 0; counting <
diesBigList.Count ; counting++);
{
if
(((Die)diesBigList[counting]).doIHaveIt.contains("Yes"))
myInventory.add(diesBigList[counting]);
return myInventory;
}
}
It does not compile. It tells me that the result should be an Array tipe but it is resolved as ArrayList... (and I do not comprendo that).
Thanks in advance. | 0 | [
2,
78,
7718,
5739,
25272,
37,
226,
7718,
5739,
568,
21,
3724,
28,
11945,
800,
3726,
3726,
19,
51,
625,
15,
21,
1327,
13,
5,
8779,
26,
29192,
6,
25,
21,
718,
29,
421,
2861,
9,
53,
16,
105,
25,
16,
14,
1001,
3724,
17,
32,
25,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PHP variables not showing up. GETid not working properly
===
I have all the login scripts and profiles set up. I have a data table where all the profile information is stored called plus_signup but I can't seem to get this GET[id] thing to work. Am I missing something? Here's what I have. When I view the page with the code I have now, there are blank areas where php is supposed to fill in the variables.
session_start();
include "include/z_db.php";
if ($_GET['id']){
$id = $_GET['id'];
} else if (isset($_SESSION['id'])) {
$id = $_SESSION['id'];
}
else {
print "important data to render this page is missing";
exit();
$sql = mysql_query("SELECT * FROM plus_signup WHERE id='$userid'");
while($row = mysql_fetch_array($sql)){
$userid = $row["userid"];
$name = $row["name"];
$location = $row["location"];
$sex = $row["sex"];
$aboutme = $row["aboutme"];
}
$check_pic = "users/$id/image01.jpg";
$default_pic = "users/0/image01.jpg";
if (file_exists($check_pic)){
$user_pic = "<img src=\"$check_pic\" width=\"175px\"/>";
} else {
$user_pic = "<img src=\"$default_pic\"/>";
}}
| 0 | [
2,
13,
26120,
12157,
52,
3187,
71,
9,
164,
1340,
52,
638,
7428,
800,
3726,
3726,
31,
57,
65,
14,
6738,
108,
17505,
17,
5296,
18,
309,
71,
9,
31,
57,
21,
1054,
859,
113,
65,
14,
5296,
676,
25,
8214,
227,
3123,
1,
11255,
576,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
My application works on android emulator but not on my device
===
<p>
My Application is running fine on emulator but does not works on the my phone Samsung galaxy nexus s.
</p><br/>
<p>
The application consists of different logins facebook, twitter, mendeley and my own web application. i don't know why it is not working. On facebook in application settings i have also added the hash code required but it really does not work. May be it is something related to http request to the servers from the device. Stressed about it please Help
</p>
| 0 | [
2,
51,
3010,
693,
27,
13005,
3579,
14868,
47,
52,
27,
51,
3646,
800,
3726,
3726,
13,
1,
306,
1,
51,
3010,
25,
946,
1123,
27,
3579,
14868,
47,
630,
52,
693,
27,
14,
51,
1132,
22981,
9358,
28674,
13,
18,
9,
13,
1,
118,
306,
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... |
All queries failing with "Error: Unexpected"
===
All queries to one of my BigQuery tables are failing with the following error:
Query Failed
Error: Unexpected. Please try again.
They take approx 60 sec to run then fail. All through the web interface. Any ideas what could be happenning?
Here is a basic query that isn't working:
SELECT timestamp FROM [streaklogsdataset.log_371af6_00000001340064000000_00000001342656000000] order by timestamp desc limit 10
If I run a basic query on any of the public data sets they work fine. I wonder if it could be that I'm appending data every 2 mins to the table. | 0 | [
2,
65,
9386,
2829,
7250,
29,
13,
7,
29992,
45,
9380,
7,
800,
3726,
3726,
65,
9386,
2829,
20,
53,
16,
51,
580,
8190,
93,
7484,
50,
7250,
29,
14,
249,
7019,
45,
25597,
1702,
7019,
45,
9380,
9,
2247,
1131,
188,
9,
59,
247,
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... |
Simple gradle build file build error
===
I am trying out several gradle basics.
Here is how my gradle file "build.gradle" looked:
task hello
{
doLast
{
println 'Hello World!'
}
}
This causes the following error:
D:\DevAreas\learn-gradle>gradle -q hello
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\DevAreas\learn-gradle\build.gradle' line: 2
* What went wrong:
Could not compile build file 'D:\DevAreas\learn-gradle\build.gradle'.
> startup failed:
build file 'D:\DevAreas\learn-gradle\build.gradle': 2: Ambiguous expression could be a parameterle
ss closure expression, an isolated open code block, or it may continue a previous statement;
solution: Add an explicit parameter list, e.g. {it -> ...}, or force it to be treated as an open
block by giving it a label, e.g. L:{...}, and also either remove the previous newline, or add an exp
licit semicolon ';' @ line 2, column 1.
{
^
1 error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more l
og output.
If I make a minor modification to the build file like so
> [Please NOTE that I have moved the parenthesis from second line to
> first line]
task hello{
doLast
{
println 'Hello World!'
}
}
I see the output
Hello World!
with out issues.
Is parenthesis such a big problem in gradle? What was I doing so wrong by placing the parenthesis in the second line? | 0 | [
2,
1935,
13,
7691,
413,
1895,
3893,
1895,
7019,
800,
3726,
3726,
31,
589,
749,
70,
238,
13,
7691,
413,
2125,
18,
9,
235,
25,
184,
51,
13,
7691,
413,
3893,
13,
7,
29361,
9,
7691,
413,
7,
292,
45,
3005,
10975,
13,
1,
107,
8558,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
File download using a Spring Controller
===
My question is regarding downloading a file from the server to the user's machine using Spring MVC.
Let's say an html or jsp has code which opens a browser file download dialog box for the user to select a folder and filename to save a file from the server. What does the Spring controller need to do to correctly handle this request? In other words, how does it extract the file mame and file content from the Model to save it to the local file system?
Any code examples greatly appreciated, thanks. | 0 | [
2,
3893,
7121,
568,
21,
1573,
9919,
800,
3726,
3726,
51,
1301,
25,
3467,
7121,
68,
21,
3893,
37,
14,
8128,
20,
14,
4155,
22,
18,
1940,
568,
1573,
307,
8990,
9,
408,
22,
18,
395,
40,
13,
15895,
54,
487,
3401,
63,
1797,
56,
8965... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
libspotify.so.12.1.51 segfaults on Android
===
I've modified the jukebox example to run on Android, but it segfaults miserably when trying to call the sp_session_create() function.
Basically - I have a helloworld Android app with a button. When pressed it calls this function, which crashes on sp_session_create():
JNIEXPORT void JNICALL Java_com_holidaystudios_unispot_uniSpot_prepareSpotify() {
sp_session *sp;
sp_error err;
const char *username = NULL;
const char *password = NULL;
username = __USERNAME;
password = __PASSWORD;
g_listname = __PLAYLIST;
UNISPOT_DEBUG("prepareSpotify() - 1\n");
audio_init(&g_audiofifo);
UNISPOT_DEBUG("prepareSpotify() - 2\n");
/* Create session */
spconfig.application_key_size = g_appkey_size;
UNISPOT_DEBUG("prepareSpotify() - 3 %d, %p, %p (%p)\n", g_appkey_size, &spconfig, &sp, sp_session_create);
err = sp_session_create(&spconfig, &sp);
UNISPOT_DEBUG("prepareSpotify() - 4\n");
.
.
.
Here's the logcat output which shows the segfault:
I/UNISPOT|NDK( 5951): prepareSpotify() - 1
I/UNISPOT|NDK( 5951): prepareSpotify() - 2
I/UNISPOT|NDK( 5951): prepareSpotify() - 3 321, 0x575115ac, 0xbec4052c (0x5b4107b4)
F/libc ( 5951): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
I/DEBUG (31750): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG (31750): Build fingerprint: 'google/yakju/maguro:4.0.4/IMM76I/330937:user/release-keys'
I/DEBUG (31750): pid: 5951, tid: 5951 >>> com.holidaystudios.unispot <<<
I/DEBUG (31750): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG (31750): r0 0155d708 r1 4006162c r2 00000000 r3 5b47add8
I/DEBUG (31750): r4 0155d708 r5 5b47e740 r6 57508d48 r7 0155d708
I/DEBUG (31750): r8 bec40460 r9 bec4052c 10 0155d768 fp 0155d768
I/DEBUG (31750): ip 40061474 sp bec40340 lr 5b410a7c pc 5b4104f4 cpsr 60000010
I/DEBUG (31750): d0 00656c6f736e6f63 d1 72616364732f2061
I/DEBUG (31750): d2 61726f74532f2f63 d3 7865646e692f6568
I/DEBUG (31750): d4 0000000000000000 d5 0000000000000000
I/DEBUG (31750): d6 0000000000000000 d7 00f92b8000000000
I/DEBUG (31750): d8 0000000000000000 d9 0000000000000000
I/DEBUG (31750): d10 0000000000000000 d11 0000000000000000
I/DEBUG (31750): d12 0000000000000000 d13 0000000000000000
I/DEBUG (31750): d14 0000000000000000 d15 0000000000000000
I/DEBUG (31750): d16 416f257010000000 d17 3fe0000000000000
I/DEBUG (31750): d18 0000000000000000 d19 3fe5555560000000
I/DEBUG (31750): d20 0000000000000000 d21 0000000000000000
I/DEBUG (31750): d22 3ff0000000000000 d23 0000000000000000
I/DEBUG (31750): d24 0000000000000000 d25 3fe5555560000000
I/DEBUG (31750): d26 0000000000000000 d27 3fe5555560000000
I/DEBUG (31750): d28 0000000000000000 d29 3ff0000000000000
I/DEBUG (31750): d30 3ff0000000000000 d31 be23e4f5df600000
I/DEBUG (31750): scr 80000013
I/DEBUG (31750):
I/DEBUG (31750): #00 pc 0016b4f4 /data/data/com.holidaystudios.unispot/lib/libspotify.so
I/DEBUG (31750): #01 lr 5b410a7c /data/data/com.holidaystudios.unispot/lib/libspotify.so
I/DEBUG (31750):
I/DEBUG (31750): code around pc:
I/DEBUG (31750): 5b4104d4 e59f50ac e59f30ac e08f5005 e7953003 .P...0...P...0..
I/DEBUG (31750): 5b4104e4 e5902004 e2833008 e5803000 e1a04000 . ...0...0...@..
I/DEBUG (31750): 5b4104f4 e5923000 e1a00002 e1a0e00f e593f178 .0..........x...
I/DEBUG (31750): 5b410504 e5943004 e3530000 0a000005 e3a02000 .0....S...... ..
I/DEBUG (31750): 5b410514 e1a00003 e5842004 e5933000 e1a0e00f ..... ...0......
I/DEBUG (31750):
I/DEBUG (31750): code around lr:
I/DEBUG (31750): 5b410a5c ebfaaa07 e5c7822c e1a00007 ebfffdec ....,...........
I/DEBUG (31750): 5b410a6c e3500000 1a000005 e1a00007 ebfffe94 ..P.............
I/DEBUG (31750): 5b410a7c e1a00007 ebfc951c e3a04002 ea00009d .........@......
I/DEBUG (31750): 5b410a8c e1a01006 e4d13001 e5c73064 e3a02080 .....0..d0... ..
I/DEBUG (31750): 5b410a9c e2870065 ebfaa8ee e3a020c0 e2861081 e........ ......
I/DEBUG (31750):
I/DEBUG (31750): stack:
I/DEBUG (31750): bec40300 0155d9c8 [heap]
I/DEBUG (31750): bec40304 5b37f080 /data/data/com.holidaystudios.unispot/lib/libspotify.so
I/DEBUG (31750): bec40308 0155d708 [heap]
I/DEBUG (31750): bec4030c 5b47e740 /data/data/com.holidaystudios.unispot/lib/libspotify.so
I/DEBUG (31750): bec40310 57508d48 /data/data/com.holidaystudios.unispot/lib/liblespot.so
I/DEBUG (31750): bec40314 5b410230 /data/data/com.holidaystudios.unispot/lib/libspotify.so
I/DEBUG (31750): bec40318 00000400
I/DEBUG (31750): bec4031c bec40460 [stack]
I/DEBUG (31750): bec40320 bec4052c [stack]
I/DEBUG (31750): bec40324 0155d768 [heap]
I/DEBUG (31750): bec40328 0155d768 [heap]
I/DEBUG (31750): bec4032c 5b33f988 /data/data/com.holidaystudios.unispot/lib/libspotify.so
I/DEBUG (31750): bec40330 00000000
I/DEBUG (31750): bec40334 00040000
I/DEBUG (31750): bec40338 df0027ad
I/DEBUG (31750): bec4033c 00000000
I/DEBUG (31750): #00 bec40340 575115ac /data/data/com.holidaystudios.unispot/lib/liblespot.so
I/DEBUG (31750): bec40344 5b47e740 /data/data/com.holidaystudios.unispot/lib/libspotify.so
I/DEBUG (31750): bec40348 57508d48 /data/data/com.holidaystudios.unispot/lib/liblespot.so
I/DEBUG (31750): bec4034c 5b410a7c /data/data/com.holidaystudios.unispot/lib/libspotify.so
I/DEBUG (31750): bec40350 00000000
I/DEBUG (31750): bec40354 57e90026 /system/framework/framework.odex
I/DEBUG (31750): bec40358 41678018 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG (31750): bec4035c bec404e4 [stack]
I/DEBUG (31750): bec40360 00000000
I/DEBUG (31750): bec40364 00010001
I/DEBUG (31750): bec40368 00000000
I/DEBUG (31750): bec4036c 00000000
I/DEBUG (31750): bec40370 416a9ee8 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG (31750): bec40374 416a9ee8 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG (31750): bec40378 41678018 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG (31750): bec4037c 00000024
I/DEBUG (31750): bec40380 01303740 [heap]
I/DEBUG (31750): bec40384 408a39b8
I/BootReceiver( 189): Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
I/WindowManager( 189): WIN DEATH: Window{416abe40 com.holidaystudios.unispot/com.holidaystudios.unispot.uniSpot paused=false}
I/ActivityManager( 189): Process com.holidaystudios.unispot (pid 5951) has died.
Any ideas?
| 0 | [
2,
13,
8326,
18,
4296,
8612,
9,
656,
9,
918,
9,
165,
9,
4246,
1353,
16368,
9708,
18,
27,
13005,
800,
3726,
3726,
31,
22,
195,
5372,
14,
3191,
1048,
5309,
823,
20,
485,
27,
13005,
15,
47,
32,
1353,
16368,
9708,
18,
2462,
106,
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... |
Cucumber: Each feature passes individually, but not together
===
I am writing a Rails 3.1 app, and I have a set of three cucumber feature files. When run individually, as with:
cucumber features/quota.feature
-- or --
cucumber features/quota.feature:67 # specifying the specific individual test
...each feature file runs fine. However, when all run together, as with:
cucumber
...one of the tests fails. It's odd because only *one* test fails; all the other tests in the feature pass (and many of them do similar things). It doesn't seem to matter where in the feature file I place this test; it fails if it's the first test or way down there somewhere.
I don't think it can be the test itself, because it passes when run individually or even when the whole feature file is run individually. It seems like it must be some effect related to running the different feature files together. Any ideas what might be going on? | 0 | [
2,
29440,
45,
206,
1580,
3789,
16579,
15,
47,
52,
429,
800,
3726,
3726,
31,
589,
1174,
21,
2240,
18,
203,
9,
165,
4865,
15,
17,
31,
57,
21,
309,
16,
132,
29440,
1580,
6488,
9,
76,
485,
16579,
15,
28,
29,
45,
29440,
967,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error when run LD_PRELOAD with boost
===
I compiled LD_PRELOAD which uses boost (locks.hpp). Compile was successfull. I copied this LD_PRELOAD to other linux server, and when i run, error:
> /usr/bin/java: symbol lookup error: /test/test.so: undefined symbol:
> _ZN5boost11this_thread20disable_interruptionC1Ev
How can i fix this? Can i avoid this problem without installing boost on this server?
How i compile LD_PRELOAD:
g++ -fPIC -m32 -shared -Wl,-soname,test.so -ldl -o test.so test.cpp
Thanks! | 0 | [
2,
7019,
76,
485,
13,
6252,
1,
3515,
8294,
29,
10419,
800,
3726,
3726,
31,
9316,
13,
6252,
1,
3515,
8294,
56,
2027,
10419,
13,
5,
3966,
18,
9,
252,
3421,
6,
9,
26561,
23,
1300,
255,
9,
31,
18225,
48,
13,
6252,
1,
3515,
8294,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 debug python module loading?
===
I'm trying to port)[cwiid](https://github.com/abstrakraft/cwiid) from python 2.7 to 3.2.
It uses a lot of deprecated stuff so I have to change a lot of stuff in order to have it work with 3.2. Right now I'm stuck because of a load error. With a python 3.2 environment and the library installed to the package repo I do:
prompt: echo "import cwiid" | python -
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define init function (PyInit_cwiid)
Besides blind searching in the source code, **where does python expect the PyInit_cwiid** method?
In the source code for example there is the `py_plugin.c` which contains a `py_init` method.
| 0 | [
2,
184,
107,
31,
121,
16254,
20059,
12613,
12797,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
1295,
6,
2558,
150,
3976,
1340,
500,
5,
21127,
18,
6903,
10404,
20926,
9,
960,
118,
2297,
5253,
12826,
3072,
118,
150,
3976,
1340,
6,
37,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Automatically create username in User model in Django based on other fields
===
I have been searching for best practice, but I did not found it. I was even unable to find solution I need used by anyone else.
I need to **generate username of the user based on his other data** (first name & last name), optionally appending integer at the end, until I get the unique username.
I strongly prefer doing that in model. Is there some standard way to do that? Or is it only appropriate in forms? I have been researching overloading of various `User` model methods, as well as signals, and did not find any proper place I could add it. | 0 | [
2,
7499,
1600,
4155,
7259,
19,
4155,
1061,
19,
3857,
14541,
432,
27,
89,
2861,
800,
3726,
3726,
31,
57,
74,
5792,
26,
246,
1345,
15,
47,
31,
144,
52,
216,
32,
9,
31,
23,
166,
2343,
20,
477,
4295,
31,
376,
147,
34,
1276,
962,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Action Script 3.0 insert a delay
===
i'm new to AS and i'm trying to manage with some issue.
i'm having the next script
var t:Date = new Date ();
var day=t.getDate();
var month=t.getMonth()+1;
var today=day+"."+month;
var u:Number = 0;
var b_persons:Array = new Array ();
var loader:URLLoader = new URLLoader(new URLRequest("bday.xml"));
var bday_file:XML = new XML();
loader.addEventListener(Event.COMPLETE, endLoad);
function endLoad(all_data:Event)
{
bday_file = XML(all_data.target.data);
for each (var person:XML in bday_file.Person)
{
if (person.BD == today)
{
b_persons.push(person.FIO);
trace (b_persons.length);
}
}
}
function assign_txtBdayPerson()
{
txtBdayPerson.text=b_persons[u];
trace(b_persons[u]);
u=u+1;
if (u >= b_persons.length)
{clearInterval(delay_assign_txtBdayPerson);}
}
trace ("Test"+b_persons.length);
if (b_persons.length != 0)
{
var delay_assign_txtBdayPerson = setInterval(assign_txtBdayPerson,3000);
}
my xml file has 2 suitable conditions, and the output window shows me the next sequence
Test 0 than 1 and last 2
so it seems that trace ("Test"+b_persons.length); runs earlier than function endLoad(all_data:Event) is completed
could you please help me?
| 0 | [
2,
1028,
3884,
203,
9,
387,
14692,
21,
7255,
800,
3726,
3726,
31,
22,
79,
78,
20,
28,
17,
31,
22,
79,
749,
20,
4705,
29,
109,
1513,
9,
31,
22,
79,
452,
14,
328,
3884,
4033,
13,
38,
45,
8209,
800,
78,
1231,
13,
5,
6,
73,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ExpatParser$ParseException when parsing a local xml file using SAX parser in android
===
I'm trying to learn how to parse an xml file using SAX parser in Android.
I placed an example xml file as such: res/xml/example.xml
Here is the xml code
<?xml version="1.0" encoding="utf-8"?>
<maintag>
<item>
<name>
AndroidPeople
</name>
<website category="android" >
www.androidpeople.com
</website>
</item>
<item>
<name>
iPhoneAppDeveloper
</name>
<website category="iPhone" >
www.iphone-app-developer.com
</website>
</item>
</maintag>
Here is the main Activity class
package com.me.xml_trail;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.LinearLayout;
import android.widget.TextView;
public class XMLParsingExample extends Activity
{
/** Create Object For SiteList Class */
SitesList sitesList = null;
SAXParserFactory spf;
SAXParser sp;
XMLReader xr;
InputSource is;
MyXMLHandler myXMLHandler;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);
/** Create a new layout to display the view */
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(1);
/** Create a new textview array to display the results */
TextView name[];
TextView website[];
TextView category[];
try
{
/** Handling XML */
spf = SAXParserFactory.newInstance();
}
catch (Exception e)
{
Log.d("mytag","1 " + e);
}
try
{
sp = spf.newSAXParser();
}
catch (Exception e)
{
Log.d("mytag","2 " + e);
}
try
{
xr = sp.getXMLReader();
}
catch (Exception e)
{
Log.d("mytag","3 " + e);
}
try
{
/** Send URL to parse XML Tags */
is = new InputSource(getResources().openRawResource(R.xml.example));
is.setEncoding("utf-8");
}
catch (Exception e)
{
Log.d("mytag","4 " + e);
}
try
{
/** Create handler to handle XML Tags ( extends DefaultHandler ) */
myXMLHandler = new MyXMLHandler();
}
catch (Exception e)
{
Log.d("mytag","5 " + e);
}
try
{
xr.setContentHandler(myXMLHandler);
}
catch (Exception e)
{
Log.d("mytag","6 " + e);
}
try
{
xr.parse(new InputSource(is.getByteStream()));
}
catch (Exception e)
{
Log.d("mytag","7 " + e);
}
/** Get result from MyXMLHandler SitlesList Object */
sitesList = MyXMLHandler.sitesList;
/** Assign textview array lenght by arraylist size */
name = new TextView[sitesList.getName().size()];
website = new TextView[sitesList.getName().size()];
category = new TextView[sitesList.getName().size()];
/** Set the result text in textview and add it to layout */
for (int i = 0; i < sitesList.getName().size(); i++)
{
name[i] = new TextView(this);
name[i].setText("Name = " + sitesList.getName().get(i));
website[i] = new TextView(this);
website[i].setText("Website = " + sitesList.getWebsite().get(i));
category[i] = new TextView(this);
category[i].setText("Website Category = " + sitesList.getCategory().get(i));
layout.addView(name[i]);
layout.addView(website[i]);
layout.addView(category[i]);
}
/** Set the layout view to display */
setContentView(layout);
}
}
Here is my logcat
> cscCountry is not German : BTU
>
> 7 org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: not well-formed (invalid token)
>
> threadid=1: thread exiting with uncaught exception (group=0x40018578)
>
> FATAL EXCEPTION: main
>
> java.lang.RuntimeException: Unable to start activity ComponentInfo{com.heiba.xml_trail/com.heiba.xml_trail.XMLParsingExample}: java.lang.NullPointerException
>
> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
>
> at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
>
> at android.app.ActivityThread.access$1500(ActivityThread.java:117)
>
> at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
>
> at android.os.Handler.dispatchMessage(Handler.java:99)
>
> at android.os.Looper.loop(Looper.java:130)
>
> at android.app.ActivityThread.main(ActivityThread.java:3687)
>
> at java.lang.reflect.Method.invokeNative(Native Method)
>
> at java.lang.reflect.Method.invoke(Method.java:507)
>
> at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
>
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
>
> at dalvik.system.NativeStart.main(Native Method)
>
> Caused by: java.lang.NullPointerException
>
> at com.heiba.xml_trail.XMLParsingExample.onCreate(XMLParsingExample.java:113)
>
> at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
>
> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
>
> ... 11 more
The problem is in the line xr.parse(new InputSource(is.getByteStream()));
Why do I get this | 0 | [
2,
1396,
5972,
3574,
4104,
4403,
3574,
870,
10066,
872,
76,
2017,
18,
68,
21,
375,
23504,
3893,
568,
16070,
2017,
4104,
19,
13005,
800,
3726,
3726,
31,
22,
79,
749,
20,
2484,
184,
20,
2017,
870,
40,
23504,
3893,
568,
16070,
2017,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Combining 2 query's using group_concat and the 2nd query needs the result
===
I'm trying to combine these 2 queries but am unable to.
The second query is used to concatenate question numbers into this format 32,33,34 and which is then used in the first query as the question_id's. Using
GROUP_CONCAT(DISTINCT questions.question_id SEPARATOR ',')
I'm trying to get a users score per course which is the aim without doing multiple queries in PHP which is currently slow for creating large reports with many users.
SELECT SUM(IF(`user_answer`=4,2,0)) + SUM(IF(`user_answer`=3,1,0)) as finalscore
FROM `user_answers` WHERE `schedule_survey_id` = 141 AND `survey_id` = 2 AND `question_id` in (34,33,32) AND `user_id` = 1
SELECT GROUP_CONCAT(DISTINCT questions.question_id SEPARATOR ','),
COUNT(course_task.question_id) as no_of_qs, course.course_id
FROM questions, questions_surveys, course_task, `course`
WHERE questions.question_id = questions_surveys.question_id
AND questions_surveys.survey_id = 2
AND questions.question_id = course_task.question_id
AND course_task.course_id = course.course_id
GROUP BY course_task.course_id
Thanks | 0 | [
2,
12803,
172,
25597,
22,
18,
568,
214,
1,
1126,
5782,
17,
14,
172,
706,
25597,
2274,
14,
829,
800,
3726,
3726,
31,
22,
79,
749,
20,
12287,
158,
172,
9386,
2829,
47,
589,
2343,
20,
9,
14,
153,
25597,
25,
147,
20,
1065,
9530,
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... |
@implementation classname {}
===
I found few codes like this
#SOMECLASS.h
@interface SOMECLASS : SOMESUPERCLASS
@end
#SOMECLASS.m
@implementation SOMECLASS {
NSMutableArray *a;
NSMutableArray *b;
NSMutableArray *c;
BOOL d;
}
@synthesize something;
- (id)init
{
self = [super init];
if (self) {
//something
}
return self;
}
can someone explain me what this actually means ? the @implementation and then '{' some variable declarations here '}' what does this mean ? what are the scopes of the variables declared in here ? | 0 | [
2,
13,
1,
8983,
413,
1130,
857,
718,
7259,
13,
1,
800,
3726,
3726,
31,
216,
310,
11358,
101,
48,
6926,
3220,
1898,
9,
252,
13,
1,
6280,
6413,
109,
1898,
13,
45,
109,
8542,
1898,
13,
1,
2451,
6926,
3220,
1898,
9,
79,
13,
1,
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... |
Get linux routes using Netlink
===
I am new to netlink sockets of linux and what I am trying to do is request the kernel to send all its routes. I am sending a RTM_GETROUTE message with NLM_F_ROOT flag. When reply from kernel is received I want to read the responses one by one(one netlink message at a time). First I am reading the message header to get the length of the message.
Code:
status = RECV (fd, buf, NLMSG_HDRLEN, 0);
RECV is a wrapper for recv(). Next I am reading the remaining bytes of the message:
Code:
status = RECV (fd, buf + NLMSG_HDRLEN, nlhdr->nlmsg_len - NLMSG_HDRLEN, 0);
What is happening is that the message header is OK but the fields of the remaining part of the message is showing erroneous values.
Can anybody please tell me what should I do to read messages like this?
Thanks in advance.
NOTE: When I am reading all the netlink responses in one go in a large buffer, everything is going just fine. | 0 | [
2,
164,
13024,
5050,
568,
4275,
6258,
800,
3726,
3726,
31,
589,
78,
20,
4275,
6258,
18482,
18,
16,
13024,
17,
98,
31,
589,
749,
20,
107,
25,
3772,
14,
17007,
20,
2660,
65,
82,
5050,
9,
31,
589,
4907,
21,
13,
5256,
79,
1,
3060,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 effect is not smooth in phonegap iphone
===
jquery effect is not smooth in phonegap application on iphone
i am using simple script for show-hide but page is blinking up.
enter code here $( '#signupbtn1' ).live('click',function(event)
{
$('#header').slideUp('slow');
$('#content').slideDown('slow');
});
any idea why it's not working properly | 0 | [
2,
487,
8190,
93,
1590,
25,
52,
3905,
19,
1132,
1136,
306,
21024,
800,
3726,
3726,
487,
8190,
93,
1590,
25,
52,
3905,
19,
1132,
1136,
306,
3010,
27,
21024,
31,
589,
568,
1935,
3884,
26,
298,
8,
19522,
47,
2478,
25,
18015,
71,
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... |
magento show "Sign up to get notified when this product is back in stock" link for simple-associated products
===
How can we display the "Sign up to get notified when this product is back in stock" link for associated products of a configurable product.
Say, we have a T-Shirt (a configurable product) and we sell it in 3 sizes - Medium, Large and Xtra-Large (simple - associated products).
When the Large size goes out of stock, how can we make user subscribe for it for notification when it is back in stock.
Please note I have already set this setting in admin:
System > Configuration > Catalog > Allow Alert When Product Comes Back in Stock - Yes
I noticed that the url for this alert is like (it is for one of the simple products in my store):
http://localhost/mystore/index.php/productalert/add/stock/product_id/1/[some key]/[some key],,/
Is there any way we can call this url directly, passing the product id of our associated product in question? If so, what about those keys at the end of the url?
please guide.
thanks | 0 | [
2,
4723,
17050,
298,
13,
7,
11255,
71,
20,
164,
22904,
76,
48,
2374,
25,
97,
19,
2070,
7,
3508,
26,
1935,
8,
23009,
43,
1985,
800,
3726,
3726,
184,
92,
95,
3042,
14,
13,
7,
11255,
71,
20,
164,
22904,
76,
48,
2374,
25,
97,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
UITableView unselecting all
===
I have my app layer out like this ViewController->ContentController->SearchController - so VC loads a view of CC and CC loads a view of SC. In SC I have a UITableView and a UITextField.
I am able to access these from VC by getting VC subviews to get to CC and repeating again to get to SC and then one more time to list the views on it. (If there is a more elegant way to do that I'd love to hear it).
So my question is: Can I reset the tableview on SC from VC? (I want to deselect everything). I can reset the text field from VC, just not sure how to go about calling the table methods.
Thanks | 0 | [
2,
13,
11193,
579,
4725,
367,
18,
16964,
68,
65,
800,
3726,
3726,
31,
57,
51,
4865,
5385,
70,
101,
48,
1418,
12898,
1252,
8,
1,
25424,
12898,
1252,
8,
1,
25136,
12898,
1252,
13,
8,
86,
13,
8990,
19069,
21,
1418,
16,
8093,
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... |
difference between queries
===
I'm building queries in HQL with join, and i've stack over one thing:
my query looks like:
From HistoryPerPhraseEntity as history left join history.linkAddressByLinkId where history.serviceId = :serviceId
and the query was fine, but when i was trying to throw response into my DataBase object and try to get values like this:
historyPhrase.get(0).getPhraseId()
i've got:
[Ljava.lang.Object; cannot be cast to com.rasp.lta.domain.HistoryPerPhraseEntity
but after change into this:
Select history From HistoryPerPhraseEntity as history left join history.linkAddressByLinkId where history.serviceId = :serviceId
everything is ok.
Could anybody answer why i need "Select from" in this query?
Thanks
| 0 | [
2,
2841,
128,
9386,
2829,
800,
3726,
3726,
31,
22,
79,
353,
9386,
2829,
19,
746,
22402,
29,
1865,
15,
17,
31,
22,
195,
7566,
84,
53,
584,
45,
51,
25597,
1879,
101,
45,
37,
447,
1432,
13314,
870,
2291,
856,
28,
447,
225,
1865,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
VBA Working Through Garbage to Set Row Label for Loop Segment and Toggle Next Label
===
I'm not sure the title really reflects what I'm asking but I hope this will. Included are examples of my data source and destination. The source book has a lot more garbage data,cell formatting and merged cells then the one shown. I have gotten around most of it. I just noticed the example I forgot to put the actual column for the offset in the source example.
I have this working 90% the only issue is in range A. If you notice in the source xSTR1 and xSTR2 are row headers not always in the same row so static range will not work. These row headers need to follow the data associated to it through the loop. I have had it working to the point of the first header but can't figure out the logic for the switch.
I have tried a number of different things loading the xSTR* cell addresses into array with a loop prior to the others then having as trigger to change the header. tried using offsets of y and validation but it was not working through the garbage data well. Many others that were researched and some that I realized weer not going to work halfway through the code...
My latest idea is to do a count of rows between xSTR1 and xSTR2 the somehow loop/trigger the label change and just paste.value the same count in the destination WB. I'm still working on how not to make a mess of the destination WB by doing that.. Not sure its possible the way its working in my head. I believe I could get it working with a second nested loop in x and comparison . I have however been trying to get into a habit of getting more with less. I am still learning this and from what I have read optimizing from the start takes less time then after the code is complete. I'm starting to wonder if I'm not taking that idea to far in this situation. Any help or feed back is appreciated greatly. I'll keep plugging away and see if I can get something to work..
![enter image description here][1]
[1]: http://i.stack.imgur.com/m5wSV.jpg
Option Explicit
Option Compare Text
Sub parse()
Application.DisplayAlerts = False
'Application.EnableCancelKey = xlDisabled
Dim strPath As String, strPathused As String
strPath = "C:\clerk plan2"
Dim objfso As FileSystemObject, objFolder As Folder, objfile As Object
Set objfso = CreateObject("Scripting.FileSystemObject")
Set objFolder = objfso.GetFolder(strPath)
'Loop through objWorkBooks
For Each objfile In objFolder.Files
If objfso.GetExtensionName(objfile.Path) = "xlsx" Then
Dim objWorkbook As Workbook
Set objWorkbook = Workbooks.Open(objfile.Path)
' Set path for move to at end of script
strPathused = "C:\prodplan\used\" & objWorkbook.Name
objWorkbook.Worksheets("inbound transfer sheet").Activate
objWorkbook.Worksheets("inbound transfer sheet").Cells.UnMerge
'Range management WB
Dim SRCwb As Worksheet, SRCrange1 As Range, SRCrange2 As Range, SRCrange3 As Range, SRCrange4 As Range, lastrow As Range
Set SRCwb = objWorkbook.Worksheets("inbound transfer sheet")
Set SRCrange1 = SRCwb.Range("g3:g150")
Set SRCrange2 = SRCwb.Range("a1:a150")
Set SRCrange3 = SRCwb.Range("a3:p150")
Dim DSTws As Worksheet
Set DSTws = Workbooks("clerkplan2.xlsm").Worksheets("transfer")
Dim x As Variant
Dim y As Variant
Dim STR1 As String, STR2 As String, xSTRtest As Integer, toggleSTR As String, toggle As Boolean, _
xVAL As String, altLASTrow As Range, exit4x As Boolean
STR1 = "INBOUND TRANS"
STR2 = "INBOUND CA TRANS"
Set altLASTrow = Workbooks("clerkplan2.xlsm").Worksheets("transfer").Range("c" & DSTws.Rows.Count).End(xlUp).Offset(1, -2)
For Each x In SRCrange2
Dim xSTR1 As String
Dim xSTR2 As String
xSTR1 = Mid(x, 1, 13)
xSTR2 = Mid(x, 1, 16)
If xSTR1 <> STR1 And xSTR2 <> STR2 Then GoTo xNEXT
If xSTR1 = STR1 Or xSTR2 = STR2 Then xVAL = x
If xSTR2 = STR2 And xSTR1 = STR1 Then MsgBox "Error Both xSTR1 and XSTR2 can not match"
For Each y In SRCrange1
Set lastrow = Workbooks("clerkplan2.xlsm").Worksheets("transfer").Range("c" & DSTws.Rows.Count).End(xlUp).Offset(1, 0)
y.Copy
lastrow.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, skipblanks:=True, Transpose:=False
DSTws.Activate
ActiveCell.Offset(0, -1) = objWorkbook.Name
objWorkbook.Activate
y.Offset(0, 8).Copy
Set lastrow = Workbooks("clerkplan2.xlsm").Worksheets("transfer").Range("d" & DSTws.Rows.Count).End(xlUp).Offset(1, 0)
lastrow.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, skipblanks:=True, Transpose:=False
objWorkbook.Activate
y.Offset(0, 9).Copy
Set lastrow = Workbooks("clerkplan2.xlsm").Worksheets("transfer").Range("e" & DSTws.Rows.Count).End(xlUp).Offset(1, 0)
lastrow.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, skipblanks:=True, Transpose:=False
Next y
xNEXT:
Next x
strPathused = "C:\clerk plan2\used\" & objWorkbook.Name
objWorkbook.Close False
'Move proccesed file to new Dir
Dim OldFilePath As String
Dim NewFilePath As String
OldFilePath = objfile 'original file location
NewFilePath = strPathused ' new file location
Name OldFilePath As NewFilePath ' move the file
End If
Next
End Sub
| 0 | [
2,
566,
969,
638,
120,
15024,
20,
309,
3131,
1899,
26,
5293,
5631,
17,
20,
263,
4875,
328,
1899,
800,
3726,
3726,
31,
22,
79,
52,
562,
14,
581,
510,
11967,
98,
31,
22,
79,
3379,
47,
31,
1376,
48,
129,
9,
506,
50,
3770,
16,
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... |
Confirm Email Address before Submitting AJAX Form
===
I have a form that I'm submitting through AJAX. The form includes many fields, but the two I'm having trouble with are "emailaddress" and "confirmemailaddress". I'd like it if the form could only be submitted if the these two fields are identical. The caveat is that these two forms are also not required. So if they are both blank, they should be able to submit just fine.
Here's the code I am working with thus far. I've removed a lot of the visual effects that happen during and after the form submits to keep it clean.
$(function() {
$("#contact_form form").submit(function() {
var thistarget = this.target;
$("#contact_form form").validate({
rules: {
emailaddress: "required",
confirmemailaddress: {
equalTo: "#emailaddress"
}
}
});
return false;
$.ajax({
type: this.method,
url: this.action,
data: $(this).serialize(),
success: function() {
alert ("success:");
$('#contact_form').html("<div id='message'></div>");
$('#message').html("<h2>Request Form Submitted!</h2>")
.append("<p>We will be in touch soon.</p>")
.hide()
.fadeIn(1500, function() {
$('#message').append("Thank you!");
});
}
});
return false;
});
}); | 0 | [
2,
10265,
8517,
3218,
115,
28848,
20624,
505,
800,
3726,
3726,
31,
57,
21,
505,
30,
31,
22,
79,
28848,
120,
20624,
9,
14,
505,
1103,
151,
2861,
15,
47,
14,
81,
31,
22,
79,
452,
2572,
29,
50,
13,
7,
62,
8079,
27950,
7,
17,
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... |
microdating nesting?
===
I'm new to SEO and heard that using microdata tags in html can dramatically improve SEO. So, for one of my pages, the schema type is an organization... in particular a sports team. One of the properties for a sports team is the members. So, I have the following code:
<div itemscope itemtype="http://schema.org/SportsTeam">
<span itemprop="name">New York Yankees</span>
<span itemprop="members">Derek Jeter</span>
</div>
The "members" itemprop has to be a person itemscope (http://schema.org/Person). What is the format for nesting one itemscope inside of another? | 0 | [
2,
2899,
43,
1880,
24338,
60,
800,
3726,
3726,
31,
22,
79,
78,
20,
13,
18,
3894,
17,
752,
30,
568,
2899,
18768,
3383,
18,
19,
13,
15895,
92,
13241,
3545,
13,
18,
3894,
9,
86,
15,
26,
53,
16,
51,
4434,
15,
14,
23874,
1001,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Losing precision by saving a BigDecimal in Play Framework
===
I'm using Play Framework 1.2.4 with H2 in memory database.
public void aBigDecimalSavingTest() {
BigDecimalEntity bde = new BigDecimalEntity();
bde.bd= new BigDecimal("0.225");
System.out.println(bde.bd); // print 0.225
bde.save();
bde = BigDecimalEntity.findById(Long.valueOf("1"));
System.out.println(bde.bd); // print 0.23
}
Where does this problem come from ?
Play Framework ? Database support ? JPA Missing Annotation ? ...
Thanks! | 0 | [
2,
2281,
13133,
34,
7599,
21,
580,
9522,
49,
3482,
19,
418,
6596,
800,
3726,
3726,
31,
22,
79,
568,
418,
6596,
137,
9,
135,
9,
300,
29,
746,
135,
19,
1912,
6018,
9,
317,
11364,
21,
6407,
9522,
49,
3482,
25102,
10543,
5,
6,
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... |
clojure-jack-in error
===
I installed clojure-mode and slime using the emacs starter kit and I get this error when I do clojure-jack-in -
Symbols value as variable is void: slime-clj
What could be causing this?
Thanks! | 0 | [
2,
7383,
2142,
99,
8,
6994,
8,
108,
7019,
800,
3726,
3726,
31,
4066,
7383,
2142,
99,
8,
15570,
17,
8824,
62,
568,
14,
13,
62,
6893,
18,
11744,
6346,
17,
31,
164,
48,
7019,
76,
31,
107,
7383,
2142,
99,
8,
6994,
8,
108,
13,
8,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Combine seperate images into a single image using HTML tags
===
I have 3 parts of images and I have to display it as single image and also want to include the links to the 3 parts of images using HTML tags.
I created the table with 1 column and 2 rows and I inserted the images into the 3 section of the table. But it have some spaces between the upper and the lower images (1st and 2nd row). How can resolve this problem and create a single graphic without any spaces and also need to include link into the 3rd image.
Need help urgently | 0 | [
2,
12287,
10332,
106,
1373,
3502,
77,
21,
345,
1961,
568,
13,
15895,
3383,
18,
800,
3726,
3726,
31,
57,
203,
1341,
16,
3502,
17,
31,
57,
20,
3042,
32,
28,
345,
1961,
17,
67,
259,
20,
468,
14,
6271,
20,
14,
203,
1341,
16,
3502,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 retrieve blob stored in mysql using php?
===
I want to retrieve a image stored in mysql DB.Here is my php code and it displays-[{"DC_Image":null}] | 1 | [
2,
184,
20,
11917,
334,
10904,
8214,
19,
51,
18,
22402,
568,
13,
26120,
60,
800,
3726,
3726,
31,
259,
20,
11917,
21,
1961,
8214,
19,
51,
18,
22402,
13,
9007,
9,
6836,
25,
51,
13,
26120,
1797,
17,
32,
9412,
8,
2558,
1,
7,
7201,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Remove a page form recommendation box
===
I have recommendation box on my site http://www.strf.ru/
There was one popular page, that doesn't exist any more (http://www.strf.ru/material.aspx?CatalogId=221&d_no=44149). But it still appears in recommendation box. How can I remove this page from plugin?
Thanks! | 0 | [
2,
4681,
21,
2478,
505,
14066,
1649,
800,
3726,
3726,
31,
57,
14066,
1649,
27,
51,
689,
7775,
6903,
6483,
9,
384,
8291,
9,
1820,
118,
80,
23,
53,
844,
2478,
15,
30,
1437,
22,
38,
3182,
186,
91,
13,
5,
21127,
6903,
6483,
9,
384... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
unrecognized selector sent to class in OAuthCore class
===
I have created one library project, in that i am trying to Twitter sharing. But when i tried to on Twitter the application is crashes at following line
NSString *_oAuthNonce = [NSString ab_GUID];
by error:
+[NSString ab_GUID]: unrecognized selector sent to class 0x1a09fd8
ab_GUID this method is present in OAuthCore class
+ (NSString *)ab_GUID
{
CFUUIDRef u = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef s = CFUUIDCreateString(kCFAllocatorDefault, u);
CFRelease(u);
return [(NSString *)s autorelease];
}
(My all classes are present in static Library) | 0 | [
2,
367,
99,
13974,
103,
1333,
23946,
795,
20,
718,
19,
635,
1346,
96,
10375,
718,
800,
3726,
3726,
31,
57,
679,
53,
1248,
669,
15,
19,
30,
31,
589,
749,
20,
10623,
6126,
9,
47,
76,
31,
794,
20,
27,
10623,
14,
3010,
25,
21563,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Vertical 'Gridview with pages' or 'Viewpager'
===
What I functionally need is a `Vertical ViewPager with GridView`.
So every page of the `ViewPager` should have a `GridView`, but the `ViewPager` is horizontal.
So there are two possibilities:
- Rotate the ViewPager with GridViews
- Create a GridView that shows the items in pages
The GridView should show 0-20 when the user scrolls 20-40 etc etc.
Does anyone have a solution for this?
<font size="1">I have checked [this link][1], but I cannot use it cause of legal reasons.</font>
[1]: https://github.com/JakeWharton/Android-DirectionalViewPager | 0 | [
2,
7035,
13,
22,
16375,
4725,
29,
4434,
22,
54,
13,
22,
4725,
6486,
139,
22,
800,
3726,
3726,
98,
31,
7652,
102,
376,
25,
21,
13,
1,
8122,
4272,
1418,
6486,
139,
29,
7354,
4725,
1,
9,
86,
352,
2478,
16,
14,
13,
1,
4725,
6486... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Many to Many on many to
===
I´m trying to map an existing database to Hibernate using annotations.
The problem is as follows.
'organization' and 'organization_roles' has a many to many relationship which is resolved in a
table 'organization_has_roles' using the two primary keys as a composite primary key in the join table.
Next there is a 'users' table. Users can have a single role in multiple organizations. This is again resolved in a join table named 'users_has_organizations_and_role' which has a composite primary key of the 'user_id', 'organization_id' and 'organization_role_id' and a unique_index on the 'user_id' and 'organization_id'.
The 'users_has_organizations_and_role' references the 'organization_has_roles' composite primary key(organization_id, organization_role_id) and the users table (user_id)
I have not been able to find examples on this matter that worked.
Is it possible to map this. Which Annotations should I use and how?
I´m using Hibernate 4, although it might not matter..
| 0 | [
2,
4148,
2102,
8820,
151,
20,
151,
27,
151,
20,
800,
3726,
3726,
31,
307,
749,
20,
2942,
40,
3149,
6018,
20,
4148,
2102,
8820,
568,
40,
1270,
7504,
9,
14,
1448,
25,
28,
2415,
9,
13,
22,
6826,
1829,
22,
17,
13,
22,
6826,
1829,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Detect image that only contains text
===
I have a database with two kinds of images:
- Photos with text integrated or not
- Images that only contains a background color and text over it
I have a delphi webservice and I want to send to the clients only the photos. Does exist any simple and fast algorithm to detect if a image is only a background with text over it?
What type of approach should use?
Thanks in advance | 0 | [
2,
9092,
1961,
30,
104,
1588,
1854,
800,
3726,
3726,
31,
57,
21,
6018,
29,
81,
8623,
16,
3502,
45,
13,
8,
7064,
29,
1854,
5547,
54,
52,
13,
8,
3502,
30,
104,
1588,
21,
2395,
1665,
17,
1854,
84,
32,
31,
57,
21,
23030,
2741,
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 to replace cursor code with CTE in sql server 2008
===
I have a condition where I need to pull id's from one master table and then based on that value pull values from two different tables and then update/insert into third table with these values.
I am using cursor to loop through the records in master table however I feel like this is leading to performance issue. I wanted to know if this can be done using CTE or not. I tried using CTE but it is non recursive and I am totally lost where I am going wrong.
Here is how my stored procedure is -
//
BEGIN
declare @variables char(10);
DECLARE @cursor CURSOR; --DECLARE CURSOR
SET @cursor = CURSOR FOR -- SET CURSOR
-- pull in value for curso
OPEN @cursor
FETCH NEXT
FROM @cursor INTO @variables --FILL IN CURSOR TO LOOP THROUGH
WHILE @@FETCH_STATUS = 0
BEGIN
BEGIN
--PUll values from table 1
END
BEGIN
--Pull values from table 1
-- Do some maths on the values pulled
END
BEGIN
--function/sql to update or insert
END
FETCH NEXT
FROM @cursor INTO @variables;
END
CLOSE @cursor;
DEALLOCATE @cursor;
END
//
With CTE, my code is -
//
;WITH CTE AS
(
--pull values from master table
)
BEGIN
BEGIN
-- pull values from table 1
END
BEGIN
-- Pull values from table 2, do the calculations
END
BEGIN
-- insert or update as needed.
END
//
| 0 | [
2,
184,
20,
3934,
29588,
1797,
29,
13,
22447,
19,
4444,
255,
8128,
570,
800,
3726,
3726,
31,
57,
21,
2874,
113,
31,
376,
20,
2201,
4924,
22,
18,
37,
53,
1129,
859,
17,
94,
432,
27,
30,
1923,
2201,
4070,
37,
81,
421,
7484,
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... |
Jython module used from Java class with Axis2, path error
===
I have a Java class wrapping Jython and using it to execute pure Python module (MyModule.py), how can I proceed to bundled the file MyModule.py so that it can be easily deployed and bundled inside the right .aar file?
how must I handle the path trouble that may happen (I used to `sys.path.append()` directly from Java, but it is too much computer dependent!
of course, trying to bundle it as it, and deploying it on another machine I obtain:
error occured! see: [Ljava.lang.StackTraceElement;@e3220a // this is from Java!
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named MyModule
(while it works well on mine)
is it possible to bundled MyFile.py inside the aar file and handling directly this path trouble?
or maybe to bundle it as an alone jar file that will be linked to the aar, from the Axis2 assistant (*Eclipse > New > others > Axis2 Service Archiver*)
(sorry, i'm really new to all this path trouble and interactions bewteen Jython/Java/Axis2)
best regards | 0 | [
2,
487,
93,
11570,
12613,
147,
37,
8247,
718,
29,
8577,
135,
15,
2013,
7019,
800,
3726,
3726,
31,
57,
21,
8247,
718,
13437,
487,
93,
11570,
17,
568,
32,
20,
15644,
4267,
20059,
12613,
13,
5,
915,
19673,
62,
9,
6448,
6,
15,
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... |
CakePHP CakeMail sending email to a TLS Microsoft Exchange Server 2010 (Hosted Exchange in Godaddy)
===
I've been trying several configuration options to send email using CakePHP (CakeMail) to a Microsoft Exchange 2010 Server. This is my current configuration:
public $default = array(
'transport' => 'Smtp',
'from' => array('email@example.com' => 'Me'),
'host' => 'smtp.ex3.secureserver.net',
'port' => 587,
'timeout' => 30,
'username' => 'verifiedUserName',
'password' => 'verifiedPassword',
'client' => null,
'log' => true,
'delivery' => 'smtp'
);
And this is my testing function:
public function test_email() {
App::uses('CakeEmail', 'Network/Email');
$email = new CakeEmail();
$email->config('default');
debug($email->config());
$result = $email->template('checkout')
->from('email@example.com')
->emailFormat('text')
->to('another@example.com')
->subject('TEST EMAIL ')
->send();
}
I'm getting a
SMTP Error: 504 5.7.4 Unrecognized authentication type
If i change the host to 'ssl://smtp.ex3.secureserver.net' or 'tls://smtp.ex3.secureserver.net' i'm getting a
Unable to connect to SMTP server.
The server is configured to use TLS.
Any ideas ? | 0 | [
2,
8390,
26120,
8390,
8079,
4907,
8517,
20,
21,
13,
7786,
18,
7099,
1950,
8128,
498,
13,
5,
25219,
1950,
19,
162,
25078,
6,
800,
3726,
3726,
31,
22,
195,
74,
749,
238,
8091,
6368,
20,
2660,
8517,
568,
8390,
26120,
13,
5,
17568,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Repeating self performSelector
===
I was just wandering If there is a simplier method to repeat the codes below for 20 seconds. If there is, how?
[self performSelector:@selector( move1) withObject:nil afterDelay:0.0];
[self performSelector:@selector( move2) withObject:nil afterDelay:0.2];
[self performSelector:@selector( move3) withObject:nil afterDelay:0.4];
[self performSelector:@selector( move1) withObject:nil afterDelay:0.8];
[self performSelector:@selector( move2) withObject:nil afterDelay:0.10];
[self performSelector:@selector( move3) withObject:nil afterDelay:0.12]; | 0 | [
2,
17389,
1119,
11563,
16964,
248,
800,
3726,
3726,
31,
23,
114,
14209,
100,
80,
25,
21,
22862,
10491,
2109,
20,
6830,
14,
11358,
1021,
26,
434,
2582,
9,
100,
80,
25,
15,
184,
60,
636,
8411,
11563,
16964,
248,
45,
1,
3434,
19932,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SMS cannot be prevented using abortBroadcast()?
===
I am working on a sms blocker application, in which i am using broadcast receiver and abortBroadcast() method - as many ppl have suggested here - to prevent messages from reaching inbox and alerting the user. But in my case, when I send a sms using the emulator, the SMS message won't get blocked, and reaches the inbox, also I get an error :
06-29 09:19:05.854: E/BroadcastReceiver(868): BroadcastReceiver trying to return result during a non-ordered broadcast
which doesn't terminate the app in the emulator, however the application gets terminated when I test it on my phone.
And yes, I have set the receiver's priority to a high number and asked for the permissions as you see here:
<receiver android:name="SMSMonitor">
<intent-filter android:priority="9999999">
<action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
</intent-filter>
</receiver>
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RAISED_THREAD_PRIORITY"/>
Finally, here's my code:
public class SMSMonitor extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
boolean isOn = loadState(context,"isOn");// is blocking enabled?
Bundle bundle = intent.getExtras();
Object messages[] = (Object[]) bundle.get("pdus");
SmsMessage smsMessage[] = new SmsMessage[messages.length];
String mAddress;
String mBody;
String mTime;
if(isOn){
// if spam blocking is enabled.
for (int n = 0; n < messages.length; n++) {
smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]);
mAddress=smsMessage[n].getDisplayOriginatingAddress().toString();
mBody=smsMessage[n].getDisplayMessageBody().toString();
mTime=getTime();
if( isBlackList( mAddress)== true) {
this.addLog(mAddress, mBody, mTime);
abortBroadcast();
Toast.makeText(context,"Incoming SMS was blocked and logged.", Toast.LENGTH_LONG).show();
}
}
Some one suggested [here][1] that the SMS broadcasts can't be aborted because Android won't allow it. But I have seen many guys here suggested using abortBroadcast() to block a sms, and also I know some SMS blocker apps on the market that actually CAN block SMSs. I don't know if they are using abortbroadcast or not.
Any ideas?
[1]: http://www.mail-archive.com/android-developers@googlegroups.com/msg05015.html | 0 | [
2,
7613,
18,
1967,
44,
8346,
568,
21557,
24162,
5,
6,
60,
800,
3726,
3726,
31,
589,
638,
27,
21,
7613,
18,
1921,
106,
3010,
15,
19,
56,
31,
589,
568,
1992,
6264,
17,
21557,
24162,
5,
6,
2109,
13,
8,
28,
151,
3273,
255,
57,
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... |
MySQL queuy, between 2 tables to get the right answer
===
I have got this script, I didn't make it, that get stats from our gameservers, then put them into a database, which works fine.
I also have another script, I didn't make it, that get the data from the database and displays the stats on a webpage, this is where my problem is.
It is a MySQL queue I need help with.
Ok I have 2 tables, and I need data from both in the query, to get the right answer
tbl_dogtags
KillerID
VictimID
Count
tbl_server_player
StatsID
ServerID
PlayerID
I need to take KillerID from tbl_dogtags and matach it with PlayerID from tbl_server_player, then do a where ServerID from tbl_server_player to give me the answer and I am not sure how to do this.
So something like this
KillerID = PlayerID where ServerID
Can anyone help please? | 0 | [
2,
51,
18,
22402,
9386,
16632,
15,
128,
172,
7484,
20,
164,
14,
193,
1623,
800,
3726,
3726,
31,
57,
330,
48,
3884,
15,
31,
223,
22,
38,
233,
32,
15,
30,
164,
12819,
18,
37,
318,
466,
106,
5498,
15,
94,
442,
105,
77,
21,
6018... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C# Facebook Page API - getting started
===
I want to implement "Post to FB Page" button to my CMS system. To be more price, I would like to be able to publish photos from my photo gallery to my FB page.
Graph API looks the most simple so far, but I still haven't figured how to post anything there.
Thanks,<br>
Ile | 0 | [
2,
272,
5910,
9090,
2478,
21,
2159,
13,
8,
1017,
373,
800,
3726,
3726,
31,
259,
20,
8713,
13,
7,
6962,
20,
13,
13478,
2478,
7,
5167,
20,
51,
2390,
18,
329,
9,
20,
44,
91,
2162,
15,
31,
83,
101,
20,
44,
777,
20,
10824,
7064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Implementing a new class in PyCuda
===
I'm a begginer in using pycuda, so far, I've learned some basic stuff how to write the kernels from book "Cuda by example", and my next task is to use a class, that is already written in C++, inside of kernels. How can I import this .h file to pycuda? Do I have to use boost python for transfering this .h so it can be imported like any other module in python? The thing is that I only need this special variables inside of a kernel. This class is used for computing the derivatives and I will write you a couple of lines so you can see how it's constructed:
adoublecuda.h:
namespace adtl {
class adouble {
public:
// ctors
__device__ __host__ inline adouble();
__device__ __host__ inline adouble(const double v);
__device__ __host__ inline adouble(const adouble& a);
__device__ __host__ inline adouble operator - () const;
__device__ __host__ inline adouble operator + () const;
...etc.
I use this class inside of C-CUDA just typing the #include "adoublecuda.h" and now I want to include the same thing in PyCUDA. I'm only using this class inside of kernels (I don't need adouble variables inside of main). So will I have to use boost python in order to include this header file to PyCuda?
Any advice would be appreciated, thank you for helping me! | 0 | [
2,
17333,
21,
78,
718,
19,
7103,
150,
5729,
800,
3726,
3726,
31,
22,
79,
21,
44,
19086,
1031,
19,
568,
7103,
150,
5729,
15,
86,
463,
15,
31,
22,
195,
2691,
109,
2125,
3217,
184,
20,
2757,
14,
17007,
18,
37,
360,
13,
7,
150,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
J2EE Spring framework
===
I m new in Spring Framework.I want to cal a new window on click on link, but that page contains data retriving through database.How to do that?? and that data is retrived by controller having model and view method type.
Thanx for ur support. | 0 | [
2,
487,
135,
2851,
1573,
6596,
800,
3726,
3726,
31,
307,
78,
19,
1573,
6596,
9,
49,
259,
20,
3550,
21,
78,
1463,
27,
10840,
27,
3508,
15,
47,
30,
2478,
1588,
1054,
302,
3367,
8397,
120,
6018,
9,
1544,
20,
107,
30,
60,
60,
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... |
Values are overwrite while saving in NSMutableArray
===
i am saving the user info in the NSMutableDictionary with key "username" and then saving this Dictionary in another NSMutableDictionary with key "name" and then saving the Dictionary in the NSMutableArray. But the Problem is that whenever i save another user with different username it overwrites the values in the NSMutableArray. Below is the code which i am using
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *directory = [paths objectAtIndex:0];
NSString *userArrayFilePath = [[NSString alloc] initWithString:[directory stringByAppendingPathComponent:@"userData"]];
if (username.length != 0)
{
[dataDictionary setObject:[NSString stringWithFormat:@"%@",username] forKey:@"username"];
[dataDictionary setObject:[NSString stringWithFormat:@"%lf",totalValue] forKey:@"totalValue"];
[dataDictionary setObject:[NSString stringWithFormat:@"%lf",totalPay] forKey:@"totalPay"];
[userDictionary setObject:dataDictionary forKey:@"name"];
[[[ArraysManager sharedInstance] getTotalUserArray] addObject:userDictionary];
[[[ArraysManager sharedInstance] getTotalUserArray] writeToFile:userArrayFilePath atomically:NO];
[dataDictionary removeAllObjects];
[userDictionary removeAllObjects];
NSLog(@"ArraysManager description is %@ ",[[[ArraysManager sharedInstance] getTotalUserArray] description]);
}
| 0 | [
2,
4070,
50,
84,
23716,
133,
7599,
19,
13,
2172,
7903,
579,
8576,
93,
800,
3726,
3726,
31,
589,
7599,
14,
4155,
15404,
19,
14,
13,
2172,
7903,
579,
22595,
1857,
29,
1246,
13,
7,
16704,
7259,
7,
17,
94,
7599,
48,
9186,
19,
226,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Tent screen in Android
===
A friend has asked me if I can create an Android app that can change white to red/yellow or another colour in another app, so applying a tint to the screen for all apps until it's turned off.
I've no idea where to start on this, has anyone got knowledge of this?
Can someone point me in the right direction of some reading? | 0 | [
2,
6797,
2324,
19,
13005,
800,
3726,
3726,
21,
860,
63,
411,
55,
100,
31,
92,
1600,
40,
13005,
4865,
30,
92,
753,
359,
20,
402,
118,
17589,
54,
226,
4609,
19,
226,
4865,
15,
86,
11989,
21,
5353,
38,
20,
14,
2324,
26,
65,
4865,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 check .NET framework version and Microsoft Visual C++ run-time library version in Windows via command line (Putty)
===
I often use putty to access some Windows Server machine. To troubleshooting an installation, I need to know which .NET framework version and MS Visual C++ run-time library that machine are installed.
From this: [Question][1]
[1]: http://stackoverflow.com/questions/2238696/is-there-a-way-to-determine-the-net-framework-version-from-the-command-line
I know how to get .NET framework version by:
dir %WINDIR%\Microsoft.Net\Framework\v*
But not MS Visual C++ run-time library.
Is there any solution? | 0 | [
2,
184,
20,
2631,
13,
9,
2328,
6596,
615,
17,
7099,
3458,
272,
20512,
485,
8,
891,
1248,
615,
19,
1936,
1197,
1202,
293,
13,
5,
4881,
1084,
6,
800,
3726,
3726,
31,
478,
275,
442,
1084,
20,
1381,
109,
1936,
8128,
1940,
9,
20,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to change the column dynamically in jasper report
===
hi am new to jasper report.i need to know how to generate reports dynamically in jasper reports? In my case table has id,name,desgn as fields.i need to manipulate five different queries in one jrxml file.first one will select the entire table.second one will select id,name alone and third one name alone in this way i have to do.here i succeed with selecting the entire table but am getting confused with other so guide me to proceed further to overcome the remaining. | 0 | [
2,
184,
20,
753,
14,
4698,
7782,
1326,
19,
16750,
1330,
800,
3726,
3726,
4148,
589,
78,
20,
16750,
1330,
9,
49,
376,
20,
143,
184,
20,
7920,
2813,
7782,
1326,
19,
16750,
2813,
60,
19,
51,
610,
859,
63,
4924,
15,
7259,
15,
3196,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
AS3: finding an object by it Instance name in a dynamic added child
===
I am doing an Adobe AIR Kiosk app but I am having a little problem.
First step is to generate a webcam container:
var bandwidth:int = 0;
var quality:int = 100;
var camera:Camera = Camera.getCamera();
camera.setQuality(bandwidth, quality);
camera.setMode(885,575,30,true);
var video:Video = new Video(885,575);
video.attachCamera(camera);
video.name = "camara";
webcam.addChild(video);
It works ok, the problem is that I want to apply to it a custom filter
It works ok if I write it this way:
MovieClip(parent).contenedor_postal.postal.webcam.filters = [filter];
But I want to affect only the child inside the clip "webcam" without affecting other MC's, so I write it like this:
MovieClip(parent).contenedor_postal.postal.webcam.camara.filters = [filter];
and does not work. I used to program in AS2, so maybe the trick is very simple but I can't find anything that works. Thanks in advance! | 0 | [
2,
28,
240,
45,
3007,
40,
3095,
34,
32,
4851,
204,
19,
21,
7782,
905,
850,
800,
3726,
3726,
31,
589,
845,
40,
20299,
282,
28092,
4865,
47,
31,
589,
452,
21,
265,
1448,
9,
64,
1424,
25,
20,
7920,
21,
2741,
8760,
12147,
45,
4033... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Assembly language how to increment variables
===
so I have this part of the code
mov SI, 0002
mov ah, INPUT[SI]
INC SI
mov al, INPUT[SI]
sub AX, 3030h
aad
inc al
cmp byte ptr INPUT[0002], 39h
jne OTHER
OTHER: aam
add ax, 3030h
mov INPUT[0003], al
mov INPUT[0002], ah
where the input is the user input.
What this code does is to increment a 2 digit number,
my problem, when a three digit number is to be incremented.
Example:
Input: 98
output: 99
Input: 99
Output: 110
Desired results:
Input: 99
Output: 100 | 0 | [
2,
1475,
816,
184,
20,
13,
28461,
12157,
800,
3726,
3726,
86,
31,
57,
48,
141,
16,
14,
1797,
13,
15146,
2769,
15,
13,
3993,
135,
13,
15146,
13,
1307,
15,
6367,
2558,
18,
49,
500,
3016,
2769,
13,
15146,
493,
15,
6367,
2558,
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... |
"Hook up" Browser Scrollbar to only a single HTML Element
===
I want everything in my page to stay put when I scroll except for just one specified element.
How do I magically "hook up" one HTML element to the browser's default scrollbar so that it affects only that one element in my entire HTML document? ... **Without using the position:fixed property**?
I only need to support Chrome.
I know I'm dreaming crazy, but I'm hoping a CSS/JavaScript/HTML wizard can calm me down a bit with some zany contraption. | 0 | [
2,
13,
7,
20378,
71,
7,
16495,
12159,
1850,
20,
104,
21,
345,
13,
15895,
4520,
800,
3726,
3726,
31,
259,
796,
19,
51,
2478,
20,
1179,
442,
76,
31,
12159,
1613,
26,
114,
53,
9931,
4520,
9,
184,
107,
31,
8090,
102,
13,
7,
20378,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Battlefield 3 Stats Api
===
I'm building a web app in PHP. In the app need to pull in some stats from the game Battlefield 3 via api requests. I'm looking for a source to use for the api requests. I've looked at <a href="http://bf3stats.com">bf3stats.com</a>, however they recommend that I cache the results and not poll for every page request.
What I'm looking for is an api where I can poll for data a couple times a minute. Are there any such api's available? Does <a href="http://www.ea.com/">EA</a>'s Blaze offer an api? | 1 | [
2,
12004,
203,
12819,
18,
21,
2159,
800,
3726,
3726,
31,
22,
79,
353,
21,
2741,
4865,
19,
13,
26120,
9,
19,
14,
4865,
376,
20,
2201,
19,
109,
12819,
18,
37,
14,
250,
12004,
203,
1197,
21,
2159,
12279,
9,
31,
22,
79,
699,
26,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Follow via twitter api
===
I am trying to send followers via twitter api. I am developing an application which will send followers to application's other users. I can make this happen with friendship/create, but when I try to send 50 followers, server gives 30 seconds connection timeout error.
I know that is possible, but I dont know how I can do it. Please tell me how can i send 30, 40, 50 followers for one time (in seconds) to another twitter user via api?
| 0 | [
2,
1740,
1197,
10623,
21,
2159,
800,
3726,
3726,
31,
589,
749,
20,
2660,
8518,
1197,
10623,
21,
2159,
9,
31,
589,
3561,
40,
3010,
56,
129,
2660,
8518,
20,
3010,
22,
18,
89,
3878,
9,
31,
92,
233,
48,
2384,
29,
5683,
118,
6037,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Extending .net control: How to prevent HTML atttribute from rendering
===
I've written a server control that extends the standard .net Gridview control.
However, by default the standard gridview control adds a **border="0"** attribute to the html markup that it produces, and I want to prevent this attribute from being rendered by my server control.
I could probably use ScriptManager to add a bit of Javascript that removes the attribute once the page that the control sits on has loaded, but that seems a bit clunky and I was hoping that somebody could tell me how to do it cleanly by, for example, adding **this.Attributes.Remove("border");** to the PreRender event of the control or something similar (which didn't work by the way, or I wouldn't have to ask the question)
| 0 | [
2,
8176,
13,
9,
2328,
569,
45,
184,
20,
2501,
13,
15895,
35,
38,
14755,
37,
15307,
800,
3726,
3726,
31,
22,
195,
642,
21,
8128,
569,
30,
9073,
14,
1236,
13,
9,
2328,
7354,
4725,
569,
9,
207,
15,
34,
12838,
14,
1236,
7354,
4725... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Joomla 2.5 password reset user sync
===
We have a Joomla 2.5 website and a second site (non-Joomla) that needs to have user information synchronized. We already have implemented a user registration that syncs to the other system after the email verification link is clicked.
The issue I have now is password reset. Joomla has a nice system to allow a user to reset the password. What I need to know is once the user clicks on the email to start the reset process (reset.php), how can I grab the user information within the confirm() method? All I need is the user (email or id) so that I can pass the new encrypted password to the other system.
Any suggestions would be VERY helpful. | 0 | [
2,
2640,
2636,
531,
172,
9,
264,
20884,
23422,
4155,
6063,
150,
800,
3726,
3726,
95,
57,
21,
2640,
2636,
531,
172,
9,
264,
2271,
17,
21,
153,
689,
13,
5,
3951,
8,
24161,
79,
531,
6,
30,
2274,
20,
57,
4155,
676,
27202,
9,
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... |
Why operator overloading fails?
===
In the following codes, I illustrate an example of operator overloading:
#include <iostream>
using namespace std;
template <typename T>
class A
{
public:
A() {};
A( T &obj) {value = obj;};
~A() {};
T value;
template <typename E>
A<T>& operator = (const A<E> &obj)
{
cout<<"equal operator"<<endl;
if(this == &obj)
return *this;
value = obj.value;
return *this;
}
};
int main()
{
int temp;
temp = 3;
A<int> myobjects(temp);
cout<<myobjects.value<<endl;
temp = 7;
A<int> yourobjects(temp);
yourobjects = myobjects;
cout<<yourobjects.value<<endl;
return 0;
}
However, when I debug this program, I find that the main program does not invoke the equal operator overloading function. However, if I change the equal operator in the following way:
A<T>& operator = (const A<T> &obj)
{
cout<<"equal operator"<<endl;
if(this == &obj)
return *this;
value = obj.value;
return *this;
}
It will work. Do you have any ideas why the initial function does not work?
| 0 | [
2,
483,
6022,
84,
16866,
13614,
60,
800,
3726,
3726,
19,
14,
249,
11358,
15,
31,
15620,
40,
823,
16,
6022,
84,
16866,
45,
6926,
22640,
13,
1,
1963,
11260,
1,
568,
204,
5582,
354,
43,
73,
22894,
13,
1,
4474,
7259,
13,
38,
1,
71... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 localize the Liferay blog post date display?
===
We use Liferay with German as the default user's settings, as described here:
http://www.liferay.com/community/wiki/-/wiki/Main/Configure+time+zones+and+locale
However, as soon as we use the blog portlet, the date of a blog entry is displayed in English format: 7/11/12 6:00 AM
Is there a way to change the default display to German format?
Thanks a lot for your help! | 0 | [
2,
184,
92,
31,
375,
2952,
14,
201,
2787,
8146,
678,
1231,
3042,
60,
800,
3726,
3726,
95,
275,
201,
2787,
29,
548,
28,
14,
12838,
4155,
22,
18,
12410,
15,
28,
745,
235,
45,
7775,
6903,
6483,
9,
4102,
2787,
9,
960,
118,
28360,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQLAlchemy modelling a complex relationship using reflection
===
I am querying a proprietary database which is maintained by a third party. The database has many tables each with large numbers of fields.
My problem refers to three tables of interest, Tree, Site and Meter.
The tree table describes nodes in a simple tree structure. Along with other data it has a foreign key referencing its own primary key. It also has an Object_Type field and an Object_ID field. The Site and Meter tables each have many fields.
A tree node has a one-to-one relationship with **either** be a meter **or** a site. If the Object_Type field is 1 then the Object_ID field refers to the primary key in the Site table. If it is 2 then it refers to the primary key in the Meter table.
following this example [https://bitbucket.org/sqlalchemy/sqlalchemy/src/408388e5faf4/examples/declarative_reflection/declarative_reflection.py][1]
I am using reflection to load the table structures like so
Base = declarative_base(cls=DeclarativeReflectedBase)
class Meter(Base):
__tablename__ = 'Meter'
class Site(Base):
__tablename__ = 'Site'
class Tree(Base):
__tablename__ = 'Tree'
Parent_Node_ID = Column(Integer, ForeignKey('Tree.Node_ID'))
Node_ID = Column(Integer, primary_key=True)
children = relationship("Tree", backref=backref('parent', remote_side=[Node_ID]))
Base.prepare(engine)
I have included the self-referential relationship and that works perfectly. How can I add the two relationships using Object_ID as the foreign key, with the appropriate check on the Object_Type field?
[1]: https://bitbucket.org/sqlalchemy/sqlalchemy/src/408388e5faf4/examples/declarative_reflection/declarative_reflection.py | 0 | [
2,
4444,
10834,
2569,
915,
23089,
21,
1502,
1429,
568,
9138,
800,
3726,
3726,
31,
589,
25597,
68,
21,
18856,
6018,
56,
25,
3926,
34,
21,
422,
346,
9,
14,
6018,
63,
151,
7484,
206,
29,
370,
2116,
16,
2861,
9,
51,
1448,
3806,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
My jQuery scripts work when access the file, but not as a intranet site
===
Issue - When I access my page \\\server\d$\Intranet\Homepage.htm everything works. No issues. When I access has a homepage, "http://server/intranet/homepage.htm"(intranet not a website) no scripts work. The page/scripts work on every pc, so it isn't a broswer issue.
linked code - `
<meta http-equiv="X-UA-Compatible" content="IE=edge" > <!--Added to see if compatiblity was the issue-->
<link href="css/main.css" rel="stylesheet" type="text/css" /> <!--css works-->
<link href="css/vader/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.7.2.min.js" charset="UTF-8"></script>
<script src="js/jquery-ui-1.8.21.custom.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/jquery.scripts" charset="UTF-8"></script>
`
It isn't a conflict with two versions (I've removed the 1.8.21 and still is broken). Everything I've read says IIS doesn't limit it just serves, but I'm not sure. I'm just getting started with IIS, jQuery and coding in general. Any help is greatly needed and appreciated! | 0 | [
2,
51,
487,
8190,
93,
17505,
170,
76,
1381,
14,
3893,
15,
47,
52,
28,
21,
14369,
2328,
689,
800,
3726,
3726,
1513,
13,
8,
76,
31,
1381,
51,
2478,
13,
1,
10321,
106,
1,
43,
4403,
1,
108,
1939,
2328,
1,
8167,
6486,
9,
9020,
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... |
Can't pause video in firefox using jQuery
===
HTML:
<video class="0" autoplay="true" width="586px" height="440" src=""></video>
JS:
$('video').mediaelementplayer();
if($('video').attr('class') == "0"){
$('video')[0].player.pause();
}
In chrome the video is paused correctly. However in firefox it is not paused. Any ideas how to fix this? | 0 | [
2,
92,
22,
38,
6911,
763,
19,
535,
18219,
568,
487,
8190,
93,
800,
3726,
3726,
13,
15895,
45,
13,
1,
14785,
718,
3726,
7,
387,
7,
3108,
5438,
3726,
7,
13398,
7,
9456,
3726,
7,
264,
3274,
306,
396,
7,
2947,
3726,
7,
16403,
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... |
Fatal error in CodeIgniter while calling function itselft
===
I want to insert dynamic data into my preorder traversal table. I am using rebuild_tree technique by referencing this tutorial : http://www.sitepoint.com/hierarchical-data-database-3/
Here I modified the code as per the need in codeigniter. But when I calling function rebuild_tree in foreach loop it showing the fatal error like :
Fatal error: Maximum function nesting level of '100' reached, aborting! in /var/www/hr/system/database/drivers/mysql/mysql_driver.php on line 199 Call Stack: 0.0389 360600 1. {main}() /var/www/hr/index.php:0 0.0401 468096 2. require_once('/var/www/hr/system/core/CodeIgniter.php') /var/www/hr/index.php:240 0.0689 3798516 3. call_user_func_array() /var/www/hr/system/core/CodeIgniter.php:359 0.0689 3798588 4. Structure->add_structure() /var/www/hr/system/core/CodeIgniter.php:0 0.0689 3798632 5.
structure_model->rebuild_tree() /var/www/hr/application/controllers/test/structure.php:42 0.0701 3928356 6. structure_model->rebuild_tree() /var/www/hr/application/models/test/structure_model.php:35 0.0703 3931572 7. structure_model->rebuild_tree() /var/www/hr/application/models/test/structure_model.php:35 0.0705 3934788 8. structure_model->rebuild_tree() /var/www/hr/application/models/test/structure_model.php:35 0.0706 3938008 9.
CI_DB_driver->query() /var/www/hr/application/models/xome/structure_model.php:29 0.0848 4216988 97. CI_DB_driver->simple_query() /var/www/hr/system/database/DB_driver.php:299 0.0848 4216988 98. CI_DB_mysql_driver->_execute() /var/www/hr/system/database/DB_driver.php:453 0.0848 4216988 99. CI_DB_mysql_driver->_prep_query() /var/www/hr/system/database/drivers/mysql/mysql_driver.php:178
And Following is my code:
function rebuild_tree($parent, $left) {
$resultArr = array();
$parent = $_GET['level'];
$left = $_GET['lft'];
$right = $_GET['rgt'];
$right = $left + 1;
$sql = 'SELECT * FROM subunit WHERE level="' . $parent . '";';
$query = $this->db->query($sql);
$data = $query->result();
foreach ($data as $datap) {
$resultArr['name'] = $datap->name;
$resultArr['level'] = $datap->level;
$right = $this->rebuild_tree($resultArr['level'], $right);
}
$sql = 'UPDATE subunit SET lft=' . $left . ', rgt=' . $right . ' WHERE name="' . $parent . '";';
$query = $this->db->query($sql);
return $right + 1;
}
Is there any solution for this. Thank you. | 0 | [
2,
8773,
7019,
19,
1797,
9693,
242,
106,
133,
2555,
1990,
1145,
38,
800,
3726,
3726,
31,
259,
20,
14692,
7782,
1054,
77,
51,
782,
7861,
19501,
192,
859,
9,
31,
589,
568,
16128,
1,
8101,
4873,
34,
13,
29254,
48,
29724,
13,
45,
77... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
In Adobe Reader how to crop image with fixed aspect ratio
===
I want to crop the image in Adobe Reader to keep fixed aspect ratio of 4:3. Is there any setting for this? | 0 | [
2,
19,
20299,
7765,
184,
20,
9833,
1961,
29,
3535,
7289,
4825,
800,
3726,
3726,
31,
259,
20,
9833,
14,
1961,
19,
20299,
7765,
20,
643,
3535,
7289,
4825,
16,
21721,
9,
25,
80,
186,
2697,
26,
48,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Getting the last record id through procedure
===
I am new learner and trying to get the last inserted id of a record.
But here it's giving me the following error:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT @p_customerId' at line 1
Any idea how to fix this.
Thanks,
<?php
class MyConnection{
var $db_host = '127.0.0.1';
var $db_user = 'root';
var $db_password = 'xxx';
var $db_name = 'xxx';
var $connection;
function Connect(){
$this->connection = @mysqli_connect($this->db_host, $this->db_user, $this->db_password)
or
die("Error: ".mysqli_connect_error());
mysqli_select_db($this->connection, $this->db_name);
mysqli_query($this->connection, "SET NAMES 'utf8'");
}
function Disconnect(){
mysqli_close($this->connection);
}
function ExecSQL($query){
$result = mysqli_query($this->connection, $query) or die('Error: '.mysqli_error($this->connection));
return $result;
}
function LastInsertId() {
return mysqli_insert_id();
}
}
if (isset($_POST['btnSubmit'])) {
$v_custname = mysql_real_escape_string($_POST['txtcustname']);
$v_custphone = mysql_real_escape_string($_POST['txtcustphone']);
$v_custemail = mysql_real_escape_string($_POST['txtcustemail']);
$conn = new MyConnection();
$conn->Connect();
$conn->ExecSQL("CALL sp_customer('$v_custname','$v_custphone','$v_custemail',@p_customerId); SELECT @p_customerId;");
echo $conn->LastInsertId();
$conn->Disconnect();
}
?>
Here's the procedure;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_customer`(IN `p_customerName` VARCHAR(50), IN `p_customerPhone` VARCHAR(50), IN `p_customerEmail` VARCHAR(50), OUT `p_customerId` INT)
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
INSERT INTO customer(CustomerName, CustomerPhone, CustomerEmail)VALUES(p_customerName, p_customerPhone, p_customerEmail);
SELECT LAST_INSERT_ID() as p_customerId;
END | 0 | [
2,
1017,
14,
236,
571,
4924,
120,
7004,
800,
3726,
3726,
31,
589,
78,
2484,
106,
17,
749,
20,
164,
14,
236,
14215,
4924,
16,
21,
571,
9,
47,
235,
32,
22,
18,
1438,
55,
14,
249,
7019,
45,
7019,
45,
42,
57,
40,
7019,
19,
154,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Accessing particular service method from metro app?
===
i have a web services which i am accessing in my client application(metro app) , but i want to access a particular method inside those many methods i have how should i do it ,
as of now , i am doing it in this way to accessing the web services from my metro app:-
private async void Button_Click_1(object sender, RoutedEventArgs e)
{
string responseBodyAsText;
HttpClient client = new HttpClient();
HttpResponseMessage response = await client.GetAsync("http://182.134.34.99/OE/examplewebservices.svc");
response.EnsureSuccessStatusCode();
StatusText.Text = response.StatusCode.ToString();
responseBodyAsText = await response.Content.ReadAsStringAsync();
}
my requirement is :- there are many methods inside that examplewebservices , so i want to access one of the method inside that , pass input parameters to that method and get the result.
1)How to access one a particular method inside those many methods ( from metro app) ?
2)how to pass input to that service method (from metro app)?
Question might be very basic to you , pls help out. i am new to metro application development.
Thanks in advance. | 0 | [
2,
1381,
68,
1498,
365,
2109,
37,
3986,
4865,
60,
800,
3726,
3726,
31,
57,
21,
2741,
687,
56,
31,
589,
1381,
68,
19,
51,
6819,
3010,
5,
27176,
4865,
6,
13,
15,
47,
31,
259,
20,
1381,
21,
1498,
2109,
572,
273,
151,
3195,
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... |
How to describe content of file rar / zip in jtable from url or path(directory)?
===
How to describe content of file rar/zip in jtable from url or path directory in java ?<br>
i found in http://www.adarshr.com/papers/raroscope <br>
and http://www.javareference.com/jrexamples/viewexample.jsp?id=79<br>
but how to open from URL on describe to jtable ?<br><br>
sorry my english is bad | 0 | [
2,
184,
20,
4996,
2331,
16,
3893,
13,
15011,
13,
118,
12133,
19,
487,
5924,
37,
287,
6362,
54,
2013,
5,
10197,
93,
6,
60,
800,
3726,
3726,
184,
20,
4996,
2331,
16,
3893,
13,
15011,
118,
2553,
306,
19,
487,
5924,
37,
287,
6362,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
rails email error - 530-5.5.1 Authentication Required.
===
trying to send email form Ruby on Rails but getting this:
SocketError in UsersController#create
getaddrinfo: nodename nor servname provided, or not known
My environments/development.rb file has:
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "my_company.org",
authentication: "plain",
enable_starttls_auto: true,
user_name: "my_username@my_company.org",
password: "my_pass"
}
and
config.action_mailer.delivery_method = :smtp
and
config.action_mailer.default_url_options = { :host => 'localhost:5000' }
# 5000 rather than 3000 as I am using foreman. | 0 | [
2,
2240,
18,
8517,
7019,
13,
8,
13,
21260,
8,
264,
9,
264,
9,
165,
27963,
1390,
9,
800,
3726,
3726,
749,
20,
2660,
8517,
505,
10811,
27,
2240,
18,
47,
1017,
48,
45,
18482,
29992,
19,
3878,
12898,
1252,
5910,
6037,
1373,
164,
148... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ruby on rails shared hosting
===
I want to deploy a rails app on shared hosting server with mysql as database on cpanel but i don't have ssh access, please provide me all the steps or any link which can help me. | 1 | [
2,
10811,
27,
2240,
18,
2592,
10637,
800,
3726,
3726,
31,
259,
20,
17617,
21,
2240,
18,
4865,
27,
2592,
10637,
8128,
29,
51,
18,
22402,
28,
6018,
27,
272,
3206,
532,
47,
31,
221,
22,
38,
57,
13,
18,
1635,
1381,
15,
2247,
1181,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.