unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Is it possible to set to flash the same cookie as my browser has?
===
I use js plugins like uploadify, that uses swf (flash) as uploader (to provide ajax upload).
I can perform upload operation only for logged-in people. But as my website authentication happens not via flash, flash doesn't have cookies as browser has after authentication.
So, in browser i am an administrator, in flash i am guest. Is there a way to setup the same cookie for flash as i have in browser to identify myself without additional hashes or other extra functionality?
Will be happy to any help/advices/links to docs/manuals.
Thank you in advance! | 0 | [
2,
25,
32,
938,
20,
309,
20,
4433,
14,
205,
19980,
28,
51,
16495,
63,
60,
800,
3726,
3726,
31,
275,
487,
18,
10922,
108,
18,
101,
71,
8294,
8612,
15,
30,
2027,
13,
18,
15263,
13,
5,
26694,
6,
28,
71,
8294,
106,
13,
5,
262,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to make these jquery pop ups fall back to css when javascript disabled
===
I have this pop up menu that I plan to use on a map. I want this to fall back to css hover when Java script is disabled. I have tried with sibling selectors and can't get it to work.
here is the fiddle:
[The fiddle][1]
[1]: http://jsfiddle.net/AJBweb1986/GQzEn/1/ | 0 | [
2,
184,
20,
233,
158,
487,
8190,
93,
1675,
71,
18,
1080,
97,
20,
272,
18,
18,
76,
8247,
8741,
10154,
800,
3726,
3726,
31,
57,
48,
1675,
71,
11379,
30,
31,
944,
20,
275,
27,
21,
2942,
9,
31,
259,
48,
20,
1080,
97,
20,
272,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
enable overscroll in android to update the listview
===
i want to enable over scroll for my listview where the listview will bounce similar to any android native applications like contact or mail etc,. and even i would like to update the listview when user over scrolls. Thanks in advance guys. | 0 | [
2,
9240,
84,
3862,
8694,
19,
13005,
20,
11100,
14,
968,
4725,
800,
3726,
3726,
31,
259,
20,
9240,
84,
12159,
26,
51,
968,
4725,
113,
14,
968,
4725,
129,
17625,
835,
20,
186,
13005,
1275,
3767,
101,
2203,
54,
4216,
2722,
15,
9,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Create 2d linear list in matlab
===
Very Simple Question that i couldn't find easily on the web so i thought i would ask here:
You can make a 1D linear array like this:
1:10 = 1 2 3 4 5 6 7 8 9 10
1:2:10 = 1 3 5 7 9
How can you easily initialise a 2D array ie.
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
and also the same thing but for columns:
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
Should be a command to do it in one line. | 0 | [
2,
1600,
172,
43,
6745,
968,
19,
4277,
9086,
800,
3726,
3726,
253,
1935,
1301,
30,
31,
711,
22,
38,
477,
2351,
27,
14,
2741,
86,
31,
289,
31,
83,
1349,
235,
45,
42,
92,
233,
21,
137,
43,
6745,
7718,
101,
48,
45,
137,
6608,
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... |
Retrieving selected text with offset values
===
I want to annotate a text and store the annotated text in database .what am doing is, storing the offset values and selected text in the database.Is there is a possible way to retrieving selection using offset values. | 0 | [
2,
13,
6239,
3272,
8397,
1704,
1854,
29,
17493,
4070,
800,
3726,
3726,
31,
259,
20,
40,
1270,
1373,
21,
1854,
17,
1718,
14,
40,
1270,
1669,
1854,
19,
6018,
13,
9,
608,
589,
845,
25,
15,
25615,
14,
17493,
4070,
17,
1704,
1854,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to represent hex value such as FFFFFFBB in x86 inline assembly programming?
===
assembly newbie here, I am learning about x86 inline assembly programming. I wanted to write this line of code (mov ecx, FFFFFFBB) however the compiler isn’t recognising it. How should hex numbers like that be written in inline assembler code? | 0 | [
2,
184,
20,
3501,
24,
396,
1923,
145,
28,
13,
2460,
2460,
2460,
3490,
19,
993,
3274,
19,
1143,
1475,
3143,
60,
800,
3726,
3726,
1475,
78,
5893,
235,
15,
31,
589,
2477,
88,
993,
3274,
19,
1143,
1475,
3143,
9,
31,
417,
20,
2757,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
AlarmManager never calling onRecieve in AlarmReceiver/BroadcastReceiver
===
Ok, so I know there's multiple dozens of questions out there just like this one, but I've tried everything I can think of and still cannot get my AlarmReceiver class' onReceive method to fire. Maybe I have no idea what I'm doing, maybe I just need another set of eyes. Does anything stick out as wrong with this implementation?
All this is supposed to do is wait a certain period of time (preferably 6 days) and then pop up a notification. (Can you believe there isn't a built in system for this? crontab anyone!?)
MyActivity and BootReceiver both set up an alarm under the necessary conditions. AlarmService kicks out a notification. And AlarmReceiver is _supposed_ to catch the alarm and kick off AlarmService, but it has never caught that broadcast, and won't no matter what I do.
P.S. Most of this has been adapted from http://android-in-practice.googlecode.com/svn/trunk/ch02/DealDroidWithService/
Thanks a lot for your time!
------------ MyActivity.java ------------
<!-- language: lang-java -->
public class MyActivity extends Activity implements SensorEventListener {
private void setupAlarm() {
Log.i(TAG, "Setting up alarm...");
AlarmManager alarmMgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 1, new Intent(context, AlarmReceiver.class), 0);
// Get alarm trigger time from prefs
Log.i(TAG, "Getting alarm trigger time from prefs...");
SharedPreferences mPrefs2 = PreferenceManager.getDefaultSharedPreferences(context);
long trigger = SocUtil.getLongFromPrefs(mPrefs2, AlarmConst.PREFS_TRIGGER);
Log.i(TAG, "Trigger from prefs: " + trigger + " (" + new Date(trigger).toString() + ").");
// If alarm trigger is not set
if(trigger == new Long(-1).longValue()) {
// Set it
trigger = new Date().getTime() + NOTIFY_DELAY_MILLIS;
SocUtil.saveLongToPrefs(mPrefs2, AlarmConst.PREFS_TRIGGER, trigger);
Log.i(TAG, "Trigger changed to: " + trigger + " (" + new Date(trigger).toString() + ").");
// And schedule the alarm
alarmMgr.set(AlarmManager.RTC, trigger, pendingIntent);
Log.i(TAG, "Alarm scheduled.");
}
// If it is already set
else {
// Nothing to schedule. BootReceiver takes care of rescheduling it after a reboot
}
}
}
------------ AlarmService.java ------------
<!-- language: lang-java -->
public class AlarmService extends IntentService {
public AlarmService() {
super("AlarmService");
}
@Override
public void onHandleIntent(Intent intent) {
Log.i(AlarmConst.TAG, "AlarmService invoked.");
this.sendNotification(this);
}
private void sendNotification(Context context) {
Log.i(AlarmConst.TAG, "Sending notification...");
Intent notificationIntent = new Intent(context, Splash.class);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
NotificationManager notificationMgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.icon, "Test1", System.currentTimeMillis());
notification.setLatestEventInfo(context, "Test2", "Test3", contentIntent);
notificationMgr.notify(0, notification);
}
}
------------ AlarmReceiver.java ------------
<!-- language: lang-java -->
public class AlarmReceiver extends BroadcastReceiver {
// onReceive must be very quick and not block, so it just fires up a Service
@Override
public void onReceive(Context context, Intent intent) {
Log.i(AlarmConst.TAG, "AlarmReceiver invoked, starting AlarmService in background.");
context.startService(new Intent(context, AlarmService.class));
}
}
------------ BootReceiver.java ------------
(to restore wiped alarms, because stuff I schedule with the OS isn't important enough to stick around through a reboot -_-)
<!-- language: lang-java -->
public class BootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.i(AlarmConst.TAG, "BootReceiver invoked, configuring AlarmManager...");
Log.i(AlarmConst.TAG, "Setting up alarm...");
AlarmManager alarmMgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 1, new Intent(context, AlarmReceiver.class), 0);
// Get alarm trigger time from prefs
Log.i(AlarmConst.TAG, "Getting alarm trigger time from prefs...");
SharedPreferences mPrefs2 = PreferenceManager.getDefaultSharedPreferences(context);
long trigger = SocUtil.getLongFromPrefs(mPrefs2, AlarmConst.PREFS_TRIGGER);
Log.i(AlarmConst.TAG, "Trigger from prefs: " + trigger + " (" + new Date(trigger).toString() + ").");
// If trigger exists in prefs
if(trigger != new Long(-1).longValue()) {
alarmMgr.set(AlarmManager.RTC, trigger, pendingIntent);
Log.i(AlarmConst.TAG, "Alarm scheduled.");
}
}
}
------------ Manifest ------------
<!-- language: lang-xml -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<activity
android:name=".MyActivity"
android:label="@string/app_name" >
</activity>
<receiver android:name="com.domain.app.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver android:name="com.domain.app.AlarmReceiver"></receiver>
<service android:name="com.domain.app.AlarmService"></service>
| 0 | [
2,
6490,
22256,
243,
2555,
27,
15110,
62,
195,
19,
6490,
99,
1105,
19737,
118,
24162,
99,
1105,
19737,
800,
3726,
3726,
5854,
15,
86,
31,
143,
80,
22,
18,
1886,
10273,
16,
2346,
70,
80,
114,
101,
48,
53,
15,
47,
31,
22,
195,
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... |
Does an asychronous web request in .Net help performance
===
What is the performance difference, if any, between a regular request in C# .net and an asychronous one? | 0 | [
2,
630,
40,
28,
93,
19973,
1291,
2741,
3772,
19,
13,
9,
2328,
448,
956,
800,
3726,
3726,
98,
25,
14,
956,
2841,
15,
100,
186,
15,
128,
21,
1290,
3772,
19,
272,
5910,
13,
9,
2328,
17,
40,
28,
93,
19973,
1291,
53,
60,
3,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How can I make a iPhone to execute a javascript on a onClick event
===
I found this code with a jQuery function to removed the 'onClick' event ad replace it for an 'tap' even in iPhone. I just can't make it work.
How can I make and iPhone to execute those JavaScript other than onclick? I try onChange and no luck neither.
function rebindClicks(){
var userAgent = navigator.userAgent.toLowerCase();
var isIphone = (userAgent.indexOf('iphone') != -1) ? true : false;
if (isIphone) {
// For each event with an inline onclick
$('[onclick]').each(function() {
var onclick = $(this).attr('onclick');
$(this).removeAttr('onclick'); // Remove the onclick attribute
$(this).bind("click", preventClickEvent); // See to it that clicks never happen
$(this).bind('tap', onclick); // Point taps to the onclick
});
}
}
function preventClickEvent(event) {
event.preventDefault();
}
<select name="jumpMenu" class="tableBlackWhite" id="jumpMenu" style="width:275px" onchange="MM_jumpMenu('parent',this,0)" >
<option value="#"><font color="#FF0000" size="3">אנא בחר שיר להשמעה</font></option>
<option onclick="javascript:ajax('/Songs/01.php','SongsContentArea')" value="#"> » נייס באלמו</option>
<option onclick="javascript:ajax('/Songs/02.php','SongsContentArea')" value="#"> » מאתונו</option>
<option onclick="javascript:ajax('/Songs/03.php','SongsContentArea')" value="#"> » פיה אסי</option>
<option onclick="javascript:ajax('/Songs/04.php','SongsContentArea')" value="#"> » טליוסאמה</option>
</select> | 0 | [
2,
184,
92,
31,
233,
21,
21024,
20,
15644,
21,
8247,
8741,
27,
21,
27,
150,
10129,
807,
800,
3726,
3726,
31,
216,
48,
1797,
29,
21,
487,
8190,
93,
1990,
20,
1974,
14,
13,
22,
218,
150,
10129,
22,
807,
21,
43,
3934,
32,
26,
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... |
Ruby, Inheritance class and Initialize module
===
class a
...
def initialize(name, age)
@name=name
@age=age
end
end
class b < a
...
def initialize (name, age, sex)
super(name)
super(age)
@sex=sex
end
I get the error: ArgumentError: wrong number of arguments (3 for 2)
The error points to initialize.
Please advice. | 0 | [
2,
10811,
15,
13852,
718,
17,
2104,
2952,
12613,
800,
3726,
3726,
718,
21,
13,
9,
9,
9,
6312,
2104,
2952,
5,
7259,
15,
348,
6,
13,
1,
7259,
3726,
7259,
13,
1,
1303,
3726,
1303,
241,
241,
718,
334,
13,
1,
21,
13,
9,
9,
9,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is this possible to check the following-sibiling of the current processing element in the xslt 2.0 function?
===
I am using xslt 2.0 for transforming one xml file to another xml file.In XSLT 2.0, i created a function that takes one argument.Actually, the argument is a collection of <w:p> elements.So, in the function i am using <xsl:for-each-group> to get the each <w:p> and process one by one.Suppose, the below mentioned XML file contains one <w:table> elements between <w:p> elements.So, now i want to check following-sibling::w:table in the function after processing each <w:p> element in <xsl:for-each-group> block.
XML File
<w:document>
<w:p> para0</w:p>
<w:p> para1</w:p>
<w:table>table</w:table>
<w:p>para3</w:p>
</w:document>
XSLT Snippet :
<xsl:for-each-group select="$paragraphs" group-starting-with="w:p">
<xsl:apply-templates select="current-group()"> <!-- for processing <w:p>elements -->
</xsl:apply-templates>
<xsl:if test="following-sibling::w:table"> <!--check following-sibling of current <w:p> is <w:table> -->
<xsl:apply-templates select="following-sibling::w:table"> </xsl:apply-templates>
</xsl:if>
</xsl:for-each-group>
But the check for following-sibling::w:table is failed to call the template...
I dont know this check is possible or legal in the function or not. Please Guide me to get out of this issue...
| 0 | [
2,
25,
48,
938,
20,
2631,
14,
249,
8,
18,
16358,
802,
16,
14,
866,
5511,
4520,
19,
14,
993,
18,
255,
38,
172,
9,
387,
1990,
60,
800,
3726,
3726,
31,
589,
568,
993,
18,
255,
38,
172,
9,
387,
26,
22335,
53,
23504,
3893,
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... |
Create and read tree data structure from json string dynamically
===
I'm trying to develop a dynamic query builder for days. But I'm having a problem with building it.
What I'm reviving is a json like this.
{"category":"Case Law","query":{"AND":{"Year the case was instituted":{"having":"","exact":"","any":"","none":""},"AND":{"Report":{"having":"","exact":"","any":"","none":""},"Citation":{"having":"","exact":"","any":"","none":""}}}}}
Here is it in much readable way
Array
(
[category] => Case Law
[query] => Array
(
[OR] => Array
(
[Year] => Array
(
[having] => some
[exact] => values
[any] => might
[none] => have
)
[AND] => Array
(
[Report] => Array
(
[having] =>
[exact] =>
[any] =>
[none] =>
)
[Citation] => Array
(
[having] =>
[exact] =>
[any] =>
[none] =>
)
)
)
)
)
- this json can change according to the user inputs(can have more depth
or less).
- what I'm trying to do is create a search query for apache
lucene...(for the moment lets assume that leaf values are just
strings.)
It **must be** something like this(What I need)
> (Year:another values OR (Report:some valeus AND Citation:some valeues))
I tried with Jettison library and used DefaultMutableTreeNode to create the tree structure . But it didn't work as I expected.Then i tried whit recursive functions and it also didn't worked
I want to is it possible to create this kind of thing. If yes how to do.
Your attempt is highly appreciated!
Thanks in advance.
| 0 | [
2,
1600,
17,
1302,
1541,
1054,
1411,
37,
487,
528,
3724,
7782,
1326,
800,
3726,
3726,
31,
22,
79,
749,
20,
2803,
21,
7782,
25597,
14960,
26,
509,
9,
47,
31,
22,
79,
452,
21,
1448,
29,
353,
32,
9,
98,
31,
22,
79,
302,
12102,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 do this with bat for looping
===
I want to loop these to output sth.<br /><br />
@echo off<br />
set ans=yyynny<br />
echo %ans:~0,1%<br />
echo %ans:~1,1%<br />
echo %ans:~2,1%<br />
echo %ans:~3,1%<br />
echo %ans:~4,1%<br />
echo %ans:~5,1%<br />
pause<br />
<br />
Output:<br />
y<br />
y<br />
y<br />
n<br />
n<br />
y<br />
<br />
After "help for" i got<br />
<br />
set ans=yyynny<br />
for /l %%i in (0,1,5) do (echo %ans:~%%i,1%)<br />
pause<br />
<br />
of courses, it doesnt work. It outputs these:<br />
<br />
yyynny<br />
yyynny<br />
yyynny<br />
yyynny<br />
yyynny<br />
How can i tackle the problem? Thank You in advance. | 0 | [
2,
184,
92,
31,
107,
48,
29,
3570,
26,
5293,
68,
800,
3726,
3726,
31,
259,
20,
5293,
158,
20,
5196,
13,
18,
96,
9,
1,
5145,
13,
118,
1,
5145,
13,
118,
1,
13,
1,
62,
2613,
168,
1,
5145,
13,
118,
1,
309,
40,
18,
3726,
93,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android: Custom View returns to initial layout after soft keyboard appers
===
I have a strange problem with my Custom View Group:
It is an extended FrameLayout representing a custom toggle button which has a handler moved on the left and on the right. (ala iPhone switch toggle button)
I move this handler by this line of code:
mHandler.layout(0, 0, right, 0);
But when another view in my activity, an EditText, gains the focus, then the soft keyboard appears. Well, this event brings my Custom View Group in the initial configuration (if i had switched the custom view group in a "state ON" configuration, it turns on the initial "state OFF" configuration.
It's like the system doesn't remember that layout has changed after the Activity.onCreate().
Does anyone found a solution? | 0 | [
2,
13005,
45,
5816,
1418,
4815,
20,
2104,
9106,
75,
1856,
8896,
4865,
445,
800,
3726,
3726,
31,
57,
21,
2578,
1448,
29,
51,
5816,
1418,
214,
45,
32,
25,
40,
1984,
3523,
4414,
1320,
3793,
21,
5816,
20,
263,
4875,
5167,
56,
63,
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... |
Rotate/Resize Controls behave unexpectedly when JQueryUI widgets are used with Fabric.js
===
I just discovered Fabric.js and though the documentation is a lacking a bit, it seems like it will handle everything I need for an HTML-based Dream Board tool I'm building. It appears that it doesn't play well with JQueryUI, though.
When I set any of my objects to be JQueryUI widgets, button, dialog box, etc...the control handles seem to be non responsive on the top half of my canvas items, and even on the bottom, the hit areas for resizing/rotating are greatly reduced, which makes the items hard to manipulate. Has anyone run into this? Is this a known issue? I checked github and have tried to search SO to no avail.
Thank you!
http://seismicdevelopment.com/test/no-jquery-uis.html - No JQuery UI Widgets...behaves how I'd expect.
http://seismicdevelopment.com/test/with-jquery-uis.html - Click 'Add Image', you'll get an image, but compared to the other page, you'll notice that the corners of the image aren't as interactive...you can move the image ok, but rotating and scaling is ver hit-or-miss. | 0 | [
2,
21448,
118,
99,
10454,
8671,
14149,
16044,
76,
487,
2005,
11867,
49,
4807,
43,
3060,
18,
50,
147,
29,
6172,
9,
728,
18,
800,
3726,
3726,
31,
114,
1848,
6172,
9,
728,
18,
17,
362,
14,
13945,
25,
21,
11690,
21,
1142,
15,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
htaccess mod_rewrite conundrum
===
Ok, so I have this .htaccess file that contains this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php?p=%{REQUEST_URI}&%{QUERY_STRING} [L]
</IfModule>
Problem is, that in apache 2.2.22, the `p` and the other query objects don't come through,
but it works great in apache 2.4.2 .
So basically in apache 2.2.22 it just forwards everything to index.php, but it doesn't have any `get` objects.
Any help, thanks. | 0 | [
2,
13,
9020,
20604,
7226,
1,
99,
23716,
1065,
1020,
17500,
800,
3726,
3726,
5854,
15,
86,
31,
57,
48,
13,
9,
9020,
20604,
3893,
30,
1588,
48,
13,
1,
821,
19673,
62,
7226,
1,
99,
23716,
9,
150,
1,
27891,
16847,
27,
27891,
8436,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Double text on Cufón using IE8
===
We've been having this very weird Cufón issue in IE which cause we haven't been able to adress. I think it's something to do with text that's hidden and cuffóned.
The problem is that both the cuffoned and normal text are shown (and I noticed that the tag <cufon> that is normally used by Cufón is replaced by <:cufon>). Anyway, this happens in native IE8 (not the "IE8 mode" of IE9).
A jsfiddle is worth more than a thousand words: http://jsfiddle.net/Osoascam/vqnh3/1/
To test, click on the red circle so that the text moves left (for some weird reason this only works on FF and IE, but it reproduces the IE8 error, so I can live with that).
Any help would be very appreciated. Here's a screenshot:
![Here is how it looks on IE8][1]
[1]: http://i.stack.imgur.com/5tKB7.png | 0 | [
2,
1494,
1854,
27,
3141,
10229,
568,
13,
660,
457,
800,
3726,
3726,
95,
22,
195,
74,
452,
48,
253,
5455,
3141,
10229,
1513,
19,
13,
660,
56,
1679,
95,
2933,
22,
38,
74,
777,
20,
21,
19137,
18,
9,
31,
277,
32,
22,
18,
301,
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... |
R - Find and Replace first NA in each column without for loops
===
Trying to do this without For Loop but can't figure it out.
I want to replace the first NA in a column with a default value of 0.0000001.
I am doing Last Observation Carried Forward (LOCF) imputation but want to give it a default value.
If I have the following data.frame:
> Col1 Col2 Col3 Col4
> 1 NA 10 99
> NA NA 11 99
> 1 NA 12 99
> 1 NA 13 NA
I want it to look like this:
> Col1 Col2 Col3 Col4
> 1 0.0000001 10 99
> 0.0000001 NA 11 99
> 1 NA 12 99
> 1 NA 13 0.0000001
This is the code I haev that works but is very slow...
#Temporary change for missing first observation
for (u in 1:ncol(data.frame))
{
for (v in 1:nrow(data.frame))
{
#Temporary change the first observations in a row to 0.0000001 until it encounters a value that isn't NA
if(is.na(temp_equity_df_merge2[v,u]))
{
temp_equity_df_merge2[v,u]=0.0000001
}
else break
}
I want to use apply or some variant that will be faster. I am looping over 20 columns and 1 million rows.
Thanks ahead of time for the help. | 0 | [
2,
761,
13,
8,
477,
17,
3934,
64,
1775,
19,
206,
4698,
366,
26,
19661,
800,
3726,
3726,
749,
20,
107,
48,
366,
26,
5293,
47,
92,
22,
38,
1465,
32,
70,
9,
31,
259,
20,
3934,
14,
64,
1775,
19,
21,
4698,
29,
21,
12838,
1923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to add multiple header views in a ListView
===
I've a custom adapter for my `ListView` I want to add project names as the headers to my work requests. Adding a single header works just fine but I'm not sure how to add multiple headers using `addHeaderView`. I don't understand where exactly to place `setAdapter` or is it supposed to be placed multiple times?
This is my java code for a single header which works:
mListView = (ListView)findViewById(R.id.dashboardList);
View header1 = getLayoutInflater().inflate(R.layout.listview_header, null, false);
tv = (TextView) header1.findViewById(R.id.listHeader);
adapter = new MyCustomAdapter(MyDashboardActivity.this, R.layout.mydashboard_row, dashboardBean);
tv.setText("Project 1");
mListView.addHeaderView(header1, null, false);
for (int i=0; i < 7; i++)
{
dashboardBean.add(new DashboardBean(workRequests[i],status[i],actualHours[i]));
}
mListView.setAdapter(adapter);
Now, I for two headers I tried this:
mListView = (ListView)findViewById(R.id.dashboardList);
View header1 = getLayoutInflater().inflate(R.layout.listview_header, null, false);
tv = (TextView) header1.findViewById(R.id.listHeader);
adapter = new MyCustomAdapter(MyDashboardActivity.this, R.layout.mydashboard_row, dashboardBean);
tv.setText("RxOffice");
mListView.addHeaderView(header1, null, false);
for (int i=0; i < 4; i++)
{
dashboardBean.add(new DashboardBean(workRequests[i],status[i],actualHours[i]));
}
tv.setText(Project 2");
mListView.addHeaderView(header1, null, false);
for (int i=4; i < workRequests.length; i++)
{
dashboardBean.add(new DashboardBean(workRequests[i],status[i],actualHours[i]));
}
mListView.setAdapter(adapter);
But this doesn't work! It gives me only the Project 2 header and all 7 entries below it. Could anyone please tell me what's wrong? I'm guessing it has something to do with `setAdapter`. Thanks! | 0 | [
2,
184,
20,
3547,
1886,
157,
106,
4146,
19,
21,
968,
4725,
800,
3726,
3726,
31,
22,
195,
21,
5816,
9924,
106,
26,
51,
13,
1,
5739,
4725,
1,
31,
259,
20,
3547,
669,
1817,
28,
14,
157,
445,
20,
51,
170,
12279,
9,
4721,
21,
345... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
UIImagePickerController both camera and library
===
I would have though that the UIImagePickerController would allow you to use the camera or choose from the library from within the view? It seems I have to pick one or the other cia the sourceType? Is there no way to add a button to the choose library view to switch to camera?
| 0 | [
2,
13,
5661,
22039,
16855,
106,
12898,
1252,
156,
3336,
17,
1248,
800,
3726,
3726,
31,
83,
57,
362,
30,
14,
13,
5661,
22039,
16855,
106,
12898,
1252,
83,
1655,
42,
20,
275,
14,
3336,
54,
3538,
37,
14,
1248,
37,
363,
14,
1418,
60... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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: Specified cast is not valid occurs intermittedly
===
I have an application that has started throwing "Specified cast is not valid" exceptions occassionally. I cannot recreate this error consistently and it is driving me and my users crazy.
Offending code:
public Complaint GetComplaintById(int Id)
{
Complaint complaint = (from c in _context.cts_complaints
join ud in _context.cts_user_details on c.CreatedBy equals ud.UserId
where c.Id == Id
select new Complaint
{
Id = c.Id,
CompanyId = c.CompanyId,
ComplaintTypeId = c.ComplaintTypeId,
CategoryId = c.CategoryId,
ReportCategoryId = c.ReportCategoryId,
ParentId = c.ParentId,
LanguageId = c.LanguageId,
AreaId = c.AreaId,
Title = c.Title,
Description = c.Description,
ResponseDue = c.ResponseDue,
DateReceived = c.DateReceived,
FPSCNumber = c.FPSCNumber,
FPSCRepresentative = c.FPSCRepresentative,
ContactMethodId = c.ContactMethodId,
ContactedBy = c.ContactedBy,
CreatedDate = c.CreatedDate,
CreatedBy = c.CreatedBy,
CreatedByName = ud.Name,
Status = c.Status,
AttachmentsArchived = c.AttachmentsArchived,
Timestamp = c.Timestamp,
}).FirstOrDefault();
complaint.Users = this.GetUsersByComplaintId(Id);
return complaint;
}
Stack Trace:
Specified cast is not valid.
at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
at ComplaintTracking.Business.Data.SqlComplaintRepository.GetComplaintById(Int32 Id) in C:\SourceCode2010\ComplaintTracking\Service Pack\1.0 ComplaintTracking\ComplaintTracking.Business\Data\SqlComplaintRepository.cs:line 20
at ComplaintTracking.Business.Managers.ComplaintManager.GetComplaintById(Int32 Id) in C:\SourceCode2010\ComplaintTracking\Service Pack\1.0 ComplaintTracking\ComplaintTracking.Business\Managers\ComplaintManager.cs:line 33
at ComplaintTracking.Web.UserControls.ComplaintViews.ResolveViewPresenter.Init() in C:\SourceCode2010\ComplaintTracking\Service Pack\1.0 ComplaintTracking\ComplaintTracking.Web\UserControls\ComplaintViews\ResolveViewPresenter.cs:line 39
at ComplaintTracking.Web.Library.BaseUserControl`2.OnLoad(EventArgs e) in C:\SourceCode2010\ComplaintTracking\Service Pack\1.0 ComplaintTracking\ComplaintTracking.Web\Library\BaseUserControl.cs:line 56
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) | 0 | [
2,
6294,
1251,
45,
9931,
1325,
25,
52,
7394,
3690,
1480,
18568,
43,
102,
800,
3726,
3726,
31,
57,
40,
3010,
30,
63,
373,
6033,
13,
7,
18,
12610,
4462,
1325,
25,
52,
7394,
7,
13392,
13,
2499,
5949,
5991,
1326,
9,
31,
1967,
21119,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cache php-generated image until it changes
===
I apologize in advance for my lack of knowledge on this subject; I've looked at lots of other posts but can't get any of their solutions to work for me.
Anyway, I'm using a dynamic *displayimage.php* file to show users' profile pictures on a site I'm working on. The page takes an id parameter, and pulls the image filename from a mysql database. Here's the (abbreviated) code:
$id = mysql_real_escape_string($_GET[id]);
$table = "images_user";
$idname = "userid";
$uploaddir = "/home/username/uploads/images/user/"; //outside web root
$select = mysql_query("SELECT * FROM $table WHERE $idname = '$id' LIMIT 1");
if(mysql_num_rows($select) > 0) {
$file = mysql_fetch_assoc($select);
header("Content-Type: $file[mimetype]");
readfile($uploaddir.$file[name]);
}
Currently, because it's generated from a php file, the image is not being cached, which really slows the site down. So I add this:
header("Cache-Control: private, max-age=10800, pre-check=10800");
header("Pragma: private");
header("Expires: " . date(DATE_RFC822,strtotime(" 2 day")));
Which solves the problem, great! Now the images are cached, and load super quickly.
However, users have the ability to change their profile pictures. When this happens, I save their uploaded picture, delete the old one, and update the database entry to point to the new picture. But now, because the old picture is still cached, they don't see the update unless they manually F5 the page.
How can I get it to cache the picture, but force a 're-cache' when the picture has been changed? | 0 | [
2,
16522,
13,
26120,
8,
25314,
1961,
163,
32,
1693,
800,
3726,
3726,
31,
12059,
19,
3612,
26,
51,
1792,
16,
1918,
27,
48,
1550,
73,
31,
22,
195,
292,
35,
7503,
16,
89,
9868,
47,
92,
22,
38,
164,
186,
16,
66,
6776,
20,
170,
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... |
Rotating towards mose in C# is not working correctly
===
I am trying to have an object rotate towards the mouse.
The problem is that the object always rotates a bit to much to the left, an extra 45 degrees to much to be excact.
So for example if my mouse is at such a position that the object should be positioned to the north, thus the rotation value = 0, the object gets rotatated 45 degrees to the left, so 270 degrees and thus pointing left, while it should point north/upwards.
This is my code:
public override void Update()
{
base.Update();
GetMousePos();
SetRotation();
}
private void GetMousePos()
{
MouseState ms = Mouse.GetState();
_mousePos.X = ms.X;
_mousePos.Y = ms.Y;
}
private void SetRotation()
{
Vector2 distance = new Vector2();
distance.X = _mousePos.X - (_position.X + (_texture.Width / 2));
distance.Y = _mousePos.Y - (_position.Y + (_texture.Height / 2));
_rotation = (float)Math.Atan2(distance.Y, distance.X);
} | 0 | [
2,
16164,
1016,
13,
24946,
19,
272,
5910,
25,
52,
638,
12044,
800,
3726,
3726,
31,
589,
749,
20,
57,
40,
3095,
21448,
1016,
14,
7567,
9,
14,
1448,
25,
30,
14,
3095,
550,
21448,
18,
21,
1142,
20,
212,
20,
14,
225,
15,
40,
2230,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Haskell list comprehension with two variables
===
I am trying to find some special numbers such that when it is divided by 2 gives 1, divided by 3 gives 2 and so on upto 6.
This perfectly works.
[ x | x <- [1..1000],x `mod` 2 == 1 , x `mod` 3 == 2 , x `mod` 4 == 3 , x `mod` 5 == 4 , x `mod` 6 == 5]
Ans:
[59,119,179,239,299,359,419,479,539,599,659,719,779,839,899,959]
I am trying to make it better so that it is not too verbose but the following doesn't work.
[ x | x <- [1..1000], y <- [2..6], x `mod` y == (y-1) ]
It takes all x for which _any_ of the y satisfies the condition but what I want is, I want x which satisfies the condition for _all_ y. | 0 | [
2,
63,
16507,
968,
27300,
29,
81,
12157,
800,
3726,
3726,
31,
589,
749,
20,
477,
109,
621,
2116,
145,
30,
76,
32,
25,
2350,
34,
172,
2352,
137,
15,
2350,
34,
203,
2352,
172,
17,
86,
27,
71,
262,
400,
9,
48,
5759,
693,
9,
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... |
Select control using jQuery - using value of hiddenfield
===
I have a hidden field, which has the following markup:
<input type="hidden" name="ctl00$ContentPlaceHolder1$LinksOverview1$ProductView$ctrl1$ctl01$ctl00$DescriptionOfLink$QuestionDivInfo" id="ContentPlaceHolder1_LinksOverview1_ProductView_ctrl1_ctl00_3_DescriptionOfLink_3_QuestionDivInfo_3" value="ContentPlaceHolder1_LinksOverview1_ProductView_ctrl1_ctl00_3_questionMark_3" />
The value of my hidden field, is the same as the ID of a span i have:
<span id="ContentPlaceHolder1_LinksOverview1_ProductView_ctrl1_ctl00_3_questionMark_3" class="questionMarkLayout">(?)</span>
I dont know the ID of my span before the code is rendered, but I can access the value of my hidden field.
Using jQuery, I want to:
- Grap the control, with the ID of the value of my hiddenfield
So far I've tried:
<script type="text/javascript">
$(document).ready(function () {
alert('<%#QuestionDivInfo.ClientID %>');
$('<%#QuestionDivInfo.ClientID %>').val().mouseover(function (e) {
$('<%#HintDiv.ClientID %>').show();
});
$('<%#QuestionDivInfo.ClientID %>').val().mouseleave(function (e) {
$('<%#HintDiv.ClientID %>').hide();
});
});
</script>
But it doesn't work.
Any hints? :) | 0 | [
2,
5407,
569,
568,
487,
8190,
93,
13,
8,
568,
1923,
16,
3689,
1109,
800,
3726,
3726,
31,
57,
21,
3689,
575,
15,
56,
63,
14,
249,
943,
576,
45,
13,
1,
108,
4881,
1001,
3726,
7,
1822,
43,
817,
7,
204,
3726,
7,
4812,
255,
2032,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
HTMLAgilityPack XPath Expression not fetching all nodes
===
**Scope**
I am trying to parse [this page][1]. For those who are not familiar with portuguese, this page contains all the Subjects from a certain Course (university course), grouped by "Semester".
So, everytime you see something like this "7º Período Ideal", you can understand like "Subjects
from the 7th semester".
**Problem** I am using a XPath expression to get all the Table Rows from the table that contains those table rows.
XPath Used : //table[@cellspacing=2]//tr
C# Statement : htmlMap.DocumentNode.SelectNodes("//table[@cellspacing=2]//tr");
The HtmlNodeCollection received by this C# statement, contains only the table row nodes until the one with this text `EAD0648 Gerência de Produtos / Serviços e Mercados`, right after the one with `5º Período Ideal`.
Why is the XPath not retrieving all the nodes after this node aswell ?
Is there any cap of ammount of nodes retrieved ?
Am i missing something ?
Thanks in advance
[1]: https://uspdigital.usp.br/jupiterweb/listarGradeCurricular?codcg=12&codcur=12012&codhab=1&tipo=N | 0 | [
2,
13,
15895,
3302,
20901,
8573,
993,
8353,
1803,
52,
18312,
68,
65,
16272,
800,
3726,
3726,
13,
1409,
11555,
1409,
31,
589,
749,
20,
2017,
870,
636,
1565,
2478,
500,
2558,
165,
500,
9,
26,
273,
72,
50,
52,
3694,
29,
4197,
15,
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... |
Why can't Eclipse find the JavaDoc?
===
I have installed the Java3D API and the documentation. Here is where I got the documentation from:
http://www.oracle.com/technetwork/java/javase/tech/index-jsp-138252.html
now, i followed these instructions to install the JavaDoc for Eclipse:
http://stackoverflow.com/questions/2268183/javadoc-in-an-eclipse-android-project/5134343#5134343
I set the path of the documentation for the jars to the location of the documentation on my computer. When I click on an Object name in Eclipse, the popup window pops up, but it says "Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found." Is there anything I'm missing here? It would be a lot more convenient if the info could just show up in the popup window instead of me rooting through the documentation by hand. | 0 | [
2,
483,
92,
22,
38,
11652,
477,
14,
8247,
13799,
60,
800,
3726,
3726,
31,
57,
4066,
14,
8247,
240,
43,
21,
2159,
17,
14,
13945,
9,
235,
25,
113,
31,
330,
14,
13945,
37,
45,
7775,
6903,
6483,
9,
6055,
5615,
9,
960,
118,
6524,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Specifing a specific value and converting columns durning a table transfer? SQL server
===
I am currently transfering data from one database to another.
My problem occurs with a newly designed table. The old table consisted of the columns:
car1, car2, car3, id1, id2, id3, id4, idtxt, idtxt2 (id types could be the same for multiple rows)
The rows would have a specific combination to car1, 2, 3 with a specific id for each combination. id1 is always filled, while 2,3,4,txt,and txt2 may or may not be filled.
My new columns are consisted of:
car1, car2, car3, idtype, id#,text
In this new table idtype is = to id1, id2, id3, id4, id5(idtxt), and id6(idtxt2) while id# is = to the row values of the id in table one. This means there will be more rows than in the old table since there will be a row for each id# even if they are the same combination.
How would you go upon transfering this information through storedprocedure?
I currently can only think of running multiple sp that consist of insert into statements, but cant seem to find any answers as to how i would go upon inserting a certain value in addition to transfering the data. ie(idtype = id1 for all of this transfer)
I am also convinced this isnt the most efficient way.
Please tell me if clarification is needed. Thanks!
| 0 | [
2,
12737,
821,
68,
21,
1903,
1923,
17,
19583,
7498,
6269,
2981,
21,
859,
2617,
60,
4444,
255,
8128,
800,
3726,
3726,
31,
589,
871,
2617,
68,
1054,
37,
53,
6018,
20,
226,
9,
51,
1448,
3690,
29,
21,
2771,
1006,
859,
9,
14,
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... |
can I customize the background of a polygon in OpenLayers?
===
Can I customize the background (with an image, for example) with OpenLayers on a polygon?
Thanks for the replies | 0 | [
2,
92,
31,
5816,
2952,
14,
2395,
16,
21,
21309,
19,
368,
15187,
18,
60,
800,
3726,
3726,
92,
31,
5816,
2952,
14,
2395,
13,
5,
1410,
40,
1961,
15,
26,
823,
6,
29,
368,
15187,
18,
27,
21,
21309,
60,
3669,
26,
14,
16287,
3,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How do I counter iframe security problems?
===
I heard there are many security issues that could arise when you use iframes. I already handle XSS, what else should I do to make sure no problems happen?
I came across some JS codes where you use top.window, but my concern is that any client-side code is not reliable, anything else I can do from the server side? (I am currently using php, but would be awesome if the solution is generic) | 0 | [
2,
184,
107,
31,
2105,
31,
8361,
1221,
1716,
60,
800,
3726,
3726,
31,
752,
80,
50,
151,
1221,
1549,
30,
110,
13277,
76,
42,
275,
31,
8361,
18,
9,
31,
614,
3053,
993,
18,
18,
15,
98,
962,
378,
31,
107,
20,
233,
562,
90,
1716,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Inherit just the javascript code from a master page
===
So I have a Javascript function on my master page. It works fine when I call it from pages that derive from this master page, however, on pages that don't, it obviously doesn't work. I am not able to put it in another .js file either because it uses some embedded c# code in it, so it has to be within a `<script>` tag.
This is the function:
function GridExport(viewUrl, fileName)
{
var actionUrl = "<%= System.Web.VirtualPathUtility.ToAbsolute("~/mvc/Indications.cfc/ExportToExcel")%>";
var guid = GetGUIDValue();
window.open((actionUrl + "?id=" + guid + "&viewName=" + viewUrl + "&fileName=" + fileName), null, null, null);
}
is there a way I can just include the Javascript definitions from my master page in another view without deriving from the master page? | 0 | [
2,
17569,
114,
14,
8247,
8741,
1797,
37,
21,
1129,
2478,
800,
3726,
3726,
86,
31,
57,
21,
8247,
8741,
1990,
27,
51,
1129,
2478,
9,
32,
693,
1123,
76,
31,
645,
32,
37,
4434,
30,
20576,
37,
48,
1129,
2478,
15,
207,
15,
27,
4434,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WPF MVVM Custom Control issue
===
I am trying to create a custom Tag Cloud control. The way I would like it to work is that the user can give it a collection of strings in the itemsSource and the converted string will be displayed in the UI.
At the moment what I have is a tag cloud MVVM app which takes a collection strings (containing duplicates) and groups them by “Name” using a collectionView and then a converter is used to decide the FontSize of each string (tag) based on the count of that string.name in the original collection.
So my question is how can I change this to my desired custom control? I know I will have to extend listbox in my code-behind to expose the itemsSource but the part I am confused about is what to do about the grouping logic (collectionView) as I am currently binding to a grouped collection (no duplicates) whereas I want the user to be able to provide any collection. Please let me know if this is clear.?
**Grouping logic**
public class TagCloudControlViewModel
{
public ObservableCollection<LabelModel> Labels { get; set; }
public CollectionView AggregatedLabelsView { get; set; }
public TagCloudControlViewModel()
{
//get me collection of labels
var data = new DataAccess();
Labels = data.GetData();
//group my labels by "name" property
AggregatedLabelsView = (ListCollectionView)CollectionViewSource.GetDefaultView(Labels);
AggregatedLabelsView.GroupDescriptions.Add(new PropertyGroupDescription("Name"));
}
} | 0 | [
2,
619,
7721,
17967,
20147,
5816,
569,
1513,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
5816,
3383,
4005,
569,
9,
14,
161,
31,
83,
101,
32,
20,
170,
25,
30,
14,
4155,
92,
590,
32,
21,
1206,
16,
7887,
19,
14,
3755,
12097,
17,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to write a Java 3D element on a web page *without* the client installing plug-ins like Java3D
===
I'm trying to write a 3D demo for a client which will simply display a 3D object on a web page and let them manipulate it with the mouse.
At first I thought I could do this fairly easily with the Java 3D API but it seems that to do so, you have to install it first. It's one thing to get the client to accept that the end-user will have to install a common plugin (Java) but I don't think they'll go for the Java3D API too.
I think I need to use webstart but what confuses me is how can I do 3d in Java without needing the client to install Java 3D?
Bit new to this, sorry if it's complete rubbish.
Any ideas?
Thanks in advance.
| 0 | [
2,
184,
20,
2757,
21,
8247,
203,
43,
4520,
27,
21,
2741,
2478,
1637,
14506,
2483,
14,
6819,
25429,
10922,
8,
108,
18,
101,
8247,
240,
43,
800,
3726,
3726,
31,
22,
79,
749,
20,
2757,
21,
203,
43,
8376,
26,
21,
6819,
56,
129,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can Lync 2010 and Communicator 2007 (w/ or w/o R2) client be installed on the same machine
===
Can both clients be installed and used at the same time ?
The purpose of using both is based needs to develop for Lync 2010 while still using Communicator 2007 in a corporate environment. Or would a developer be forced to have two different machines/VMs/boot environments ? | 0 | [
2,
92,
13,
102,
6897,
498,
17,
13,
14869,
596,
3457,
624,
13,
5,
499,
118,
54,
619,
118,
111,
761,
135,
6,
6819,
44,
4066,
27,
14,
205,
1940,
800,
3726,
3726,
92,
156,
7421,
44,
4066,
17,
147,
35,
14,
205,
85,
13,
60,
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... |
How to extract the balance qty
===
I hv a table like this:-
TABLE A
Date Serial Qty Size
20110101 ABC 1 23
20110102 ABC -1 23
20110105 ABC 1 22
20110106 ABC 1 24
20110108 ABC -1 22
I wish to to extract the data via SQL with the final output like this:-
Date Serial Qty Size
20110106 ABC 1 24
What it means is that the final total qty of ABC is 1 with size 24.
Thanks.
| 0 | [
2,
184,
20,
10962,
14,
4468,
2593,
1084,
800,
3726,
3726,
31,
13,
21109,
21,
859,
101,
48,
45,
8,
859,
21,
1231,
5956,
2593,
1084,
1072,
542,
387,
12811,
5079,
137,
1137,
542,
387,
16284,
5079,
13,
8,
165,
1137,
542,
387,
16242,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
format numeric string in html
===
I have a data in the following format
> "1214423-034"
in html table, How can I format the string such that I only display everything after hyphen, so in this case only display "
> 034"
Is there any html function that I can use for this?
Thanks in advance. | 0 | [
2,
2595,
15764,
596,
3724,
19,
13,
15895,
800,
3726,
3726,
31,
57,
21,
1054,
19,
14,
249,
2595,
13,
1,
13,
7,
918,
13365,
2001,
8,
3601,
300,
7,
19,
13,
15895,
859,
15,
184,
92,
31,
2595,
14,
3724,
145,
30,
31,
104,
3042,
79... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Rotating a png image about its bottom center from within a .js file
===
First of all, let me quickly explain why I brought this up despite similar question here:
http://stackoverflow.com/questions/365382/canvas-rotate-from-bottom-center-image-angle
All the information I have seen so far is concerned with javascript embedded in html markup. I do not know whether this information would suffice for someone more experienced than I, but I know very little javascript and html. I do have a little experience in a lot of scripting languages however.
My problem is that I have a .js file that takes an object, i, and sets i.image to a png image from a url (say example.com/pic.png). I want to add a few lines of code that first rotates the image by x degrees or radians (I do not care which, I can always convert) first, then sets it to i.image. So:
image="example.com/pic.png";
i.image=MagicRotateFunction(image,45);
I just have no idea what MagicRotateFunction would be. | 0 | [
2,
16164,
21,
351,
2723,
1961,
88,
82,
2129,
459,
37,
363,
21,
13,
9,
728,
18,
3893,
800,
3726,
3726,
64,
16,
65,
15,
408,
55,
976,
3271,
483,
31,
809,
48,
71,
869,
835,
1301,
235,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to create simple self LVL like library
===
I have been trying to understand LVL library but without luck. All i need is a simple method that will send and receive current status of License without Policies , just send / reply from ILicensingService service. I want to create custom LVL library but i must understand it first. | 0 | [
2,
184,
20,
1600,
1935,
1119,
644,
15143,
101,
1248,
800,
3726,
3726,
31,
57,
74,
749,
20,
1369,
644,
15143,
1248,
47,
366,
5419,
9,
65,
31,
376,
25,
21,
1935,
2109,
30,
129,
2660,
17,
2588,
866,
1782,
16,
3962,
366,
4845,
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... |
Mercurial pretxncommit.pep8 hook not finding pep8 violations
===
If I run pep8 over a file in my Mercurial repository it will list all the pep8 violations.
I've installed hghooks and set up the pretxncommit.pep8 hook, but it never reports any violations when I commit my code.
I've verified it is installed:
$ hg showconfig | grep hook
hooks.pretxncommit.pep8=python:hghooks.code.pep8hook
hooks.pretxncommit.pyflakes=python:hghooks.code.pyflakeshook
hooks.precommit.validate=python manage_dev.py validate
hooks.changegroup.lfiles=<function checkrequireslfiles at 0x1012721b8>
hooks.commit.lfiles=<function checkrequireslfiles at 0x1012721b8>
and it is called when I commit:
$ hg -v ci -m "pep-8 test commit"
running hook precommit.validate: python manage_dev.py validate
0 errors found
test.py
calling hook pretxncommit.pep8: hghooks.code.pep8hook
calling hook pretxncommit.pyflakes: hghooks.code.pyflakeshook
calling hook commit.lfiles: <function checkrequireslfiles at 0x1012731b8>
committed changeset 17:6eb75d7b80d1
So the pretxncommit.pep8 hook is being called but is not finding any violations.
If I open a shell I can import the pep8hook method:
$ python
Python 2.7.3 (default, Apr 13 2012, 00:05:08)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from hghooks.code import pep8hook
>>>
Mercurial is installed globally, hghooks (and pep8) are installed in my local virtualenv. Here is ome more information:
$ python --version
Python 2.7.3
$ hg --version
Mercurial Distributed SCM (version 2.2.2)
(see http://mercurial.selenic.com for more information)
Copyright (C) 2005-2012 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ pip freeze | grep hghooks
hghooks==0.5.2
$ pip freeze | grep pep8
pep8==1.3.3 | 0 | [
2,
9046,
3594,
192,
782,
38,
396,
103,
960,
5130,
9,
1664,
306,
457,
5559,
52,
3007,
11841,
457,
15753,
800,
3726,
3726,
100,
31,
485,
11841,
457,
84,
21,
3893,
19,
51,
9046,
3594,
192,
24869,
32,
129,
968,
65,
14,
11841,
457,
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... |
What does migrate data on TDD mean?
===
I have been reading [Test Driven Development: By Example][1] for a couple weeks. Right now, I stuck on chapter 31 - Refactoring. My question is about Migrate Data on page 183. I don't understand this topic. The example about `TestSuite` doesn't help me understand this too.
I want to know what does migrate data mean and how to use it in TDD.
[1]: http://www.amazon.com/Test-Driven-Development-By-Example/dp/0321146530 | 0 | [
2,
98,
630,
22985,
1054,
27,
15596,
43,
884,
60,
800,
3726,
3726,
31,
57,
74,
1876,
636,
10543,
5355,
522,
45,
34,
823,
500,
2558,
165,
500,
26,
21,
1335,
1342,
9,
193,
130,
15,
31,
4549,
27,
1260,
1538,
13,
8,
302,
17455,
68,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GeoCoordinate System.FormatException
===
I have a viewmodel which contains a System.Device.Location.GeoCoordinate property which is marked as [Datamember] like so:
[DataMember]
public GeoCoordinate Location
{
get
{
return _location;
}
set
{
if (_location != value)
{
_location = value;
NotifyPropertyChanged("Location");
}
}
}
I have a collection of a this viewmodel, and for every item of the collection I am getting: "A first chance exception of type 'System.FormatException' occurred in mscorlib.dll"
The interesting part is that this only occurs when I am navigating back, but somewhere before onNavigatedTo event fires.
Is this a known issue? how can I fix it? | 0 | [
2,
6389,
716,
23239,
329,
9,
23588,
10066,
872,
800,
3726,
3726,
31,
57,
21,
1418,
13998,
56,
1588,
21,
329,
9,
546,
18507,
9,
19032,
9,
834,
13707,
23239,
1354,
56,
25,
2739,
28,
636,
18768,
6990,
500,
101,
86,
45,
636,
18768,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 id with AUTO_INCREMENT on Oracle?
===
I realised that there is no concept of AUTO_INCREMENT on Oracle. How can I use `SYS_GUID()` to create 'auto increment'? | 0 | [
2,
184,
20,
1600,
4924,
29,
3108,
1,
28461,
27,
15759,
60,
800,
3726,
3726,
31,
12514,
30,
80,
25,
90,
2420,
16,
3108,
1,
28461,
27,
15759,
9,
184,
92,
31,
275,
13,
1,
4980,
18,
1,
7215,
43,
5,
6,
1,
20,
1600,
13,
22,
1804... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Is it possible to use late binding on a COM object inside a T4 template?
===
My T4 template instantiates an Excel COM object to read some cell values and create C# classes from them. I wrote the Excel reading logics in regular C# first, which works fine. One of the lines I use in this test is:
string cellContents = xlWorkSheet.Cells.Item[1, 1].Value;
Transplanting the test code into a T4 template does not work though. The following error is displayed:
> `Error 1: Compiling transformation: 'object' does not contain a definition for 'Value2' and no extension method 'Value2' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)`
The only way for me to resolve this, is by adding some manual casting:
string cellContents = (xlWorkSheet.Cells.Item[1, 1] as Range).Value as string;
I was under the impression that T4 uses the "regular" C# compiler and as such, would be able to deal with dynamic binding like regular code can. But apparently, there are differences. In this case, I could resolve my issues because I was able to guess what type to cast to. In general, that is not the case though. Is there a way to make this late binding work in a T4 template? | 0 | [
2,
25,
32,
938,
20,
275,
456,
8728,
27,
21,
13,
960,
3095,
572,
21,
13,
38,
300,
22894,
60,
800,
3726,
3726,
51,
13,
38,
300,
22894,
6322,
15882,
18,
40,
20700,
13,
960,
3095,
20,
1302,
109,
1667,
4070,
17,
1600,
272,
5910,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
FancyBox v2 - login box
===
I've readed and went trough all examples on:
- http://fancyapps.com/fancybox/
There is nothing to help me with making a pop-up login box.
I've checked the old version Fancybox 1.3.x which have an example for login box, but that method doesn't really work on new Fancybox v2.
If anyone can help me, I will be happy.
So far I have this code, which is semi-working:
$("#top-login-button").click(function() {
$.fancybox.open({
href : "#login_form",
padding : 0,
onClosed : function() {
$("#login_error").hide();
}
});
});
$("#login_form_ajax").bind("submit", function() {
if ($("#login_name").val().length < 1 || $("#login_pass").val().length < 1) {
$("#login_error").show();
return false;
}
$.fancybox.showActivity();
$.ajax({
type : "POST",
cache : false,
url : "/login.php",
data : $(this).serializeArray(),
success: function(data) {
$.fancybox(data);
}
});
return false;
}); | 0 | [
2,
12251,
5309,
566,
135,
13,
8,
6738,
108,
1649,
800,
3726,
3726,
31,
22,
195,
1302,
69,
17,
296,
22032,
65,
3770,
27,
45,
13,
8,
7775,
6903,
410,
10821,
7753,
18,
9,
960,
118,
410,
10821,
5309,
118,
80,
25,
626,
20,
448,
55,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Hyperlinks in iText
===
I want to disable internal and external hyperlinks in a PDF using iText. How do I do it? There is no Hyperlinks class and I have tried to remove PdfName.DEST or PdfName.A and PdfName.SUBTYPE from the annotation dictionary but it does not help.
Also, I want to change the color of the hyperlinks from the default blue to say, Red. Is there a way to do this?
Thanks,
Nitesh | 0 | [
2,
5443,
6258,
18,
19,
31,
11969,
800,
3726,
3726,
31,
259,
20,
1460,
579,
3117,
17,
4886,
5443,
6258,
18,
19,
21,
13,
11124,
568,
31,
11969,
9,
184,
107,
31,
107,
32,
60,
80,
25,
90,
5443,
6258,
18,
718,
17,
31,
57,
794,
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... |
Can't INSERT INTO SELECT into a table with identity column
===
:)
In SQL server, I'm using a table variable and when done manipulating it I want to insert its values into a real table that has an identity column which is also the PK.
The table variable I'm making has two columns; the physical table has four, the first of which is the identity column, an integer IK. The data types for the columns I want to insert are the same as the target columns' data types.
INSERT INTO [dbo].[Message] ([Name], [Type])
SELECT DISTINCT [Code],[MessageType]
FROM @TempTableVariable
END
This fails with
Cannot insert duplicate key row in object 'dbo.Message' with unique index
'IX_Message_Id'. The duplicate key value is (ApplicationSelection).
But when trying to insert just Values (...) it works ok.
How do I get it right?
Thanks. :) | 0 | [
2,
92,
22,
38,
14692,
77,
5407,
77,
21,
859,
29,
3270,
4698,
800,
3726,
3726,
13,
45,
6,
19,
4444,
255,
8128,
15,
31,
22,
79,
568,
21,
859,
7612,
17,
76,
677,
27799,
32,
31,
259,
20,
14692,
82,
4070,
77,
21,
683,
859,
30,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Suggestionbox action on selected
===
I use a richfaces:suggestionBox in the following manner:
<h:inputText
value="#{myBean.data}">
<rich:suggestionbox width="100" ajaxSingle="true"
selfRendered="true" var="result"
suggestionAction="#{autoBean.autocomplete}"
>
<h:column>
<h:outputText value="#{result.getValue('txtsugg')}" />
</h:column>
</rich:suggestionbox>
All goes well, bu now I need to intercept the user selection because when the user select a particular value I need to do an action over the server and after refresh a piece of page.
For example:
1) user write 'ala'
the suggestionbox suggest him 'ala1' 'ala2' 'ala3' ...
2) user select 'ala2' (press enter, click over it or change focus)
a server action must be called and a refresh of one piece of the page.
Hope I explain my problem. | 0 | [
2,
10910,
5309,
1028,
27,
1704,
800,
3726,
3726,
31,
275,
21,
2042,
6413,
18,
45,
18,
21606,
160,
3309,
5309,
19,
14,
249,
3832,
45,
13,
1,
252,
45,
108,
4881,
11969,
1923,
3726,
7,
5910,
1,
915,
863,
210,
9,
18768,
1,
7,
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 resize div element less than its content?
===
I have a table and there is a TreeView in a cell. Here is my code:
<style>
#leftPanel
{
width:60px;
height:'100%';
border:1px solid red;
background:yellow;
}
<style>
<table>
<tr>
<td>
<div id="leftPanel">
<asp:PlaceHolder runat="server" ID="TreeView" />
<%-- Here is a TreeView --%>
</div>
</td>
</tr>
<%-- other code --%>
<table>
$(function () {
$('#leftPanel').resizable(
{
handles: 'e, w'
});
});
I can't reduce the size of my div less then the size of my TreeView.
What code need I write to allow leftPanel to be less than the size of TreeView ? It is necessary if TreeView node's text too long. | 0 | [
2,
184,
20,
302,
10454,
13,
12916,
4520,
787,
119,
82,
2331,
60,
800,
3726,
3726,
31,
57,
21,
859,
17,
80,
25,
21,
1541,
4725,
19,
21,
1667,
9,
235,
25,
51,
1797,
45,
13,
1,
4381,
1,
6926,
9742,
3206,
532,
13,
1,
9456,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Template compilation error in Sun Studio 12
===
We are migrating to Sun Studio 12.1 and with the new compiler [ CC: Sun C++ 5.10 SunOS_sparc 2009/06/03 ]. I am getting compilation error while compiling a code that compiled fine with earlier version of Sun Compiler [ CC: Sun WorkShop 6 update 2 C++ 5.3 2001/05/15 ].
This is the compilation error I get.
"Sample.cc": Error: Could not find a match for LoopThrough<SZ>(int[2]) needed in main().
1 Error(s) detected.
*** Error code 1.
**CODE:**
#include <iostream>
#define PRINT_TRACE(STR) \
std::cout << __FILE__ << ":" << __LINE__ << ":" << STR << "\n";
template<size_t SZ>
void LoopThrough(const int(&Item)[SZ])
{
PRINT_TRACE("Specialized version");
for (size_t index = 0; index < SZ; ++index)
{
std::cout << Item[index] << "\n";
}
}
/*
template<typename Type, size_t SZ>
void LoopThrough(const Type(&Item)[SZ])
{
PRINT_TRACE("Generic version");
}
*/
int main()
{
{
int arr[] = { 1, 2 };
LoopThrough(arr);
}
}
If I uncomment the code with Generic version, the code compiles fine and the generic version is called. I don't see this problem with MSVC 2010 with extensions disabled and the same case with ideone [here][1].
The specialized version of the function is called. Now the question is, is this a bug in Sun Compiler ?
If yes, how could we file a bug report ?
[1]: http://ideone.com/opX6g | 0 | [
2,
22894,
4868,
7019,
19,
939,
1120,
390,
800,
3726,
3726,
95,
50,
28749,
20,
939,
1120,
390,
9,
165,
17,
29,
14,
78,
21486,
636,
8093,
45,
939,
272,
20512,
331,
9,
1036,
939,
759,
1,
18,
22773,
588,
118,
3370,
118,
3601,
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... |
Pointcut matching types with certain parent class
===
Is it possible in Spring AOP to implement a pointcut that matches types with a certain parent class?
I'd like to do it with the `@AfterReturning` annotation. | 0 | [
2,
454,
4118,
10120,
2551,
29,
1200,
4766,
718,
800,
3726,
3726,
25,
32,
938,
19,
1573,
21,
2594,
20,
8713,
21,
454,
4118,
30,
1717,
2551,
29,
21,
1200,
4766,
718,
60,
31,
22,
43,
101,
20,
107,
32,
29,
14,
13,
1,
5162,
24632,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How do I recursively rename files and contents in Linux?
===
I'm trying to rename a load of files (I count over 200) that either have the company name in the filename, or in the text contents. I basically need to change any references to "company" to "newcompany", maintaining capitalisation where applicable (ie "Company becomes Newcompany", "company" becomes "newcompany"). I need to do this recursively.
Because the name could occur pretty much anywhere I've not been able to find example code anywhere that meets my requirements. It could be any of these examples, or more:
company.jpg
company.php
company.Class.php
company.Company.php
companysomething.jpg
Hopefully you get the idea. I not only need to do this with filenames, but also the contents of text files, such as HTML and PHP scripts. I'm presuming this would be a second command, but I'm not entirely sure what.
I've searched the codebase and found nearly 2000 mentions of the company name in nearly 300 files, so I don't fancy doing it manually.
Please help! :) | 0 | [
2,
184,
107,
31,
302,
24244,
102,
302,
7259,
6488,
17,
8478,
19,
13024,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
302,
7259,
21,
6305,
16,
6488,
13,
5,
49,
2468,
84,
2327,
6,
30,
694,
57,
14,
237,
204,
19,
14,
3893,
7259,
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... |
Meteor Deps - Running a Client Side Func
===
I'm struggling to get a handle on Meteor deps, in order to be specific my use case is:
2) When collection is changed, I want to run a jQuery function on the client side
I *think* deps are what I'm looking for, but at the moment I have only just used:
Template.templateName.set () ->
return Set.find({})
...in terms of reactivity.
A solution which simply console.log's the collection each time it is changed would be more that enough. | 0 | [
2,
17522,
121,
1919,
13,
8,
946,
21,
6819,
270,
2414,
150,
800,
3726,
3726,
31,
22,
79,
7587,
20,
164,
21,
3053,
27,
17522,
121,
1919,
15,
19,
389,
20,
44,
1903,
51,
275,
610,
25,
45,
172,
6,
76,
1206,
25,
1015,
15,
31,
259,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ToString() & Contains() have no supported translation to SQL
===
I have an action which returns JSON to a jQuery [datatable][1]. The data returned can be filtered depending on the params passed to it. Here's the code:
public ActionResult IndexAjaxHandler(jQueryDataTableParamModel parameters) {
var data = _mailingListRep.GetAllWithinAccount();
IEnumerable<MailingList> filtered;
// Filtering - THIS DOES NOT WORK!
if (!string.IsNullOrEmpty(parameters.sSearch)) {
filtered = data.Where(c =>
c.MailingListName.Contains(parameters.sSearch) ||
((c.IsDoubleOptIn) ? "Yes" : "No").Contains(parameters.sSearch, StringComparison.OrdinalIgnoreCase) ||
c.Created.ToString("dd MMM yyyy").Contains(parameters.sSearch) ||
c.ActiveMembers.Count().ToString().Contains(parameters.sSearch) ||
c.AvailableSegments.Count().ToString().Contains(parameters.sSearch)
);
}
else {
filtered = data;
}
// create json object
// return;
}
The problem is this gives me the following error:
>Method 'Boolean Contains(System.String, System.String, System.StringComparison)' has no supported translation to SQL.
**BUT**
-------
In the same controller is another action which also returns JSON to a datatable, which uses **the exact same filtering method** and it works fine!
// Filtering - THIS WORKS, NO ERRORS!
if (!string.IsNullOrEmpty(parameters.sSearch)) {
filtered = data.Where(c =>
c.EmailAddress.Contains(parameters.sSearch, StringComparison.OrdinalIgnoreCase) ||
c.UnsubscribedDate.ToString("dd MMM yyyy").Contains(parameters.sSearch, StringComparison.OrdinalIgnoreCase)
);
}
else {
filtered = data;
}
Does anyone know why this is?
For reference, `Contains(string, comparison)` is an extension method:
public static bool Contains(this string source, string toCheck, StringComparison comp) {
return source.IndexOf(toCheck, comp) >= 0;
}
I understand what the error means, it is the fact that the code works in 1 action, but not the other than has me completely confused.
Thanks for any help in advance.
[1]: http://datatables.net
| 0 | [
2,
20,
11130,
5,
6,
279,
1588,
5,
6,
57,
90,
1827,
4064,
20,
4444,
255,
800,
3726,
3726,
31,
57,
40,
1028,
56,
4815,
487,
528,
20,
21,
487,
8190,
93,
636,
18768,
5924,
500,
2558,
165,
500,
9,
14,
1054,
587,
92,
44,
25090,
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... |
Customized DataFormWebPart Connections Don't Work in Web Part Pages
===
I have created some DataFormWebParts that use a web service data source in SharePoint Designer. I then exported each one to the site web part gallery. Each data source is configured with a parameter than can be set by a web part connection.
I then create a web part page in my browser and add in each web part. They all display data correctly from the underlying web service call. However, creating the connections between them have no effect. However, if I then edit this page in SharePoint Designer and add connections, they all work perfectly.
I have tried exporting these web parts from SPD both with and without connections already being created (i.e. when there are no connections, each item has no hyperlink). I am attempting all this in SharePoint 2010.
So can this be made to work in browser edit mode, or have I discovered another SharePoint bug?
| 0 | [
2,
28779,
1054,
4190,
14113,
3091,
6760,
221,
22,
38,
170,
19,
2741,
141,
4434,
800,
3726,
3726,
31,
57,
679,
109,
1054,
4190,
14113,
3091,
18,
30,
275,
21,
2741,
365,
1054,
1267,
19,
1891,
3132,
4742,
9,
31,
94,
18011,
206,
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... |
Crontab every 5 minutes
===
How could i tell crontab to run every 5 minutes, but starting at the second minute of the hour. In other words, i would like to execute my script when `minute % 5 = 2`.
For example, my script should run at :
08:02
08:07
08:12
08:17
...
Thanks for your help! | 2 | [
2,
13,
19587,
15783,
352,
331,
902,
800,
3726,
3726,
184,
110,
31,
494,
13,
19587,
15783,
20,
485,
352,
331,
902,
15,
47,
1422,
35,
14,
153,
2038,
16,
14,
1671,
9,
19,
89,
715,
15,
31,
83,
101,
20,
15644,
51,
3884,
76,
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... |
Implementing iOS Maps style page curl gesture interactions
===
A bunch of people are interested in implementing the page curl modal transition in iOS like that found in the native Maps app - see [here][1], [here][2] and [here][3] - however the question doesn't seem to have been fully answered. So:
Is it possible to display a page-curl modal beneath a main view as is currently the case in Maps on iOS 5 and 6? I wish to implement the segue via "curling" the top view back with a finger, giving the appearance of direct interaction with the curl, as is the case with iBooks in the same versions of iOS.
Implementing the segue itself (as in a partial curl transition) is not the problem - adding the gesture interaction (with dynamic partial peeling) is.
[1]: http://stackoverflow.com/questions/5819897/how-to-do-page-curl-with-swipe-gesture-in-ios "here"
[2]: http://stackoverflow.com/questions/10880031/partial-page-curl-by-pan-gesture-like-in-uipageviewcontroller
[3]: http://stackoverflow.com/questions/8603326/ios-effect-curl-as-maps-in-ipad | 0 | [
2,
17333,
13,
7760,
6867,
1034,
2478,
14320,
7222,
11224,
800,
3726,
3726,
21,
7653,
16,
148,
50,
3158,
19,
17333,
14,
2478,
14320,
13,
20756,
4513,
19,
13,
7760,
101,
30,
216,
19,
14,
1275,
6867,
4865,
13,
8,
196,
636,
6836,
500,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Problems with scalar values in native hibernate/jpa query using annotations
===
I'm trying to run a simple SQL query containig a group by clause.
Annotations within the DataHistory class:
@NamedNativeQuery(name = "myQuery",
query = "SELECT h.reference as reference FROM DataHistory h "
+ "WHERE h.lrn = :lrn GROUP BY h.reference",
resultSetMapping = "resultMapping")
The result mapping for the query is:
@SqlResultSetMapping(name = "resultMapping", columns = {
@ColumnResult(name = "reference")
})
In the service class, I execute the query as follow:
Query query = entityManager.createNamedQuery("myQuery");
query.setParameter("lrn", lrn);
List resultList = query.getResultList();
Depending on the result of the query, the list contains java.lang.Character's:
Case 1:
SQL-Result (if I'm running the sql in a sql client):
| Reference |
| 123456780678MMM |
| 123456781678MMM |
| 123456782678MMM |
| 123456783678MMM |
Java-List-Result (in Java Debug View):
[1, 1, 1, 1]
Case 2:
SQL-Result:
| Reference |
| 123456780678MMM |
Java-List-Result:
[2]
I'm looking for a way to run a simple sql query with scalar values (using hibernate/jpa) to get as result a list with the values of the result.
Is there any way to do this without using the criteria api?
If you need more information, let me know!
Many thanks in advance for your help.
Marco | 0 | [
2,
1716,
29,
28960,
4070,
19,
1275,
4148,
2102,
8820,
118,
728,
1060,
25597,
568,
40,
1270,
7504,
800,
3726,
3726,
31,
22,
79,
749,
20,
485,
21,
1935,
4444,
255,
25597,
3717,
2816,
21,
214,
34,
9040,
9,
40,
1270,
7504,
363,
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... |
javascript inventory management system
===
I have to make an inventory sys.There are 100 stocks maintained at Argentina and Brazil. A single ipod costs $100 in Brazil and $50 in Argentina. The cost of exporting stocks from one country to the other will cost $400 per 10 blocks. The transportation is always done in the multiples of 10. the minimum cost for purchasing the given no of units has to be calculated. Assuming that for each transaction, the available stock in each country is maintained to be 100 that is if it cannot become more than 100.
Input and output format:
The country from which the order is being placed: No of units
Minimum costs:No of stock left in brazil:No of stock left at Argentina
Sample Input and output:
Brazil:5
5000:95:100
Brazil:50
4500:100:50
how can i calculate that when my order is above 100 i have to exprt?
var countryinfo = [
{
name:"Argentina",
cost : 50,
exprt : 40
},
{
name:"brazil",
cost: 100,
exprt: 40
},
];
inventoryipod=function(countryinfo,numberofunits)
{
this.allcountries=[];
this.country=countryinfo;
this.numberofunits=numberofunits;
for(i=0;i<this.country.length;i++)
{
console.log(this.country[i].name)
this.allcountries.push(this.country[i].name);
}
}
inventoryipod.prototype.minimizedcost=function()
{
if(this.numberofunits%10==0)
{
var prices = [];
var name = [];
var i, len;
if( this.numberofunits<100)
{
for( i = 0, len = this.country.length; i < len; i += 1)
{
this.totalcost=this.numberofunits*this.country[i].cost+this.country[i].exprt*this.numberofunits;
prices.push(this.totalcost);
}
return Math.min.apply(Math,prices);
}
}
} | 1 | [
2,
8247,
8741,
13875,
1097,
329,
800,
3726,
3726,
31,
57,
20,
233,
40,
13875,
10315,
18,
9,
1887,
50,
808,
2070,
18,
3926,
35,
4491,
17,
2867,
9,
21,
345,
31,
10670,
4227,
18162,
19,
2867,
17,
21946,
19,
4491,
9,
14,
1516,
16,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
giving an alert after an succesful sign up in asp.net
===
I wan to givean alert after person sign up succesfully.And then I redirect it to index page I tried something like that
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Login is succesful!" + "');", true);
Response.Redirect("index.html");
But alert cannot be seen can you help me?
Thanks. | 0 | [
2,
1438,
40,
7863,
75,
40,
21792,
5052,
1566,
1676,
71,
19,
28,
306,
9,
2328,
800,
3726,
3726,
31,
10685,
20,
590,
210,
7863,
75,
840,
1676,
71,
21792,
5052,
5655,
9,
290,
94,
31,
302,
14706,
32,
20,
4348,
2478,
31,
794,
301,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
HTML5 video - Safari (Mac) - live HLS stream - seek in live buffer
===
I have the following HTML:
<head>
</head>
<body>
<button type="button" onclick="onSeek();">Seek</button>
<video id="video" src="http://<host>/somevideo.m3u8" autoplay controls>
</video>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
function onSeek() {
var video = $('#video')[0];
video.currentTime = -300;
}
</script>
</body>
When I open the page, the m3u8 playlist has already about 100 media segments (5 min). Since it's a live video it starts playing from one of the last media segments and video.currentTime is set to 0. video.seekable.start(i) and video.seekable.end(i) shows the seekable range which is 0..currentTime. How can I seek to the previous media segments, say 5 min back? video.currentTime = -300 doesn't work. It resets currentTime to 0.
| 0 | [
2,
13,
15895,
264,
763,
13,
8,
25055,
13,
5,
6893,
6,
13,
8,
515,
13,
3712,
18,
3766,
13,
8,
5048,
19,
515,
17497,
800,
3726,
3726,
31,
57,
14,
249,
13,
15895,
45,
13,
1,
1743,
1,
13,
1,
118,
1743,
1,
13,
1,
9760,
1,
13,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
StaticResource does not find Resource but Application.Resource.contains("Key") is true
===
I have been reading and trying a lot and I still couldn't find a answer to my problem. So I really hope that you guys can help me out.
I have an Application with two "Themes" which menas two very big resource dictionaries with different default stlyes and colors etc. The themes shall not be changed while the application is running, but it shall be possible to configure a different theme in a config file before the application starts. So I have a style loader that reads that configuration and then loads either resource dictionary A or resource dictionary B. This is done by removeing all application resources and adding every single key from every resource dictionary to the ApplicationResources. Recursively of course to get all the keys from merged dictionaries aswell.
So all my Basecontrol styles look like this (simplified a lot):
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="Button">
<Setter Property="Background" Value="{StaticResource color}" />
</Style>
</ResourceDictionary>
Then I have some ResourceDictionaries that only contain Colors, so the StaticResource "color" is defined in an other dictionary.
Now I have one resource dictionary that merges everythign that is needed for one Style together.
NewStyleTheme.xaml
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="NewStyle/BinaryResources/Binaries.xaml" />
<ResourceDictionary Source="NewStyle/NewStyleBase.xaml" />
<ResourceDictionary Source="NewStyle/NewStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
NewStyle.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Base="clr-namespace:Hamilton.XRP2.Base;assembly=Hamilton.XRP2.Base.BaseUI">
<!-- Do not load Splash-Screen here -->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/ColorResources.xaml"/>
<ResourceDictionary Source="BaseControlLibrary/BaseControlLibrary.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
So theoretically all color resources should have been loaded and all control resources. But I still get an Exception that the resource could not be found, but when I debug and do the following Application.Current.Resources.Contains("color") it returns true.
I know that I can resolve the issue by merging the color resources into the button.xaml where the style is defined, but I do not want to do this as I have like 70 base controls and if all merge the resources the application is incredibly slowed down.
Can anybody help me?
Regards,
m00ni
| 0 | [
2,
12038,
99,
12097,
630,
52,
477,
6577,
47,
3010,
9,
99,
12097,
9,
1126,
5851,
18,
5,
7,
4237,
7,
6,
25,
1151,
800,
3726,
3726,
31,
57,
74,
1876,
17,
749,
21,
865,
17,
31,
174,
711,
22,
38,
477,
21,
1623,
20,
51,
1448,
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... |
C2DM Registration ID vs GCM Registration ID?
===
I notice that Google has deprecated C2DM and changes it to GCM.
Then, in its [Migration docs][1], it states:
> After receiving a response from GCM, the registration ID obtained must
> be sent to the application server. When doing this, the application
> should indicate that it is sending a GCM registration ID so that the
> server can distinguish it from existing C2DM registrations.
For anyone have migrated C2DM to GCM, is the registration ID in different format for both services? Because it states
> the application
> should indicate that it is sending a GCM registration ID so that the
> server can distinguish it from existing C2DM registrations.
Thanks
[1]: http://developer.android.com/guide/google/gcm/c2dm.html#client | 0 | [
2,
272,
135,
43,
79,
8587,
4924,
4611,
489,
9095,
8587,
4924,
60,
800,
3726,
3726,
31,
3551,
30,
8144,
63,
121,
3515,
150,
1669,
272,
135,
43,
79,
17,
1693,
32,
20,
489,
9095,
9,
94,
15,
19,
82,
636,
10183,
5946,
9765,
18,
500... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 access the content of USB drive in android ics?
===
how to access the content of USB drive in android ics? in android USB Host example missile launcher communicating to the usb. i want just like to access the media file from usb similar to using MediaScanner to access the content of SD. Please help me on this. | 0 | [
2,
184,
20,
1381,
14,
2331,
16,
182,
220,
1493,
19,
13005,
13,
8354,
60,
800,
3726,
3726,
184,
20,
1381,
14,
2331,
16,
182,
220,
1493,
19,
13005,
13,
8354,
60,
19,
13005,
182,
220,
2015,
823,
6699,
19755,
23284,
20,
14,
182,
220... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 the Internet e-mail address from an Exchange Outlook Contact programmatically?
===
I’m trying to read out the Internet formatted address from an Exchange connected Outlook. I read all contacts from the Outlook Contacts, i.e. not from the Global Address Book (GAB), and the problem is that for all users that are stored in Contacts from the Exchange GAB I’ve only managed to read out the X.500 formatted address which is not useful in this case. For all manually added contacts that are not in the domain of the Exchange server, the Internet address is exported as expected.
Basically I’ve used the following code snippet to enumerate the Contacts:
static void Main(string[] args)
{
var outlookApplication = new Application();
NameSpace mapiNamespace = outlookApplication.GetNamespace("MAPI");
MAPIFolder contacts = mapiNamespace.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
for (int i = 1; i < contacts.Items.Count + 1; i++)
{
try
{
ContactItem contact = (ContactItem)contacts.Items[i];
Console.WriteLine(contact.FullName);
Console.WriteLine(contact.Email1Address);
Console.WriteLine(contact.Email2Address);
Console.WriteLine(contact.Email3Address);
Console.WriteLine();
}
catch (System.Exception e) { }
}
Console.Read();
}
Is there any way to extract the Internet address instead of the X.500?
Regards, Ola
| 0 | [
2,
1017,
14,
2620,
13,
62,
8,
8079,
3218,
37,
40,
1950,
19837,
2203,
625,
6732,
1326,
60,
800,
3726,
3726,
31,
1,
79,
749,
20,
1302,
70,
14,
2620,
13,
29850,
3218,
37,
40,
1950,
2587,
19837,
9,
31,
1302,
65,
11894,
37,
14,
198... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to parse json before applying the Django database API?
===
I have a Django database, in which I have some JSON stored. I wish to extract this JSON, parse it, and then apply filters / queries to it. More specifically I want to have a dynamic webpage which displays the JSON sorted, filtered or grouped by the users preference.
From reading the Django documentation I can only see how to use pre-made filters like starts_with, but not how to pre-process the data. I did see the option for applying a regex, but I don't think I can implement a full JSON parser by hand. I currently parse the JSON and then search it using python classes, but that seems to defeat the purpose of using a database, particularly because it is limited in the types of query it can handle.
The JSON is coming from some other source, and has no guarantees about it's fields or structure.
Thanks in advance,
jhoyla
| 0 | [
2,
25,
32,
938,
20,
2017,
870,
487,
528,
115,
11989,
14,
3857,
14541,
6018,
21,
2159,
60,
800,
3726,
3726,
31,
57,
21,
3857,
14541,
6018,
15,
19,
56,
31,
57,
109,
487,
528,
8214,
9,
31,
2536,
20,
10962,
48,
487,
528,
15,
2017,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Redirect from asp.net web api post action
===
I m very new to asp.net 4.0 web api. Can we redirect to another url at end of the post action?
Something like this `Response.Redirect(url)`
Actually I upload file from a mvc application( say www.abcmvc.com) through web api ( say www.abcwebapi.com/upload)
Here 'upload' is the post action. I post a multipart form to web api upload controller's post action
After uploading I would like to redirect back to www.abcmvc.com. Is this possible?
| 0 | [
2,
302,
14706,
37,
28,
306,
9,
2328,
2741,
21,
2159,
678,
1028,
800,
3726,
3726,
31,
307,
253,
78,
20,
28,
306,
9,
2328,
268,
9,
387,
2741,
21,
2159,
9,
92,
95,
302,
14706,
20,
226,
287,
6362,
35,
241,
16,
14,
678,
1028,
60,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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: from Copy Protection to Application Licensing
===
MY app on Android has a new major module added to it which changes the app size from ~10Mb to ~100Mb. The plan is to implement "Application Licensing" and allow app to a) be installed on SD card, b) download heavy bits (video) from inside the app when needed after installation. My question is: what will happen to previous users? On their devices the app is installed in internal memory from the start due to Copy Protection. Will an update automatically move the app to SD? | 0 | [
2,
13005,
45,
37,
4344,
2057,
20,
3010,
15038,
800,
3726,
3726,
51,
4865,
27,
13005,
63,
21,
78,
394,
12613,
905,
20,
32,
56,
1693,
14,
4865,
1072,
37,
13,
1,
1036,
5024,
20,
13,
1,
4031,
5024,
9,
14,
944,
25,
20,
8713,
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... |
Customize Video view in iOS 3.0
===
I need help, how add customize video view in iOS 3.0! I use MPMoviePlayerController, but method (view) use in iOS 3.2, not earlier. I understand that the old version, but there is a need to support in iOS 3.0. Or exist any alternatives this realization. | 0 | [
2,
5816,
2952,
763,
1418,
19,
13,
7760,
203,
9,
387,
800,
3726,
3726,
31,
376,
448,
15,
184,
3547,
5816,
2952,
763,
1418,
19,
13,
7760,
203,
9,
387,
187,
31,
275,
4628,
22607,
14049,
12898,
1252,
15,
47,
2109,
13,
5,
4725,
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... |
Why Eclipse error log show error "failed to instantiate"
===
Error Log shows error org.anddev.android.weatherforecast.view.SingleWeatherInfoView failed to instantiate
Package name:org.anddev.android.weatherforecast.view
Class name: SingleWeatherInfoView
Please help me to get out of the error.
My error log
![enter image description here][1]
[1]: http://i.stack.imgur.com/E6MIF.png | 0 | [
2,
483,
11652,
7019,
6738,
298,
7019,
13,
7,
24910,
69,
20,
6322,
15882,
7,
800,
3726,
3726,
7019,
6738,
1285,
7019,
13,
5583,
9,
290,
14438,
9,
290,
18524,
9,
18924,
16558,
6146,
9,
4725,
9,
14031,
18924,
108,
4120,
4725,
1702,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I create automatically a instance of every class in a directory?
===
How do I in ruby create an instance of every class in each file in a directory and
providing it as an array?
Thank you in advance!
| 0 | [
2,
184,
107,
31,
1600,
7499,
21,
4851,
16,
352,
718,
19,
21,
16755,
60,
800,
3726,
3726,
184,
107,
31,
19,
10811,
1600,
40,
4851,
16,
352,
718,
19,
206,
3893,
19,
21,
16755,
17,
2674,
32,
28,
40,
7718,
60,
3531,
42,
19,
3612,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
redirect user to a particular page in web view
===
I am creating a app in android that scans barcode and retrieves the information from my database.It works fine but now i want to integrate it with flipkart database.Or redirect them to flipkart page of that product.But how do i access the flipkart database.
Say i scanned a book of android , now i would want to redirect my user to specific page on flipkart.Any help would be appreciated...thanks
| 0 | [
2,
302,
14706,
4155,
20,
21,
1498,
2478,
19,
2741,
1418,
800,
3726,
3726,
31,
589,
2936,
21,
4865,
19,
13005,
30,
8313,
18,
748,
9375,
17,
11917,
18,
14,
676,
37,
51,
6018,
9,
242,
693,
1123,
47,
130,
31,
259,
20,
18399,
32,
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... |
SQL server schema auditing?
===
We have a SQL Server 2008 Enterprise database with two different schemas, a locked one that we maintain and an open one that we allow outside development teams to add to and modify for their own needs. Usually this works out OK for us but one particular team likes to really muck it up and it is impacting everyone else. So 2 questions:
1. In hindsight I wish we had set up something robust from the outset but we did not, just the default install. It would be nice to be able to see what has been done to the schema so far, even if its as simple as 'User XYZ changed Procedure ABC on 07/12/2012 at 9:00 AM'. Is there anything built into SQL Server and enabled by default that tracks this that we might leverage, and if so where/how?
2. As far as a long term solution goes, what would you recommend for this? I've been reading up on DDL triggers a bit and that seems like a promising option. If you've used this approach can you share a bit with how it worked and what you could do with it?
thank you | 0 | [
2,
4444,
255,
8128,
23874,
13471,
68,
60,
800,
3726,
3726,
95,
57,
21,
4444,
255,
8128,
570,
6002,
6018,
29,
81,
421,
23874,
18,
15,
21,
4011,
53,
30,
95,
4027,
17,
40,
368,
53,
30,
95,
1655,
719,
522,
952,
20,
3547,
20,
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... |
lock and unlock sql server tables from .net code without using stored procedures
===
I need to block a table from being accessed by any other process unless my current operation(usually a INSERT or an UPDATE) is completed, Is there a way to lock and unlock sql server tables from .net code without using stored procedures, i need these to avoid business rules based duplicate records from being entered into the table. | 0 | [
2,
3991,
17,
16497,
4444,
255,
8128,
7484,
37,
13,
9,
2328,
1797,
366,
568,
8214,
8876,
800,
3726,
3726,
31,
376,
20,
1921,
21,
859,
37,
142,
12904,
34,
186,
89,
953,
4003,
51,
866,
1453,
5,
13075,
21,
14692,
54,
40,
11100,
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... |
'Convert' Dictionary<string,int> into List<object> C#
===
I have a `Dictionary<string,int> dictionary1` and I need to convert it into a `List<Data>` where `Data` has the properties `lable` = dictionary1.key and `value` = dictionary1.value. I don't want to use a loop because in order to avoid a new loop I am trying to use a Dictionary.
Another option would be having two different dictionaries (dictionary2 and dictionary3) where `dictionary2<string,keyOfDictionary1>` and `dictionary3<string,valueOfDictionary1>`.
Do I make sense? Is that possible? Is there a better option?
Thanks! | 0 | [
2,
13,
22,
1126,
8122,
22,
9186,
1,
11130,
15,
6391,
1,
77,
968,
1,
23793,
1,
272,
5910,
800,
3726,
3726,
31,
57,
21,
13,
1,
22595,
1857,
1,
11130,
15,
6391,
1,
9186,
165,
1,
17,
31,
376,
20,
8406,
32,
77,
21,
13,
1,
5739,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Uncaught SyntaxError: Unexpected token ILLEGAL?
===
I am making an AJAX call via jQuery which results in the above mentioned error. The strange part is the code works fine on LAMP, WAMP but when it is ported to a real server its giving the problem.
Here's my AJAX call:
function wordAnalysis() {
$("#spinner").show();
removeTopics();
$.ajax({
type: "POST",
url: "{$site_root_path}pages/wordanalysis.php",
data: "statuses="+json_statuses,
success: function(msg){
$("#mainstage").html(msg);
$("#spinner").hide();
}
});
}
Here's the Smarty .tpl file that is loaded from the AJAX call
<script type="text/javascript">{$words}</script>
<script type="text/javascript" src="{$site_root_path}extlib/jQCloud/jqcloud-1.0.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="{$site_root_path}extlib/jQCloud/jqcloud.css" />
<script type="text/javascript">
$(document).ready(function() {
var max = {$max};
var avg = {$avg};
var time_taken = {$time_taken};
var count = {$count};
var size;
{literal}
var text;
var color;
var span;
var ele;
var word_list = [];
var table_height = $("#contentTable").height();
var orig_table_height = 563;
var ratio = table_height / orig_table_height;
var max_font_size = 45;
for (var word in words) {
if (words[word]['total'] < avg) {
continue;
}
color = Math.floor((words[word]['url']*100)/words[word]['total']);
size = Math.floor((words[word]['total']/max)*max_font_size);
size = Math.round(size*ratio);
var item = new Array();
item['text'] = word;
item['weight'] = words[word]['total'];
var html = new Array();
if (color <= 10) { html['style']= "color: #68a1ff;"; }
else if (color <= 20) { html['style']= "color: #4088ff;"; }
else if (color <= 30) { html['style']= "color: #2477ff;"; }
else if (color <= 40) { html['style']= "color: #0060ff;"; }
else if (color <= 50) { html['style']= "color: #0057e6;"; }
else if (color <= 60) { html['style']= "color: #004ece;"; }
else if (color <= 70) { html['style']= "color: #0044b5;"; }
else if (color <= 80) { html['style']= "color: #003996;"; }
else if (color <= 90) { html['style']= "color: #002c75;"; }
else { html['style']= "color: #002562;"; }
html['style'] += " font-size: "+size;
item['html'] = html;
word_list.push(item);
}
$("#mainstage").jQCloud(word_list);
});
</script>
<style type="text/css">
#mainstage span.w10, #mainstage span.w9, #mainstage span.w8, #mainstage span.w7 {
text-shadow: 0px 1px 1px #ccc;
}
#mainstage span.w3, #mainstage span.w2, #mainstage span.w1 {
text-shadow: 0px 1px 1px #fff;
}
</style>
{/literal}
<link rel="stylesheet" type="text/css" href="{$site_root_path}assets/css/popup.css" />
<script type="text/javascript" src="{$site_root_path}assets/js/popup.js"></script>
What could be the reason for such an error that too only on a real server and not on LAMP, WAMP ? I've basically tested it with chrome.
The data is returned as JSON after the call. | 0 | [
2,
16061,
12647,
22649,
29992,
45,
9380,
20,
2853,
5143,
60,
800,
3726,
3726,
31,
589,
544,
40,
20624,
645,
1197,
487,
8190,
93,
56,
1736,
19,
14,
784,
2211,
7019,
9,
14,
2578,
141,
25,
14,
1797,
693,
1123,
27,
6792,
15,
619,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
join two tables order by date and display results
===
I'm trying to make a function kinda similar to facebook's notification window. Their function seems to combine any kind of event and display them after date.
So i have 2 tables :
Article and comments.
both have 2 similar rows : uniquepostowner and date_posted.
I want to join them up and display them one after another.
Example :
User A has posted a comment (04.05.2012 5:30)
User B Has posted a comment (04.05.2012 6:30)
User C has written an article (04.05.2012 7:30)
user D has posted a comment (04.05.2012 8:30)
However, i'm struggling with both joining these 2 and displaying the results.
Reading others with similar scenarios ive tried this as a query:
$sesid = $_SESSION['user_id'];
$sql = "SELECT X.* FROM ( SELECT * FROM `article` WHERE uniquepostowner = {$sesid} UNION SELECT * FROM `comments` WHERE uniquepostowner = {$sesid} ) X ORDER BY X.`date_posted`";
$result = mysql_query($sql);
Then trying to fetch the results like this:
while($row = mysql_fetch_array($result))
{
echo $row['article.id'];
}
But no success. Any help is greatly appreciated as always! :)
| 0 | [
2,
1865,
81,
7484,
389,
34,
1231,
17,
3042,
1736,
800,
3726,
3726,
31,
22,
79,
749,
20,
233,
21,
1990,
21096,
835,
20,
9090,
22,
18,
52,
4634,
1463,
9,
66,
1990,
2206,
20,
12287,
186,
825,
16,
807,
17,
3042,
105,
75,
1231,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to check live straming url response iphone
===
In my app i am doing live streaming with the ollowing code :
-(void)playurl:(id)sender
{
self.mpPlayer=[[[MPMoviePlayerController alloc]initWithContentURL:[NSURL URLWithString:@"http://alwatan.lsops.net/live/alwradio_ar_audio.sdp/playlist.m3u8"]] autorelease];
[self.mpPlayer prepareToPlay];
if(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
{
self.mpPlayer.view.frame = CGRectMake(0, 50, 768, 400);
}
else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
self.mpPlayer.view.frame = CGRectMake(0, 0, 1024, 500);
}
[self.mpPlayer play];
self.mpPlayer.movieSourceType = MPMovieSourceTypeStreaming;
//self.mpPlayer.movieSourceType = MPMovieSourceTypeFile;
self.mpPlayer.shouldAutoplay = TRUE;
self.mpPlayer.controlStyle = MPMovieControlStyleDefault;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:mpPlayer];
[scrollView addSubview:self.mpPlayer.view];
if(isVideoPlay)
{
isVideoPlay = FALSE;
}
else
{
isVideoPlay = TRUE;
}
}
- (void) moviePlayBackDidFinish:(NSNotification*)notification {
NSError *error = [[notification userInfo] objectForKey:@"error"];
if (error)
{
}
else
{
MPMoviePlayerController *moviePlayer = [notification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
}
}
Everything is fine but my problem is that is url is not runing then application will be crashed so how can i check the live streaming ulr response so i can mange the condition and give alert for url not respond.
Thanks, | 0 | [
2,
184,
20,
2631,
515,
5428,
3863,
287,
6362,
1627,
21024,
800,
3726,
3726,
19,
51,
4865,
31,
589,
845,
515,
11920,
29,
14,
6304,
4121,
68,
1797,
13,
45,
13,
8,
5,
2625,
1340,
6,
5438,
911,
255,
45,
5,
1340,
6,
18,
13630,
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... |
Is there a way to change windows7 aero theme with python?
===
I want to create a script that will change the global Aero window border color based on certain conditions. Say, for example, a tasks completes in the background, it could change the global window glass to a green hue, for a subtle notification.
There seems to be a way to do it [through Visual Basic][1], but not knowing VB, I was wondering if someone knew a way to do it with Python... or another scripting language.
[1]: http://stackoverflow.com/a/11172289/496097 | 0 | [
2,
25,
80,
21,
161,
20,
753,
1936,
465,
8914,
3184,
29,
20059,
60,
800,
3726,
3726,
31,
259,
20,
1600,
21,
3884,
30,
129,
753,
14,
2062,
8914,
1463,
1862,
1665,
432,
27,
1200,
2039,
9,
395,
15,
26,
823,
15,
21,
8674,
1279,
18,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
[Android]Make the second Textview in a TableRow scrollable if the text is too long
===
i have a table layout like the hello, tablelayout on android dev -wow the site is down today -.- . There are 2 textviews in 1 tableRow, the 1 should be at the left site.
The second should be fixed at the right side. But i have 2 textviews who are longer than the screen. If i start the application, i only see the middle /end of the long textviews, the short are right behind the screen. How can i make the short textviews fixed at the left screen side ?
I hope you know what i mean, my english is very bad but i think the content of my question is clear.
This is only the first part^^ the xml file is much longer
Here is the xml file :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:isScrollContainer="true"
android:overScrollMode="always"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarStyle="outsideInset"
android:scrollbars="vertical" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="1">
<TableRow
android:id="@+id/tableRow0"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_column="1"
android:padding="3dip"
android:textSize="20dp"
android:text="@string/tab1_text1"
android:textColor="#ffffff"
android:layout_marginTop="5dp"
/>
</TableRow>
<View
android:layout_height="2dip"
android:background="#FF909090" />
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_column="1"
android:padding="3dip"
android:text="@string/TV_1_1" android:textColor="#ffffff"/>
<TextView
android:id="@+id/in1_1"
android:gravity="right"
android:padding="3dip"
android:text="TEXT2" android:textColor="#ffffff"/>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_column="1"
android:padding="3dip"
android:text="@string/TV_1_2" android:textColor="#ffffff"/>
<TextView
android:id="@+id/in1_2"
android:gravity="right"
android:padding="3dip"
android:text="TEXT2" android:textColor="#ffffff"/>
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_column="1"
android:padding="3dip"
android:text="@string/TV_1_3" android:textColor="#ffffff"/>
<TextView
android:id="@+id/in1_3"
android:gravity="right"
android:padding="3dip"
android:text="TEXT2"
android:textColor="#ffffff"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit ="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</TableRow>
| 0 | [
2,
636,
290,
18524,
500,
11115,
14,
153,
1854,
4725,
19,
21,
859,
5417,
12159,
579,
100,
14,
1854,
25,
266,
175,
800,
3726,
3726,
31,
57,
21,
859,
9106,
101,
14,
10975,
15,
859,
4414,
1320,
27,
13005,
9664,
13,
8,
14297,
14,
689... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WebView cocoa doesn't respond to scrollWheel
===
How to make it work? I added the override method in the class inheriting from WebView, but it doesn't get fired.
Any idea? Thanks in advance!
- (void)scrollWheel:(NSEvent *)theEvent | 0 | [
2,
2741,
4725,
24507,
1437,
22,
38,
4590,
20,
12159,
8229,
800,
3726,
3726,
184,
20,
233,
32,
170,
60,
31,
905,
14,
84,
11891,
2109,
19,
14,
718,
17569,
68,
37,
2741,
4725,
15,
47,
32,
1437,
22,
38,
164,
3899,
9,
186,
882,
60,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Disable href with jquery/js
===
I am having difficulties in disabling href links through jquery. I am using this method i modified. Can some please advise or help me in figuring this out?
thank you
**jquery/js**
<script>
$('.next-tab').click(function() {
$('.st_tab_active').attr('disabled','disabled');
var tab= $('.st_tab_active').parent().next().children('a');
tab.removeAttr('disabled');
tab.trigger('click');
return false;
</script>
**html**
<ul class="st_tabs">
<li><a href="#st_content_1" class="st_tab" disabled="disabled">Horizontal Tab #1</a></li>
<li><a href="#st_content_2" class="st_tab" disabled="disabled">Horizontal Tab #2</a></li>
<li><a href="#st_content_3" class="st_tab" disabled="disabled">Horizontal Tab #3</a></li>
<li><a href="#st_content_4" class="st_tab" disabled="disabled">Horizontal Tab #4</a></li>
<li><a href="#st_content_5" class="st_tab" disabled="disabled">Horizontal Tab #5</a></li>
</ul> | 0 | [
2,
1460,
579,
746,
14057,
29,
487,
8190,
93,
118,
728,
18,
800,
3726,
3726,
31,
589,
452,
8075,
19,
1460,
58,
8599,
746,
14057,
6271,
120,
487,
8190,
93,
9,
31,
589,
568,
48,
2109,
31,
5372,
9,
92,
109,
2247,
14640,
54,
448,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Pyglet game objects. Extended sprite class?
===
I'm a long time web developer who has had a recent interest in game development. Seeing that I'm already very familiar with python, I read up on both pygame and pyglet and decided to go with the latter. Just like the syntax better. Anyways, both frameworks use a class `Sprite` to represent objects on screen. My game objects have a lot of functionality that's outside of just displaying and moving an image around. Would it be better to extend the Sprite class to include this functionality or to writing a class and accepts a sprite as an attribute so it can still be drawn but seperates responsibilities between object logic and image representation. I haven't seen much documentation on this issue but overall, not a lot of pyglet documentation at all so I thought I'd ask others who have used it. | 0 | [
2,
13,
28860,
1336,
250,
3916,
9,
1984,
27902,
718,
60,
800,
3726,
3726,
31,
22,
79,
21,
175,
85,
2741,
10058,
72,
63,
41,
21,
1764,
1163,
19,
250,
522,
9,
2078,
30,
31,
22,
79,
614,
253,
3694,
29,
20059,
15,
31,
1302,
71,
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... |
Rename primary key constraint in Teradata
===
Does Teradata have a way to rename a primary key constraint, rather than dropping it and recreating it? I'm using SP_RENAME for SQL Server and ALTER TABLE...RENAME CONSTRAINT for Oracle, but I don't know a corresponding command for Teradata. | 2 | [
2,
302,
7259,
1256,
1246,
28804,
19,
20796,
18768,
800,
3726,
3726,
630,
20796,
18768,
57,
21,
161,
20,
302,
7259,
21,
1256,
1246,
28804,
15,
864,
119,
6780,
32,
17,
6042,
99,
1880,
32,
60,
31,
22,
79,
568,
3782,
1,
99,
7259,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Dynamic select array in PHP
===
I have a standard form array in PHP like this. I need to account for up to 10 hours of labor in 15 minute increments with 10 as a value for every 15 min or 40 per hour. Is it possible to automate this into some sort of array with PHP instead of hardcoding each of these values? It just seems like there should be a better way and I have no idea how to start?
<select size="1" name="labor" id="labor">
<option value="80">2 Hours</option>
<option value="70">1 Hour 45 min.</option>
<option value="60">1 Hour 30 min.</option>
<option value="50">1 Hour 15 min.</option>
<option value="40">1 Hour</option>
<option value="30">45 Minutes</option>
<option value="20">30 Minutes</option>
<option value="10">15 Minutes</option>
</select> | 0 | [
2,
7782,
5407,
7718,
19,
13,
26120,
800,
3726,
3726,
31,
57,
21,
1236,
505,
7718,
19,
13,
26120,
101,
48,
9,
31,
376,
20,
2176,
26,
71,
20,
332,
974,
16,
2583,
19,
357,
2038,
13,
28461,
18,
29,
332,
28,
21,
1923,
26,
352,
35... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
z3 produces unknown for assertions without quantifiers
===
I have some simple constraints involving multiplication of reals in z3 that are producing `unknown`. The problem seems to be that they are wrapped in a datatype, as the unwrapped version produces `sat`.
Here is a simplified case:
(declare-datatypes () ((T (NUM (n Real)))))
(declare-const a T)
(declare-const b T)
(declare-const c T)
(assert (is-NUM a))
(assert (is-NUM b))
(assert (is-NUM c))
(assert (= c (NUM (* (n a) (n b)))))
(check-sat)
;unknown
And without the datatype:
(declare-const a Real)
(declare-const b Real)
(declare-const c Real)
(assert (= c (* a b)))
(check-sat)
;sat
I'm using z3 3.2, but this also is reproducible in the web interface. | 0 | [
2,
2052,
240,
6700,
2562,
26,
20878,
18,
366,
9836,
38,
16292,
18,
800,
3726,
3726,
31,
57,
109,
1935,
16747,
4838,
25432,
16,
683,
18,
19,
2052,
240,
30,
50,
4081,
13,
1,
1020,
2929,
1,
9,
14,
1448,
2206,
20,
44,
30,
59,
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... |
grouped pandas DataFrames: how do I apply scipy.stats.sem to them?
===
I know that I can apply numpy methods by doing the following:
`dataList` is a list of DataFrames (same cols/rows).
testDF = (concat(dataList, axis=1, keys=range(len(dataList)))
.swaplevel(0, 1, axis=1)
.sortlevel(axis=1)
.groupby(level=0, axis=1))
testDF.aggregate(numpy.mean)
testDF.aggregate(numpy.var)
and so on. However, what if I want to compute the standard error of the mean (sem)?
I tried:
testDF.aggregate(scipy.stats.sem)
but it gave a confusing error. Anyone know how to do this? What are the scipy.stats methods doing differently? | 0 | [
2,
19511,
16982,
18,
1054,
8361,
18,
45,
184,
107,
31,
5645,
9569,
6448,
9,
10631,
18,
9,
18,
1503,
20,
105,
60,
800,
3726,
3726,
31,
143,
30,
31,
92,
5645,
13,
6336,
6448,
3195,
34,
845,
14,
249,
45,
13,
1,
18768,
5739,
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... |
Overriding a Magento Adminhtml template file
===
I'm attempting to override a particular block on a page, in this case it's basically the Sales_Order_View_History template. The problem I'm seeing is that this block is already being overridden.
The custom module that is overriding this block is using:
<sales>
<rewrite>
<quotes_history>Company_Quotes_Block_Sales_Quotes_History</quotes_history>
</rewrite>
</sales>
What I have seen as the generally accepted format for overriding blocks is:
<adminhtml>
<rewrite>
<!-- companyhistory and Companyhistory are the name of the phtml template file we are overloading-->
<sales_order_view_companyhistory>Namespace_Package_Blocks_Adminhtml_Sales_Order_View_Companyhistory_Content</
The code above would like for me to create a Content.php file to rewrite the blocks constructor function. It looks to me like the first example uses a History.php to override the constructor as well. Just a naming convention. My question is why is one using 'sales' and the other using 'adminhtml'? Also now that we're overloading something called companyhistory how would my config reflect that?
| 0 | [
2,
84,
5175,
68,
21,
4723,
17050,
21,
43,
2160,
15895,
22894,
3893,
800,
3726,
3726,
31,
22,
79,
6314,
20,
84,
11891,
21,
1498,
1921,
27,
21,
2478,
15,
19,
48,
610,
32,
22,
18,
11374,
14,
2598,
1,
7861,
1,
4725,
1,
16853,
2289... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
check if facebook is blocked
===
I am using the facebook registration plugin, but certain workplaces now ban facebook (such as mine). I need to quickly determine if this is the case and show the alternative signup instead. I have read all the previous questions regarding this [such as this one][1] and the solution proposed seems pretty simple (load an image from facebook and use onerror to run any scripts you want when facebook is unavailable).
My problem with this is, when I test it at work, it takes 45 seconds before running the onerror script (it loads the rest of the page and says "Sending Request"). By that time, the user will have clicked the signup button and been sent to an error page (since facebook won't load).
Are there any ways of speeding up the process or another method to check if the user can access facebook?
[1]: http://stackoverflow.com/questions/7264667 | 0 | [
2,
2631,
100,
9090,
25,
8388,
800,
3726,
3726,
31,
589,
568,
14,
9090,
8587,
10922,
108,
15,
47,
1200,
16932,
18,
130,
2135,
9090,
13,
5,
4289,
28,
1114,
6,
9,
31,
376,
20,
976,
3746,
100,
48,
25,
14,
610,
17,
298,
14,
2676,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
put div on different line
===
I want to build a list of itens. Each item should be in one line, like several paragraphs.
Why my div.empresa elements are on same line? I think they should be on different lines because the display property of them is block.
Take a look at code:
http://jsfiddle.net/Yz8Cq/ | 0 | [
2,
442,
13,
12916,
27,
421,
293,
800,
3726,
3726,
31,
259,
20,
1895,
21,
968,
16,
32,
3474,
9,
206,
9101,
378,
44,
19,
53,
293,
15,
101,
238,
20599,
18,
9,
483,
51,
13,
12916,
9,
1503,
11973,
58,
2065,
50,
27,
205,
293,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Trying to convert a winforms datagridview to a wpf gridview but it's only populating with blank rows
===
I have a winforms project that I'm converting to wpf and I have an issue getting the datagrid to work. The datagridview in the original winforms does a few special things and I'd like to have this datagrid do all of the same things. In a broad sense what it does is:
Reads in several columns/rows from a database as a datatable.
Renames each of the column headers
Makes a few invisible
Populates a datagridview with binding
available_table = attributes.GetDataTable(query)
available_table.Columns(0).ColumnName = "Laser Scribe"
available_table.Columns(1).ColumnName = "Growth ID"
available_table.Columns(2).ColumnName = "Structure"
available_table.Columns(3).ColumnName = "Resistance"
available_table.Columns(4).ColumnName = "UID"
DataGridView_available.DataSource = available_table
DataGridView_available.Columns("UID").Visible = False
I've tried this to get it to work in the new WPF window, but obviously databinding has changed a bit since winforms.
Dim dv_test As DataView = attributes.GetDataTable(query).AsDataView
datagrid_available.ItemsSource = dv_test
dv_test.Columns(0).ColumnName = "Laser Scribe"
dv_test.Columns(1).ColumnName = "Growth ID"
dv_test.Columns(2).ColumnName = "Structure"
dv_test.Columns(3).ColumnName = "Resistance"
dv_test.Columns(4).ColumnName = "UID"
datagrid_available.Columns(4).Visibility = Windows.Visibility.Hidden
But it just results in three blank rows (the query returns three results). My only guess is that I'm not binding column names or something which is why they're not displaying. Is there a way to just bind and have the datagrid display everything in the dataview? I assume there is. | 0 | [
2,
749,
20,
8406,
21,
628,
4190,
18,
1054,
16375,
4725,
20,
21,
619,
7721,
7354,
4725,
47,
32,
22,
18,
104,
1675,
10038,
29,
6463,
11295,
800,
3726,
3726,
31,
57,
21,
628,
4190,
18,
669,
30,
31,
22,
79,
19583,
20,
619,
7721,
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... |
TSQL OrderedTable
===
So I am querying some data and trying to determine the amount of time between log on and log off for each user. I am close to getting this but am getting results that do not work. Here is the code I have right now:
WITH OrderedTable AS
(
SELECT EventType
, ModuleAndEventText
, Time
, Node
, UserSID
, ROW_Number() OVER (Partition BY UserSID ORDER BY UserSID,EventID,Time) RN
FROM viewevent
where EventType in ('BROKER_USERLOGGEDIN','BROKER_USERLOGGEDOUT') and usersid = 'S-1-5-21-999033763-294680432-740312968-10026'
)
SELECT t1.EventType
, t1.ModuleAndEventText
, t1.Node
, t1.UserSID
, t1.Time as TimeIn
, t2.Time as TimeOut
, DATEDIFF(hour, t1.Time, t2.Time ) TimeElapsedInHours
FROM OrderedTable t1
JOIN OrderedTable t2 ON t1.UserSID = t2.UserSID AND t2.RN = t1.RN + 1
WHERE t1.RN % 2 <> 0
ORDER BY t1.UserSID
Here are some of the results I am getting:
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in VMVIEWTC1.yrmc.org S-1-5-21-999033763-294680432-740312968-10026 2012-04-14 08:00:36.137 2012-04-14 09:32:08.267 1
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in VMVIEWTC1.yrmc.org S-1-5-21-999033763-294680432-740312968-10026 2012-04-14 08:00:36.137 2012-04-14 09:32:08.267 1
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026 2012-06-11 14:50:40.420 2012-06-11 16:43:08.640 2
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026 2012-06-11 17:49:46.330 2012-06-11 18:42:50.047 1
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026 2012-06-11 18:59:40.550 2012-06-12 23:20:16.027 29
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026 2012-06-12 23:20:16.777 2012-06-12 23:20:16.823 0
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026 2012-06-12 23:20:17.120 2012-06-15 13:03:31.807 62
The first two records are correct. The last few are not, it is picking the logged out record as the time in and I am not clear on how to fix this. Here is the data:
EventType ModuleAndEventText Time Node UserSID
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in 2012-04-14 08:00:36.137 VMVIEWTC1.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out 2012-04-14 09:32:08.267 VMVIEWTC1.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in 2012-04-14 08:00:36.137 VMVIEWTC1.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out 2012-04-14 09:32:08.267 VMVIEWTC1.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in 2012-06-11 14:50:40.420 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in 2012-06-11 16:43:08.640 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in 2012-06-11 17:49:46.330 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in 2012-06-11 18:42:50.047 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out 2012-06-11 18:59:40.550 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out 2012-06-12 23:20:16.027 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out 2012-06-12 23:20:16.777 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out 2012-06-12 23:20:16.823 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDOUT User YRMC_MAIN\jerogers has logged out 2012-06-12 23:20:17.120 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
BROKER_USERLOGGEDIN User YRMC_MAIN\jerogers has logged in 2012-06-15 13:03:31.807 VMVIEWWC2.yrmc.org S-1-5-21-999033763-294680432-740312968-10026
Thanks in advance. Kameron | 0 | [
2,
13,
38,
18,
22402,
1905,
5924,
800,
3726,
3726,
86,
31,
589,
25597,
68,
109,
1054,
17,
749,
20,
3746,
14,
2006,
16,
85,
128,
6738,
27,
17,
6738,
168,
26,
206,
4155,
9,
31,
589,
543,
20,
1017,
48,
47,
589,
1017,
1736,
30,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Upgraded from Rails 2.3.5 to 2.3.11 and am getting this error now: "uninitialized constant AssignmentsPresenter::OrderedHash
===
After upgrading, when I try to login to my Rails app, I get the following:
NameError in ApplicationsController#index
uninitialized constant AssignmentsPresenter::OrderedHash
RAILS_ROOT: /Users/jasonbodak
Application Trace | Framework Trace | Full Trace
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:131:in `const_missing'
/Users/jasonbodak/janova/janova/lib/assignments_presenter.rb:4:in `present'
/Users/jasonbodak/janova/janova/app/controllers/applications_controller.rb:12:in `index'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:1333:in `send'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:1333:in `perform_action_without_filters'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/filters.rb:617:in `call_filters'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/activesupport-2.3.11/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/activesupport-2.3.11/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/flash.rb:151:in `perform_action'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:532:in `send'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:532:in `process_without_filters'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/filters.rb:606:in `process'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:391:in `process'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:386:in `call'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03@janova-local_app/gems/actionpack-2.3.11/lib/action_controller/routing/route_set.rb:438:in `call'
Request
Parameters:
None
Show session dump
Response
Headers:
{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}
Does this mean anything to anyone? Thanks. | 0 | [
2,
9958,
37,
2240,
18,
172,
9,
240,
9,
264,
20,
172,
9,
240,
9,
1306,
17,
589,
1017,
48,
7019,
130,
45,
13,
7,
1020,
27313,
1333,
3587,
16898,
3914,
106,
45,
45,
7861,
69,
25436,
800,
3726,
3726,
75,
26939,
15,
76,
31,
1131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 width when generating dynamic linearlayouts
===
I'm setting up a layout, that I'm adding to (via a for-loop) based on a set of objects. The issue is if there are say 3 fields (columns), if the middle field has a longer text length in the first entry than the second... the middle field in the first one will consume a larger width, even if I've already defined a weightSum and a layout_weight for that center column. My question is, when dynamically adding rows like this, how can I ensure that they all end up being the exact same width, as defined in the XML? | 0 | [
2,
558,
9456,
76,
13500,
7782,
6745,
4414,
12638,
800,
3726,
3726,
31,
22,
79,
2697,
71,
21,
9106,
15,
30,
31,
22,
79,
4721,
20,
13,
5,
5034,
21,
26,
8,
18786,
6,
432,
27,
21,
309,
16,
3916,
9,
14,
1513,
25,
100,
80,
50,
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... |
Monospace fonts , quotes, and circumflex a
===
Most of the monospace fonts normally used for programming on Windows (all I have found so far) don't display 'funny quotes' (0xE2) properly. For example, an error message from the gcc compiler like
> warning: conflicting types for built-in function âprintfâ
which is really
>{funny quote}fname{funnyquote}
displays in Ludida Console, DejaVu, etc. as
>{circumflex a}fname{circumflex a}
(It may be doing so for you right now). Is there a a helvetica-like monospace font that respects that particular 8-bit codepage?
| 0 | [
2,
4129,
5582,
9978,
18,
13,
15,
18901,
15,
17,
18567,
19752,
21,
800,
3726,
3726,
127,
16,
14,
4129,
5582,
9978,
18,
4147,
147,
26,
3143,
27,
1936,
13,
5,
1233,
31,
57,
216,
86,
463,
6,
221,
22,
38,
3042,
13,
22,
16638,
1536,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
LINQ to Entities error when trying to bind a dropdownlist
===
I am trying to create a viewmodel and add a SelectListItem to allow me to bind a dropdown list.
I have a very basic viewmodel that looks like this
public class CreatePurchaseViewModel
{
public Product Product { get; set; }
public IEnumerable<SelectListItem> Products { get; set; }
public int SelectedProductId { get; set; }
public DateTime OrderDate { get; set; }
public bool OrderSent { get; set; }
}
My controller looks like this
[HttpGet]
public ActionResult Create()
{
var model = new CreatePurchaseViewModel
{
Products = context.Products.Select(x =>
new SelectListItem()
{
Text = x.ProductName,
Value = x.ProductID
})
};
return View(model);
}
However it complains that Value = x.Product cant convert type int to string. So if I add a .ToString it compiles ok but when I try load the view I get an error
> LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.
My View
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>CreatePurchaseViewModel</legend>
<div class="editor-label">
@Html.LabelFor(model => model.SelectedProductId)
</div>
<div class="editor-field">
@Html.DropDownListFor(x => x.SelectedProductId,Model.Products)
@Html.ValidationMessageFor(model => model.SelectedProductId)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.OrderDate)
</div>
<div class="editor-field">
@Html.TextBoxFor(model=>model.OrderDate)
@Html.ValidationMessageFor(model => model.OrderDate)
</div>
<div>
Sent
@Html.RadioButtonFor(model => model.OrderSent, "Sent", new { @checked = true })
Not Sent
@Html.RadioButtonFor(model=>model.OrderSent,"Not Sent")
Im pretty new to both entity framework and mvc so any help would be great.
Thank you
| 0 | [
2,
6294,
1251,
20,
12549,
7019,
76,
749,
20,
10193,
21,
2804,
2968,
5739,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
1418,
13998,
17,
3547,
21,
5407,
5739,
2119,
79,
20,
1655,
55,
20,
10193,
21,
2804,
2968,
968,
9,
31,
57,
21,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I get a user's latitude/longitude using foursquare's API?
===
Is there any way, using Foursquare's API, to get a user's geolocation based purely on the internet, i.e without using the phone's GPS?
Thanks | 0 | [
2,
184,
107,
31,
164,
21,
4155,
22,
18,
16337,
118,
2701,
16731,
568,
222,
12300,
22,
18,
21,
2159,
60,
800,
3726,
3726,
25,
80,
186,
161,
15,
568,
222,
12300,
22,
18,
21,
2159,
15,
20,
164,
21,
4155,
22,
18,
6389,
19032,
432,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Chronometer Skipping Seconds
===
I have a quick question regarding the chronometer. After observing it a bit more closely, I noticed that every once in a while, the chronometer will skip a second. Other than that, it functions fine. Is this normal behavior, and if not, how can I go about fixing it? | 2 | [
2,
13005,
25628,
7307,
27225,
2582,
800,
3726,
3726,
31,
57,
21,
2231,
1301,
3467,
14,
25628,
7307,
9,
75,
16987,
32,
21,
1142,
91,
3368,
15,
31,
2711,
30,
352,
382,
19,
21,
133,
15,
14,
25628,
7307,
129,
12532,
21,
153,
9,
89,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Devise Combinatorics Naming Convention
===
I stumbled upon a problem that I'm looking for an smart solution to. It's basically a combinatorics question.
I have five objects of which I need to select two, I can select the same one twice and it does not matter in which order I select them. This gives me ( 5 + 2 - 1 choose 2) = 15 possible combinations. I now want to reduce each combination (ie (1,1) or (2, 5)) to a number between 1 and 15. Any suggestions? | 0 | [
2,
29276,
12994,
108,
3457,
8354,
10929,
3087,
800,
3726,
3726,
31,
10282,
685,
21,
1448,
30,
31,
22,
79,
699,
26,
40,
3978,
4295,
20,
9,
32,
22,
18,
11374,
21,
12994,
108,
3457,
8354,
1301,
9,
31,
57,
355,
3916,
16,
56,
31,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can i create the collection of following data structure and send using socket.io?
===
I use node.js and socket.io.
I have in my mysql table this data structure:
TABLE USERS:
Id: 1, Name: 'ABC1', ToUserId: 1
Id: 2, Name: 'ABC2', ToUserId: 1
Id: 3, Name: 'ABC3', ToUserId: 1
Id: 4, Name: 'ABC4', ToUserId: 2
Id: 5, Name: 'ABC5', ToUserId: 2
Id: 6, Name: 'ABC6', ToUserId: 2
Id: 7, Name: 'ABC7', ToUserId: 3
I want to send the rows (ID1 - ID3) as a collection to user with UserId 1
and the rows (ID4 - ID6) to user with UserId 2
and the row (ID7) to user with UserId 3.
How can i create the collection and send the collection to the user?
I read the data as follows:
getUsers: function(callback)
{
client.query(
'SELECT * FROM users',
function select(err, results, fields) {
if (err) {
throw err;
}
var userslist = {};
if (results.length > 0) {
for (var i = 0; i < results.length; i++) {
var row = results[i];
//Create colletion in object userslist
//Emit to specific user ------v
//io.sockets.socket(USER_ID).emit('sendusers', userslist )
}
}
else
{
userslist = {};
}
callback(userslist);
}
);
}
| 0 | [
2,
184,
92,
31,
1600,
14,
1206,
16,
249,
1054,
1411,
17,
2660,
568,
18482,
9,
1963,
60,
800,
3726,
3726,
31,
275,
15421,
9,
728,
18,
17,
18482,
9,
1963,
9,
31,
57,
19,
51,
51,
18,
22402,
859,
48,
1054,
1411,
45,
859,
3878,
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... |
How to separate a column of numbers from string lines of varying lengths in C++?
===
thanks in advance for your help.
I'm looking to read a file that has the following format:
100 Every line has
23452 A different number of words
30 etc
If I use the method of reading line by line:
file >> number[i] >> str
It obviously doesn't work, because the string has spaces. Does anyone have any idea how else I could do this? I am only interested in saving the numbers in an array.
Thanks! | 0 | [
2,
184,
20,
1725,
21,
4698,
16,
2116,
37,
3724,
1560,
16,
9852,
13189,
19,
272,
20512,
60,
800,
3726,
3726,
3669,
19,
3612,
26,
154,
448,
9,
31,
22,
79,
699,
20,
1302,
21,
3893,
30,
63,
14,
249,
2595,
45,
808,
352,
293,
63,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.