text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
new Point(200,200), new Point(300,100), new Point(200,50), new Point(100,100), new Point(200, 100), new Point(300, 200), new Point(250, 100), }); foreach (Point point in ConvexHull(test))
[ -0.365360289812088, -0.13033293187618256, 0.6652424931526184, -0.481780081987381, 0.240544393658638, 0.7265933156013489, 0.01883755996823311, -0.615063488483429, -0.05660106986761093, -0.7326313257217407, -0.1138947457075119, 0.4441658556461334, -0.22911055386066437, -0.039197955280542374,...
{ Console.WriteLine(point); } Console.ReadKey(); } public static List<Point> ConvexHull(List<Point> points) { if (points.Count < 3) {
[ -0.38565632700920105, -0.037558723241090775, 0.737113893032074, -0.3517727255821228, -0.2801235616207123, 0.3361665904521942, 0.0545194149017334, -0.3282667398452759, -0.019618913531303406, -0.29805099964141846, -0.3156631588935852, 0.22893820703029633, -0.3167860507965088, -0.003412259276...
throw new ArgumentException("At least 3 points reqired", "points"); } List<Point> hull = new List<Point>(); // get leftmost point Point vPointOnHull = points.Where(p => p.X == points.Min(min => min.X)).First(); Point vEndpoint;
[ -0.6968400478363037, -0.37703803181648254, 0.7551808953285217, -0.34603410959243774, -0.2894751727581024, 0.5246580243110657, 0.24908454716205597, -0.25223544239997864, -0.2646181285381317, -0.6352872848510742, -0.22362469136714935, 0.2229919582605362, 0.11795403808355331, 0.05690662935376...
do { hull.Add(vPointOnHull); vEndpoint = points[0]; for (int i = 1; i < points.Count; i++) {
[ -0.2218976616859436, -0.05039042606949806, 0.640861988067627, -0.3674304485321045, 0.02786707878112793, 0.36922770738601685, 0.2379375696182251, -0.49672460556030273, -0.3018355369567871, -0.3359623849391937, -0.09382062405347824, 0.05331604927778244, -0.09898258745670319, 0.01663830690085...
if ((vPointOnHull == vEndpoint) || (Orientation(vPointOnHull, vEndpoint, points[i]) == -1)) { vEndpoint = points[i];
[ -0.5465126037597656, -0.034997519105672836, 0.8541821837425232, -0.4722220003604889, 0.20863227546215057, 0.08057067543268204, 0.027691463008522987, -0.4461243450641632, 0.04036339372396469, -0.4475354552268982, -0.2782903015613556, 0.22604836523532867, 0.0669439360499382, 0.20396609604358...
} } vPointOnHull = vEndpoint; } while (vEndpoint != hull[0]); return hull; }
[ -0.37871766090393066, -0.16708330810070038, 0.5831416845321655, -0.3734472095966339, 0.06643170118331909, 0.2997441291809082, 0.5139126777648926, -0.2788504660129547, -0.25434610247612, -0.41856124997138977, 0.03792167827486992, 0.5562189221382141, -0.16073726117610931, 0.36021700501441956...
private static int Orientation(Point p1, Point p2, Point p) { // Determinant int Orin = (p2.X - p1.X) * (p.Y - p1.Y) - (p.X - p1.X) * (p2.Y - p1.Y); if (Orin > 0) return -1; //
[ -0.5194137096405029, -0.299432635307312, 0.517331063747406, -0.18125951290130615, -0.04002542793750763, 0.3960207402706146, 0.00555343646556139, -0.12839457392692566, 0.004017941188067198, -0.09256274253129959, -0.3032967150211334, 0.4788600206375122, -0.3426841199398041, 0.041639249771833...
(* Orientation is to the left-hand side *) if (Orin < 0) return 1; // (* Orientation is to the right-hand side *) return 0; // (* Orientation is neutral aka collinear *) } } } ``` adaptation to your private classes, would be your homework.
[ -0.24039925634860992, -0.1298588514328003, 0.18015776574611664, -0.24150775372982025, 0.053100842982530594, -0.0054844701662659645, 0.07167969644069672, -0.07603070139884949, 0.04534485563635826, -0.5547382831573486, -0.39455991983413696, 0.6425836682319641, -0.06974565982818604, -0.058080...
Sorry for the confusing question, but what I'm trying to do is store an array in a variable. I want to store the numbers in `*value` so that instead of `int value: -12118433669` it will be `int value: 123456789`. OUTPUT ``` 123456789 array: '123456789' int value: -1218433669 0001234 array: '0001234' int value: -121...
[ 0.10470207035541534, 0.0012222712393850088, -0.057850465178489685, -0.048439301550388336, -0.054255805909633636, 0.27680373191833496, 0.46375536918640137, -0.5586215257644653, -0.11821725219488144, -0.26581329107284546, -0.10819078236818314, 0.5026730895042419, -0.40495631098747253, 0.0650...
printf("%c", numArray[i] - 0); } } } int main() { char numbers[5][10] = { "123456789", "0001234", "abc5xyz", "", "987654321" }; int i, value; for(i = 0; i < 5; i++) { MyFNatoi(numbers[i], &value); printf("\narray: '%s' int value: %d\n", numbers[i], value); } return 0;...
[ -0.22814087569713593, -0.20264704525470734, 0.21995759010314941, -0.4721991717815399, 0.3747943341732025, 0.34956279397010803, 0.49053439497947693, -0.19579653441905975, -0.042934224009513855, -0.4086623191833496, -0.41961729526519775, 0.7091174125671387, -0.4132750630378723, 0.19656698405...
(value == NULL) return; *value = 0; if (str != NULL) { int negative = 0; if (*str == '-') { negative = 1; str++; } while
[ -0.13047915697097778, -0.042123183608055115, 0.2753825783729553, -0.47820329666137695, -0.09290919452905655, 0.15934905409812927, 0.5787025690078735, -0.45655587315559387, -0.011392349377274513, 0.05877644196152687, -0.511525571346283, 0.4839038848876953, -0.2531108856201172, 0.04622922465...
(*str && isdigit(*str)) { *value = (*value * 10) + (*str++ - '0'); } if (negative) *value *= -1; } } ``` It handles negative numbers, and only checks leading digits (so wont make a number out of `"abc123def456"` for example).
[ -0.35337013006210327, 0.10805266350507736, 0.30088698863983154, -0.3712058663368225, -0.08189906924962997, 0.022538214921951294, 0.4600314497947693, -0.252301424741745, 0.042232614010572433, -0.3014580011367798, -0.2846832871437073, 0.47236737608909607, -0.2372068613767624, -0.070003703236...
I'm having trouble using `std::auto_ptr`. I try to compile the following on Ubuntu 11.10 using GCC 4.6.1, and I get the error message `error: no match for call to ‘(std::auto_ptr<int>) (int*)’`. ``` #include <memory> #include <iostream> class Toy { public: std::auto_ptr<int> foo; Toy() { foo(new i...
[ 0.530590832233429, 0.1161738857626915, 0.5433117747306824, -0.40229642391204834, 0.4060038626194, 0.37454986572265625, 0.18646931648254395, -0.08006507158279419, -0.04098203033208847, -0.3545668423175812, -0.257419615983963, 0.624085545539856, -0.7248592972755432, 0.40099453926086426, -0...
if this is a trivial or duplicate question, but I searched the archives, and haven't found an answer. Places like [this](http://www.cprogramming.com/tutorial/auto_ptr.html) seem to suggest that the above code should work. Anyway, any help would be appreciated! To initialize the fields of a class you use the initializat...
[ 0.31739991903305054, -0.31967854499816895, 0.48713669180870056, -0.16951227188110352, 0.09280428290367126, 0.27519097924232483, -0.0978018045425415, -0.35307034850120544, -0.35470613837242126, -0.0792103186249733, -0.4705860912799835, 0.35378098487854004, -0.3965394198894501, 0.18975056707...
line.reset(new int(3)); } }; ``` But there are more problems with this code; first of all, `new int(3)` does not create an array of three `int`s (as I think you think), but it creates a single `int` initialized to `3`. What you probably meant was `new int[3]`. *But*: `new int[3]` would need a `delete[]` to be fr...
[ 0.081020288169384, -0.3686034083366394, 0.4141071140766144, -0.2984825670719147, -0.03489618003368378, 0.10728365182876587, 0.5337430238723755, -0.526161253452301, -0.23804548382759094, -0.5389065146446228, -0.24023322761058807, 0.7044506669044495, -0.5717863440513611, -0.14275608956813812...
`std::vector` has virtually no overhead over a "normal" dynamic array.
[ -0.10821917653083801, -0.32762157917022705, 0.14865829050540924, 0.048153363168239594, -0.31793737411499023, 0.04973391443490982, -0.06670582294464111, 0.17150680720806122, -0.17987343668937683, -0.49726083874702454, -0.2988864779472351, 0.5001058578491211, -0.3132677376270294, 0.009167077...
This is pretty simple: how do I strip a ruby string of a special character? Here's the character: <http://www.fileformat.info/info/unicode/char/2028/index.htm> And here's the string, with the two special characters between the period and the ending quote: ``` "Each of the levels requires logic, skill, and brute force...
[ -0.03732355684041977, -0.007525317836552858, 0.44195443391799927, 0.01869521662592888, -0.1632254421710968, 0.014626638032495975, 0.4260973632335663, -0.31923046708106995, -0.2372259944677353, -0.3446289002895355, -0.5210607647895813, 0.21888451278209686, 0.05463103577494621, -0.2501171529...
I'm modifying the jquery ui slider. I have certain "stops" I want the user to be able to slide to, expressed as a percentage of the slider's overall width. So, for example, if I have 3 stops, they will be distributed evenly at 0, 50, and 100 (%). I store these in an array [0,50,100]. When the user drags the slider and...
[ 0.3149460256099701, -0.11616621166467667, 1.0381073951721191, -0.2545672655105591, -0.28258582949638367, 0.4661073684692383, -0.19784067571163177, -0.5624348521232605, -0.06697865575551987, -0.4003520607948303, 0.0552598275244236, 0.24042324721813202, -0.09689555317163467, -0.0963006392121...
closest to? Here's my code: ``` var optValArr = [0,50,100]; function slideStop( event, ui ) { var stopVal = ui.value; //NOW NEED TO FIND CLOSEST ARRAY VALUE TO stopVal } ``` Try This: ``` var optValArr = [0,50,100]; function slideStop( event, ui ) { var stopVal = ui.value; var diff=101; var ...
[ -0.36616188287734985, -0.2173650711774826, 1.0568162202835083, -0.16454346477985382, 0.024784818291664124, 0.16207745671272278, 0.09668126702308655, -0.30911874771118164, 0.17836099863052368, -0.5978195667266846, -0.15450435876846313, 0.6899827122688293, -0.09839888662099838, -0.3405112326...
diff=tmpDiff; val = optValArr[i] } } } slideStop("something", {"value":20}); ``` Demo: <http://jsfiddle.net/ggzZj/>
[ -0.04450378194451332, -0.5272896885871887, 0.542406439781189, -0.06694234907627106, 0.09551435708999634, -0.1855202168226242, 0.22306610643863678, -0.24965272843837738, -0.18034249544143677, -0.660326361656189, -0.5537832379341125, 0.7594961524009705, -0.25395387411117554, -0.2540408968925...
how can i add something in javascript that will check the website url of someone on a website and then redirect to a certain page on the website, if a match is found? for example... the string we want to check for, will be `mydirectory`, so if someone went to `mysite.com/mydirectory/anyfile.php` or even `mysite.com/my...
[ 0.17478902637958527, 0.10093183815479279, 0.42036280035972595, 0.019572069868445396, -0.16660989820957184, -0.15990950167179108, 0.11992427706718445, -0.18971776962280273, 0.009540663100779057, -0.8442339301109314, 0.20801401138305664, 0.27367016673088074, -0.29606735706329346, 0.085784003...
I am trying to remove all of a specific character from a string. I have been using `String.Replace`, but it does nothing, and I don't know why. This is my current code: ``` if (Gamertag2.Contains("^")) { Gamertag2.Replace("^" + 1, ""); } ``` This just leaves the string as it was b...
[ -0.05640895664691925, 0.1301548331975937, 0.4791455864906311, -0.15044236183166504, 0.20469437539577484, 0.1319981813430786, 0.3330165147781372, 0.05940621346235275, -0.1875590831041336, -0.649288535118103, -0.20820879936218262, 0.3341188430786133, -0.4331669807434082, 0.32417547702789307,...
instance: hence instead of(no need for the `Contains check)` ``` if (Gamertag2.Contains("^")) { Gamertag2.Replace("^" + 1, ""); } ``` just this(what's that mystic `+1`?): ``` Gamertag2 = Gamertag2.Replace("^", ""); ```
[ -0.17914453148841858, 0.1297474205493927, 0.4488895833492279, 0.025729574263095856, -0.008706826716661453, -0.27635517716407776, 0.7266727089881897, -0.1688588559627533, -0.014970052056014538, -0.493186891078949, -0.038777295500040054, 0.6990858912467957, -0.353336900472641, -0.03156708553...
I can't solve this problem... I'm having some problems with fetched properties (not with fetched requests). How can I created a fetched property to get the entity with a minimum field? If you see these captures, you will see it: ![enter image description here](https://i.stack.imgur.com/dU1F5.png) ![enter image descrip...
[ 0.3807706832885742, -0.3708902597427368, 0.5648768544197083, 0.17823362350463867, -0.08853413164615631, 0.10489585995674133, 0.19271643459796906, -0.3075461685657501, -0.4341280162334442, -0.5362233519554138, 0.20782704651355743, 0.5372344851493835, -0.22051766514778137, 0.3622718155384063...
belong to current category, the one with minimum timestamp? Thanks a lot, I appreciate your help a lot. You do not need a fetched property. use the following lines of code: ``` id minTimestamp=[myCategory.items valueForKeyPath:@"@min.timestamp"]; id maxTimestamp=[myCategory.items valueForKeyPath:@"@max.timestamp"]; ...
[ -0.008743518963456154, -0.14964571595191956, 0.33475297689437866, 0.37989866733551025, -0.03561466559767723, 0.13602635264396667, 0.1218789666891098, -0.11832582950592041, -0.2666383981704712, -0.5942258834838867, -0.06218648701906204, 0.4918804466724396, 0.13014113903045654, 0.17214928567...
I'm using jQuery and jQuery UI. When I submit a form ($("#compareit").submit(function(e){...), I hide my left and right columns on the page and show the AJAX results of the form submission. I'm also using some simple tooltips. The tooltips work fine prior to submitting the form...after submission, they stop working. I'...
[ 0.3776777684688568, 0.11329574137926102, 0.4316922724246979, -0.033924419432878494, -0.31105127930641174, -0.04866843298077583, 0.20266075432300568, -0.21091164648532867, 0.1435520052909851, -1.0244261026382446, 0.231255903840065, 0.6473187208175659, 0.01821090467274189, 0.0064559057354927...
my page Show results on page. Tooltips stop working The tooltip in question is: $('.tTip').betterTooltip({speed: 150, delay: 300}); ``` $(document).ready(function(e) { positions = new Array ('8' , '9'); positions_num = 7; position_list = new Array(positions_num); $("#tabsP" ).tabs(); $("#tooMan...
[ 0.03228602930903435, -0.00008703453204361722, 1.2328723669052124, -0.22648149728775024, 0.10372819751501083, 0.17862051725387573, 0.40313348174095154, -0.29465797543525696, -0.006577294319868088, -0.6783841848373413, -0.3971831500530243, 0.5642355680465698, -0.29098260402679443, 0.00105271...
$("#rightcolumn").hide(); $("#yearChooser").hide(); e.preventDefault(); var queryString = $('#compareit').serialize(); var dataString = queryString + "&count=" + totalselected; //alert(dataString); $.ajax({ type: 'GET', url:'newmlbcompare2p.php',
[ 0.009845892898738384, -0.3482530415058136, 0.8397654294967651, -0.14129357039928436, 0.08853191882371902, -0.02396433614194393, 0.3211701512336731, -0.055165115743875504, -0.4129413366317749, -0.15257903933525085, -0.3900052607059479, 0.3495493531227112, -0.2372296154499054, 0.249570176005...
cache: false, data: dataString, dataType : 'html', success:function(result){ $('#ajaxDiv').html(result); } }); return false; }); $( "#accordionRight" ).accordion({
[ -0.3939090967178345, -0.07309874892234802, 0.6793087124824524, -0.0866292342543602, 0.36398178339004517, 0.42703235149383545, 0.4366872310638428, -0.16888293623924255, -0.43145468831062317, -0.540762722492218, -0.222307950258255, 0.7096139788627625, -0.06831376999616623, -0.013968606479465...
collapsible: true, autoHeight: false }); $( "#accordionLeft" ).accordion({ header: "h3", autoHeight: false, navigation: true, collapsible: true, active: true }) $(".btn-slide").click(function(){ $("#ppanel").slideToggle("slow"); $(this).t...
[ -0.4179099202156067, -0.3357158899307251, 1.1265710592269897, -0.34801551699638367, 0.3509448766708374, 0.18327978253364563, 0.13423869013786316, -0.2657627463340759, -0.4001493453979492, -0.45004481077194214, -0.3533264994621277, 0.8491120934486389, -0.5394644737243652, 0.0321671105921268...
}); }); ``` If the tool tip inside the ajax is not working, because that content you loaded after binding your method to enable the tool tip. So the tool tip function is not aware of the new elements added. So you probably need to bind that function again to the new contents loaded. You can do so in your ajax succes...
[ 0.07177498191595078, -0.30664002895355225, 0.7109861373901367, 0.018961207941174507, -0.08459841459989548, -0.36961042881011963, 0.2588289976119995, -0.22756172716617584, -0.17378850281238556, -0.5298491716384888, -0.3279895782470703, 0.6314409971237183, -0.3637802302837372, -0.00701695587...
cache: false, data: dataString, dataType : 'html', success:function(result){ $('#ajaxDiv').html(result); $('.tTip').betterTooltip({speed: 150, delay: 300}); } }); ``` **EDIT:** The same thing applies to your other
[ -0.015959452837705612, -0.2098090648651123, 0.27106940746307373, 0.27389442920684814, 0.18001426756381989, 0.1984003484249115, 0.5853489637374878, -0.15466059744358063, -0.2629052400588989, -0.6822276711463928, -0.17676414549350739, 0.5918148756027222, 0.044591885060071945, -0.155702978372...
events also. Like you said, your click events are not working, You probable needs to change that to use jQuery `on` Change ``` $(".btn-slide").click(function() { //do stuff }); ``` to ``` $("#yourContainerDiv").on("click", ".btn-slide", function(event){ //do stuff }); ``` on will handle current elemen...
[ 0.07817525416612625, -0.36484986543655396, 0.372698575258255, 0.1377633512020111, 0.1478717178106308, 0.056524619460105896, 0.07083209604024887, -0.047209177166223526, -0.4002985954284668, -0.5783883929252625, -0.26431113481521606, 0.6789249777793884, -0.386194109916687, -0.263041317462921...
I have an app that displays 9 UIImageViews, and I'm trying to add in the ability for the user to delete them. So, I set it all up, and set up an alert view for the user to confirm that they want to delete the image that they tapped on. When I click Yes in the alert view, the app crashes and the debugger states: **2012...
[ -0.14852577447891235, 0.26745671033859253, 0.5565704107284546, 0.0822613537311554, -0.13415536284446716, 0.23344744741916656, 0.852202832698822, -0.07841507345438004, -0.2101219892501831, -0.6034882664680481, -0.22848446667194366, 0.47037050127983093, -0.5036186575889587, 0.304473429918289...
setImage in any of my code. This is the code I'm working with: ``` - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo { if (imageView.image == nil) { imageView.image = img; self.array = [NSMutableArray arrayWith...
[ -0.025130489841103554, -0.36854439973831177, 0.5867807865142822, -0.1542622447013855, -0.2643715441226959, -0.013937566429376602, 0.3332780599594116, -0.4764901101589203, -0.02487138658761978, -0.511898398399353, -0.23464636504650116, 0.7192142605781555, -0.4442467987537384, 0.025159131735...
NSLog(@"The image is a %@", imageView); [self.array addObject:[NSData dataWithData:UIImagePNGRepresentation(imageView2.image)]]; [picker dismissModalViewControllerAnimated:YES]; [self.popover dismissPopoverAnimated:YES]; return; } } ``` **.....** ``` - (IBAction)deleteButto...
[ -0.2686668038368225, 0.001169368508271873, 0.5220246911048889, -0.19503305852413177, -0.2947392463684082, 0.29019248485565186, 0.3874720633029938, -0.28620606660842896, -0.25268444418907166, -0.47164395451545715, -0.5092064142227173, 0.44684597849845886, -0.20416449010372162, 0.18830147385...
message:@"Are you sure you want to delete this photo?"
[ 0.600258469581604, 0.012936078943312168, 0.01690378598868847, 0.1589404195547104, 0.406033992767334, -0.0858602449297905, 0.5467901825904846, 0.5932111740112305, -0.46289801597595215, -0.14456835389137268, -0.02710234746336937, 0.07910370081663132, -0.525534987449646, 0.12763826549053192, ...
delegate:self cancelButtonTitle:@"No"
[ 0.28657662868499756, -0.18058308959007263, -0.1120043396949768, 0.1650715321302414, -0.1405441015958786, 0.08002723008394241, 0.3308491110801697, 0.061797723174095154, -0.31829437613487244, -0.33602607250213623, 0.021510833874344826, 0.2942218780517578, -0.2145889401435852, 0.2426190823316...
otherButtonTitles:@"Yes", nil]; [deleteAlertView show]; int imageIndex = ((UIButton *)sender).tag; deleteAlertView.tag = imageIndex; } - (void)alertView: (UIAlertView *) alertView clickedButtonAtIndex: (NSInteger) buttonIndex { if (buttonIndex != [alertView cancelButt...
[ 0.27785754203796387, -0.6075723767280579, 0.7075111865997314, -0.14845480024814606, -0.10993529111146927, 0.028953898698091507, 0.28956204652786255, -0.2810647487640381, -0.14209187030792236, -0.21504507958889008, -0.12739373743534088, 0.5592003464698792, -0.5504453778266907, 0.06061582639...
{ NSLog(@"User Clicked Yes. Deleting index %d of %d", alertView.tag, [array count]); NSLog(@"The tag is %i", alertView.tag); [self.array removeObjectAtIndex: alertView.tag]; NSLog(@"After deleting item, array count = %d", [array count]); NSLog(@"Returned view is ...
[ -0.35997962951660156, -0.23433859646320343, 0.44385457038879395, -0.4961901903152466, -0.09428183734416962, 0.26518383622169495, 0.4149082899093628, -0.3827773332595825, -0.10471788793802261, -0.5392722487449646, -0.402008593082428, 0.6722437143325806, -0.4554881453514099, -0.1115703508257...
((UIImageView *)[self.view viewWithTag:alertView.tag]).image =nil; } [self.user setObject:self.array forKey:@"images"]; } ``` I added breakpoints, and it appears that the line that is causing the crash is: `((UIImageView *)[self.view viewWithTag:alertView.tag]).image =nil;` The purpose of that l...
[ -0.19365771114826202, -0.005868374370038509, 0.3199913501739502, 0.09908778220415115, 0.050823234021663666, -0.08996588736772537, 0.31196296215057373, 0.14601732790470123, -0.16272605955600739, -0.5481094121932983, -0.2877082824707031, 0.510773777961731, -0.33916598558425903, 0.26930615305...
thanks! Turns out that I had my tags messed up. I tagged the invisible button over the UIImageView, forgetting that it was not the actual UIImageView. That explains all of the weirdness. I tagged the actual UIImageViews this time in accordance with the UIButtons, and it works fine now. Thanks everyone for all of your h...
[ 0.6007046103477478, -0.19095095992088318, 0.4626515209674835, 0.4389563202857971, -0.41896745562553406, -0.2061215192079544, 0.5653172135353088, 0.5590549111366272, -0.36663514375686646, -0.5414998531341553, -0.2090328335762024, 0.28299757838249207, 0.08711105585098267, -0.0074998997151851...
This question is on a sample exam that our professor was too lazy to type up solutions to and I am stuck pretty bad. Thanks in advance for your help! Prove that the following language is context-free `{x is an element of {a,b,c}* | the number of a's in x is greater than the number of b's or the number of c's in x}` > ...
[ -0.1838688850402832, 0.26865825057029724, -0.08420944958925247, 0.19056585431098938, -0.22910629212856293, 0.03143360838294029, 0.38537561893463135, -0.2279067188501358, -0.0959087684750557, -0.38924646377563477, -0.1870412826538086, 0.3488915264606476, -0.1820306032896042, 0.0243898835033...
greater than (the number of `b`'s plus the number of `c`'s) 2. (The number of `a`'s is greater than the number of `b`'s) or (the number of `a`'s is greater than the number of `c`'s). Hints for 1: A PDA could work as follows. If the stack is empty and you see an `a` on the input, then add an `a` to the stack. If the st...
[ -0.06908993422985077, -0.14857973158359528, -0.06513223797082901, -0.20775656402111053, 0.044973939657211304, 0.05052267760038376, -0.11179829388856888, -0.446744441986084, -0.0485883466899395, -0.5541952252388, -0.6285188794136047, 0.46618106961250305, -0.31707730889320374, -0.35265955328...
remove a `b` from the stack. If the top-most stack symbol is a `b` and you see a `b` or a `c` on the input, add another `b` to the stack. If the top-most stack symbol is an `a` and you see an `a` on the input, add another `a` to the stack. If the top-most stack symbol is an `a` and you see a `b` or a `c` on the input, ...
[ -0.21634820103645325, 0.11595603078603745, 0.09811123460531235, -0.3236251771450043, 0.0748424306511879, 0.0679551437497139, -0.1805148422718048, -0.33768466114997864, -0.10240599513053894, -0.4624134302139282, -0.9400107860565186, 0.34169748425483704, -0.5102980732917786, -0.1537442058324...
to the sum of the numbers of `b`'s and `c`'s; (2) an `a` on top of the stack if it saw more `a`'s than it saw either `b`'s or `c`'s (combined); (3) a `b` on top of the stack if it saw fewer `a`'s than it saw either `b`'s or `c`'s (combined). Hints for 2: First, construct a PDA accepting any string of `a`'s, `b`'s, and...
[ -0.4538584351539612, -0.06273792684078217, -0.07280178368091583, -0.1943807750940323, -0.285686731338501, 0.13748612999916077, 0.020447224378585815, -0.428981751203537, 0.09039192646741867, -0.4760236144065857, -0.6380874514579773, 0.5464861989021301, -0.6107281446456909, -0.23783209919929...
and `c`'s which has more `a`'s than `c`'s, ignoring any `b`'s (similar to the one you just built). Finally, demonstrate that the language you are trying to prove context-free is the union of the languages accepted by these automata; a simple argument should suffice. Since context-free languages are closed under union, ...
[ 0.1971859186887741, 0.23776787519454956, -0.1138758510351181, 0.14450234174728394, -0.06720393896102905, 0.06365456432104111, 0.22927989065647125, -0.04835256189107895, -0.36275985836982727, -0.23481078445911407, -0.405168741941452, 0.536672830581665, -0.3143292963504791, -0.16567385196685...
Is there any way to keep track the state of a UIButton whether it is selected or not? I tried accessing the selected property but it doesn't seem to work, seems to work only for UISwitch You need to set the state to selected if you want to use it like a toggle ``` - (void)buttonTapped:(UIButton *)button; { button....
[ -0.07208894193172455, -0.3633677363395691, 0.48367878794670105, 0.06546531617641449, -0.06936664134263992, -0.055531952530145645, 0.3738085627555847, -0.058371029794216156, -0.1506870985031128, -0.7096379995346069, -0.25703927874565125, 0.46457600593566895, -0.32623612880706787, 0.24441228...
Now I have a panel called panel1, and I would like to place a button on panel1, and set the position of the button as (30,30). How can I do this? I tried this, but seems that it is not the right way:( ``` int x = panel1.getX(); int y = panel2.getY(); button.setLocation(x+30,y+30); ``` Thanks a lot, t...
[ 0.11409665644168854, -0.18424850702285767, 0.7470648884773254, -0.3228795528411865, 0.08334895223379135, 0.31093308329582214, -0.11795276403427124, -0.3108092248439789, -0.5378513336181641, -0.9394689202308655, 0.09697606414556503, 0.7459923624992371, -0.47393476963043213, -0.0226663481444...
shall I use? According to the tutorial, it seems that there is no such layout manager....A key problem is I don't want the buttons to look like they are organized in grid, for example, button1 at (20,20) size 15, and button 2 at (40,70) size 20, button 3 at (150,40) size 5..... To display a SplitViewController you'll n...
[ 0.2120610922574997, -0.20403291285037994, 0.829049289226532, -0.006055609788745642, 0.018509717658162117, 0.2248973846435547, -0.05920944735407829, -0.4978572130203247, -0.02185330167412758, -0.8520662188529968, 0.048629291355609894, 0.6832078099250793, -0.31006863713264465, 0.185963869094...
UISplitViewController object as the root view of your application's > window. The panes of your split-view interface may then contain > navigation controllers, tab bar controllers, or any other type of view > controller you need to implement your interface. To get back you'll need to use setRootViewController to go...
[ 0.029794812202453613, -0.38271045684814453, 0.8969598412513733, 0.14370273053646088, -0.18272745609283447, -0.10013721883296967, 0.3349810838699341, -0.06914135813713074, -0.17022211849689484, -0.8359142541885376, -0.04698154702782631, 0.5776540637016296, -0.4415229260921478, 0.28116500377...
fudging](https://stackoverflow.com/questions/9671926/can-you-animate-setrootviewcontroller).
[ 0.04731416329741478, -0.354110449552536, 0.8219236135482788, 0.06355523318052292, 0.08801724016666412, -0.36137792468070984, 0.4149838089942932, -0.4189663231372833, -0.18022292852401733, -0.45445191860198975, -0.18255585432052612, 0.7339712977409363, -0.48868948221206665, -0.2462495416402...
I have a list of Divs within another div and I want to only target the first one. ``` <div id="content"> <div> I want to target this Div </div> <div> </div> <div> </div> </div> ``` How would I target only the first one and leave the rest alone? You can also do this: ``` $('#content div').first() ...
[ 0.3971635401248932, -0.05849471315741539, 0.16456715762615204, -0.041225168853998184, -0.4617323875427246, -0.13447396457195282, -0.05168949067592621, -0.1311030089855194, 0.12753191590309143, -0.7807307839393616, -0.12014737725257874, 0.6263718008995056, -0.772986650466919, 0.099322244524...
model: **User** ``` has_one :beta_invite before_save :beta_code_must_exist def beta_code_must_exist if beta_invite_id == beta_invite.find_by_name(beta_invite.id) user else nil end end ``` model: **BetaInvite** ``` has_many :users ``` What I`m trying to do is check for the existence of a ...
[ 0.18718275427818298, 0.05877437815070152, 0.27448245882987976, -0.17060048878192902, -0.14034748077392578, -0.41362521052360535, 0.18416371941566467, -0.2975082993507385, 0.042252831161022186, -0.9618708491325378, -0.06638488918542862, 0.562099814414978, -0.4404958486557007, 0.044805392622...
the form for :beta\_code 2. Add an attr\_accessor for that field: attr\_accessor :beta\_code 3. Then add the following line to the model (Assumes you only want to do this check on user creation): `validate :beta_code_must_exist, :on => :create` 4. Change `beta_code_must_exist` to add an error to the form. Also be sure...
[ 0.1990269273519516, 0.24013954401016235, 0.4524688124656677, -0.04746314510703087, 0.13837659358978271, -0.48900750279426575, 0.4994358420372009, -0.3954070210456848, 0.17257264256477356, -0.6162821650505066, -0.31277552247047424, 0.370503306388855, -0.5101669430732727, 0.2487591952085495,...
I'm following the guidance [here](https://stackoverflow.com/questions/9299331/what-is-the-best-practice-to-gracefully-shutdown-a-node-js-program-from-an-exter) (listening for `SIGINT` events) to gracefully shutdown my Windows-8-hosted node.js application in response to `Ctrl`+`C` or server shutdown. But Windows doesn'...
[ -0.16440057754516602, 0.09218799322843552, 0.42341095209121704, -0.1929408460855484, 0.13783492147922516, -0.3672415316104889, 0.573857307434082, 0.2502002716064453, -0.4686301350593567, -0.640265166759491, -0.3301554024219513, 0.5416828989982605, -0.16908954083919525, 0.2683000862598419, ...
on Windows? You have to use the readline module and listen for a SIGINT event: <http://nodejs.org/api/readline.html#readline_event_sigint> ``` if (process.platform === "win32") { var rl = require("readline").createInterface({ input: process.stdin, output: process.stdout }); rl.on("SIGINT", function () ...
[ -0.07320021092891693, -0.14093832671642303, 0.5845986008644104, -0.183515265583992, 0.08943598717451096, 0.09564600139856339, 0.43437647819519043, -0.2264133244752884, -0.17460884153842926, -0.7164243459701538, -0.4603036344051361, 0.5628563761711121, -0.19710782170295715, 0.05128388106822...
I am working on a project. I am trying to implement the core as independent jar file which can be run from command line or even a windows service. The core would be responsible to keep track couple of files and send some notification emails. The question is, what would be the best idea to keep GUI totally independent? ...
[ 0.299261212348938, 0.2400917261838913, 0.07430991530418396, 0.005710633471608162, -0.3314163088798523, 0.038713451474905014, 0.06917040795087814, -0.009452210739254951, -0.08635594695806503, -0.6130357384681702, 0.08802192658185959, 0.8103357553482056, -0.12551069259643555, -0.036163561046...
is incoming messages from core I had this software developed in Delphi and C. C was used to code the core logic and using Windows Messages and Callbacks, i registered Delphi GUI on C dll/service. I am confused how to implement it in java. * Observer pattern? * Small client/server communication between core and gui? ...
[ 0.10363081842660904, 0.024014564231038094, 0.3351473808288574, 0.1299428939819336, -0.35481974482536316, 0.016172898933291435, -0.046932660043239594, 0.15503038465976715, -0.3651945888996124, -0.7485225200653076, 0.15829218924045563, 0.21776863932609558, -0.4247113764286041, -0.08814246952...
to any idea, design or framework. Oberserver Pattern is really the correct answer for three out of your 4 use cases. On the level of your description you might have the following interface implemented by your core: ``` public interface Core { sendFiles(List<File> files); registerProgressListener(ProgressList...
[ -0.016128916293382645, -0.0313282236456871, 0.5790210962295532, -0.05610108748078346, -0.05727045610547066, 0.26953017711639404, 0.3732745349407196, -0.4438263773918152, -0.2837185263633728, -0.86470627784729, -0.1628306806087494, 0.4000681936740875, -0.5037896037101746, 0.0084441527724266...
public final double progress; public final String fileName; public ... // constructor } ``` You probably want your core and your gui to run in different threads. Otherwise your GUI would not react to any events while the core is running. Since the core shouldn't know anything about the GUI the handover betwee...
[ 0.2306063175201416, 0.08682876080274582, 0.3870903551578522, -0.052109137177467346, -0.15460608899593353, -0.17234158515930176, 0.4194563031196594, -0.2373262643814087, -0.21955353021621704, -0.4840241074562073, -0.27389267086982727, 0.642622709274292, -0.07645667344331741, 0.1542608290910...
If you have a C pointer which was defined in a method and are trying to return it from an object method in Objective C, what do you place as the return object type for the method? For example, I am using code that converts a UIImage into an RGBA image map (as seen [here](http://iphonedevelopment.blogspot.com/2009/05/o...
[ -0.11107324808835983, 0.23298314213752747, 0.4270365536212921, -0.19072555005550385, 0.07934939116239548, 0.340461403131485, 0.17385852336883545, -0.14662186801433563, -0.267744779586792, -0.45363649725914, -0.184048131108284, 0.6925787925720215, -0.4684382379055023, -0.26292750239372253, ...
to declare being returned? I don't know why is this related to C#, however Objective-C is a superset of C, thus every C syntax is also a valid Objective-C syntax. Just place `void*` as return type.
[ 0.4459537863731384, -0.024190934374928474, 0.02367021143436432, -0.30857497453689575, -0.34062495827674866, -0.2257382869720459, 0.15681517124176025, 0.10288520157337189, 0.04774755239486694, 0.004449719563126564, -0.13510096073150635, 0.7092613577842712, -0.4562795162200928, 0.18782503902...
I have a shell script which outputs all of the .js and .html files found in a folder provided by the user. I need to exclude a sub-folder and all its files from the search results. I'm using the `find` command to do this. The command I have currently excludes all the files under this sub-folder but outputs the sub-fold...
[ 0.118004210293293, 0.36489689350128174, 0.12245272099971771, -0.00197337637655437, 0.13681113719940186, -0.20535112917423248, 0.12065167725086212, 0.041362062096595764, 0.06787219643592834, -0.801056981086731, -0.2263915240764618, 0.6526384949684143, -0.2953208386898041, 0.0451157167553901...
output includes "Users/test/Desktop/Units/JSunit/CrashLog/". How can I exclude this? I know I can use grep, but would prefer if there is solution using find itself. I'm running on Mac OSX. You need `-print`, at the end and parenthesis around the file extension tests: ``` find "Users/test/Desktop/Units" -name CrashLog ...
[ -0.03898731619119644, 0.34449732303619385, 0.40129178762435913, 0.05651991069316864, 0.09931447356939316, -0.13613617420196533, 0.04534846171736717, 0.14498171210289001, 0.044007476419210434, -0.8842776417732239, -0.15288683772087097, 0.46287429332733154, -0.11554264277219772, -0.027527408...
The task is to write a program which prompts for a filename and then produces a concordance of that file. Ex. A concordance is an alphabetical index that shows the lines in a document where each word occurs. For example, a concordance for this paragraph might appear as: ``` Word Line Number a 1 1 ...
[ 0.14440393447875977, 0.21932882070541382, 0.40171191096305847, 0.105161651968956, -0.060433801263570786, 0.16197335720062256, 0.019487034529447556, -0.25449952483177185, 0.009818779304623604, -0.7195746302604675, -0.4581715166568756, 0.1748163253068924, -0.5332527756690979, 0.1078815981745...
that I can sort the words. I have this code: ``` f = open(raw_input("Enter a filename: "), "r") myDict = {} linenum = 0 for line in f: line = line.strip() line = line.lower() line = line.split() linenum += 1 for word in line: word = word.strip() word = word.lower() myDict[word] = linenum if word in...
[ -0.0681956484913826, -0.11772208660840988, 0.687957763671875, -0.24884594976902008, 0.02409341000020504, 0.21034549176692963, 0.22055372595787048, -0.23041044175624847, -0.12553371489048004, -0.74097740650177, -0.27130886912345886, 0.33891624212265015, 0.025136014446616173, -0.072118237614...
you explain this please? The file is the same as the example and the output should also be the example from above. I'm very new at python please help :[ I think it makes sense to use a dict, but you'll have to add a key along with each value you add to the dict. For example: ``` >>> dict = {} >>> dict["apple"] = "red...
[ -0.10209611803293228, 0.33385518193244934, -0.1900859773159027, -0.10739297419786453, 0.13849779963493347, 0.03497166186571121, 0.18647120893001556, 0.2217896729707718, 0.010516701266169548, -0.7753312587738037, -0.22535303235054016, 0.5963976979255676, -0.49168044328689575, -0.16781507432...
your assignment. Also, this line is problematic: ``` for word in line: ``` `line` is a string, so you're actually looking at each character in `line`, rather than each word. You'll have to find some way to transform `line` into a list of words... Lastly, your final statement will only print the last word read. You...
[ -0.011970131658017635, -0.1512705683708191, 0.5143041014671326, -0.04099250212311745, -0.2860860526561737, 0.2524259090423584, 0.3133925199508667, -0.22965359687805176, 0.04341519996523857, -0.766473114490509, -0.36778342723846436, 0.2907693684101105, -0.2685721516609192, -0.05481066554784...
to handle words that appear more than once (furthermore, dict doesn't have a sort method, which is why you're getting an error, but even if it did, you wouldn't need it here). Also, once you assign a value to a key, it's added to the dictionary, so it's already been "appended". In your example, the word *a* appears 3 ...
[ 0.04080415144562721, -0.010938622988760471, 0.16560639441013336, -0.07095517963171005, -0.25101062655448914, 0.07742411643266678, 0.4964062571525574, -0.216745063662529, -0.3180595934391022, -0.6541560292243958, -0.26174306869506836, 0.3022376000881195, -0.05257390812039375, -0.18306396901...
I have a need to swap between different DB instances of the same design. Is there a way to repoint the DBML to this different DB. What would be ideal would be to specify in code a different web.config connection string. However one would not want to change the Datacontext names in the codebase. If one was doing this in...
[ 0.19833499193191528, -0.09161365777254105, 0.4921312928199768, 0.21895302832126617, -0.257100909948349, -0.12339399009943008, 0.10433413833379745, -0.02942761965095997, -0.0645301342010498, -0.9265643954277039, -0.2020840048789978, 0.4624598026275635, -0.48936694860458374, 0.26307812333106...
a property on the DBML, and can be viewed through the designer) is used. You will only need to use the connection string constructor if you are using multiple connection strings through a single instance, and need to specify the database to which you should connect. In your case you simply need to include the appropr...
[ 0.274718314409256, -0.12641407549381256, 0.38979557156562805, 0.14459551870822906, -0.00008495456859236583, -0.279433012008667, -0.032583873718976974, -0.22093230485916138, -0.14688897132873535, -0.7776544094085693, -0.3720708191394806, 0.5725088119506836, -0.3620659410953522, 0.2900405228...
What I would like to do is display the following in a form: ``` Open [15] minutes before class ``` Where `[15]` is a **text-field.** Is this possible? Use a 'composite component' by adding the required parts to a `JPanel`. E.G. ![TimeBeforeClass](https://i.stack.imgur.com/kXD4O.png) ``` import java.awt.FlowLayout;...
[ 0.25368568301200867, -0.046458397060632706, 0.7190564870834351, -0.253037691116333, 0.14450563490390778, 0.09046835452318192, 0.20414091646671295, -0.5233535170555115, -0.16933594644069672, -0.6072299480438232, -0.17707309126853943, 0.434048593044281, -0.3782697319984436, 0.119227595627307...
gui.add(new JLabel("Open")); gui.add(new JSpinner(new SpinnerNumberModel(15,0,20,1))); gui.add(new JLabel("minutes before class")); JOptionPane.showMessageDialog(null, gui); } }); } } ``` Note that I swapped the 'textfield' for a `JSpinner` -
[ -0.32650578022003174, -0.24751847982406616, 0.4591170847415924, -0.3100650906562805, 0.048107344657182693, 0.002387529704719782, 0.398242324590683, -0.002744674449786544, -0.15247240662574768, -0.5534732937812805, -0.49351951479911804, 0.8161788582801819, -0.22867216169834137, 0.0524746216...
a more suitable component for selecting 'time in minutes'.
[ 0.25266730785369873, -0.19738297164440155, 0.11968772113323212, 0.07522913813591003, 0.06440577656030655, 0.2684495449066162, -0.00807176437228918, -0.17907118797302246, -0.19904357194900513, -0.578487753868103, -0.028918461874127388, -0.09075703471899033, 0.34693190455436707, 0.2249411940...
I have NFS installed for Windows 2008 but when I try to access C:/Windows/System32/mount.exe or umount.exe and execute it in Java, I get an IO Exception that the file cannot be found. ``` Runtime.getRuntime().exec("C:/Windows/System32/mount.exe <location> J:"); ``` This also doesnt work if you were thinking it might...
[ -0.10748745501041412, 0.17650823295116425, 0.5555575489997864, -0.3580726087093353, 0.050699565559625626, -0.14560391008853912, 0.5928875207901001, -0.1600445657968521, -0.34750035405158997, -0.8777938485145569, 0.10558159649372101, 0.5690260529518127, -0.36474379897117615, 0.2874357402324...
Windows? ``` java.io.IOException: Cannot run program "C:/Windows/System32/mount.exe": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at Data.SystemExecutor.exec(SystemExecutor.java:46) at Data.SystemExecutor.exec(SystemExecutor.java:18) at Mount.Mount...
[ -0.08823417872190475, 0.47340884804725647, 0.4947991669178009, -0.2539452314376831, 0.19191992282867432, 0.22916889190673828, 0.5114926099777222, -0.15882240235805511, -0.422698050737381, -0.6748111844062805, -0.35209038853645325, 0.7948765754699707, -0.4307861328125, 0.18009421229362488, ...
For some reason the php mail() function is not working properly on a site I am building. I tried to troubleshoot the issue down to its simplest form, and came up with this file: ``` <?php mail('myEmail@gmail.com', 'the subject', 'the message', 'From: webmaster@example.com', '-fwebmaster@example.com'); ?> ``` when my...
[ 0.23217473924160004, 0.5158019065856934, 0.29205843806266785, -0.006044428795576096, -0.3005116581916809, -0.21283137798309326, 0.5927628874778748, 0.18035726249217987, -0.10529719293117523, -0.6086141467094421, 0.0662330836057663, 0.3977035880088806, -0.21700870990753174, 0.23674188554286...
add that this was all working fine a few weeks ago, the last time I tested it. No significant code changes since then at all. EDIT 2 - After reading a similar post I tried adding From and Reply-To headers... still no luck. New code: ``` <? $headers = 'From: <some@email.com>' . "\r\n" . 'Reply-To: <some@email.com>'; ...
[ 0.39556849002838135, 0.11223556846380234, 0.5037776827812195, -0.09819955378770828, -0.2767947018146515, -0.04598157852888107, 0.43035897612571716, -0.07265500724315643, -0.2651169002056122, -0.6005475521087646, 0.061543624848127365, 0.468144029378891, -0.5283920168876648, -0.0176144260913...
email address on page refresh. It worked when I sent to my exchange-based email address, but not to any Google-related accounts. Code: ``` $headers = 'From: <test@test.com>' . "\r\n" . 'Reply-To: <test@test.com>'; mail('<myEmail@gmail.com>', 'the subject', 'the message', $headers, '-fwebmaster@example.com'); ?> `...
[ 0.21419256925582886, 0.26236334443092346, 0.3980315029621124, 0.07588808238506317, -0.19978561997413635, 0.19148683547973633, 0.4840688109397888, 0.18047505617141724, 0.15450838208198547, -0.7801093459129333, -0.006682088132947683, 0.4065643548965454, -0.01508504617959261, 0.05359874665737...
hello i am new here and i hope i don`t post in a wrong place the problem is like this: i use a .getJson to retrive results from a database. and the results are appendet to a table [multiple rows] once i click to a img it loads a detailed view of the data into a div(or another table). my problem is the following: i mus...
[ -0.3426983058452606, 0.05025502294301987, 0.7770175337791443, -0.15440620481967926, -0.13893689215183258, -0.14504873752593994, 0.4468874931335449, -0.3631250858306885, -0.14450213313102722, -0.8029527068138123, -0.019585000351071358, 0.37135934829711914, -0.22134436666965485, 0.5249651670...
Name: </td><td>" + data[i].name + "</td></tr>" ... [lots of data] $("img.#editrow" + i ).click( function(){ $(detailfull).appendTo("table.#detailsfull"); }); }); }); }); ``` the html: [html code] ``` &lt;table id="shorttableinfo"&gt; // i need a small table here &lt;tr&gt;&lt;td&gt;Name:&lt;/td&gt;&lt;td&...
[ -0.17324645817279816, 0.0778186023235321, 0.4250151813030243, -0.15761134028434753, 0.3022589683532715, 0.1669856607913971, 0.2840198576450348, -0.16344000399112701, -0.06241230294108391, -0.5353233218193054, -0.6346421837806702, 0.3340144753456116, -0.43929365277290344, 0.1603059768676757...
a string replace. On the most basic level there are two strings `MountPoint` Which will be used as the "mount point", such as your `SomeRoot`. `MountResolve` Which is the location to what `mount point` is pointed at for when "resolving" a file location. This is the same as your `C:\SomeFolder`. Besides for the obvio...
[ -0.2509511113166809, -0.23627319931983948, 0.6651955842971802, -0.10362451523542404, 0.039624083787202835, -0.16954931616783142, 0.14717064797878265, -0.15979479253292084, 0.013107085600495338, -0.3728218972682953, -0.27976518869400024, 0.6932602524757385, -0.5294551849365234, -0.008355199...
result into `resolvedPath`. ``` resolvedPath = mountPath; resolvedPath.replace(0, mMountPoint.size() + 1, mMountResolve.c_str(), mMountResolve.size()); ``` However, there is more that can be done in that function. The reason why I have it returning a bool is because the function should fail `mountPath` does not hav...
[ -0.3433329463005066, -0.2203773856163025, 0.8033079504966736, -0.29848137497901917, 0.16499459743499756, -0.06351540982723236, 0.04252460226416588, -0.19782967865467072, -0.34934866428375244, -0.39262327551841736, -0.189754918217659, 0.736199676990509, -0.3804374039173126, 0.18800221383571...
your access for setting the mount resolve, you want to check to see if there is there is a trailing folder slash. If there is not, then add it. ``` void FileSystem::SetMountResolve(const String& mountResolve) { mMountResolve = mountResolve; if(*(mMountResolve.end() - 1) != FOLDERSLASH) mMountResolve +...
[ -0.34417545795440674, -0.07201112806797028, 1.017648696899414, -0.20992764830589294, 0.054656852036714554, -0.141294464468956, 0.2494659125804901, -0.49778708815574646, -0.10793928056955338, -0.5913766026496887, -0.17122617363929749, 1.0198346376419067, -0.20067152380943298, 0.098613604903...
I have an disappearing delete animation code and I want to get the entire div "parent\_parent" to disappear. Here is the HTML ``` <div class="parent_parent"> <div class="parent"> <a href="?delete=1" class="delete_link"></a> </div> </div> ``` And here is part of the jquery code that makes the parent\...
[ -0.19303035736083984, -0.0072523136623203754, 0.621783971786499, -0.16048908233642578, 0.11087999492883682, 0.10759091377258301, 0.2745889127254486, -0.16892962157726288, -0.0030336875934153795, -0.5931435823440552, -0.30895259976387024, 0.3283396363258362, -0.33431777358055115, 0.40411785...
url: 'delete.php', data: 'ajax=1&delete=' + parent.parent().attr('id').replace('sort_', ''), beforeSend: function() { parent.parent().animate({ 'backgroundColor': '#fff' }, 300);
[ -0.1774049550294876, -0.26942771673202515, 0.5193822979927063, 0.03820503503084183, 0.029961230233311653, 0.4200361371040344, 0.2155746966600418, -0.057748399674892426, 0.10696542263031006, -0.4839915335178375, -0.4329758882522583, 0.23981797695159912, -0.28001099824905396, 0.3037436306476...
}, success: function() { parent.parent().slideUp(300,function() { parent.parent().remove(); }); } }); }); });​ ``` But so far no animation
[ -0.20497043430805206, 0.040930405259132385, 0.5513688921928406, 0.14119699597358704, 0.18142792582511902, 0.5548439621925354, 0.24811679124832153, -0.09753267467021942, -0.1360345035791397, -0.41354262828826904, -0.29392585158348083, 0.2690538167953491, -0.009827103465795517, 0.34065505862...
happens, but if I just call one parent then the inside div does disappear. I don't get any error messages either. Your code is still too complicated for what you are trying to do. This is better: ``` // $(function(){ is shorthand for $(document).ready(function(){ $(function() { $('a.delete_element').click(function...
[ 0.1384437084197998, -0.2133481204509735, 0.20271416008472443, -0.1592053771018982, 0.4364226460456848, -0.0692233070731163, 0.2555985748767853, -0.2038470357656479, -0.06684551388025284, -0.9604596495628357, -0.13953039050102234, 0.5185022950172424, -0.29195839166641235, 0.5672970414161682...
$.ajax({ type: 'get', url: 'delete.php', // You had multiple instances of parent.parent(), but no direct usage of parent alone // This is a clue that you can simplify parent.parent() since you are traversing to the same element every time data: 'ajax=1&delete=...
[ -0.14293184876441956, -0.24700391292572021, 0.11821597814559937, 0.202833354473114, 0.026726840063929558, -0.13912177085876465, 0.4073844850063324, 0.031539857387542725, -0.07793386280536652, -0.6689779758453369, 0.0877467468380928, 0.3131239712238312, -0.07513832300901413, 0.1799669414758...
container.attr('id').replace('sort_', ''), beforeSend: function() { containter.animate({ 'backgroundColor': '#fff' }, 300); }, success: function() {
[ -0.11249539256095886, -0.3022872805595398, 0.44567376375198364, -0.01851116307079792, 0.3991852104663849, 0.18040607869625092, -0.15605580806732178, -0.21305792033672333, -0.22438853979110718, -0.6212600469589233, -0.2932143807411194, 0.42048904299736023, -0.2954710125923157, 0.23580199480...
container.slideUp(300, function() { // Do not repeat the same selector within a callback // That's what `this` is for $(this).remove();
[ 0.26342108845710754, -0.3152450621128082, 0.4129599332809448, -0.28113648295402527, 0.31103622913360596, 0.05151968449354172, -0.07189687341451645, -0.2471553534269333, -0.01068838406354189, -0.3937811851501465, -0.06429651379585266, 0.4662741720676422, -0.48063603043556213, 0.400036990642...
}); } }); }); });​ ``` If you use this code example as it is, it will work.
[ 0.16413715481758118, 0.1388295292854309, 0.26521676778793335, -0.2614963948726654, 0.2484026849269867, -0.3471881151199341, 0.5891094207763672, -0.3019302487373352, 0.09784764796495438, -0.4833560585975647, -0.5133867263793945, 0.7433368563652039, -0.46195971965789795, 0.11834046989679337,...
Does anyone know how exactly the asset digest value is calculated? If I have two JS files which contain various other included JS scripts then will each file maintain the same digest hash if none of the inner scripts have been changed? Or is a new digest value calculated each time the assets:precompile operation is run...
[ 0.6098118424415588, 0.05484768748283386, -0.2745138704776764, 0.3667930066585541, 0.17894721031188965, -0.22011549770832062, 0.1673273891210556, -0.2556542456150055, -0.27469590306282043, -0.48586326837539673, 0.23815295100212097, 0.5957922339439392, 0.03662591800093651, 0.0184575021266937...
content. When the content is updated, the fingerprint will change. > This will cause the remote clients to request a new copy of the > content. This is generally known as cache busting. > > > The technique that Rails uses for fingerprinting is to insert a hash > of the content into the name, usually at the end. Fo...
[ 0.0791940987110138, 0.0761604979634285, 0.03891872987151146, 0.34720540046691895, 0.02546861208975315, -0.4460083544254303, 0.381198525428772, 0.2918178141117096, -0.2864934206008911, -0.6907391548156738, -0.3152298331260681, 0.21732188761234283, -0.41578787565231323, 0.5008513927459717, ...
I'm trying to generate an array of integers contains randoms adding up to a particular value. Here's my code: ``` private long[] getRandoms(long size , long sum) throws Exception { double iniSum = 0; System.out.println("sum = " + sum); long[] ret = new long[(int) size]; for (int i = 0 ; i < ret.length; i++) { ...
[ 0.034874942153692245, -0.2720215618610382, 0.17752639949321747, -0.22651131451129913, -0.10656452178955078, 0.2425740361213684, 0.27991193532943726, -0.6902779340744019, -0.359853059053421, -0.2376115620136261, -0.10185244679450989, 0.30764660239219666, -0.35853296518325806, 0.190552204847...
iniSum); System.out.println("ret[" + i +"] = " + ret[i]); finSum += ret[i]; } if (finSum != sum) throw new Exception("Could not find " + size + " numbers adding up to " + sum + " . Final sum = " + finSum); return ret; } private long randomInRange(long min , long max) { Random rand = new Random(); l...
[ -0.24336427450180054, -0.7368089556694031, 0.20652207732200623, -0.1580030918121338, 0.14833980798721313, 0.20985335111618042, 0.25186675786972046, -0.4827757477760315, -0.18040986359119415, -0.4874521493911743, -0.15178585052490234, 0.33080413937568665, -0.0984281376004219, 0.440841346979...
100 numbers adding up to 4194304 . Final sum = > 4194305.0 I think I'm losing accuracy in this bit: ``` (sum * ret[i]) / iniSum ``` Can you recommend an alternative algorithm or a fix in my code which can help me achieve this objective? Each time you scale a value with `ret[i] = Math.round((sum * ret[i]) / iniSum)...
[ -0.010093770921230316, 0.04120437055826187, 0.6029318571090698, 0.2088298499584198, -0.012219076044857502, 0.4505043923854828, 0.06546729058027267, -0.555733323097229, -0.24261081218719482, -0.5517427325248718, 0.19586068391799927, 0.08768999576568604, -0.1835886687040329, 0.03111108951270...
votes. Two techniques for mitigating this: First scale all the values in the list, but keep track of the difference between the ideal scaled value (a real number) and stored scaled value. Use truncation instead of rounding, so that the discrepency will always be positive. If there is a discrepency, you can increment ...
[ -0.05243707448244095, -0.46929144859313965, 0.6149988770484924, 0.3055706024169922, 0.12320282310247421, 0.20751743018627167, 0.04764025658369064, -0.8573407530784607, -0.24850402772426605, -0.5172439813613892, 0.14369800686836243, 0.4856933057308197, -0.25252559781074524, -0.3563204109668...
* ret[i]) / iniSum; ret[i] = (long) (ideal[i]); // Truncate, not round System.out.println("ret[" + i +"] = " + ret[i]); finSum += ret[i]; } /* There are iniSum - finSum extra amounts to add. */ for (int i = 0; i < iniSum - finSum; i++) { /* Pick a target slot to increment. This could be done by keepi...
[ -0.09954285621643066, -0.4761190116405487, 0.537810742855072, -0.11446007341146469, 0.20225681364536285, 0.5030539035797119, -0.10850311070680618, -0.623422384262085, -0.2339637726545334, -0.5435811877250671, -0.253530889749527, 0.4549793004989624, -0.05387648940086365, -0.0616807751357555...