text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
X = x;
Y = y;
}
public int NaturalNumbers()
{
for (i = 0; i < 9999; i++)
{
Console.WriteLine(i); | [
-0.04051331803202629,
-0.2597567141056061,
0.635796308517456,
-0.3498826026916504,
0.32898762822151184,
0.1721748262643814,
0.41295289993286133,
-0.340954452753067,
0.1764131784439087,
-0.5999755263328552,
-0.35941389203071594,
0.6551598906517029,
-0.10869734734296799,
0.22486110031604767,... | |
long iteration = i * 100 / 9999;
if ((i % iteration == 0) &&
(backgroundWorker != null) && backgroundWorker.WorkerReportsProgress)
{
backgroundWorker.ReportProgress(iteration); | [
-0.08690432459115982,
-0.31616196036338806,
0.5564362406730652,
-0.4326983392238617,
0.5004982352256775,
0.7451441884040833,
0.4349907636642456,
-0.2985963225364685,
-0.07539099454879761,
-0.44259586930274963,
0.07032540440559387,
0.20782352983951569,
-0.136749729514122,
0.293368935585022,... | |
}
}
return 1;
}
}
}
```
> Error : The name 'backgroundWorker' does not exist in the current
> context
How can I make progress bar working?
Here's a simple example that works:
```
public partial class BackgroundWorkerPage : Page
{
private readonly BackgroundWorker _worker = n... | [
0.056225743144750595,
0.04959266260266304,
0.5021709203720093,
-0.2818906903266907,
0.2785809338092804,
0.17136624455451965,
0.48028501868247986,
-0.22687043249607086,
-0.41241762042045593,
-0.8339394927024841,
-0.06524129211902618,
0.53791743516922,
-0.29647505283355713,
0.000683855207171... | |
InitializeComponent();
_worker.DoWork += WorkerOnDoWork;
_worker.WorkerReportsProgress = true;
_worker.ProgressChanged += WorkerOnProgressChanged;
}
private void WorkerOnProgressChanged(object sender, ProgressChangedEventArgs progressChangedEventArgs)
{
progressBar.Value = ... | [
-0.2011270970106125,
-0.01972217485308647,
0.3425646424293518,
-0.29720208048820496,
0.34926584362983704,
0.5198149085044861,
0.5566374659538269,
-0.45440104603767395,
-0.08578580617904663,
-0.6967806816101074,
-0.19590654969215393,
0.29473742842674255,
-0.32984164357185364,
0.341999411582... | |
{
Thread.Sleep(50);
_worker.ReportProgress(i);
}
}
private void Button_Click_1(object sender, System.Windows.RoutedEventArgs e)
{
_worker.RunWorkerAsync();
}
}
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefin... | [
0.12661607563495636,
-0.16851218044757843,
0.3239395320415497,
-0.22950614988803864,
0.3172248601913452,
0.40495142340660095,
0.19086183607578278,
-0.31302881240844727,
-0.6447550654411316,
-0.852418839931488,
-0.14592044055461884,
0.10955649614334106,
-0.31219884753227234,
0.6030109524726... | |
Content="Start" Click="Button_Click_1"/>
</Grid>
```
And you need to change your code a bit
```
private void WorkerOnDoWork(object sender, DoWorkEventArgs doWorkEventArgs)
{
var flow = new Flow(_worker);
flow.NaturalNumbers();
}
internal class Flow
{
private readonly BackgroundWorker _worker;
publi... | [
0.1531325876712799,
-0.23516519367694855,
0.7066857814788818,
-0.055251650512218475,
0.3601762354373932,
0.19630250334739685,
0.2947990298271179,
0.02543971873819828,
-0.32653141021728516,
-0.7266919612884521,
-0.39048197865486145,
0.5260804891586304,
-0.5874252915382385,
0.305446565151214... | |
int X { get; set; }
public int Y { get; set; }
public int NaturalNumbers()
{
for (int i = 0; i <= 9999; i++)
{
int iteration = i*100/9999;
// your if(...) fails with divide by zero exception
_worker.ReportProgress(iteration); | [
0.05393233895301819,
-0.274802029132843,
0.366996169090271,
-0.16647274792194366,
0.23155264556407928,
0.3585875928401947,
0.43786296248435974,
-0.4141676425933838,
-0.04192192852497101,
-0.5330677032470703,
-0.1594797521829605,
0.47245779633522034,
-0.19242548942565918,
0.1290273666381836... | |
}
return 1;
}
}
``` | [
-0.18125544488430023,
0.34737062454223633,
-0.060725778341293335,
-0.333061546087265,
0.18480953574180603,
-0.30145442485809326,
0.3193676769733429,
0.18501701951026917,
0.3834134638309479,
-0.26595237851142883,
-0.5582873225212097,
0.8514294028282166,
-0.385678231716156,
0.036680843681097... | |
When i came across the html5 range slider with larger max values the slider gets jumped to higher values and cant able to take the middle vaues while moving with mouse. So im trying to control the slider using keyboard with the help of javascript or some other. im a newbie to this one. could anybody pls help me. Thanks... | [
0.21441352367401123,
-0.15308311581611633,
0.5139241218566895,
0.23966816067695618,
-0.30506476759910583,
0.1507977396249771,
-0.0554971769452095,
-0.11150537431240082,
-0.26212140917778015,
-0.5667126178741455,
0.2774560749530792,
0.7153185606002808,
-0.18462957441806793,
-0.3103671967983... | |
all.
E.g.
```
<html><head><title>bla</title></head>
<body>
<input type="range" id="slider" min="0" max="100" value="50" />
<script type="text/javascript">
document.getElementById('slider').addEventListener('click', function() {
this.focus();
});
</script>
</body>
</html>
```
Fo... | [
0.21579650044441223,
-0.15924295783042908,
0.9355730414390564,
-0.17654679715633392,
-0.06360245496034622,
0.04794154316186905,
-0.21790552139282227,
-0.7773942351341248,
-0.2168108969926834,
-0.5413678884506226,
-0.38435840606689453,
0.5979311466217041,
-0.4398021399974823,
-0.17179280519... | |
this.focus();
});
}
}
</script>
``` | [
0.19917507469654083,
-0.030171861872076988,
0.5179179310798645,
-0.4153701066970825,
0.1973496675491333,
-0.34070077538490295,
0.2768038511276245,
0.2141953408718109,
0.10405691713094711,
-0.821501612663269,
-0.8430585861206055,
0.8837311267852783,
-0.44795235991477966,
0.02425391972064972... | |
In the AndroidManifest.xml, I have added all uses-permission, and now I want to remove permissions that I don't need them. I don't use camera or vibrate.. I use just simple functions ajax, I use Internet to extract data from server, and I use the local storage, so I want to know the uses-permission that shoudn't be del... | [
-0.00512330187484622,
0.291871577501297,
0.5566033720970154,
-0.05775591358542442,
0.13425830006599426,
0.021663518622517586,
0.03402752801775932,
-0.2022418975830078,
-0.18795062601566315,
-0.785361647605896,
-0.04026968404650688,
0.6688892245292664,
-0.5909984111785889,
0.076418019831180... | |
I want that `part 1` onclick div style changes and `part 2` again on click it comes back to normal. I tried doing so but I failed to achieve the `part 2` results.
Following is the Javascript code
```
function abc() {
document.getElementById("test").style.color="red";
}
```
After clicking the test div again, co... | [
0.4256129860877991,
0.10212718695402145,
0.41195857524871826,
-0.4611269533634186,
0.33447471261024475,
-0.009318175725638866,
0.5825297236442566,
-0.4440414607524872,
0.06970109045505524,
-0.7591713666915894,
-0.1692150980234146,
0.9148094058036804,
-0.5725201964378357,
0.1479566097259521... | |
I'm trying to detect valid Java annotations in a text. Here's my test program (I'm currently ignoring all whitespace for simplicity, I'll add this later):
```
txts = ['@SomeName2', # match
'@SomeName2(', # no match
'@SomeName2)', | [
0.34828391671180725,
0.30675214529037476,
0.10469843447208405,
-0.40918830037117004,
-0.16821421682834625,
-0.03539752587676048,
0.2625977396965027,
-0.04477773606777191,
0.023698192089796066,
-0.5236241817474365,
0.28262773156166077,
0.5644478797912598,
-0.07968293875455856,
-0.1230804100... | |
# no match
'@SomeName2()', # match
'@SomeName2()()', # no match
'@SomeName2(value)', # no match
'@SomeName2(=)', | [
0.16529831290245056,
0.16021527349948883,
0.1769220232963562,
-0.2276691347360611,
-0.238825261592865,
-0.24821479618549347,
0.24049076437950134,
0.07890338450670242,
0.2329525649547577,
-0.3624216914176941,
-0.12113305926322937,
0.6744375228881836,
-0.15768364071846008,
0.1802850067615509... | |
# no match
'@SomeName2("")', # match
'@SomeName2(".")', # no match
'@SomeName2(",")', # match
'@SomeName2(value=)', # no match | [
0.17833003401756287,
0.17567069828510284,
0.2408776879310608,
-0.13772359490394592,
-0.12447942048311234,
-0.27779197692871094,
0.27313360571861267,
0.13421282172203064,
0.28201112151145935,
-0.37538209557533264,
-0.11631771177053452,
0.6785954833030701,
-0.06768965721130371,
0.16535411775... | |
'@SomeName2(value=")', # no match
'@SomeName2(=3)', # no match
'@SomeName2(="")', # no match
'@SomeName2(value=3)', # match
'@SomeName2(value=3L)', # | [
0.2161903977394104,
0.011615336872637272,
0.2648123800754547,
-0.33329111337661743,
-0.45232874155044556,
-0.11805301904678345,
0.35324373841285706,
-0.07229190319776535,
0.27111464738845825,
-0.40787091851234436,
0.04995950683951378,
0.5957277417182922,
-0.08570514619350433,
0.08858151733... | |
match
'@SomeName2(value="")', # match
'@SomeName2(value=true)', # match
'@SomeName2(value=false)', # match
'@SomeName2(value=".")', # no match
'@SomeName2(value=",")', # match
'@SomeName2(x="o_nbr ASC, a")', # match | [
0.24354924261569977,
0.07266377657651901,
0.36007437109947205,
-0.2443419247865677,
-0.27018842101097107,
-0.05997973307967186,
0.238259956240654,
0.014485547319054604,
0.1370583027601242,
-0.3897850513458252,
-0.07233608514070511,
0.7493796348571777,
-0.26541823148727417,
0.06093138828873... | |
# multiple params:
'@SomeName2(,value="ord_nbr ASC, name")', # no match
'@SomeName2(value="ord_nbr ASC, name",)', # no match
'@SomeName2(value="ord_nbr ASC, name"insertable=false)', | [
0.03651273250579834,
0.05609570071101189,
0.38797450065612793,
-0.008552228100597858,
-0.3229723572731018,
0.23180125653743744,
0.4109416902065277,
-0.41087284684181213,
-0.06786131858825684,
-0.08577810227870941,
-0.14983798563480377,
0.5667120218276978,
-0.3188720643520355,
0.25545930862... | |
# no match
'@SomeName2(value="ord_nbr ASC, name",insertable=false)', # match
'@SomeName2(value="ord_nbr ASC, name",insertable=false,length=10L)', # match
'@SomeName2 ( "ord_nbr ASC, name", insertable = false, length = 10L )', # match
]
#regex = '((?:@[a-z][a-z0-9_]*))(\... | [
-0.20303545892238617,
0.19212064146995544,
0.5814809799194336,
-0.26020076870918274,
0.09659858047962189,
-0.1638382226228714,
0.3512395918369293,
-0.09074269980192184,
0.28118836879730225,
-0.3423379957675934,
-0.5611269474029541,
0.8922035098075867,
-0.41891753673553467,
0.04592712968587... | |
# @ + identifier (class name)
(
\( # opening parenthesis
(
(?:[a-z]\w*) | [
0.02541261538863182,
0.17984618246555328,
0.5167601704597473,
-0.2929370403289795,
0.26145604252815247,
0.10053388774394989,
0.4874247610569,
-0.11781133711338043,
0.02148296684026718,
-0.3937017619609833,
-0.4311082363128662,
0.4824112057685852,
-0.1975274682044983,
0.30605649948120117,
... | |
# identifier (var name)
= # assigment operator
(\d+l?|"(?:[a-z0-9_, ]*)"|true|false) # either a numeric | a quoted string containing only alphanumeric | [
0.027173878625035286,
0.16368316113948822,
0.19088135659694672,
-0.014605649746954441,
0.027779577299952507,
0.023878484964370728,
0.06264118105173111,
-0.34635111689567566,
0.21684880554676056,
-0.13321055471897125,
-0.3596615195274353,
0.437294602394104,
-0.4885611832141876,
0.0602890923... | |
chars, _, space | true | false
)? # optional assignment group
\) | [
-0.22723862528800964,
0.014040801674127579,
-0.021750433370471,
-0.07256759703159332,
0.24490021169185638,
0.1803056001663208,
0.17220991849899292,
-0.2515874207019806,
0.0874846801161766,
-0.20812954008579254,
-0.708777904510498,
0.6380958557128906,
-0.422235369682312,
-0.2578095197677612... | |
# closing parenthesis
)?$ # optional parentheses group (zero or one)
"""
rg = re.compile(regex, re.VERBOSE + re.IGNORECASE)
for txt in txts:
m = rg.search(txt)
#m = rg.match(txt)
if m:
print "MATCH: ", | [
-0.06067456305027008,
0.11198443174362183,
0.8015279173851013,
-0.4135275185108185,
0.16822822391986847,
0.22363503277301788,
0.19010208547115326,
-0.38641834259033203,
-0.2223109006881714,
-0.15075348317623138,
-0.6408286094665527,
0.866222083568573,
-0.44475439190864563,
-0.0909286662936... | |
output = ''
for i in xrange(2):
output = output + '[' + str(m.group(i+1)) + ']'
print output
else:
print "NO MATCH: " + txt
```
So basically what I have seems to work for zero or one parameters. Now I'm trying to extend the syntax to zero or more parameters, like in the last ex... | [
0.07752952724695206,
0.06427905708551407,
0.26447609066963196,
-0.3044823110103607,
-0.16185949742794037,
0.13170042634010315,
0.21898247301578522,
-0.35291892290115356,
0.11577179282903671,
-0.2929162085056305,
0.03332078456878662,
0.6482149362564087,
-0.6107150316238403,
-0.0548467822372... | |
assignment and prepend it by a comma for the 2nd to nth group (this group now using \* instead of ?):
```
regex = '((?:@[a-z][a-z0-9_]*))(\((((?:[a-z][a-z0-9_]*))(=)(\d+l?|"(?:[a-z0-9_, ]*)"|true|false))?(,((?:[a-z][a-z0-9_]*))(=)(\d+l?|"(?:[a-z0-9_, ]*)"|true|false))*\))?$'
```
That **cannot** work however. The pro... | [
-0.40719860792160034,
-0.08418601006269455,
0.3625057637691498,
-0.11230020970106125,
-0.2382042407989502,
-0.21301746368408203,
0.2442425638437271,
-0.48529213666915894,
0.12386927008628845,
-0.29307904839515686,
-0.6043800115585327,
0.742088794708252,
-0.32150816917419434,
-0.35521680116... | |
to detect valid syntax, I believe the regex below will give you the matches you want. But I'm not sure what you are doing with the groups. Do you want each parameter value in its own group as well? That will be harder, and I'm not even sure it's even possible with regex.
```
regex = r'((?:@[a-z][a-z0-9_]*))(?:\((?!,)(... | [
-0.12262772768735886,
0.12055666744709015,
0.3102114200592041,
-0.04901633784174919,
-0.07318810373544693,
0.009665028192102909,
0.37436750531196594,
-0.33115342259407043,
-0.05731889232993126,
-0.34437716007232666,
-0.1354694664478302,
0.7591045498847961,
-0.4838602840900421,
-0.278153330... | |
groups: the function name, and all the params in parentheses:
```
regex = r'''
(@[a-z][a-z0-9_]*) # function name, captured in group
( # open capture group for all parameters
\( # opening function parenthesis
(?!,) # negative lookahead for unwanted comma
(?: ... | [
-0.573623538017273,
-0.07705114781856537,
0.27213194966316223,
-0.1454233080148697,
0.06566394865512848,
0.2206440567970276,
0.07879061251878738,
-0.4698309600353241,
-0.24350517988204956,
-0.05955394729971886,
-0.688759982585907,
0.4601033926010132,
-0.41206488013267517,
0.024768833070993... | |
group for all params
[a-z][a-z0-9_]* # parameter name
= # parameter assignmentoperators
(?:"[a-z0-9_, ]*"|true|false|(?:\d+l?)) # possible parameter values
(?!,\)) # negative lookahead for unwanted comma and closing parenthesis
,? # optional comma, separating params
)*... | [
-0.5507689118385315,
0.025520632043480873,
0.5089313983917236,
-0.057908955961465836,
-0.3075830340385437,
0.4708884656429291,
0.23614518344402313,
-0.8333553075790405,
-0.2578733265399933,
-0.15800397098064423,
-0.5752781629562378,
0.19749584794044495,
-0.39480483531951904,
-0.16819165647... | |
it optional
\) # closing function parenthesis
(?!\(\)) # negative lookahead for empty parentheses
|$ # OR end-of-line (in case there are no params)
) # close capture group for all parameters
'''
```
After reading your comment about the parameters, the easies... | [
-0.007470241282135248,
-0.1395501047372818,
0.46099257469177246,
-0.06769911199808121,
0.10044091194868088,
0.02134375460445881,
0.09570162743330002,
-0.2810753285884857,
-0.041907645761966705,
-0.07637342810630798,
-0.5046032667160034,
0.7955836653709412,
-0.34134820103645325,
-0.32794505... | |
to use the above regex to pull out all the parameters, then write another regex to pull out name/value pairs to do with as you wish. This will be tricky too, though, because there are commas in the parameter values. I'll leave that as an exercise for the reader :) | [
-0.033413294702768326,
0.02565910667181015,
0.37528905272483826,
-0.09251362085342407,
0.045317143201828,
-0.011092573404312134,
0.10414480417966843,
-0.16247998178005219,
-0.03347606956958771,
-0.445088267326355,
-0.04344220459461212,
0.7890622615814209,
-0.24253590404987335,
-0.223719224... | |
I have created a view in which there is a capture button. When i click on that button camera screen is opening. but Image taken in Portrait is distorted when viewed in Landscape.
How to get actual image without distortion?
if you working on the ios 5 then you have to manually call this function when u capture the image... | [
0.16005390882492065,
-0.4681675136089325,
0.7886261343955994,
-0.15582741796970367,
-0.1372605264186859,
0.24243058264255524,
0.44486185908317566,
-0.39822593331336975,
0.0432136096060276,
-0.9671420454978943,
-0.01656956411898136,
0.8311113715171814,
-0.2501586675643921,
0.107687830924987... | |
= CGAffineTransformTranslate(transform, img.size.width, img.size.height);
transform = CGAffineTransformRotate(transform, M_PI);
break;
case UIImageOrientationLeft:
case UIImageOrientationLeftMirrored:
transform = CGAffineTransformTranslate(transform, img.size.width, 0);
transfor... | [
-0.2541170120239258,
-0.37830209732055664,
0.4333309829235077,
-0.41463038325309753,
0.015610717236995697,
0.17750808596611023,
0.4686693847179413,
-0.6299027800559998,
0.14353695511817932,
-0.24520140886306763,
-0.5726200342178345,
0.6920689940452576,
-0.12305156141519547,
0.1762266606092... | |
break;
}
switch (img.imageOrientation) {
case UIImageOrientationUpMirrored:
case UIImageOrientationDownMirrored:
transform = CGAffineTransformTranslate(transform, img.size.width, 0);
transform = CGAffineTransformScale(transform, -1, 1);
break;
case UIImageOrientationLeftMirrored:
... | [
0.03972192853689194,
-0.3028288185596466,
0.5042476654052734,
-0.23590470850467682,
0.014545808546245098,
0.29012319445610046,
0.2452496737241745,
-0.4173141121864319,
-0.11239384859800339,
-0.4352430999279022,
-0.3505519926548004,
0.5821340084075928,
-0.15733787417411804,
0.14621889591217... | |
CGImageGetBitsPerComponent(img.CGImage), 0,
CGImageGetColorSpace(img.CGImage), | [
-0.0030099821742624044,
-0.7514235973358154,
0.7044411301612854,
-0.03711264207959175,
-0.16540609300136566,
0.25965455174446106,
0.07962687313556671,
-0.03413793072104454,
-0.05306609719991684,
-0.9438187479972839,
-0.01817893236875534,
0.3681928515434265,
-0.27128666639328003,
0.00813347... | |
CGImageGetBitmapInfo(img.CGImage));
CGContextConcatCTM(ctx, transform);
switch (img.imageOrientation) {
case UIImageOrientationLeft:
case UIImageOrientationLeftMirrored:
case UIImageOrientationRight:
case UIImageOrientationRightMirrored:
// Grr...
CGContextDrawImage(ctx, CGRectMake(0,0,i... | [
-0.23843005299568176,
-0.4276517629623413,
0.8002777695655823,
-0.21478815376758575,
-0.14548949897289276,
0.1810818761587143,
0.2902008593082428,
-0.5010238289833069,
-0.26877114176750183,
-0.6520439386367798,
-0.48146122694015503,
0.6553346514701843,
-0.24705441296100616,
0.1782032400369... | |
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
self.image = [info objectForKey:UIImagePickerControllerOriginalImage];
snapimage.image = [self fixOrientation:self.image];
}
- (void)imagePickerController:(UIImagePickerController *)picker1
did... | [
-0.09429958462715149,
-0.16778236627578735,
0.45695528388023376,
-0.07293029874563217,
-0.10745708644390106,
-0.0015143303899094462,
0.20280633866786957,
-0.1311303675174713,
-0.08878960460424423,
-0.4630100131034851,
-0.32552462816238403,
0.925195574760437,
-0.4324268698692322,
-0.1081946... | |
I want to write a server side code in Java to access DB. A request like `http://localhost/name=jack`, will access database and return information of jack.
I want to use Apache or lighttpd webserver. However, most pages about these servers' configuration are about JavaEE, I just want to use javaSE to implement this pro... | [
0.5810728669166565,
0.22674447298049927,
-0.19364546239376068,
-0.09526871144771576,
-0.24812263250350952,
-0.25229012966156006,
0.2532520294189453,
-0.09129764884710312,
-0.057396382093429565,
-0.7882317900657654,
0.0621420182287693,
0.2781713306903839,
-0.37472307682037354,
0.24373795092... | |
I know that we can initialise an array in one of two ways:
1. Loop (No Memory reflection issues)
2. `Enumerable.Repeat` (Probably causes memory issues? Link: [Enumerable.Repeat has some memory issues?](https://stackoverflow.com/questions/10071032/enumerable-repeat-has-some-memory-issues))
I have two questions:
1. Ca... | [
0.37811583280563354,
0.16824468970298767,
0.1090751364827156,
-0.05599714815616608,
-0.26025351881980896,
-0.11198394000530243,
0.32033771276474,
-0.4359630048274994,
-0.34567058086395264,
-0.4256967604160309,
0.0038289499934762716,
0.414130300283432,
-0.3605879843235016,
0.110023334622383... | |
type there are two ways to go about it:
```
// #1: THIS ARRAY CONTAINS 10 REFERENCES TO THE SAME OBJECT
var myarr = Enumerable.Repeat(new object(), 10).ToArray();
// #2: THIS ARRAY CONTAINS REFERENCES TO 10 DIFFERENT OBJECTS
var myarr = Enumerable.Range(0, 10).Select(i => new object()).ToArray();
// #3: SAME RESULT ... | [
0.1559680998325348,
0.12677627801895142,
0.47431680560112,
-0.25136443972587585,
-0.06295312941074371,
0.1962248682975769,
0.5076584219932556,
-0.6357762813568115,
-0.07784231752157211,
-0.4538905620574951,
-0.05661005899310112,
0.6953288316726685,
-0.5274702310562134,
0.1509074717760086,
... | |
As topic mentioned. How can you insert a record or delete a record using PHP code after connecting to Microsoft Access Database? Thank you!
Edit: I've successfully login with a user account and now i will like to insert records. As below is the code that has not been successful in inserting record.
```
<?php
session_... | [
-0.2538389265537262,
-0.03354404866695404,
0.487606942653656,
0.10807587951421738,
0.07665259391069412,
0.19973552227020264,
0.15183092653751373,
-0.6181848049163818,
-0.3253346085548401,
-0.6440563797950745,
-0.013079153373837471,
0.32729247212409973,
-0.1436511129140854,
0.21220800280570... | |
/>
</form>
</fieldset>
<table width=100%>
</html>
</body>
<?php
}
else
{
$conn=odbc_connect("employee","","") or die (odbc_errormsg());
if (!$conn)
{
exit
("Connection Failed: " . $conn);
}
$query = "INSERT INTO empTable (empID, password, Role, Days left in MC, Days left in leave) VALUES" .
"('$_POST[username]'... | [
0.09632736444473267,
0.22511911392211914,
0.7052505612373352,
0.0015720281517133117,
0.25973883271217346,
0.4349583089351654,
0.2572817802429199,
-0.12935948371887207,
-0.26303237676620483,
-0.4970352053642273,
-0.016219723969697952,
0.5454774498939514,
-0.2526645362377167,
0.3047022223472... | |
default values.
Then in your php.ini file, make sure these lines are not commented (remove ';' from the beginning of the line to un-comment it) in the 'Mail Function' section:
```
SMTP = localhost
smtp_port = 25
sendmail_from = postmaster@localhost
``` | [
-0.04982640966773033,
-0.006135127507150173,
0.6373361349105835,
-0.172990083694458,
0.07682064175605774,
0.028230980038642883,
0.6325948238372803,
0.2970878481864929,
-0.1579505205154419,
-0.7317053079605103,
-0.20555977523326874,
0.151841938495636,
-0.40117934346199036,
0.183910205960273... | |
I am working with rails 3 and currently writing test with capybara using selenium driver,
I have issue as below
In one form i have 3 button named "save and add another", "save and continue editing" and "Save"
Now, if i try to save form by capybara as below
```
click_button 'Save'
```
Then this throws error called '... | [
0.10447995364665985,
0.24898162484169006,
0.43599793314933777,
-0.07536095380783081,
0.13483096659183502,
0.20081789791584015,
0.08770241588354111,
-0.5592789649963379,
0.07203193008899689,
-0.8272100687026978,
0.4228704273700714,
0.8096345067024231,
-0.2636006772518158,
-0.326801329851150... | |
continue editing">`
`<input class="btn" type="submit" value="Save" name="_save" data-disable-with="Save">`
Please let me know if anyone has an idea.
I think the problem is that all the values return a match because they all contain 'Save'.
Try assigning each one a distinctive id and using that instead. | [
0.3606064021587372,
0.1781933307647705,
0.12074928730726242,
0.05609772726893425,
0.10710009187459946,
-0.3355824649333954,
0.3289051651954651,
-0.04204276576638222,
-0.0266327615827322,
-0.6349889636039734,
-0.07082866132259369,
0.7412522435188293,
-0.3804797828197479,
-0.0105536319315433... | |
I have just installed these nodejs and socket.io but I am having problems with getting the client to connect to the server.
In my server I have:
```
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(3000, 'lo... | [
0.147120401263237,
0.1633913516998291,
0.6426069140434265,
-0.19397857785224915,
-0.14449942111968994,
0.16127020120620728,
0.7132999897003174,
-0.0925256609916687,
-0.03659568354487419,
-1.0969547033309937,
-0.2674987018108368,
0.6743916273117065,
-0.40897423028945923,
0.3922405540943146,... | |
(Not Found)
Uncaught ReferenceError: io is not defined
```
you are not serving the client via nodeJS, this will not work :
```
<script src="/socket.io/socket.io.js"></script>
```
try using the this instead:
```
<script src="http://localhost:3000/socket.io/socket.io.js"></script>
``` | [
-0.09127070754766464,
-0.029964949935674667,
0.35442012548446655,
0.014461051672697067,
0.012412951327860355,
0.045285798609256744,
0.36098700761795044,
0.26895344257354736,
-0.11621619015932083,
-0.9262190461158752,
-0.17448477447032928,
0.5291383266448975,
-0.21956686675548553,
0.2800419... | |
I have a TextBox/RichTextBox in XAML that I want to validate to make sure it contains a string with an '@' symbol. I am using this feature to accept an appropriate email address. How can I do it?
you are not serving the client via nodeJS, this will not work :
```
<script src="/socket.io/socket.io.js"></script>
```
t... | [
0.15619802474975586,
0.25644150376319885,
0.36947664618492126,
-0.205801859498024,
-0.04255899414420128,
-0.11683963239192963,
0.3960348665714264,
0.13380637764930725,
0.03523151949048042,
-0.9302393198013306,
-0.09260856360197067,
0.496962308883667,
-0.2584168016910553,
0.2053791433572769... | |
Is there a way to see that a browser window is minimized while the user is switching to the other window on **IPhone**? Same about when the browser window becomes inactive by switching to any other application.
I've tried to bind to jQuery *onfocus*, *onblur* events (`$(window).blur(...);`) but got no callbacks.
Than... | [
0.10449817031621933,
-0.12095686793327332,
0.18336482346057892,
-0.19070418179035187,
-0.2278682291507721,
-0.024683116003870964,
0.34775057435035706,
0.09201639145612717,
-0.4075375497341156,
-0.6120071411132812,
-0.13794396817684174,
0.6983908414840698,
-0.3394153416156769,
-0.2122179716... | |
I pressed the home button just once to get to the home screen it seems the JavaScript thread is suspended immediately and listeners for the event are only called when Mobile Safari is brought into focus again.
This is how you would listen for the events:
```
window.addEventListener('pageshow', myPageShowListenerFunc,... | [
0.24003833532333374,
0.2178218811750412,
0.6728571057319641,
-0.3022972345352173,
-0.18197478353977203,
-0.14708837866783142,
0.5119397640228271,
-0.048344679176807404,
-0.15568754076957703,
-0.6929517388343811,
-0.022814683616161346,
0.9400508999824524,
-0.21143725514411926,
0.01233973167... | |
I want to get the frames of a video file to show in a gallery view in android. and how to edit frames, for example
Select frame sections
use selected sections
delete selected sections
copy selected sections
cut selected sections
paste into the head
paste into the tail
```
arr = [["0", {"checkbox_2"=>"on"}], ["2"... | [
0.5203618407249451,
0.07617345452308655,
0.6165025234222412,
-0.06340959668159485,
-0.12091235816478729,
0.3680516481399536,
0.05536075308918953,
-0.4478236138820648,
0.07731852680444717,
-0.700503945350647,
0.061047449707984924,
0.273391455411911,
-0.40757185220718384,
0.04006491601467132... | |
I came across the problem of not having an editor kit that could not handle some parts of a webpage. Examples include javascript and css. Does anyone know where I can find an editor kit that is suitable for that?
Also I'm curious as to what programming language browsers like Google Chrome and IE use.
Try [Aptana Studio... | [
0.8203670978546143,
0.09997665882110596,
-0.1929587572813034,
-0.10855340212583542,
-0.27084648609161377,
-0.17776012420654297,
0.25794896483421326,
-0.17232081294059753,
-0.18271580338478088,
-0.5531641840934753,
0.17823752760887146,
0.5400601625442505,
0.03569645434617996,
-0.17783190310... | |
I have two tables and I want to display only the child ID that are in the first table and not in the second table. But it gives me always all the ID's, even those that are in the second table. This is the stored procedure;
```
ALTER PROC [dbo].[GetAllChildren]
@UserID int
AS
SELECT Child_ID FROM firstTable
UNION
SE... | [
0.22287845611572266,
0.18839089572429657,
0.37461569905281067,
-0.1014658734202385,
0.19500094652175903,
0.4373649060726166,
-0.34532901644706726,
-0.29229485988616943,
-0.13088825345039368,
-0.8611687421798706,
-0.028285223990678787,
0.2851356267929077,
-0.10958310961723328,
0.35568112134... | |
Is there any way to "encapsulate" an Iframe with some other element to simulate onClick? I know the Iframe doesn't support events but I need to track clicks from my website that are leaving thru the Iframe.
Thanks!
If the frame contains page from the same domain (does not violate [same-origin policy](http://en.wikiped... | [
0.16917268931865692,
0.059581272304058075,
0.47581034898757935,
-0.02589532546699047,
0.06187964230775833,
0.0003488925576675683,
0.49285027384757996,
-0.19022038578987122,
-0.166261225938797,
-0.8150245547294617,
0.06671027094125748,
0.2762894034385681,
-0.2726544141769409,
0.143483564257... | |
way to do what you want for obvious security reasons. Although all the contents is visually parts of the same page, frames coming from different domains must stay separate in terms of scripting. Otherwise any page could e.g. create a hidden iframe loading your webmail and steal your session cookie from it. All the data... | [
0.7266256213188171,
-0.2478502094745636,
0.30494794249534607,
0.45469599962234497,
0.15203674137592316,
-0.4334011971950531,
0.6520450711250305,
-0.32814231514930725,
-0.22145798802375793,
-0.6114380955696106,
-0.11572465300559998,
0.23113910853862762,
-0.24977940320968628,
0.0271550696343... | |
I have a dropdownlist and a textbox in my page,I want to change the dropdownlist with the textbox change. I use JQuery post like this:
`$("#txtBuildId").change(function() {
var builddate = $("#txtBuildId").val();
$.post("/UTOverview/Index?builddate=" + builddate);
});`
and my Index function is:
```
public ActionR... | [
0.12782223522663116,
-0.05970804765820503,
0.7540808320045471,
-0.4551205635070801,
-0.0016137631610035896,
0.37613752484321594,
0.4137250781059265,
-0.6043175458908081,
-0.15859751403331757,
-0.6190944910049438,
-0.18760153651237488,
0.641413688659668,
-0.29230302572250366,
0.223488971590... | |
list.Add(new SelectListItem { Text = bd["buildid"].ToString(), Value = bd["buildid"].ToString() });
}
ViewData["tbbuildid"] = list;
return View();
}
```
But I found that the dropdownlist didn't change with the DataView["tbbuildid"] change? Why ?
I try to do this via full postback way like... | [
0.3673440217971802,
-0.09732047468423843,
0.6420021653175354,
-0.43019065260887146,
0.1868712157011032,
-0.11646893620491028,
0.4213968515396118,
-0.5285857319831848,
-0.28152012825012207,
-0.7057011127471924,
-0.07137797772884369,
0.7093254327774048,
-0.36213794350624084,
0.17883707582950... | |
Ajax way?
In your Action method, you are returning a View, But do you have a view for this ? In this case, I would simply return Json from the action method.
Just return `Json` from your Action method and use that to populate your dropdow. Since you are making an Http Post call, It will hit your `HTTPPost` Action meth... | [
-0.03184060752391815,
-0.42165377736091614,
0.47928768396377563,
-0.019589640200138092,
-0.20948399603366852,
-0.04499666020274162,
0.2171233594417572,
-0.3453066647052765,
-0.37507131695747375,
-0.6659504771232605,
-0.12186851352453232,
0.7049728035926819,
-0.3916192054748535,
-0.32269668... | |
foreach (DataRow bd in tbBuildid.Rows as IEnumerable)
{
list.Add(new SelectListItem { Text = bd["buildid"].ToString(), Value = bd["buildid"].ToString() });
}
return Json(list);
}
```
And in your script,
```
$("#txtBuildId").change(function () {
var builddate = $("#txtB... | [
0.04086893051862717,
0.13404330611228943,
0.663422703742981,
-0.7443732619285583,
0.17594115436077118,
0.5030598044395447,
0.2293456494808197,
-0.5657271146774292,
0.1890186369419098,
-0.848444938659668,
-0.3665764331817627,
0.6400407552719116,
-0.17749005556106567,
0.00322188762947917,
... | |
$("#select1").append($("<option />").val(this.Value).text(this.Text));
});
});
});
```
It is always a good practice to use `Url.Action` HTML helper to get the path to the Action method as MVC will take care of returning the correct path to the action method. You dont need to worry about how man... | [
0.005036892835050821,
-0.2831275463104248,
0.6874210834503174,
-0.2575768232345581,
0.026219336315989494,
-0.08486048132181168,
0.6459753513336182,
-0.26073750853538513,
-0.20390085875988007,
-0.6763395667076111,
-0.38666483759880066,
0.7486129999160767,
-0.31702113151550293,
-0.1415811032... | |
i have total 70,000 records in database.
currently i displays all the records in the data gridview.
but it takes too much time.
now i want to load first 100 records when winform load
and then get records using background process.
and bind it to datagridview.
is it possible?if yes how i achieve this?
In your Action meth... | [
0.32323187589645386,
-0.12267773598432541,
0.6894963383674622,
0.23971901834011078,
0.03494606539607048,
0.042444858700037,
0.1535024791955948,
-0.2176486700773239,
-0.40819665789604187,
-0.6247318983078003,
0.13906434178352356,
0.5161147117614746,
-0.0670044794678688,
0.14533410966396332,... | |
hit your `HTTPPost` Action method
```
[HttpPost]
public ActionResult Index()
{
string buildDate = Request.Params.Get("builddate");
DataTable tbBuildid = DatabaseService.getBuilidByDate(buildDate);
List<SelectListItem> list = new List<SelectListItem>();
foreach (DataRow bd in tbBuildid.R... | [
0.22928814589977264,
-0.07616263628005981,
0.7661873698234558,
-0.31069067120552063,
-0.07654765993356705,
0.23737508058547974,
0.556013822555542,
-0.5251744985580444,
-0.18589259684085846,
-0.616783082485199,
-0.2145344316959381,
0.752650260925293,
-0.3356932997703552,
-0.1369322836399078... | |
Json(list);
}
```
And in your script,
```
$("#txtBuildId").change(function () {
var builddate = $("#txtBuildId").val();
$.post("@Url.Action("Index","UTOverview")", {builddate:builddate},function(data){
$.each(data, function() {
$("#select1").append($("<option />").val(th... | [
0.05721599608659744,
-0.2651025652885437,
0.6316790580749512,
-0.49278736114501953,
0.06933863461017609,
0.2666637897491455,
0.4363294839859009,
-0.4380238354206085,
-0.2087172269821167,
-0.47540274262428284,
-0.4675028920173645,
0.7010361552238464,
-0.33933448791503906,
-0.224070265889167... | |
as MVC will take care of returning the correct path to the action method. You dont need to worry about how many `../` to use.
The above code is tested and it will work fine. | [
0.25939175486564636,
-0.010696164332330227,
0.6234254837036133,
-0.015622197650372982,
0.043655745685100555,
-0.2997000217437744,
0.5894834399223328,
-0.32133787870407104,
-0.18949821591377258,
-0.4750532805919647,
-0.06756061315536499,
0.7950107455253601,
-0.23932011425495148,
-0.35930520... | |
Hi i'm trying to create and distribute an update/patch for my app on app store.
Does anyone know how to made it in the best way?
Thanks
There's no such thing as a patch or pure update - you release a full version of the app with the changes you require. | [
0.636519193649292,
-0.016039986163377762,
0.2910307049751282,
0.11738181114196777,
-0.10687913745641708,
0.0452297106385231,
0.32524436712265015,
0.4704115688800812,
-0.04163789004087448,
-0.4915619194507599,
0.25781428813934326,
0.34103143215179443,
0.007895509712398052,
0.193966969847679... | |
I wonder, is there any way to disable remember-me in Spring Security?
Scenario I want to implement is pretty common: after closing browser window I would like user's session to expire. Seems weird, but it doesn't work with Tomcat 7 & Spring Security 3.1.
We use auto-config in Spring Security configuration file, but the... | [
0.2907911539077759,
-0.002043311484158039,
0.6089898943901062,
0.11092173308134079,
0.1486879289150238,
-0.34122368693351746,
0.6623156666755676,
-0.08173341304063797,
-0.3380265235900879,
-0.42145198583602905,
-0.3857020437717438,
0.254921555519104,
-0.16948442161083221,
-0.00202789995819... | |
to /secure.html.
4. Current Spring's behaviour: page is displayed successfully. Expected behaviour: redirecting to login page.
**New symptoms** for differential diagnosis:
User is probable reathenticated because JSESSIONID in the same between browser close/open. How I could forse Tomcat or Spring to generate a new ses... | [
-0.40038400888442993,
-0.3804306089878082,
0.5830844640731812,
-0.2998000383377075,
-0.2515797019004822,
0.11177721619606018,
0.5914644598960876,
-0.222952738404274,
-0.6382853984832764,
-0.450695663690567,
-0.13905619084835052,
0.3590146601200104,
-0.017549309879541397,
-0.158787712454795... | |
authentication-failure-url="/auth/failed.html" />
<logout logout-success-url="/auth/logout.html" delete-cookies="JSESSIONID" />
</http>
```
**Update** Documentation [claims](http://static.springsource.org/spring-security/site/docs/3.1.x/reference/ns-config.html#ftn.d0e765) that there is no default remember-me con... | [
0.11971306055784225,
0.36915865540504456,
0.729393720626831,
-0.22094766795635223,
0.32724860310554504,
-0.18208195269107819,
0.6499975919723511,
-0.30647438764572144,
-0.004912263713777065,
-0.3350929319858551,
-0.0787331759929657,
0.5592390894889832,
-0.2614155411720276,
-0.1210089102387... | |
I have following class which reads and writes an array of objects from/to a parcel:
```
class ClassABC extends Parcelable {
MyClass[] mObjList;
private void readFromParcel(Parcel in) {
mObjList = (MyClass[]) in.readParcelableArray(
com.myApp.MyClass.class.getClassLoader()));
}
... | [
0.2900998592376709,
-0.16000963747501373,
0.6310197710990906,
-0.41070953011512756,
0.11331704258918762,
0.2233426421880722,
0.17872770130634308,
-0.5464718341827393,
0.09004530310630798,
-0.5920875668525696,
-0.18900826573371887,
0.09923414885997772,
-0.2218836098909378,
0.450476080179214... | |
readFromParcel(in);
}
public int describeContents() {
return 0;
}
public static final Parcelable.Creator<ClassABC> CREATOR =
new Parcelable.Creator<ClassABC>() {
public ClassABC createFromParcel(Parcel in) {
return new ClassABC(in);
}
public Cl... | [
0.15636013448238373,
-0.3041052222251892,
0.7974755764007568,
-0.2059057652950287,
0.1966124325990677,
0.1953766793012619,
0.2210649698972702,
-0.2591545283794403,
-0.18023990094661713,
-0.7860175371170044,
-0.258618026971817,
0.10319305211305618,
-0.17164085805416107,
0.6070892810821533,
... | |
return new ClassABC[size];
}
};
}
```
In above code I get a `ClassCastException` when reading `readParcelableArray`:
> ERROR/AndroidRuntime(5880): Caused by: java.lang.ClassCastException: [Landroid.os.Parcelable;
What is wrong in above code? While writing the object array, should I first convert the arr... | [
0.28896966576576233,
-0.28739669919013977,
0.22359871864318848,
-0.3908271789550781,
0.33199843764305115,
0.026490936055779457,
0.14882323145866394,
-0.5333384871482849,
-0.07730948179960251,
-0.6567803025245667,
0.006813699845224619,
0.44760802388191223,
-0.4287545680999756,
0.25202798843... | |
}
out.writeArray(tmpArrya.toArray());
```
When reading:
```
final ArrayList<MyClass> tmpList =
in.readArrayList(com.myApp.MyClass.class.getClassLoader());
mObjList= new MyClass[tmpList.size()];
for (int loopIndex=0;loopIndex != tmpList.size();loopIndex++) {
mObjList[loopIndex] = ... | [
0.05386795848608017,
-0.21703700721263885,
0.34304216504096985,
-0.45278680324554443,
0.08252885937690735,
0.1251099407672882,
0.11394898593425751,
-0.6156744956970215,
-0.1684575378894806,
-0.5422051548957825,
-0.10263264179229736,
0.27435368299484253,
-0.42066338658332825,
0.241631805896... | |
void readFromParcel(Parcel in) {
mObjList = in.createTypedArray(MyClass.CREATOR);
}
```
The reason why you shouldn't use the `readParcelableArray()`/`writeParcelableArray()` methods is that `readParcelableArray()` really creates a `Parcelable[]` as a result. This means you cannot cast the result of the method to ... | [
0.15445326268672943,
-0.18174372613430023,
0.2692607045173645,
-0.18763326108455658,
0.15981550514698029,
-0.051995694637298584,
0.003861040808260441,
-0.5740122199058533,
-0.08180616050958633,
-0.47206586599349976,
-0.06391768902540207,
0.11855781823396683,
-0.2735697031021118,
0.52204966... | |
While writing a WordPress post, in visual mode there shows the line breaks in text editor but in HTML mode there is only
  not BR tag.
How can I add BR tag at each line break instead of   by default?
I think this should be
```
RewriteRule ^(.*)$ index.php/$1
``` | [
-0.10205139964818954,
0.025833284482359886,
0.6848169565200806,
-0.14490672945976257,
-0.24197567999362946,
-0.04146971181035042,
0.2698800265789032,
-0.04082021862268448,
-0.2953841984272003,
-0.6874999403953552,
0.03792564943432808,
0.3957793712615967,
-0.19902944564819336,
-0.0743016377... | |
I'm making a battleships game, so when I pass something such as "A10" into the coordinate function it needs to make column into letter and row into the number.
```
Coordinate(std::string coord = "A10")
{
char c = coord[0];
col = c - 16;
int r = atoi((coord.substr(1,2)).c_str());
ro... | [
-0.27392756938934326,
0.23074179887771606,
0.38869285583496094,
-0.33416473865509033,
0.36945629119873047,
0.3514035940170288,
0.03327334672212601,
-0.4734759032726288,
-0.5296093225479126,
-0.4399271607398987,
-0.2846308648586273,
0.45135313272476196,
-0.18760555982589722,
-0.067957162857... | |
equaling 9 seems to work but col equally 0 does not.
Are you trying to map the value of 'A' to zero? Remember that characters are single-byte integers,
```
char c = std::toupper( coord[0] );
if( c >= 'A' && c <= 'Z' )
{
col = c - 'A';
}
else
{
// TODO: Invalid/error?
}
``` | [
-0.3171384632587433,
-0.021766789257526398,
0.35534989833831787,
-0.07302531599998474,
0.019064679741859436,
0.2213350534439087,
0.1042463630437851,
-0.32823652029037476,
-0.09554439038038254,
-0.21544457972049713,
0.1280500888824463,
0.4228130578994751,
-0.3996874988079071,
-0.13197031617... | |
when I run the following it seems successful:
```
$ sudo ssh -T git@github.com
Hi x! You've successfully authenticated, but GitHub does not provide shell access.
```
However, when I do a `sudo git push` from my repo, it doesn't work I get
```
Permission denied (publickey).
fatal: The remote end hung up unexpectedl... | [
0.03978170454502106,
-0.06322090327739716,
0.4358930289745331,
-0.0700875073671341,
-0.015192104503512383,
-0.07091332226991653,
0.6427744626998901,
-0.09410642087459564,
-0.04026961699128151,
-0.548098087310791,
-0.34937331080436707,
0.5159881711006165,
-0.15270449221134186,
0.31681904196... | |
a DATETIME column you will need to use NOW() rather than CURDATE() or extract just the date pat of the field values. | [
-0.008188232779502869,
-0.2511851489543915,
0.6997053027153015,
0.009965884499251842,
0.21651577949523926,
-0.11826802045106888,
-0.13041599094867706,
0.05033854395151138,
-0.14195820689201355,
-0.3329275846481323,
-0.31676265597343445,
0.212591290473938,
-0.04774037003517151,
0.1022638976... | |
My Goal
-------
To be able to detect when, at runtime, a comparison is made (or any other operation like, \*, - , /, >, < ,...
This should be achieved to edit the bytecode of a class using Javassist or ow2 ASM
What must be achieved
---------------------
This code
```
public class Test{
public void m(){
... | [
0.4028189778327942,
0.1458527147769928,
0.03167135268449783,
-0.26757240295410156,
0.22567352652549744,
-0.017408374696969986,
0.39291661977767944,
-0.35517656803131104,
0.23974600434303284,
-0.8384020328521729,
-0.07870487868785858,
0.566713809967041,
-0.22534698247909546,
0.1400609612464... | |
m(){
if(someExternalClass.greaterThan(a,2)){
//blalbla
}
}
}
```
The greaterThan will return exactly the same result as '>' but will also be used the save the amount of comparisons
The external class will then be notified everytime a comparison has been made
Extra note
-----... | [
0.3723818063735962,
0.13953568041324615,
0.24485015869140625,
-0.3109922409057617,
0.05151688680052757,
0.009207839146256447,
0.4000920057296753,
-0.546604335308075,
-0.18906882405281067,
-0.5477054119110107,
-0.0843542218208313,
0.6681128144264221,
-0.24607178568840027,
0.0763565227389335... | |
suggestions on how I can achieve this with Javassist or other libraries.
I guess it'll have something to do with OpCodes like IFLT, IFGT
You can use the BETWEEN operator for this
```
SELECT COUNT(*)
FROM complaints
WHERE complaint_status = 'OPEN'
AND complaint_regdate < (CURDATE() - INTERVAL 7 day)
```
Note yo... | [
0.2395162731409073,
-0.38354945182800293,
0.3878156840801239,
-0.05053152143955231,
-0.019135452806949615,
-0.1226472407579422,
0.04690470173954964,
0.1271534264087677,
-0.18604597449302673,
-0.5244497656822205,
0.03247157484292984,
0.35801950097084045,
-0.20638899505138397,
0.070193804800... | |
Can some one tell me what is wrong in the for loop? When I run it, it interrupts. I tried to debug to see what is wrong, I noticed that in the for loop it just stops:
```
#define MAX_POPULATION 64
float **tr_pop;//Tournament candidates
float **matingPool;//Mating pool
tr_pop=new float *[m];
matingPool=new float *[m];
... | [
0.0751243382692337,
-0.11584560573101044,
0.5185391902923584,
-0.09631624072790146,
0.2225511521100998,
-0.2111789435148239,
0.13699133694171906,
-0.3668156862258911,
-0.28426775336265564,
-0.33825549483299255,
-0.049922212958335876,
0.5456840395927429,
-0.4955660104751587,
0.3263390660285... | |
{
tr_pop[l]=new float[MAX_POPULATION+1];
matingPool[l]=new float[MAX_POPULATION+1];
}
```
Because in another function I think I was doing violation:
```
void crossover()
{
int p1,p2,i,j;float tempBit;
p1=m/3;
p2=(2*m)/3;
for(j=0;j<MAX_POPULATION;j++)
{
for(i=p1;i<p2;i++)
{
tempBit=matingPool[... | [
0.11302360147237778,
-0.29932206869125366,
0.5200594067573547,
-0.020887652412056923,
0.15858051180839539,
0.211023211479187,
0.19235655665397644,
-0.48205527663230896,
-0.6153820157051086,
-0.06062784418463707,
-0.13158497214317322,
0.5754888653755188,
-0.575454831123352,
0.23530472815036... | |
tr_pop[l]=new float[MAX_POPULATION];
}
```
should be
```
for(l=0;l<m;l++)//allocating
{
tr_pop[l]=new float[MAX_POPULATION];
}
```
You're allocating `m` elements for each of the arrays and try to access `m+1`. | [
-0.21681122481822968,
-0.21509045362472534,
0.6891850829124451,
-0.1311805695295334,
0.5252510905265808,
0.3581559956073761,
-0.0461508147418499,
-0.24483585357666016,
-0.437528133392334,
-0.33184921741485596,
-0.3302084505558014,
0.570536196231842,
-0.44238340854644775,
-0.147240877151489... | |
How can we search content(text) within images using plone 4.1. I work on linux Suppose an image say a sample.jpg contains text like 'Happy Birthday', on using search 'Birthday' I should get the contents i.e sample.jpg
Best is to use collective.DocumentViewer with various options to select from | [
0.3010063171386719,
-0.07078143954277039,
0.18173189461231232,
0.21308887004852295,
-0.4423629641532898,
-0.12051237374544144,
-0.13805782794952393,
-0.21803082525730133,
-0.2952270805835724,
-0.593319296836853,
-0.004731629975140095,
0.30318528413772583,
0.13111986219882965,
-0.0494014099... | |
I am developing my own forums and everything is working perfectly apart from when I attempt to ORDER BY date\_time. My table name is correct and so is all the field names! A PHP error is given when I add ORDER BY date\_time to the query and I can't understand why, as it works perfectly fine elsewhere on the site. The c... | [
-0.01442477572709322,
0.30943697690963745,
0.5823230147361755,
-0.14443768560886383,
-0.29461586475372314,
-0.057521894574165344,
0.3261798024177551,
-0.04490773379802704,
-0.2566623389720917,
-0.6285519599914551,
0.1026257798075676,
0.6084079146385193,
-0.21983931958675385,
0.240566179156... | |
Add one above.";
} else {
while($row = mysql_fetch_array($sqlresponses)){
$response_author_id = $row["author_id"];
$reply_body = $row["reply_body"];
$date_time = $row["date_time"];
$date_time = strftime("%b %d, %Y", strtotime($date_time));
$responseList .= '<div id="sub_r... | [
-0.2299344390630722,
-0.35485607385635376,
0.9168177247047424,
-0.2838340997695923,
0.07058785855770111,
0.30058547854423523,
0.18894106149673462,
-0.5419372916221619,
-0.2728140354156494,
-0.515190601348877,
-0.2822369635105133,
0.5195248126983643,
-0.2618897557258606,
0.1422496736049652,... | |
<i>' . $date_time . '</i></p></div>';
}
}
```
Error:
```
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/public_html/lb/forum/post.php on line 49
```
Just to clarify, line 49 is $numRows = mysql\_num\_rows($sqlresponses);.
Your ORDER BY clause needs to be after the WH... | [
-0.34601354598999023,
0.07452823221683502,
0.66264408826828,
-0.22752253711223602,
0.27099597454071045,
-0.0031565758399665356,
0.13034477829933167,
-0.052840862423181534,
-0.33297306299209595,
-0.5693906545639038,
-0.46211203932762146,
0.4522860646247864,
-0.13717776536941528,
0.269728451... | |
```
sum = 0;
for (i = 1; i <= n; i++) { //#1
for (j = 1; j <= i * i; j++) { //#2
if (j % i == 0) { //#3
for (k = 1; k <= j; k++) { //#4
sum++;
}
} | [
0.11686880141496658,
0.3028465509414673,
0.33300653100013733,
-0.36683759093284607,
-0.09018836170434952,
-0.11755716800689697,
0.5544290542602539,
-0.7552784085273743,
0.15823885798454285,
-0.11455997079610825,
-0.4279859960079193,
0.6553773880004883,
-0.6299729347229004,
0.16533523797988... | |
}
```
}
The above got me confusing
```
Suppose #1 runs for N times
#2 runs for N^2 times
#3 runs for N/c since for N inputs N/c could be true conditions
#4 runs for N times
```
Therefore roughly I could be looking at O(N^5) . I am not sure. Please help clarify.
**EDIT** I was wondering the runti... | [
0.20022539794445038,
0.12734375894069672,
0.07057254016399384,
-0.2681945860385895,
0.1494273543357849,
0.003229893045499921,
0.461490273475647,
-0.24532587826251984,
-0.3858148753643036,
-0.5417494773864746,
0.024954779073596,
0.4483851492404938,
-0.41236644983291626,
0.19905655086040497,... | |
i = 1; i <= n; i++) //#1 O(n ...
for (int j = i; j <= i * i; j+=i) //#2 ... * n ...
for (int k = 1; k <= j; k++) //#4 ... * n^2) as j ~= i^2
sum++;
```
or
```
public static void main(String... args) {
int n = 9000;
System.out.println((double) f(n * 10) / f(n));
}
private static lo... | [
-0.0011867145076394081,
-0.30351462960243225,
0.4489922523498535,
-0.46077021956443787,
0.25730979442596436,
0.2926062345504761,
0.4537634551525116,
-0.24105693399906158,
-0.2497536540031433,
-0.08802798390388489,
-0.3983466923236847,
0.4226425588130951,
-0.4373382031917572,
0.367471039295... | |
0;
for (long i = 1; i <= n; i++) //#1
for (long j = 1; j <= i; j++) //#2
sum += i * j; // # 4
return sum;
}
```
prints
```
9996.667534360826
```
which is pretty close to 10^4 | [
-0.023817310109734535,
0.001071142964065075,
0.4105994999408722,
-0.4119270443916321,
-0.016138385981321335,
0.12578833103179932,
0.22985747456550598,
-0.5435209274291992,
-0.19053761661052704,
0.03138451650738716,
-0.3656660318374634,
0.4774389863014221,
-0.3486984670162201,
0.00538218114... | |
I develop Firefox extension with bundled executable file which should be run on browser startup.
To run process I need get nsIFile or nsILocalFile instance which points to executable file.
I know one solution how to get it using directory service:
```
var file = Components.classes["@mozilla.org/file/directory_service... | [
0.24090659618377686,
0.18408963084220886,
0.7908710241317749,
-0.18039515614509583,
0.09439683705568314,
-0.028363259509205818,
0.34583601355552673,
-0.5700506567955017,
-0.10081510990858078,
-0.8884285688400269,
-0.1812722533941269,
0.8202236294746399,
-0.5436471104621887,
0.0402745231986... | |
with Firefox extension?
Thanks.
You are making way too many assumptions about the directory structure of the Firefox profile - don't. The [Add-on Manager API](https://developer.mozilla.org/en/Addons/Add-on_Manager/AddonManager) lets you get the path of a file inside the extension, you should use it:
```js
Components.... | [
0.3191376328468323,
-0.10642803460359573,
0.712815523147583,
-0.24504759907722473,
0.08127181231975555,
-0.22586414217948914,
0.2067330777645111,
-0.7520560026168823,
-0.40225136280059814,
-0.7174949645996094,
-0.4643929898738861,
0.6668418645858765,
-0.8002898693084717,
-0.056760754436254... | |
We are implementing a project where the users post and get some information from a server. The scenario is that the user can create account/login both manually (giving email and password) and with facebook credentials using SSO. I implement mostly the Android part, but my questions are general.
1. Let’s say that I hav... | [
0.4840955138206482,
0.2505573630332947,
0.1830446422100067,
-0.08154558390378952,
0.1351454108953476,
0.13801127672195435,
0.0630984678864479,
-0.10816031694412231,
-0.2883749008178711,
-0.7155258655548096,
0.021760229021310806,
0.26654982566833496,
-0.08083464950323105,
-0.192402824759483... | |
unique and permanent for every FB account, meaning the each time I use the same FB credentials I get the same Access Token?
2. Is there any additional work that needs to be done on the server side? Or can the server handle the users that use their FB accounts similarly as it handles the others?
Every clarification wil... | [
0.3862655460834503,
0.09594886749982834,
0.4295685589313507,
-0.29842814803123474,
0.002330360934138298,
-0.23921963572502136,
0.2242126613855362,
-0.4079561233520508,
-0.37443310022354126,
-0.6593112349510193,
-0.26365894079208374,
0.42546382546424866,
-0.45262739062309265,
0.010659364983... | |
function(addon)
{
var uri = addon.getResourceURI("<relative path>");
var file = uri.QueryInterface(Components.interfaces.nsIFileURL).file;
...
});
``` | [
-0.22944064438343048,
-0.374094694852829,
0.6022072434425354,
-0.24051474034786224,
0.07969365268945694,
0.3089388608932495,
0.26531586050987244,
-0.3280063271522522,
0.018212880939245224,
-0.7124618291854858,
-0.3854219615459442,
0.6684929728507996,
-0.6390971541404724,
0.2326703667640686... | |
it's not clear to me how to manage formsets in Django. This is my views.py:
```
def newAd(request):
newAdFormSet = modelformset_factory(Ad)
if request.method == 'POST':
formset = newAdFormSet(request.POST, request.FILES)
if formset.is_valid():
formset.save()
return rende... | [
0.20922036468982697,
-0.045136258006095886,
0.7824699282646179,
-0.31654977798461914,
-0.17061233520507812,
0.009885688312351704,
0.13587728142738342,
-0.47222524881362915,
-0.2970965504646301,
-1.0232412815093994,
-0.22917440533638,
0.10149694234132767,
-0.3428076505661011,
-0.03076050244... | |
{'state':'Your ad has been successfull created.'},
context_instance = RequestContext(request),)
else:
formset = newAdFormSet()
return render_to_response('ad_form.html', | [
0.001125002047047019,
-0.060680754482746124,
0.9001367092132568,
-0.4536379277706146,
-0.11936338245868683,
0.17872007191181183,
0.4874967634677887,
-0.5645837783813477,
0.0441315732896328,
-0.83583003282547,
-0.4290151596069336,
0.3068195879459381,
-0.36733075976371765,
0.0990656167268753... | |
{'form':formset},
context_instance=RequestContext(request),)
```
It works but it always returns one prefilled form for each existing tuple plus, at the end, a blank form.
Now, i can't get how to say where it must return a blank form (to perform a new insert), and where it must instead ret... | [
0.15983961522579193,
-0.12353228777647018,
0.7615785002708435,
-0.016253188252449036,
-0.026088764891028404,
-0.09080974757671356,
0.36016929149627686,
-0.38044261932373047,
0.001852911664173007,
-0.682093620300293,
0.05693383142352104,
0.47584089636802673,
-0.42690446972846985,
0.04709799... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.