text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I know that a web page has an implied `<head>` tag even when there is none declared in the file. I was just curious in testing `getElementsByTagName('head')` when there is none and it does return a `<head>` tag. However, when I placed more than one `<head>` in the page... it returns a unified head. why is this? Don't...
[ 0.1476420909166336, 0.27371007204055786, 0.4626437723636627, 0.039675358682870865, -0.07122833281755447, -0.4553753733634949, 0.6586127281188965, 0.02276686765253544, -0.11958510428667068, -0.5633014440536499, -0.27046555280685425, 0.29613450169563293, -0.3776852488517761, 0.06290118396282...
data[1] << " " << data[2] << " " << data[3] << " " << data[4] << endl; } ```
[ -0.14421750605106354, 0.0873895138502121, 0.3417105972766876, 0.18514342606067657, 0.10206987708806992, -0.2515510320663452, -0.129379004240036, -0.45480379462242126, 0.034819718450307846, -0.32251638174057007, -0.47047656774520874, 0.4540615975856781, -0.3861532509326935, 0.32668107748031...
Is there a simple, pythonic, way to generate all n-tuples of a given length from a string? For example, I would like `generateTuples("Hello, World!", 3)` to produce the following: ``` [ "Hel", "ell", "llo", "lo,", "o, ", ", W", " Wo", "Wor", "orl", "rld", "ld!" ] ``` ``` >>> a = "Hello, World!" >>> def generate_tupl...
[ -0.12253551185131073, 0.10383692383766174, 0.33885782957077026, -0.23424755036830902, -0.407420814037323, 0.4309450089931488, 0.40574368834495544, -0.019123967736959457, -0.1663278341293335, -0.2640715539455414, -0.41499799489974976, 0.4025306701660156, -0.4857131540775299, 0.0316641107201...
Yesterday I tried to substitute all `(` `)` in my text but not the one found in matches from a previous search. I couldn't find a good solution. I did it changing one by one. *This is my original text*: ``` (Peter Jackson) is the man who..... (John Johnson) is the man who.... and (John Johnson) is also the man who....
[ -0.2957026958465576, 0.6609047651290894, -0.0818507969379425, -0.07132575660943985, 0.15053240954875946, 0.30875009298324585, 0.2971860468387604, -0.10435912013053894, -0.4744342267513275, -0.4308970868587494, -0.5248613953590393, 0.2653961777687073, -0.5926587581634521, 0.3110277354717254...
Johnson) is the man who.... and (John Johnson) is also the man who.. not as (Jon Johnson) more [letters] etc. ``` **Edit** Is there an easy method to substitute one or more whatever characters in a text but not these in matches? One can use the following substitution command to achieve the purpose in question. ...
[ 0.008311182260513306, 0.49875274300575256, -0.030400602146983147, -0.3027476668357849, 0.05582736060023308, 0.21742002665996552, 0.4518261253833771, -0.25523266196250916, -0.291747510433197, -0.4776909053325653, -0.47364380955696106, 0.11596699059009552, -0.8158478736877441, 0.047554627060...
For the Easter holiday, I'm wanting to have a little surprise "Easter Egg Hunt" on a site I develop for. Two of these five *Easter Eggs* I'm hiding will be keypress ordained. This won't be like a "Press CTRL and TAB at the same time" type deal but will be a "Pres UP three times and then RIGHT three times" type of thing...
[ 0.3162049353122711, 0.0905923843383789, 0.6594721078872681, -0.027581270784139633, 0.0995795950293541, 0.12430836260318756, 0.5213078856468201, 0.13134948909282684, -0.283260315656662, -0.3974161148071289, -0.1724727898836136, 0.35650762915611267, 0.1018364205956459, -0.08273161202669144, ...
looking for the following keypress series: surprise1 - LEFT (x3), RIGHT (x3), UP (x3), DOWN (x3) surprise2 - SHIFT (x3), TAB (x3), CTRL (x3) ``` $(document.body).keydown(function(e) { surprise1(e); surprise2(e); }); function surprise1(e) { var ev = (e) ? e : window.event; var k =...
[ -0.16912691295146942, -0.2653643786907196, -0.015770578756928444, -0.4127812683582306, -0.18130238354206085, 0.4990012049674988, 0.29759225249290466, -0.6855612993240356, -0.09275509417057037, -0.23726823925971985, -0.27483323216438293, 0.4755467474460602, -0.13157178461551666, 0.039322122...
typekeys[k]++; if (typekeys[37] == 3) { if (typekeys[37] == 3 && typekeys[39] == 3) { if (typekeys[37] == 3 && typekeys[39] == 3 && typekeys[38] == 3) { if (typekeys[37] == 3 && typekeys[39] == 3 && typekeys[38] == 3 && typekeys[40] == 3)
[ -0.4931350350379944, -0.05540250986814499, 0.249138742685318, -0.17712409794330597, 0.1418059766292572, 0.3176455795764923, 0.5835844874382019, -0.42928722500801086, 0.05351611599326134, -0.23936006426811218, -0.766396164894104, 0.3062536418437958, -0.4921632707118988, -0.12876930832862854...
{ alert("You've found Surprise 1! Contact the site admin ASAP to get your prize!"); typekeys[37] = typekeys[39] = typekeys[38] = typekeys[40] = 0; }
[ 0.0942036435008049, -0.39547500014305115, 0.13475574553012848, -0.04633117839694023, 0.05352892726659775, -0.21053780615329742, 0.21881192922592163, 0.06481628119945526, -0.056487493216991425, -0.21973927319049835, -0.6229993104934692, 0.3672507703304291, -0.1719295084476471, -0.1100539863...
} else { typekeys[40] = 0; } } else { typekeys[38] = typekeys[40] = 0; } } else
[ -0.3661561608314514, -0.070799320936203, -0.07902741432189941, -0.13937577605247498, 0.29865556955337524, 0.20512081682682037, 0.16718246042728424, -0.18569877743721008, -0.010956917889416218, -0.3801133632659912, -0.5427472591400146, 0.7874630093574524, -0.3643546998500824, -0.23602996766...
{ if (typekeys[37] > 3) { typekeys[37] = 0; } typekeys[39] = typekeys[38] = typekeys[40] = 0; } } else { typekeys[37] = typekeys[39] = typekeys[38] = typekeys[40] = 0; } }; function surprise2(e)
[ -0.3157159984111786, -0.5748385787010193, -0.15691488981246948, -0.30227574706077576, 0.06001722440123558, -0.0457557812333107, 0.23112861812114716, -0.5475565791130066, -0.05421121418476105, -0.18527260422706604, -0.5890864133834839, 0.5511943697929382, -0.26954641938209534, -0.1191553473...
{ var ev = (e) ? e : window.event; var k = ev.keyCode; if (k > 8 && k < 18) { typekeys[k] = isNaN(typekeys[k]) ? 0 : typekeys[k]; typekeys[k]++; if (typekeys[16] == 3) { if (typekeys[9] == 3) { if (typekeys[16] == 3
[ -0.10231813788414001, -0.3402535915374756, 0.3740440607070923, -0.35547327995300293, 0.01498667523264885, 0.3450787365436554, 0.43413251638412476, -0.47911304235458374, -0.08749443292617798, -0.5205835700035095, -0.5010200142860413, 0.5903615355491638, -0.24606114625930786, 0.0178583804517...
&& typekeys[9] == 3 && typekeys[17] == 3) { alert("You've found Surprise 2! Contact the site admin ASAP to get your prize!"); typekeys[16] = typekeys[9] = typekeys[17] = 0; } }
[ 0.07843596488237381, -0.34111201763153076, 0.31075483560562134, -0.15187610685825348, 0.02833370678126812, -0.15821599960327148, 0.2168937474489212, -0.16372786462306976, -0.17301605641841888, -0.0833606868982315, -0.6002407073974609, 0.4689941108226776, -0.13656014204025269, 0.04928673431...
} else { if (typekeys[16] > 3) { typekeys[16] = 0; } typekeys[9] = typekeys[17] = 0; } } else { typekeys[16] = typekeys[9] = typekeys[17] = 0; } }; ``` Mind telling
[ 0.44992491602897644, 0.1273137778043747, 0.05145275220274925, -0.07533475011587143, 0.5752295255661011, -0.11011993885040283, 0.4099311828613281, -0.23525495827198029, -0.0057744490914046764, -0.12541234493255615, -0.3134887218475342, 1.0241448879241943, -0.43288612365722656, 0.27174377441...
me exactly as to why that isn't working? It seems like to me it should work. Try this: I'm using <https://github.com/madrobby/keymaster> jquery plugin ``` $(function () { var combination = '' key('left', function(){ combination = 'left'; checkCombination(); }); key('right', function(){ ...
[ -0.03326044976711273, -0.13354134559631348, 0.4677203893661499, -0.3141004741191864, 0.22173723578453064, -0.007969050668179989, 0.3092774748802185, -0.5755651593208313, -0.24956129491329193, -0.6259552836418152, -0.6199116110801697, 0.7764033079147339, -0.3388369679450989, 0.0853095501661...
key('down', function(){ combination+= 'down'; checkCombination(); }); function checkCombination() { if(combination === 'leftrightupdown') { alert('surprise 1'); } } });​ ``` Demo: <http://jsfiddle.net/codef0rmer/BSdCq/>
[ -0.0737193375825882, -0.4110497832298279, 0.3536703288555145, -0.3527362048625946, 0.2856300175189972, -0.2205013930797577, 0.23472197353839874, -0.6626480221748352, -0.46914905309677124, -0.4345800578594208, -0.7216283082962036, 0.6362130641937256, -0.3303983509540558, 0.05280238017439842...
I'm struggling for about 14 days now with a simple task: In database, I have definitions for hardware categories. For example : 1. HDD * Internal * External * Flash This list is in database defined like this: ``` [ID - ParrentID - Name] : 1 - 0 - HDD, 2 - 1 - Internal, 3 - 1 - External, 4 - 1 - Flash. ...
[ 0.26187264919281006, 0.3873457908630371, 0.418954074382782, -0.02600027434527874, 0.025840256363153458, 0.2802758812904358, -0.20698316395282745, -0.28742966055870056, -0.20206691324710846, -0.7520009875297546, 0.10450723022222519, 0.627888023853302, -0.057873938232660294, 0.26307976245880...
class Category { private int _id = -1; private string _name = ""; private List<Category> _subCategories = null; // property getters and setters, constructors, and bool HasSubCategories } ``` Now, from these I create ViewModel called *SubCategoryViewModel* to which is binded my TreeView. So, I can view my c...
[ -0.24142234027385712, -0.271251916885376, 0.36602583527565, -0.05889931321144104, -0.3803486227989197, -0.025756780058145523, 0.23386119306087494, -0.42036834359169006, -0.3474096655845642, -0.328105092048645, -0.20484359562397003, 0.5496947765350342, -0.48472946882247925, 0.16725237667560...
nested in *HWDocumentViewModel* which is a main ViewModel for my window. What I need now is obvious : When user doubleclicks on item in TreeView, I need to load items from database and show them in ListView. My opinion is, that in *HWDocumentViewModel* I need to define an collection of Items and load them accordingly ...
[ 0.04937126487493515, -0.1351688951253891, 0.33022093772888184, 0.03905359283089638, -0.2949397563934326, -0.07391378283500671, 0.3248647451400757, -0.30567437410354614, -0.19631393253803253, -0.8093628883361816, 0.029409203678369522, 0.35224077105522156, -0.3521879315376282, 0.185250848531...
execute a method on main ViewModel (HWDocumentViewModel). I tried this approach : I created a property : `public static SubCategoryViewModel SelectedCategory` on `HWDocumentViewModel`. When doubleclick occurs, I set this property from SubCategoryViewModel as `this`. So, in this property is object, which executed d...
[ -0.1029055193066597, -0.3681538999080658, 0.10060369968414307, 0.12694619596004486, -0.19728408753871918, -0.15764005482196808, 0.3414149880409241, -0.3589916527271271, -0.12036941200494766, -0.45569339394569397, -0.14217157661914825, 0.41338256001472473, -0.5211416482925415, 0.03488674759...
ListView, right ? But, how can I from SubCategoryViewModel call a method in HWDocumentViewModel ? Should I write a static method on a HWDocumentViewModel which will be accessible from SubCategoryViewModel ? **Or is there a way, how to call Command defined on HWDocumentViewModel from SubCategoryViewModel ?** Or gene...
[ 0.40448126196861267, -0.17531511187553406, 0.4975738525390625, 0.00881493091583252, -0.3844279646873474, -0.37784403562545776, 0.1326703280210495, -0.19588316977024078, -0.44041547179222107, -0.6197766661643982, -0.05483487248420715, 0.4994490146636963, -0.41399502754211426, 0.191115871071...
<Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
[ -0.11503691971302032, -0.34825336933135986, 0.40618735551834106, 0.0004098723875358701, -0.1909804493188858, -0.09248510748147964, 0.2323349565267563, -0.33733347058296204, 0.03481270372867584, -0.683361291885376, -0.137014240026474, 0.22739708423614502, -0.3498275876045227, 0.012815767899...
<Setter Property="FontWeight" Value="Normal" /> <Setter Property="behaviors:MouseDoubleClick.Command" Value="{Binding MouseDoubleClickCommand}" /> <Setter Property="behaviors:MouseDoubleClick.CommandParameter" Value="{Binding}" />
[ -0.21915119886398315, -0.3296870291233063, 0.20729941129684448, -0.03901655226945877, -0.16314111649990082, 0.1540001630783081, 0.20885585248470306, -0.6141209602355957, -0.14275261759757996, -0.5970518589019775, -0.011656018905341625, 0.7680932879447937, -0.4374522864818573, -0.1494068354...
<Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="FontWeight" Value="Bold" />
[ 0.14137804508209229, -0.20810654759407043, 0.381479412317276, -0.1446792036294937, -0.22474907338619232, 0.3605060279369354, -0.10841258615255356, -0.5988287329673767, -0.19489508867263794, -0.40575581789016724, -0.13522179424762726, 0.3652317523956299, 0.025852715596556664, -0.14687991142...
</Trigger> </Style.Triggers> </Style> </TreeView.ItemContainerStyle>
[ 0.150984525680542, -0.27288511395454407, 0.18804118037223816, 0.27941715717315674, -0.32011738419532776, 0.006837054155766964, 0.24213576316833496, -0.4159701466560364, -0.4181225001811981, -0.2499871701002121, -0.3064071536064148, 0.17187057435512543, -0.21024605631828308, -0.168484702706...
<TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type localvm:SubCategoryViewModel}" ItemsSource="{Binding Children}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding CategoryName}" />
[ -0.38836491107940674, -0.25603702664375305, 0.3941212296485901, 0.056356362998485565, -0.19395017623901367, 0.21659216284751892, 0.15557003021240234, -0.23625005781650543, -0.5023576021194458, -0.553579568862915, -0.30481216311454773, 0.016401933506131172, -0.07834015041589737, 0.023450104...
</StackPanel> </HierarchicalDataTemplate> </TreeView.Resources> </TreeView> ``` I'm not sure I see the problem. You have a tree of subcategories and
[ -0.14129716157913208, 0.003088246565312147, 0.01802121102809906, 0.06547598540782928, -0.1430054008960724, -0.06798936426639557, 0.16746194660663605, -0.08260457962751389, -0.368888795375824, -0.5017621517181396, -0.1793718934059143, 0.3081822097301483, -0.31207275390625, 0.161438852548599...
when one is selected, the appropriate `SubCategoryViewModel` sets itself as `SelectedCategory` on the main `HWDocumentViewModel`. That seems like a reasonable approach. So why do you need to call a command? Why can't you just load the new list in `HWDocumentViewModel` in response to a change of its `SelectedCategory` ...
[ 0.08372267335653305, -0.30451488494873047, 0.45175668597221375, -0.057177621871232986, -0.0689554512500763, -0.19293123483657837, 0.06894459575414658, -0.28372201323509216, -0.16326332092285156, -0.6067013144493103, -0.46888551115989685, 0.7272162437438965, -0.21188104152679443, 0.03268899...
I'm working on a concept that will have objects falling from the top of the screen. For this example lets say, 4 objects: red square, blue square, green square, yellow square. I have all of these objects placed in the interface builder and connected with the names given in the .h files: IBObject UIImageView \*greenSqu...
[ 0.31025373935699463, -0.1796787679195404, 0.6818483471870422, 0.13657395541667938, -0.09773135185241699, 0.16478799283504486, 0.07048434019088745, 0.12669961154460907, -0.35330963134765625, -0.9258431792259216, 0.10688389837741852, 0.2868749797344208, -0.11627916991710663, 0.25743141770362...
reset that one instance since at any given point 1 or more of the same object would be falling. The end result would be x number of the squares of any of the colors would be showing and falling. I'm sure my workflow for this would be: * Set time to pick square * position square * show square * drop square at x rate ...
[ -0.3546139597892761, 0.021303795278072357, 0.5343644022941589, 0.05298763886094093, -0.3980790078639984, 0.4306032359600067, 0.25283944606781006, -0.4233728051185608, -0.3793986439704895, -0.8325791358947754, -0.20639410614967346, 0.550382137298584, -0.3420730531215668, -0.2740466892719269...
[UIImage imageNamed:@"orangeBall.png"]; red = [UIImage imageNamed:@"redball.png"]; ``` I called a method and set a timer: ``` [NSTimer scheduledTimerWithTimeInterval:(0.5) target:self selector:@selector(onTimer) userInfo:nil repeats:YES]; ``` finally, inside the onTimer I create a random number that chooses a ball...
[ -0.39399203658103943, -0.16778527200222015, 0.47378259897232056, -0.05807536467909813, 0.022926226258277893, 0.2875267267227173, -0.18998724222183228, -0.15693464875221252, -0.3188874125480652, -0.6984223127365112, -0.1463225781917572, 0.2417415976524353, -0.37866178154945374, -0.053455915...
I once read this entry in mailing list <http://archives.postgresql.org/pgsql-hackers/2005-06/msg01481.php> ``` SELECT * FROM foo_func( c => current_timestamp::timestamp with time zone, a => 2, b => 5 ); ``` Now I need this kindof solution where I can pass associative array argument to a function. Do I ne...
[ -0.003883665194734931, 0.11728033423423767, 0.2383146733045578, -0.09808237105607986, 0.031285449862480164, 0.10046467930078506, 0.12664198875427246, 0.038899682462215424, -0.426853209733963, -0.560907244682312, 0.07187088578939438, 0.16577403247356415, -0.0996251180768013, 0.3949240446090...
in all non-clustered indices on that table. So your index on `c` also includes `a`, so the condition ``` where c= 3 and a = 3 ``` can be found in that index using an index seek. Most likely, the query optimizer decided that doing a index seek to find `a` and `c` and a key lookup to get the rest of the data is fas...
[ 0.0017476917710155249, -0.001788881840184331, 0.3624652922153473, -0.0046345824375748634, -0.02128184400498867, -0.15107479691505432, -0.021144172176718712, -0.1689906120300293, -0.01212588232010603, -0.4898632764816284, -0.1849769651889801, 0.5424083471298218, -0.19896306097507477, 0.0414...
to get index seeks over scans.
[ 0.1244048997759819, 0.013561451807618141, 0.34953632950782776, 0.46910619735717773, 0.19507057964801788, -0.31926706433296204, -0.034778520464897156, -0.2873004376888275, -0.30539757013320923, -0.6671282052993774, -0.12156252562999725, 0.26404884457588196, -0.12257540971040726, -0.01703227...
I plan to customize mode line in Emacs in near future, and i don't understand the algorithm behind listing minor modes in the mode line. In section «1.3 The Mode Line» of Emacs manual it says: *«MINOR is a list of some of the enabled "minor modes"»* While in section «23.2 Minor Modes» it says: *«Most buffer-local mi...
[ -0.1826087385416031, -0.06182285398244858, 0.4097708761692047, 0.003396341111510992, 0.11863229423761368, -0.1393945962190628, 0.23458291590213776, 0.33081701397895813, -0.17186270654201508, -0.49430564045906067, -0.15226325392723083, 0.922676146030426, -0.3427192270755768, 0.0690668374300...
the mode's own definition. If you read on to section 23.3.3 - Defining Minor Modes: > The string LIGHTER says what to display in the mode line when the mode is enabled; if it is `nil', the mode is not displayed in the mode line. See: `M-:` `(info "(elisp) Defining Minor Modes")` `RET` `C-h``f` `define-minor-mode` ...
[ 0.07593544572591782, -0.48683974146842957, 0.7601677775382996, -0.02292032167315483, 0.13305328786373138, -0.24139375984668732, 0.2340003401041031, 0.003309579798951745, -0.15560312569141388, -0.3746349811553955, -0.5386137962341309, 0.9602677226066589, -0.165466770529747, 0.18924532830715...
I'm using a simple implementation of saxParser. Within my endElement method, I'm storing vo objects to an ArrayList. Unfortunately when I loop over my List, it only returns the last item from my xml data. Just wondering what I'm doing wrong? Relavent code below: ``` public class MyXMLHandler extends DefaultHandler { ...
[ 0.0311399195343256, -0.039692703634500504, 0.7812387347221375, -0.2741585671901703, 0.205363467335701, 0.10867350548505783, 0.47099995613098145, -0.4925463795661926, -0.054082468152046204, -0.488273561000824, -0.10543322563171387, 0.7287237644195557, -0.38275861740112305, 0.430851101875305...
Attributes attributes) throws SAXException { currentElement = true; } @Override public void endElement(String uri, String localName, String qName) throws SAXException { currentElement = false; if (localName.equals("StoreID")) { buffer.toString().trim(); ...
[ -0.14693403244018555, -0.18538567423820496, 0.16337355971336365, 0.05421514809131622, 0.2313222438097, 0.33716097474098206, 0.2577831447124481, -0.3046697676181793, 0.17480437457561493, -0.18496224284172058, 0.0674445629119873, 0.6911113858222961, -0.020541897043585777, 0.4556499719619751,...
buffer.toString().trim(); storeDetails.setStoreName(buffer.toString()); } else if (localName.equals("StoreCategory")) { buffer.toString().trim(); storeDetails.setStoreCategory(buffer.toString()); //add vo object to ArrayList - dataList dataList.add(st...
[ -0.08139754831790924, -0.2717489004135132, 0.7548001408576965, -0.3710196614265442, 0.40157604217529297, 0.2110608071088791, 0.4045494496822357, -0.5753108859062195, -0.014247149229049683, -0.49702462553977966, -0.25001010298728943, 0.6879526376724243, -0.41985630989074707, 0.0698539763689...
buffer = new StringBuffer(); } @Override public void characters(char[] ch, int start, int length) throws SAXException { if (currentElement) { buffer.append(ch, start, length); currentElement = false; } } @Override public void endDocument() throws SAX...
[ 0.044515736401081085, -0.09168561547994614, 0.31497156620025635, -0.29589834809303284, 0.40530234575271606, 0.6819440126419067, 0.14972931146621704, -0.26432517170906067, 0.09739013761281967, -0.18953023850917816, -0.0985136553645134, 0.2925540804862976, -0.2737240493297577, 0.495382785797...
Log.i("TAG", "DONE PARSING XML"); for(StoreDetails details : dataList){ //ISSUE - returning only the last row in my xml data (over and over) Log.i("TAG", "Details ID: " + details.getStoreId()); } } } ``` You have to reinitialize the object after adding it to array list. Othe...
[ 0.15576578676700592, -0.1315363198518753, 0.474588006734848, -0.023716073483228683, 0.06864981353282928, -0.32554346323013306, 0.04694612696766853, -0.24610522389411926, -0.2117905169725418, -0.6690541505813599, -0.2883726954460144, 0.554732084274292, -0.1903248131275177, 0.110802419483661...
, then ``` <Item> <StoreID></StoreID> <StoreName></StoreName> <StoreCategory></StoreCategory> </Item> ``` At startElement you have to initialize the 'storeDetails' object. ``` storeDetails = new StoreDetails(); ``` At endElement you have to add the 'storeDetails' object to the array list. ``` dataList.add(storeD...
[ -0.3790292739868164, -0.1544530987739563, 0.7458469867706299, -0.17299304902553558, 0.07747721672058105, 0.17107407748699188, -0.0002136214025085792, -0.3113294839859009, -0.10879101604223251, -0.7913401126861572, -0.44133391976356506, 0.46127256751060486, -0.2035236805677414, 0.0716287493...
> **Possible Duplicate:** > > [What does 'foo' really mean?](https://stackoverflow.com/questions/53609/what-does-foo-really-mean) I hope it is not the most stupid question ever. Whenever I read about javascript, I see people use the word **FOO**. Where does this word come from? as per wiki The terms foobar /ˈfʊ...
[ 0.5247179865837097, 0.42260679602622986, 0.3885703384876251, -0.4956475496292114, -0.15416213870048523, 0.20194841921329498, 0.1604260504245758, 0.29877859354019165, -0.24206671118736267, -0.12760911881923676, -0.2524017095565796, 0.38362371921539307, -0.6063151359558105, -0.09783201664686...
I have a function which evaluates terms of a polynomial in several variables. The inputs are lists of powers of each variable. For example, for two variables and 2nd order it looks like this, ``` def f(x,y): return [1, x[1], y[1], x[1]*y[1], x[2], y[2]] x = [2**0, 2**1, 2**2] y = [3**0, 3**1, 3**2] >>> f(x,y) [1...
[ -0.03597430884838104, 0.09404772520065308, 0.384194940328598, -0.05625995248556137, -0.33514901995658875, 0.23044264316558838, 0.345636785030365, -0.6213796734809875, 0.28997501730918884, -0.39120736718177795, -0.023622382432222366, 0.4452464282512665, -0.3344583213329315, 0.22976830601692...
currently a speed bottleneck. The profiler tells me I spend most of the time in \_\_times\_\_. Short of creating a C extension module, can anyone see any room for optimization? **Edit:** The example above is trying to evaulate `1 + x + y + xy + x^2 + y^2` with `x = 2`and `y = 3`, except without adding them, just put...
[ -0.11940743029117584, 0.16525179147720337, 0.5207396149635315, -0.052082568407058716, 0.18850786983966827, -0.2485264539718628, 0.09258557856082916, -0.2828419804573059, -0.24587757885456085, -0.549678385257721, -0.11262781172990799, 0.5591998100280762, -0.29892227053642273, 0.268933117389...
numpy should have a [`polyval2d(x,y,c)`](http://docs.scipy.org/doc/numpy/reference/generated/numpy.polynomial.polynomial.polyval2d.html) function into the [`polynomial`](http://docs.scipy.org/doc/numpy/reference/routines.polynomials.polynomial.html) module, that will perfectly apply to your example. You seemed intere...
[ 0.15575920045375824, -0.04422221705317497, 0.23301012814044952, 0.0019986459519714117, -0.07743537425994873, 0.026711193844676018, -0.11522606015205383, -0.057384371757507324, -0.24372096359729767, -0.5869808197021484, -0.004261374473571777, 0.4414302110671997, -0.14102062582969666, -0.011...
I was looking at a tutorial on Regex. It was about how to get the class attribute from this piece of html ``` <pre class="ruby" name="code"> ``` and the regex used was ``` <pre class="([^"]+)" name="code"> ``` They recommended to use the above one instead of ``` <pre class="(.+)" name="code"> ``` "as it goes ...
[ 0.36561527848243713, -0.0638013705611229, 0.18809625506401062, 0.1391979604959488, -0.3309527635574341, -0.2512470483779907, 0.08734889328479767, 0.05157214403152466, -0.00431094178929925, -0.5940399169921875, 0.28107449412345886, 0.6307039856910706, -0.27433228492736816, -0.01551524922251...
right across the tag boundaries: ``` <pre class="ruby" name="code">foo</pre> <pre class="python" name="code">bar</pre> ``` would result in `ruby" name="code">foo</pre> <pre class="python`! So as long as you know exactly what your HTML will look like, `.+` can work, but as soon as it changes unexpectedly (as HTML is...
[ 0.3280327618122101, -0.19621782004833221, 0.5562922358512878, -0.04193473234772682, -0.22037392854690552, -0.2427753359079361, 0.14409245550632477, -0.2926802635192871, -0.05381343886256218, -0.7045140862464905, -0.13504797220230103, 0.7167768478393555, -0.3893013894557953, -0.205151870846...
said, for precisely the same reasons, you shouldn't try and match HTML and other markup languages with regexes anyway because there are better tools for that.
[ 0.4280853569507599, 0.0625767633318901, 0.07724279165267944, 0.45303428173065186, -0.3033113479614258, -0.2587485611438751, 0.18882706761360168, 0.41349175572395325, -0.30157190561294556, -0.6021724343299866, -0.007910726591944695, 0.35574907064437866, -0.1357312798500061, -0.0684029757976...
I just want get a 2 dimension array of List in c#. In my thought, below should works but it didn't, the 1 dimension array of List works. I use Unity3D with Mono, however I think it's language related problem. ``` List<MyType>[,] twoDArrayofList;//don't work, it's type is List<MyType> List<MyType>[] oneDArrayofList;//i...
[ 0.54430091381073, 0.3205278515815735, 0.1364680379629135, -0.22657279670238495, -0.159592866897583, -0.1327541470527649, 0.5318820476531982, -0.19648286700248718, -0.18228910863399506, -0.7375784516334534, 0.06106213107705116, 0.8784716725349426, -0.5605869889259338, -0.0032635359093546867...
"One" }; strings[0, 1] = new List<string> { "Two" }; strings[1, 0] = new List<string> { "Three" }; strings[1, 1] = new List<string> { "Four" }; ```
[ -0.1682201772928238, -0.15196295082569122, 0.22113162279129028, -0.3064848482608795, -0.08341912925243378, 0.1348782330751419, 0.19291789829730988, -0.5071032047271729, -0.22045886516571045, -0.40077850222587585, -0.5518872737884521, 0.6947270035743713, -0.6569831967353821, 0.2107495367527...
After reading some excellent posts about the difference between AppDomain.UnhandledException and Application.DispatcherUnhandledException, it appears that I should be handling both. This is because it is significantly more likely the user can recover from an exception thrown by the main UI thread (i.e., Application.Dis...
[ 0.05071943998336792, 0.19044238328933716, 0.5035057067871094, -0.034439340233802795, 0.05129343271255493, 0.15608373284339905, 0.4777623414993286, -0.1036907359957695, -0.32908669114112854, -0.5779147744178772, -0.32056015729904175, 0.6857837438583374, -0.29534053802490234, -0.000958864053...
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Startup="App_StartupUriEventHandler" Exit="App_ExitEventHandler" DispatcherUnhandledException="AppUI_DispatcherUnhandledException"> <Application.Resources> ...
[ -0.5071858763694763, 0.20053821802139282, 0.6486036777496338, -0.23097315430641174, -0.1099141538143158, 0.29081395268440247, 0.21416664123535156, -0.33053797483444214, -0.4347086250782013, -0.4360410273075104, -0.7423214316368103, 0.31562182307243347, -0.6645330786705017, 0.00221977569162...
any thread. /// </summary> void AppUI_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { if (e.Exception == null) { Application.Current.Shutdown(); return; } string errorMessage = string.Format("An application error occurred. I...
[ -0.04813392087817192, -0.01839904673397541, 0.7560958862304688, -0.11474476754665375, 0.3642190396785736, -0.06130271404981613, 0.6153013110160828, 0.1873874068260193, -0.43692001700401306, -0.534673273563385, -0.402370810508728, 0.4819769263267517, -0.5847527980804443, 0.2873912751674652,...
if (MessageBox.Show(errorMessage, "Application User Interface Error", MessageBoxButton.YesNoCancel, MessageBoxImage.Error) == MessageBoxResult.No) { if (MessageBox.Show("WARNING: The application will close. Any changes will not be saved!\nDo you really want to close it?", "Close the application!", MessageBo...
[ -0.18255265057086945, 0.05754180997610092, 0.6552438139915466, -0.24196864664554596, 0.3382723033428192, -0.08354843407869339, 0.6693264245986938, -0.1440579742193222, -0.17490722239017487, -0.476858526468277, -0.733540415763855, 0.4528946280479431, -0.47470200061798096, 0.3883153200149536...
method for DispatcherUnhandledException will only handle exceptions thrown by the main UI thread. /// Unhandled exceptions caught by this method typically terminate the runtime. /// </summary> void OnDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { str...
[ -0.2715892791748047, -0.10057333111763, 0.4845215082168579, 0.14319075644016266, 0.05404076725244522, -0.0012829473707824945, 0.5802283883094788, -0.21561965346336365, -0.20871669054031372, -0.3433557152748108, -0.21773990988731384, 0.5476557016372681, -0.40978115797042847, 0.2298735380172...
== MessageBoxResult.No) { if (MessageBox.Show("WARNING: The application will close. Any changes will not be saved!\nDo you really want to close it?", "Close the application!", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) == MessageBoxResult.Yes) { Application.Current.Shutdown()...
[ -0.055813267827034, 0.12161741405725479, 0.6507048010826111, -0.2782933712005615, 0.30547896027565, -0.03799084946513176, 0.6925574541091919, -0.07956834882497787, -0.23499862849712372, -0.4489454925060272, -0.5940318703651428, 0.4218157231807709, -0.697563111782074, 0.5339216589927673, ...
on the UI thread. This seems to work reliably, and will replace the `AppDomain.CurrentDomain.UnhandledException` handler on the UI thread (takes priority). Use `e.Handled = true` to keep the application running. * For catching exceptions on other threads (in the best case, they are handled on their own thread), I found...
[ -0.11429460346698761, -0.042504046112298965, 0.4588191509246826, -0.02928551845252514, 0.09178026020526886, -0.22755561769008636, 0.3869314193725586, -0.22167977690696716, -0.48115676641464233, -0.5357072353363037, -0.3812083601951599, 0.4150116443634033, -0.4435218870639801, 0.12194514274...
I am trying to understand the difference between 2 methods that have the same name. This is the code I am trying to understand... ``` public class Test { public static void main(String[] args) { MyPoint p1 = new MyPoint(); MyPoint p2 = new MyPoint(10, 30.5); System.out.println(p1.distance(p...
[ 0.2408665418624878, 0.018168700858950615, 0.3248285949230194, -0.3232630789279938, -0.11412723362445831, 0.3291606903076172, 0.3765287399291992, -0.21607109904289246, 0.3995057940483093, -0.6684269309043884, 0.03998321667313576, 0.18179155886173248, -0.19447213411331177, 0.2899082899093628...
secondPoint); } public static double distance(MyPoint p1, MyPoint p2) { return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y)); } ``` Could someone please explain the difference between the 2 `distance()` methods. What does the type `MyPoint` actually mean? Why does 1 of the methods have...
[ -0.408579021692276, -0.1762363314628601, 0.3868929147720337, 0.02279803715646267, -0.30417105555534363, 0.11912855505943298, 0.0450265072286129, -0.02859000489115715, 0.22304867208003998, -0.6857066750526428, -0.08772378414869308, 0.02267647162079811, -0.30177438259124756, 0.30461734533309...
and the second object is another `MyPoint` object called p2. The difference between the 2 println statements is that the first one runs the `distance(MyPoint)` method, and the second one runs the `distance(MyPoint, MyPoint)` method. Additionally, the first method runs the `distance()` from the `MyPoint p1` object to t...
[ -0.3879769742488861, -0.09851009398698807, 0.42044857144355774, -0.24034443497657776, -0.13047844171524048, 0.09848503768444061, -0.15293025970458984, -0.18165946006774902, 0.08924518525600433, -0.4623371362686157, -0.15243253111839294, 0.376904159784317, -0.14123326539993286, -0.038312744...
I've found this topic which I've implemented (see accepted answer): [javascript equivalent of PHP's call\_user\_func()](https://stackoverflow.com/questions/5818313/javascript-equivalent-of-phps-call-user-func) However, I am having a problem with multiple parameters. I realize what I was doing was turning my paramet...
[ -0.17638085782527924, 0.030532531440258026, 0.5442990064620972, -0.307982474565506, -0.3523631691932678, 0.08027267456054688, 0.30315133929252625, -0.25472819805145264, -0.3275836408138275, -0.3351256549358368, -0.21739892661571503, 0.47098541259765625, -0.3952277898788452, 0.2348081320524...
var len = 0; var fx = ''; var params = ''; for( i in a ){ params = ''; len = a[i].length; fx = a[i][0]; // getting the function name a[i].splice( 0, 1 ); // removing it from array if( len > 1 ){
[ -0.014034570194780827, -0.526226282119751, 0.391777366399765, -0.2962992787361145, -0.35856151580810547, 0.4197453260421753, 0.30238908529281616, -0.48584210872650146, -0.31579992175102234, 0.0753575786948204, -0.27738556265830994, 0.397534042596817, -0.5089842081069946, 0.2592380940914154...
params = a[i].join(", "); // trying to turn the parameters into the right format, but this is turning it into strings I think params = params.replace(/\\'/g,'\''); // bc i was adding slashes with PHP } window[fx](params); } ``` I don't have to use arrays to do this. I don't understand ...
[ 0.1531164050102234, 0.09850163757801056, 0.41328731179237366, -0.24762828648090363, -0.3007511496543884, 0.25532129406929016, 0.34866631031036377, -0.5164812207221985, -0.5218680500984192, -0.21453367173671722, -0.11178434640169144, 0.38177260756492615, -0.606654167175293, -0.2423149347305...
to do this there. Any help on passing multiple parameters would be appreciated. Thanks. First thing to do: Scrap your entire code, start over. Your approach will not get you anywhere where you'd want to be. (Unfortunately I can't tell you where you'd want to be because I cannot make sense of your example.) There ar...
[ 0.3033766448497772, 0.06413593143224716, 0.34946775436401367, -0.2874736785888672, -0.018778212368488312, 0.06579729914665222, 0.042096976190805435, -0.5832072496414185, 0.23245997726917267, -0.6364033818244934, 0.07032938301563263, 0.7171408534049988, -0.5399526357650757, -0.1994637995958...
inside the function (that's the important bit!). `apply` accepts an array of arguments, `call` accepts individual arguments. The closest thing to `call()` is PHP's `call_user_func()`. The closest thing to `apply()` is PHP's `call_user_func_array()`. JavaScript objects share something with PHP arrays: They are key/v...
[ -0.12574352324008942, 0.4137311279773712, 0.7164872288703918, -0.25436481833457947, -0.2594631612300873, 0.13118603825569153, 0.19881409406661987, -0.6186656355857849, 0.1051734983921051, -0.4161149859428406, -0.08598968386650085, 0.5583816170692444, -0.5013684034347534, 0.0872436389327049...
gives you the freedom to choose an object property dynamically. If this property happens to be a function, `apply()` gives you the freedom to choose function arguments dynamically. Every top-level function that has not been declared as the property of some object will become the property of the *global* object. In bro...
[ -0.24319788813591003, -0.13306617736816406, 0.2695607841014862, 0.07575500011444092, -0.20882898569107056, -0.34807103872299194, 0.3232542872428894, 0.12740956246852875, -0.2943396270275116, -0.392089307308197, -0.2791258990764618, 0.6319267749786377, -0.2736065089702606, 0.025199968367815...
does not really exist in JavaScript. Things can be modeled that way, but it's only a convention.) With direct calling (`obj.foo(1, 2, 3)`), `this` will point to `obj`. With `call` and `apply`, `this` will point to whatever object you want to. This is a lot more useful than it sounds at first. Most of the time when you...
[ -0.14946235716342926, -0.02462288737297058, 0.3460824191570282, -0.26696234941482544, -0.11996551603078842, -0.04545880854129791, 0.10338591039180756, 0.011586371809244156, -0.08155442774295807, -0.46701177954673767, -0.26796528697013855, 0.49695900082588196, -0.7649440169334412, 0.0276648...
I have a many-to-many relationship and I want to find all W's and their sum (frequency) for some A's that were created\_at a certain date. What's the best way to do this? The result should **NOT** be: ``` w.name | sum -------+------ bar | 2 bar | 5 baz | 4 bim | 3 foo | 2 foo | 3 ``` Th...
[ 0.12207774817943573, 0.18746249377727509, 0.4608958065509796, -0.3789263665676117, -0.09844338148832321, 0.050053928047418594, 0.3479478061199188, -0.6305956840515137, 0.024163004010915756, -0.4221009314060211, -0.09209353476762772, 0.6228403449058533, -0.4840708374977112, 0.30860874056816...
| 3 foo | 5 ``` My tables: Table A: ``` id | title | author | created_at ----+-------+--------+------------- ... | ... | ... | ... 11 | abc | ccc | Thu, 5 Apr 2012 08:01:25 GMT 12 | bcb | ddd | Thu, 5 Apr 2012 10:11:15 GMT 13 | dfg | aaa | Fri, 6 Apr 2012 07:33:45 GMT ``` Table A...
[ -0.27912193536758423, 0.8974303007125854, 0.676518440246582, -0.08807851374149323, -0.2001117765903473, 0.23163588345050812, 0.2046957015991211, -0.4395858943462372, -0.41916587948799133, -0.6075586080551147, -0.3764135241508484, 0.02477141097187996, -0.11019104719161987, 0.308941036462783...
| 11 | 2 | 2 202 | 11 | 3 | 4 203 | 11 | 17 | 2 204 | 12 | 17 | 3 205 | 12 | 66 | 1 206 | 12 | 12 | 2 207 | 12 | 24 | 5 208 | 12 | 7 | 3 209 | 13 | 2 | 5 210 | 13 | ... | ... ``` Table W: ``` id | name | ...
[ -0.10815741121768951, 0.36027097702026367, 0.7018939256668091, -0.16714651882648468, 0.11556306481361389, 0.3317290246486664, 0.24661803245544434, -0.6896066665649414, -0.5048500895500183, -0.4052415192127228, -0.26476001739501953, 0.025951916351914406, 0.11229410022497177, 0.0465614236891...
----+-------+-------- ... | ... | ... 2 | bar | ... 3 | baz | ... ... | ... | ... 7 | bim | ... ... | ... | ... 17 | foo | ``` It's certainly not wrong to put more than one statement in a switch, but it looks like there could be some duplication here, especially if the needed val...
[ 0.2532481849193573, 0.3290567398071289, 0.3315422236919403, -0.35884326696395874, -0.19816020131111145, 0.12104601413011551, 0.46946778893470764, -0.2604655921459198, -0.25190505385398865, 0.022149285301566124, -0.3568810522556305, 0.2660227119922638, -0.523902177810669, 0.1612876802682876...
ID are changed. It seems to me that you would have to use a map collection object for both `viewName` and `refValue` that maps the id's with the corresponding values. Then use `yourCollection.get(id);`. That will certainly keep your code best maintainable and consistent. ``` Dictionary<string, string> _refValues = ne...
[ 0.2326991856098175, 0.01771855354309082, 0.7613580822944641, -0.06834578514099121, 0.22313840687274933, -0.011680368334054947, 0.12797479331493378, -0.5116893649101257, -0.3050047755241394, -1.0278650522232056, -0.08439291268587112, 1.0575330257415771, -0.39662447571754456, 0.0146199483424...
is not even yet the best solution. The best would be that you use a dictionary to couple the refValues to the viewNames, and then another dictionary that maps the ids to the refvalues. You can then get the refValue by using the id as key, and then the returned refValue as the key to get the viewName. Hope I made myself...
[ 0.02118789590895176, -0.06920257210731506, 0.7860103845596313, 0.09279980510473251, 0.2954120635986328, 0.04085048660635948, -0.046139832586050034, -0.07094035297632217, 0.2443116009235382, -0.6572047472000122, -0.04871015250682831, 0.8915005922317505, 0.05089499428868294, -0.1066224724054...
If I run a C/C++ program in gdb (after compiling with the -g flag) and I examine the addresses of certain variables, arguments...etc, and then I run it outside of gdb (using `./`) will these addresses be the same as the ones I saw in gdb? If they're different are they usually similar or will they be drastically differe...
[ 0.18269670009613037, 0.2105722576379776, 0.20559147000312805, 0.03114471398293972, -0.026743685826659203, -0.0213220976293087, 0.15925617516040802, -0.26601657271385193, 0.03445636108517647, -0.6406221389770508, -0.07630221545696259, 0.439043790102005, -0.6207788586616516, -0.0248847678303...
I run it outside of gdb (using ./) will these addresses be the same as the ones I saw in gdb It depends. 1. Global variables defined in the main executable will stay at the same address (unless the executable is built with `-fpie` and linked with `-pie` flags. 2. Global variables defined in other shared libraries may...
[ 0.1570693999528885, -0.2855342924594879, 0.3498598039150238, -0.07489952445030212, -0.1989642232656479, -0.09585434943437576, 0.4437015950679779, 0.08315873891115189, -0.3131960332393646, -0.5320718288421631, -0.19882620871067047, 0.44493770599365234, -0.6234773993492126, 0.008613706566393...
debugging easier. You can re-enable ASLR under GDB with `set disable-randomization off`. That may allow you to reproduce the problem under GDB. > I have a buffer overflow Also note, that tools like [Valgrind](http://valgrind.org/) and [Address Sanitizer](http://code.google.com/p/address-sanitizer/) are often signific...
[ -0.12496776878833771, -0.08100157231092453, -0.08688904345035553, -0.015145381912589073, -0.4115186035633087, -0.35658353567123413, 0.6807956099510193, 0.032438840717077255, -0.4406379461288452, -0.8102269172668457, -0.28640684485435486, 0.49066805839538574, -0.3624844253063202, 0.13801088...
I'm having trouble wrapping my head around a way to use recursion to create a list and then returning that list for the base case. Specifically, I'm entering two 32 bit numbers (x1 and x2) into an ALU and evaluating them bit by bit (via ALU1) and then creating a list of the resulting number. My base case for this recur...
[ 0.06707267463207245, 0.2478889375925064, 0.2088320255279541, -0.05101323872804642, -0.08788087218999863, 0.26991793513298035, 0.2065228670835495, -0.2835848927497864, -0.2633242905139923, -0.5780495405197144, -0.016080057248473167, 0.2747676968574524, -0.38642650842666626, 0.08235202729701...
This is my first go at functional programming, so thanks in advance. ``` (define ALU-helper (lambda (selection sub x1 x2 carry-in n) (if (null? x1) (________?) (cons (ALU1 selection sub (car x1) (car x2) carry-in n) (ALU-helper selection sub (cdr x1) (cdr x2) ...
[ -0.35228607058525085, 0.039917103946208954, 0.3109470009803772, -0.2151578962802887, 0.04059067368507385, 0.19128428399562836, -0.18539166450500488, -0.48876655101776123, -0.0935162678360939, -0.20255868136882782, -0.322714626789093, 0.6010437607765198, -0.4704030156135559, -0.258947342634...
`x1` and `x2` have the exact same length, this should work: ``` (define ALU-helper (lambda (selection sub x1 x2 carry-in n) (if (null? x1) '() (cons (ALU1 selection sub (car x1) (car x2) carry-in n) (ALU-helper selection sub (cdr x1) (cdr x2) carry-in (- n 1)))))) ``` When y...
[ -0.26692014932632446, 0.09285098314285278, 0.2704513967037201, -0.21749114990234375, -0.09186647087335587, 0.08911530673503876, -0.07419157028198242, -0.5100117325782776, -0.06990428268909454, -0.11768914759159088, -0.5359798073768616, 0.50700843334198, -0.5471992492675781, -0.255778640508...
`if (null? lst)` then return the empty list `'()`. That's because the resulting list is being built at each step when you `cons` new elements; when you reach the last element of the input list, you've already built the output list and the only thing left to do is returning the end-of-list marker, `'()`. To see it more...
[ -0.01870856061577797, 0.20972087979316711, 0.3498222231864929, -0.3009999394416809, 0.27383336424827576, 0.107554130256176, 0.1081843450665474, -0.19004175066947937, -0.12355154752731323, -0.4975909888744354, -0.39572200179100037, 0.6853592991828918, -0.28023356199264526, 0.331760853528976...
(copy (cdr lst))))) (copy '(1 2 3 4 5)) > (1 2 3 4 5) ``` Notice that again the base case is `if (null? lst)` and the recursive step `cons`es the current element of the list `(car lst)` with the result of recurring on `(cdr lst), the rest of the list. In your case, you perform`ALU1`, an operation on the current elem...
[ -0.0009066671482287347, -0.07390184700489044, 0.35130250453948975, -0.24951483309268951, 0.15490148961544037, -0.018428124487400055, 0.03775344789028168, -0.2914940118789673, -0.2127286046743393, -0.4419255256652832, -0.44582894444465637, 0.5146671533584595, -0.5716875791549683, 0.20012083...
I have files a1 a2 a3 b1 b2 b3 and I need to exclude a2 and b2 from the list using `ls` command only. Try this: ``` $ ls [a-b][13] a1 a3 b1 b3 ``` Or ``` $ shopt -s extglob $ ls !(*2) a1 a3 b1 b3 ```
[ 0.19929254055023193, 0.35024771094322205, 0.04508369043469429, -0.43755438923835754, 0.24789489805698395, 0.28347814083099365, 0.2780584394931793, -0.19552817940711975, -0.2776687741279602, -0.4750652015209198, -0.17128778994083405, 0.4916118085384369, -0.4779722988605499, -0.0135593479499...
For example, `chineseName.sort((function(a,b){return a.localeCompare(b)}));` The javascript function localeCompare works well for IE and firefox, but not in Chrome. Dose anyone know how to make the code compatible for Chrome? > I've found a sample template in the ANTLR website, its the Javatreeparser.g, which the site ...
[ 0.11634686589241028, 0.25005051493644714, 0.3658680021762848, -0.29407772421836853, -0.11360403895378113, -0.21904635429382324, 0.3368626534938812, -0.1683797687292099, -0.013711854815483093, -0.8781796097755432, -0.06711775064468384, 0.46755659580230713, -0.43195149302482605, -0.198600098...
is done by the parser created from `Java.g`. > What I've done so far is placing the grammar file together with my existing java grammar. That is incorrect. The tree grammar `JavaTreeParser.g` expects an AST as input that the parser generated from `Java.g` produced. You can't just plug in another parser (or other tree...
[ 0.4204070270061493, 0.06544278562068939, 0.14153467118740082, -0.18653453886508942, -0.2611854374408722, 0.10770571976900101, 0.46562492847442627, -0.29171374440193176, -0.2390976846218109, -0.7246266603469849, -0.2307669073343277, 0.5906479954719543, -0.380991667509079, -0.295535653829574...
I wanted you to give it a try yourself first (yes, I'm mean!) ;) Here's a quick demo: 1. copy the `Java.g` in a directory and remove the `@header{...}` and `@lexer:::header{...}` declarations from it; 2. copy `antlr-3.3.jar` into the same directory; 3. create the files `Main.java` and `Test.java` in this directory (...
[ 0.5793273448944092, -0.04192734882235527, -0.04600213095545769, -0.03906024619936943, 0.015728382393717766, 0.03905205801129341, 0.5804932713508606, -0.3882240951061249, 0.10207808762788773, -0.7327716946601868, 0.09823253005743027, 0.4254486560821533, -0.27227118611335754, -0.036876898258...
void main(String[] args) throws Exception { JavaLexer lexer = new JavaLexer(new ANTLRFileStream("Test.java")); JavaParser parser = new JavaParser(new CommonTokenStream(lexer)); CommonTree tree = (CommonTree)parser.javaSource().getTree(); DOTTreeGenerator gen = new DOTTreeGenerator(); ...
[ -0.34337297081947327, 0.10645938664674759, 0.5571512579917908, -0.10679806768894196, 0.08410830795764923, 0.16107332706451416, 0.402172714471817, -0.4782920479774475, -0.22844186425209045, -0.6209593415260315, -0.234762042760849, 0.4844227433204651, -0.5207140445709229, 0.03707428276538849...
`Main` class and pipe the output to a file called `ast.dot`. ``` java -cp .:antlr-3.3.jar Main > ast.dot ``` *(on Windows, do: `java -cp .;antlr-3.3.jar Main > ast.dot`)* If you now open the file `ast.dot`, you see a [DOT](http://en.wikipedia.org/wiki/DOT_language) representation of the AST produced by the parser. ...
[ 0.16223953664302826, -0.11982285231351852, 0.7592890858650208, -0.23996280133724213, -0.18920032680034637, 0.4622350037097931, 0.23633842170238495, 0.15416309237480164, -0.37727677822113037, -0.8926028609275818, -0.31441906094551086, 0.402465283870697, -0.5413365364074707, -0.1023377627134...
I think there is something I don't understand about same origin limitation for `XMLHttpRequest`. Instead of forbidding Javascript code to send http request to different hosts (something that is really annoying for legitimate uses) wouldn't have been better to just allow the request but not sending or accepting cookies...
[ 0.5136411786079407, 0.018573163077235222, -0.11343320459127426, 0.1357826590538025, -0.6651561856269836, -0.6633243560791016, 0.43713849782943726, 0.062183309346437454, -0.18915347754955292, -0.4449978768825531, -0.0036977960262447596, 0.34682801365852356, -0.5387725830078125, 0.5360744595...
wouldn't have been better to just allow the request but not sending or accepting cookies in that case? That is what [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/) specifies. > Care must always be taken by applications when making cross-origin requests with user credentials, and servers processing ...
[ 0.15618576109409332, 0.14648185670375824, 0.25418299436569214, 0.07221163064241409, 0.06447067856788635, -0.1388295590877533, -0.048856351524591446, -0.18295374512672424, -0.11877476423978806, -0.5513298511505127, -0.2090650200843811, 0.3152224123477936, -0.09223631769418716, 0.15195168554...
... > > > ### [omit credentials flag](http://www.w3.org/TR/cors/#omit-credentials-flag) > > > Set when user credentials are to be excluded in the request and when cookies are to be ignored in its response. --- > Forbidding a specific script to get something that literally everyone else in the internet can get see...
[ 0.3628695011138916, 0.10294748097658157, 0.30400344729423523, -0.14202561974525452, -0.32704684138298035, -0.5566858053207397, 0.6236976385116577, -0.1150784119963646, -0.25024479627609253, -0.3904939591884613, -0.17746946215629578, 0.2454831302165985, -0.4003264009952545, 0.15292444825172...
How to bind data source to Report Viewer. I am using report viewer and at run time it is showing error?? might be I am missing some where?? Dragged a Table into your rdlc View, and assigned a datasource to the table. Hope this will help you
[ 0.24334567785263062, -0.007002466358244419, 0.3725490868091583, 0.191036656498909, -0.11297392845153809, -0.12431886792182922, 0.08167721331119537, -0.4501042366027832, -0.26944035291671753, -0.8050206899642944, 0.2679341435432434, 0.0971461609005928, -0.25683826208114624, 0.22421187162399...
I have a list of users and a list of vaccines, I'd like to keep track of which vaccines a user has so I have a vaccine\_users table as well. I want to display a list of checkboxes in a view, name of vaccine and wether a user has been vaccinated with that particular vaccine. I'm currently using a ListActivity, which I'...
[ 0.7682483196258545, 0.1994931846857071, 0.22968269884586334, 0.0437968447804451, -0.32901424169540405, 0.02441619709134102, 0.17700381577014923, 0.027393624186515808, -0.24544866383075714, -0.8676099181175232, 0.4888302981853485, 0.3165925145149231, -0.1850762665271759, 0.37117207050323486...
not have. So I'd like something like this: ``` userId vaccineId hasVaccine 1 2 0 1 2 1 ``` I've got tables user, vaccine, vaccine\_user and I can query for which vaccine a user has, but it's the hasVaccine=0 row that gives me trouble since I don't store which vaccin...
[ 0.7245863676071167, 0.26332539319992065, 0.13924452662467957, -0.2502540946006775, -0.25834789872169495, 0.09141692519187927, 0.03308966010808945, -0.05288528650999069, -0.20984037220478058, -1.1193522214889526, 0.46445634961128235, 0.32210537791252136, -0.502717912197113, 0.27792167663574...
join is on the right track, I tried this: ``` SELECT v.name, u._id as userId, vu._id as vaccineId FROM user u LEFT OUTER JOIN vacc_user vu ON u._id = vu.userId LEFT OUTER JOIN vaccine v ON v._id = vu.vaccineId WHERE u._id = 4; ``` And I think it should result in this ``` name userId vaccineId Ebola ...
[ 0.3642441928386688, -0.015604219399392605, 0.802535355091095, -0.08823703229427338, -0.1409846693277359, 0.07677198946475983, 0.08723273873329163, -0.42165035009384155, -0.26512381434440613, -0.6767284870147705, 0.36823663115501404, 0.38115495443344116, -0.6345493197441101, 0.6162433624267...
Hep A but I just get the Ebola row. EDIT 2: Here's the relevant tables in their current form, created for sqllite3 but will hopefully work for MySql as well. ``` CREATE TABLE user (_id integer primary key autoincrement, name text not null default 'unnamed'); CREATE TABLE vacc_user(_id integer primary key autoincremen...
[ 0.2013399600982666, 0.06789781153202057, 0.506222128868103, -0.3639959394931793, -0.2603985667228699, 0.1128808781504631, 0.24360273778438568, -0.4821110665798187, 0.05143919587135315, -0.6988942623138428, -0.038281992077827454, 0.573672890663147, -0.7775434255599976, 0.023798692971467972,...
// set document listener textField.getDocument().addDocumentListener(new MyListener()); // get the preferences associated with your application Preferences prefs = Preferences.userRoot().node("unique_string_representing_your_preferences"); // load previous value textField.setText(prefs.get("your_pre...
[ -0.0013222775887697935, -0.06893402338027954, 0.9337450265884399, -0.4468221664428711, 0.1881372034549713, 0.2247830629348755, 0.04839535430073738, -0.5339745879173279, 0.014475199393928051, -0.8147836923599243, -0.3192315697669983, 0.7037622332572937, -0.24076925218105316, 0.2561472654342...
try { // save textfield value in the preferences object prefs.put("your_preference_unique_key", document.getText(0, document.getLength())); } catch (BadLocationException e) { e.printStackTrace(); } } @Override public void insertUpdate(DocumentEvent arg0) ...
[ 0.0851064994931221, -0.2516714334487915, 0.35003662109375, -0.3322364091873169, 0.49599021673202515, 0.13013020157814026, 0.3558613955974579, -0.469805508852005, 0.21905192732810974, -0.5776943564414978, -0.16951172053813934, 0.5603485703468323, -0.5516787171363831, -0.1156630665063858, ...
{ } } ``` but in this way every time you change value in the text field it is saved. If you want to save it only when application is closed, you can add a WindowListener to your application and write in its > windowClosing method the content of the previous changedUpdate.
[ -0.009107791818678379, -0.032537832856178284, 0.5391851663589478, -0.18398365378379822, -0.05676976963877678, -0.05271975323557854, 0.018802626058459282, 0.23198610544204712, -0.16615092754364014, -0.8174680471420288, -0.1712946742773056, 0.5466850996017456, -0.29876813292503357, 0.3018063...
I find myself again and again implementing a validation system. I was just wondering if somebody could recommend some kind of open source Java library that would have all the necessary methods to validate input field. Mainly it should have methods to check if a string represents a proper float or integer. Character va...
[ 0.27156928181648254, 0.026292718946933746, -0.03162414953112602, 0.01698346808552742, -0.4750666618347168, -0.21672074496746063, 0.351118266582489, 0.005243084393441677, -0.08669756352901459, -0.5907146334648132, 0.045856475830078125, 0.43379637598991394, -0.1985383927822113, -0.0474587976...