text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
= new RulePackages();
FileRelativePaths FullPaths
{
get { return relPaths; }
}
private static string RootPath()
{
// No longer called, but somehow need to find a way to append to paths returned in FullPaths
return Some_DirectoryName_Determined_At_Run_Time_Returned_BySomeOth... | [
0.2245618849992752,
-0.4121953248977661,
0.5955072045326233,
-0.05125528946518898,
0.21951763331890106,
-0.15454775094985962,
0.7311851382255554,
-0.4105699062347412,
-0.12433721125125885,
-0.643394410610199,
-0.09434198588132858,
0.601356029510498,
-0.47998619079589844,
-0.126128733158111... | |
problem is that this is giving me the relative paths only, where I really wanted to append some code to the strings returned (by using the method RootPath()).
So, is there any way to get this to work, while still having strong typing and keeping the code length to a minimum? I'm a bit resigned to using the first appro... | [
0.151637002825737,
-0.04272446781396866,
0.11071678251028061,
-0.022530071437358856,
-0.12250612676143646,
-0.28196418285369873,
0.4466192424297333,
-0.019011270254850388,
-0.3274933099746704,
-0.6614550352096558,
0.14121013879776,
0.6487096548080444,
-0.4807019531726837,
-0.02214805409312... | |
enum XmlFile{
File1,
File2
};
public static class TestFiles{
const string RelativeDirectory = @"TestData";
const string XmlExtension = @"xml";
static string RootPath {
get
{
return Some_DirectoryName_Determined_At_Run_Time_Returned_BySomeOtherModule();
}
}
... | [
0.3581196069717407,
-0.3554205596446991,
0.37481480836868286,
0.20196175575256348,
0.14321880042552948,
0.009688585065305233,
0.20823585987091064,
-0.28919798135757446,
0.19881337881088257,
-0.6882548332214355,
-0.3264981806278229,
0.41070693731307983,
-0.38346222043037415,
0.1815102398395... | |
file){
return string.Format(@"{0}{1}\{2}.{3}", RootPath, RelativeDirectory, file, XmlExtension);
}
}
```
This snippet has some unfortunate side-effects:
* uses convention to associate enum members with a file name
* relies on enum's ToString()
* assumes that the RelativeDirectory is always the same (othe... | [
-0.09824966639280319,
-0.1254899650812149,
0.45273399353027344,
-0.19794043898582458,
0.2431502342224121,
-0.13008970022201538,
0.1850566864013672,
0.02851208858191967,
-0.2977513372898102,
-0.45090916752815247,
-0.44379767775535583,
0.3916097581386566,
-0.24415826797485352,
0.469252377748... | |
In my application, I need to parse a JSON that includes the end time of an event. When this event is in progress, I need to calculate the time left for the finalization of that evet. To do this I use this piece of code:
```
// I get the time and convert it from millis to seconds
long end = System.currentTimeMillis() /... | [
0.06389875710010529,
-0.24370341002941132,
0.6590717434883118,
-0.013769887387752533,
0.2514100670814514,
0.30417951941490173,
0.04596206173300743,
-0.07484377920627594,
-0.15434615314006805,
-0.8146562576293945,
-0.07456086575984955,
0.3524618446826935,
0.06936684995889664,
0.178740948438... | |
a charm in some devices like the Optimus Black and the HTC Desire. But today I've tested my app with the ZTE Blade of a friend and the time left of the event is very strange. It appears in negative numbers and digits very distance from the original ones. I've tested the app with different values and there's no pattern,... | [
0.1540122926235199,
-0.31956344842910767,
0.5546260476112366,
0.2521575093269348,
-0.1046341061592102,
0.11623997986316681,
0.17452475428581238,
-0.07271436601877213,
0.02956257201731205,
-0.646404504776001,
0.18185371160507202,
0.32105669379234314,
0.07566867768764496,
0.14781513810157776... | |
with the clock of one of the devices not set properly. With the time extracts you give it seems like the difference is exactly one hour, which might be a cause of wrong clock setting. When you consider the time set, also take a look at the time zone. It might be that both devices show the same time, but one of them is ... | [
0.492712140083313,
-0.1347053498029709,
0.264517605304718,
0.41747382283210754,
0.0016912412829697132,
-0.2075720578432083,
0.11946876347064972,
-0.08163777738809586,
-0.21934272348880768,
-0.5792678594589233,
0.18727819621562958,
0.5597681999206543,
-0.21134358644485474,
0.415572792291641... | |
What techniques are people using to utilize multiple processors/cores when running a TwistedWeb server? Is there a recommended way of doing it?
My twisted.web based web service is running on Amazon EC2 instances, which often have multiple CPU cores (8, 16), and the type of work that the service is doing benefits from ... | [
0.6822080612182617,
-0.0026041839737445116,
0.21194633841514587,
0.22526027262210846,
-0.10316605865955353,
0.07578488439321518,
0.013176165521144867,
0.004933037795126438,
-0.4207387864589691,
-0.7126927971839905,
0.24048878252506256,
0.19914484024047852,
-0.09531790018081665,
0.340525656... | |
serving as a reverse proxy to several upstream twisted.web services running on the same host, but each on different port.
This works fine, but what i'm really interested in, is a solution where there is no "front-facing" server, but all twistd processes somehow bind to the same socket and accept requests. Is such thin... | [
0.0868203192949295,
-0.026725314557552338,
0.4103599786758423,
0.3491496443748474,
-0.07779248803853989,
0.08135424554347992,
0.0252394862473011,
0.4662227928638458,
-0.4231482744216919,
-0.5136517882347107,
0.0025852045509964228,
0.158765971660614,
-0.2962943911552429,
0.49848130345344543... | |
application deals with shared state.
In a single process Twisted application, concurrency is all cooperative (with help from Twisted's asynchronous I/O APIs) and shared state can be kept anywhere a Python object would go. Your application code runs knowing that, until it gives up control, nothing else will run. Additi... | [
0.03155605122447014,
0.12813054025173187,
0.34565311670303345,
0.3015771806240082,
0.013363149017095566,
0.07704802602529526,
0.2743116021156311,
-0.016804398968815804,
-0.5200210213661194,
-0.5751024484634399,
-0.08434237539768219,
0.06107717379927635,
-0.5158306956291199,
0.4948061704635... | |
two forms of concurrency. One is the same as for the previous case - within a particular process, the concurrency is cooperative. However, you have a new kind, where multiple processes are running. Your platform's process scheduler might switch execution between these processes at any time, and you have very little con... | [
0.118346206843853,
-0.08729472011327744,
0.05413464456796646,
0.39805975556373596,
0.004753499291837215,
-0.19807997345924377,
0.24431265890598297,
0.17377083003520966,
-0.814731240272522,
-0.44314080476760864,
0.23156940937042236,
0.16193462908267975,
-0.508633017539978,
0.258184909820556... | |
when a second process might come along and try to operate on some shared state. This leads in to the other important area of consideration, how you will actually share state between the processes.
Unlike the single process model, you no longer have any convenient, easily accessed places to store your state where all y... | [
0.19380447268486023,
-0.3355773985385895,
-0.07102449238300323,
0.3135457932949066,
-0.00698361499235034,
0.11478663980960846,
0.48093128204345703,
0.1991027146577835,
-0.49735820293426514,
-0.7943216562271118,
0.09780237078666687,
0.01301916316151619,
-0.4102076590061188,
0.48688235878944... | |
to find an RPC system to let your processes communicate with each other. Or, you might architect your process divide so that each process only receives requests which require state stored in that process. An example of this might be a web site with sessions, where all state about a user is stored in their session, and ... | [
0.3694486916065216,
-0.00220351736061275,
-0.0564197301864624,
0.15381713211536407,
0.026148712262511253,
-0.07172820717096329,
0.23603631556034088,
-0.36261340975761414,
-0.4304771423339844,
-0.4464704990386963,
-0.13146331906318665,
0.19668804109096527,
-0.3931531608104706,
0.41947710514... | |
need to communicate (as long as your web application is sufficiently simple - ie, as long as users don't interact with each other, or operate on shared data).
Note that in that example, a pre-forking model is not appropriate. The front-end process must exclusively own the listening port so that it can inspect all inco... | [
0.17924121022224426,
0.24978625774383545,
0.15916651487350464,
0.22911453247070312,
0.1785244643688202,
-0.22963766753673553,
0.5609089136123657,
-0.13266721367835999,
-0.25818246603012085,
-0.8157515525817871,
-0.14131271839141846,
0.6926782727241516,
-0.4256664216518402,
0.06268580257892... | |
your application's state.
That being said, with very new versions of Twisted (unreleased as of this point), it's quite easy to share a listening TCP port amongst multiple processes. Here is a code snippet which demonstrates one way you might use some new APIs to accomplish this:
```py
from os import environ
from sys ... | [
0.5451581478118896,
0.15343670547008514,
0.4962106943130493,
0.07647339254617691,
-0.1168896034359932,
0.12567287683486938,
0.7345712184906006,
-0.32065483927726746,
-0.1299934983253479,
-0.7997994422912598,
-0.01660466007888317,
0.627180278301239,
-0.4934852719306946,
0.41900211572647095,... | |
other processes to help out.
port = reactor.listenTCP(8080, factory)
for i in range(3): | [
0.2462359070777893,
-0.030613208189606667,
0.4731021523475647,
-0.09940463304519653,
0.016042254865169525,
0.3913896381855011,
0.27706995606422424,
-0.23655559122562408,
-0.17252235114574432,
-0.3196357488632202,
0.1428036391735077,
0.4368518888950348,
-0.10728128254413605,
0.5153898596763... | |
reactor.spawnProcess(
None, executable, [executable, __file__, str(port.fileno())],
childFDs={0: 0, 1: 1, 2: 2, port.fileno(): port.fileno()},
env=environ)
else:
# Another process created the port, just start listening on it. | [
0.5077873468399048,
-0.10411959141492844,
0.3128622770309448,
0.08422591537237167,
0.034605760127305984,
-0.20228199660778046,
0.2027868926525116,
-0.3016679584980011,
-0.03997587040066719,
-0.5836331248283386,
0.2116495668888092,
0.6698107123374939,
0.024320662021636963,
0.696998715400695... | |
port = reactor.adoptStreamPort(fd, AF_INET, factory)
reactor.run()
if __name__ == '__main__':
if len(argv) == 1: | [
0.008976859971880913,
-0.22771108150482178,
0.3603228032588959,
-0.3503676652908325,
0.042818088084459305,
0.2731383740901947,
0.20044560730457306,
-0.16552038490772247,
-0.14788414537906647,
-0.3842388987541199,
0.17405280470848083,
0.3279520273208618,
-0.2774161100387573,
0.6074867844581... | |
main()
else:
main(int(argv[1]))
```
With older versions, you can sometimes get away with using `fork` to share the port. However, this is rather error prone, fails on some platforms, and isn't a supported way to use Twisted:
```py
from os import fork
from twisted.internet import reactor
from twisted.web... | [
0.24940645694732666,
-0.08584184944629669,
0.4629082679748535,
-0.21185117959976196,
-0.08914955705404282,
0.16180352866649628,
0.49292922019958496,
-0.04983994737267494,
-0.2504604756832123,
-0.4375966191291809,
0.1328710913658142,
0.45904800295829773,
-0.5167862772941589,
0.6853164434432... | |
that port
for i in range(3):
if fork() == 0:
# Proceed immediately onward in the children.
# The parent will continue the for loop.
break
reactor.run()
if __name__ == '__main__':
main()
```
This works because of the normal behavior of fork, where the newly cre... | [
-0.05982780084013939,
0.0915781557559967,
0.258403480052948,
-0.20890109241008759,
0.3735503852367401,
-0.06557974219322205,
0.41768908500671387,
-0.1101970300078392,
0.09065677225589752,
-0.34303900599479675,
-0.022640762850642204,
0.2491479516029358,
-0.024981161579489708,
0.777983784675... | |
and file descriptors from the original process (the parent). Since processes are otherwise isolated, the two processes don't interfere with each other, at least as far as the Python code they are executing goes. Since the file descriptors are inherited, either the parent or any of the children can accept connections on... | [
0.01730293594300747,
-0.05350698530673981,
0.142258882522583,
0.18873073160648346,
-0.023701999336481094,
0.016065657138824463,
0.10605206340551376,
0.14098475873470306,
-0.5563786625862122,
-0.6741858720779419,
-0.18590937554836273,
0.34705793857574463,
-0.037326838821172714,
0.4583068490... | |
more of a liability than it's worth accepting. | [
0.07302062213420868,
0.270129919052124,
-0.13675573468208313,
0.12362347543239594,
0.04939808323979378,
-0.06886497884988785,
-0.16066081821918488,
0.1733679473400116,
-0.03439147770404816,
-0.12958022952079773,
0.2587662935256958,
0.24570989608764648,
0.19155022501945496,
0.14173938333988... | |
I have following two arrays. I want the difference between these two arrays. That is, how can I find the values that do not exist in both arrays?
```
$array1=Array ( [0] => 64 [1] => 98 [2] => 112 [3] => 92 [4] => 92 [5] => 92 ) ;
$array2=Array ( [0] => 3 [1] => 26 [2] => 38 [3] => 40 [4] => 44 [5] => 46 [6] => 48 [... | [
0.15113359689712524,
0.3676089346408844,
0.21835005283355713,
-0.18653568625450134,
-0.185878723859787,
0.21126024425029755,
0.3788929581642151,
-0.6878299713134766,
-0.22867082059383392,
-0.6009687185287476,
0.08203812688589096,
0.6749305129051208,
-0.26998957991600037,
-0.018922647461295... | |
[16] => 94 [17] => 96 [18] => 98 [19] => 100 [20] => 108 [21] => 110 [22] => 112);
```
**Note:** this answer will return the values in `$array2` that are not present in `$array1`, it will not return the values in `$array1` that are not in `$array2`.
```
$diff = array_diff($array2, $array1);
```
[`array_diff()`](htt... | [
0.0924411490559578,
0.19590884447097778,
0.3719179928302765,
-0.25604578852653503,
-0.09418436139822006,
0.31335070729255676,
0.36370545625686646,
-0.810554027557373,
-0.04876260086894035,
-0.06642287224531174,
-0.43317437171936035,
0.529537558555603,
-0.3662748336791992,
-0.29939511418342... | |
Can i resize images in python to given height and width,i use python 2.5, and i tried as this tutorial <http://effbot.org/imagingbook/introduction.htm>, and i installed PIL library for images,but when i try to write:
```
import Image
im = Image.open("test.jpg")
```
i got undefined variable from import:open
although ... | [
0.2716361880302429,
0.06509524583816528,
0.46388036012649536,
-0.02252199500799179,
-0.32445886731147766,
0.11734406650066376,
0.31931760907173157,
-0.5295552611351013,
-0.14102865755558014,
-0.5800352692604065,
0.04366281256079674,
0.6875514984130859,
-0.32485365867614746,
-0.259215623140... | |
```
SELECT SUM(bytes),stamp_updated
from acct
where stamp_updated BETWEEN datetime('now', 'localtime','-7 hours') AND datetime('now', 'localtime')
GROUP BY ip_src
ORDER BY bytes DESC limit 10;
```
```
48498275|2012-04-09 11:26:01
6977282|2012-04-09 08:27:01
1192705|2012-04-09 08:46:02
3971336|201... | [
-0.5051625967025757,
0.0274564940482378,
0.26846903562545776,
0.1689457893371582,
-0.03738107532262802,
0.4649503827095032,
0.06127956509590149,
-0.3866695165634155,
-0.8100820183753967,
-0.45695146918296814,
-0.4169418215751648,
0.027527423575520515,
0.06103048473596573,
0.221252620220184... | |
BETWEEN datetime('now', 'localtime','-7 hours') AND datetime('now', 'localtime')
GROUP BY ip_src
ORDER BY total_bytes DESC limit 10;
``` | [
0.2675912380218506,
-0.16560444235801697,
0.7052091956138611,
-0.1193026602268219,
0.600879967212677,
0.039309050887823105,
0.18145081400871277,
0.010166322812438011,
-0.19274716079235077,
-0.5083639025688171,
-0.32970017194747925,
0.3280830383300781,
-0.050968583673238754,
0.3470053672790... | |
Is there a way to sign git commits with gpg? It's so easy with tags (using `-s` instead of `-a`), it seems there would be a similar function for commits.
`git commit -S` (requires git >= 1.7.9). | [
0.3144969046115875,
0.1767268031835556,
0.09023924171924591,
0.12213477492332458,
-0.26710161566734314,
-0.2798773944377899,
0.26270410418510437,
-0.2506588399410248,
-0.2884998619556427,
-0.6949194073677063,
-0.05328424274921417,
0.5847097635269165,
-0.4171938896179199,
-0.064404577016830... | |
Ok, not sure if this is even possible, but I want to change the default color of a selected HTML listbox item. I'm not talking about the background color of the listbox option tag. That can be done through CSS, I get that. I'm talking about the color that overrides that background color when the item is selected. In Ch... | [
0.5595495700836182,
-0.1703292727470398,
0.09228549152612686,
0.04986618831753731,
-0.16804693639278412,
-0.018578387796878815,
0.3730074167251587,
0.21288152039051056,
-0.3367372751235962,
-0.939703106880188,
-0.021296098828315735,
0.5926269292831421,
-0.4405582547187805,
0.04845362156629... | |
but I was hoping someone here might know. Thanks for any help.
Not reliably. The `<select>` element's rendering is controlled by the operating system, so it's not something that's simple to style. Most services that attempt this use JS/HTML/CSS to create pseudo- elements that can be styled at will rather than true `<se... | [
0.575697660446167,
0.0021789756137877703,
0.3734268546104431,
0.1721370816230774,
-0.10174087435007095,
0.04358282685279846,
0.22904793918132782,
0.1458696573972702,
0.026378029957413673,
-0.5273454189300537,
-0.1764259934425354,
0.5363180637359619,
-0.2630220055580139,
-0.0125157497823238... | |
If I have the following data that is printed seperated by tabs using
```
print str(z).translate(None,"([]){},\"'").replace(' ','\t')
0.016611783537845426 0.5728972505882961 0.1723653381777387 0.44730982873820446 10 11 10 0.016611783537845426 0.5728972505882961 0.2526385373738682 0.03281263933004819 1... | [
-0.1356702595949173,
0.23634259402751923,
0.669624388217926,
-0.2651059329509735,
0.03193226084113121,
0.25221139192581177,
0.34173324704170227,
-0.4206002950668335,
0.09424315392971039,
-0.7737419009208679,
-0.2552560269832611,
0.3111684024333954,
-0.4595639109611511,
0.04556802660226822,... | |
[`itertools` documentation](http://docs.python.org/library/itertools.html#recipes):
```
import itertools as it
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return it.izip_longest(fillvalue=fillvalue, *args)
```
Then you can generate th... | [
-0.19119702279567719,
-0.1591033786535263,
0.3973362445831299,
-0.17885351181030273,
0.061769384890794754,
0.16331349313259125,
0.14659477770328522,
-0.3505931496620178,
-0.21233436465263367,
-0.3734361231327057,
-0.5227469205856323,
0.4974827170372009,
-0.5151983499526978,
-0.018688445910... | |
Please bear with me, I'm new at C and I'm trying to program an Arduino. I want to write a program that spits out a data frame of specific length with byte values ranging from 0-255. The minimum code to reproduce the error is in the code block below. When compiling I receive the following error:
> ```
> sketch_apr09b.c... | [
0.13013218343257904,
0.5483771562576294,
0.1579807549715042,
-0.4977187514305115,
-0.1289696991443634,
0.18841367959976196,
0.34093034267425537,
-0.2881629168987274,
-0.12798812985420227,
-0.4979996085166931,
0.22839906811714172,
0.7781361937522888,
-0.3951643407344818,
-0.1645586937665939... | |
0x61 , 0x62 , 0x63
};
return frame;
}
void setup() {
Serial.begin( 115200 );
};
void loop() {
char frame = assembleFrame();
Serial.print( frame );
}
```
When I run a hexdump on the receiving PC, I want to see:
```
00000000 61 62 63 |abc|
00000003
```
I've found... | [
0.4126296043395996,
0.26422634720802307,
0.4088400602340698,
-0.3657040596008301,
0.22273506224155426,
0.19036856293678284,
0.3961004912853241,
-0.17426539957523346,
-0.33291560411453247,
-0.619309663772583,
-0.12320589274168015,
0.4617140591144562,
-0.5211102962493896,
0.4315550625324249,... | |
**EDIT**:
This is what I came up with so far, but receiving wrong data. I think I'm sending the pointer to the actual data with this.
```
byte *assembleFrame() {
byte frame[] = { 4 , 'a' , 'b' , 'c' };
return frame;
}
void setup() {
Serial.begin( 115200 );
};
void loop() {
byte *frame = assembleFrame();
Se... | [
0.40121328830718994,
0.1855039745569229,
0.18925772607326508,
-0.328229159116745,
0.05196911096572876,
0.2606610059738159,
0.33251041173934937,
-0.39606282114982605,
-0.456482470035553,
-0.5131881237030029,
-0.028948893770575523,
0.42911848425865173,
-0.4157291054725647,
0.3583604991436004... | |
(`char` array/pointer), it fails.
Looks like `Serial.print()` can handle a `char *`, which will potentially need to be null-terminated (because it asks for no length specifier).
```
char *assembleFrame() {
char frame[] = {
0x61, 0x62, 0x63, 0x00 // null byte to signify end of string
};
return frame;
}
void... | [
0.41615206003189087,
0.033306870609521866,
0.3051517605781555,
-0.33307698369026184,
0.29862701892852783,
0.2761061191558838,
0.4115111231803894,
-0.4137415587902069,
-0.6258254647254944,
-0.43837031722068787,
-0.036980438977479935,
0.3745853006839752,
-0.45949050784111023,
0.3865832090377... | |
My model class:
```
public class StatusList
{
public int StatusID {get;set;}
[UIHint("ByteCheckbox")]
public byte Active {get;set;}
}
```
In /Views/Shared/EditorTemplates I created a file called ByteCheckbox.cshtml
The editortemplate ByteCheckbox contains (My 3rd attempt):
```
@model byte
@if (Model == 1)... | [
-0.09584373980760574,
-0.0032335894647985697,
0.6079990267753601,
-0.1171666607260704,
-0.06512937694787979,
-0.031044019386172295,
0.3475765883922577,
-0.24732689559459686,
-0.09022492170333862,
-0.707318902015686,
0.15578393638134003,
0.6164596080780029,
-0.3272657096385956,
0.1118846684... | |
@Html.LabelFor(model => model.Active)
</div>
<div class="editor-field">
@Html.CheckBoxFor(model => model.Active != 0)
@Html.ValidationMessageFor(model => model.Active)
</div>
```
You can do this in your model:
```
public class StatusList
{
public int StatusID {get;set;}
public byte Active {get;set;}
... | [
-0.14184316992759705,
-0.31615540385246277,
0.691321849822998,
-0.24065500497817993,
0.15066875517368317,
0.024162346497178078,
0.24496707320213318,
-0.4776943027973175,
-0.30964696407318115,
-0.5044680833816528,
-0.20031070709228516,
0.543632984161377,
-0.3631678819656372,
-0.225493490695... | |
We have an application that allows users to add/edit/replace/delete content (text, images, swfs, mp3s, etc). We want the admins to always have the latest updated files by using a no-cache header and when a user runs the application, everything gets/uses the cache.
I have looked into solutions and have tried using htm... | [
0.40219682455062866,
0.05945712700486183,
0.5959343314170837,
0.2169189453125,
0.03256716579198837,
-0.22610323131084442,
0.24084588885307312,
-0.11127597838640213,
-0.22075927257537842,
-0.7501416206359863,
-0.2666281759738922,
0.49613457918167114,
-0.3278345465660095,
0.2408844381570816,... | |
and came across this code for [this site](http://www.askapache.com/htaccess/using-http-headers-with-htaccess.html):
```
<filesMatch "\.(html|htm|js|css)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Hea... | [
-0.1314428597688675,
0.3829118609428406,
0.4465579390525818,
0.09351398050785065,
0.010473629459738731,
-0.3833361864089966,
0.5869675874710083,
-0.02742370218038559,
-0.2896696627140045,
-0.41047540307044983,
0.00880874041467905,
0.52444988489151,
-0.3194027543067932,
0.2832638919353485,
... | |
the same content and media through an iframe. For example, they each look like:
```
<%
//Some JSP
%>
/* HTML Headers, JS, ETC */
<iframe id="contentFrame" seamless="1" src="http://somedomain.com/template.html"></iframe>
/* End HTML */
```
preview.jsp and run.jsp appear in the same directory and use all the same reso... | [
0.12555699050426483,
-0.026466242969036102,
0.44800063967704773,
0.1643565148115158,
-0.2834480106830597,
-0.27632343769073486,
0.01968679018318653,
-0.11317833513021469,
-0.27771517634391785,
-0.9245136380195618,
-0.06513107568025589,
0.26154398918151855,
-0.31938982009887695,
0.098221905... | |
like that (since `using` is only about *names*), but it should be enough to make the desired specialization visible. | [
0.4117397367954254,
0.0560629777610302,
-0.11566770821809769,
-0.022015124559402466,
0.25517892837524414,
-0.189015731215477,
0.18314756453037262,
0.26162004470825195,
-0.27112865447998047,
-0.7005311250686646,
-0.5230401754379272,
0.588090181350708,
-0.14593303203582764,
-0.10781680047512... | |
What Server Role(s) and/or Database Role(s) must a SQL Login have to do the following:
1. Read Data (including Temp tables)
2. Write Data (including Temp tables)
3. Execute any SP within a database which they are granted access
We are migrating from SQL 2000 to 2008 and I'm going through all the Logins and have notic... | [
0.18467044830322266,
0.20447051525115967,
0.6310039162635803,
-0.03335626423358917,
-0.3177574872970581,
-0.1716647446155548,
0.2932043671607971,
-0.2949797213077545,
-0.24023529887199402,
-0.6653861999511719,
0.1930728256702423,
0.3308046758174896,
-0.3334617614746094,
0.14069317281246185... | |
include executing SP's. We've got close to 300 SP's in 2 or our DB's and to have to go through each SP and set the login permissions in the Extended Properties would be WAY too long and tedious.
Any help is greatly appreciated!
I would either just deal with it and set the permissions manually or (my preference) create... | [
0.45327773690223694,
-0.06568831205368042,
-0.10603530704975128,
0.19734664261341095,
-0.05736781656742096,
-0.37331950664520264,
0.41674867272377014,
-0.4156111776828766,
-0.39071324467658997,
-0.45416948199272156,
-0.19360212981700897,
0.5189366340637207,
-0.3313031792640686,
-0.30121427... | |
sort of prefix naming convention so that (for example) procedures that read from your login information tables all start with something like pAccount\_ or something, then you can dynamically do `GRANT`s to roles based on the prefix of the routine. | [
0.2009461373090744,
-0.45403605699539185,
-0.06432245671749115,
0.17508402466773987,
0.11660397052764893,
0.02211662568151951,
0.13570594787597656,
-0.07150601595640182,
-0.2474064975976944,
-0.4223632514476776,
-0.12767715752124786,
0.4266432523727417,
-0.21634404361248016,
-0.03465314209... | |
I'm developing an app on my local pc. THe frontend should be built with spinejs and the backend-api with node.js.
Spine is running on port 9294 and node.js is running on port 3000.
in Spine I've added to my model the following:
```
@url: "http:localhost:3000/posts"
```
and in my express server
```
app.get('/posts',... | [
0.2133336365222931,
0.3456752896308899,
0.8697189092636108,
-0.007232569623738527,
-0.049522463232278824,
0.20596559345722198,
0.2818480134010315,
-0.3020036518573761,
-0.159810870885849,
-0.9409964680671692,
-0.12761877477169037,
0.5559212565422058,
-0.37577003240585327,
0.010399410501122... | |
to `GET` requests. If the browser is preflighting it with an `OPTIONS` request, express will send an error because it doesn't have any listeners for those requests. Try adding this code in addition to yours and see if it works:
```
app.options('/posts', function(req, res){
console.log("writing headers only");
res.... | [
0.13213419914245605,
-0.10834132134914398,
0.6603277325630188,
0.11499392241239548,
0.2825731635093689,
-0.1252126544713974,
0.5606867074966431,
-0.12814871966838837,
0.04302948713302612,
-0.8351099491119385,
-0.49367088079452515,
0.7186859250068665,
-0.3709785044193268,
-0.076736412942409... | |
cookies, then it is more likely that you will want to actually check that the `origin` is an allowed website in order to avoid [CSRF attacks](https://en.wikipedia.org/wiki/Cross-site_request_forgery). | [
0.4090034067630768,
0.3180381953716278,
0.11031804978847504,
0.29886525869369507,
0.02500929683446884,
-0.6848285794258118,
0.41743260622024536,
0.1377572864294052,
-0.18280820548534393,
-0.4899548590183258,
-0.2838835120201111,
0.09409793466329575,
-0.0204432625323534,
0.1720837652683258,... | |
I have the following function that I want to run as parallel tasks:
```
void WuManberFinder::find()
```
so I wrote the following:
```
void WuManberFinder::Parallel_find()
{
tbb::task_group g;
for(auto i = 0; i != tbb::tbb_thread::hardware_concurrency(); ++i)
{
g.run(find);
}
g.wait();
}
```
but it... | [
-0.07790511846542358,
0.2746099531650543,
0.6470946073532104,
0.04596768319606781,
0.1603272706270218,
0.2931136190891266,
0.2480522245168686,
-0.4724441468715668,
-0.23308254778385162,
-0.6024224758148193,
0.06905017793178558,
0.6888118982315063,
-0.5252019166946411,
0.20775096118450165,
... | |
{
while(m_pos <= m_text2.size()) {
string bgram = m_text2.substr(m_pos - m_B, m_B);
shift_type::iterator i = m_shift.find(bgram);
if (i == m_shift.end())
{// shared variable lock
m_pos += m_lmin - m_B + 1;
}// unlock | [
-0.26149529218673706,
-0.24680320918560028,
0.49539947509765625,
-0.23018556833267212,
0.5068429112434387,
0.1349799484014511,
0.16299530863761902,
-0.5480875968933105,
-0.2122916281223297,
-0.03813258931040764,
-0.45118871331214905,
0.6085364818572998,
-0.3558529019355774,
0.2088521569967... | |
else {
if (i->second == 0) {
vector<size_t>& list = m_hash[bgram];
// Verify all patterns in list against the text.
//shared variable lock
++m_pos;
//unlock | [
0.235582172870636,
-0.2615332007408142,
0.3395237326622009,
-0.17916424572467804,
0.19924910366535187,
-0.05300481244921684,
0.3185131847858429,
-0.6024341583251953,
-0.41261109709739685,
-0.47969648241996765,
-0.14362749457359314,
0.4825909733772278,
-0.4284122586250305,
-0.14574624598026... | |
for (size_t j = 0; j < list.size(); ++j) {
string const& str = m_patterns[list[j]];
m_find_pos = m_pos - str.size() - 1;
size_t k = 0;
for (; k < str.size(); ++k) | [
-0.015673279762268066,
-0.38508695363998413,
0.5880278944969177,
-0.6546488404273987,
0.18695823848247528,
0.36443451046943665,
0.451052725315094,
-0.4771359860897064,
-0.4501776397228241,
-0.4652431607246399,
-0.4879383146762848,
0.5555853247642517,
-0.6445118188858032,
-0.100362017750740... | |
if (str[k] != m_text2[m_find_pos + k])
break;
if (k == str.size()) {
m_find_pattern_index = list[j]; | [
-0.23171572387218475,
-0.14137201011180878,
0.28475815057754517,
-0.5369332432746887,
0.5071540474891663,
-0.26058170199394226,
0.5823938250541687,
-0.2068587690591812,
-0.3513656556606293,
-0.30487555265426636,
-0.8373768329620361,
0.4814891815185547,
-0.43115857243537903,
-0.084570281207... | |
// cout << "***" << m_patterns[m_find_pattern_index] <<endl;
// return true
// shared variable lock
m_intrusions++;
// unlock | [
-0.03557867184281349,
-0.07299188524484634,
0.412882924079895,
-0.15353713929653168,
0.36015233397483826,
-0.15492579340934753,
0.2591474652290344,
-0.35004502534866333,
-0.18347187340259552,
-0.29502972960472107,
-0.4300393760204315,
0.5012311935424805,
-0.45216992497444153,
0.31346565485... | |
}
}
}
else
{ // access m_pos shared critical section
m_pos += i->second;
} // access m_pos shared critical section
}
}
// return | [
-0.4915010929107666,
-0.30076852440834045,
0.10107895731925964,
-0.027007272467017174,
0.05315956473350525,
0.22020223736763,
-0.1681298166513443,
-0.10533421486616135,
-0.0549917109310627,
-0.6640567779541016,
-0.142610102891922,
0.4186820387840271,
-0.2592889368534088,
0.1025955155491828... | |
false; nothing found
}
```
I know this might seem weird, but the main idea is I want multiple tasks of this type to traverse a string. The shared variable is `pos`. Could you give me a hint?
`app.get` will only respond to `GET` requests. If the browser is preflighting it with an `OPTIONS` request, express will ... | [
0.03011670708656311,
-0.13602639734745026,
0.22994305193424225,
0.02379734255373478,
0.24762095510959625,
0.021811220794916153,
0.854705810546875,
0.002836242550984025,
-0.2020060271024704,
-0.7923246622085571,
-0.10599767416715622,
0.5974127054214478,
-0.447336345911026,
-0.17561985552310... | |
with the request (`withcredentials=true`), then the `Access-Control-Allow-Origin` header cannot be `*`, it must be the exact value in the `Origin` header that the browser automatically adds to the ajax request like so:
```
res.header("Access-Control-Allow-Origin", req.headers.origin);
```
This is for security reason... | [
0.29582440853118896,
0.036184266209602356,
0.3518086075782776,
0.15225236117839813,
0.017691457644104958,
-0.4934919476509094,
0.37741416692733765,
0.02631295472383499,
-0.006919596344232559,
-0.6956780552864075,
-0.5423089265823364,
0.2654123902320862,
-0.22867028415203094,
0.138533145189... | |
I have an interface like this:
```
public interface IUser{
//some properties here
T ToDerived(User u);
}
```
I'm new to interface development, so here's what I'm trying to accomplish. I will have a base class
```
public class User
```
that does NOT implement the above interface. Then I will have a deri... | [
0.011671810410916805,
0.24105672538280487,
0.7703615427017212,
-0.06804908066987991,
-0.23518790304660797,
0.06790630519390106,
-0.1111067458987236,
-0.15547987818717957,
0.045198943465948105,
-0.8878016471862793,
0.1510760486125946,
0.6326707005500793,
-0.1984955370426178,
0.2169599384069... | |
}
}
```
I would like to write the function for ToDerived(User u) in the SalesUser class, but in the interface, I do not know how to define this as the ToDerived method declaration that I have now in the interface is not compiling.
I hope this makes sense.
```
public interface IUser<T> where T : User
{
//some pro... | [
-0.19737350940704346,
0.356900691986084,
0.8049554824829102,
-0.09225621819496155,
-0.03657977283000946,
-0.04652479290962219,
0.10418117046356201,
-0.0425623394548893,
-0.04957085847854614,
-0.6557484865188599,
-0.08694922178983688,
0.8517541885375977,
-0.14263904094696045,
0.315922886133... | |
a base User to a derived SalesUser
}
}
```
Not sure this is what you want, but I added a generic type constraint on the interface to ensure that the generic type is `User` or inherits from it. | [
0.3016871511936188,
-0.035036832094192505,
0.4181438982486725,
-0.10580291599035263,
-0.05581524595618248,
-0.3136834502220154,
-0.12700830399990082,
0.006252416409552097,
0.2800171375274658,
-0.3008066713809967,
-0.039697691798210144,
0.6186880469322205,
-0.4571162760257721,
0.30183133482... | |
I've been wondering why do some languages, such as Java run on Both Linux with little or no modification of the code, but other languages you have to nearly re-write all the code. Why is this? Because of the Kernel?
Sorry if this is a simple question but, I really don't have much of a clue.
Also, what's the differen... | [
0.2476286143064499,
0.2001412957906723,
-0.33262187242507935,
0.030674250796437263,
-0.12095732986927032,
-0.23795382678508759,
0.32166069746017456,
0.5936765670776367,
-0.42190343141555786,
-0.6797317266464233,
0.22611737251281738,
0.32381436228752136,
-0.5092299580574036,
0.0677182003855... | |
not run on any operating system.
It runs directly on the machine. It only works on one type of machine - the Java Virtual Machine. Fortunately, the Java Virtual Machine has been virtualized onto Linux, Windows, Mac, etc. | [
0.40231892466545105,
-0.13314877450466156,
0.18634474277496338,
0.14787182211875916,
0.28116410970687866,
-0.33257919549942017,
0.38405564427375793,
0.6446442604064941,
0.05704093351960182,
-0.5585083365440369,
-0.26722532510757446,
0.44807910919189453,
-0.4620358943939209,
0.1447379589080... | |
I want to be able to extract text from text files as tokens - for example, say I have a text file that contains the sentence:
It's a good restaurant,
believe me!
I want to extract the contents of this as 'tokens' - for example, one token would be "It's", the next token would be " ", the one after that would be "a", ... | [
0.3538372218608856,
0.6327012777328491,
0.19973626732826233,
-0.3480817973613739,
-0.09803785383701324,
0.29033491015434265,
0.17583535611629486,
0.3183880150318146,
0.06601791828870773,
-0.36411139369010925,
-0.18831105530261993,
0.3106949031352997,
0.25882434844970703,
-0.182896956801414... | |
so far (I check to see if the token is a word or not elsewhere in the program, this method just returns the next token):
```
public Token next() {
if (c == -1) {
throw new NoSuchElementException();
}
Writer sw=new CharArrayWriter();
try {
while ( c != -1 && Character.isLetter(c) ) {
... | [
0.03801662102341652,
-0.05570520460605621,
0.4863548278808594,
-0.4347962737083435,
0.2889181673526764,
0.13710227608680725,
0.4378233551979065,
-0.42316439747810364,
-0.1457669883966446,
-0.5328898429870605,
-0.25239628553390503,
0.5144273638725281,
0.08108211308717728,
0.3800961673259735... | |
}
while ( c != -1 && !Character.isLetter(c)) {
c = r.read();
}
} catch (IOException e) {
c = -1;
return null;
}
return null;
}
```
Right now I have the return values as 'null' because I'm not sure how to use the writer to export it | [
0.06810786575078964,
0.1700720340013504,
0.23839978873729706,
-0.3938130736351013,
0.2490558624267578,
0.24126823246479034,
0.46555963158607483,
-0.20211030542850494,
-0.08212900906801224,
-0.13324964046478271,
-0.24515852332115173,
0.6639675498008728,
-0.28605425357818604,
0.2231620699167... | |
as tokens. Does anyone have any tips for this? Thank you!
You write:
> When attempting to use ldap\_connect(), I get this error:
>
>
> Fatal error: Call to undefined function ldap\_connect()
You get this error because the function [`ldap_connect`*Docs*](http://php.net/ldap_connect) is not defined. You can not call... | [
-0.011453275568783283,
-0.09957418590784073,
0.21058891713619232,
0.12921635806560516,
-0.11628153920173645,
-0.35545575618743896,
0.2458607256412506,
-0.15292370319366455,
-0.16607679426670074,
-0.8522984981536865,
0.07133624702692032,
0.7918506264686584,
-0.46037378907203674,
-0.10531505... | |
configuration option when compiling PHP to enable LDAP support. DIR is the LDAP base install directory.
However, normally it's enough to just install what you need via the package manager, e.g. try:
```
# yum install php-ldap
```
If it's not enough and you actually need to edit your PHP configuration (not always ne... | [
0.12753139436244965,
-0.33589380979537964,
0.10824397951364517,
0.004840037785470486,
-0.13671189546585083,
-0.4713951051235199,
0.10039028525352478,
0.14912192523479462,
0.03899770975112915,
-0.894940197467804,
-0.022314799949526787,
0.9543756246566772,
-0.38864871859550476,
-0.0997468531... | |
I have read that sizeof operator in C is interpreted at compile time and since at compile time compiler knows the array size and its type,sizeof is abled to compute the number of bytes occupied by array.But how is sizeof working for the following code :
```
#include<stdio.h>
#include<string.h>
int main()
{
int... | [
-0.025017904117703438,
0.016027744859457016,
0.35815632343292236,
-0.36483195424079895,
0.07816562801599503,
0.003987753298133612,
0.3352988660335541,
-0.479789674282074,
-0.30156391859054565,
-0.5598713755607605,
-0.125555619597435,
0.6644600629806519,
-0.2919575273990631,
-0.018963046371... | |
in C89. Since C99 and variable length arrays, it is computed at run time when a variable length array is part of the expression in the `sizeof` operand.
Same for the evaluation of the `sizeof` operand: it is not evaluated in C89 but in C99 if the operand is of variable length array type it is evaluated. For example:
... | [
-0.2815456688404083,
-0.0549049973487854,
0.47294023633003235,
-0.30306074023246765,
0.02014993131160736,
-0.03570663183927536,
0.38753020763397217,
-0.298180490732193,
-0.06176129728555679,
-0.033764682710170746,
-0.25165843963623047,
0.5113696455955505,
-0.32623034715652466,
-0.101649343... | |
If I have the following directory structure:
```
parent/
- __init__.py
- file1.py
- child/
- __init__.py
- file2.py
```
In file 2, how would I import file 1?
**Update**:
```
>>> import sys
>>> sys.path.append(sys.path.append('/'.join(os.getcwd().split('/')[:-2])))
>>> import parent
>>> ... | [
0.05579030141234398,
0.02646522969007492,
0.3324258029460907,
-0.25222641229629517,
0.33111265301704407,
0.000950097106397152,
0.06869702786207199,
-0.2787628769874573,
0.08085700124502182,
-0.8714317679405212,
-0.2133423089981079,
0.44723621010780334,
-0.10575029253959656,
0.3671485781669... | |
```
require 'open-uri'
print "Enter a URL"
add = gets
open(#{add}) do |f|
j = f.read.scan(/<img/)
jlen = j.length
puts jlen
end
```
Is the code I have.
For some reason, ruby is giving me the error:`findimages.rb:8: syntax error, unexpected kEND, expecting $end`
Why is this?
`#{}` works only inside interpolated ... | [
0.1422041654586792,
0.36047327518463135,
0.46935805678367615,
-0.3966350257396698,
0.01719137839972973,
-0.25656047463417053,
0.5839815735816956,
-0.2804032862186432,
0.02809671312570572,
-0.43616756796836853,
-0.2835300862789154,
0.4845653772354126,
-0.4129813313484192,
0.0849976241588592... | |
I have a site that gets a user data on logging in.
this data is saved by mysql as a string, and after calling this string with ajax, I split the data by js function: str.split().
this returns an array with all the id's of the btns I would like to check, and with the ".each" call I check all matched btns.
the big proble... | [
0.7151857614517212,
0.10256180167198181,
0.32107388973236084,
-0.190057173371315,
-0.1736687272787094,
0.03549550101161003,
0.22730395197868347,
-0.19985561072826385,
-0.24652822315692902,
-0.8858729004859924,
0.02551881968975067,
0.400069922208786,
-0.146519273519516,
0.056254759430885315... | |
type: "post",
url: "ajax/get_saved_list.php",
success: function(data){
list=data.split(";");
for(j=0; j<list.length-1; j++){
$(".content #"+list[j]).siblings('a').trigger('click');
}
setTimeout("$('#save').hide()", 1); | [
0.11428207159042358,
-0.33908170461654663,
0.4171524941921234,
-0.07429638504981995,
0.011448943987488747,
0.14938686788082123,
0.39561641216278076,
-0.3620879352092743,
-0.0682796761393547,
-0.31452223658561707,
-0.5404101610183716,
0.5551866292953491,
-0.26458635926246643,
0.238890126347... | |
}
});
}
```
some of the html include the 'a' that is triggered:
```
<ul class="content"><li>
<a class="third_cat_chb cat_chb_off"></a><span>page</span>
<button id="page_<?php echo $row['page']."Z"; ?>chapter_<?php echo $row['s_id'];?>" style="width: 20px; margin-right... | [
-0.08646916598081589,
-0.14051149785518646,
0.6126397252082825,
-0.3827052116394043,
-0.3464285135269165,
-0.1417357176542282,
0.32830920815467834,
-0.5249025821685791,
-0.2587357461452484,
-0.4596090018749237,
-0.39749202132225037,
0.37028810381889343,
-0.36209189891815186,
0.095500595867... | |
which is slower.
Try this selector instead: `$("#"+list[j])`
I was able to loop through 1000 items and trigger a click in about 1 second, rather than 4-5 seconds by doing a class first.
It would also help if you could put an ID on the actual `<a>` that you want to click so that you can avoid the call to siblings(), ... | [
0.23176652193069458,
-0.33764737844467163,
0.09256390482187271,
0.1053868904709816,
-0.13974004983901978,
0.15645678341388702,
0.4871797561645508,
-0.3770349323749542,
-0.15905195474624634,
-0.43937012553215027,
0.2599242627620697,
0.23269003629684448,
0.18774916231632233,
0.02117139473557... | |
I need a C# implementation of something similar with ByteBuffer from Java. Methods of interest
- .remaining() - returns the number of elements between the current position and the limit.
- .array()
- .clear()
- .put(byte[], int, int)
I started something with `MemoryStream`.. but no `clear()`, and a lot of improvisati... | [
-0.09501931816339493,
-0.0591052770614624,
0.3456609845161438,
-0.14051011204719543,
0.08661337941884995,
-0.11165352165699005,
0.011335880495607853,
-0.16230408847332,
-0.3169664442539215,
-0.39445868134498596,
0.014961848966777325,
0.5410704612731934,
-0.27362868189811707,
-0.07132638990... | |
static class MemoryStreamExtensions
{
public static void Clear(this MemoryStream stream)
{
stream.SetLength(0);
}
public static int Remaining(this MemoryStream stream)
{
return stream.Length - stream.Position;
}
}
``` | [
-0.10584469139575958,
-0.49133050441741943,
0.4932083189487457,
-0.12788957357406616,
0.4748629927635193,
-0.0482226125895977,
-0.037182971835136414,
0.15029732882976532,
-0.11995583772659302,
-0.22809982299804688,
-0.381247341632843,
0.5914625525474548,
-0.38971683382987976,
0.32974213361... | |
In TSQL, if I'm searching for valid .com email addresses, I need to make sure there's an @ sign, it ends in .com, and there's at least one character before and after the @.
```
SELECT * FROM CUSTOMER WHERE [EMAIL] LIKE '%@%.com';"
```
I don't believe the above query would satisfy the requirement of ensuring that the... | [
0.10230722278356552,
-0.00967594888061285,
0.5838286876678467,
-0.08962543308734894,
-0.24067352712154388,
-0.03420494496822357,
0.054810747504234314,
0.14739078283309937,
-0.14646776020526886,
-0.5239976048469543,
-0.21938782930374146,
0.02202756144106388,
-0.16220541298389435,
-0.0504030... | |
to match a mandatory single character in conjunction with `%` to match optional additional ones.
```
LIKE '_%@_%.com';"
``` | [
0.3114287257194519,
0.27019280195236206,
0.16410592198371887,
-0.21157771348953247,
0.13488171994686127,
0.09559740871191025,
-0.06680397689342499,
0.14420753717422485,
0.11927124857902527,
-0.24079851806163788,
-0.5138341188430786,
0.3442968428134918,
-0.27545735239982605,
-0.105267807841... | |
I am working on a school project (if you couldn't figure that out just by the fact that I'm using MIPS and QTSpim), and my group chose to make a calculator for large (128-bit) numbers. We know how to do operations on 128-bit numbers, but what we're having trouble with is having the user input.
The professor doesn't qu... | [
0.08172603696584702,
0.39370492100715637,
0.13305890560150146,
0.18412256240844727,
0.32676970958709717,
0.3317536413669586,
0.025231236591935158,
-0.12903860211372375,
-0.37122058868408203,
-0.4638846814632416,
0.15616244077682495,
0.581649899482727,
-0.051389265805482864,
-0.110698550939... | |
way to make that happen?
Thanks!
I would:
* Read the user input as a string
* Convert the ASCII codes of the each digit to a number 0-9 (i.e. subtract '0')
* Apply a radix conversion from base 10 to base 2, and hold the results in four 32 bit words | [
0.38970300555229187,
0.3431568741798401,
0.28294482827186584,
0.001650958089157939,
-0.019735991954803467,
0.5736399292945862,
0.2871651351451874,
-0.10532951354980469,
-0.1628313958644867,
-0.34496238827705383,
0.03366238623857498,
0.2833372950553894,
-0.08787281811237335,
-0.027904890477... | |
I have set of 6 elements and I would like to filter by every second and third element so I want to have elements 2, 3, 5 and 6. I've tried `.filter(':nth-child(2n+1)'));` but obviously that filters the 2, 4, and 6.
The other way I was trying was to remove elements 1 and 4, but I couldn't find a jQuery function that wa... | [
0.07381577044725418,
0.0703827440738678,
0.16354192793369293,
-0.42553436756134033,
-0.2630118727684021,
0.19989195466041565,
0.2514382004737854,
-0.5892949104309082,
0.06853289902210236,
-0.532617449760437,
-0.08553535491228104,
0.238348126411438,
-0.4044307768344879,
0.050885044038295746... | |
one of these should work:
```
.filter(':nth-child(3n+2), :nth-child(3n+3)'));
.filter(':not(:nth-child(3n+1))');
``` | [
-0.32019704580307007,
-0.15885795652866364,
0.11106951534748077,
-0.2745952010154724,
-0.0580170638859272,
0.1900027096271515,
0.27527111768722534,
-0.47689929604530334,
0.18018530309200287,
-0.8157749772071838,
-0.5130816102027893,
0.37042656540870667,
-0.3272201418876648,
0.0045778783969... | |
For some reason i can't get the variable 'total' to define at all...
I defined it on like 74 but it does't want to stick for some reason.. what am i doing wrong? Thanks in advance!
```
$(document).ready(function() {
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]... | [
0.14265823364257812,
-0.29225775599479675,
0.929367184638977,
0.05497971177101135,
0.1354471892118454,
-0.04481400176882744,
0.3906247317790985,
-0.3270014822483063,
-0.29673030972480774,
-0.4660249948501587,
-0.2695939242839813,
0.6536650061607361,
-0.21879106760025024,
0.1997853219509124... | |
if(results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
$(".tab-content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab-content:first").show(); //Show first tab content
... | [
0.01037870068103075,
-0.29990845918655396,
0.5240511298179626,
-0.27726462483406067,
-0.03629554808139801,
-0.09488951414823532,
0.2816144824028015,
-0.4732235074043274,
0.04693717882037163,
-0.36915823817253113,
-0.8045767545700073,
0.5669118762016296,
-0.6112104058265686,
0.0105331018567... | |
var activeClass = activeTab.substr(5);
$("ul.tabs li").removeClass("active");
$('ul li:nth-child('+activeClass+')').addClass("active"); //Add "active" class to selected tab
$(".tab-content").hide(); //Hide all tab content
$(activeTab).fadeIn(); //Fade in the active ID content
$... | [
0.10112568736076355,
-0.6568317413330078,
0.6709330677986145,
-0.34233030676841736,
0.1929088532924652,
0.33317282795906067,
0.4684847593307495,
-0.586868166923523,
0.1391858160495758,
-0.5859779715538025,
-0.19389024376869202,
0.6738942861557007,
-0.6829960346221924,
0.053621575236320496,... | |
$('.meter-value').attr('style', 'background-color: #9496c9; width: 46.5%;');
break;
case '3' :
$('.meter-value').attr('style', 'background-color: #9496c9; width: 67%;');
break;
case '4' : | [
-0.08668946474790573,
0.06037916988134384,
0.781989574432373,
0.2641429305076599,
0.2231936752796173,
0.384350061416626,
0.41305848956108093,
-0.4873926341533661,
-0.2250756174325943,
-0.29683560132980347,
-0.4882464110851288,
0.6741086840629578,
-0.2877512276172638,
-0.191115602850914,
... | |
$('.meter-value').attr('style', 'background-color: #9496c9; width: 100%;');
break;
}
return false;
});
$('.quantity, .init_cost').change(function() {
var row_id = $(this).attr('id');
var row_number = row_id.substr(9);
var item_cost = $('#cost_'+row_num... | [
0.04447459056973457,
-0.25651681423187256,
0.8153958916664124,
-0.057837627828121185,
0.2520870268344879,
0.6291058659553528,
0.10483190417289734,
-0.655019998550415,
-0.20196571946144104,
-0.35265588760375977,
-0.3672144412994385,
0.6931819915771484,
-0.46994462609291077,
0.48335707187652... | |
var final_cost = item_cost * item_quantity;
$('#final_cost_'+row_number).val(final_cost).formatCurrency();;
});
$('.row input').each(function(index) {
var row_id = $(this).attr('id');
var row_number = row_id.substr(9);
var item_cost = $('#cost_'+row_number).attr('value');
... | [
-0.25650981068611145,
-0.19616736471652985,
0.8077031373977661,
-0.0500933937728405,
0.08474931120872498,
0.8512037992477417,
0.048059653490781784,
-0.455941379070282,
0.0242628064006567,
-0.4870530366897583,
-0.6190611720085144,
0.8849330544471741,
-0.21229037642478943,
0.4464588761329651... | |
var total = 0;
$('.final_cost').each(function(index) {
var final_cost = $(this).attr('value').substr(1);
var total = total + final_cost;
console.log(total);
})
});
```
The `total` in the each function is shadowing the outer one.
A simpler example of the same thin... | [
0.08958021551370621,
-0.34526410698890686,
0.6959378719329834,
-0.33363014459609985,
0.03774626553058624,
0.30364832282066345,
-0.09212005883455276,
-0.3466298580169678,
-0.3064477741718292,
-0.28312262892723083,
-0.10334672778844833,
0.6908362507820129,
-0.16597235202789307,
0.39722183346... | |
+ total);
(function()
{
console.log("total 2: " + total);
var total = total + 3;
console.log("total 3: " + total);
})()
})();
```
In addition to the shadowing, you have to consider [hoisting](http://www.adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting). Because... | [
0.09675592929124832,
-0.24670879542827606,
0.8813988566398621,
-0.24250517785549164,
-0.019230959936976433,
0.06068648397922516,
0.07565170526504517,
-0.6429969668388367,
-0.652092695236206,
0.13580261170864105,
-0.26394882798194885,
0.5408262610435486,
-0.32595154643058777,
-0.03128674626... | |
" + total);
total = total + 3;
console.log("total 3: " + total);
}
```
In this case, I think you simply don't want the inner `var` keyword. In other cases, you would use a different variable name. | [
0.07678479701280594,
-0.13719283044338226,
0.3039429783821106,
-0.4277566969394684,
-0.09607446938753128,
-0.07478426396846771,
0.1927829384803772,
-0.30311986804008484,
-0.19764380156993866,
-0.10727251321077347,
-0.19111064076423645,
0.7975240349769592,
-0.244430273771286,
0.279814600944... | |
In Java util logging, I initiate the handler on init(), and close the handler at destroy() and it works perfectly fine: A log file was created, etc. If the user refreshs the page normally, it still just creates one log file.
However if the user refreshs the page with the applet a couple of times fast, it seems like th... | [
-0.06202203780412674,
-0.12206520885229111,
0.08626288175582886,
-0.558170735836029,
-0.16581325232982635,
-0.19148671627044678,
0.48429927229881287,
-0.32316598296165466,
-0.005290705244988203,
-0.5878829956054688,
-0.1959703266620636,
0.6592729091644287,
-0.47969913482666016,
-0.24015550... | |
the handler but it does not work.
Anyone has any idea how to solve this issue?
Another minor question is: What actually happened if init() has not finished and the page gets refreshed. Is it going to continue the process and eventually failes to call destroy() or does it just stop right there?
Quote from [Java Tutoria... | [
0.28859513998031616,
-0.028511259704828262,
0.026587149128317833,
0.0236415583640337,
-0.18092718720436096,
-0.1773359477519989,
0.5466248393058777,
-0.11793752759695053,
-0.11489945650100708,
-0.48060140013694763,
0.2213866114616394,
0.47817638516426086,
-0.4807661771774292,
-0.0114604160... | |
handler each time in "init"-method. If it's true, you should use one static shared logger (check this [link](https://stackoverflow.com/questions/8915448/using-synchronization-while-logging)). It will help to improve situation a bit, but if you start more than one browser with your applet - new log file still will be cr... | [
0.22152668237686157,
-0.24778683483600616,
0.19333097338676453,
-0.05971153452992439,
-0.04319097101688385,
-0.17173337936401367,
0.5285840630531311,
-0.5105736255645752,
-0.22428621351718903,
-0.48339778184890747,
-0.13509953022003174,
0.6113756895065308,
-0.5127465128898621,
-0.083096027... | |
For Applet Development](http://download.java.net/jdk8/docs/technotes/guides/jweb/applet/best_practices.html).
---
Answer to your minor question (**changed**):
According to discussion of this [old bug](http://bugs.sun.com/view_bug.do?bug_id=6840201) in java plugin, applet could be terminated at any moment with some p... | [
-0.029486190527677536,
0.2659487724304199,
0.41253209114074707,
-0.2858060300350189,
0.3337990343570709,
-0.08273110538721085,
0.6078122854232788,
-0.0878131091594696,
-0.5676494240760803,
-0.7810792922973633,
-0.5069458484649658,
0.6609634160995483,
-0.3158944845199585,
0.0605032816529274... | |
old plugin and 200ms in new
> plugin) for applet to stop. | [
-0.37795302271842957,
0.05751236900687218,
0.5855728387832642,
-0.21234315633773804,
0.3327464461326599,
0.0696338564157486,
0.7280644774436951,
0.15092885494232178,
-0.18903304636478424,
-0.6943224668502808,
-0.40955379605293274,
0.6861621737480164,
-0.4638868272304535,
0.116061732172966,... | |
I currently have an app deployed on Heroku which runs on two web dynos so it won't go to sleep if it remains inactive for a certain time.
Now if I scale it down to only one web dyno (free) and instead pay for one worker dyno, will Heroku always keep my app active?
It will still idle - you *NEED* to have more than a s... | [
0.47147199511528015,
-0.08827825635671616,
0.4372972249984741,
0.3666481077671051,
-0.41270846128463745,
0.2708429992198944,
0.14072446525096893,
-0.20174187421798706,
-0.4355173408985138,
-0.5042948126792908,
-0.13388308882713318,
0.5831660032272339,
-0.041352950036525726,
0.1302856951951... | |
I have the following table. The header is at it looks and the content is generated within a PHP loop. It contains some taxes that a user has to pay and a tax can be paid in installments. For example, if the user has to pay a 100$ tax and he first pays 25$ and then 75$, there will be two rows in the table for that tax. ... | [
0.3807028532028198,
0.2942894995212555,
0.47287848591804504,
-0.0012605034280568361,
-0.07186412066221237,
0.011156897991895676,
-0.16902939975261688,
-0.2918285131454468,
0.11993703991174698,
-0.5769859552383423,
0.31536316871643066,
0.29213953018188477,
0.05174212157726288,
0.08029504865... | |
<thead>
<tr>
<th width="10%">Tax name</th>
<th width="10%">Value</th> | [
0.18841847777366638,
0.12165084481239319,
0.1589268296957016,
0.03989088907837868,
-0.16474242508411407,
0.3060576617717743,
-0.4146136939525604,
-0.2679864466190338,
0.1749344915151596,
-0.1683136224746704,
-0.36463046073913574,
0.4127312898635864,
0.47574785351753235,
-0.0815968364477157... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.