unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Create postgresql Table in java code
===
I have a code in java that connects with postgreSQL database.
now, I want that when it connects to the database, i will also create database table.
but my problem is that, it will not create the database, and I don't know what is the problem.
here is my code:
Statement st = null;
ResultSet rs = null;
try{
Class.forName("org.postgresql.Driver");
System.out.println("connect");
} catch (ClassNotFoundException cnfe){
System.out.println("Could not find the JDBC driver!");
System.exit(1);
}
Connection conn = null;
try {
//database location, database user, database password
conn = DriverManager.getConnection
("jdbc:postgresql:"POS_DB","postgres", "123456");
st = conn.createStatement();
String qs = "CREATE TABLE IF NOT EXISTS user(user_id SERIAL NOT NULL PRIMARY KEY,username varchar(225) NOT NULL UNIQUE,password varchar(225),islogged varchar(10))";
String qs1 = "SELECT * FROM test";
rs = st.executeQuery(qs);
System.out.println("connect");
} catch (SQLException sqle) {
System.out.println("Could not connect");
System.exit(1);
}
I am sure that my sql statement in creating the table is correct. but when I run this, it will not create the table. If I replace the string into `select` sql, there is no problem.
does anyone have an idea about my case?
thanks in advance .. | 0 | [
2,
1600,
678,
6879,
18,
22402,
859,
19,
8247,
1797,
800,
3726,
3726,
31,
57,
21,
1797,
19,
8247,
30,
8534,
29,
678,
6879,
18,
22402,
6018,
9,
130,
15,
31,
259,
30,
76,
32,
8534,
20,
14,
6018,
15,
31,
129,
67,
1600,
6018,
859,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Compiler run() method
===
I found this code online about the JavaCompiler
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
int result = compiler.run(null, null, null,
"src/org/kodejava/example/tools/Hello.java");
And it says for the `compiler.run(null, null, null` that these three nulls are the default `System.in`, `System.out` and `System.err` respectively. But what do these values actually do as I cannot find the API for these? Could someone please explain?
| 0 | [
2,
8247,
21486,
485,
5,
6,
2109,
800,
3726,
3726,
31,
216,
48,
1797,
2087,
88,
14,
8247,
11103,
49,
1252,
8247,
11103,
49,
1252,
21486,
800,
5607,
26735,
139,
9,
3060,
10724,
1004,
1385,
11103,
49,
1252,
5,
6,
73,
19,
38,
829,
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... |
Redirect URL's with index.php to wordpress default URL's doesn't work
===
i have questuon.
i moving from php based web site to wordpress system.
old links was domains.com/index.php?Subject={Value} for example:
domains.com/index.php?Subject=Mistake-19 , domains.com/index.php?Subject=Mistake domains.com/index.php?Subject=Home_Content-31
new links is regular wordpress urls domain.com/?p={value}
i tried to create htaccess but it's doesn't work.
for example
Redirect 301 /index.php?Subject=Mistake-19 http://www.domain.com/?p=51
it's trasfer me to domain.com/?Subject=Mistake-19
also tried this:
rewriterule ^index.php?Subject=Mistake-19(.*)$ http://www.domain.com/?p=51$1 [r=301,nc]
still transfer to domain.com/?Subject=Mistake-19
how i can fix it? | 0 | [
2,
302,
14706,
287,
6362,
22,
18,
29,
4348,
9,
26120,
20,
833,
5890,
12838,
287,
6362,
22,
18,
1437,
22,
38,
170,
800,
3726,
3726,
31,
57,
7769,
291,
218,
9,
31,
1219,
37,
13,
26120,
432,
2741,
689,
20,
833,
5890,
329,
9,
315,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Top and Left not reflecting the negative margin given
===
I have two elements in a div element. I am giving float left to one and float right to another. I am giving them the negative-margins but when i try to find out the top and left through the jquery .position() function as I have to apply some translation on them, the left element's left is not showing the same correct calculation as expected, the right element is giving the correct top and left. This is link for the same [Link to code on Jsfiddle][1]
[1]: http://jsfiddle.net/eD4Ws/21/
comment the margin-left in css for class figure1 and margin-right in css for class figure2 and note that margin of -80px is reflected in one but not the other when we see the output of console.log in terminal. | 0 | [
2,
371,
17,
225,
52,
11560,
14,
3682,
5440,
504,
800,
3726,
3726,
31,
57,
81,
2065,
19,
21,
13,
12916,
4520,
9,
31,
589,
1438,
11510,
225,
20,
53,
17,
11510,
193,
20,
226,
9,
31,
589,
1438,
105,
14,
3682,
8,
1615,
17040,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquery ui tab how to load external url with ajax?
===
i am new to learn jquery, i tried to using the [jquery ui official website][1] given example code
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
<div class="demo">
<div id="tabs">
<ul>
<li><a href="#tabs-1">Nunc tincidunt</a></li>
<li><a href="#tabs-2">Proin dolor</a></li>
<li><a href="#tabs-3">Aenean lacinia</a></li>
</ul>
<div id="tabs-1">
<p>some</p>
</div>
<div id="tabs-2">
<p>content</p>
</div>
<div id="tabs-3">
<p>is putting</p>
<p>here</p>
</div>
</div>
</div><!-- End demo -->
<div class="demo-description" style="display: none; ">
<p>Click tabs to swap between content that is broken into logical sections.</p>
</div><!-- End demo-description -->
i know there are alot of people asking relevant question here...and my question is duplicate with them. i am sorry about that i am really urgent to know, please help me.
first i need to know is it jquery ui tabs must put the javascript and css?my js is get from [jquery ui demo link][2] and copy to my folder..but it cannot work after i change little link..what happen is it?below is the full code i copy from demo jquery
<html>
<head>
<meta charset='utf-8'/>
<title>jQuery Tabs Demo</title>
<link rel="stylesheet" href="http://jqueryui.com/themes/base/jquery.ui.all.css">
<script src="js/jquery-1.7.2.js"></script>
<script src="js/jquery.ui.core.js"></script>
<script src="js/jquery.ui.widget.js"></script>
<script src="js/jquery.ui.tabs.js"></script>
<link rel="stylesheet" href="js/demos.css">
<script>
$(function() {
$( "#tabs" ).tabs({
ajaxOptions: {
error: function( xhr, status, index, anchor ) {
$( anchor.hash ).html(
"Couldn't load this tab. We'll try to fix this as soon as possible. " +
"If this wouldn't be a demo." );
}
}
});
});
</script>
</head>
<body>
<div class="demo">
<div id="tabs">
<ul>
<li><a href="#tabs-1">Preloaded</a></li>
<li><a href="ajax/content1.html">Tab 1</a></li>
<li><a href="ajax/content2.html">Tab 2</a></li>
<li><a href="ajax/content3-slow.php">Tab 3 (slow)</a></li>
<li><a href="ajax/content4-broken.php">Tab 4 (broken)</a></li>
</ul>
<div id="tabs-1">
<p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
</div>
</div>
</div><!-- End demo -->
<div class="demo-description">
<p>Fetch external content via Ajax for the tabs by setting an href value in the tab links. While the Ajax request is waiting for a response, the tab label changes to say "Loading...", then returns to the normal label once loaded.</p>
<p>Tabs 3 and 4 demonstrate slow-loading and broken AJAX tabs, and how to handle serverside errors in those cases. Note: These two require a webserver to interpret PHP. They won't work from the filesystem.</p>
</div><!-- End demo-description -->
</body>
</html>
second i need some very detail tutorial, can any one suggest to me please?
because i am really stupid with jquery...><
if you have a better idea to do tab which can load external url, please suggest to me!
thank you so much!
[1]: http://jqueryui.com/demos/tabs/
[2]: http://jqueryui.com/demos/tabs/ajax.html | 0 | [
2,
487,
8190,
93,
13,
5661,
6523,
184,
20,
6305,
4886,
287,
6362,
29,
20624,
60,
800,
3726,
3726,
31,
589,
78,
20,
2484,
487,
8190,
93,
15,
31,
794,
20,
568,
14,
636,
728,
8190,
93,
13,
5661,
989,
2271,
500,
2558,
165,
500,
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... |
How to come back to first activity from third activity?
===
I have three activities A,B & C.Now the Task i have this form A,B and C,in default android "standard"mode The activities navigation takes place like this A->B->C->B->A.Now What I want here is when I went to Activity C from B,when i backPressed In activity I went to previous Activity i.e.,B But i want to come back to A from C.How to achieve this could anyone tell about this??
Thanks In Advance | 0 | [
2,
184,
20,
340,
97,
20,
64,
2358,
37,
422,
2358,
60,
800,
3726,
3726,
31,
57,
132,
1648,
21,
15,
220,
279,
272,
9,
1387,
14,
3005,
31,
57,
48,
505,
21,
15,
220,
17,
272,
15,
108,
12838,
13005,
13,
7,
15566,
7,
15570,
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... |
iOS and Facebook API - posting on friends wall vs Tagging friends, verifying it and spam
===
1 - How like is that an APP that enourage a user to post on his friends wall will be tagged as Spam? Is it possible and sensible in iOS to allow the user to select a sublist of x friends and then post it only to those walls?
([here][1] is a similar topic)
2 - If I tag a friend instead it [seems][2] like I have to provide the user's with a place. Can the place be my App name?
3 - To verify that the post dialog has succeed is [this][3] the raccomended way?
[1]: http://stackoverflow.com/questions/11050070/using-the-facebook-ios-sdk-to-post-to-friends-wall
[2]: http://stackoverflow.com/questions/11465871/tag-a-user-in-a-profile-post-with-graph-api
[3]: http://stackoverflow.com/questions/9776790/check-success-of-facebook-dialog-post-in-facebook-ios-sdk | 0 | [
2,
13,
7760,
17,
9090,
21,
2159,
13,
8,
15669,
27,
954,
769,
4611,
3383,
2762,
954,
15,
21012,
68,
32,
17,
6954,
79,
800,
3726,
3726,
137,
13,
8,
184,
101,
25,
30,
40,
4865,
30,
1957,
4110,
1303,
21,
4155,
20,
678,
27,
33,
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... |
Modifiable Chatroulette script
===
Does anyone know of a free Chatroulette-esque script (preferably with video) that can be easily modified only to allow users who have a certain email address (e.g. @xxx.com)? | 0 | [
2,
7226,
25372,
6615,
8821,
15030,
3884,
800,
3726,
3726,
630,
1276,
143,
16,
21,
551,
6615,
8821,
15030,
8,
17029,
3884,
13,
5,
3515,
2407,
4801,
29,
763,
6,
30,
92,
44,
2351,
5372,
104,
20,
1655,
3878,
72,
57,
21,
1200,
8517,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Is it possible to set an Expiration Date/Time for a table in mysql?
===
I'm wondering if it is possible to set an "Expire" time or date when creating a table in mysql.
For example a table is created and will expire/auto-delete in 2 hours. Something to that effect. Google didn't give any answer so its probably not as simple as I'm hoping. | 0 | [
2,
25,
32,
938,
20,
309,
40,
29529,
1231,
118,
891,
26,
21,
859,
19,
51,
18,
22402,
60,
800,
3726,
3726,
31,
22,
79,
5712,
100,
32,
25,
938,
20,
309,
40,
13,
7,
6899,
7735,
7,
85,
54,
1231,
76,
2936,
21,
859,
19,
51,
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... |
PDCurses Win32a -- how to build on Windows 7
===
[PDCurses-Win32a][1] quite clearly claims that its implementation of init_color() works on Windows; but when I built it as a DLL in a Visual Studio project (after nmake failed, saying it couldn't find something called "rc"), it didn't. What do I need to do to make this work -- in a manner that can also display IBM Extended ASCII (Codepage 437) characters?
[1]: http://www.projectpluto.com/win32a.htm | 0 | [
2,
13,
9251,
4734,
7202,
628,
3125,
58,
13,
8,
8,
184,
20,
1895,
27,
1936,
453,
800,
3726,
3726,
636,
9251,
4734,
7202,
8,
4181,
3125,
58,
500,
2558,
165,
500,
1450,
2885,
2810,
30,
82,
6123,
16,
19,
242,
1,
11282,
5,
6,
693,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ActionBarSherlock library is full of errors after being imported
===
Okay, I'm trying to get ActionBarSherlock working, so I imported the library by:
Creating New Project > Create Project From Existing Source > Choosing library from the ActionBarSherlock folder
After that I imported a example project from the samples folder using the same method, Both the library and the sample are set to Android 15 Build Path!
My problem is, over 100 errors come up in the library, all kinds of stuff about abs_style not existing, And I have no idea whats wrong!
Things I have tried: <br>
Cleaning Project<br>
Setting build path to 13, 14 and 15
| 0 | [
2,
1028,
1850,
9161,
3966,
1248,
25,
503,
16,
11908,
75,
142,
11808,
800,
3726,
3726,
1705,
15,
31,
22,
79,
749,
20,
164,
1028,
1850,
9161,
3966,
638,
15,
86,
31,
11808,
14,
1248,
34,
45,
2936,
78,
669,
13,
1,
1600,
669,
37,
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... |
IIS and CName Records
===
A Co-Worker created a CName record pointing his site to ours e.g.
siteA.com to siteB.com
nslookup confirms that this is resolving to siteB.com's IP.
However, when I browse to siteA.com I get a webpage not available error.
Do I need to add an additional binding to IIS? If so, do I just need to add the siteA.com domain name, port (80), protocol (http), or do I need to include the IP it is resolving to. The same IP I'm seeing in nslookup?
Any help would be greatly appreciated. | 0 | [
2,
595,
18,
17,
272,
7259,
742,
800,
3726,
3726,
21,
326,
8,
22560,
679,
21,
272,
7259,
571,
6832,
33,
689,
20,
318,
18,
13,
62,
9,
263,
9,
689,
58,
9,
960,
20,
689,
220,
9,
960,
13,
2172,
5810,
576,
10265,
18,
30,
48,
25,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Passing a Javascript function through inline data- attributes
===
I'm working with a Javascript file upload library, and one of it's features is that it uses HTML5 inline data- attributes to pass information to the plugin.
This is working great for anything data related, strings, numbers etc., however the plugin has some callback methods you can assign function to. My problem is that when trying to pass a javascript function through these inline data attributes, like this:
<input type="file" name="test" data-on-finish="alert();">
The plugin picks up the reference to the onFinish() callback method fine, but when it tries to execute whatever javascript I put in there I get the error:
Uncaught TypeError: Object alert(); has no method 'call'
I'm assuming it's reading the `alert();` as a string. Any idea how I can pass through executable javascript to the plugin?
I believe the plugin I'm using is an extension to the jQuery file upload plugin:
[https://github.com/blueimp/jQuery-File-Upload/wiki/Options][1]
[1]: https://github.com/blueimp/jQuery-File-Upload/wiki/Options | 0 | [
2,
2848,
21,
8247,
8741,
1990,
120,
19,
1143,
1054,
8,
13422,
800,
3726,
3726,
31,
22,
79,
638,
29,
21,
8247,
8741,
3893,
71,
8294,
1248,
15,
17,
53,
16,
32,
22,
18,
967,
25,
30,
32,
2027,
13,
15895,
264,
19,
1143,
1054,
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... |
construct file tree from path components
===
I have an array of file path components like this:
[ ['some', 'dir', 'file.txt'],
['other', 'folder', 'here.txt'],
['this', 'one', 'is', 'deeper', 'file.txt'],
['some', 'dir', 'second.txt'
]
So the array contains arrays each consisting of path components to a file. The last element in an inner array is always the file itself, with the preceding elements being directories leading to the file.
What I'm trying to figure out is how to transform the above data so that I can easily generate a file tree with it using `<ul>` and `<li>` tags such that folders are nested within each other and files within the same folder show up together. All sorted alphabetically.
From the above I would like to generate the following. The file `<li>` themselves have to be links to the path to that file:
<ul>
<li>some/
<ul>
<li>dir/
<ul>
<li><a href="some/dir/file.txt">file.txt</a></li>
<li><a href="some/dir/second.txt">second.txt</a></li>
</ul>
</li>
</ul>
</li>
<li>other/
<ul>
<li>folder/
<ul>
<li><a href="other/folder/here.txt">here.txt<a/></li>
</ul>
</li>
</ul>
</li>
<li>this/
<ul>
<li>one/
<ul>
<li>is/
<ul>
<li>deeper/
<ul>
<li><a href="this/one/is/deeper/file.txt">file.txt</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
Thanks, I'd appreciate any ideas. | 0 | [
2,
6960,
3893,
1541,
37,
2013,
5090,
800,
3726,
3726,
31,
57,
40,
7718,
16,
3893,
2013,
5090,
101,
48,
45,
636,
636,
22,
3220,
22,
15,
13,
22,
9035,
22,
15,
13,
22,
16877,
9,
38,
396,
38,
22,
500,
15,
636,
22,
9539,
22,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
App's Mongoose Connection Closes
===
I have a simple webapp using node.js that reads the database and displays this data to the user. There is this issue where after the app isn't actively used, when viewed initially the connection errors out with a [Error: connection closed]. After reloading the connection seems to be ok. Here's pretty much all the important bits of the code...
//POSTPROVIDER.JS
var mongoose = require('mongoose');
var async = require('async');
var settings = require('./settings.js').mongodb;
if(!settings) {
console.log('Could not connect to MongoDB server - missing MongoDB settings');
}
var connectString = "mongodb://" +
settings.username + ":" + settings.password + "@" +
settings.hostname + ":" + settings.hostport + "/" +
settings.database;
mongoose.connect(connectString);
mongoose.connection.on('error', function(error) {
console.log(error)
mongoose.connect(connectString);
})
var Schema = mongoose.Schema;
var FeedbackSchema = new Schema({
//Schema
});
var feedbackDoc = mongoose.model('Feedback', FeedbackSchema);
//Example query
PostProvider.prototype.findByUuid = function(_id, callback) {
feedbackDoc.findById( _id).exclude('screenshot').exec(function (err, feedback) {
if (err) return callback(err);
var feedbacks = JSON.stringify(convertFeedback(feedback), null, ' ');
callback( null, feedbacks )
});
};
exports.PostProvider = PostProvider;
And the server code...
//APP.JS
var express = require('express');
var request = require('request');
var cluster = require('cluster');
var numCPUs = require('os').cpus().length;
var app = module.exports = express.createServer();
// Express Config
var pub = __dirname + '/public';
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.compiler({ src: pub, enable: ['sass'] }));
app.use(express.static(pub));
app.use(app.router);
});
var error = require('./error');
app.configure('development', function(){
app.use(error({ showMessage: true, dumpExceptions: true, showStack: true, logErrors: __dirname + '/log/error_log' }));
});
app.configure('production', function(){
app.use(error({ showMessage: true, dumpExceptions: true, showStack: true, logErrors: __dirname + '/log/error_log' }));
});
var PostProvider = require('./postprovider').PostProvider;
var PostProvider= new PostProvider();
if (cluster.isMaster) {
// Fork workers.
console.log("Master is running. [ %d ]", process.pid );
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('death', function(worker) {
console.log('worker ' + worker.pid + ' died');
console.log(worker)
cluster.fork();
});
} else {
// Worker processes have a http server.();
console.log("Worker is running. [ %d ]", process.pid );
//Main View
app.get('/', function(req, res){
var pageNum = 1;
res.render('layout', {
locals: {
title: 'View Portal',
pageNum: pageNum
}
});
});
app.listen(8900);
console.log("Express server listening on port 8900");
}
Is there a way to check the status of the connection, and if so a way to reconnect correctly before processing a query? | 0 | [
2,
4865,
22,
18,
3521,
839,
6641,
2760,
543,
18,
800,
3726,
3726,
31,
57,
21,
1935,
2741,
7753,
568,
15421,
9,
728,
18,
30,
11137,
14,
6018,
17,
9412,
48,
1054,
20,
14,
4155,
9,
80,
25,
48,
1513,
113,
75,
14,
4865,
2532,
22,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Manipulating dynamically created SVG elements
===
I'm trying to be able to "drag" SVG elements loaded from a database around a canvas using AJAX. I can load them and display them from the DB fine, but when I want to add event handlers to each individual one, I can't seem to get it right.
I tried using .on() after loading all elements from the DB, when the DOM is ready:
$('circle').on("mousedown", function(event) {
ox = event.screenX;
oy = event.screenY;
event.target.attr({opacity: .5});
dragging = true;
});
But this never seems to get called.
I can add events during the creation of the circles, but then only the last element added actually moves--but only if the mouse is within the X,Y of the other loaded circles:
var data = $.ajax({
type: "POST",
url: "map.php",
data: "loadMap=1",
success: function(text) {
var item = text.split(";");
for (x in item)
{
if (item[x].length > 0)
{
var str = item[x].split(",");
if (str[0] == "node")
{
var c = svg.circle(str[1], str[2], 10);
c.attr("id", str[3]);
c.attr("fill", "black");
c.attr("stroke", "none");
c.mousemove(function(event) {
if (dragging) {
c.translate(event.screenX - ox, event.screenY - oy);
ox = event.screenX;
oy = event.screenY;
}
});
c.mouseup(function(Event) {
dragging = false;
c.attr({opacity: 1});
});
}
else if (str[0] == "room")
{
}
}
}
}
});
What am I doing wrong, or better yet, what is the best way to approach this problem? | 0 | [
2,
27799,
7782,
1326,
679,
13,
18,
22955,
2065,
800,
3726,
3726,
31,
22,
79,
749,
20,
44,
777,
20,
13,
7,
43,
11208,
7,
13,
18,
22955,
2065,
8572,
37,
21,
6018,
140,
21,
9696,
568,
20624,
9,
31,
92,
6305,
105,
17,
3042,
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... |
Typing hidden words with jQuery
===
I need a function that triggers an event every time every time a word is entered while the browser is focused on the webpage. I figured I'd use jQuery for this and came up with the following which does the job:
$(document).ready(function(){
var target = "808072727373767673738080";
var input = "";
$(window).delegate('*', 'keyup', function (e){
input += e.keyCode;
if(input==target){
alert('philip');
}
if(e.keyCode==13){
input = "";
}
});
});
However I feel that there might be a simpler solution than to use the delegate function..<br>
Any advice or links to other posts?<br>
<br>
Many Regards<br>
-ajarbol | 0 | [
2,
25266,
3689,
715,
29,
487,
8190,
93,
800,
3726,
3726,
31,
376,
21,
1990,
30,
7286,
18,
40,
807,
352,
85,
352,
85,
21,
833,
25,
1297,
133,
14,
16495,
25,
2604,
27,
14,
2741,
6486,
9,
31,
5700,
31,
22,
43,
275,
487,
8190,
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... |
Doing graphics and drawings in a C++ Win32 client/frame area
===
How does one write code to make drawings in the Windows main client area of a Win32 C++ app?
I found an example online that uses the "eclipse" API but when I put it in my program, the IDE complained so it would not compile.
| 0 | [
2,
845,
8351,
17,
9646,
19,
21,
272,
20512,
628,
3125,
6819,
118,
8361,
217,
800,
3726,
3726,
184,
630,
53,
2757,
1797,
20,
233,
9646,
19,
14,
1936,
407,
6819,
217,
16,
21,
628,
3125,
272,
20512,
4865,
60,
31,
216,
40,
823,
2087... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 content animation + nivo slider: Why does the slider disappear?
===
I'm trying to do a Jquery - "always there" menu bar based on <a href="http://net.tutsplus.com/tutorials/javascript-ajax/how-to-load-in-and-animate-content-with-jquery">this tutorial</a>.
I have two pages: index.html and contact.html.
Both have a dv container named #wrap.
index.html has a Nivo Slider on its #wrap container.
The thing is, at first the slider works fine, but when I leave index.html
and come back the slider isn't there anymore.
The .js code for the content animation looks like this:
$(document).ready(function() {
var hash = window.location.hash.substr(1);
var href = $('#menu li a').each(function(){
var href = $(this).attr('href');
if(hash==href.substr(0,href.length-5)){
var toLoad = hash+'.html #wrap';
$('#wrap').load(toLoad)
}
});
$('#menu li a').click(function(){
var toLoad = $(this).attr('href')+' #wrap';
$('#wrap').fadeOut('fast',loadContent);
$('#load').remove();
$('#wrap').append('<span id="load">LOADING...</span>');
$('#load').fadeIn('fast');
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
function loadContent() {
$('#wrap').load(toLoad,'',showNewContent());
}
function showNewContent() {
$('#wrap').fadeIn('fast',hideLoader());
}
function hideLoader() {
$('#load').fadeOut('fast');
}
return false;
});
});
And for the slider:
$(document).ready(function() {
$('#slider').nivoSlider({
effect: 'fade',
pauseOnHover: false,
controlNav: false,
});
});
Any help would be appreciated! | 0 | [
2,
487,
8190,
93,
2331,
6236,
2754,
1781,
2625,
3295,
106,
45,
483,
630,
14,
3295,
106,
10866,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
107,
21,
487,
8190,
93,
13,
8,
13,
7,
21284,
80,
7,
11379,
748,
432,
27,
13,
1,
58,
746... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 anyone explain a simple description regarding 'file descriptor' after fork()?
===
In "Advanced Programming in the Unix Environment", 2nd edition, By W. Richard Stevens.
Section 8.3 fork function.
Here's the description:
It is important that the parent and the child share the same file offset.
Consider a process that forks a child, then waits for the child to complete. Assume that both processes write to standard output as part of their normal processing. If the parent has its standard output redirected (by a shell, perhaps) it is essential that the parent's file offset be updated by the child when the child writes to standard output.
***[1. What does it mean? if parent's std output is redirected to a 'file1' for example, then what should child update after child writes? parent's original std output offset or redirected ouput(i.e file1) offset? Can't be the later, right?]***
***[2. How is the update done? by child explicitly, by OS implicitly, by files descriptor itself? After fork, i thought parent and child went their own ways and has their own COPY of file descriptor. So how does child update offset to parent side?]***
In this case, the child can write to standard output while the parent is waiting for it; on completion of the child, the parent can continue writing to standard output, knowing that its output will be appended to whatever the child wrote. If the parent and the child did not share the same file offset, this type of interaction would be more difficult to accomplish and would require explicit actions by the parent.
If both parent and child write to the same descriptor, without any form of synchronization, such as having the parent wait for the child, their output will be intermixed (assuming it's a descriptor that was open before the fork). Although this is possible, it's not the normal mode of operation.
There are two normal cases for handling the descriptors after a fork.
1. The parent waits for the child to complete. In this case, the parent does not need to do anything with its descriptors. When the child terminates, any of the shared descriptors that the child read from or wrote to will have their file offsets updated accordingly.
2. Both the parent and the child go their own ways. Here, after the fork, the parent closes the descriptors that it doesn't need, and the child does the same thing. This way, neither interferes with the other's open descriptors. This scenario is often the case with network servers."
***[3. When fork() is invoked, all i understand is that child get a COPY of what parent has, file descriptor in this case, and does its thing. If any offset changes to file descriptor that parent and child share, it can only be because the descriptor remember the offset itself. Am i right?]***
Sorry i am kind of new to the concepts.
Any helps? Thanks. | 0 | [
2,
92,
1276,
3271,
21,
1935,
5318,
3467,
13,
22,
16877,
121,
8741,
248,
22,
75,
8777,
5,
6,
60,
800,
3726,
3726,
19,
13,
7,
1283,
2686,
11014,
3143,
19,
14,
22540,
2307,
7,
15,
172,
706,
1322,
15,
34,
619,
9,
1098,
8743,
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... |
Date picker sencha touch 2
===
I am creating a date picker field dynamically. I need to set the picker field value to a textfield. somehow i am unable to retrieve the picker value. The date picker is displayed but the done button is throwing an error saying "Cannot call method "Todatestring" of undefined.
My code is :
case 'date':
var cmp1 = Ext.create('Ext.Button', {
text:'Date:',
ui:'plain',
id:'datepicker',
handler:function () {
console.log('on date function called');
var datePicker = Ext.create('Ext.picker.Date',{
setValue: function(value, animated) {
console.log('inside set value function');
if (!Ext.isDate(value) && !Ext.isObject(value)) {
value = new Date();
this.value = {
day : value.getDate(),
year: value.getFullYear(),
month: value.getMonth() + 1
};
}
if (Ext.isDate(value)) {
this.value = {
day : value.getDate(),
year: value.getFullYear(),
month: value.getMonth() + 1
};
} else {
this.value = value;
}
return Ext.DatePicker.superclass.setValue.call(this, this.value, animated);
console.log('date val: '+datePicker);
}
});
Ext.getCmp('overlayId').add(datePicker);
datePicker.show();
Ext.getCmp('datefield').setValue('');
}
});
Ext.getCmp('overlayId').add({ xtype:'container', padding:10, items:[cmp1] });
var cmp = Ext.create('Ext.field.Text', {
//label:'Date:',
id:'datefield',
listener:{
focus:function () {
console.log('on blue function called');
}
}
});
break; | 0 | [
2,
1231,
2036,
106,
8252,
1651,
1723,
172,
800,
3726,
3726,
31,
589,
2936,
21,
1231,
2036,
106,
575,
7782,
1326,
9,
31,
376,
20,
309,
14,
2036,
106,
575,
1923,
20,
21,
1854,
1109,
9,
3625,
31,
589,
2343,
20,
11917,
14,
2036,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Ember.js routing, outlets and animation
===
It seems like if you want to animate a transition between states using the new Ember.js router and outlets, you're out of luck, since the previous content of an outlet will be destroyed before you have a chance to animate it. In cases where you can completely animate one view out before transitioning to the new state, there's no problem. It's only the case where both old and new views need to be visible that's problematic.
It looks like some of the functionality needed to animate both the previous outlet content and the new was added in [this commit](https://github.com/emberjs/ember.js/pull/1198), but I'm not sure I understand how to use it.
There's also been some discussion about using extra transitional routes/states to explicitly model the "in-between" states that animations can represent ([here](https://github.com/emberjs/ember.js/issues/779) and [here](https://github.com/emberjs/ember.js/commit/b5ff0edb41f50e1f55446c14605fb566aa419ed4)), but I'm not sure if it's currently possible to match this approach up with outletted controllers and views.
This is similar to http://stackoverflow.com/questions/11083392/ember-js-routing-how-not-to-destroy-view-when-exiting-a-route?rq=1, but I'm not sure overriding the `outlet` helper is a good solution.
Any ideas? | 0 | [
2,
13,
19603,
9,
728,
18,
19880,
15,
13071,
17,
6236,
800,
3726,
3726,
32,
2206,
101,
100,
42,
259,
20,
14487,
591,
21,
4513,
128,
202,
568,
14,
78,
13,
19603,
9,
728,
18,
858,
139,
17,
13071,
15,
42,
22,
99,
70,
16,
5419,
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... |
Adding files to Android System Folder
===
Not all Android phones can support Google Maps. This is because of 2 missing files, namely: `com.google.android.maps.jar` & `com.google.android.maps.xml`. How do I add these files to the `etc` and `framework` folder of Android.
Is it possible to add files in the system memory? If not, can you give viable solution for Google Maps compatability. | 0 | [
2,
4721,
6488,
20,
13005,
329,
19294,
800,
3726,
3726,
52,
65,
13005,
14830,
92,
555,
8144,
6867,
9,
48,
25,
185,
16,
172,
2863,
6488,
15,
8525,
45,
13,
1,
960,
9,
16111,
4875,
9,
290,
18524,
9,
15022,
18,
9,
6300,
1,
279,
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... |
Does Google Maps Javascript API v3 Geocoding Library overwrite localStorage keys with keys starting with "geocode:"?
===
I have Google Maps Javascript API v3 on a page and am using the Geocoding Library:
https://developers.google.com/maps/documentation/javascript/geocoding
**The Code**
In my google.maps.Geocoder.geocode callback function I am saving the lat,lng as JSON into the Chrome browser's window.localStorage like this:
if (localStorage.getItem('geocode:'+job.url) === null) {
geocoder.geocode({'address': job.address}, function(results, status) {
var json = JSON.stringify({
address: job.address,
lat: results[0].geometry.location.lat(),
lng: results[0].geometry.location.lng()
});
console.log('Set key:"geocode:'+job.url+'", value: '+json);
localStorage.setItem('geocode:'+job.url, json);
console.log('Get key:"geocode:'+job.url+'", value: '+localStorage.getItem('geocode:'+job.url));
});
}
**The problem** is my key is getting set to null outside the callback function.
After the above code runs and prints the two log messages, typing this in the Console shows the problem:
> localStorage.length;
1
> localStorage.key(0);
"geocode:123 street San Francisco CA USA"
> localStorage.getItem("geocode:123 street San Francisco CA USA");
null
Changing my localStorage key prefix to 'blah:' fixes the problem!
Does this mean the Google Maps Javascript API v3 Geocoding Library overwrites localStorage keys with a prefix "geocode:" after the callback function returns?
**Extra background info:**
I am including this script code on the page from a Chrome extension url like:
<script src="chrome:///blah" type="text/javascript"></script>
The call to google.maps.Geocoder.geocode and the callback function are called from a window.setTimeout handler. | 0 | [
2,
630,
8144,
6867,
8247,
8741,
21,
2159,
566,
240,
6389,
15458,
1248,
84,
23716,
375,
18,
2153,
1303,
5534,
29,
5534,
1422,
29,
13,
7,
834,
111,
9375,
45,
7,
60,
800,
3726,
3726,
31,
57,
8144,
6867,
8247,
8741,
21,
2159,
566,
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 seekbar with marks at discrete progress points
===
I want to have a seekbar(like int the link: [YUI Library Examples][1]) with marks at discrete progress points, but the progress interval is not static. How can I achieve this?
[1]: http://developer.yahoo.com/yui/examples/slider/slider-ticks.html | 0 | [
2,
13005,
5048,
1850,
29,
4872,
35,
18563,
3455,
819,
800,
3726,
3726,
31,
259,
20,
57,
21,
5048,
1850,
5,
1403,
19,
38,
14,
3508,
45,
636,
4703,
49,
1248,
3770,
500,
2558,
165,
500,
6,
29,
4872,
35,
18563,
3455,
819,
15,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there any way to resuse XLAM addin's funciton in another .NET project?
===
I have developed an XLAM addin for Excel by VBA language and I'm building another .NET project. I need to solve the same thing with completetly XLAM, i don't want re-write these code ([DRY][1]).
**Is there any way to resuse XLAM addin's funciton in another .NET project?**
eg I can compile `xlam` to `dll` and import to .NET project after that???
Thank you.
[1]: http://en.wikipedia.org/wiki/Don%27t_repeat_yourself | 0 | [
2,
25,
80,
186,
161,
20,
10719,
3699,
993,
4445,
3547,
108,
22,
18,
2414,
1892,
444,
19,
226,
13,
9,
2328,
669,
60,
800,
3726,
3726,
31,
57,
885,
40,
993,
4445,
3547,
108,
26,
20700,
34,
566,
969,
816,
17,
31,
22,
79,
353,
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... |
PostreSql compare with substring doesn't work
===
I want to select from 2 table where 2nd id is equal with first 4 character from first id
SELECT a.*, b.*, substring(a.my_id from 1 for 4)::integer as number
FROM table1 as a
INNER Join table2 as b ON(b.id_2=number) where my_id = 101
^
It produces an error here |
ERROR: column "number" does not exist
SQL state: 42703
Character: 189
| 0 | [
2,
678,
99,
18,
22402,
11590,
29,
972,
11130,
1437,
22,
38,
170,
800,
3726,
3726,
31,
259,
20,
5407,
37,
172,
859,
113,
172,
706,
4924,
25,
2747,
29,
64,
268,
925,
37,
64,
4924,
5407,
21,
9,
2483,
15,
334,
9,
2483,
15,
972,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Getting wrong week number in IPHONE
===
I am trying to get week Number in iPhone. I am using this piece of code
NSNumber* getWeek() {
NSDate *currDate = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"w.ee"];
NSString *dateString = [dateFormatter stringFromDate:currDate];
NSNumberFormatter *weekNumber = [[NSNumberFormatter alloc] init];
[weekNumber setNumberStyle:NSNumberFormatterDecimalStyle];
NSNumber *week = [weekNumber numberFromString:dateString];
[weekNumber release];
return week;
}
However, I have difference result, at simulator is ok, but when I ran in iPhone this got me "0"
Any helps? | 0 | [
2,
1017,
1389,
877,
234,
19,
21024,
800,
3726,
3726,
31,
589,
749,
20,
164,
877,
234,
19,
21024,
9,
31,
589,
568,
48,
1855,
16,
1797,
13,
2172,
16299,
2483,
164,
7219,
5,
6,
13,
1,
13,
2172,
8209,
1637,
4734,
897,
1373,
800,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jQuery "Attribute Starts With Selector" not working in iFrame
===
I have an iFrame. All its elements are loaded. Anyway, I am not able to select elements using jQuery selector by "part" of the id/class/etc.
This is my code:
//Not working
$('#iFrameID').contents().find($('[id^="lodingImg"]')));
//Works
$('[id^="lodingImg"]'))
Dos anyone knew if this type of jQuery selectors do not works in the iFrame. I have recently read that .live is not working in iframe, too. So, my questions is if I am doing something wrong or this is limitation of the library?
Thanks in advance. | 0 | [
2,
487,
8190,
93,
13,
7,
721,
14755,
3244,
29,
23946,
7,
52,
638,
19,
31,
8361,
800,
3726,
3726,
31,
57,
40,
31,
8361,
9,
65,
82,
2065,
50,
8572,
9,
2774,
15,
31,
589,
52,
777,
20,
5407,
2065,
568,
487,
8190,
93,
23946,
34,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to create a Makefile?
===
I have done a project for lighthttpd authetication. For achieving this i have done the follwoing
1) Modified /etc/lighttpd/lighttpd.conf
2) created the following directories
a) created /var/www/cgi-bin
b) created /var/www/sym_links
c) created /var/www/lua_snippet
3) crated 2 new scripts (one is perl and other is lua)
a)/var/www/cgi-bin/auth.pl
b)/var/www/lua_snippet/manage_header.lua
I want this to be installed like a package. So that , Now i need a Makefile with the targets "all", "clean" and "install".
As i dont know anything much on creating a package. Can someone guide me for creating a Makefile for the same.
thanking you in advance
Sheffin | 0 | [
2,
184,
20,
1600,
21,
233,
16877,
60,
800,
3726,
3726,
31,
57,
677,
21,
669,
26,
471,
21127,
43,
10343,
124,
1786,
857,
9,
26,
11784,
48,
31,
57,
677,
14,
4310,
211,
6374,
68,
137,
6,
5372,
13,
118,
1198,
150,
118,
3130,
38,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PostgreSQL 9.1 index over arrays
===
What index will enhance database performance for table
CREATE TABLE my_table (
word_set text[]
)
for requests with `WHERE my_table.word_set @> '<some word>'` | 0 | [
2,
678,
6879,
18,
22402,
561,
9,
165,
4348,
84,
7718,
18,
800,
3726,
3726,
98,
4348,
129,
10734,
6018,
956,
26,
859,
1600,
859,
51,
1,
5924,
13,
5,
833,
1,
3554,
1854,
2558,
500,
13,
6,
26,
12279,
29,
13,
1,
2798,
51,
1,
592... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
java.security.AccessControlException: access denied (java.io.FilePermission file read)
===
Below code prompts for the input box for the file name and location.
When I enter `file://C:/test/abc.tiff` then I am getting
java.security.AccessControlException: access denied (java.io.FilePermission \\c\abc.tiff read)
Code Snippet
CMBDocument document = evt.getDocument();
String docSaveFileName = (String) docToURL.get(document);
System.out.println("docSaveFileName :"+docSaveFileName);
docSaveFileName = docSaveFileName.replaceAll("servlet", "annotate");
System.out.println("modified docSaveFileName :"+docSaveFileName);
File tempFile = null;
try {
if (evt.getSaveAsNew() || document.isModified()) {
if (evt.getSaveAsNew()) {
docSaveFileName =
JOptionPane.showInputDialog(myGenDocViewer,
"Enter the name of the file to save the document:");
}
if (docSaveFileName == null) { // user cancelled
return;
}
currStreamingDocServices.setPreferredFormats(
new String[] { document.getMimeType()});
if (document.getCanWrite()) {
URL url = new URL(docSaveFileName);
OutputStream out = null;
String protocol = url.getProtocol();
String host = url.getHost();
// Use FileOutputStream if this URI is for a local file.
if (protocol.equals("file")
&& (host == null || host.length() == 0 || host.equals("localhost"))) {
out = new FileOutputStream(new File(url.getPath()));
}
else {
URLConnection urlCon = url.openConnection();
urlCon.setDoInput(false);
urlCon.setDoOutput(true);
urlCon.setUseCaches(false); // Enable tunneling.
if (urlCon instanceof HttpURLConnection) {
HttpURLConnection httpCon = (HttpURLConnection) urlCon;
httpCon.setRequestMethod("PUT");
}
urlCon.setRequestProperty("Content-type",document.getWriteMimeType());
out = urlCon.getOutputStream();
}
document.write(out);
out.close();
document.setModified(false);
document.setNew(false);
myGenDocViewer.setDocName(document, docSaveFileName);
| 0 | [
2,
8247,
9,
17749,
9,
20604,
12898,
10066,
872,
45,
1381,
5265,
13,
5,
1004,
1385,
9,
1963,
9,
16877,
1432,
12385,
3893,
1302,
6,
800,
3726,
3726,
1021,
1797,
11443,
13531,
26,
14,
6367,
1649,
26,
14,
3893,
204,
17,
1474,
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... |
PL/SQL report file automaticaly run and export result?
===
I am using PL/SQL developer.
I have a report file (.rep) that fetches some data based on time period, for ex. from 1st July 2012 to 2th July 2012. I use this report by running it, entering &date_from and &date_to, and then export it in HTML via corresponding button.
I want to automate this task because basically this report needs to be executed on daily basis with today's date as a parameter. I have modified a code a bit so that now it uses **trunc(current_date, 'DDD')** as a parameter so that I do not have to enter it manualy. Next I need to:
1. run this report as a scheduled task without my interaction.
2. get an HTML export copied in a folder with the date that was used as a parameter inside report (so, basically current_date).
The pseudocode of my wish script would be like the following:
reportDate = get_current_date_without_time
run my_report.rep
mkdir c:\somefolder\reportDate
copy my_report_result_as_HTML c:\somefolder\reportDate
Is it possible? If so, then how? | 0 | [
2,
12443,
118,
18,
22402,
1330,
3893,
6715,
58,
102,
485,
17,
7487,
829,
60,
800,
3726,
3726,
31,
589,
568,
12443,
118,
18,
22402,
10058,
9,
31,
57,
21,
1330,
3893,
13,
5,
9,
99,
306,
6,
30,
18312,
160,
109,
1054,
432,
27,
85,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JQuery - How to append new functions to existing event handler?
===
I've came across this use case: Multiple template files have their own JavaScript code to handle browser resize. I wish that, as rendered result, all the templates will handle browser resize event using the JavaScript defined in each of the templates.
For example:
header.jsp - resize header image when browser resizes.
body.jsp - resize a table when browser resizes.
When rendered:
both header image and body table resize as browser resizes.
So far I don't see how JQuery can support this use case. Is my idea feasible?
Thank you! | 0 | [
2,
487,
8190,
93,
13,
8,
184,
20,
4865,
2451,
78,
3719,
20,
3149,
807,
24641,
60,
800,
3726,
3726,
31,
22,
195,
281,
464,
48,
275,
610,
45,
1886,
22894,
6488,
57,
66,
258,
8247,
8741,
1797,
20,
3053,
16495,
302,
10454,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
flash cs5.5 as3 - get unicode character of Arabic Presentation forms A and B
===
I have a string like 'دبي' and i want to get its correct unicode character. Currently, I am using str.charCodeAt(index) to get its unicode character but for Arabic characters it gives between 0600 and 06FF. However, i want Arabic Presentation Forms A and B - whichever is actually written.
Can anyone suggest how to do this?
Regards | 0 | [
2,
4433,
272,
18,
264,
9,
264,
28,
240,
13,
8,
164,
28010,
925,
16,
6663,
6364,
1997,
21,
17,
334,
800,
3726,
3726,
31,
57,
21,
3724,
101,
13,
22,
1,
22,
17,
31,
259,
20,
164,
82,
4456,
28010,
925,
9,
871,
15,
31,
589,
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... |
RewriteRule does not work, while the rest do
===
My blog's .htaccess is setup in such a way that one page is accessed through multiple URLs, and displays different content depending on which URL is visited.
http://kn3rdmeister.com/category/blog/
http://kn3rdmeister.com/2012/
http://kn3rdmeister.com/2012/07/
all are actually using `http://kn3rdmeister.com/blog.php`.
The .htaccess file is very handy in the sense that I only need to redirect to one page (pretty much *ever*) just with different query strings. After a lot messing around with 'em, all of my rules finally work, and I'm dang glad that they do. Well, *almost* all of them work. The last one does not.
the .htaccess:
RewriteEngine On
RewriteRule ^blog\.php$ /category/blog/ [R=301,L]
RewriteRule ^category/blog/?$ blog.php [L]
RewriteRule ^category/blog/page/?$ /category/blog/ [R=301,L]
RewriteRule ^category/blog/page/([0-9]*)/?$ /category/blog/?pagenum=$1 [L]
RewriteRule ^([0-9]{4})/?$ /category/blog/?year=$1 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/?$ /category/blog/?year=$1&month=$2 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/?$ /category/blog/?year=$1&month=$2&day=$3 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(^/]+)/?$ /category/blog/?url=http://kn3rdmeister.com/$1/$2/$3/$4/ [L]
The last rule is supposed to redirect to the "permanent link" page for each blog post. Being that each URL is unique, I'm using the post URLs as the unique identifier. Essentially, it is supposed to pass the "url" query string through "blog.php". The PHP script takes over, sees that the "url" query string is set, and then loads the only post with that exact URL in it's row.
The script works, but the redirect doesn't. Going directly to
`http://kn3rdmeister.com/blog.php?url=http://kn3rdmeister.com/2012/07/04/amsterdam-ave/`
will load the right content. However, going to
`http://kn3rdmeister.com/2012/07/04/amsterdam-ave/`
doesn't. | 0 | [
2,
27891,
16154,
630,
52,
170,
15,
133,
14,
760,
107,
800,
3726,
3726,
51,
8146,
22,
18,
13,
9,
9020,
20604,
25,
18161,
19,
145,
21,
161,
30,
53,
2478,
25,
12904,
120,
1886,
13,
911,
7532,
15,
17,
9412,
421,
2331,
4758,
27,
56... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Changing size of different characters in text view, Android
===
I want to create a Text view in which I want some characters to be of 40pt size and some characters to be of 20pt.
I tried using Html.fromhtml() but can't find any tag for changing size as such..
pleas help if this Is possible. | 0 | [
2,
4226,
1072,
16,
421,
1766,
19,
1854,
1418,
15,
13005,
800,
3726,
3726,
31,
259,
20,
1600,
21,
1854,
1418,
19,
56,
31,
259,
109,
1766,
20,
44,
16,
1417,
4417,
1072,
17,
109,
1766,
20,
44,
16,
434,
4417,
9,
31,
794,
568,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquery removing everything after question mark in url
===
I was wondering if I can remove everything after a question mark in a URL?
`http://www.site.com?some_parameters_continue_forever`
can I just use `.remove()`? What would need to be put inside the parameters?
Thanks | 0 | [
2,
487,
8190,
93,
9096,
796,
75,
1301,
943,
19,
287,
6362,
800,
3726,
3726,
31,
23,
5712,
100,
31,
92,
4681,
796,
75,
21,
1301,
943,
19,
21,
287,
6362,
60,
13,
1,
21127,
6903,
6483,
9,
9097,
9,
960,
60,
3220,
1,
6351,
7307,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Property not found exception in JSP EL
===
Very annoying. Don't know why this error is coming. In the below code
NOTE:
if I only use <td>${user.id}</td> than its printing id properly but on ${user.username} property generating error. See below JSP page code.
If I use below code in JSP page like to test than I get all the objects and properties
<c:forEach var="user" items="${users}" varStatus="i">
<tr>
<td>${users[i.index]}</td>
</tr>
</c:forEach>
Result:
User[id=1,username=u1,password=p1,firstname=f1,lastname=l1,dob=2012-07-01,age=40]
User[id=2,username=u2,password=p2,firstname=f2,lastname=l2,dob=2012-07-02,age=39]
User[id=3,username=u3,password=p3,firstname=f3,lastname=l3,dob=2012-07-03,age=38]
**ERROR:**
09:49:49,047 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/crud_jsp_servlet_cdi_jdbc_tagfile].[jsp]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet jsp threw exception: javax.el.PropertyNotFoundException: The class 'com.myapp.dao.User' does not have the property 'username'.
at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:661) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.el.BeanELResolver.getValue(BeanELResolver.java:290) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.el.parser.AstValue.getValue(AstValue.java:169) [jbossweb-7.0.13.Final.jar:]
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) [jbossweb-7.0.13.Final.jar:]
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:935) [jbossweb-7.0.13.Final.jar:]
at org.apache.jsp.WEB_002dINF.admin.UserList_jsp._jspx_meth_c_005fforEach_005f0(UserList_jsp.java:137)
at org.apache.jsp.WEB_002dINF.admin.UserList_jsp.access$1(UserList_jsp.java:114)
at org.apache.jsp.WEB_002dINF.admin.UserList_jsp$Helper.invoke1(UserList_jsp.java:215)
at org.apache.jsp.WEB_002dINF.admin.UserList_jsp$Helper.invoke(UserList_jsp.java:240)
at org.apache.jsp.tag.web.layout_tag.doTag(layout_tag.java:120)
at org.apache.jsp.WEB_002dINF.admin.UserList_jsp._jspx_meth_tags_005flayout_005f0(UserList_jsp.java:96)
at org.apache.jsp.WEB_002dINF.admin.UserList_jsp._jspService(UserList_jsp.java:69)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [jbossweb-7.0.13.Final.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
***JSP Page:***
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<tags:layout path="${pageContext.request.contextPath}">
<jsp:attribute name="search">
<tags:search />
</jsp:attribute>
<jsp:body>
<div class="mainDiv">
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Id</th>
<th>UserName</th>
<th>Password</th>
<th>FirstName</th>
<th>LastName</th>
<th>Date of Birth</th>
<th>Age</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<c:forEach var="user" items="${users}">
<tr>
<td>${user.id}</td>
<td>${user.username}</td>
<td>${user.password}</td>
<td>${user.firstname}</td>
<td>${user.lastname}</td>
<td>${user.dob}</td>
<td>${user.age}</td>
<td><a href="#"><i class="icon-edit"></i></a> <a href="#"><i
class="icon-trash"></i></a></td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</jsp:body>
</tags:layout>
***User.java***
package com.myapp.dao;
import java.sql.Date;
public class User {
private Long id;
private String username;
private String password;
private String firstname;
private String lastname;
private Date dob;
private int age;
public User(){
};
public User(Long id, String username, String password, String firstname, String lastname, Date dob, int age){
this.id = id;
this.username = username;
this.password = password;
this.firstname = firstname;
this.lastname = lastname;
this.dob = dob;
this.age = age;
}
public Long getId(){
return id;
}
public void setId(Long id){
this.id = id;
}
public String getUserName(){
return username;
}
public void setUserName(String username){
this.username = username;
}
public String getPassword(){
return password;
}
public void setPassword(String password){
this.password = password;
}
public String getFirstName(){
return firstname;
}
public void setFirstName(String firstname){
this.firstname = firstname;
}
public String getLastName(){
return lastname;
}
public void setLastName(String lastname){
this.lastname = lastname;
}
public Date getDob(){
return dob;
}
public void setDob(Date dob){
this.dob = dob;
}
public int getAge(){
return age;
}
public void setAge(int age){
this.age = age;
}
public String getFullName(){
return this.firstname + " " + this.lastname;
}
}
***Selvlet:***
List<User> users = null;
userDAO = new UserDAOJDBC();
users = userDAO.listUsers();
request.setAttribute("users", users);
String path = "/WEB-INF/admin/UserList.jsp";
getServletContext().getRequestDispatcher(path).forward(request, response); | 0 | [
2,
1354,
52,
216,
5391,
19,
487,
3401,
931,
800,
3726,
3726,
253,
17610,
9,
221,
22,
38,
143,
483,
48,
7019,
25,
880,
9,
19,
14,
1021,
1797,
1945,
45,
100,
31,
104,
275,
13,
1,
38,
43,
1,
4403,
1,
16704,
9,
1340,
1,
118,
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... |
Reading an Image Pixel by Pixel
===
Is there anyway I can read pixel by pixel a jpeg without taking the whole Image into memory?
I have been searching this for a long time.Thanking you in advance for your valuable advice.
| 0 | [
2,
1876,
40,
1961,
18146,
34,
18146,
800,
3726,
3726,
25,
80,
2774,
31,
92,
1302,
18146,
34,
18146,
21,
487,
20427,
366,
741,
14,
979,
1961,
77,
1912,
60,
31,
57,
74,
5792,
48,
26,
21,
175,
85,
9,
5904,
68,
42,
19,
3612,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
an error when add blank data on top drop downlist
===
I have a dropdown, I have a datasource and i wanted to add blank data it worked but the value that selected always 0
my code is
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
> listhostel()
>
End Sub
>
> Protected Sub listhostel()
> Dim dash As New DataSet
> Dim clas As New Class1
>
> dash = clas.returndataset("select ID as idhostel,Nama from Hostel")
>
> listhotelx.DataSource = dash
> listhotelx.DataBind()
> listhotelx.Items.Insert(0, New ListItem("-- Select --", 0))
> End Sub
>
> Protected Sub viewdatagrid_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles viewdatagrid.Click
>
Label1.Text = listhotelx.SelectedValue
> viewdata()
> End Sub
The file.aspx
<asp:DropDownList ID="listhotelx" runat="server" DataTextField="Nama"
DataValueField="idhostel" >
</asp:DropDownList> | 0 | [
2,
40,
7019,
76,
3547,
6463,
1054,
27,
371,
2804,
125,
5739,
800,
3726,
3726,
31,
57,
21,
2804,
2968,
15,
31,
57,
21,
1054,
12097,
17,
31,
417,
20,
3547,
6463,
1054,
32,
577,
47,
14,
1923,
30,
1704,
550,
713,
51,
1797,
25,
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... |
Graphite: recursive descent of nodes in graphs / functions?
===
A follow-up question from http://stackoverflow.com/questions/11480952/graphite-sum-all-stats-that-match-a-pattern/11489491:
Is there any Graphite magic to recursively descend node names? I now know that I can use patterns like so:
stats.timers.api.*.200.count
... but imagine that I have the following:
stats.timers.api.foo.bar.200.count
stats.timers.api.baz.200.count
I'd like to see both of those stats (and all others of arbitrary depth) on the same chart. I tried the following:
stats.timers.api.*.200.count
stats.timers.api.**.200.count
The former only shows me items like the 'baz' example above; the latter is an error.
Is there some other way to match metrics in a depth-insensitive manner?
| 0 | [
2,
7210,
2119,
45,
302,
24244,
5974,
16,
16272,
19,
7210,
18,
13,
118,
3719,
60,
800,
3726,
3726,
21,
1740,
8,
576,
1301,
37,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
1306,
16318,
3836,
9298,
9614,
2119,
8,
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... |
JAR Hell Issue? Weblogic 10.3.4 Spring 3.1.0.RELEASE Spring Modules Validation 0.8
===
I'm developing Java Spring 3.1.0.RELEASE using Maven and have been running it on Jettry server since. It works fine on Jetty.
Until we move to Weblogic 10.3.4, the trouble came. We are using Spring Modules Validation 0.8 which needs Spring 2.0.3 to run. Would this be the cause of the error? (It maybe overwrite Spring 3.1.0.RELEASE that we have)
Below are the errors
ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/spring-security.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.getLocalName(Lorg/w3c/dom/Node;)Ljava/lang/String;
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:375) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:298) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) [spring-2.0.3.jar:2.0.3]
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481) [weblogic.jar:10.3.4.0]
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) [com.bea.core.weblogic.security.identity_1.1.2.1.jar:1.1.2.1]
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) [com.bea.core.weblogic.security.wls_1.0.0.0_6-1-0-0.jar:6.1.0.0]
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181) [weblogic.jar:10.3.4.0]
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872) [weblogic.jar:10.3.4.0]
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153) [weblogic.jar:10.3.4.0]
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508) [weblogic.jar:10.3.4.0]
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) [weblogic.jar:10.3.4.0]
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) [weblogic.jar:10.3.4.0]
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636) [weblogic.jar:10.3.4.0]
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163) [weblogic.jar:10.3.4.0]
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195) [weblogic.jar:10.3.4.0]
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13) [weblogic.jar:10.3.4.0]
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68) [weblogic.jar:10.3.4.0]
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528) [com.bea.core.weblogic.workmanager_1.9.0.0.jar:1.9.0.0]
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207) [com.bea.core.weblogic.workmanager_1.9.0.0.jar:1.9.0.0]
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176) [com.bea.core.weblogic.workmanager_1.9.0.0.jar:1.9.0.0]
Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.getLocalName(Lorg/w3c/dom/Node;)Ljava/lang/String;
at org.springframework.security.config.SecurityNamespaceHandler.parse(SecurityNamespaceHandler.java:69) ~[spring-security-config-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353) ~[spring-2.0.3.jar:2.0.3]
... 48 common frames omitted
And below are dependencies in pom.xml
<dependencies>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
<scope>test</scope>
</dependency>
<!-- logging -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<!-- servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2-rev-1</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jetty</artifactId>
<version>2.0.4</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${org.springframework.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${org.springframework.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<!-- database -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.0.6</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.2.2</version>
</dependency>
<!-- json -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.4</version>
</dependency>
<!--
ORACLE Y U NO USE PUBLIC LICENSE FOR YOUR JDBC?
solution, download the ojdbc6.jar on zaki's computer (the movie server)
then run:
mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle -DartifactId=oracle -Dversion=11.2.0.3 -Dpackaging=jar -DgeneratePom=true
please adjust the -Dfile location
-->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>oracle</artifactId>
<version>11.2.0.3</version>
</dependency>
<!-- tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
<!-- diplaytag -->
<dependency>
<groupId>displaytag</groupId>
<artifactId>displaytag</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>displaytag</groupId>
<artifactId>displaytag-export-poi</artifactId>
<version>1.2</version>
</dependency>
<!-- JExcelAPI library -->
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.3</version>
</dependency>
<!-- commons-lang apache -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<!-- spring modules validation -->
<dependency>
<groupId>org.springmodules</groupId>
<artifactId>spring-modules-validation</artifactId>
<version>0.8</version>
</dependency>
<!-- JSR-303 javax validation -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId>
<version>4.2.0.Final</version>
</dependency>
</dependencies>
<build>
<finalName>artajasa-billing</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>2.9.1</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.1</version>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1H.14.1</version>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>10000</port>
</connector>
</connectors>
<webAppConfig>
<contextPath>/${project.name}</contextPath>
</webAppConfig>
<scanTargets>
<scanTarget>target/classes/</scanTarget>
</scanTargets>
<scanIntervalSeconds>0</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
I hope there will be 'light' this time. I've been struggling to get the answer since one week ago. Many thanks for any the help given. | 0 | [
2,
5112,
1094,
1513,
60,
2741,
24268,
332,
9,
240,
9,
300,
1573,
203,
9,
165,
9,
387,
9,
15202,
1573,
17113,
27999,
713,
9,
457,
800,
3726,
3726,
31,
22,
79,
3561,
8247,
1573,
203,
9,
165,
9,
387,
9,
15202,
568,
1216,
3124,
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... |
transfer values of select boxes to hidden field
===
I have three select boxes, one to select the year, another one for the month and the last one for the day. My goal is to have them automatically inserted into one hidden field (resulting in e.g. 2012-07-16) which is the main "date" field and that get's stored into the database.
Does anyone have an idea how this can be best achieved? Some advise would be highly appreciated, thank you very much, Patrick | 0 | [
2,
2617,
4070,
16,
5407,
8120,
20,
3689,
575,
800,
3726,
3726,
31,
57,
132,
5407,
8120,
15,
53,
20,
5407,
14,
159,
15,
226,
53,
26,
14,
1617,
17,
14,
236,
53,
26,
14,
208,
9,
51,
1195,
25,
20,
57,
105,
7499,
14215,
77,
53,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Converting from Sql to Linq
===
I have, what I thought was a pretty straight-forward query.
In normal Sql this would read:
SELECT [column names]
FROM agentscheduledetail
WHERE (date = '2012-07-04') AND
(
exception = 'Break (No Sign Off)' OR
exception = 'Break' OR
exception = 'Break (Signed Out)'
)
This returns approx 900 records.
However, when I try to enter this into my controller, I end up with around 300,000 records - so I think my AND and ORs are not working. I've tried Linqer, but can't get it to work.
My controller query is:
var dte = DateTime.Today;
return View(db.agentscheduledetails.Where
(
d => d.date == dte && d.agentName.StartsWith("ta") &&
(
d.exception == "Break (No Sign Off)" ||
d.exception == "Break" ||
d.exception == "Break (Signed Out)"
)
).ToList()
);
Can anyone either a) let me know where I'm going wrong with my && || (and/or), or b) is there a way of stepping through the code in VS, to see what the above query translates to in normal SQL so I can try to figure out where I'm going wrong?
Thanks for any help,
Mark | 0 | [
2,
19583,
37,
4444,
255,
20,
6294,
1251,
800,
3726,
3726,
31,
57,
15,
98,
31,
289,
23,
21,
1772,
1599,
8,
21216,
25597,
9,
19,
1826,
4444,
255,
48,
83,
1302,
45,
5407,
636,
716,
4404,
103,
1817,
500,
37,
5125,
6261,
9813,
546,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Display values when the Window is displayed
===
I want to display a popout window with some values displayed on it fetched from a PHP server file. I have no clue how to display the items on the window.
I don't know why but the `console.log` message `'method call'` in the controller doesn't get displayed when the view is rendered. I think this is because i have added `click: this.methodcall` (which gets called only when a button click is made, but i want the log statement to print when the view is rendered)
Nothing gets displayed on the View, i think this is because i have not added any code to display it in the View.
Can someone help me solve this problem ?
My Pop out window **VIEW** code;
Ext.define('Project.view.user.Popupwin', {
extend: 'Ext.window.Window',
alias: 'widget.popupwin',
layout:'fit',
autoShow: true,
initComponent: function() {
this.store = 'Popupwin';
this.items = [
{
xtype: 'form',
items: [
]
}
];
this.callParent(arguments);
}
});
**STORE**
Ext.define('Project.store.Popupwin',{
extend:'Ext.data.Store',
model:'App.model.Popupwin',
proxy: {
actionMethods : {
read : 'POST'
},
type: 'ajax',
url : 'loaddata.php',
autoLoad: true
}
});
**CONTROLLER**
Ext.define('Project.controller.Popupwin',{
extend: 'Ext.app.Controller',
stores:['Popupwin'],
models:['Popupwin'],
views:['DoctorView'],
init: function(){
console.log('executed');
this.control({
'popupwin': {
click: this.methodcall
}
});
},
methodcall: function() {
console.log('method call');
this.getShowPopupwinStore().load();
}
});
**Model**
Ext.define ('Project.model.Popupwin',{
extend: 'Ext.data.Model',
fields:['fname','lanme']
}); | 0 | [
2,
3042,
4070,
76,
14,
1463,
25,
6115,
800,
3726,
3726,
31,
259,
20,
3042,
21,
1675,
1320,
1463,
29,
109,
4070,
6115,
27,
32,
13,
28998,
37,
21,
13,
26120,
8128,
3893,
9,
31,
57,
90,
8906,
184,
20,
3042,
14,
3755,
27,
14,
1463... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript run function only once and avoid running again in refresh
===
I am developing TimeAgo jQuery plugin that calculates time since a given datetime.
Example: 4 minutes ago
I developed it to be according to user`s timezone and it works ok but when it refreshs automaticly it repeats the minus/plus hours according to time zone..
I want to add value only once!
JS code:
> (function($) {
$.timeago = function(timestamp) {
if (timestamp instanceof Date) {
return inWords(timestamp);
} else if (typeof timestamp === "string") {
return inWords($.timeago.parse(timestamp));
} else if (typeof timestamp === "number") {
return inWords(new Date(timestamp));
} else {
return inWords($.timeago.datetime(timestamp));
}
};
var $t = $.timeago;
$.extend($.timeago, {
settings: {
refreshMillis: 60000,
allowFuture: false,
strings: {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "قبل",
suffixFromNow: "من الآن",
seconds: "اقل من دقيقة",
minute: "دقيقة",
minutes: "%d دقيقة",
hour: "ساعة",
hours: "%d ساعة",
day: "يوم",
days: "%d يوم",
month: "شهر",
months: "%d اشهر",
year: "سنة",
years: "%d سنين",
wordSeparator: " ",
numbers: []
}
},
inWords: function(distanceMillis) {
var $l = this.settings.strings;
var prefix = $l.prefixAgo;
var suffix = $l.suffixAgo;
if (this.settings.allowFuture) {
if (distanceMillis < 0) {
prefix = $l.prefixFromNow;
suffix = $l.suffixFromNow;
}
}
var seconds = Math.abs(distanceMillis) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
var years = days / 365;
function substitute(stringOrFunction, number) {
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
var value = ($l.numbers && $l.numbers[number]) || number;
return string.replace(/%d/i, value);
}
var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
seconds < 90 && substitute($l.minute, 1) ||
minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
minutes < 90 && substitute($l.hour, 1) ||
hours < 24 && substitute($l.hours, Math.round(hours)) ||
hours < 42 && substitute($l.day, 1) ||
days < 30 && substitute($l.days, Math.round(days)) ||
days < 45 && substitute($l.month, 1) ||
days < 365 && substitute($l.months, Math.round(days / 30)) ||
years < 1.5 && substitute($l.year, 1) ||
substitute($l.years, Math.round(years));
var separator = $l.wordSeparator === undefined ? " " : $l.wordSeparator;
return $.trim([prefix, suffix, words].join(separator));
},
parse: function(iso8601) {
var s = $.trim(iso8601);
s = s.replace(/\.\d+/, ""); // remove milliseconds
s = s.replace(/-/, "/").replace(/-/, "/");
s = s.replace(/T/, " ").replace(/Z/, " UTC");
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2"); // -04:00 -> -0400
return new Date(s);
},
datetime: function(elem) {
var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
return $t.parse(iso8601);
},
isTime: function(elem) {
// jQuery's `is()` doesn't play well with HTML5 in IE
return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
}
});
$.fn.timeago = function() {
var self = this;
self.each(refresh);
var $s = $t.settings;
if ($s.refreshMillis > 0) {
setInterval(function() { self.each(refresh); }, $s.refreshMillis);
}
return self;
};
function refresh() {
var data = prepareData(this);
var dt = data.datetime;
if (!isNaN(dt)) {
$(this).text(inWords(dt));
}
return this;
}
function prepareData(element) {
element = $(element);
if (!element.data("timeago")) {
element.data("timeago", { datetime: $t.datetime(element) });
var text = $.trim(element.text());
if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
element.attr("title", text);
}
}
return element.data("timeago");
}
function get_time_zone_offset() {
var current_date = new Date();
return -current_date.getTimezoneOffset() / 60;
}
function inWords(date) {
date.setHours(date.getHours() + get_time_zone_offset());
return $t.inWords(distance(date));
}
function distance(date) {
return (new Date().getTime() - date.getTime());
}
// fix for IE6 suckage
document.createElement("span");
document.createElement("time");
} (jQuery));
Thanks people.. | 0 | [
2,
8247,
8741,
485,
1990,
104,
382,
17,
2658,
946,
188,
19,
24905,
800,
3726,
3726,
31,
589,
3561,
85,
9668,
487,
8190,
93,
10922,
108,
30,
18469,
18,
85,
179,
21,
504,
1231,
891,
9,
823,
45,
268,
902,
1464,
31,
885,
32,
20,
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... |
Change current revision of existing repo in Mercurial
===
I'm tracking a complex bug and I want to find out the changeset that introduced it by testing the program with old revisions.
Given a local mercurial repository with 100 changesets, how can I pull(revert ? clone ?) to a previous (ex.50) changeset ?
| 0 | [
2,
753,
866,
11323,
16,
3149,
302,
1638,
19,
9046,
3594,
192,
800,
3726,
3726,
31,
22,
79,
10353,
21,
1502,
6256,
17,
31,
259,
20,
477,
70,
14,
1693,
1198,
30,
1277,
32,
34,
4431,
14,
625,
29,
315,
11323,
18,
9,
504,
21,
375,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ajax form handling an array
===
am trying to handle an array comes from php file after submitting the form data , the value of data after submitting the form is = ARRAY but i cant use this array in any way , any idea how can i handle this array !!!!
Javascript :
$('#file').live('change',function(){
$('#preview').html('');
$('#preview').html('<img src="loader.gif" />');
$('#data').ajaxForm(function(data){
$(data['toshow']).insertBefore('.pic_content').hide().fadeIn(1000);
});
}).submit();
});
PHP :
....
....etc
echo array('toshow'=>somedata,'data'=>somedata); | 0 | [
2,
20624,
505,
7988,
40,
7718,
800,
3726,
3726,
589,
749,
20,
3053,
40,
7718,
1624,
37,
13,
26120,
3893,
75,
28848,
14,
505,
1054,
13,
15,
14,
1923,
16,
1054,
75,
28848,
14,
505,
25,
800,
7718,
47,
31,
2973,
275,
48,
7718,
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... |
Jetty deployment error using androMDA
===
I am working on timetracker and successfully made to this page <http://www.andromda.org/docs/andromda-d> but when it came to deployment using jetty i cant do it as it seems to produce some error.
[INFO] Webapp assembled in [1413 msecs]
[INFO] Building war: /Projects/timetracker2/web/target/timetracker2-web-1.0-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] >>> jetty-maven-plugin:8.1.4.v20120524:run (start-jetty) @ timetracker2-web >>>
[INFO]
[INFO] --- build-helper-maven-plugin:1.5:add-source (default) @ timetracker2-web ---
[INFO] Source directory: /Projects/timetracker2/web/target/src/main/java added.
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ timetracker2-web ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource to /Projects/timetracker2/web/target/src/main/webapp
[INFO]
[INFO] --- maven-antrun-plugin:1.6:run (default) @ timetracker2-web ---
[INFO] Executing tasks
main:
[copy] Copying 1 file to /Projects/timetracker2/web/target/src/main/webapp
[INFO] Executed tasks
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ timetracker2-web ---
[INFO] Compiling 1 source file to /Projects/timetracker2/web/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ timetracker2-web ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Projects/timetracker2/web/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ timetracker2-web ---
[INFO] Not compiling test sources
[INFO]
[INFO] <<< jetty-maven-plugin:8.1.4.v20120524:run (start-jetty) @ timetracker2-web <<<
[INFO]
[INFO] --- jetty-maven-plugin:8.1.4.v20120524:run (start-jetty) @ timetracker2-web ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Timetracker ....................................... SUCCESS [1.780s]
[INFO] Timetracker MDA ................................... SUCCESS [3:11.223s]
[INFO] Timetracker Common ................................ SUCCESS [4.337s]
[INFO] Timetracker Core Business Tier .................... SUCCESS [13.023s]
[INFO] Timetracker Web ................................... FAILURE [12.602s]
[INFO] Timetracker Application ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:43.654s
[INFO] Finished at: Tue Jul 03 13:16:00 IST 2012
[INFO] Final Memory: 56M/133M
[INFO] ------------------------------------------------------------------------
[ERROR] Internal error: java.lang.NullPointerException -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException at org.apache.maven.lifecycle.internal.BuilderCommon.handleBuildError(BuilderCommon.java:128) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:95) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.NullPointerException
at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:348)
at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:161)
at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:89)
at org.codehaus.plexus.component.configurator.converters.composite.ArrayConverter.fromChildren(ArrayConverter.java:129)
at org.codehaus.plexus.component.configurator.converters.composite.ArrayConverter.fromConfiguration(ArrayConverter.java:91)
at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:295)
at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:161)
at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:567)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:529)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
... 16 more
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e s
please any idea what could be the problem | 0 | [
2,
17341,
93,
10475,
7019,
568,
17,
8541,
593,
800,
3726,
3726,
31,
589,
638,
27,
85,
4792,
106,
17,
3673,
117,
20,
48,
2478,
13,
1,
21127,
6903,
6483,
9,
19554,
79,
593,
9,
5583,
118,
13799,
18,
118,
19554,
79,
593,
8,
43,
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 control the version of Chef that Vagrant uses to provision VMs?
===
A current Chef recipe isn't running because of a bug in version 0.10.10. How can I upgrade the version of Chef that Vagrant uses, to 0.10.12?
I don't want to just update it for the current instance of the VM - I keep destroying and rebuilding those. Do I need to change something in the Vagrant base box, or something in my (physical) system's installation? | 0 | [
2,
184,
20,
569,
14,
615,
16,
8915,
30,
3471,
12965,
2027,
20,
8738,
13,
20147,
18,
60,
800,
3726,
3726,
21,
866,
8915,
20510,
2532,
22,
38,
946,
185,
16,
21,
6256,
19,
615,
713,
9,
1036,
9,
1036,
9,
184,
92,
31,
9483,
14,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
android set camera resolution using intent
===
My app is using this Intent to take photos:
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, saveUri);
startActivityForResult(i, cameraData);
Is there any way to set the resolution of the camera?
Any advice would be greatly appreciated.
Thanks! | 0 | [
2,
13005,
309,
3336,
4302,
568,
6936,
800,
3726,
3726,
51,
4865,
25,
568,
48,
6936,
20,
247,
7064,
45,
6936,
31,
800,
78,
6936,
5,
290,
18524,
9,
26735,
139,
9,
8260,
16828,
9,
8645,
1,
22039,
1,
4666,
6418,
6,
73,
31,
9,
4881... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Change PrismaticJoint engine direction
===
Is it possible to modify the direction of the engine after the joint is created?
This is the definition of a joint:
//Define a prismatic joint
b2PrismaticJointDef jointDef;
b2Vec2 axis = b2Vec2(1.0f, 0.0f);
axis.Normalize(); //Important
jointDef.Initialize(staticBody, body, b2Vec2(0.0f, 0.0f),axis);
jointDef.localAnchorA = b2Vec2(0.0f,0.0f);
jointDef.localAnchorB = body->GetLocalCenter();
jointDef.motorSpeed = 3.0f;
jointDef.maxMotorForce = +200*body->GetMass();
jointDef.enableMotor = true;
jointDef.lowerTranslation = -2.0f;
jointDef.upperTranslation = 3.0f;
jointDef.enableLimit = true;
_horPrismaticJoint = (b2PrismaticJoint*) world->CreateJoint(&jointDef);
Inside CCTouchesBegan I tried to change the force value but it's not working:
_horPrismaticJoint->SetMaxMotorForce(-200.0f);
The cocos distribution is cocos2d-iphone-1.0.1 | 0 | [
2,
753,
21985,
12479,
17838,
1406,
1400,
800,
3726,
3726,
25,
32,
938,
20,
17579,
14,
1400,
16,
14,
1406,
75,
14,
2266,
25,
679,
60,
48,
25,
14,
5465,
16,
21,
2266,
45,
12894,
546,
7509,
21,
21985,
12479,
2266,
334,
135,
15839,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 ul click event not firing in asp.net
===
Sample code is below.... event not firing.. please help
jQuery(document).ready(function () {
jQuery("#tabsSurveyStats").tabs();
jQuery("#ULCampaignStats li").click(function () {
var activeTab = jQuery(this).find("a").attr("href");
alert(activeTab);
});
}); | 0 | [
2,
487,
8190,
93,
13,
1287,
10840,
807,
52,
7139,
19,
28,
306,
9,
2328,
800,
3726,
3726,
5717,
1797,
25,
1021,
9,
9,
9,
9,
807,
52,
7139,
9,
9,
2247,
448,
487,
8190,
93,
5,
28132,
6,
9,
15193,
5,
22359,
13,
5,
6,
13,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
publish on facebook wall stop working in wp7
===
I use facebook sdk for my application but it stop working at step:
http://intesl.com/Capture.JPG
I think has problem with my facebook appID because when i try change appID, it works fine.
So whats problem with my appID?
| 0 | [
2,
10824,
27,
9090,
769,
747,
638,
19,
13,
13790,
465,
800,
3726,
3726,
31,
275,
9090,
13,
18,
43,
197,
26,
51,
3010,
47,
32,
747,
638,
35,
1424,
45,
7775,
6903,
108,
3231,
255,
9,
960,
118,
4666,
6418,
9,
12851,
263,
31,
277,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Django nginx uwsgi ending slash
===
any request to djangobook.ir/toc (without ending slash) redirects to djangobook.irdjangobook_ir.wsgi! but I don't have problem with djangobook.ir/toc/ (with ending slash).
server {
listen 80;
server_name djangobook.ir;
charset utf-8;
access_log /var/log/nginx/app_access.log;
error_log /var/log/nginx/app_error.log;
root /home/aminpy/djangobook_ir/;
location /static/ {
alias /home/aminpy/djangobook_ir/static/;
}
location /statics/ {
alias /home/aminpy/djangobook_ir/statics/;
}
location / {
uwsgi_pass 127.0.0.1:5000;
include uwsgi_params;
root /home/aminpy/djangobook_ir/;
uwsgi_param UWSGI_SCRIPT djangobook_ir.wsgi;
uwsgi_param SCRIPT_NAME djangobook_ir.wsgi;
uwsgi_param UWSGI_CHDIR $document_root;
}
}
you can test it online! | 0 | [
2,
3857,
14541,
13,
2723,
108,
396,
13,
14524,
18,
2234,
3119,
14098,
800,
3726,
3726,
186,
3772,
20,
3857,
14541,
5199,
9,
1523,
118,
262,
150,
13,
5,
14506,
3119,
14098,
6,
302,
14706,
18,
20,
3857,
14541,
5199,
9,
1523,
14365,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 fancybox plugin using arrays in code?
===
I've got a Jquery plugin for a fancybox, which I know works when I use the following code:
$("a#roomthumb_2237").fancybox({
'href' : '#2237_Info',
'titleShow' : false,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
});
But to stop me having to repeat this code multiple times (with different href values), I'd like to run it in a for loop.
The code I've tried is:
for (var i = 0; i < rooms_array.length; i++) {
var d = "#roomthumb_"+rooms_array[i]
$(d).fancybox({
'href' : rooms_array[i]+'_Info',
'titleShow' : false,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
});
};
The original code I took straight from google (it may well have been from stackoverflow, I can't remember), but as soon as I try to put it the loop, I'm lost, since I've no idea how to write it. I think the href line is wrong, but I can't find anything that explains how to do what I need it to.
I dont know how to write the $("a#roomthumb_2237") as $("a"+d) for example... | 0 | [
2,
487,
8190,
93,
12251,
5309,
10922,
108,
568,
7718,
18,
19,
1797,
60,
800,
3726,
3726,
31,
22,
195,
330,
21,
487,
8190,
93,
10922,
108,
26,
21,
12251,
5309,
15,
56,
31,
143,
693,
76,
31,
275,
14,
249,
1797,
45,
5579,
5,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to show execution stages of .class file in JVM.(Using animation actionscript)
===
[it is our project website, none of my group members are able to corelate the link b/w execution process of .class files in JVM n actionscrpt][1]
please help
[1]: http://techtalkies2k10.blogspot.in/p/assignments.html | 3 | [
2,
184,
20,
298,
5769,
4891,
16,
13,
9,
1898,
3893,
19,
487,
20147,
9,
5,
12655,
6236,
1028,
8741,
6,
800,
3726,
3726,
636,
242,
25,
318,
669,
2271,
15,
2369,
16,
51,
214,
443,
50,
777,
20,
2884,
6554,
14,
3508,
334,
118,
499,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I get Gson to use accessors rather than fields?
===
By default Gson uses fields as a basis for it's serialization. Is there a way to get it to use accessors instead? | 0 | [
2,
184,
92,
31,
164,
489,
528,
20,
275,
1381,
248,
18,
864,
119,
2861,
60,
800,
3726,
3726,
34,
12838,
489,
528,
2027,
2861,
28,
21,
2239,
26,
32,
22,
18,
5956,
1829,
9,
25,
80,
21,
161,
20,
164,
32,
20,
275,
1381,
248,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Symfony 2 one to many data persistence
===
I am trying to implement CRUD functionality for entities with a one to many relationship.
For simplicity purposes, I am initially implementing a simple client-member CRUD. Where one client has many members for which the client is responsible.
Symfony2 is throwing the following error with my implementation.
Warning: spl_object_hash() expects parameter 1 to be object, array given in /home/evolve/public_html/bootstrap/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1509Warning: spl_object_hash() expects parameter 1 to be object, array given in /home/evolve/public_html/bootstrap/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1509
The code:
client.php
<?php
namespace CRUD\dbBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* CRUD\dbBundle\Entity\client
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="CRUD\dbBundle\Entity\clientRepository")
*/
class client
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string $name
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @var string $surname
*
* @ORM\Column(name="surname", type="string", length=255)
*/
private $surname;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
* @return client
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set surname
*
* @param string $surname
* @return client
*/
public function setSurname($surname)
{
$this->surname = $surname;
return $this;
}
/**
* Get surname
*
* @return string
*/
public function getSurname()
{
return $this->surname;
}
/**
* @var Doctrine\Common\Collections\ArrayCollection
*
* @ORM\OneToMany(targetEntity="member", mappedBy="client", cascade={"persist"})
*/
protected $member;
public function __construct()
{
$this->member = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Set the collection of related member
*
* @param \Doctrine\Common\Collections\ArrayCollection $member
*/
public function setMember(\Doctrine\Common\Collections\ArrayCollection $member)
{
foreach ($member as $members) {
$members->addTask($this);
}
$this->member = $member;
}
/**
* Add a member to the collection of related member
*
* @param \CRUD\dbBundle\Entity\member $member
*/
public function addMember(member $member)
{
$this->member->add($member);
$item->setClient($this);//inverse side association
}
/**
* Remove a member from the collection of related member
*
* @param \CRUD\dbBundle\Entity\member $member
*/
public function removeMember(OrderItem $member)
{
$this->member->removeElement($member);
}
/**
* Get the collection of related items
*
* @return \Doctrine\Common\Collections\ArrayCollection
*/
public function getMember()
{
return $this->member;
}
}
member.php
<?php
namespace CRUD\dbBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* CRUD\dbBundle\Entity\member
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="CRUD\dbBundle\Entity\memberRepository")
*/
class member
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string $name
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @var string $surname
*
* @ORM\Column(name="surname", type="string", length=255)
*/
private $surname;
/**
* @var Order
*
* @ORM\ManyToOne(targetEntity="client", inversedBy="members")
*/
protected $client;
/**
* Set the related client
*
* @param client $client
*/
public function setClient(client $client)
{
$this->client = $client;
}
/**
* Get the related client
*
* @return client
*/
public function getClient()
{
return $this->client;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
* @return member
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set surname
*
* @param string $surname
* @return member
*/
public function setSurname($surname)
{
$this->surname = $surname;
return $this;
}
/**
* Get surname
*
* @return string
*/
public function getSurname()
{
return $this->surname;
}
}
clientController.php
<?php
namespace CRUD\dbBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use CRUD\dbBundle\Entity\client;
use CRUD\dbBundle\Form\clientType;
/**
* client controller.
*
* @Route("/client")
*/
class clientController extends Controller
{
/**
* Lists all client entities.
*
* @Route("/", name="client")
* @Template()
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('CRUDdbBundle:client')->findAll();
return array(
'entities' => $entities,
);
}
/**
* Finds and displays a client entity.
*
* @Route("/{id}/show", name="client_show")
* @Template()
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CRUDdbBundle:client')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find client entity.');
}
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
);
}
/**
* Displays a form to create a new client entity.
*
* @Route("/new", name="client_new")
* @Template()
*/
public function newAction()
{
$entity = new client();
$form = $this->createForm(new clientType(), $entity);
return array(
'entity' => $entity,
'form' => $form->createView(),
);
}
/**
* Creates a new client entity.
*
* @Route("/create", name="client_create")
* @Method("post")
* @Template("CRUDdbBundle:client:new.html.twig")
*/
public function createAction()
{
$entity = new client();
$request = $this->getRequest();
$form = $this->createForm(new clientType(), $entity);
$form->bindRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('client_show', array('id' => $entity->getId())));
}
return array(
'entity' => $entity,
'form' => $form->createView(),
);
}
/**
* Displays a form to edit an existing client entity.
*
* @Route("/{id}/edit", name="client_edit")
* @Template()
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CRUDdbBundle:client')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find client entity.');
}
$editForm = $this->createForm(new clientType(), $entity);
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
/**
* Edits an existing client entity.
*
* @Route("/{id}/update", name="client_update")
* @Method("post")
* @Template("CRUDdbBundle:client:edit.html.twig")
*/
public function updateAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CRUDdbBundle:client')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find client entity.');
}
$editForm = $this->createForm(new clientType(), $entity);
$deleteForm = $this->createDeleteForm($id);
$request = $this->getRequest();
$editForm->bindRequest($request);
if ($editForm->isValid()) {
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('client_edit', array('id' => $id)));
}
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
/**
* Deletes a client entity.
*
* @Route("/{id}/delete", name="client_delete")
* @Method("post")
*/
public function deleteAction($id)
{
$form = $this->createDeleteForm($id);
$request = $this->getRequest();
$form->bindRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CRUDdbBundle:client')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find client entity.');
}
$em->remove($entity);
$em->flush();
}
return $this->redirect($this->generateUrl('client'));
}
private function createDeleteForm($id)
{
return $this->createFormBuilder(array('id' => $id))
->add('id', 'hidden')
->getForm()
;
}
}
memberController.php
<?php
namespace CRUD\dbBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use CRUD\dbBundle\Entity\member;
use CRUD\dbBundle\Form\memberType;
/**
* member controller.
*
* @Route("/member")
*/
class memberController extends Controller
{
/**
* Lists all member entities.
*
* @Route("/", name="member")
* @Template()
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('CRUDdbBundle:member')->findAll();
return array(
'entities' => $entities,
);
}
/**
* Finds and displays a member entity.
*
* @Route("/{id}/show", name="member_show")
* @Template()
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CRUDdbBundle:member')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find member entity.');
}
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
);
}
/**
* Displays a form to create a new member entity.
*
* @Route("/new", name="member_new")
* @Template()
*/
public function newAction()
{
$entity = new member();
$form = $this->createForm(new memberType(), $entity);
return array(
'entity' => $entity,
'form' => $form->createView(),
);
}
/**
* Creates a new member entity.
*
* @Route("/create", name="member_create")
* @Method("post")
* @Template("CRUDdbBundle:member:new.html.twig")
*/
public function createAction()
{
$entity = new member();
$request = $this->getRequest();
$form = $this->createForm(new memberType(), $entity);
$form->bindRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('member_show', array('id' => $entity->getId())));
}
return array(
'entity' => $entity,
'form' => $form->createView(),
);
}
/**
* Displays a form to edit an existing member entity.
*
* @Route("/{id}/edit", name="member_edit")
* @Template()
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CRUDdbBundle:member')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find member entity.');
}
$editForm = $this->createForm(new memberType(), $entity);
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
/**
* Edits an existing member entity.
*
* @Route("/{id}/update", name="member_update")
* @Method("post")
* @Template("CRUDdbBundle:member:edit.html.twig")
*/
public function updateAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CRUDdbBundle:member')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find member entity.');
}
$editForm = $this->createForm(new memberType(), $entity);
$deleteForm = $this->createDeleteForm($id);
$request = $this->getRequest();
$editForm->bindRequest($request);
if ($editForm->isValid()) {
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('member_edit', array('id' => $id)));
}
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
/**
* Deletes a member entity.
*
* @Route("/{id}/delete", name="member_delete")
* @Method("post")
*/
public function deleteAction($id)
{
$form = $this->createDeleteForm($id);
$request = $this->getRequest();
$form->bindRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CRUDdbBundle:member')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find member entity.');
}
$em->remove($entity);
$em->flush();
}
return $this->redirect($this->generateUrl('member'));
}
private function createDeleteForm($id)
{
return $this->createFormBuilder(array('id' => $id))
->add('id', 'hidden')
->getForm()
;
}
}
I do understand that my clientController is incomplete, but have no idea what should be added. I have been struggling for days to get this working and I would appreciate any suggestions.
PS
This is my first post, let me know if there are any improvements I should make in regards to standards I should follow when posting a question. | 0 | [
2,
13,
7261,
10229,
93,
172,
53,
20,
151,
1054,
28584,
800,
3726,
3726,
31,
589,
749,
20,
8713,
11498,
43,
18548,
26,
12549,
29,
21,
53,
20,
151,
1429,
9,
26,
20595,
4612,
15,
31,
589,
1537,
17333,
21,
1935,
6819,
8,
6990,
11498... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 add a custom git hook to a GitHub Enterprise repo?
===
I've fired up an instance of GitHub Enterprise (11.10.272) and created a repository. I've written a pre-receive hook in Ruby which I'd like to use with that repository.
GitHub Enterprise, like regular GitHub, allows the configuration of service hooks. I tried to SSH into the GitHub Enterprise server to create a hook file, but I couldn't find the repo directory. Furthemore, GitHub Enterprise's terms forbid modifying the VM, so I'm not confident this is a great approach.
It seems GitHub:FI supported hooks. The current version of the FI to Enterprise migration tool does not currently support hooks according to [Migrating from GitHub:FI][1].
[1]: https://support.enterprise.github.com/entries/21179373-migrating-from-github-fi | 0 | [
2,
184,
92,
31,
3547,
21,
5816,
13,
10404,
5559,
20,
21,
13,
10404,
20926,
6002,
302,
1638,
60,
800,
3726,
3726,
31,
22,
195,
3899,
71,
40,
4851,
16,
13,
10404,
20926,
6002,
13,
5,
1306,
9,
1036,
9,
23381,
6,
17,
679,
21,
2486... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 sliding element down and up with the same link not working
===
I have the following code, it slides down, but not up. Please could you help me find the error, and also if maybe there is a better way to do this, I have tried slideToggle, but that does not make it possible to check the state of the element, for where using hide and show you can check $('#my_div').is(':hidden').
Here is my code:
$("a.advanced_search_toggle").click(function() {
if ($("#advanced_search_box").hasClass('closed')) {
$("#advanced_search_box").slideDown(function(){
$("a.advanced_search_toggle").text('Simple Search');
$("a.advanced_search_toggle").removeClass('down_arrow');
$("a.advanced_search_toggle").addClass('up_arrow')
$("a.advanced_search_toggle").removeClass('closed');
$("a.advanced_search_toggle").addClass('open');
});
} else {
$("#advanced_search_box").slideUp(function(){
$("a.advanced_search_toggle").text('Advanced Search');
$("a.advanced_search_toggle").removeClass('up_arrow');
$("a.advanced_search_toggle").addClass('down_arrow');
$("a.advanced_search_toggle").removeClass('open');
$("a.advanced_search_toggle").addClass('closed');
});
}
return false;
});
Please note that by default I add a class of closed to #advanced_search_box | 0 | [
2,
487,
8190,
93,
7609,
4520,
125,
17,
71,
29,
14,
205,
3508,
52,
638,
800,
3726,
3726,
31,
57,
14,
249,
1797,
15,
32,
18066,
125,
15,
47,
52,
71,
9,
2247,
110,
42,
448,
55,
477,
14,
7019,
15,
17,
67,
100,
913,
80,
25,
21,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Narrow down contained elements if they are to wide to fit in a container
===
Let's assume there is a fixed-width div container, 200px wide. Contained elements are fixed-width inline-block divs, 45px wide. Then let's assume I add one more element to the container. What I would like to achieve is that all the contained elements shrink to maximum possible width and fit in the container without overflowing (40px, assuming there is no whitespace between the elements).
Is this possible with pure CSS? | 0 | [
2,
2868,
125,
3437,
2065,
100,
59,
50,
20,
1051,
20,
2742,
19,
21,
12147,
800,
3726,
3726,
408,
22,
18,
7158,
80,
25,
21,
3535,
8,
3976,
43,
96,
13,
12916,
12147,
15,
2327,
306,
396,
1051,
9,
3437,
2065,
50,
3535,
8,
3976,
43,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Generics: generic class based on generic class
===
I'm trying to create a generic service that is based on a class with a generics based collection
public class GenericClass<T> {
List<T> results;
public List<T> getResults() {
return results;
}
}
Im just not sure how to create a service that is based on this GenericClass and has a concrete implementation of T. I would expect something like
public class ServiceManagerImpl<GenericClass<T>> implements ServiceManager<GenericClass<T>> {
public GenericClass<T> getMyClass() {
...
}
}
But the compiler doesn't like this. Any ideas how to do this?
Marc | 0 | [
2,
12733,
18,
45,
12733,
718,
432,
27,
12733,
718,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
12733,
365,
30,
25,
432,
27,
21,
718,
29,
21,
12733,
18,
432,
1206,
317,
718,
12733,
1898,
1,
38,
1,
13,
1,
968,
1,
38,
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... |
Remember preferable language
===
I've made a simple website for my daughter.
It is in Dutch and for every page there is a English version as well.
Dutch URL: nl/index.html
English URL: eng/index.html
What I would like to do is give the visitor the option to set one language as preference. So if they come to this site the next time they will automatically linked to the preferable page.
I know this can be done with a cookie and saw the explanation on this forum ( http://stackoverflow.com/questions/9960936/how-to-remember-the-currently-clicked-url-javascriptphp ).
I've tried to make this work but apparently I am doing something wrong?
Can somebody guide me through step by step? That would be great!
Kind regards,
Jurgen | 0 | [
2,
1518,
6369,
579,
816,
800,
3726,
3726,
31,
22,
195,
117,
21,
1935,
2271,
26,
51,
783,
9,
32,
25,
19,
2117,
17,
26,
352,
2478,
80,
25,
21,
486,
615,
28,
134,
9,
2117,
287,
6362,
45,
13,
10651,
118,
25671,
9,
15895,
486,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Server.mappath confusion
===
There is a little confusion in my mind about server.mappath
which is correct and what's the difference betwwen these two
FileUpload1.saveAs(Server.MapPath("~/User/images/")+"ankush.jpg"));
FileUpload1.saveAs(Server.MapPath("~/User/images")+"ankush.jpg")); | 0 | [
2,
8128,
9,
15022,
8353,
5677,
800,
3726,
3726,
80,
25,
21,
265,
5677,
19,
51,
594,
88,
8128,
9,
15022,
8353,
56,
25,
4456,
17,
98,
22,
18,
14,
2841,
5676,
499,
5036,
158,
81,
3893,
576,
8294,
165,
9,
19863,
472,
5,
10321,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Post Data on Wordpress Site By Using PHP Curl
===
hi guys i am having a little problem and i am unable to figure it out, I am working on a project we have made application related school management in which we can basically add students,branches,classes make test,show test results,fees management etc.
we also made their website on wordpress my problem is i have a page on my application show results i want to show this page results on their wordpress site by using curl. Basically what i want when user enter his student id and test id and hit search button then show results file which reside on my application showed up. Both application and websites are on different server. Can you guys teach me how can i achieve this. Thanks | 0 | [
2,
678,
1054,
27,
833,
5890,
689,
34,
568,
13,
26120,
14320,
800,
3726,
3726,
4148,
2776,
31,
589,
452,
21,
265,
1448,
17,
31,
589,
2343,
20,
1465,
32,
70,
15,
31,
589,
638,
27,
21,
669,
95,
57,
117,
3010,
1597,
116,
1097,
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... |
Why camera is turning back after taking picture and pressing ok button of my android application?
===
I have created an android application , where camera is turning back to camera mood, after taking picture and pressing ok button. It is happening for the first time when the camera is running and the picture is taken landscape mode,after that every time it is working smoothly. ok button code is given below.
if (requestCode == IMAGE_CAPTURE) {
if (resultCode == RESULT_OK) {
/*Log.d("ANDRO_CAMERA", "Picture taken!!!");
ImageView image = (ImageView) findViewById(R.id.cameraImage);
image.setImageURI(imageUri);*/
Uri selectedImage = imageUri;
getContentResolver().notifyChange(selectedImage, null);
ContentResolver cr = getContentResolver();
ImageView image = (ImageView) findViewById(R.id.cameraImage);
Bitmap bitmap;
try {
bitmap = android.provider.MediaStore.Images.Media
.getBitmap(cr, selectedImage);
image.setImageBitmap(bitmap);
} catch (Exception e) {
Log.e("Camera", e.toString());
}
}
| 0 | [
2,
483,
3336,
25,
2101,
97,
75,
741,
2151,
17,
7196,
5854,
5167,
16,
51,
13005,
3010,
60,
800,
3726,
3726,
31,
57,
679,
40,
13005,
3010,
13,
15,
113,
3336,
25,
2101,
97,
20,
3336,
5190,
15,
75,
741,
2151,
17,
7196,
5854,
5167,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Showing last used text in a UITextField/UISearchBar
===
I am trying to implement a search bar, and I am going to need to be able to show the last 10 searches that were entered when the user starts typing.
My background is non standard (a big background texture basically), and I can't find a way to make the search bar fit in the image without looking too funky.
So.
1. Is there a way to use a UISearchBar/UITextField to show last used searches?
2. How can I take the background of the UISearchBar out (i.e. make it completely go away, leaving only the rounded rectangle of the search bar)?
Thanks!
| 0 | [
2,
3187,
236,
147,
1854,
19,
21,
13,
5661,
11969,
1109,
118,
5661,
25136,
1850,
800,
3726,
3726,
31,
589,
749,
20,
8713,
21,
2122,
748,
15,
17,
31,
589,
228,
20,
376,
20,
44,
777,
20,
298,
14,
236,
332,
19994,
30,
46,
1297,
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... |
Is this my aggregate root?
===
I have a method that loads a collection with a single object with it's children, all ancestors and their children. I don't have a proper name for this method but as far as I know this could be my aggregate root and therefor be named something like GetAggregateRoot? | 0 | [
2,
25,
48,
51,
8544,
5900,
60,
800,
3726,
3726,
31,
57,
21,
2109,
30,
19069,
21,
1206,
29,
21,
345,
3095,
29,
32,
22,
18,
391,
15,
65,
11575,
17,
66,
391,
9,
31,
221,
22,
38,
57,
21,
4119,
204,
26,
48,
2109,
47,
28,
463,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NullPointerException while pdf to image conversion
===
While I was playing around with pdfbox 1.7.0 (apache) I came across a NullPointerException. I can't figure out what the hack is wrong with my code. You can see the full stacktrace at http://pastebin.com/XEuv7VmU and the code here: http://pastebin.com/vJYBwWtq .
I just want to convert every page of a pdf into an image (BufferedImage), is anyone out there who could help me? Thank you :) | 0 | [
2,
16203,
3132,
106,
10066,
872,
133,
13,
11124,
20,
1961,
6263,
800,
3726,
3726,
133,
31,
23,
791,
140,
29,
13,
11124,
5309,
137,
9,
465,
9,
387,
13,
5,
7738,
2569,
6,
31,
281,
464,
21,
16203,
3132,
106,
10066,
872,
9,
31,
92... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Linq: Handle empty table
===
How do you handle an empty table/NullReference in LINQ?
I have the following Linq statement in my code:
List<FeaturedTrack> features = _db.FeaturedTracks.Where(f => (f.FeatureStartDate >= DateTime.Now && f.FeatureEndDate <= DateTime.Now) ||
(f.FeatureStartDate == null && f.FeatureEndDate == null))
.ToList<FeaturedTrack>();
My table is currently empty, now I know this table won't be empty but it got me wondering about how to handle the NullReference error in case it is.
I've tried this:
int test = _db.FeaturedTracks.Count();
if (test > 0)
{
...
}
However my code breaks on the first line, so how do I check the table is empty before running the statement?
| 0 | [
2,
6294,
1251,
45,
3053,
2424,
859,
800,
3726,
3726,
184,
107,
42,
3053,
40,
2424,
859,
118,
4215,
211,
28018,
19,
6294,
1251,
60,
31,
57,
14,
249,
6294,
1251,
3331,
19,
51,
1797,
45,
968,
1,
26956,
43,
4792,
1,
967,
800,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Django sessions: changing session key when modified
===
I am setting up a payment gateway and am using sessions to store data across page requests. The class below is used for organizing and storing information to the session.
class Gateway:
def __init__(self, session_key=None, session_name="FOO"):
# Store session ID and name
self.session_key = session_key
self.session_name = session_name
# Get the session
session = SessionStore(session_key=self.session_key)
try :
data = session[self.session_name]
except :
data = {user_id:None, checked_in:False }
self.__dict__.update(data)
def save(self) :
session = SessionStore(session_key=self.session_key)
session[self.session_name] = deepcopy(self.__dict__)
try :
del session['session_key']
del session['session_name']
except :
pass
session.save()
This view checks to see if the user is logged in. If he/she is, then he/she is redirected. If not, he/she is asked to either login or check in as a guest.
def check_in(request):
gateway = Gateway(session_key=request.session.session_key)
if request.user.is_authenticated():
gateway.user_id = request.user.id
gateway.checked_in = True
gateway.save()
return redirect('next_step')
else:
login_form = FormLogin()
if request.POST:
data = request.POST.copy()
if 'login' in data:
login_form = FormLogin(data)
if login_form.is_valid():
user = login(request, login_form)
if user:
gateway.user_id = user.id
gateway.checked_in = True
gateway.save()
return redirect('next_step')
elif 'guest' in data:
gateway.checked_in = True
gateway.save()
return redirect('next_step')
return render(
request,
'shop/login.html',
{
'login_form':login_form,
}
)
The next view checks the "checked_in" variable. This is to make sure that users are not skipping over the login/checkin process. (As a side note, the function "login(request, login_form)" is a function that is works perfectly in other contexts and returns the User if it was successful and None otherwise)
def next_step(request):
gateway = Gateway(session_key=request.session.session_key)
if not gateway.verified_log_in:
messages.info(request, _(u'You must specify login first.'))
return redirect('check_in')
else:
#do the next step
Now for the problem:
Even when the user is authenticated, the "checked_in" variable is still false and causes the views to loop. A new session with a new session id is created each time that that I set the variable and save. The django docs have some explanation about the modification of sessions, but I cannot understand why new session is being created or why the session key is changing.
| 0 | [
2,
3857,
14541,
5763,
45,
4226,
3723,
1246,
76,
5372,
800,
3726,
3726,
31,
589,
2697,
71,
21,
7582,
12171,
17,
589,
568,
5763,
20,
1718,
1054,
464,
2478,
12279,
9,
14,
718,
1021,
25,
147,
26,
11725,
17,
25615,
676,
20,
14,
3723,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Calling a function in a custom php template in Wordpress
===
I want to call a function which is in another php class that I wrote in Wordpress. However I'm confused about the syntax, e.g. to get the header on a page you just call get_header(); etc. But how do i call a function in a specific class? For example in index.php I want to call a function named this_function() which reside in say test.php. What is the syntax for this?
I suspect it to be very simple, but I can't get the syntax right, and I can't any help online.
Thanks | 0 | [
2,
2555,
21,
1990,
19,
21,
5816,
13,
26120,
22894,
19,
833,
5890,
800,
3726,
3726,
31,
259,
20,
645,
21,
1990,
56,
25,
19,
226,
13,
26120,
718,
30,
31,
738,
19,
833,
5890,
9,
207,
31,
22,
79,
4230,
88,
14,
22649,
15,
13,
62,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NSFetchedResultsController does not update TableView after UIManagedDocuments gets new data
===
I am using a `NSFetchedResultsController` in combination with a `UIManagedDocument` which gets updated in an background thread.
I have set up the NSFetchedResultsController exactly as described in this tutorial: [How To Use NSFetchedResultsController][1]
I have set the delegate `_fetchedResultsController.delegate = self` and the protocol for my view controller to `NSFetchedResultsControllerDelegate`.
My code works fine when it loads the data after launch. However, the `NSFetchedResultsController` **does not update the TableView** whenever it has processed and saved the data in the background thread. In particular, the NSFetchedResultsController's delegate methods `-controllerWillChangeContent:controller`etc. are never being called.
I have double-checked that the SQLite database contains the data correctly.
[1]: http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller
This is how I process and save the data in the view controller:
[backgroundContext performBlock:^{
[company parseAttributesFrom:xmlStr inManagedObjectContext:backgroundContext]; //self.managedDocument.managedObjectContext
NSError *error = nil;
[backgroundContext save:&error];
if (error) NSLog(@"error: %@",error.localizedDescription);
[self.managedDocument.managedObjectContext performBlock:^{
NSError *error = nil;
[self.managedDocument.managedObjectContext save:&error];
if (error) NSLog(@"error: %@",error.localizedDescription);
}];
[self.managedDocument saveToURL:self.managedDocument.fileURL forSaveOperation:UIDocumentSaveForOverwriting completionHandler:NULL];
[self.managedDocument updateChangeCount:UIDocumentChangeDone];
}];
How can I get the NSFetchedResultsController to update the TableView automatically when the underlying data changes?
Thank you for your help! | 0 | [
2,
13,
2172,
28998,
29955,
18,
12898,
1252,
630,
52,
11100,
859,
4725,
75,
13,
5661,
177,
8030,
28132,
18,
3049,
78,
1054,
800,
3726,
3726,
31,
589,
568,
21,
13,
1,
2172,
28998,
29955,
18,
12898,
1252,
1,
19,
3733,
29,
21,
13,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to Post an image To Facebook Wall?
===
Using This Tutorial
https://github.com/facebook/facebook-ios-sdk
I Successfully Login to facebook , i want to post image on facebook wall using fuction
- (IBAction)rateTapped:(id)sender
But its not work for me ,Any help will be appriated .Thanx in advance. | 1 | [
2,
184,
20,
678,
40,
1961,
20,
9090,
769,
60,
800,
3726,
3726,
568,
48,
29724,
7775,
18,
6903,
10404,
20926,
9,
960,
118,
6413,
5199,
118,
6413,
5199,
8,
7760,
8,
18,
43,
197,
31,
3673,
6738,
108,
20,
9090,
13,
15,
31,
259,
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... |
PHP - SQL making a menu with submenu's
===
Hy,
The title says it al, i want to make a menu with submenu's.
So something like this:
<ul><li>parent1<ol><li>sub2<ol><li>sub 3</li></ol></li></ol></li><li>parent2</li></ul>
I've got this already working, but the code doesn't look nice.
So how can i improve my code, or does you know it beter, post it then.
This is the code:
<?php
$le_content .= '<div id="main_menu">';
$sQuery_get_all_parents = " SELECT
menu.id,
menu.`name`,
menu.url,
menu.parent_id
FROM `menu`
WHERE
menu.actif = 1 AND
menu.parent_id = 0
ORDER BY
menu.volgorde ASC";
$rResultaat_get_all_parents = mysql_query($sQuery_get_all_parents) or die(mysqlError($sQuery_get_all_parents));
$menu_parents = array();
$menu_child_1 = array();
$counter = 0;
$counter_child_1 = 0;
$counter_child_2 = 0;
while($row = mysql_fetch_assoc($rResultaat_get_all_parents)){
$menu_parents[$counter]['id'] = $row['id'];
$menu_parents[$counter]['name'] = $row['name'];
$menu_parents[$counter]['url'] = $row['url'];
$menu_parents[$counter]['parent_id'] = $row['parent_id'];
$counter++;
}
$le_content .= '<ul id="main_menu_ul">';
foreach ($menu_parents as $menu_entry => $value) {
$le_content .= '<li><a href="'.ROOT_HREF.$value['url'].'" >'.$value['name'].'</a>';
$sQuery_get_first_children = " SELECT
menu.id,
menu.`name`,
menu.url,
menu.parent_id
FROM `menu`
WHERE
menu.actif = 1 AND
menu.parent_id = ".$value['id']."
ORDER BY
menu.volgorde ASC";
$rResultaat_get_first_children = mysql_query($sQuery_get_first_children) or die(mysqlError($sQuery_get_first_children));
$row_count = mysql_num_rows($rResultaat_get_first_children);
if($row_count != false){
$le_content .= '<ol>';
while($row = mysql_fetch_assoc($rResultaat_get_first_children)){
$menu_child_1[$counter_child_1]['id'] = $row['id'];
$menu_child_1[$counter_child_1]['name'] = $row['name'];
$menu_child_1[$counter_child_1]['url'] = $row['url'];
$menu_child_1[$counter_child_1]['parent_id'] = $row['parent_id'];
$counter_child_1++;
}
foreach ($menu_child_1 as $menu_entry_child_1 => $value_child_1) {
$le_content .= '<li><a href="'.ROOT_HREF.$value_child_1['url'].'" >'.$value_child_1['name'].'</a>';
$sQuery_get_second_children = " SELECT
menu.id,
menu.`name`,
menu.url,
menu.parent_id
FROM `menu`
WHERE
menu.actif = 1 AND
menu.parent_id = ".$value_child_1['id']."
ORDER BY
menu.volgorde ASC";
$rResultaat_get_second_children = mysql_query($sQuery_get_second_children) or die(mysqlError($sQuery_get_second_children));
$row_count = mysql_num_rows($rResultaat_get_second_children);
if($row_count != false){
$le_content .= '<ol>';
while($row = mysql_fetch_assoc($rResultaat_get_second_children)){
$menu_child_2[$counter_child_2]['id'] = $row['id'];
$menu_child_2[$counter_child_2]['name'] = $row['name'];
$menu_child_2[$counter_child_2]['url'] = $row['url'];
$menu_child_2[$counter_child_2]['parent_id'] = $row['parent_id'];
$counter_child_2++;
}
foreach ($menu_child_2 as $menu_entry_child_2 => $value_child_2) {
$le_content .= '<li><a href="'.ROOT_HREF.$value_child_2['url'].'" >'.$value_child_2['name'].'</a></li>';
}
$le_content .= '</ol>';
}
$le_content .= '</li>';
}
$le_content .= '</ol>';
}
$le_content .= '</li>';
}
$le_content .= '</ul></div>';
?>
in the end, i echo $le_content.....
Thanks in advantage. | 0 | [
2,
13,
26120,
13,
8,
4444,
255,
544,
21,
11379,
29,
972,
755,
291,
22,
18,
800,
3726,
3726,
4085,
15,
14,
581,
898,
32,
493,
15,
31,
259,
20,
233,
21,
11379,
29,
972,
755,
291,
22,
18,
9,
86,
301,
101,
48,
45,
13,
1,
1287,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 custom events data (subscribe and trigger)
===
I'm trying to figure out, how I can set arguments for custom events.
How I can set an argument when I subscribing the event and then add some additional data when i trigger event.
I have a simple JS for testing, but in e parameter of "handle" i see only data of subscribe.
function handle(e) {
//e.data has only "b"
alert(e.data);
}
function myObj() {
this.raise = function () {
//Trigger
$(this).trigger("custom", { a: "a" });
}
}
var inst = new myObj();
//Subscribe
$(inst).bind("custom", { b: "b" }, handle);
inst.raise();
Thank you. | 0 | [
2,
487,
8190,
93,
5816,
963,
1054,
13,
5,
20330,
17,
7286,
6,
800,
3726,
3726,
31,
22,
79,
749,
20,
1465,
70,
15,
184,
31,
92,
309,
10553,
26,
5816,
963,
9,
184,
31,
92,
309,
40,
5476,
76,
31,
972,
28723,
14,
807,
17,
94,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
block my out going call and launch an activity for that specified time
===
i wish to plan to block my out going call and launch an activity for that specified time....But when i am attempting to try this activity launches but it should be work as background and the call screen may appear....my OutgoingCallReceiver.java code as follows
package com.dpn.pack;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.sax.StartElementListener;
import android.widget.Button;
import android.widget.Toast;
public class OutgoingCallReceiver extends BroadcastReceiver {
SQLiteDatabase mydb;
static String key;
Button b1;
private static final String OUTGOING_CALL_ACTION = "android.intent.action.NEW_OUTGOING_CALL";
private static final String INTENT_PHONE_NUMBER = "android.intent.extra.PHONE_NUMBER";
@Override
public void onReceive(Context context,Intent intent) {
mydb=context.openOrCreateDatabase("key", 0, null);
mydb.execSQL("CREATE TABLE IF NOT EXISTS keys(num INT(13))");
Cursor cur=mydb.rawQuery("select * from keys", null);
while(cur.moveToNext())
{
key=cur.getString(cur.getColumnIndex("num"));
}
cur.close();
System.out.println("************************"+key+"*******************************");
mydb.close();
if (intent.getAction().equals(OutgoingCallReceiver.OUTGOING_CALL_ACTION)) {
// get phone number from bundle
String phoneNumber =intent.getExtras().getString(OutgoingCallReceiver.INTENT_PHONE_NUMBER);
if ((phoneNumber != null) && phoneNumber.equals(OutgoingCallReceiver.key)) {
Intent in=new Intent(context,Badge_success.class);
in.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(in);
abortBroadcast();
}
}
}
}
my xml file as
<receiver android:name=".OutgoingCallReceiver">
<intent-filter android:priority="2147483647">
<action android:name="android.intent.action.NEW_OUTGOING_CALL"/>
</intent-filter>
</receiver>
| 0 | [
2,
1921,
51,
70,
228,
645,
17,
3394,
40,
2358,
26,
30,
9931,
85,
800,
3726,
3726,
31,
2536,
20,
944,
20,
1921,
51,
70,
228,
645,
17,
3394,
40,
2358,
26,
30,
9931,
85,
9,
9,
9,
9,
811,
76,
31,
589,
6314,
20,
1131,
48,
2358,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Navigation bar being hidden behind content
===
This is the init method for a UINavigationController. I think I must be doing this wrong.
- (id)init
{
self = [super init];
if (self) {
self.view.backgroundColor = [UIColor blackColor];
self.viewController = [[UIViewController alloc] init];
self.viewControllers = [NSArray arrayWithObject:self.viewController];
UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithTitle:@"Done"
style:UIBarButtonItemStylePlain
target:self
action:@selector(done)];
self.viewController.navigationItem.rightBarButtonItem = button;
self.navigationBar.barStyle = UIBarStyleBlackTranslucent;
self.mediaScrollView = [[MediaScrollView alloc] initWithFrame:self.view.bounds];
self.mediaScrollView.touchDelegate = self;
self.mediaScrollView.fullScreenDelegate = self;
[self.viewController.view addSubview:self.mediaScrollView];
}
return self;
}
The mediaScrollView is going in front of my navigation bar. It should be appearing behind the navigation bar.
This is the method for calling it:
self.mediaVC = [[PDMediaViewController alloc] init];
self.mediaVC.mediaScrollView.manualMedia = YES;
self.mediaVC.mediaScrollView.mediaDelegate = self;
self.mediaVC.mediaScrollView.currentMediaItem = 0;
self.mediaVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:self.mediaVC animated:YES]; | 0 | [
2,
8368,
748,
142,
3689,
439,
2331,
800,
3726,
3726,
48,
25,
14,
19,
242,
2109,
26,
21,
287,
1673,
13227,
857,
12898,
1252,
9,
31,
277,
31,
491,
44,
845,
48,
1389,
9,
13,
8,
13,
5,
1340,
6,
108,
242,
13,
1,
1119,
800,
636,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Erasing type parameter
===
I have a module Socket using phantom types to enforce some simple access control:
module Socket : sig
type 'a t
val ro : string -> [ `Read ] t
val rw : string -> [ `Read | `Write ] t
end
I want to wrap a Socket.t in a Container.t record, but is there some way **not** to propagate the phantom type parameter also into
Container.t?
module Container : sig
type 'a t =
{
owner: string;
socket: 'a Socket.t;
}
end
| 0 | [
2,
2047,
18,
68,
1001,
18906,
800,
3726,
3726,
31,
57,
21,
12613,
18482,
568,
11771,
2551,
20,
16525,
109,
1935,
1381,
569,
45,
12613,
18482,
13,
45,
8858,
1001,
13,
22,
58,
13,
38,
3347,
13,
661,
13,
45,
3724,
13,
8,
1,
636,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Initial "No OpenID Endpoint Found" on Windows Azure
===
I've looked at the various questions on this topic but none of them QUITE fit the problem I'm having.
I've developed an MVC4 app which utilizes DNOA to call into a particular provider (Intuit). All worked perfectly on my local IIS (testing) but when I deployed to Windows Azure I get the proverbial wonderful "strange, intermittent" behavior. Specifically, 99% of the time, the initial sign-in request results in the "No OpenID Endpoint Found" error; however, SUBSEQUENT sign-ins go through without a hitch.
I've added the code referred to here: [ServiceManagerCode][1], to no avail. I've checked and the OpenID URL is correct. I've also attempted to add log4net to see what might be occurring but have been unable to do this correctly, some other answers seem to suggest this returns nothing anyway. I've also asked Intuit but, so far, no responses.
Again, if this wasn't occurring on just the first attempt then there would be numerous relevant posts but with this peculiar behavior I am wary of wasting inordinate amounts of time on a wild goose chase.
Any suggestions, however slight, would be very much appreciated.
[1]: http://stackoverflow.com/questions/10969426/no-openid-endpoint-found-on-azure-website | 0 | [
2,
2104,
13,
7,
251,
368,
1340,
241,
3132,
216,
7,
27,
1936,
25715,
800,
3726,
3726,
31,
22,
195,
292,
35,
14,
617,
2346,
27,
48,
8303,
47,
2369,
16,
105,
1450,
2742,
14,
1448,
31,
22,
79,
452,
9,
31,
22,
195,
885,
40,
307,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 generate isolines (contour lines) at specific values from irregular data?
===
I have an array of sample points with their (X, Y, Z) coordinates. I use Delaunay Triangulation to generate an irregular network from them and then I use linear interpolation to plot contour lines at fixed values (e.g. 90, 95, 100, 105). The problem is that I need smooth contour lines to be generated with another algorithm. I've searched for some time now and found out that I need to use something like Kriging but I'm not that good at math to implement the algorithm from pure mathematical relations. Also I can't seem to find an implementation or explanation of the algorithm anywhere. Can anyone help me find one? Also, am I right with the chosen algorithm? Is there another one that can be easier to implement? Note that I don't care about precision.
https://dl.dropbox.com/u/15926260/ex.png
P.S. I've done a plot in Surfer showing the results that I'm looking for. On the right side is what I have done using triangulation and linear interpolation and on the left side is what I need to plot using a different algorithm (Kriging was used in Surfer).
Sorry for the spelling mistakes but I'm not a native language speaker.
Thank you! | 0 | [
2,
184,
20,
7920,
11899,
7939,
13,
5,
1126,
11648,
1560,
6,
35,
1903,
4070,
37,
10687,
1054,
60,
800,
3726,
3726,
31,
57,
40,
7718,
16,
5717,
819,
29,
66,
13,
5,
396,
15,
13,
93,
15,
2052,
6,
13714,
9,
31,
275,
16293,
4140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 you call an instance method on BCL type from T-SQL without uploading a full SQLCLR assembly?
===
I have a datetimeoffset column in a table with varying TZ offsets in the rows. I'd like to run them all through the [ToLocalTime][1] method on the BCL type System.DateTimeOffset (due to Daylight Saving, I can't just use the [SWITCHOFFSET][2] function).
The 'brute force' approach appears to be creating a static class with a static method, something like:
public static class DateTimeUtils
{
public static DateTimeOffset ToLocalTimeZone(DateTimeOffset input)
{
return input.ToLocalTime();
}
}
Is there any simpler route that would allow calling the BCL type/method without having to create an assembly in the database just for this?
I was hoping I'd be able to just call a method off of the SQL type, but no such luck. Trying something like this:
DECLARE @foo datetimeoffset = getdate()
select [datetimeoffset]::ToLocalTime(@foo)
... gives
Msg 258, Level 15, State 1, Line 3
Cannot call methods on datetimeoffset.
Thanks!
[1]: http://msdn.microsoft.com/en-us/library/system.datetimeoffset.tolocaltime.aspx
[2]: http://msdn.microsoft.com/en-us/library/bb677244.aspx
| 0 | [
2,
184,
107,
42,
645,
40,
4851,
2109,
27,
2726,
255,
1001,
37,
13,
38,
8,
18,
22402,
366,
71,
16866,
21,
503,
4444,
6109,
12988,
1475,
60,
800,
3726,
3726,
31,
57,
21,
1231,
891,
1299,
3554,
4698,
19,
21,
859,
29,
9852,
13,
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... |
Missing semicolon in class declaration
===
I suspect this is a very minor issue, but I have spent several hours trying to fix it and have not found anything.
In Game.h (a header file), I have the following:
#pragma once
#include "PlayEngine.h"
class Game {
public:
int Init();
int Run();
int Shutdown();
private:
enum State { ST_MENU, ST_PLAYING } state;
PlayEngine* playengine_;
};
The compiler throws a syntax error on `PlayEngine* playengine_`, complaining that there is a missing `;` before the `*`. PlayEngine is a class I have defined in other places.
What am I missing? | 0 | [
2,
2863,
1922,
12805,
103,
19,
718,
7098,
800,
3726,
3726,
31,
7551,
48,
25,
21,
253,
1689,
1513,
15,
47,
31,
57,
1111,
238,
974,
749,
20,
6098,
32,
17,
57,
52,
216,
602,
9,
19,
250,
9,
252,
13,
5,
58,
157,
106,
3893,
6,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Web Api call with a complex object as parameter
===
My webApi Controller
[HttpPost]
public ISearchProviderCommandResult ExecuteCommand(ISearchProviderCommand command)
{
MySearchProvider searchProvider = new MySearchProvider();
return searchProvider.ExecuteCommand(command);
}
My class that calls the webapi
public ISearchProviderCommandResult ExecuteCommand(ISearchProviderCommand searchCommand)
{
WebRequest request = HttpWebRequest.Create(String.Format("{0}", "http://localhost:62158/api/SearchProvider"));
request.Method = "POST";
request.ContentType = "application/json";
using (Stream requestStream = request.GetRequestStream())
{
BinaryFormatter bf = new BinaryFormatter();
MemoryStream ms = new MemoryStream();
bf.Serialize(ms, searchCommand);
requestStream.Write(ms.ToArray(), 0, ms.ToArray().Length);
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
return (ISearchProviderCommandResult)null; //just for now till I get the code to work
}
My searchCommand object
[Serializable]
class SearchProviderCommand : ISearchProviderCommand
{
public string OperationContext {get; set;}
public string OperationId{get; set;}
}
I have a break point in my webapi controller and a breakpoint on the line
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
When I try to step into the webapi controller, I get a 500 error and it doesnt even hit the breakpoint inside the webapi controller. Here are my questions:
1. What am I doing wrong?
2. Can I send complex objects to web api requests? | 0 | [
2,
2741,
21,
2159,
645,
29,
21,
1502,
3095,
28,
18906,
800,
3726,
3726,
51,
95,
969,
2159,
9919,
636,
21127,
6962,
500,
317,
31,
25136,
26735,
139,
16239,
29955,
15644,
16239,
5,
49,
25136,
26735,
139,
16239,
1202,
6,
13,
1,
51,
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... |
Customize jQuery form slider
===
I have a web page with some input sliders just like this one: [http://jqueryui.com/demos/slider/#steps][1].
What I need, is to force the user to move the slider before he presses the submit button.
So I'm thinking in put the default color of the handle red, and if he presses submit when it's red, an alert window appears warning that he needs to click or move the handle. Of course, when he do that the color will change and he'll able to continue.
What I've so far is:
<html>
<head>
<meta charset="utf-8">
<link type="text/css" href="jQuery/css/start/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<script type="text/javascript" src="jQuery/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jQuery/js/jquery-ui-1.8.21.custom.min.js"></script>
<style>
#demo-frame > div.demo { padding: 10px !important; };
</style>
<script>
$(document).ready(function() {
$(".slider").slider({
step: 0.01,
min: 0,
max: 1,
value: 0.5,
slide: function(event, ui) {
$("input[name=" + $(this).attr("id") + "_question]").val(ui.value);
}
});
});
</script>
<form action="next.php" method="POST">
<input type="hidden" value=0.5 name="first_question"/>
<div class="demo">
<p>
<label>question 1:</label>
</p>
<div class="slider" id="first"></div>
<br />
<br />
<input type="hidden" value=0.5 name="second_question"/>
<p>
<label>question 2:</label>
</p>
<div class="slider" id="second"></div>
</div><!-- End demo -->
<br />
<input type="submit" value="submit" id="bt"/>
</form>
</body>
</html>
Is this too much complicated to implement?
Any help is welcome.
[1]: http://jqueryui.com/demos/slider/#steps | 0 | [
2,
5816,
2952,
487,
8190,
93,
505,
3295,
106,
800,
3726,
3726,
31,
57,
21,
2741,
2478,
29,
109,
6367,
3295,
445,
114,
101,
48,
53,
45,
636,
21127,
6903,
728,
2005,
11867,
49,
9,
960,
118,
19274,
18,
118,
18,
1210,
1157,
118,
591... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 servlets are not thread safe and EJBs are Thread Safe, why are they not consistent
===
As per my understanding, server container would create limited instances of a servlets and multiple threads of each servlet instance and reuse those threads and instances.
Because there are multiple instances of a thread, they are not "Thread-safe" (though I understand that coding them with Thread-safety is not difficult).
EJBs containers on the other hand do not create threads of EJB, but reuse EJB objects only (using pool). Since there are no multiple threads of an EJB instance, not question of thread safety.
My question: Why we have two different behaviors? Is not it a good idea to make EJBs work as Servlets (thread unsafe)?
I am sure I am missing something and want to understand that missing part.
| 0 | [
2,
483,
13,
10321,
11045,
50,
52,
9322,
1834,
17,
13,
10022,
4562,
50,
9322,
1834,
15,
483,
50,
59,
52,
8224,
800,
3726,
3726,
28,
416,
51,
3260,
15,
8128,
12147,
83,
1600,
1317,
13946,
16,
21,
13,
10321,
11045,
17,
1886,
20396,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
4sum implementation in Java from leetcode
===
About this four sum problem, I have 2 questions: <br/> 1. Where I went wrong? The compiled code cannot pass all the tests, but I thought the code should be right since it is only using brute force to solve the problem. <br/> 2. Is there any efficient way to solve the four sum problem instead of this O(n^4) run-time algorithm? <br/>Thanks a lot.<hr/>
<pre>
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
public class FourSumSolution{
public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target){
ArrayList<ArrayList<Integer>> aList = new ArrayList<ArrayList<Integer>>();
int N = num.length;
for(int i=0; i<N; i++)
for(int j=i+1; j<N; j++)
for(int k=j+1; k<N; k++)
for(int l=k+1; l<N; l++){
int sum = num[i] + num[j] + num[k] + num[l];
if(sum == target){
ArrayList<Integer> tempArray = new ArrayList<Integer>();
Collections.addAll(tempArray, num[i], num[j], num[k], num[l]);
aList.add(tempArray);
}
}
return aList;
}
}
</pre>
| 0 | [
2,
268,
18,
723,
6123,
19,
8247,
37,
1358,
38,
9375,
800,
3726,
3726,
88,
48,
222,
3907,
1448,
15,
31,
57,
172,
2346,
45,
13,
1,
5145,
118,
1,
137,
9,
113,
31,
296,
1389,
60,
14,
9316,
1797,
1967,
1477,
65,
14,
4894,
15,
47,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Drupal 6 not loading page-user.tpl.php file
===
I am running a Drupal 6 installation and am using domainname.com/user to use Drupal's special functionality (ie display the login screen if the user isn't login or display the user's profile if they are). The problem is that I have created a page-user.tpl.php file and have it placed in the template directory under the theme directory that I am using. In there is the page.tpl.php file as well so Drupal should find these template files. The problem that I have is that Drupal is not loading the page-user.tpl.php file but is loading the page.tpl.php file. I have cleared the cache numerous times but it is still not loading.
I have no idea what is wrong. Can someone please help me as I am pulling my hair out. I have googled for an answer but can't find anything.
| 0 | [
2,
15708,
6720,
400,
52,
12797,
2478,
8,
16704,
9,
38,
5727,
9,
26120,
3893,
800,
3726,
3726,
31,
589,
946,
21,
15708,
6720,
400,
7758,
17,
589,
568,
4603,
7259,
9,
960,
118,
16704,
20,
275,
15708,
6720,
22,
18,
621,
18548,
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... |
Sencha Touch 2 how it relates to my knowledge of html5/javascript web development
===
So Ive been learning HTML5 and javascript(including all the other stuff that goes with these two), and now my managers at my internship are asking me to use Sencha Touch 2. What I have found is that everything I have learned is almost irrelevant. I feel like the way things are done in Sencha Touch 2 are almost completely different from web development using html5/javascript...the only thing common is a tad bit of html and css. Am i correct or am i wrong? I feel like unsatisfied knowing i spent the last few weeks getting bettter at javascript/html5 to learn that it is not useful for sencha touch 2. I have not dwelled to deep yet into Sencha Touch, but that is how i feel so far | 0 | [
2,
8252,
1651,
1723,
172,
184,
32,
16429,
20,
51,
1918,
16,
13,
15895,
10551,
1004,
1385,
8741,
2741,
522,
800,
3726,
3726,
86,
5568,
74,
2477,
13,
15895,
264,
17,
8247,
8741,
5,
3970,
65,
14,
89,
3217,
30,
1852,
29,
158,
81,
6,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
what are my options if I need rebranded iOS app to run on 150 iPads?
===
I have application in App Store. A client approached me asking if he can get the same application but with different name, different graphics and little other changes installed on his iPads - 150 of them. If that would be 10 iPads - i would do a custom build, add all iPads into provisioning certificate, and that would be it. But that won't work for 150 iPads. So what are my options? So far I can think about the following:
1. Open 2 more dev accounts and add UUIDs into them - but I have a feeling that Apple won't like this.
2. Do the required changes - and submit the app into App Store with different name
3. Figure something out with Enterprise distribution - but I do not think it will work from legal point of view - my client wants to install the apps on his clients' iPads - so it's clearly NOT "in-house" distribution.
So far **option #2 looks the most promising to me** - submit as a different app to App Store. But I'm afraid that Apple will not let almost identical app to go into App Store. Especially if I submit it from the same account as the primary app. Can Apple block me for this? Any other ideas?
Thank you.
| 0 | [
2,
98,
50,
51,
6368,
100,
31,
376,
20992,
13,
7760,
4865,
20,
485,
27,
4354,
31,
8240,
18,
60,
800,
3726,
3726,
31,
57,
3010,
19,
4865,
1718,
9,
21,
6819,
4132,
55,
3379,
100,
24,
92,
164,
14,
205,
3010,
47,
29,
421,
204,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error listenerStart - JaxWS - JBoss as 7
===
I'm trying to migrate a Jax-WS based web service to JBoss as 7 but the application (deployed as a war) failes to start the listener on start-up.
ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-14) Error listenerStart
ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-14) Context [/abc] startup failed due to previous errors
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14) MSC000001: Failed to start service jboss.web.deployment.default-host (...)
The error message references to **failed due to previous errors** however no errors are printed in the log. The application in question bundles jax-ws-rt like this:
<dependency>
<groupId>sun-jaxws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.1.7</version>
</dependency>
If I change the scope of the jax-ws-rt to be provided this causes a nice ClassNotFound as expected.
WARN [org.jboss.as.ee] (MSC service thread 1-13) JBAS011006: Not installing optional component com.sun.xml.ws.transport.http.servlet.WSServletContextListener due to exception: java.lang.ClassNotFoundException: com.sun.xml.ws.transport.http.servlet.WSServletContextListener (…)
The servlet is defined like this in the web.xml.
<listener>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
<servlet>
<description>JAX-WS endpoint for data service</description>
<display-name>abc</display-name>
<servlet-name>abc</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>abc</servlet-name>
<url-pattern>/services/abc</url-pattern>
</servlet-mapping>
**I cant understand whats wrong. How do I solve this and get the application deployed?**
Thoughts:
1. Am I missing a dependency?
2. Can I reconfigure the war to use Jboss internal JaxWS without major refactoring?
3. If I cant use a jboss internal JaxWS version can I force Jboss to use a version of Jaxws that I bundle in the war? (If so, what dependencies do I need for JaxWs?)
| 0 | [
2,
7019,
21772,
13680,
13,
8,
11712,
10268,
13,
8,
487,
10349,
18,
28,
453,
800,
3726,
3726,
31,
22,
79,
749,
20,
22985,
21,
11712,
8,
10268,
432,
2741,
365,
20,
487,
10349,
18,
28,
453,
47,
14,
3010,
13,
5,
17309,
10892,
69,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Upgrading "initialization from incompatible pointer type" warning to an error
===
I am working on a code base that's compiled with gcc, which is doing a lot of initialisation of structures containing function pointers.
Whenever anyone makes a mistake with the function types I get the warning "initialization from incompatible pointer type". I would like to upgrade this to an error, because it's obviously wrong.
Unfortunately I cannot seem to find what the compiler option name of this warning is to use with `-Werror='. And turning all warnings into errors isn't an options here (for reasons which are not relevant right now).
Apparently adding `-fdiagnostics-show-option` is supposed to annotate each compiler warning with the compiler option name, and indeed, it does so... for all warnings except this one. So now I'm confused. Any suggestions?
This is gcc 4.4.5 for ARM, running on Linux. | 0 | [
2,
26939,
13,
7,
27313,
1829,
37,
19,
20049,
454,
106,
1001,
7,
3590,
20,
40,
7019,
800,
3726,
3726,
31,
589,
638,
27,
21,
1797,
1000,
30,
22,
18,
9316,
29,
489,
3384,
15,
56,
25,
845,
21,
865,
16,
2104,
4330,
16,
3815,
3503,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What happens to wget when the ssh pipe gets broken?
===
Say, I'm downloading a file using wget on the server machine via SSH and due to some internet connectivity issues, ssh kicks me out saying broken pipe. What happens to the wget download? Would it stop or would it continue? If it were to continue, how do you get back to see the download process? | 2 | [
2,
98,
5531,
20,
619,
3060,
76,
14,
13,
18,
1635,
7642,
3049,
2023,
60,
800,
3726,
3726,
395,
15,
31,
22,
79,
7121,
68,
21,
3893,
568,
619,
3060,
27,
14,
8128,
1940,
1197,
13,
18,
1635,
17,
397,
20,
109,
2620,
24026,
1549,
15,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Reaching a specific word in a string
===
Hi I have a string like this:
word1--tab--word2--tab--word3--tab--word4--tab--word5--tab--word6
I need to extract the third word from the string. I thought of reading character by character and getting the word after reading the second tab. But I guess it is inefficient. Can you show me a more specific way please? | 0 | [
2,
2669,
21,
1903,
833,
19,
21,
3724,
800,
3726,
3726,
4148,
31,
57,
21,
3724,
101,
48,
45,
833,
165,
8,
8,
15783,
8,
8,
9587,
135,
8,
8,
15783,
8,
8,
9587,
240,
8,
8,
15783,
8,
8,
9587,
300,
8,
8,
15783,
8,
8,
9587,
264... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cannot get to work VB.NET DLL referenced by VB6 client in reg-free scenario
===
I am trying to access a VB.NET DLL (.NET FX 4.0) from a VB6 client in a reg-free scenario.
I tried to follow the example from <http://msdn.microsoft.com/en-us/library/ms973915.aspx>, but with no success. I downloaded (link in the article) the sources and compiled, no success (error message: Run-time error '-2146234341 (8013101b)': Automation error"). Running from VB6 IDE using registered VB.NET DLL works.
I tried other examples where the .NET DLL is created as a COM Class (using "COM Class" template from VS2010), with manifest for referenced DLL embedded or not, but nothing worked for me.
Can somebody provide some simple source code with manifests example of VB.NET DLL (.NET FX v4) used in VB6 client in reg-free scenario?
Thanks much in advance. | 0 | [
2,
1967,
164,
20,
170,
13,
20468,
9,
2328,
13,
43,
211,
17571,
34,
13,
20468,
379,
6819,
19,
7953,
8,
4639,
12705,
800,
3726,
3726,
31,
589,
749,
20,
1381,
21,
13,
20468,
9,
2328,
13,
43,
211,
13,
5,
9,
2328,
13,
16488,
268,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
9patch for a lot of resources without losing quality
===
My designer works on Illustrator and exports all the resources for mdpi, hdpi and xhdpi (and also for iOS res) with a script. For buttons and streachables images, I'm looking for the best solution to generate the 9patches.
Until now, I was using the draw9patch soft in the SDK to generate the 9patches. It still works, but seriously, I hope that there is a better way. If in my project I have 20 buttons, with 3 or 4 states, and in 3 density types, I can't imagine the hours that this solution will require.
A solution would be to use the Asset Studio tool, but I don't want to provide my xhdpi file, and get poorly generated images for the other density folders. My goal is to get pixel perfect 9patches for each density.
We also tried to use SVG files for stretchable images, but it seems that Asset Studio doesn't accept them.
If my designer tries to make the 9patch directly in Illustrator, he can't use the script to export, because the 1 px line will be scaled too, and won't measure 1px anymore.
So is there a solution to make 9patches, without losing image quality, and without spending ten hours for it ? | 0 | [
2,
561,
23661,
26,
21,
865,
16,
2566,
366,
2281,
2190,
800,
3726,
3726,
51,
4742,
693,
27,
13805,
17,
16716,
65,
14,
2566,
26,
8138,
2159,
15,
8590,
2159,
17,
23077,
43,
2159,
13,
5,
290,
67,
26,
13,
7760,
10719,
6,
29,
21,
38... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Force version of ASP.NET MVC
===
We've got a couple of projects here at work. One uses MVC4 Beta and the other MVC4 RC.
I have MVC4 RC Installed on my local machine.
I need to be able to build both projects locally however the project using MVC4 Beta makes reference to `System.Web.Http.SelfHost` which has at least one method in beta that is not longer in RC.
How can I force the project using MVC4 Beta to use the dll we require rather than the MVC4 RC version in the GAC? | 0 | [
2,
558,
615,
16,
28,
306,
9,
2328,
307,
8990,
800,
3726,
3726,
95,
22,
195,
330,
21,
1335,
16,
2314,
235,
35,
170,
9,
53,
2027,
307,
8990,
300,
8434,
17,
14,
89,
307,
8990,
300,
16462,
9,
31,
57,
307,
8990,
300,
16462,
4066,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Errors while creating subtheme of AT Commerce
===
I am an intermediate drupal user, I will keep my question simple. Firstly I installed "Adaptive Theme" and then Installed "AT Commerce theme" as all the drupal geeks know that Its important to install Adabtive theme to run AT Commerce. Then I started creating sub theme of AT Commerce following different tutorials on net but what ever and how ever I create theme following error continuously appearing.
Notice: Undefined index: highlighted in include() (line 124 of D:\wamp\www\goAtif\modules\system\page.tpl.php).
Notice: Undefined index: sidebar_first in include() (line 136 of D:\wamp\www\goAtif\modules\system\page.tpl.php).
Notice: Undefined index: sidebar_second in include() (line 142 of D:\wamp\www\goAtif\modules\system\page.tpl.php).
Notice: Undefined index: footheme in drupal_theme_initialize() (line 100 of D:\wamp\www\goAtif\includes\theme.inc).
Notice: Trying to get property of non-object in _drupal_theme_initialize() (line 145 of D:\wamp\www\goAtif\includes\theme.inc).
Notice: Trying to get property of non-object in _theme_load_registry() (line 334 of D:\wamp\www\goAtif\includes\theme.inc).
Notice: Undefined index: footheme in theme_get_setting() (line 1332 of D:\wamp\www\goAtif\includes\theme.inc).
Notice: Trying to get property of non-object in theme_get_setting() (line 1379 of D:\wamp\www\goAtif\includes\theme.inc).
I realy dont know how to get rid of them ... Any help will be appreciated. Thanks | 0 | [
2,
11908,
133,
2936,
972,
124,
790,
16,
35,
5577,
800,
3726,
3726,
31,
589,
40,
6889,
15708,
6720,
4155,
15,
31,
129,
643,
51,
1301,
1935,
9,
64,
102,
31,
4066,
13,
7,
27576,
1284,
3184,
7,
17,
94,
4066,
13,
7,
721,
5577,
3184... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.