text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
int checkedId) { if (group.getChildAt(0).getId() == checkedId) { responses.add(0); // the first answer was checked } else if (group.getChildAt(1).getId() == checkedId) { responses.add(1); // the first answer was checked } else if (group.getChildAt(2).get...
[ 0.0755099505186081, -0.38803622126579285, 0.21900875866413116, -0.16923107206821442, -0.11358261853456497, 0.02040884457528591, 0.4343131184577942, -0.7744542360305786, 0.11657456308603287, -0.4574471712112427, -0.4752761125564575, 0.4470469653606415, -0.5892653465270996, -0.19157855212688...
responses.add(2); // the first answer was checked } } }); ```
[ 0.13864699006080627, 0.009927111677825451, 0.27743011713027954, -0.17895151674747467, -0.11508572846651077, 0.14264453947544098, 0.22699743509292603, -0.4096737205982208, -0.14565132558345795, -0.5003043413162231, -0.46337196230888367, 0.5364760756492615, -0.6851680278778076, 0.06658670306...
I have several JRadioButtons in a ButtonGroup. ``` private ButtonGroup radioGroup= new ButtonGroup(); private JRadioButton radio1= new JRadioButton("Red"); private JRadioButton radio2= new JRadioButton("Green"); private JRadioButton radio3= new JRadioButton("Blue"); radioGroup.add(radio1); radioGrou...
[ -0.28474536538124084, -0.1583195924758911, 0.7140146493911743, -0.3111218214035034, 0.23467206954956055, 0.35788509249687195, 0.3421376347541809, -0.5389931797981262, -0.25004690885543823, -0.7046234011650085, -0.2259160727262497, 0.5602990388870239, -0.39678066968917847, -0.12764823436737...
if you set the actionCommand first. e.g.,: ``` // code not compiled, run, nor tested in any way String[] colors = {"Red", "Green", "Blue"}; JRadioButton[] radioBtns = new JRadioButton[colors.length]; for (int i = 0; i < radioBtns.length; i++) { radioBtns[i] = new JRadioButton(colors[i]); radioBtns[i].setActionCo...
[ 0.1714560091495514, -0.4348146915435791, 0.494373619556427, -0.359769344329834, 0.27102020382881165, -0.1646091192960739, 0.6833402514457703, -0.669196367263794, -0.16484428942203522, -0.5395664572715759, -0.7050563097000122, 0.7324315309524536, -0.2988322675228119, -0.09200569242238998, ...
I have some problems with using wxHTTP inside a Thread. I have created below class which derive from wxThread to use wxHTTP. ``` class Thread : public wxThread { private: wxHTTP get; public: Thread() { } ~Thread() { } virtual ExitCode Entry() { get.SetHeader(wxT("Content-Type"), wxT("text/html; charset=utf-8"))...
[ 0.14744125306606293, 0.08746088296175003, 0.7419413924217224, 0.08713424205780029, 0.09201079607009888, -0.09996682405471802, 0.691236138343811, 0.00966376531869173, -0.22033174335956573, -0.6990148425102234, -0.14118477702140808, 0.4995681345462799, -0.5403580665588379, 0.4061941802501678...
way to create wxHTTP connection inside a thread? Here is the answer (as requested by @bluefeet) wxHTTP inherits from wxSocketBase and in wxSocketBase we have this quote > When using wxSocket from multiple threads, even implicitly (e.g. by using wxFTP or wxHTTP in another thread) you must initialize the sockets from th...
[ 0.47125044465065, -0.039122309535741806, 0.061930228024721146, -0.0806734636425972, -0.03931208327412605, -0.23582035303115845, 0.12304903566837311, -0.20942793786525726, -0.1772991120815277, -0.6204144954681396, 0.01713913306593895, 0.07188599556684494, -0.41961368918418884, 0.34011161327...
Alright. Now this question is pretty hard. I am going to give you an example. Now the left numbers are my algorithm classification and the right numbers are the original class numbers ``` 177 86 177 86 177 86 177 86 177 86 177 86 177 86 177 86 177 86 177 89 177 89 177 89 177 89 177 89 177 89 177 89 ``` So here my a...
[ -0.09529725462198257, 0.28452008962631226, 0.1721198856830597, -0.0623529888689518, -0.07732441276311874, 0.3773000240325928, 0.2778409719467163, -0.4263055920600891, -0.8070135116577148, -0.5328903794288635, 0.2657349109649658, 0.38388699293136597, -0.3285435736179352, 0.37980344891548157...
classification and the right numbers are original class ids. As can be seen above it miss classified 3 products (i am classifying same commercial products). So at this example what would be the error rate? How would you calculate. This question is pretty hard and complex. We have finished the classification but we ar...
[ -0.3170296847820282, -0.1211601123213768, -0.05533907562494278, 0.2524065673351288, -0.07680562138557434, 0.4266000986099243, -0.08363976329565048, -0.15778674185276031, -0.19258923828601837, -0.7558432221412659, -0.172042578458786, 0.24582478404045105, -0.08436817675828934, 0.389361739158...
A B C D E F G H I J ----------------------------------------------------- 0: 2 4 1 546 1 1: 71 249 11 1 6
[ -0.06513407826423645, 0.48716044425964355, 0.1813706010580063, -0.13528655469417572, -0.3872765600681305, 0.23531976342201233, 0.236837238073349, -0.2886253297328949, 0.37971368432044983, -0.23233731091022491, -0.1289767026901245, -0.026356318965554237, -0.3630598783493042, 0.2738159298896...
228 5 2: 13 5 64 1 13 1 460 3: 29 2 507 20 5 9 4: 33 483 4
[ 0.06988529115915298, 0.7111146450042725, 0.1311931610107422, -0.0837797299027443, -0.2255352884531021, 0.6465951800346375, 0.5070990920066833, -0.26247283816337585, 0.004516886081546545, -0.7093195915222168, 0.20473730564117432, 0.12073429673910141, -0.09586967527866364, 0.4484114944934845...
38 5 3 2 5: 1 1 2 58 3 480 13 6: 2 1 2 294 1 1 257 7: 1 5
[ 0.32523655891418457, 0.5212985277175903, -0.10563186556100845, -0.06415879726409912, -0.35188931226730347, 0.5062398910522461, 0.30609941482543945, -0.3649630844593048, 0.051305439323186874, -0.4576084017753601, -0.02205980196595192, 0.03263559564948082, -0.1797410100698471, 0.269982010126...
1 546 6 7 8: 415 15 2 5 3 12 13 87 2 9: 46 72 2 357 35 1 47 2 ---------------------------------------------------- 580
[ 0.15313692390918732, 0.44874581694602966, 0.11685099452733994, 0.30308303236961365, -0.11559692025184631, 0.6031854748725891, 0.3831091821193695, -0.28166547417640686, -0.3125389814376831, -0.29353103041648865, -0.10243714600801468, 0.14370045065879822, -0.1135447546839714, 0.2158884108066...
383 496 1002 307 670 549 557 810 266 estimates in each cluster y class sizes: [554 571 557 572 568 558 558 566 554 562] kmeans cluster sizes: [ 580 383 496 1002 307 670 549 557 810 266] ``` For example, cluster A has 580 data points, 415 of which are "8"s; cluster B has 383 data points, 249 of which ...
[ -0.37606534361839294, 0.28814682364463806, 0.1636326164007187, 0.11656101793050766, 0.02457481250166893, 0.7547338008880615, 0.4324215054512024, 0.10683027654886246, -0.592589259147644, -0.3700762391090393, -0.5531488656997681, -0.07196063548326492, -0.061225734651088715, 0.392868965864181...
B C D E F G H I J 8 1 4 3 6 7 0 5 2 6 415 249 483 507 294 546 546 480 460 257 ``` One
[ 0.2801364064216614, 0.6999136209487915, -0.15528064966201782, -0.28320038318634033, -0.2446088343858719, 0.22024807333946228, 0.3426717519760132, -0.3452833592891693, -0.11715579777956009, -0.17968125641345978, -0.2991090416908264, 0.1162835881114006, -0.3158878982067108, 0.429114997386932...
*could* say that the "success rate" is 75 % = (415 + 249 + 483 + 507 + 294 + 546 + 546 + 480 + 460 + 257) / 5620 but this throws away useful information — here, that E and J both say "6", and no cluster says "9". So, add up the biggest numbers in each column of the confusion matrix and divide by the total. But, ...
[ -0.17056579887866974, 0.126630961894989, -0.0883508026599884, 0.23814484477043152, 0.011576014570891857, 0.13074201345443726, 0.5679766535758972, -0.1526566594839096, -0.3699544072151184, -0.6224269270896912, -0.014223880134522915, 0.05082046240568161, 0.18051859736442566, 0.24644368886947...
throw away information; look at the whole confusion matrix. NB such a "success rate" will be optimistic for new data ! It's customary to split the data into say 2/3 "training set" and 1/3 "test set", train e.g. k-means on the 2/3 alone, then measure confusion / success rate on the test set — generally worse than...
[ 0.20107531547546387, 0.16458261013031006, -0.13394249975681305, 0.28876015543937683, -0.24889826774597168, 0.1426163911819458, 0.5061705708503723, -0.3543837070465088, -0.08398806303739548, -0.6052477359771729, -0.2883357107639313, 0.29085785150527954, 0.15942032635211945, 0.24818372726440...
I'm new to Spring Data with MongoDB and would like to have an automagically generated query method inside my MongoRepository extension interface which requires filtering, sorting and limiting. The query looks like this: ``` // 'created' is the field I need to sort against find({state:'ACTIVE'}).sort({created:-1}).l...
[ -0.31945639848709106, -0.3309389650821686, 0.37878963351249695, 0.044916730374097824, -0.10106144845485687, 0.20056411623954773, -0.0166824609041214, -0.13098858296871185, -0.25237494707107544, -0.37940549850463867, 0.02069726027548313, 0.5802870392799377, -0.19369396567344666, 0.003727406...
Job findOneActiveOldest(); ... } ``` I know that one can add a Sort argument to a query method in order to get sorting but the problem is limiting the results to just a single object. Is this possible to do without having to write a custom JobRepositoryImpl? Thanks Edit: Example of what I am looking for: ```...
[ -0.46512383222579956, -0.09057603031396866, 0.7547768950462341, -0.07529762387275696, -0.06211814656853676, -0.15123017132282257, 0.1947462558746338, -0.17799022793769836, -0.13364800810813904, -0.8134366869926453, -0.07411901652812958, 0.5817338824272156, -0.4330623149871826, -0.245169356...
= new PageRequest(0, 1, new Sort(Sort.Direction.DESC, "created")); Job job = repository.findOneActiveOldest(request).getContent().get(0); ```
[ -0.3233007490634918, 0.03826429694890976, 0.5576428174972534, -0.19049827754497528, 0.3097004294395447, 0.23922055959701538, 0.524828314781189, -0.1867818385362625, -0.19547419250011444, -0.7220744490623474, -0.4940134584903717, 0.39438846707344055, -0.23206476867198944, 0.3696491122245788...
I am front end developer and new to TDD and BDD. I have this task. Populate a table with json object received from an AJAX call. How would I describe this in a suite and spec? Thanks in advance **EDIT** I am using BackboneJS for MVC and sinon.js for spies, stubs etc. You don't mention a lot about what libraries you...
[ 0.28483906388282776, 0.06752774864435196, 0.4755430817604065, -0.03373266011476517, -0.20629407465457916, -0.3349808156490326, 0.13804803788661957, 0.07440517842769623, -0.17463688552379608, -0.8808174133300781, -0.13980096578598022, 0.4351266026496887, -0.14118830859661102, 0.223546400666...
populate_table }); ``` Also I will assume that the server would return the following object `{row: [1, 2, 3]}` For starters you need to mock the ajax response since you don't want to be relying on your server being available. The mocking, checking of parameters and fake return of the data can be achieved by using a *...
[ 0.1621527373790741, -0.19665583968162537, 0.7134655117988586, 0.12121855467557907, 0.004781352821737528, 0.12021230161190033, 0.26395249366760254, -0.14537446200847626, -0.0238645039498806, -0.4579559862613678, -0.16420739889144897, 0.7095813155174255, -0.3193519711494446, -0.1311796605587...
result. Finally, you need to see whether your table was populated. You don't provide any info on the data or the table, but again guessing that you use jQuery, you should give a try to [jasmine-jquery](http://github.com/velesin/jasmine-jquery). With it you can easily describe expectations on your DOM, have a look at t...
[ 0.04216765984892845, -0.48246660828590393, 0.482361763715744, 0.09744087606668472, 0.005683297291398048, -0.09771743416786194, 0.20539452135562897, -0.31612545251846313, 0.01597493141889572, -0.5945204496383667, 0.07053166627883911, 0.47950807213783264, -0.007211583200842142, -0.3116094470...
expect(options.data.foo).toEqual('bar'); options.success({row: [1, 2, 3]}; }); $.ajax({ url: 'http://server/populate_table', data: {foo: 'bar'}, success: populate_table }); expect($('#mytable')).toExist(); // DOM specific expectations go here... }); ```
[ -0.07190454751253128, -0.4581868350505829, 0.4770483672618866, -0.17101527750492096, 0.2587571144104004, 0.28389090299606323, 0.33404600620269775, -0.14706909656524658, -0.20453953742980957, -0.6717582941055298, -0.19688157737255096, 0.9748644232749939, -0.019424114376306534, -0.1576300114...
So currently I am attempting to save an indexPath and access it, yet I keep receiving the EXC\_BAD\_ACCESS error, and when I use the Analyze tool in xcode, it says that the value stored to my indexPath during its initialization is never read. Can anybody help and tell me what's going wrong here? Method to set indexPat...
[ 0.16617749631404877, 0.12562577426433563, 0.5489541888237, -0.019054288044571877, 0.161141037940979, 0.10176059603691101, 0.31629204750061035, -0.2931184768676758, -0.08454151451587677, -0.8215518593788147, -0.01730986498296261, 0.6554476022720337, -0.0712958425283432, 0.32062989473342896,...
= [[FoodDescription alloc] initWithNibName:@"FoodDescription" bundle:nil]; // pass the food detailViewController.aFood = [[NSMutableDictionary alloc] initWithDictionary:[_foodArray objectAtIndex:indexPath.row]]; detailViewController.foodPicture = foodImage; detailViewController.restaurantName = _restaurantName; // Pa...
[ 0.07395992428064346, 0.28930583596229553, 0.20824840664863586, -0.059100791811943054, 0.1803663969039917, -0.06414982676506042, 0.13497819006443024, -0.23786891996860504, -0.22187834978103638, -0.690514087677002, -0.2329801619052887, 0.6139984130859375, -0.18356214463710785, 0.234573781490...
get rid of the release statement. You should be good.
[ 0.4447310268878937, 0.19389060139656067, 0.0019735819660127163, 0.14656458795070648, 0.1677435040473938, -0.6410278081893921, 0.17465545237064362, 0.24949289858341217, -0.23323072493076324, -0.20168252289295197, 0.05606135353446007, 0.37688955664634705, 0.03939582780003548, -0.038569036871...
I sometimes forget to `return result` from a function: ``` def f(*args): # do stuff result = # an expression # oops forgot to return result ``` Since `None` is a valid value in my application, this does not raise any exception or even any alarm in the caller. Of course, I'm trying to be careful. But I was wond...
[ 0.10546746104955673, 0.37077057361602783, 0.2823277413845062, -0.15465722978115082, 0.15089349448680878, -0.201453298330307, 0.6431519985198975, 0.23406463861465454, -0.49698561429977417, -0.33847251534461975, -0.23449432849884033, 0.5919941067695618, -0.05365528166294098, 0.12056879699230...
even thinking using a decorator like this: ``` def requires_return(func): def new_func(*args, **kwargs): result = func(*args, **kwargs) if result is None: print('Warning: {} may be missing a return statement'.format(func.__name__)) return result ``` But this wouldn't work because: 1. Many false ...
[ 0.2374093383550644, 0.45396676659584045, 0.22486914694309235, -0.2842886745929718, 0.0301999319344759, 0.007944625802338123, 0.6125993728637695, -0.27443087100982666, -0.22433151304721832, -0.7787315249443054, 0.06909114122390747, 0.5358676910400391, -0.38560593128204346, 0.335565596818923...
a certain naming convention, which allows me easily to distinguish them. (Specifically, every function that starts with `get_` must have a return statement.) Pylint will sometimes catch this kind of error. In particular if you assign to `result` but then never use it: ``` pylint zorg.py ************* Module zorg W0612...
[ -0.0018626245437189937, -0.07927305996417999, 0.2956157624721527, -0.11242149025201797, -0.09922703355550766, -0.2893110513687134, 0.376913458108902, -0.14391806721687317, -0.2976195514202118, -0.2954353094100952, -0.48454147577285767, 0.5222195982933044, -0.5071651339530945, 0.37267044186...
I am new on Python and just got around to install PyCharm for Windows. Downloaded some sample code from Skype for testing their SkypeKit API. But... As soon as I hit the debug button, I get this: (I have Python 2.7 and Django 1.4 installed) ``` Traceback (most recent call last): File "C:\Program Files (x86)\JetBrain...
[ 0.18313245475292206, 0.3986137807369232, 0.4050882160663605, -0.22085201740264893, -0.26025763154029846, -0.3647538125514984, 0.22866219282150269, -0.441463440656662, -0.16364218294620514, -0.6577685475349426, 0.028464272618293762, 0.2546028792858124, -0.39939430356025696, -0.0461615249514...
line 38, in <module> COMMENT = N_TOKENS NameError: name 'N_TOKENS' is not defined Process finished with exit code 1 ``` What does this mean and what can I do to fix it? The tokenize.py module is probably loading the wrong token.py module. See [error importing numpy](https://stackoverflow.com/questions/7414504/er...
[ -0.24527515470981598, -0.012578203342854977, 0.3660002052783966, 0.1064019501209259, -0.05230100452899933, 0.2663322985172272, 0.164033442735672, -0.07843967527151108, -0.4164765477180481, -0.6325703859329224, -0.2888321876525879, 0.1440485566854477, -0.3175090253353119, 0.1819100975990295...
I want to apply the same decorator to every method in a given class, other than those that start and end with `__`. It seems to me it should be doable using a class decorator. Are there any pitfalls to be aware of? Ideally, I'd also like to be able to: 1. disable this mechanism for some methods by marking them with...
[ 0.6891213059425354, 0.022296862676739693, -0.3023844361305237, 0.15915893018245697, 0.045988939702510834, -0.2910670042037964, 0.17582418024539948, -0.13688981533050537, -0.5796954035758972, -0.42935267090797424, 0.03433540463447571, 0.35328537225723267, -0.38369855284690857, -0.2067010700...
= {} def apply(decorator): def apply_decorator(cls): for method_name, method in get_all_instance_methods(cls): if (cls, method) in _methods_to_skip: continue if method_name[:2] == `__` and method_name[-2:] == `__`: continue cls.method_name = decorator(method) return apply_deco...
[ 0.31354811787605286, 0.2235218584537506, 0.6948052048683167, -0.1525375247001648, 0.3466002643108368, 0.011676590889692307, 0.3172738552093506, -0.7278478145599365, -0.14271828532218933, -0.27756866812705994, -0.18250355124473572, 0.652105450630188, -0.44441699981689453, 0.1917062699794769...
added to a class in runtime * how to apply this to subclasses * how to implement `get_class_from_method` I think this is better done with a metaclass, in order to handle both runtime and subclass method decoration. I don't see an elegant way to handle subclasses automatically with a class decorator. ``` from types imp...
[ 0.24737492203712463, -0.19177477061748505, 0.38305342197418213, -0.021031303331255913, -0.09898779541254044, 0.12431003153324127, 0.38841307163238525, -0.41529661417007446, -0.18278318643569946, -0.7192473411560059, -0.12162420898675919, 0.528367280960083, -0.332165390253067, 0.13388983905...
methods (unless excluded) with the same decorator def decorate_all(decorator): class DecorateAll(type): def __new__(cls, name, bases, dct): for attr, value in dct.iteritems(): if do_decorate(attr, value): dct[attr] = decorator(value) return super(D...
[ 0.12296725064516068, -0.20777982473373413, 0.2950628399848938, -0.027760494500398636, 0.041558638215065, 0.26513510942459106, 0.18395085632801056, -0.7267212271690369, -0.33627793192863464, -0.39708462357521057, -0.31689590215682983, 0.4966965615749359, -0.3903006315231323, 0.1479699313640...
def __setattr__(self, attr, value): if do_decorate(attr, value): value = decorator(value) super(DecorateAll, self).__setattr__(attr, value) return DecorateAll # decorator to exclude methods def dont_decorate(f): f.decorate = False return f ``` And an example of its...
[ 0.40350615978240967, -0.06370123475790024, 0.44029632210731506, -0.26673436164855957, -0.07553116977214813, 0.11089057475328445, 0.18089471757411957, -0.5923160910606384, -0.36420202255249023, -0.29266980290412903, -0.16967160999774933, 0.37424877285957336, -0.5577460527420044, 0.051627725...
Foo(object): __metaclass__ = decorate_all(printer) def bar(self): pass @dont_decorate def baz(self): pass @classmethod def test(self): pass # prints # <function bar at 0x04EB59B0> class AnotherName(Foo): def blah(self): pass # prints # <function blah at 0x04E...
[ 0.15030786395072937, 0.1477741003036499, 0.35754498839378357, -0.32179516553878784, 0.04587164148688316, 0.3869055211544037, 0.036249611526727676, -0.740261435508728, -0.38228729367256165, -0.43527403473854065, 0.13997140526771545, 0.3462781012058258, -0.6107056736946106, 0.073455840349197...
As the builtin browser of my ebook-reader (Sony PRS-T1) is quite stupid and wants to open .epub files as text-files instead of downloading them, I tried to force the browser to download the .epub files with this .htaccess file: ``` <FilesMatch "\.(?i:epub)$"> ForceType application/octet-stream Header add Content-D...
[ -0.04706834256649017, 0.16876289248466492, 0.5862513780593872, 0.273653507232666, -0.2064267098903656, -0.2812521755695343, 0.45008522272109985, -0.3040293753147125, -0.016894856467843056, -0.690045177936554, -0.4571824073791504, 0.7637511491775513, -0.35194551944732666, 0.0617409721016883...
that may have caused the error. > > > More information about this error may be available in the server error > log. When I leave out `Header add Content-Disposition "attachment"` there is no error - however, the browser wouldn't download the file :( Am I doing something wrong? Where does the Internal Server error ...
[ 0.11471935361623764, 0.0281530749052763, 0.28602272272109985, 0.09708959609270096, -0.07048695534467697, -0.3840214014053345, 0.36925002932548523, -0.08816668391227722, -0.15858322381973267, -0.5740022659301758, -0.1423526257276535, 0.7642093896865845, -0.19084545969963074, 0.3596746325492...
basename($path); // Set headers header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // required for certain browsers header("Content-Description: File Transfer"); header("Content-Disposition: attachment...
[ 0.2016606330871582, -0.16037634015083313, 0.61750727891922, -0.06177392974495888, 0.25891149044036865, -0.36460572481155396, 0.5458332300186157, -0.35533371567726135, -0.09324371069669724, -0.7244316339492798, -0.6944258213043213, 0.40177154541015625, -0.23046883940696716, -0.0205762051045...
-s ../mods-available/headers.load > headers.load sh /etc/init.d/apache2 force-reload > > ```
[ 0.35131582617759705, -0.11853860318660736, 0.44696295261383057, -0.05977941304445267, -0.40555575489997864, -0.32518139481544495, 0.7569363713264465, -0.5597084164619446, -0.07607683539390564, -0.12344144284725189, -0.4086681604385376, 0.37646177411079407, -0.12644192576408386, -0.18365742...
I'm currently assembling some line graphs with circles at the datapoints from arrays of JSON objects formatted like so: ``` var data = [{ "name": "metric1", "datapoints": [ [10.0, 1333519140], [48.0, 1333519200] ] }, { "name": "metric2", "datapoints": [ [48.0, 1333519200], ...
[ 0.14119021594524384, -0.0030189459212124348, 0.42226526141166687, -0.028936678543686867, -0.31109708547592163, 0.3866785168647766, 0.3340883255004883, -0.0776050016283989, -0.24664829671382904, -0.948534369468689, 0.0872202068567276, 0.06120647117495537, -0.25171563029289246, 0.08941647410...
them based on the index of the object within the array data. The code I have currently for just placing the circles looks like: ``` // We bind an svg group to each metric. var metric_groups = this.vis.selectAll("g.metric_group") .data(data).enter() .append("g") .attr("class", "metric_group"); // Then bind a c...
[ 0.03660936653614044, -0.06963340193033218, 0.7812750339508057, -0.18409399688243866, -0.2989661395549774, 0.30011799931526184, 0.19012466073036194, -0.6268712878227234, -0.30449360609054565, -0.7152959108352661, -0.09803345054388046, 0.37406793236732483, -0.36012041568756104, 0.24168691039...
: 'Nesting and Index'](http://bost.ocks.org/mike/nest/#index), I tried: ``` circles.enter().append("circle") .attr("r", 3.5); .style("fill", function(d,i,j) { return j%2 ? "red" : "blue"; } ``` Which doesn't work (j is undefined), presumably because we are in the named property datapoints, rather than an array e...
[ 0.11473508924245834, -0.019446609541773796, 0.4655914008617401, -0.10618424415588379, -0.1904631406068802, 0.14362889528274536, 0.30226022005081177, -0.5999853014945984, 0.04583973437547684, -0.6983974575996399, -0.19099512696266174, 0.5998948216438293, -0.3320519030094147, 0.1354577541351...
}); var circle = metricGroup.selectAll("circle") .data(function(d) { return d.datapoints; }) .enter().append("circle") .attr("r", 3.5); ``` If you defined categorical colors as CSS classes, you could also use a dynamic class name and inherit that way: ``` var metricGroup = vis.selectAll(".metric-group") ...
[ -0.15398097038269043, -0.371182918548584, 0.18532265722751617, -0.09200198948383331, -0.3407401740550995, 0.2312832623720169, 0.2682152986526489, -0.4143705666065216, 0.0008475749637000263, -0.46000397205352783, -0.37572866678237915, 0.44519487023353577, -0.4736538529396057, 0.136074185371...
.attr("r", 3.5) .style("fill", color(p.name)); }); ``` I also think using the group index `j` would work; I'm not sure why it's undefined for you, but there is a spurious semicolon in your code example (in `.attr("r", 3.5);`), so it's possible there's something else going on. At any rate, it's more idiomatic to...
[ 0.13450682163238525, 0.061772190034389496, 0.20181235671043396, -0.030516110360622406, -0.22753490507602692, -0.13767009973526, 0.3171418607234955, -0.24124275147914886, -0.020954689010977745, -0.4368659555912018, -0.49204862117767334, 0.4785657525062561, -0.47892096638679504, -0.064848102...
I'm doing an ajax form with a server API calls. The server can returns errors messages for specific fields (example: url => 'This url is incorrect'). So I've created a specific view for my form Textfield : ``` (textfield.handlebars) {{view Ember.TextField valueBinding="value"}} {{#if hasError}} <div class="error"...
[ 0.023816002532839775, 0.15620121359825134, 0.8866897225379944, -0.42611458897590637, -0.06648548692464828, 0.2412395179271698, 0.36991646885871887, -0.532640814781189, 0.06713356822729111, -1.0355894565582275, -0.09148894995450974, 0.8023495078086853, -0.2047094851732254, -0.12396737933158...
//how could I set the errorMessage in my App.TextField }); } ``` When the user click on the submit button, I'm sending all form datas to the server and retrieving errors messages. My question is how can I do to update the "subview" App.TextField to set the error messages ? You could use a custom `App.Error` obje...
[ 0.22531472146511078, 0.2658366858959198, 0.49869605898857117, 0.10152427107095718, -0.3545837998390198, 0.06294861435890198, 0.24187295138835907, -0.297853022813797, -0.12073737382888794, -0.5473995804786682, -0.14422012865543365, 0.5440948009490967, -0.14632631838321686, -0.19141420722007...
data-template-name="edit" > name: {{view App.TextField valueBinding="content.name" propertyName="name" }}</br> age: {{view App.TextField valueBinding="content.age" propertyName="age" }}</br> <button {{action "save"}}>save</button> </script>​ ``` **JavaScript**: ```js App.Error = Ember.Object.extend({ ...
[ -0.16262632608413696, 0.1146913394331932, 0.6816774010658264, -0.26027289032936096, 0.12246301770210266, 0.315304160118103, 0.2564569413661957, -0.6479745507240295, -0.159626767039299, -0.4597218930721283, -0.4009310305118561, 0.5345348715782166, -0.28003376722335815, 0.12871748208999634, ...
this.get('error'); return error && error.isError(this.get('propertyName')); }.property('error', 'propertyName'), errorMessage: function() { var error = this.get('error'); if (error) { var propertyName = this.get('propertyName'); return error.getErrorMessage(prope...
[ -0.1771663874387741, 0.24219316244125366, 0.641429603099823, -0.42593881487846375, 0.3144400417804718, 0.35105282068252563, 0.5355939865112305, -0.4797869622707367, -0.10077527910470963, -0.9076621532440186, -0.6660166382789612, 0.9382116198539734, -0.7290321588516235, 0.04366055503487587,...
contentBinding: 'App.obj', save: function() { var content = this.get('content'); var error = this.get('error'); if (error) { error.destroy(); } error = App.Error.create(); if (content.get('age') <= 100) { error.set('age', 'sorry, you are not
[ 0.35320091247558594, 0.21296435594558716, 0.6256024241447449, -0.2178644984960556, 0.3854292631149292, 0.045981500297784805, 0.4846559166908264, 0.028147412464022636, -0.16792289912700653, -0.657358705997467, -0.6071548461914062, 0.4343843460083008, -0.3029002547264099, 0.3735252618789673,...
wise enough'); } if ('Chuck Norris' === content.get('name')) { error.set('name', 'yeah, and i am the queen of england'); } this.set('error', error); } }).append();​ ```
[ 0.2621232271194458, 0.32046252489089966, 0.6295541524887085, -0.19184981286525726, 0.4836427867412567, -0.25011521577835083, 0.3888431191444397, 0.013736395165324211, 0.0007689251797273755, -0.20749470591545105, -0.5477699637413025, 0.6495036482810974, -0.31817471981048584, 0.2336620539426...
My controllers are currently mapped to be something like <http://example.com/fix.go> and, of course, I think that's idiotic and want something nicer like <http://example.com/fix> or <http://example.com/mmm/fix> with no extension. When I try to configure this, however, I can't get it to work. I'm clearly missing a key p...
[ 0.003068622201681137, -0.1456349939107895, 0.6974829435348511, 0.2990925908088684, 0.009814431890845299, 0.009545004926621914, -0.34365931153297424, -0.28432732820510864, -0.42130976915359497, -0.6191600561141968, -0.03441348671913147, 0.2016039937734604, -0.45661017298698425, 0.2705301642...
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>BooBoo</servlet-name> <url-pattern>*.*</url-pattern> <!-- was *.go when it worked --> </servlet-mapping> <welcome-f...
[ -0.3304307162761688, -0.26190808415412903, 0.45563969016075134, -0.4285443425178528, -0.2832149565219879, 0.14729715883731842, 0.168694868683815, -0.39587074518203735, -0.5741521716117859, -0.43009692430496216, -0.5326285362243652, 0.06736235320568085, -0.4387665390968323, 0.07974296808242...
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3...
[ 0.07540644705295563, 0.01078773196786642, 0.5802318453788757, 0.06816689670085907, 0.08925526589155197, 0.08360468596220016, -0.3293865919113159, -0.4591021239757538, -0.43724164366722107, -0.4808436334133148, -0.11030067503452301, 0.1899586170911789, -0.2645642161369324, 0.176206126809120...
is configured as such: ``` @Controller public class BangBangController extends BaseController { // Used to be fix.go when it worked @RequestMapping( value="fix", method=RequestMethod.GET ) public ModelAndView choose( HttpSession session, @RequestParam( value="fixId", requir...
[ -0.3295953869819641, -0.6232519149780273, 0.42260292172431946, 0.16614031791687012, 0.23293375968933105, -0.05963675677776337, 0.12252131849527359, 0.03502288833260536, -0.29460224509239197, -0.20720094442367554, -0.28610146045684814, 0.4624318480491638, -0.6149919629096985, -0.07807549089...
{ ... } } ``` I've tried changing the mapping in web.xml to /mmm/\* expecting URLs like <http://example.com/mmm/fix> to work, but that too has not worked. I get "missing resource" errors when I enter what I think are the correct URLs in the browser. What am I goofing up here? What critical piece of understanding do ...
[ 0.22662107646465302, 0.2120031714439392, 0.36565646529197693, -0.08981073647737503, 0.11122139543294907, -0.09344536811113358, 0.2543469965457916, 0.31397849321365356, -0.4526710510253906, -0.8286715745925903, -0.3211941719055176, 0.39765939116477966, -0.40811023116111755, 0.21614435315132...
you won't be able to serve static content. What you really should do is this: ``` <url-pattern>/webapp/*</url-pattern> ``` Where "webapp" is some prefix. All of your URLs will need to be prefixed with it, but that allows you to still serve static content.
[ 0.32109934091567993, -0.20802196860313416, 0.6242925524711609, 0.1385655701160431, -0.07969199120998383, -0.3806692361831665, 0.09568558633327484, 0.516396164894104, -0.4882212281227112, -0.6445033550262451, -0.28820112347602844, 0.21574163436889648, -0.4163445234298706, 0.4021458625793457...
I'm just starting with Java and I'm having trouble with the following code. I was using something like this to call the non-static apply method from a static method, but I dont think its very efficient. I set an array list of the rules that need to be applied but I can't get it to work. ``` ClassificationRule rul...
[ 0.06321771442890167, 0.08647523820400238, 0.4167153537273407, -0.09422939270734787, 0.021555960178375244, -0.22202780842781067, 0.42882809042930603, -0.6557661890983582, -0.215142622590065, -0.6988718509674072, 0.04838067665696144, 0.5072980523109436, -0.6585927605628967, 0.215409636497497...
the type ArrayList". Any help would be greatly appreciated! ``` package tweetClassification; import java.util.ArrayList; public class PrioritRuls { //Set of rules to be applied final static ArrayList<ClassificationRule> rulesA = new ArrayList<ClassificationRule>(); static{ rulesA.add( ...
[ 0.03236142173409462, -0.27709153294563293, 0.41948598623275757, -0.08732885867357254, -0.1766684204339981, 0.03102227859199047, 0.292802631855011, -0.7782654762268066, -0.2848755717277527, -0.5222921967506409, -0.5595240592956543, 0.3062916696071625, -0.39891958236694336, 0.114068418741226...
// The method apply(String) is undefined // for the type ArrayList<ClassificationRule> } } package tweetClassification; public class ClassificationRule { // ******************************************* public void apply (final String aUserInput) { apply( aUserInput ); } } ...
[ 0.21150149405002594, -0.12848563492298126, 0.38976940512657166, -0.09347895532846451, -0.016537662595510483, -0.1085565909743309, 0.38011661171913147, -0.6500784158706665, -0.09172601252794266, -0.621694028377533, -0.4069457948207855, 0.5935648679733276, -0.588424026966095, 0.1216015219688...
element, you need to iterate through the list. ``` for (ClassificationRule rule:rulesA){ rule.apply(aUserInput); } ```
[ -0.21818211674690247, -0.034599702805280685, 0.15447543561458588, -0.10597874224185944, 0.1620887666940689, -0.07589488476514816, 0.3327079713344574, -0.7372252345085144, -0.05897064134478569, -0.6345662474632263, -0.4425542652606964, 0.410562664270401, -0.5025922060012817, -0.008877170272...
Several posts have noted difficulties with getting an exact height out of CTFramesetterSuggestFrameSizeWithConstraints, and here, [(framesetter post)](https://stackoverflow.com/questions/3374591/ctframesettersuggestframesizewithconstraints-sometimes-returns-incorrect-size), @Chris DeSalvo gives what looks like the defi...
[ -0.21640166640281677, 0.02883818931877613, 0.6453720331192017, 0.2405385822057724, -0.14193567633628845, 0.3184051215648651, 0.23400387167930603, -0.35354530811309814, -0.08866304904222488, -0.3652384281158447, -0.1998225748538971, 0.5846792459487915, -0.1431892365217209, -0.10263379663228...
ascender (Y coord from baseline) * -3.408 UIFont’s descender (Y coord from baseline) * 08.368 UIFont’s xHeight And here are the CTFont values that Ken Thomases inquired about: * 11.568001 CTFontGetCapHeight * 08.368 CTFontGetXHeight * -15.216001, -7.696001, 38.352001, 24.928001 CTFontGetBoundingBox * 15.232 CTFontGet...
[ -0.6567720770835876, -0.2019895613193512, 0.813826322555542, -0.017308862879872322, -0.42697006464004517, 0.03862310200929642, 0.21658548712730408, -0.36766374111175537, 0.0233124028891325, -0.0576559416949749, -0.18326424062252045, 0.44053590297698975, -0.13695548474788666, 0.076093986630...
to be **21** and CTFontRef **.448** for the same font? Something’s not right. Three questions: 1. Is “leading” really what is meant by kCTParagraphStyleSpecifierLineSpacingAdjustment? 2. If so, which method/formula should I use to get it? 3. If not, what should I use for the line spacing adjustment? Answers to the 3 ...
[ 0.15074317157268524, -0.16470861434936523, 0.6467602849006653, -0.07092468440532684, -0.23483696579933167, 0.07120609283447266, 0.411969929933548, -0.3648315370082855, 0.10399916023015976, -0.23041106760501862, -0.15322934091091156, 0.5468748807907104, -0.2393883913755417, -0.2068267166614...
string will enable the Core-Text framesetter to calculate its height *exactly*. There are two caveats: 1. If you try to calculate heights incrementally, one string at a time, each string containing an initial line break, framesetter will consider that line break to represent an entire line, not just the leading. If ...
[ 0.05368301644921303, -0.24173028767108917, 0.4886122941970825, 0.07252772152423859, -0.16312220692634583, -0.04212779551744461, 0.29900676012039185, -0.3258734941482544, -0.24448159337043762, -0.4730718731880188, -0.1965092420578003, 0.20055487751960754, -0.08216368407011032, 0.01457454357...
per exact string height is an issue, you must draw direct to a CALayer. And there is one mystery: What is going on with UIFont's deprecated leading? Leading and lineHeight are two distinct things.
[ -0.00985926017165184, -0.3949901759624481, 0.49187543988227844, -0.14195887744426727, -0.5297471880912781, -0.206827774643898, 0.027593879029154778, -0.3339109420776367, -0.057658907026052475, -0.07088592648506165, -0.13114948570728302, -0.00037882861215621233, -0.2978801429271698, 0.24044...
For simplicity of the problem let's consider spheres. Let's say I have a sphere, and before execution I know the radius, the position and the triangle count. Let's also say the triangle count is sufficiently large (e.g. ~50k triangles). Would it be faster generally to create this sphere mesh before hand and stream all...
[ 0.0582355260848999, 0.26395517587661743, 0.4643257260322571, 0.2631484866142273, -0.4664008915424347, 0.45488351583480835, -0.08747418224811554, -0.6582468152046204, -0.308262437582016, -0.7340437173843384, 0.12278751283884048, 0.2624741792678833, 0.005239842925220728, -0.107413150370121, ...
different positions? Can I use hull/geometry shaders to create something which I can then combine with instancing? I just so happen to be working with this at the same time. In terms of FPS, the pre-computed method would be faster ***in this situation*** since you can dump one giant 50K triangle sphere payload (like a...
[ 0.22608420252799988, -0.13065411150455475, 0.30571305751800537, 0.31272178888320923, -0.30139756202697754, 0.40984320640563965, -0.14192621409893036, -0.305558979511261, -0.3662549555301666, -0.8934653401374817, 0.23412737250328064, 0.27340805530548096, -0.11981988698244095, 0.031354870647...
``` public class Category { public virtual int Id { set; get; } public virtual string Name { set; get; } public virtual int CategoryOrder { set; get; } public virtual IEnumerable<News> LatestNews { set; get; } } public sealed class CategoryMap :ClassMap<Category> { public CategoryMap() { ...
[ -0.031205300241708755, -0.24015925824642181, 0.5211440920829773, -0.1614360511302948, -0.1354915052652359, -0.1790933459997177, 0.22648389637470245, 0.03922763839364052, -0.20587827265262604, -0.46253466606140137, -0.7236769199371338, 0.6276088356971741, -0.307431161403656, 0.4529907703399...
HasMany(x => x.LatestNews); } } IRepository<Category> newsRepo = new NHibernateRepository<Category>(); using(var session = newsRepo.GetSessionFactory().OpenSession()) using(var transaction = session.BeginTransaction()) { var result = session.Query<Category>().OrderBy(x...
[ -0.28913041949272156, -0.06106235459446907, 0.9157766699790955, -0.14158721268177032, -0.13712351024150848, -0.004749087616801262, 0.1687358021736145, -0.4109515845775604, -0.5667062401771545, -0.5901020169258118, -0.3177173435688019, 0.545749843120575, -0.37821701169013977, 0.490242749452...
a (only one) News per category. Is this correct mapping? or should i change it to `Map` When i run this, it gets all the news per category. But i want the latest news per category (only one). I can get the latest news by querying `News.DateUpdated`. How should i change the query to get one news per category? or how ...
[ 0.4330260455608368, -0.07113896310329437, 0.4904596507549286, 0.2300601452589035, -0.37806883454322815, 0.010509039275348186, 0.011723517440259457, 0.1897282600402832, -0.45866280794143677, -0.751222550868988, -0.12177830189466476, 0.5084166526794434, -0.1535796970129013, 0.023503825068473...
I'm using sorl-thumbnail to get some images to crop. I have a model looking like this ``` from django.db import models from sorl.thumbnail import ImageField class Photo(models.Model): image = models.ImageField(upload_to="uploads") ``` and inside my template I have ``` {% load thumbnail %} {% thumbnail photo....
[ 0.3909035325050354, 0.14241766929626465, 0.6514591574668884, -0.07935859262943268, -0.15393178164958954, -0.009227513335645199, 0.1736653447151184, -0.31797096133232117, -0.2513812482357025, -0.9601072072982788, 0.36968204379081726, 0.8684985041618347, -0.2139294147491455, 0.08039697259664...
code looks fine, so the problem should come from other parts. The first thing you can do is to set `THUMBNAIL_DEBUG = True` in your `settings.py` and see why the error occurs. Are you using `virualenv` and `PIL` for image library? Make sure your `PIL` is compiled and installed with `jpeg` and `png/gif` support which...
[ 0.38137003779411316, 0.1293143332004547, 0.21989548206329346, 0.21104499697685242, 0.035515688359737396, -0.23191896080970764, 0.5209288597106934, -0.21282832324504852, -0.05240529403090477, -0.7170999050140381, -0.17675508558750153, 0.8309051990509033, -0.45573872327804565, -0.06928427517...
I can't figure out the problem on my code : ``` /* Declare a cursor for the FETCH statement. */ EXEC SQL DECLARE customer_cursor CURSOR FOR SELECT CUSTOMER_ID, CUSTOMER_NAME FROM CUSTOMER_TABLE WHERE CUSTOMER_CARD_NUM = :argv[1]; if ( sqlca.sqlcode != 0 ) { printf("Declare cursor failed\n"); return( ...
[ -0.4249407649040222, 0.08639036864042282, 0.6707000732421875, -0.1058671697974205, -0.18987813591957092, 0.22941258549690247, 0.16098381578922272, -0.2196948081254959, -0.08952513337135315, -0.14808671176433563, -0.02789193019270897, 0.7036454081535339, -0.3445571959018707, 0.2968296110630...
EXEC SQL FETCH customer_cursor INTO :var_customer_id, :var_customer_name; if ( sqlca.sqlcode != 0 ) { EXEC SQL CLOSE cust_data_cursor; return ( sqlca.sqlcode ); } /* Doing some stuff here */ processing_customer(); } EXEC SQL CLOSE customer_cursor; /* Handling the ...
[ -0.28246936202049255, 0.01310619805008173, 0.7879290580749512, -0.08758550882339478, 0.002894187346100807, 0.11374977976083755, -0.3501071035861969, -0.024025794118642807, -0.0916135311126709, -0.11729405075311661, -0.18501441180706024, 0.5186810493469238, -0.3482288122177124, 0.1472154855...
CARD_NUM\n"); /* Some stuff */ ...... return 1; ``` My query is supposed to return just one row or nothing, when nothing is returned all is ok, **but when ther's a matching, the function processing\_customer is executed and the strange is that the no\_match is executed too**. Thanks for helping me ...
[ 0.006108305882662535, 0.13530993461608887, 0.628577470779419, 0.09696728736162186, -0.08597812056541443, -0.1947753131389618, 0.14690113067626953, 0.011541614308953285, -0.5191142559051514, -0.44849666953086853, -0.05871885269880295, 0.41736528277397156, -0.36709579825401306, 0.24388323724...
that section. You either need to return before that label, or `goto` something after it. You also need to close the cursor in the no-match scenario. But this seems unnecessarily messy and as @Arion hinted you don't need an explicit cursor for this - just do a `select into` and catch the exception. ``` EXEC SQL SELECT...
[ 0.1066906750202179, 0.14885017275810242, 0.4603346884250641, -0.1370096206665039, -0.06717193871736526, -0.14985798299312592, -0.13020433485507965, 0.04497317224740982, -0.032785333693027496, -0.3474223017692566, -0.15974317491054535, 0.6167135834693909, -0.32415270805358887, 0.11483218520...
return 1; } if (sqlca.sqlcode != 0) { return ( sqlca.sqlcode ); } /* Doing some stuff here */ processing_customer(); ``` You've said there will be zero or one rows; if there are more than one you'll get a too-many-rows error (ORA-02112).
[ -0.042020946741104126, 0.04535818099975586, 0.16481685638427734, -0.3745730519294739, 0.29307523369789124, -0.07988069206476212, 0.08872684836387634, -0.025465380400419235, -0.1598443239927292, -0.4097672998905182, -0.1396290361881256, 0.47714826464653015, -0.3067440390586853, 0.1276047378...
I preload load two different images at the top of my javascript file. ``` var imgColor = new Image(); var imgLoadedColor = false; imgColor.src = 'color/progress.png'; imgColor.onload = function(){ imgLoadedColor = true; } var imgBlackWhite = new Image(); var imgLoadedColor = false; imgBlackWhite.src = 'blackWhi...
[ -0.07773241400718689, -0.09673364460468292, 0.4630323350429535, -0.3463350534439087, 0.1826140582561493, 0.2318640947341919, 0.28695446252822876, -0.37455126643180847, -0.10481685400009155, -0.666854202747345, -0.3003554046154022, 0.7334288954734802, -0.6338452696800232, 0.1103937402367591...
`imgBlackWhite` it loads the black and white image because `imgColor` and `imgBlackWhite` are objects. How do I create a reference to the objects `imgColor` and `imgBlackWhite` from the value of the string in `this.options.type`? Why not just use an if statement? ``` if (arg == "imgColor") return imgColor; else retur...
[ -0.06890146434307098, 0.039286933839321136, 0.32748326659202576, -0.1825612485408783, -0.15442748367786407, -0.05832627788186073, 0.17680872976779938, -0.14965415000915527, -0.21273019909858704, -0.6666752099990845, -0.26622089743614197, 0.5355644226074219, -0.6179695129394531, 0.166557714...
I am trying to create an autocomplete field with jquerys famous autocomplete and by creating an array from mysql database. It works perfectly but when a selection is made, the input field value is not updated, therefore I am not able to pass the value from the form. Can someone help me here? JQUERY: ``` <link rel="st...
[ 0.028024381026625633, 0.17875926196575165, 0.4701770544052124, 0.24354365468025208, 0.06983182579278946, 0.006020169705152512, 0.22315408289432526, 0.09311461448669434, -0.17347529530525208, -0.37228843569755554, -0.11892840266227722, 0.3219825327396393, -0.3527333438396454, -0.05280108749...
'<script>'."\n"; $output .= 'var keywordList = ['; while($row_rsKeywords = mysql_fetch_assoc($rsKeywords)) { $output .= '"'.$row_rsKeywords['Destination'].'",'; } $output = substr($output,0,-1); //Get rid of the trailing comma $output .= '];'."\n"; $output .= '</script>'; return $output; } ?> ```...
[ -0.3949490189552307, -0.007055472116917372, 0.7053495049476624, -0.3680334687232971, 0.11981885880231857, 0.15517403185367584, 0.30995237827301025, -0.3358425796031952, -0.1549810916185379, -0.38455620408058167, -0.6431641578674316, 0.6342759728431702, -0.41001710295677185, -0.044823970645...
$("#keywords").val(ui.item.value); } }); ```
[ 0.03465106338262558, -0.046869467943906784, 0.5749941468238831, -0.2715722322463989, 0.22874195873737335, -0.017341813072562218, 0.39949721097946167, -0.2230866700410843, 0.08783140033483505, -0.39808252453804016, -0.60243159532547, 0.9129824638366699, -0.3131747841835022, 0.52026224136352...
Thanks everyone for taking the time to read this. I have styled my navigation bar and a few other things on my website using lists. For example... ``` <ul> <li id="n1"><a href="http://www.beaconrecords.com/index.php"></a></li> <li id="n2"><a href="artists"></a></li> <li id="n3"><a href="lifestyle.php"></a...
[ 0.4004279673099518, 0.11796847730875015, 0.4160476326942444, -0.08848057687282562, 0.023753009736537933, -0.029338018968701363, 0.522884726524353, -0.163304403424263, -0.23377451300621033, -0.8906893134117126, 0.17820344865322113, 0.5031704902648926, -0.02671980671584606, -0.36718133091926...
know what is causing this problem, and I don't think it's due to the way I styled the list, as I will show. This is the website with the problem. <http://beaconrecords.com/> here is a test link that doesn't have the problem. <http://beaconrecords.com/wp-content/themes/br/test.php> Use the select `event` to set the va...
[ -0.13683255016803741, -0.1199306845664978, 0.4556161165237427, -0.1254812777042389, 0.012954037636518478, -0.05567244067788124, 0.19751675426959991, -0.2641768455505371, -0.15809211134910583, -0.39922183752059937, -0.2634013593196869, 0.6275314688682556, -0.31600674986839294, 0.03449785336...
} }); ```
[ 0.05535417050123215, 0.22359678149223328, 0.33292123675346375, -0.44429904222488403, 0.4482058882713318, -0.16275274753570557, 0.18889392912387848, 0.2862910032272339, 0.3227475583553314, -0.38386330008506775, -0.35699695348739624, 0.9355558753013611, -0.4717769920825958, 0.204942822456359...
I'm basically trying to create a 2 column div with a liquid `<h1>` and another div that will span the entire height of the `<h1>`, but I'd like the vertical-alignment to be centered. I'm basically trying to place an image to the left of a page title: ``` <div class="outer"> <div><img src="pound.png" /></div> <h1...
[ 0.16441112756729126, 0.03391283005475998, 0.20488709211349487, -0.015961600467562675, -0.4068494141101837, 0.07093790173530579, -0.007989445701241493, -0.07526127249002457, -0.10713207721710205, -0.6587464809417725, -0.06438218057155609, 0.2542564570903778, -0.08001402020454407, -0.1221249...
to use tables because I'd like to be able to float the image to the right side in certain situations. I also don't care about the borders, I'm just doing it to illustrate the alignment. ```none ------------------------------------------------------ | This is text that is really long. This is ###### | text ...
[ 0.39159876108169556, 0.262285977602005, 0.5200656652450562, 0.013959396630525589, 0.013244252651929855, -0.14865286648273468, 0.04476218298077583, 0.054639555513858795, -0.28023067116737366, -0.9112097024917603, 0.10915791243314743, 0.5172644257545471, -0.4552655816078186, -0.1486571729183...
is text that is really long. ------------------------------------------------------ ``` My main issue is getting the image to occupy the entire space vertically so that I can vertically align it using margin: 50% or auto or some variation of that. I can either get the image centered vertically, but then the text wrap...
[ 0.11928790807723999, 0.11782104521989822, 0.4552822709083557, -0.11272618174552917, 0.016585681587457657, -0.1075243204832077, 0.1019013524055481, -0.07687968760728836, -0.16552172601222992, -0.6842390894889832, -0.22526635229587555, 0.48333457112312317, -0.021708108484745026, 0.0400782413...
I'm new to Sinatra and I'm trying to figure out how querying a collection in templates work. In this particular example I'm trying to find out if in a specific collection (`c` in this example) of objects if there is an object with a certain value. ``` <% if c.votes #then filter by an id for example through all of the...
[ 0.411380410194397, 0.2543858587741852, 0.1419246792793274, -0.029090968891978264, -0.17112992703914642, -0.3318382501602173, -0.12937788665294647, -0.2672228515148163, -0.36566105484962463, -0.5856364369392395, 0.2270708531141281, 0.5548250079154968, -0.43592050671577454, -0.00392423290759...
a standard collection? You could use any?, which returns true if the provided block ever finds a match. You would then test each object for the value you are looking for in that block. ``` <% if c.votes.any? { |a| a.id == whatever } %> ... <% else %> ... <% end %> ``` It really depends on what "votes" is.
[ 0.4432544708251953, -0.1850740611553192, -0.0385403074324131, 0.47633036971092224, -0.2865702211856842, -0.20597517490386963, 0.01873871684074402, -0.47555646300315857, -0.15526345372200012, -0.31794965267181396, -0.10353513807058334, 0.540526807308197, -0.47056591510772705, -0.19725918769...
guys sorry for being so noob but im still starting yet with my php, what im trying to do is to do is to out put the result on the same page . ``` <html> <body> <?php error_reporting(E_ALL ^ E_NOTICE); $button=$_POST['button_validate']; if(isset($button)){ error_reporting(E_ALL ^ E_NOTICE); $text=$_POST['t...
[ -0.01870855689048767, 0.4684816598892212, 0.5334261655807495, -0.21935312449932098, -0.5120997428894043, -0.1949874311685562, 0.44680601358413696, -0.26449474692344666, -0.31120386719703674, -0.3901944160461426, -0.07455197721719742, 0.2684875428676605, -0.4348636865615845, 0.0016343654133...
same page in makes a new page.. is there a code on how to output this on the same page or its just in the logic? try doing this in your form tag: ``` <form method="post" action=""> ``` then your data will be submitted to the same page. I hope this helps.
[ 0.29414623975753784, -0.045775625854730606, 0.5043637752532959, 0.13556210696697235, -0.10326449573040009, -0.15827928483486176, 0.07344155013561249, -0.31283217668533325, -0.09943955391645432, -0.848314106464386, 0.09298623353242874, 0.32123613357543945, -0.2903696894645691, 0.15027022361...
I have an old project that is mixed C and C++. It makes extensive use of C strings and of `strcpy`,`strcat`,`strncpy`,`strncat` etc. I've uncovered a number of buffer overflows, and I'd like to use more secure functions, such as `strcpy_s`. MSVC includes those functions, but I need something that will work on various p...
[ 0.1622585952281952, 0.029768692329525948, 0.38973718881607056, -0.01978486403822899, 0.03430365025997162, -0.24697914719581604, 0.03127608820796013, 0.17460806667804718, -0.09626006335020065, -0.7173135876655579, -0.11435803025960922, 0.5949013233184814, -0.20858974754810333, 0.16592618823...
`BSD`, but if you know of implementations under other licenses, go ahead and list them - I'm sure someone else will benefit. Try with the [Safe C](http://sourceforge.net/projects/safeclib/) library. It's under the [MIT license](http://www.opensource.org/licenses/MIT) and according to this [list](http://www.openwatcom.o...
[ 0.7403789758682251, 0.17197731137275696, -0.02652004361152649, -0.0024156756699085236, -0.21274760365486145, -0.6526898145675659, 0.11239586025476456, -0.36230024695396423, -0.07452508807182312, -0.4156896471977234, -0.3090207278728485, 0.6030490398406982, -0.6200035810470581, -0.011672042...
I am actually testing a file and I have a situation, where I need to access some of the protected members of the class from main.cpp. I tried to add, `main()` as friend, didn't work out and learned that it wont work, so I moved everything in the `main()` to a `test ()` and made the `test()` as friend. still it shows th...
[ 0.15501952171325684, 0.1957763433456421, -0.10122478008270264, 0.05607021227478981, 0.07166317105293274, 0.019903400912880898, 0.5922442078590393, -0.04610976576805115, 0.03762560337781906, -0.501039445400238, 0.07008055597543716, 0.37432852387428284, -0.12971678376197815, 0.26354682445526...
{} protected: long word; private: friend int test(); }; }//ns:Files //--List_File.hpp namespace Files { class List_File :public File { public: List_File() : File(sizeof(int) + sizeof(long)) {}
[ 0.011793583631515503, -0.06446939706802368, 0.3404347896575928, -0.047986168414354324, 0.1291959136724472, 0.1581677496433258, 0.26115885376930237, -0.32257717847824097, -0.1951032131910324, -0.576781153678894, -0.3768886923789978, 0.5107865333557129, -0.046795908361673355, 0.1623844206333...
private: friend int test(); }; }//ns:Files //--main.cpp using namespace Files; int test() { File *pd = new List_File(); assert(pd->word == 12); //LINE 34 return 0; } int main() { test(); return 0; } ``` //it says error on Line 34: Base::value is pro...
[ 0.006233196705579758, 0.014650734141469002, 0.06721671670675278, -0.24938952922821045, 0.21975651383399963, 0.2014855593442917, 0.713521420955658, -0.16961032152175903, 0.13166648149490356, -0.46567896008491516, -0.23102989792823792, 0.5633542537689209, -0.2194078117609024, 0.0784714296460...
g++ -O -Wall -Wno-unused -o a.out File.cpp List_File.cpp Data_File.cpp Free_List_File.cpp main.cpp File.hpp: In function ‘int test()’: File.hpp:30:7: error: ‘long int Files::File::word’ is protected main.cpp:34:16: error: within this context make: *** [a.out] Error 1 ``` No, it defin...
[ -0.26092225313186646, 0.1584440916776657, 0.4271398186683655, -0.2182631492614746, -0.0804891362786293, 0.19719049334526062, 0.3568370044231415, -0.3127102553844452, -0.26279523968696594, -0.24900463223457336, -0.27010637521743774, 0.36331450939178467, -0.4220699667930603, -0.0551236420869...