text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
charArr[i] = new char[m[i] - m[i-1]];
}
k=0;
}
}
return n;
}
```
**Note**: that this last method could easily be modified to accept a `String str` argument instead of `n` and set `n = str.length()`, and return a `String[]` array from `charArr[][]`. | [
-0.2786141037940979,
0.023159734904766083,
0.34547826647758484,
-0.5248873233795166,
-0.20123769342899323,
0.18876364827156067,
0.41209471225738525,
-0.5362756848335266,
-0.11974412947893143,
-0.10841146111488342,
-0.2493603676557541,
0.5377922654151917,
-0.16348637640476227,
0.28968170285... | |
I need to store a file in conjunction with a database entry. How can I override the `Remove` method of the `DbContext` so that both the entry *and* file are deleted?
You can override the `SaveChanges` method, as described here: [Entity Framework 4.1 DbContext Override SaveChanges to Audit Property Change](https://stack... | [
0.17538174986839294,
0.33800700306892395,
0.2278686761856079,
0.023388180881738663,
0.28245699405670166,
-0.1874835193157196,
0.096734918653965,
-0.5549073815345764,
-0.26915496587753296,
-0.39753347635269165,
0.01362660713493824,
0.681678831577301,
-0.19822798669338226,
0.1819208115339279... | |
`npm update` seems to just update the packages in `dependencies`, but what about `devDependencies`.
Right now you can install `devDependencies` by running `npm install .`, but this doesn't work for `npm update .`
Any ideas?
To update package.json in addition to the local modules, run
```
npm update --save-dev
```
... | [
0.40996456146240234,
-0.09665438532829285,
0.23845289647579193,
0.18238289654254913,
-0.16016943752765656,
-0.3195802867412567,
0.3115423023700714,
-0.0864093080163002,
-0.23312373459339142,
-0.7576812505722046,
-0.3417631685733795,
1.1098380088806152,
-0.4321930706501007,
-0.0874504819512... | |
I want to call `setTimeout()` after a click occurs.
If the user clicks again before `300ms` has passed, I want to stop that timer, fire off another function and restart the original timer.
I know about `setTimeout()` but I'm not sure how to approach this problem.
**JavaScript:**
```
myTimeout = setTimeout(function()... | [
0.2876758575439453,
-0.07262107729911804,
0.9134335517883301,
-0.2592705190181732,
0.31564173102378845,
-0.13165141642093658,
0.5025599598884583,
-0.2705760598182678,
-0.15547463297843933,
-0.7262855172157288,
-0.3473140597343445,
0.9474576115608215,
-0.4160721004009247,
-0.020342513918876... | |
id="button">Click me</button>
```
The setTimeout starts the 300ms timer. the click handler binds a click event to a button on the page that, when clicked, will stop the timer by using clearTimeout.
When you call setTimeout, assign it to a variable. Then you can use that variable to stop the timer later by calling cl... | [
0.11066074669361115,
-0.12238233536481857,
1.0490683317184448,
-0.25283122062683105,
0.21898841857910156,
-0.28039848804473877,
0.18381844460964203,
-0.3039390444755554,
0.07889651507139206,
-0.8157181143760681,
-0.14723625779151917,
0.8688799142837524,
-0.3181902766227722,
0.2674865424633... | |
stuff every 300ms
},300);
clearInterval(myInterval); // stop the interval
```
**With addEventListener:**
```
function start() {
window.addEventListener("click", function() {
timeout = setTimeout(function() {
// do stuff after 300ms after the first click
clearTimeou... | [
-0.047463901340961456,
-0.10487353801727295,
1.036043643951416,
-0.2805527150630951,
0.5796175003051758,
-0.208524689078331,
0.4179617762565613,
0.008516385219991207,
-0.26046037673950195,
-0.48430147767066956,
-0.4069254994392395,
0.8594388961791992,
-0.22553680837154388,
0.09928853809833... | |
above should bind a global click listener on the page and clear and restart the timer recursively after a click. The listener stops if there are no clicks though, but this should get you started. | [
0.04720160737633705,
0.20854641497135162,
0.7768421173095703,
-0.08540309220552444,
-0.16052238643169403,
-0.5441323518753052,
0.32286766171455383,
-0.1993638426065445,
-0.34149619936943054,
-0.5968466997146606,
-0.004924911540001631,
0.7339776754379272,
-0.22669872641563416,
0.19778902828... | |
Suppose you are creating a class with multiple .cpp files (which each contain the implementation of a member function) and have the class' declaration in a .h file. Also, each .cpp file includes the .h file via the include directive.
I was told that if you change the implementation of any of the member functions (.cpp... | [
0.37883973121643066,
-0.09306275099515915,
-0.14471185207366943,
-0.2257348895072937,
0.2843915522098541,
0.011770027689635754,
0.29165539145469666,
-0.4610174894332886,
-0.20901243388652802,
-0.5053616166114807,
-0.2692033648490906,
0.3514229655265808,
-0.5087276101112366,
0.0921640321612... | |
compile the 1 .cpp file I changed AND the 4 other .cpp files I didn't change in order to correctly run my program.
My question, if the previous statement is true, is why is the statement is true? Any insight on this concept would be helpful.
It's false. If there is no change to a particular implementation file, no ch... | [
0.48720455169677734,
0.31399819254875183,
0.15569210052490234,
0.19116538763046265,
0.06879814714193344,
0.05568384751677513,
0.35324525833129883,
-0.3581883907318115,
-0.351656436920166,
-0.34854596853256226,
-0.08408869057893753,
0.5969705581665039,
-0.38615867495536804,
-0.0131036508828... | |
even having any of the others at all. Then you can link all the compiled files together without all the implementation files ever having been in the same place. | [
0.44769540429115295,
-0.08866959810256958,
0.12065602838993073,
0.4880724549293518,
-0.06043879687786102,
-0.2590654194355011,
0.09065636247396469,
-0.018980950117111206,
-0.5217757821083069,
-0.618628740310669,
-0.03620855137705803,
0.3583133816719055,
-0.17120632529258728,
0.056186683475... | |
For the life of me, I can't get my app to get the response from a process calling busybox from within su shell.
I've tried three different methods, as well as tried a combination of the three to get it to work, but I can never get the output from anything using busybox, only the rest of the commands.
To be more speci... | [
0.14910747110843658,
-0.2414448857307434,
0.37232789397239685,
-0.17479445040225983,
-0.18541623651981354,
0.05785004794597626,
0.4259350001811981,
0.17808212339878082,
-0.22560131549835205,
-0.7530408501625061,
-0.261534184217453,
0.5770749449729919,
-0.48873311281204224,
0.12923648953437... | |
works with `ls /data`, but not "busybox free"
This one would run the command (for the most part), and return an empty string instead of loop endlessly from the inputstream.
```java
Process p;
try {
p = Runtime.getRuntime().exec(new String[]{"su", "-c", "/system/bin/sh"});
DataOutputStream stdin = new DataOutp... | [
-0.07493522018194199,
-0.44693928956985474,
0.5218319296836853,
-0.3665245771408081,
0.27246448397636414,
0.031228013336658478,
0.31218624114990234,
-0.5170328617095947,
-0.13106755912303925,
-0.7435407638549805,
-0.2852219045162201,
0.46055805683135986,
-0.4795629680156708,
-0.15853618085... | |
out += new String(buffer, 0, read);
if(read<4096){
break;
}
}
Toast.makeText(getApplicationContext(), out, Toast.LENGTH_SHORT).show();
} catch (IOException e) {
e.printStackTrace();
}
```
The toast near the bottom shows everything from `ls /data`, but when changed to anything for busyb... | [
0.0909462496638298,
0.16795237362384796,
0.38941073417663574,
-0.5002896189689636,
0.02017938531935215,
0.20220880210399628,
0.3936748206615448,
-0.24205704033374786,
-0.14635224640369415,
-0.5710423588752747,
-0.26771289110183716,
0.1470646858215332,
-0.4796777069568634,
0.151059210300445... | |
right when you hit the button for the methods.
```java
String termReader(Process process){
BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
try {
int i;
char[] buffer = new char[4096];
StringBuffer output = new StringBuffer();
... | [
-0.1814814954996109,
-0.21596819162368774,
0.8189714550971985,
-0.4910629391670227,
0.22336070239543915,
0.2572416067123413,
0.4554397165775299,
-0.412387877702713,
-0.06590110063552856,
-0.7930523157119751,
-0.35846468806266785,
0.6054683923721313,
-0.45262411236763,
0.32683658599853516,
... | |
reader.close();
return output.toString();
} catch (IOException e) {
e.printStackTrace();
return e.getMessage();
}
}
String processReader(Process process){
InputStream stdout = process.getInputStream();
byte[] buffer = new byte[1024];
int read;
String out = new String();
... | [
-0.12432189285755157,
-0.2387911081314087,
0.6044960618019104,
-0.3902488648891449,
0.25264880061149597,
0.4476061463356018,
0.3039741814136505,
-0.33047014474868774,
-0.13482877612113953,
-0.6307840347290039,
-0.377160906791687,
0.49588021636009216,
-0.3593252897262573,
0.1845368891954422... | |
out += new String(buffer, 0, read);
if(read<1024){
break;
}
} catch (IOException e) {
e.printStackTrace(); | [
-0.05319434776902199,
-0.32220032811164856,
0.2278006374835968,
-0.3892729580402374,
0.26667097210884094,
0.14302006363868713,
0.13076762855052948,
-0.4489571154117584,
-0.09001626074314117,
-0.31956911087036133,
-0.14138644933700562,
0.29914361238479614,
-0.5776510834693909,
-0.0347694978... | |
}
}
return out;
}
```
There's no stack traces to work with, so I'm starting to get a bit stumped.
Edited with the code proposed below, uhm, below :D
I changed it around a small bit to make it a oneclick run thing for easier troubleshooting and testing.
This also freezes when it tries to read the inputstream... | [
0.14035840332508087,
0.11232440173625946,
0.1730060577392578,
-0.5309889912605286,
0.20800073444843292,
-0.17670980095863342,
0.47534123063087463,
0.050298046320676804,
-0.4277411103248596,
-0.35871773958206177,
0.18159089982509613,
0.2899385690689087,
-0.45588207244873047,
0.3202405571937... | |
String command = "busybox traceroute\n";
StringBuffer theRun = null;
try {
Process process = Runtime.getRuntime().exec("su");
DataOutputStream stdin = new DataOutputStream(process.getOutputStream());
stdin.writeBytes(command);
BufferedReader reader = new BufferedReader(
... | [
-0.19494225084781647,
-0.5563620328903198,
0.5038846135139465,
-0.4006510376930237,
0.31288832426071167,
0.3711858093738556,
0.3820178508758545,
-0.12468366324901581,
-0.22002072632312775,
-0.610527515411377,
-0.2965267598628998,
0.44050025939941406,
-0.5129982233047485,
0.3481261432170868... | |
= new StringBuffer();
while ((read = reader.read(buffer)) > 0) {
theRun = output.append(buffer, 0, read);
}
reader.close();
process.waitFor();
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException... | [
0.2626729905605316,
-0.29971256852149963,
0.5639559626579285,
-0.4310946762561798,
0.04602638632059097,
-0.0791306346654892,
0.5492698550224304,
-0.12321513891220093,
-0.2177596241235733,
-0.75620436668396,
-0.36617445945739746,
0.5503591895103455,
-0.2544354498386383,
0.3122172951698303,
... | |
info line you get every time you invoke the command) and not catching the rest of the data. Ive tried all variations I can think of to get this working right :/
If anybody's got some insight on this, I'd be greatly appreciative :)
I've found a sort of a workaround for this.
First of all, running commands linked to bu... | [
0.2352001965045929,
-0.3847009539604187,
0.36950376629829407,
0.2569686770439148,
-0.034627363085746765,
-0.026894139125943184,
0.41778498888015747,
0.2529171407222748,
0.02030571550130844,
-0.45698440074920654,
-0.05011952668428421,
0.8145990967750549,
-0.21336600184440613,
-0.10145713388... | |
if you want something to rely on whether a command fired off properly (in my case, my app just wouldn't work right if I couldn't compare how everything ran.)
You cant get the input from the process, but you CAN get the exit value if you work it right :) this works for anything that doesn't give you a complex response ... | [
0.16420908272266388,
-0.2567468583583832,
0.2547062933444977,
-0.052715715020895004,
0.046654727309942245,
-0.2531753480434418,
0.34357407689094543,
-0.5275919437408447,
-0.1103578731417656,
-0.5312244892120361,
-0.02888334169983864,
0.6703299880027771,
-0.23973044753074646,
-0.18732762336... | |
up to work easily. Run the commands as normal using the method provided by MasterJB:
```java
process p;
try {
p = Runtime.getRuntime().exec(new String[]{"su", "-c", "/system/bin/sh"});
DataOutputStream stdin = new DataOutputStream(p.getOutputStream());
stdin.writeBytes(command);
stdin.writeBytes("echo... | [
0.2016165554523468,
-0.22429819405078888,
0.8546003699302673,
-0.3212924301624298,
0.21400806307792664,
0.10845947265625,
0.36388829350471497,
-0.7172369360923767,
-0.3542463779449463,
-0.7189494967460632,
-0.44964882731437683,
0.5657244324684143,
-0.4060427248477936,
-0.20982344448566437,... | |
String(buffer, 0, read);
if(read<4096){
break;
}
// here is where you catch the error value
int len = out.length();
char suExitValue = out.charAt(len-2);
Toast.makeText(getApplicationContext(), String.valueOf(suExitValue), Toast.LENGTH_SHORT).show();
return0or1(Integer.... | [
0.0587480403482914,
-0.06484901905059814,
0.27885836362838745,
-0.3152436316013336,
0.16332100331783295,
0.12024582177400589,
0.6470090746879578,
-0.12358596175909042,
-0.3002137541770935,
-0.2502005994319916,
-0.21430520713329315,
0.44622355699539185,
-0.27506035566329956,
0.3000136911869... | |
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
```
I also found it easier to make a "0 or 1" method to return what happened. In this example it's fired as a toast. You may also want to test if the char is actually an integer, as some commands give no exit value whatsoeve... | [
0.06041818484663963,
-0.12677213549613953,
0.18293942511081696,
-0.2815239727497101,
-0.0386798195540905,
-0.10976841300725937,
0.38882550597190857,
-0.002347339875996113,
-0.086069256067276,
-0.3923729360103607,
-0.12210123986005783,
0.3126802444458008,
-0.3012825548648834,
0.342579603195... | |
Cannot get return value.";
if (returnValue == 0){
message = command + " - successful.";
return message;
}
if (returnValue == 1){
message = command + " - failed.";
return message;
}
return message;
}
```
With a little bit of research you can match just about any exit value with proper responses, just ... | [
0.06593897193670273,
0.05768917500972748,
0.23561416566371918,
-0.04509638249874115,
0.19893689453601837,
0.08875501155853271,
1.1586965322494507,
-0.33090630173683167,
-0.24186481535434723,
-0.4195164144039154,
-0.35668420791625977,
0.5297006964683533,
-0.37905964255332947,
0.310044348239... | |
work in most cases, but needs to be expanded upon to catch double and triple values. | [
0.30928075313568115,
0.2717529535293579,
0.0956050381064415,
0.04162581264972687,
0.26348787546157837,
-0.02288329415023327,
0.0870763510465622,
-0.5280869007110596,
-0.340198278427124,
-0.4323791265487671,
-0.4075685739517212,
0.4333857595920563,
-0.04202663525938988,
-0.09585421532392502... | |
Hi I'm working through the Stanford iOS development class. I have a question regarding threading. I understand UIKit calls should be handled by the main thread. I was wondering if something like this is legal?
```
- (UIImage *)mapViewController:(MapViewController *)sender imageForAnnotation:(id<MKAnnotation>)annotatio... | [
-0.0580567941069603,
-0.2551247775554657,
1.0351214408874512,
-0.08105065673589706,
-0.17223814129829407,
0.01566469855606556,
0.4334079623222351,
-0.2543150782585144,
-0.23452407121658325,
-0.44200295209884644,
-0.17508956789970398,
0.44026923179626465,
-0.38415631651878357,
0.09774432331... | |
dispatch_async(dispatch_get_main_queue(), ^{
image = [UIImage imageWithData:data];
});
}
});
dispatch_release(downloadQ);
return image;
}
```
or I should just return NSData and handle all the threading in the calling method?
Thanks
Your code won't do what you want.
Yo... | [
0.12054451555013657,
-0.41828998923301697,
0.5786555409431458,
0.19109705090522766,
-0.0015951056266203523,
-0.004829270765185356,
0.38784289360046387,
0.17387935519218445,
-0.4732249677181244,
-0.6875806450843811,
-0.30568209290504456,
0.6681178212165833,
-0.39932700991630554,
0.119229018... | |
You are not guaranteed that the block will actually run before you return -- in fact, the odds are that it won't.
So you'll return the current value of `image`. Since you didn't initialize it, it's probably garbage. Whoever calls this method will try to use a garbage pointer to an image, and (if you're lucky) crash. I... | [
0.059970710426568985,
0.11544908583164215,
0.3135637044906616,
0.04480411857366562,
-0.006437745410948992,
-0.12340206652879715,
0.4135710597038269,
-0.035120755434036255,
-0.10055581480264664,
-0.6759912967681885,
-0.3108139634132385,
0.4651772975921631,
-0.17541848123073578,
0.1923483759... | |
There is zero benefit to doing this on some other thread -- you're still waiting the same amount of time, and switching threads just adds overhead.
In order to load the image in a usefully asynchronous way, you need some way to asynchronously tell the caller when the image is done loading, via a callback to a delegate... | [
0.34518659114837646,
-0.41986459493637085,
0.21162322163581848,
0.2105465829372406,
-0.040242843329906464,
-0.20806759595870972,
0.14494594931602478,
0.05716020241379738,
-0.4160163998603821,
-0.8163480758666992,
-0.2223985195159912,
0.4446570873260498,
-0.22476428747177124,
0.210616812109... | |
I'm trying to create a form for 'Member' using simple\_form and having trouble displaying an association where it display the organization as below instead of the id, or organization\_name. Am I missing something here? How should I go about this?
\*\*Organization:0x0000000485cf88
Organization:0x0000000485c948
Organi... | [
-0.35311487317085266,
0.26037147641181946,
0.4030911922454834,
0.08583791553974152,
-0.12705665826797485,
-0.14693637192249298,
0.2026827484369278,
-0.13584837317466736,
-0.3593369424343109,
-0.6431803107261658,
-0.13957107067108154,
0.22005224227905273,
-0.31890642642974854,
0.28844708204... | |
doesn't have any of these fields: `[ :to_label, :name, :title, :to_s ]` so `SimpleForm` can't detect a default label and value methods for collection. I think you should pass it manually. | [
0.2809039056301117,
0.011542809195816517,
0.22345997393131256,
-0.04293408244848251,
0.1624811738729477,
-0.6319921612739563,
0.37119919061660767,
0.003359805792570114,
0.09577000141143799,
-0.3208056688308716,
-0.20165959000587463,
0.6210192441940308,
-0.24098610877990723,
0.2396958470344... | |
I have an application that I have behind a reverse proxy, I would like for it to only listen to localhost/127.0.0.1.
I expected this to work:
`app.listen(3001, 'localhost');`
or
`app.listen(3001, '127.0.0.1');`
...but instead I get an error:
```
node.js:201
throw e; // process.nextTick error, or 'error' event... | [
0.09960643202066422,
0.1649164855480194,
0.0492916963994503,
-0.2980167269706726,
0.2286399006843567,
0.07624763250350952,
0.8392689228057861,
-0.3142467439174652,
-0.28262269496917725,
-0.762229323387146,
-0.11501871794462204,
0.5849250555038452,
-0.6688551306724548,
0.1323784440755844,
... | |
at EventEmitter._tickCallback (node.js:192:40)
```
Running the application without a specifying the hostname works fine, ie., `app.listen(3001);`.
I am running Node **v0.6.14** and express@**2.5.5** and have read this [google groups discussion](https://groups.google.com/group/express-js/browse_thread/thread/6a46488f... | [
-0.29193878173828125,
-0.07536907494068146,
0.5708418488502502,
-0.09470182657241821,
0.0745358094573021,
-0.12962296605110168,
0.38513514399528503,
-0.007833197712898254,
-0.2501315176486969,
-0.8785964846611023,
-0.3776419460773468,
0.6329430341720581,
-0.4700296223163605,
0.105381913483... | |
problem is the potentially asynchronous nature of `.listen()`. Really it should be doing that `console.log` call inside a callback passed to listen. When you add the host, it tries to do a DNS lookup, which is async. So when that line tries to fetch the address, there isn't one yet because the DNS request is running, s... | [
-0.20832815766334534,
-0.13603748381137848,
0.5751606225967407,
-0.08301868289709091,
0.3154914379119873,
-0.25036609172821045,
0.5481662750244141,
-0.11054002493619919,
-0.22408528625965118,
-0.750971794128418,
-0.3451923131942749,
1.205798864364624,
-0.4477449655532837,
0.407858848571777... | |
I am hoping to be able to make something similar to the universal access zoom window shown below. I have already created an NSView and using a fill operation I made a rect with a clear "see through" composite to see through my window and show the desktop. Now I am wondering if it is possible to zoom in and out inside m... | [
0.5656017065048218,
-0.013432173989713192,
0.17247582972049713,
0.24855810403823853,
0.019625067710876465,
0.006228412501513958,
0.03915831446647644,
0.27235281467437744,
-0.2819002866744995,
-0.8743513822555542,
0.4146427810192108,
0.5576828718185425,
-0.03823670372366905,
0.1454284340143... | |
where I could find this in the docs? Some code would be great. Thanks!

Take a look at Apple's example **CIAnnotation**. In this example is magnifying image but I think You can achieve what You want. You can download sample code from [here](https://de... | [
0.3827282190322876,
0.4181146025657654,
0.0018880207790061831,
0.2751006782054901,
0.06421589851379395,
0.07276865094900131,
0.156053364276886,
-0.17242172360420227,
-0.23079970479011536,
-0.46361300349235535,
0.11166244000196457,
0.4142687916755676,
0.10566055774688721,
-0.115967683494091... | |
I'm currently in the midst of converting a large multi-module project (~100 sub-modules) to use Maven. Currently we use Ant + Ivy.
So far no major issues have cropped up and I'm comfortable that Maven is still a good fit. However, I wonder if there is a better way to handle native dependencies.
So far I have come to ... | [
0.17361649870872498,
-0.11001834273338318,
0.29930269718170166,
-0.3867843747138977,
-0.10172378271818161,
-0.04329558461904526,
0.5250211954116821,
-0.0735570639371872,
0.040396060794591904,
-0.9136950969696045,
0.048222608864307404,
0.6376090049743652,
-0.3414498269557953,
0.038600526750... | |
to give each a classifier (e.g. natives-win32) and use the following in the parent POM:
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy<... | [
-0.17325979471206665,
-0.3496640622615814,
-0.0858684629201889,
0.09225574135780334,
-0.0675424337387085,
-0.04220856353640556,
-0.019055010750889778,
-0.4280499517917633,
-0.04037061706185341,
-0.7469375729560852,
-0.06203952059149742,
-0.08536550402641296,
-0.3503493368625641,
0.09258551... | |
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope> | [
0.17769993841648102,
-0.11283466964960098,
0.08606099337339401,
0.27549195289611816,
0.2952229380607605,
-0.18050210177898407,
-0.11532987654209137,
-0.10920863598585129,
-0.3134511411190033,
-0.8061195015907288,
-0.04327159747481346,
0.15070241689682007,
-0.7065786123275757,
0.21378140151... | |
<includeClassifiers>natives-win32</includeClassifiers>
<outputDirectory>${project.build.directory}/natives</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
```
So far this seems to be a simple all-round solution that doesn't require to... | [
-0.08487347513437271,
-0.12534935772418976,
-0.01690143160521984,
0.10113364458084106,
-0.2931162416934967,
-0.08038410544395447,
0.46953433752059937,
-0.24191346764564514,
-0.27189967036247253,
-0.9543291330337524,
0.023962195962667465,
0.1402614414691925,
-0.2632051706314087,
0.304480671... | |
only thing I must do is ensure that my /natives/ directory is defined on java.library.path.
One thing that bothers me (a little) about this approach is that all my native dependencies get copied around to each sub-module that expresses a transitive dependency on them, whilst my happy jar libraries are added to the cl... | [
0.19700446724891663,
0.22634297609329224,
0.25736352801322937,
0.07809650152921677,
-0.03564893454313278,
-0.25163865089416504,
0.40397244691848755,
0.25142282247543335,
-0.12594342231750488,
-0.9702621102333069,
0.08556541800498962,
0.37548166513442993,
-0.022216299548745155,
0.3716866672... | |
copying about.
Are there any other potential gotchas' that I should be concerned about with the above approach?
A satisfactory way to do this (imo) is to not use list-style-image, instead using the background property to set the "bullet" (note I substituted my own placeholder image since I just copied/pasted from a fi... | [
0.2808923125267029,
0.14797890186309814,
0.6140754222869873,
0.09189240634441376,
-0.09689323604106903,
0.053790073841810226,
-0.03493884578347206,
-0.47274336218833923,
-0.17368972301483154,
-0.6435222625732422,
0.15231138467788696,
0.3209496736526489,
-0.24662762880325317,
0.155864700675... | |
line-height: 32px;
vertical-align: middle;
padding-left: 40px;
}
``` | [
-0.17215752601623535,
0.14800962805747986,
0.44600173830986023,
-0.14578452706336975,
0.1398763209581375,
0.30553823709487915,
0.1511189192533493,
0.11484438925981522,
0.03749081492424011,
-0.4102366864681244,
-0.36779719591140747,
0.4041833281517029,
-0.1004367545247078,
-0.07518024742603... | |
I have what should be a simple issue: On my newest rendition of <http://www.derekbeck.com/1775> the "Recent Updates" line is a table cell spanning three cells. (The three cells of this table are the left side, a spacer in the middle, and the right side.) The line you see is a border-bottom set by CSS. I want more spaci... | [
0.1783033013343811,
0.19935071468353271,
0.830134928226471,
0.07106588035821915,
0.003326511476188898,
0.07869892567396164,
-0.258328914642334,
0.11247298866510391,
-0.22884725034236908,
-0.7129663825035095,
0.24132922291755676,
-0.09931047260761261,
-0.12684226036071777,
0.310812234878540... | |
but still nothing. padding-bottom works but simply increases the spacing between "Recent Updates" and the line. I want the spacing AFTER the line, before the next table row.
Any ideas?
Instead of putting the dotted border on the cell, put it on the "Recent Updates" div, then increase the size of the table cell by sett... | [
0.1285364180803299,
0.0405304878950119,
1.021058440208435,
-0.11414431780576706,
0.3255158066749573,
-0.043277982622385025,
-0.1662459671497345,
0.038270533084869385,
-0.4298346936702728,
-0.5817219018936157,
-0.001963225891813636,
0.3605961799621582,
-0.04663783311843872,
-0.2185627967119... | |
I am having a problem I am working on a class which is subclass of UITextField.
Which will be used in many classes further.
But I don't want to let user to use it's delegate methods in any way.
Is there any way to do this ?
Override `setDelegate:` so that it throws an exception or logs an instruction on what to do. Th... | [
0.17911110818386078,
-0.005624896846711636,
0.3671971261501312,
-0.15578657388687134,
0.019678056240081787,
-0.21853238344192505,
0.4779796004295349,
-0.13787899911403656,
-0.2843473553657532,
-0.7259471416473389,
-0.008558511734008789,
0.4137607514858246,
-0.48122596740722656,
0.305633306... | |
> Exception: ERROR: Element xpath=//\*[@id='seriesNwsHldr']/div[2]/p[1]/a not found.
I checked in Fierbug. The path is correct but I don't know what's the reason for this test case to fail.
The first time you download the file, save the date from the Last-Modified header of the response. You can pull it out of the `NS... | [
0.11413741856813431,
0.026669500395655632,
0.5858296751976013,
-0.1656547337770462,
0.03250245004892349,
-0.009679481387138367,
0.7482392191886902,
-0.12732064723968506,
0.12405800819396973,
-0.636609673500061,
-0.42144185304641724,
0.488931268453598,
-0.1737888604402542,
0.018940271809697... | |
The following snippet, called from my implementation of `onOptionsItemSelected()`, works nicely to carry the user from my app to a mail client with email address, subject and body pre-filled. I'm using this as a simple way to let the user give me feedback.
```
String uriText =
"mailto:" + emailAddress +
"?subj... | [
0.1860690861940384,
-0.05307034030556679,
0.9447405338287354,
-0.10933064669370651,
-0.023953339084982872,
0.2152511477470398,
0.2524355351924896,
-0.26286834478378296,
-0.1412562131881714,
-0.656136691570282,
-0.11035294830799103,
0.3770016133785248,
-0.2635575532913208,
-0.14217545092105... | |
*createChooser unregisterReceiver* seem fruitless, and I can't find many examples of `createChooser()` that also call `unregisterReceiver()` in a way that helps this situation.
> 04-08 21:26:19.094: E/ActivityThread(27894): Activity com.android.internal.app.ChooserActivity has leaked IntentReceiver com.android.interna... | [
0.10885206609964371,
0.18084178864955902,
0.5618761777877808,
-0.15462510287761688,
0.0853927806019783,
-0.06789644807577133,
0.4483942687511444,
-0.379861444234848,
-0.22874416410923004,
-0.7214589715003967,
0.09098487347364426,
0.5554271936416626,
-0.22403161227703094,
0.1229065135121345... | |
as well on my Galaxy Nexus with 4.0.4, but only if there's only one option and the chooser doesn't appear.
This is a bug in Android source - not much you can do about it. Their ResolverActivity registers a BroadcastReceiver, but doesn't always unregister it.
More detail:
Intent.createChooser() will start a ResolverA... | [
0.14372651278972626,
-0.17803284525871277,
0.8914119005203247,
-0.2352301925420761,
-0.002043274464085698,
-0.20625580847263336,
0.3077678382396698,
-0.16476336121559143,
-0.3564806878566742,
-0.6227728724479675,
-0.23692010343074799,
0.6551669239997864,
-0.5090373158454895,
-0.05064697936... | |
called in `onCreate()` the other lifecycle methods are never called and it jumps straight to `onDestroy()` - leaking the receiver.
I didn't see a bug for this in the Android issues database, so I [created one](http://code.google.com/p/android/issues/detail?id=29399).
For more info you can see this in code:
* [Resol... | [
0.27024877071380615,
-0.36470675468444824,
0.4264225959777832,
-0.16966401040554047,
-0.163530170917511,
0.00503118708729744,
0.1125747337937355,
-0.32194575667381287,
0.09958656132221222,
-0.4965381324291229,
-0.39538681507110596,
0.47650042176246643,
-0.3775425851345062,
-0.2012492716312... | |
I would like to change the background color of the DIV that contains my input field. I got the code working correctly when you type data in the input the background color changes red. But when I go back and erase the data leaving the input field blank, the background does not go back to it's original color.
I need the... | [
0.30542075634002686,
0.07939059287309647,
0.4884476959705353,
-0.18930059671401978,
0.4787514805793762,
0.06506934016942978,
0.14805762469768524,
-0.30334731936454773,
0.05745607614517212,
-0.7288991212844849,
-0.2813316583633423,
0.827273964881897,
-0.35073116421699524,
0.1072157546877861... | |
see this as well on my Galaxy Nexus with 4.0.4, but only if there's only one option and the chooser doesn't appear.
This is a bug in Android source - not much you can do about it. Their ResolverActivity registers a BroadcastReceiver, but doesn't always unregister it.
More detail:
Intent.createChooser() will start a ... | [
0.20714177191257477,
-0.17941834032535553,
0.734207034111023,
-0.24723650515079498,
0.04328266903758049,
-0.28614750504493713,
0.29216235876083374,
-0.18740588426589966,
-0.37394991517066956,
-0.6789429187774658,
-0.26346662640571594,
0.6569725871086121,
-0.5163927674293518,
0.024921949952... | |
`finish()` is called in `onCreate()` the other lifecycle methods are never called and it jumps straight to `onDestroy()` - leaking the receiver.
I didn't see a bug for this in the Android issues database, so I [created one](http://code.google.com/p/android/issues/detail?id=29399).
For more info you can see this in co... | [
0.27858877182006836,
-0.15521754324436188,
0.40080907940864563,
-0.3176763653755188,
-0.19893264770507812,
-0.04645295813679695,
0.15691687166690826,
-0.38925811648368835,
0.10132814198732376,
-0.3902074992656708,
-0.3438561260700226,
0.5095959901809692,
0.03426358476281166,
-0.13198846578... | |
I was curious that what does setTimeout return. So I did a quick test:
```
var thing = setTimeout(function(){},1);
```
And what surprise me is that it gave me a number. `1351` Each time is different.
So is it really all it returns is a number? So I can actually do this as well?
```
clearTimeout(1351);
```
Very c... | [
0.03621114045381546,
-0.22179491817951202,
0.3117263615131378,
-0.13875295221805573,
0.05312729626893997,
-0.22934384644031525,
-0.02946723997592926,
-0.29841628670692444,
-0.2358839213848114,
-0.3409583866596222,
-0.07081795483827591,
0.3862836956977844,
-0.28946492075920105,
0.2978721559... | |
you pass in. | [
0.17265662550926208,
0.4230286478996277,
0.1895512193441391,
-0.08553373068571091,
-0.17316283285617828,
-0.07414397597312927,
0.26905590295791626,
0.040319398045539856,
-0.31012874841690063,
-0.7053821086883545,
-0.29413580894470215,
0.030616238713264465,
0.3018728494644165,
0.01162066217... | |
I am writing a simple sender and receiver program to transit using UDP so it's connectionless, but I am having a problem figuring out whether my receiver program needs to call bind() or the server and/or both. My receiver program(client) will sit in an infinite loop waiting to receive data from the sender(server) and t... | [
0.2195776402950287,
-0.008862792514264584,
0.23326842486858368,
-0.22834201157093048,
-0.35833725333213806,
0.007320105563849211,
0.29618313908576965,
-0.07739482074975967,
-0.11071367561817169,
-1.1062065362930298,
-0.019138721749186516,
0.29606208205223083,
-0.48433399200439453,
0.243881... | |
packets to. When you call `bind` with a specific port for a given protocol (e.g. TCP or UDP), you're asking it "whenever you see a network packet on port XXXXX, please give it to me".
Say, for example, that two copies of your program were running, and they both wanted to listen for UDP packets on the same port. If the... | [
0.18968670070171356,
-0.14269253611564636,
0.27985113859176636,
0.06883206218481064,
-0.08864143490791321,
-0.0978870764374733,
0.07413063943386078,
-0.04284226894378662,
-0.2797067165374756,
-1.0032225847244263,
-0.249954491853714,
0.37014731764793396,
-0.7180674076080322,
0.3960469365119... | |
the program succeeded at binding to that port. | [
-0.14599727094173431,
0.05060989409685135,
0.15716677904129028,
0.011055775918066502,
0.1080433651804924,
-0.14991377294063568,
0.16111066937446594,
-0.07094140350818634,
-0.05450256168842316,
-0.31928738951683044,
-0.00727827288210392,
0.535218358039856,
-0.1670449674129486,
0.15080870687... | |
I want to display the last March month. I am using the following code,
```
date("Y-m-d",strtotime("last March"));
```
Any suggestions or references would be very helpful.
```
$year = date('Y');
if (date('n') < 3) {
$year--;
}
$beginningOfLastMarch = mktime(0, 0, 0, 3, 1, $year);
``` | [
0.020912939682602882,
0.09071875363588333,
1.1139118671417236,
-0.2933327853679657,
0.2556142210960388,
0.27237191796302795,
0.020923467352986336,
0.20270583033561707,
-0.3544260561466217,
-0.610059916973114,
-0.19464822113513947,
0.06524384021759033,
0.16113285720348358,
0.462918579578399... | |
I'm trying to create a script that takes a .txt file with multiple lines of YouTube usernames, appends it to the YouTube user homepage URL, and crawls through to get profile data.
The code below gives me the info I want for one user, but I have no idea where to start for importing and iterating through multiple URLs.
... | [
0.3786465525627136,
-0.25576531887054443,
0.6032186150550842,
-0.24292151629924774,
-0.48039376735687256,
0.29240208864212036,
0.32595333456993103,
-0.06352633237838745,
-0.10297185927629471,
-0.8272989988327026,
0.01394724752753973,
0.12949512898921967,
-0.4426107406616211,
0.125806197524... | |
print info.get_text()
```
Does anyone have any recommendations?
Eg., if I had a .txt file that read:
```
username1
username2
username3
etc.
```
How could I go about iterating through those, appending them to <http://youtube.com/user/%s>, and creating a loop to pull all the info?
If you don't want to use an actual... | [
0.5586992502212524,
0.09735506772994995,
0.34192949533462524,
-0.10177399218082428,
-0.19742701947689056,
0.17741970717906952,
0.03008371591567993,
-0.0578918531537056,
-0.20273274183273315,
-0.7440987825393677,
0.18923231959342957,
0.5997845530509949,
-0.3716558814048767,
0.00517854187637... | |
line in file_obj` to go line by line in a document.
2. *concatenate urls* I used `+` below, but you can also use the concatenate function.
3. *make a list of urls* - will let you stagger your requests, so you can do [compassionate screen scraping.](http://dev.lethain.com/an-introduction-to-compassionate-screenscraping/... | [
0.31279388070106506,
-0.11149781942367554,
0.9211708307266235,
-0.04363097995519638,
-0.26489222049713135,
0.1706458330154419,
0.37233588099479675,
-0.07903380692005157,
-0.010793466120958328,
-0.8571454286575317,
0.0546497143805027,
0.4521600008010864,
-0.4002581536769867,
0.0795968100428... | |
urllib2
finally:
f.close()
```
EDIT: Andrew G's string format is clearer. :) | [
-0.2725416123867035,
0.07283341139554977,
0.33285579085350037,
-0.3576239049434662,
-0.2274385243654251,
-0.21726292371749878,
0.20806851983070374,
0.05378035828471184,
-0.158403679728508,
-0.37828704714775085,
-0.5818320512771606,
0.22188077867031097,
-0.6019027233123779,
0.07571689039468... | |
When converting from Unix to Windows, I get the correct output; however, when going from Windows to Unix I get some strange output. I thought all I had to allow for was the removal of the carriage return, '\r'. This isn't working though. When I open the text file after running the code, I get some strange results, the ... | [
0.08901995420455933,
0.23651577532291412,
0.47133761644363403,
-0.4045245349407196,
0.22557206451892853,
-0.024610968306660652,
0.5057318806648254,
0.009438431821763515,
-0.2115117460489273,
-0.6101475954055786,
-0.2747171223163605,
0.773942232131958,
-0.2571249008178711,
0.538160085678100... | |
cout << "Please enter the name of the source file: ";
cin >> source;
ifstream fin( source, ios::binary );
if ( !fin ) // Check to make sure the source file exists.
{
cerr << "File " << source << " not found!";
getch();
return 1;
}//endif
cout << "Please enter the name of t... | [
-0.22530469298362732,
-0.06015964597463608,
0.5464653968811035,
-0.2636590898036957,
0.32248592376708984,
-0.02991543523967266,
-0.08701951056718826,
0.2486955225467682,
0.18504974246025085,
-0.734427273273468,
-0.5130866169929504,
0.4993283748626709,
-0.4130783975124359,
0.200991302728652... | |
ifstream fest( destination );
if ( fest ) // Check to see if the destination file already exists.
{
cout << "The file " << destination << " already exists!" << endl;
cout << "If you would like to truncate the data, please enter 'Y', "
<< "otherwise enter 'N' to quit: ";
char ... | [
-0.08657284080982208,
-0.2365136295557022,
0.7551971673965454,
-0.26112449169158936,
0.3646846115589142,
-0.129283145070076,
0.056675806641578674,
0.12054501473903656,
0.1771761178970337,
-0.5111762285232544,
-0.15709803998470306,
0.6983415484428406,
-0.2930358648300171,
0.1144180670380592... | |
if ( answer == 'n' || answer == 'N' )
{
return 1;
}//endif
}//endif
clrscr(); // Clear screen for neatness.
ofstream fout( destination, ios::binary );
if ( !fout.good() ) // Check to see if the destination file can be edited.
{
cout << destination << "could not be ... | [
-0.22548171877861023,
0.01000938843935728,
0.6270970106124878,
-0.3819529116153717,
0.6029055118560791,
-0.03793206810951233,
0.3779933750629425,
0.0755787193775177,
-0.09659230709075928,
-0.6092385053634644,
-0.4641095995903015,
0.4697197675704956,
-0.4555475413799286,
0.03456151485443115... | |
getch();
return 1;
}//endif
// Open the destination file in binary mode.
fout.open( destination, ios::binary );
char ch = fin.get(); // Set ch to the first char in the source file.
while ( !fin.eof() )
{
if ( ch == '\x0D' ) // If ch is a carriage return, then the sourc... | [
-0.12933838367462158,
0.023308206349611282,
0.6751872301101685,
-0.21323230862617493,
0.2021513432264328,
0.23918373882770538,
0.11494532227516174,
-0.07430862635374069,
-0.008366057649254799,
-0.6238630414009094,
-0.48261532187461853,
0.4748372733592987,
-0.41337740421295166,
0.4025520682... | |
file
{ // must be in a windows format.
windows = true;
}//endif
if ( windows == true )
{
ch = fin.get(); // Advance ch, so that at the bottom of the loop, the
}//endif | [
0.26300856471061707,
-0.10836540162563324,
0.641492486000061,
-0.1527402549982071,
0.38604921102523804,
-0.21374280750751495,
0.16955484449863434,
-0.21085819602012634,
0.025429898872971535,
-0.34435445070266724,
-0.4786032438278198,
0.5755949020385742,
-0.17832474410533905,
0.377659827470... | |
// carriage return is not coppied into the new file.
if ( windows == false )
{
if ( ch == '\x0A' ) // If the file is in the Unix format..
{
fout.put( '\x0D' ); // When a new line is found, output a carriage | [
0.12267442792654037,
-0.3510691225528717,
0.43849360942840576,
0.07300560176372528,
-0.0770440325140953,
0.20664969086647034,
0.022712159901857376,
-0.16599951684474945,
-0.00878831371665001,
-0.5570297837257385,
-0.04992865398526192,
0.5358555912971497,
-0.5296152830123901,
0.313656061887... | |
}//endif // return.
}//endif
fout.put( ch );
ch = fin.get();
}//endwh
if ( windows == true )
{
fout.put( '\x0A' );
}//endif
fout.close();
fin.close(); // Close yer files.
if ( windows == true ) | [
0.012016283348202705,
0.023799428716301918,
0.6545966863632202,
-0.6071958541870117,
0.19353339076042175,
0.33875420689582825,
0.30630525946617126,
-0.25264623761177063,
-0.0668577030301094,
-0.6565137505531311,
-0.5241190195083618,
0.6991130709648132,
-0.40133604407310486,
0.1857011616230... | |
// A little output for user-friendly-ness.
{
cout << "The contents of " << source << " have been coppied to "
<< destination << " and converted to Unix format." << endl;
}else{
cout << "The contents of " << source << " have been coppied to "
<< destination << " and converted to W... | [
-0.02900252304971218,
-0.05444836616516113,
0.519772469997406,
0.0040594604797661304,
0.18591152131557465,
-0.1387956291437149,
-0.05546493083238602,
0.19192348420619965,
0.026191823184490204,
-0.7332064509391785,
-0.36482957005500793,
0.5494632720947266,
-0.21090489625930786,
-0.239577069... | |
}//endif
cout << "Enter any key to quit.." << endl;
getch();
return 0;
}//endmn
```
\*If\* you only need to convert simple ascii (and perhaps utf-8) text files, you could read the source file line-by-line in a loop in translated mode (handles newlines for you enough for this case) with non-member getline() an... | [
0.2514559030532837,
-0.20046114921569824,
0.16066129505634308,
-0.2551693618297577,
0.04323122650384903,
-0.022978520020842552,
0.2975464165210724,
-0.15652963519096375,
0.00033044276642613113,
-0.5089724659919739,
-0.381329208612442,
0.410716712474823,
-0.6294986605644226,
0.0197275374084... | |
push\_back the lines into a vector<string>. Then, you could close the input handle to the file, do ofstream out("filename", ios\_base::trunc) and write the elements of the vector to the file while separating them by the newlines you want.
It all depends on your requirements.
The following is an example with minimal e... | [
0.1377052366733551,
-0.24221448600292206,
0.5860475897789001,
-0.4106159508228302,
-0.061037883162498474,
0.08813152462244034,
0.02427142672240734,
-0.5338771343231201,
-0.15520228445529938,
-0.7462635040283203,
-0.1037740632891655,
0.6416026949882507,
-0.45054924488067627,
-0.189897045493... | |
cerr << "Usage: this.exe file_to_convert newline_format(\"linux\" or \"win\")" << endl;
return EXIT_FAILURE;
}
string fmt(argv[2]);
if (fmt != "linux" && fmt != "win") {
cerr << "Invalid newline format specified" << endl;
return EXIT_FAILURE;
}
ifstream in(argv[1]);
if (!... | [
-0.40559789538383484,
-0.1548798680305481,
0.6637137532234192,
-0.45440447330474854,
0.13110631704330444,
0.16870565712451935,
0.24083568155765533,
-0.3429671823978424,
0.14470137655735016,
-0.56390380859375,
-0.572110652923584,
0.9036451578140259,
-0.4422294795513153,
0.19283294677734375,... | |
return EXIT_FAILURE;
}
string tmp(argv[1]);
tmp += "converted";
ofstream out(tmp.c_str(), ios_base::binary);
if (!out) {
cerr << "Error writing " << tmp << endl;
return EXIT_FAILURE;
}
bool first = true;
for (string line; getline(in, line); ) {
if (!first) { | [
-0.3471255302429199,
-0.21864286065101624,
0.48080915212631226,
-0.5906749367713928,
0.08097102493047714,
0.37266281247138977,
0.7142385840415955,
-0.3968420624732971,
0.07097849994897842,
-0.3039957582950592,
-0.4842417240142822,
0.5905493497848511,
-0.34443384408950806,
0.109107576310634... | |
if (fmt == "linux") {
out << "\n";
} else {
out << "\r\n";
}
}
out << line;
first = false; | [
-0.2082797884941101,
-0.4713089168071747,
0.5474382638931274,
-0.5251433253288269,
0.12370437383651733,
0.09275638312101364,
0.23959526419639587,
-0.25143682956695557,
0.1836646944284439,
-0.30090099573135376,
-0.6407536864280701,
0.6879706978797913,
-0.3566919267177582,
0.1698196232318878... | |
}
in.close();
out.close();
if (remove(argv[1]) != 0) {
cerr << "Error deleting " << argv[1] << endl;
return EXIT_FAILURE;
}
if (rename(tmp.c_str(), argv[1]) != 0) {
cerr << "Error renaming " << tmp << " to " << argv[1] << endl;
return EXIT_FAILURE;
}
}
```
As ot... | [
-0.23871676623821259,
0.13181035220623016,
0.4442670941352844,
-0.5004656910896301,
0.20425736904144287,
0.06961958110332489,
0.43981459736824036,
-0.4620562195777893,
0.17648370563983917,
-0.4007243812084198,
-0.568153440952301,
0.633216142654419,
-0.49846509099006653,
0.21466636657714844... | |
editors like Notepadd++) that do newline conversion for you. So, you don't need to implement anything yourself unless you're doing this for other reasons (you didn't specify). | [
-0.09841613471508026,
-0.254302978515625,
0.371244341135025,
0.16299191117286682,
0.021641282364726067,
-0.3617853820323944,
0.06985127925872803,
-0.008023537695407867,
-0.2523820698261261,
-0.893110454082489,
-0.10323707014322281,
0.41914111375808716,
-0.15458783507347107,
-0.258994549512... | |
I have to use javascript to make links instead of for several unimportant reasons, and I want for it to behave like even though im not using it. Not the affects thats easy, but I want to be able to hold down shift while clicking to open a new window and to open it in a new tab if they are holding down ctrl. How would I... | [
0.3550340533256531,
-0.0111662857234478,
0.6432111263275146,
-0.18148230016231537,
-0.3645731806755066,
-0.15428215265274048,
0.354052871465683,
-0.20161142945289612,
-0.17708653211593628,
-0.7619960904121399,
0.2592543363571167,
0.6671129465103149,
-0.5753529667854309,
0.17242422699928284... | |
var link = 'http://stackoverflow.com/';
if (ctrlPressed) {
window.open(link,'_blank');
} else {
window.location = link;
}
return false;
});
$(document).keydown(function (e) {
if (e.keyCode === 17) {
ctrlPressed = true;
}
});
$(document).keyup(function (e) {
if (e.keyC... | [
-0.1382369101047516,
-0.07010742276906967,
0.996033787727356,
-0.3398430347442627,
-0.029700864106416702,
0.08362823724746704,
0.12279082834720612,
-0.5930951833724976,
-0.16773514449596405,
-0.6696150898933411,
-0.5417110323905945,
0.7376387715339661,
-0.28882458806037903,
-0.011121830902... | |
{
if (el.addEventListener) {
el.addEventListener(eType, fn, uC);
return true;
} else if (el.attachEvent) {
return el.attachEvent('on' + eType, fn);
} else {
el['on' + eType] = fn;
}
}
var ctrlPressed = false,
a = document.getElementById('link'),
link = 'http://st... | [
-0.09311674535274506,
-0.041962191462516785,
0.832127034664154,
-0.17571191489696503,
0.36288321018218994,
0.18301203846931458,
0.08773401379585266,
-0.5488054156303406,
-0.07082623988389969,
-0.29795050621032715,
-0.33861014246940613,
1.032939076423645,
-0.24003656208515167,
0.20593452453... | |
window.open(link,'_blank');
} else {
window.location = link;
}
return false;
});
addEvent(document, 'keydown', function (e) {
if (e.keyCode === 17) {
ctrlPressed = true;
}
});
addEvent(document, 'keyup', function (e) {
if (e.keyCode === 17) {
ctrlPressed = false;
}
})... | [
-0.2826642692089081,
-0.08395617455244064,
0.8396304845809937,
-0.3875736892223358,
0.2695174515247345,
0.07516241073608398,
0.2503960132598877,
-0.1760881096124649,
0.037196289747953415,
-0.7956495881080627,
-0.7167903184890747,
0.7956263422966003,
-0.32349032163619995,
0.2391185611486435... | |
jQuery cannot find my custom attribute on a drop down menu I have a similar one just one line above it that works great, but this keeps giving me an undefined.
***jQuery***
```
$('#admin_student_school_select').change('click',function(){
var school_student = $(this+':selected').attr('school_student');
$('#admin_stude... | [
-0.014176339842379093,
0.056931763887405396,
0.6812071204185486,
0.24449975788593292,
0.1620509922504425,
-0.14181169867515564,
-0.09375062584877014,
0.11622331291437149,
-0.019538143649697304,
-0.7183818817138672,
-0.011408384889364243,
0.5253223180770874,
0.14692766964435577,
-0.01964306... | |
event?!
---
**Update:**
`$(this+':selected')` isn't a valid selector...use this:
```
var school_student = $(':selected', this).attr('school_student');
``` | [
0.013731837272644043,
-0.31030726432800293,
-0.09963691979646683,
0.03898359090089798,
0.08309788256883621,
-0.10934612154960632,
-0.009385020472109318,
-0.023511627689003944,
-0.13522876799106598,
-0.37479349970817566,
-0.3566651940345764,
0.3474406898021698,
-0.05083885416388512,
0.10968... | |
Am using Mac lion for developing iPhone application, there I created database and copied into documents directory of the application, But the path to the applications documents directory not found in my lion, even the "Library" folder is not available under the lion's username.
I searched completely on my lion for the... | [
0.13900086283683777,
0.44975316524505615,
-0.04841253533959389,
0.18100227415561676,
0.08074906468391418,
0.08933234959840775,
0.36623701453208923,
-0.19606800377368927,
-0.20851846039295197,
-0.29314032196998596,
0.08594155311584473,
0.6868325471878052,
-0.07764551788568497,
-0.2653735578... | |
in Advance!!!
Your library folder is bydefault hidden so you will have to unhide it.
You can get information about showing hidden files [here](http://www.mactricksandtips.com/2008/04/show-hidden-files.html)
**Edit1**:
You can also go to library in following way
* Right click on Finder icon of your Dock
* Click on "Go... | [
0.3636234700679779,
-0.051420908421278,
0.5510407090187073,
0.10184731334447861,
0.028699582442641258,
-0.1532963067293167,
0.025743640959262848,
-0.3480992317199707,
-0.15397974848747253,
-0.4650445580482483,
-0.268331378698349,
0.7091607451438904,
-0.0034279196988791227,
0.33197084069252... | |
**The Situation**
In Sharepoint 2010 I can click on an item in a list:

And then the Read/Edit view becomes visible in that page:

**My Goal**
I have a WebPart *on another Page* ... | [
-0.13208653032779694,
-0.11038938909769058,
0.4710719585418701,
-0.07392814010381699,
-0.25001260638237,
0.10472465306520462,
0.27204281091690063,
-0.017700619995594025,
-0.341044157743454,
-0.8972997665405273,
0.12649774551391602,
0.5268820524215698,
-0.12861590087413788,
0.07938402891159... | |
?PageType=4
&ListId={D0FDB54F-1DDF-4C5E-865B-ABDE55C1125}
&ID=1
&ContentTypeID=0x010800ED5176D13CCEFC4AA8D62A79985DE892"
onclick="EditLink2(this,49);return false;" target="_self">Test Item</a>
```
So I digged a bit into the Sharepoint JS files and found `EditLink2` calling `_... | [
0.2093973159790039,
0.26227426528930664,
0.4041152000427246,
-0.118491992354393,
-0.0648881271481514,
0.024734312668442726,
0.5636191368103027,
-0.356258362531662,
0.09182140231132507,
-0.5653783679008484,
-0.01899060048162937,
0.4522375464439392,
-0.36948803067207336,
0.06947003304958344,... | |
open dialog just write simple JS function for showing [modal dialog](http://msdn.microsoft.com/en-us/library/ff410058.aspx), for example:
```
function openMyItemDialog( itemId ) {
var options = {
url: "http://{mysharepointsite}/_layouts/listform.aspx?PageType=4&ListId={D0FDB54F-1DDF-4C5E-865B-ABDE55C1125}&... | [
-0.1616947203874588,
0.074588842689991,
1.0257056951522827,
0.10160183906555176,
-0.04754174128174782,
0.050901610404253006,
0.16648657619953156,
-0.28719332814216614,
-0.4186858534812927,
-0.6061380505561829,
-0.3992396593093872,
0.46706491708755493,
-0.39944198727607727,
-0.0681177675724... | |
Michael Harrison has a great post on [lazy enumerators in Ruby](http://www.michaelharrison.ws/weblog/?p=163), providing an implementation of `lazy_select` and `lazy_map`. I am wondering whether the following implementation of `lazy_flatten` should have special processing for anything other than `Enumerator` and `Enumer... | [
0.143594890832901,
0.412205308675766,
-0.3638988137245178,
-0.08010759204626083,
-0.10677710175514221,
0.2626151740550995,
0.19636806845664978,
-0.14541926980018616,
-0.43270042538642883,
-0.24223724007606506,
-0.03593064472079277,
0.1519285887479782,
-0.06433470547199249,
-0.0597428902983... | |
end
elsif value.kind_of? Enumerable
value.flatten.each do |v|
yielder.yield v
end
else
yielder.yield value
end
end
end
end
end
```
1. This doesn't seem lazy to me, as you are still performing old (non-lazy) `flatten` | [
-0.12552937865257263,
-0.0275180134922266,
0.6052340269088745,
-0.39306190609931946,
-0.2757405638694763,
-0.14025157690048218,
0.12407180666923523,
-0.3855247497558594,
0.1267593801021576,
-0.5124131441116333,
-0.21073301136493683,
0.5732324123382568,
-0.06506595015525818,
0.2734369337558... | |
beneath.
2. `Enumerator` is `Enumerable`, so I think you don't need to handle it separately.
3. I would expect `lazy_flatten` to be method on `Enumerable`.
Here's how I would implement it:
```
module Enumerable
def lazy_flatten
Enumerator.new do |yielder|
each do |element|
if element.is_a? Enumera... | [
-0.12142066657543182,
-0.0940362885594368,
0.21404966711997986,
-0.2939794659614563,
-0.32387447357177734,
-0.1498730182647705,
0.07518355548381805,
-0.6372066140174866,
-0.19887107610702515,
-0.6516380310058594,
-0.11030188202857971,
0.667300820350647,
-0.20415832102298737,
0.008486368693... | |
yielder.yield(element)
end
end
end
end
end
``` | [
0.05971356853842735,
0.05056864768266678,
0.41445648670196533,
-0.23314666748046875,
-0.3344982862472534,
-0.07013293355703354,
-0.06953860819339752,
-0.40499773621559143,
0.4278375804424286,
-0.30934080481529236,
-0.06396496295928955,
0.7305037379264832,
-0.025565067306160927,
0.392498701... | |
I am working on a P2P Chat Application using TcpClient and sockets.
I have written the following code to accept tcpclient:
```
IPAddress[] ip = Dns.GetHostAddresses(Dns.GetHostName());
IPAddress ip_local = Dns.GetHostAddresses(Dns.GetHostName())[0];
// IPAddress ip_local = IPAddress.Parse(ip_local);
TcpListener tcpl ... | [
-0.23045288026332855,
0.271342933177948,
0.9545845985412598,
-0.2888289988040924,
0.24614278972148895,
0.31737393140792847,
0.4587700068950653,
-0.2940746545791626,
-0.2942851185798645,
-0.8577027916908264,
-0.18908476829528809,
0.25243711471557617,
-0.3340452313423157,
0.17230400443077087... | |
new AsyncCallback(OnReceive), state);
}
catch (Exception ex)
{
}
}
```
The problem is that it picks different network [as I have 1 LAN and 2 VMWARE networks] every time. So the question is how to force it to take the network address of LAN, i.e. a particular network?
1. This doesn't seem lazy to me, ... | [
-0.06471993774175644,
-0.3791237473487854,
0.5546374320983887,
-0.146767720580101,
-0.19290345907211304,
-0.1271723508834839,
0.11907144635915756,
-0.356917142868042,
-0.3225979506969452,
-0.7851166725158691,
-0.09430991113185883,
0.6621026992797852,
-0.2236432135105133,
0.3630756139755249... | |
method on `Enumerable`.
Here's how I would implement it:
```
module Enumerable
def lazy_flatten
Enumerator.new do |yielder|
each do |element|
if element.is_a? Enumerable
element.lazy_flatten.each do |e|
yielder.yield(e)
end
else
yielder.yield(eleme... | [
-0.35926729440689087,
-0.24652735888957977,
0.268480122089386,
-0.11893835663795471,
-0.21307885646820068,
-0.0576016940176487,
0.05989764630794525,
-0.6333796977996826,
-0.1361922174692154,
-0.4529264271259308,
-0.12207916378974915,
0.6013447046279907,
-0.3683956265449524,
0.0313965603709... | |
end
end
end
end
``` | [
0.09053593128919601,
0.17408306896686554,
0.9050940871238708,
0.018810953944921494,
-0.1377137303352356,
-0.3929614722728729,
0.4956907033920288,
0.13939474523067474,
0.358357310295105,
-0.47481784224510193,
-0.20272067189216614,
0.16480758786201477,
-0.08470422029495239,
0.651962995529174... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.