text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
or > * 250 paid app promo codes + 250 promo codes for one in-app product, or > * 100 promo codes for five in-app products
[ 0.2627812922000885, 0.12843355536460876, 0.31069639325141907, 0.3922716975212097, 0.029049614444375038, 0.4521266222000122, 0.17538341879844666, -0.27598780393600464, -0.049832455813884735, -0.3766847252845764, -0.3853527903556824, 0.6547889709472656, 0.07293622195720673, -0.28875052928924...
This CSS code does work in all browsers except FireFox. Why ? How can I fix it ? ``` .img_box { width: 110px; height: 160px; background-repeat: no-repeat; background-position: center center; background-image: url('https://www.google.com/images/srpr/logo3w.png'); } ``` Thanks in advance. **EDIT:** Here is ...
[ 0.030971696600317955, 0.3860498368740082, 0.4305698275566101, -0.11495740711688995, -0.08778233826160431, -0.16333994269371033, 0.21162259578704834, -0.03072422556579113, -0.2000284641981125, -0.9308590292930603, -0.1292334496974945, 0.42312151193618774, -0.3869589865207672, -0.18058371543...
solution to this problem. In your case, however, you would be much better off using a `div` and adding `display:inline-block` to your CSS, instead of using an image.
[ 0.16790108382701874, 0.11407244205474854, 0.25951433181762695, 0.20889495313167572, -0.17617082595825195, -0.16803355515003204, 0.08727869391441345, 0.16207994520664215, -0.13885337114334106, -0.8448894619941711, -0.00974439550191164, 0.34031280875205994, -0.4157460033893585, 0.04294690117...
I have a django test site and I can see the admin site, but it has different formatting from the tutorial examples. This is how my admin site looks: ![enter image description here](https://i.stack.imgur.com/X3hpj.png) But on the example it looks like this: ![enter image description here](https://i.stack.imgur.com/h...
[ 0.5506986975669861, 0.5367215275764465, 0.017278170213103294, -0.27619683742523193, -0.47254377603530884, -0.4084468185901642, 0.12963753938674927, -0.024240095168352127, -0.19714705646038055, -0.5297911167144775, 0.08429709076881409, 0.5225746631622314, -0.28152233362197876, -0.0267499703...
I have a bigger rapidly growing data set of around 4 million rows, in order to define and exclude the outliers (for statistics / analytics usage) I need the algorithm to consider all entries in this data set. However this is too much data to load into memory and my system chokes. I'm currently using this to collect and...
[ 0.05535406619310379, -0.06361022591590881, 0.555513322353363, 0.19581246376037598, 0.15748384594917297, 0.023478953167796135, 0.0587669312953949, -0.10835394263267517, -0.13389912247657776, -0.6504049897193909, 0.32850781083106995, 0.2772862911224365, -0.11907273530960083, 0.28133639693260...
order( :score ). pluck( :score ) ``` Using the typical divide and conquer method won't work, I don't think because every entry has to be considered to keep my outlier calculation accurate. How can this be achieved efficiently? `innerFence` identifies the lower quartile and upper q...
[ -0.42154017090797424, 0.006178774870932102, 0.10576186329126358, 0.21789143979549408, 0.11481233686208725, 0.3339523673057556, 0.018529647961258888, -0.48838749527931213, 0.07132427394390106, -0.5537941455841064, 0.06819897890090942, 0.31630000472068787, -0.1375775933265686, -0.03525042161...
refactored, non-DRY) code for this: ``` def q1(s) q = s.length / 4 if s.length % 2 == 0 return ( s[ q ] + s[ q - 1 ] ) / 2 else return s[ q ] end end def q2(s) q = s.length / 4 if s.length % 2 == 0 return ( s[ q * 3 ] + s[ (q * 3) - 1 ] ) / 2 else return s[ q * 3 ] end end def inner...
[ -0.04546692594885826, -0.13879230618476868, 0.5654426217079163, -0.30626797676086426, 0.14220356941223145, 0.21746069192886353, 0.5531367063522339, -0.6865743398666382, 0.0007725231698714197, -0.43988072872161865, -0.18069231510162354, 1.0011781454086304, -0.3529205620288849, -0.0232133027...
q2 = q2(s) iq = (q2 - q1) * 3 if1 = q1 - iq if2 = q2 + iq return [if1, if2] end ``` This is not the best way, but it is an easy way: Do several querys. First you count the number of scores: q = Post.where( :source => 1 ).count then you do your calculations then you fetch the scores q1 = Post.where( :sou...
[ -0.15214082598686218, -0.0172627791762352, 0.3003048300743103, -0.19591322541236877, -0.3466750681400299, 0.2689453065395355, 0.2512078583240509, -0.5366548299789429, -0.13711842894554138, -0.5204509496688843, 0.273711621761322, 0.514455258846283, -0.08706016838550568, 0.03303300589323044,...
I'm updating an array by adding a varchar to an int4 array. The 'varchar' field is all numbers so I tried casting it to ::integer but it isn't working ``` update dwh.attr_lookup set kli_tree = array[target_909_kli::integer] || kli_tree ``` is giving me this error ``` ERROR: ERROR: invalid input syntax for integer:...
[ 0.21772323548793793, 0.22224310040473938, 0.3307245671749115, -0.3951680362224579, -0.2181786298751831, 0.30652570724487305, 0.7861382365226746, -0.4510737657546997, 0.009532091207802296, -0.45540693402290344, 0.034429118037223816, 0.6719504594802856, -0.5059129595756531, 0.101858295500278...
^ ``` You'll have to decide what you want to do with empty strings. If you want to convert them to zeros, then something like this should work: ``` array[case when target_909_kli = '' then 0 else target_909_kli::integer end] ```
[ -0.06125825271010399, 0.1028657779097557, 0.30308279395103455, -0.24701844155788422, -0.07438844442367554, 0.04932824894785881, -0.08830410242080688, -0.0406087301671505, -0.1801564246416092, -0.3291894495487213, -0.09352879226207733, 0.382754385471344, -0.45853957533836365, -0.07229135185...
How do you register a new message processor class with WSO2 ESB? I've tried dropping the jar file into CARBON\_HOME/repository/components/plugins and dropins but when I create a custom MP via the carbon console I get a ClassNotFound exception. I am using version 4.0.3. Cheers Probably the most correct way to do fra...
[ 0.24077820777893066, 0.13731877505779266, 0.41570180654525757, 0.05356287583708763, -0.4540442228317261, 0.128082275390625, 0.09485821425914764, -0.17376217246055603, -0.14890289306640625, -0.6559235453605652, 0.1710364818572998, 0.34555935859680176, 0.11573082953691483, -0.126315727829933...
quick test shows that it currently only works in Firefox and Opera. See it here: <https://jsfiddle.net/6sfeqcw5/>
[ 0.18419864773750305, -0.14249740540981293, 0.5622270703315735, -0.16313327848911285, 0.03154865279793739, -0.27820447087287903, 0.4405183792114258, -0.2141358107328415, -0.10240847617387772, -0.5409038662910461, -0.1596968024969101, 0.3139541447162628, -0.34978505969047546, -0.001159123959...
I need a regex to match a string not enclosed by another different, specific string. For instance, in the following situation it would split the content into two groups: 1) The content before the second {Switch} and 2) The content after the second {Switch}. It wouldn't match the first {Switch} because it is enclosed by...
[ 0.13774584233760834, -0.11803605407476425, 0.5120633244514465, 0.19362498819828033, 0.027800366282463074, -0.1222924292087555, -0.0007393336272798479, -0.1240595281124115, 0.03627942502498627, -0.6915960311889648, -0.06979513168334961, 0.4135887026786804, -0.28375712037086487, 0.4271700978...
here too {Switch} More content ``` So far I've gotten what is below which I know isn't very close at all: ``` (.*?)\{Switch\}(.*?) ``` I'm just not sure how to use the [^] (not operator) with a specific string versus different characters. Try this simple function: function find\_content() ------------------------...
[ -0.10387646406888962, -0.19455495476722717, 0.8588733077049255, -0.10371439158916473, 0.011468065902590752, -0.153131902217865, 0.19492435455322266, -0.411639541387558, 0.09169657528400421, -0.458294540643692, -0.47574082016944885, 0.6567434072494507, -0.2918880581855774, 0.036643173545598...
return $res; } ``` Use it this way --------------- ``` $content_parts = find_content($doc); // $doc is your input document print_r($content_parts); ``` Output (your example) --------------------- ``` Array ( [0] => Some more {my_string} Random content {Switch} //This {Switch} may or may not be here, but sho...
[ 0.009677819907665253, -0.1599583774805069, 0.6944446563720703, -0.06144217401742935, 0.05956462398171425, -0.052846722304821014, 0.15328966081142426, -0.5030545592308044, -0.234110489487648, -0.6201411485671997, -0.3211967349052429, 0.6143802404403687, -0.24832022190093994, 0.1495357602834...
Say we have a class Potato (and instances therefore) that has an attribute smoothness which is used for other method but is not pretended to be public. This attribute is setted when the instance is created and is used only internally the instance. Moreover, my system should support several database drivers, therefore ...
[ -0.4118763506412506, 0.22228558361530304, 0.15227408707141876, 0.16908961534500122, 0.11253895610570908, 0.2518969476222992, 0.0364849679172039, 0.3124399185180664, -0.3117756247520447, -0.8050387501716614, 0.0982399508357048, 0.7223218083381653, -0.1428333967924118, 0.3737882077693939, ...
potato by using the database adaptor class, but.. it's private! How can I send the smoothness of the potato without making it accessible for other purposes? Thanks in advance Write a method that allows the object to save itself, taking a writer of some kind as a parameter. Since this is a database, you might need to h...
[ -0.20764872431755066, 0.0006318768719211221, 0.11467363685369492, -0.11403947323560715, 0.11151260882616043, 0.41566362977027893, 0.03723670542240143, 0.029838109388947487, 0.23021285235881805, -1.098527431488037, 0.04610789567232132, 0.7628207802772522, -0.2768096625804901, 0.154069587588...
double mSmoothness; public void InsertToDatabase(Database pDatabase) { pDatabase.InsertToPotatoes(mID, mSmoothness, ...); } public void UpdateDatabase(Database pDatabase) { pDatabase.UpdatePotatoes(mID, mSmoothness, ...); } } ```
[ -0.06960408389568329, -0.20510387420654297, 0.3164365589618683, -0.20780667662620544, 0.2098734974861145, 0.32645583152770996, 0.014086958952248096, -0.03129388391971588, -0.21194283664226532, -0.6170934438705444, -0.4415256083011627, 0.75237637758255, -0.6723354458808899, -0.0521973557770...
I tried `BigDecimal.valueOf(Double.POSITIVE_INFINITY)`, but kept getting `NumberFormatException` Thanks This behavior corresponds to the [documented](http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html#valueOf%28double%29) way the `valueOf` method is supposed to work: > Parameters: val - double to ...
[ 0.11883231997489929, -0.08347177505493164, 0.12143301963806152, -0.2036745399236679, -0.1456189900636673, -0.00026291163521818817, 0.24374087154865265, -0.15739887952804565, -0.202461376786232, -0.4209822118282318, 0.14696912467479706, 0.7027634382247925, -0.22509895265102386, 0.2050772309...
I am writing a C++ library in Xcode 4.2. One of my classes won't compile with this error: > attempt to use a deleted function There is no specific indication what function it's talking about. I don't want to post the class code here, but does anybody have any idea what this error means? In C++11 you can declare func...
[ 0.4102466106414795, 0.3795638382434845, 0.19874690473079681, -0.23120523989200592, 0.03023865818977356, -0.2954428791999817, 0.4939614236354828, 0.08905203640460968, -0.21270494163036346, -0.4140301048755646, -0.2271823137998581, 0.7010894417762756, -0.6465325951576233, 0.10144639015197754...
for the non-copyable trick used pre-C++11. Also, there are rules in the C++ spec that lead to member functions being implicitly deleted. The error is telling you that your program attempts to use a deleted function. You'll have to post the error you're getting for more detailed help.
[ 0.009940963238477707, 0.10482460260391235, -0.0681680217385292, -0.02781490609049797, 0.2275315374135971, -0.3126445412635803, 0.593097984790802, 0.1704971194267273, -0.46648484468460083, -0.12691563367843628, -0.15054850280284882, 0.5501408576965332, -0.5750487446784973, 0.216411933302879...
I'm working on an iOS music app (written in C++) and my model looks more or less like this: ``` --Song ----Track ----Track ------Pattern ------Pattern --------Note --------Note --------Note ``` So basically a `Song` has multiple `Tracks`, a `Track` can have multiple `Patterns` and a `Pattern` has multiple `Notes.` E...
[ 0.20829211175441742, 0.16288208961486816, 0.2993423044681549, 0.12438642978668213, 0.09117995947599411, 0.12652279436588287, -0.14407601952552795, -0.4783352017402649, -0.07384421676397324, -0.5799277424812317, 0.1877903789281845, 0.3856092095375061, 0.0213394183665514, 0.13020457327365875...
the start of the third second. My question is how I should represent those notes for best performance? Right now I'm thinking of storing the notes in a vector datamember of each pattern and than loop all the `Tracks` of the `Song`, than look the `Patterns` and than loop the `Notes` to see which one has a frame datamem...
[ -0.02613651379942894, -0.19136042892932892, 0.5056749582290649, 0.03341423347592354, -0.4642287492752075, -0.03473767265677452, 0.3766039311885834, -0.22838757932186127, -0.25565004348754883, -0.7196344137191772, 0.3354080617427826, 0.18389369547367096, 0.16126899421215057, 0.1317064911127...
all the frames and send them to the buffer on time. One thing you should remember is that to improve performance, normally memory consumption would have to increase. It is also relevant (and justified) in this case, because I believe you want to store the same data **twice**, in different ways. First of all, you shoul...
[ 0.04372502118349075, -0.09893462061882019, 0.16548070311546326, 0.371488094329834, -0.07981210201978683, 0.06297032535076141, 0.14747363328933716, -0.3186355233192444, -0.1728537678718567, -0.8509515523910522, -0.0155617855489254, 0.5719252824783325, -0.16692188382148743, -0.00398500030860...
main performance concern is to loop through thousands of notes. Here's how I suggest to solve it: First of all, for each `Pattern` object you should have a `vector<Note>` as your main data storage. You will write all the changes on the `Pattern`'s contents to this `vector<Note>` first. ``` vector<Note> notes; ``` A...
[ 0.09032202512025833, 0.021949898451566696, 0.24935494363307953, 0.16740965843200684, -0.19199086725711823, -0.04533709958195686, -0.03904443979263306, -0.3196457326412201, -0.4116024374961853, -0.7335742712020874, 0.25003451108932495, 0.1810043901205063, -0.05209007114171982, -0.0642051845...
`measures`. You could also do it only once every time before the playback, or even *while* playback, in a separate thread. Of course, you could only store notes in measures, without having to sync two sources of data. But it may be not so convenient to work with when you have to apply mass operations on bunches of not...
[ 0.2142002433538437, -0.27362748980522156, 0.24109415709972382, 0.30113306641578674, -0.14870943129062653, 0.09390883892774582, -0.005144179333001375, -0.5681071281433105, -0.4348604679107666, -0.8105078339576721, 0.2778876721858978, 0.05682411417365074, 0.11022640019655228, 0.1178169101476...
from the `measures` map. 3. Now, until the next measure (second?) starts, you only have to loop through current measure's notes.
[ 0.2502720057964325, 0.04123324528336525, 0.33549317717552185, -0.010573715902864933, -0.08666495233774185, -0.192353293299675, 0.2288702130317688, -0.25742533802986145, -0.29315608739852905, -0.7494943141937256, 0.04657622054219246, -0.03904593363404274, -0.06859587877988815, -0.0011675107...
Is there an effective way of returning part of an array's memory to the system? i am using C# to iterate through a one large string arrays and a hashtable with (>100k elements) and I am setting the individual elements to null after i am finished with them. i've experimented with calling the garbage collector at various...
[ 0.16636811196804047, 0.09595584869384766, 0.024233564734458923, -0.15528146922588348, -0.10748665779829025, 0.16558000445365906, 0.430370956659317, -0.2867095172405243, -0.12943989038467407, -0.46522271633148193, 0.21948201954364777, 0.22079899907112122, -0.24574650824069977, 0.19626632332...
n parts and call the gc after each part is finished but that seems messy ``` GC.Collect(1); GC.Collect(2); .... GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); ``` Just let the garbage collector do its thing. The most efficient approach is exactly what the GC already does: defer collections until they actu...
[ 0.21003109216690063, -0.1353691667318344, 0.5528407096862793, 0.03442513570189476, -0.11656409502029419, -0.2906910181045532, 0.014881283976137638, -0.12256272882223129, -0.46341654658317566, -0.3418593406677246, -0.22795316576957703, 0.5590978264808655, -0.4842170774936676, 0.041664756834...
but as long as you do that, you shouldn't really need to do anything else.
[ 0.8130830526351929, 0.1247590184211731, -0.3803878724575043, -0.0916476622223854, -0.008626836352050304, -0.20341230928897858, 0.35219261050224304, 0.37310194969177246, -0.48157408833503723, -0.06711594015359879, 0.3739720284938812, 0.28136494755744934, 0.08060173690319061, -0.125540345907...
I'm working on a method of authentication, and i have 2 text fields named 'username' and 'pass' I want to make it so that when the user enters their username and password, that info gets stored into a text file. So when they log back in, it reads the username and password from that text file to log in. How can I do thi...
[ 0.2944110333919525, 0.0840030387043953, 0.22653377056121826, 0.006848763674497604, 0.004173525143414736, -0.10904181003570557, 0.25899645686149597, 0.02121094986796379, -0.053480364382267, -0.9890437722206116, 0.2033587545156479, 0.26738059520721436, -0.10452259331941605, 0.162173777818679...
shared object with the id userInfo and create a new one if it doesn't exist ``` Once you have a handle on your sharedObject ``` sharedObject.data.userName = "Some username"; sharedObject.data.password= "Some password"; //it's really not a good idea to save a password like this sharedObject.flush(); //saves everythin...
[ 0.08937950432300568, 0.002124521415680647, 0.05413004010915756, 0.08442649245262146, 0.07210808247327805, -0.19653575122356415, 0.2426643818616867, 0.03439652919769287, -0.13725869357585907, -1.0214555263519287, 0.13863596320152283, 0.3655526340007782, -0.34981992840766907, 0.2447046041488...
session id of some kind in this object. in pseudo code: ``` function validateLogin(){ var sessionID = server->checkLogin(username, password); //returns a string if authed, nothing if not if(sessionID){ sharedObject->sessionID = sessionID; } else { //bad login } } ``` More reading: ...
[ -0.03227480873465538, 0.0878680869936943, 0.27453163266181946, -0.2625812888145447, -0.26035210490226746, -0.10129927098751068, 0.3917750120162964, -0.47531747817993164, -0.24389295279979706, -0.48363685607910156, -0.30419519543647766, 0.4110407829284668, -0.3344203531742096, -0.0400830693...
I have installed ruby193 and I've installed rails via the command prompt. However, whenever I try the command: ``` ruby script/server ``` I get this error: ``` ruby: No such file or directory -- script/server (LoadError) ``` I checked my script folder and all it has is a file called rails. I'm very new to Ruby o...
[ 0.3175831139087677, 0.41132012009620667, 0.13112057745456696, -0.22722071409225464, -0.2329138070344925, -0.17993605136871338, 0.7283068895339966, 0.06713029742240906, -0.0960264727473259, -0.7116237282752991, 0.022726137191057205, 0.8093992471694946, -0.36053842306137085, 0.17713014781475...
run a rails server try running `rails server` or `rails s`
[ 0.08478836715221405, -0.17480991780757904, -0.426434189081192, 0.18673773109912872, -0.19634152948856354, -0.10699488967657089, 0.4823686480522156, 0.3017023801803589, -0.06674164533615112, -0.7015701532363892, -0.14944519102573395, 0.34903958439826965, -0.3675457537174225, -0.088691741228...
Let's say I have two or more lists of same length. What's a good way to iterate through them? `a`, `b` are the lists. ``` for i, ele in enumerate(a): print ele, b[i] ``` or ``` for i in range(len(a)): print a[i], b[i] ``` or is there any variant I am missing? Is there any particular advantages of using ...
[ 0.1490057110786438, -0.10536813735961914, 0.0815274640917778, -0.2568069100379944, -0.31454381346702576, 0.31179341673851013, 0.0467023104429245, -0.30894196033477783, -0.30769026279449463, -0.383750319480896, -0.2756744921207428, 0.5905783176422119, -0.31056448817253113, -0.02303289435803...
2 only) and [`itertools.izip_longest()`](http://docs.python.org//library/itertools.html#itertools.izip_longest) (`itertools.zip_longest()` in Python 3).
[ -0.13273976743221283, -0.36569690704345703, 0.3221587538719177, -0.06084869056940079, -0.06602653861045837, -0.1571332812309265, 0.11556492745876312, 0.06121072545647621, -0.5012825727462769, -0.16872072219848633, -0.5833348631858826, 0.24080941081047058, -0.3041279911994934, -0.1488285362...
Given the code : ``` for (int i = 0; i < n; ++i) { A(i) ; B(i) ; C(i) ; } ``` And the optimization version : ``` for (int i = 0; i < (n - 2); i+=3) { A(i) A(i+1) A(i+2) B(i) B(i+1) B(i+2) C(i) C(i+1) C(i+2) } ``` Something is not clear to me : which is better ? I can't see...
[ -0.2757985591888428, 0.08396299928426743, 0.17254890501499176, -0.1451513171195984, 0.17851990461349487, 0.1158103346824646, 0.22700990736484528, -0.3556326627731323, -0.06620412319898605, -0.4912451207637787, -0.3205171525478363, 0.7277402281761169, -0.4000241756439209, -0.016680017113685...
I see is that each instruction is depending on the previous instruction , meaning that I need to wait that the previous instruction would finish in order to start the one after ... Thanks In the high-level view of a language, you're not going to see the optimization. The speed enhancement comes from what the compiler...
[ 0.4171392023563385, -0.01583757996559143, -0.010632841847836971, 0.22194534540176392, 0.025452416390180588, -0.06372173875570297, 0.3732398450374603, -0.2717346251010895, -0.33898261189460754, -0.5028613805770874, 0.011944782920181751, 0.5140184164047241, -0.11734437197446823, -0.227658987...
per 3. In the first it's 1 instruction per 1; so it happens a lot more often. Therefore, if you have invariants you can rely on (an array of mod 3, to use your example) then it is more efficient to unwind loops because the underlying assembly is written more directly.
[ 0.30640870332717896, -0.28805944323539734, -0.19135168194770813, -0.09303992986679077, -0.3820463716983795, -0.11029203236103058, 0.6249057650566101, -0.716210663318634, -0.3804597854614258, -0.2617271840572357, -0.15885958075523376, 0.2743459939956665, -0.7543843388557434, -0.203851193189...
Consider the two following prototypes: ``` template<class T> void whatever1(const T& something); template<class T> void whatever2(T const& something); ``` They are both identical. Yet what if `T` is not a usual type, but a pointer type? For instance, let `T` be `Somewhere*` then `whatever1` and `whatever2` would ha...
[ 0.3791944682598114, 0.06005740165710449, 0.23109939694404602, -0.30974018573760986, -0.021233433857560158, 0.11004304140806198, 0.04626566544175148, -0.13169792294502258, -0.21793140470981598, -0.7248380780220032, -0.05619819089770317, 0.5882132053375244, -0.29736438393592834, 0.3474172353...
safe outside; b) object pointed by `something` can be modified. Usually `const` and `&` are used together to avoid copying when passing a parameter and to protect this parameter from modification at the same time. Then in terms of this philosophy only `whatever2` fulfills its role. However, if I want the object point...
[ 0.5521745085716248, 0.015713894739747047, 0.1872199922800064, -0.11305359750986099, 0.03983564302325249, -0.44359827041625977, 0.6944863796234131, -0.20902463793754578, -0.1668355017900467, -0.3693326413631439, -0.06403165310621262, 0.5955246090888977, -0.4208844006061554, 0.03728957474231...
as a rule of thumb? Note that if we start considering `Somewhere**` as `T` things get even more confusing. Your assumption is wrong. When `T = U *`, then `T const &` and `const T &` are both `U * const &`, and that's it. Similarly, `const T` and `T const` are both `U * const`, and when `T = const W`, then `T *` is `W ...
[ 0.10627470910549164, -0.020834121853113174, 0.3013274669647217, -0.176019087433815, 0.1289874017238617, -0.3738138973712921, 0.1592203974723816, 0.016164401546120644, -0.13846686482429504, -0.5287630558013916, -0.4425481855869293, 0.6067053079605103, -0.2865099012851715, 0.3380281031131744...
I am building a survey site in Yesod (0.10) and am getting lost in the types. Here is a simplified version on what I am trying to do. ``` invitation url = do render <- getUrlRender return $ renderHtml [hamlet| <p>Dear foo, please take our <a href=@{ShowSurveyR url}>survey. |] render ``` Another function is...
[ 0.33012300729751587, 0.17126606404781342, 0.7120423316955566, -0.4248145818710327, -0.09875079244375229, 0.11036878824234009, 0.562109649181366, -0.13798977434635162, 0.04167384281754494, -0.863592267036438, 0.1172659695148468, 0.36794695258140564, -0.3195289075374603, 0.10110075026750565,...
one ``` This is confusing, because the templates tutorial seems to do things this way. But if I modify the code, like this... ``` invitation url = do return $ renderHtml [hamlet| <p>Dear foo, please take our <a href=@{ShowSurveyR url}>survey. |] ``` I get this type error. ``` Handler/Root.hs:403:24: The...
[ 0.2634601891040802, 0.14168037474155426, 0.427001953125, -0.16471463441848755, -0.15783794224262238, -0.11512070149183273, 0.35343214869499207, -0.0608975775539875, 0.0713944062590599, -0.7100234627723694, 0.007346532307565212, 0.4925483167171478, -0.4689271152019501, 0.04972991347312927, ...
am I supposed to pass the routing function into my hamlet code? The quasiquote (`[hamlet|...|]`) returns a function whose argument is *also* a function. You must first apply that quasiquote value, and pass the results to renderHtml: [Edit: as @MattoxBeckman discovered, another issue is the need to use getUrlRenderPara...
[ 0.15351171791553497, 0.1086001843214035, 0.8843057155609131, -0.23380440473556519, 0.1560191661119461, -0.022469064220786095, 0.3812457025051117, -0.5477309226989746, 0.32350844144821167, -0.4455540180206299, -0.05014735832810402, 0.3478584587574005, -0.3093564808368683, -0.076109647750854...
you saw notes that you tried to pass two arguments to renderHtml, while the second error message notes that you didn't pass any arguments to the quasiquote value.
[ 0.04095330461859703, -0.21487045288085938, 0.18549968302249908, 0.2121947705745697, -0.06716190278530121, -0.10313347727060318, 0.4319087862968445, 0.22072917222976685, -0.030636334791779518, -0.30626675486564636, -0.0011358362389728427, 0.306353896856308, -0.1282527893781662, 0.0980001166...
I have an Xcode Universal Storyboard project that is properly displaying data for the iPhone but does not display data for the iPad. I had initialized the data array using the code below. It is working properly in the iPhone but does not display data in the iPad and gets the error: > -[DetailViewController setDataCo...
[ 0.1259804666042328, 0.14549408853054047, 0.7204657793045044, -0.044267572462558746, 0.09413359314203262, 0.11973976343870163, 0.5803681015968323, -0.3409479558467865, -0.10580107569694519, -0.9269850254058838, -0.1745421290397644, 0.5801966786384583, -0.21325618028640747, -0.00626378366723...
DataController *controller = [[DataController alloc] init]; masterViewController.dataController = controller; splitViewController.delegate = (id)navigationController.topViewController; } else { // Create the data controller and pass it to the master view controller. UINavigationController *navigati...
[ -0.3614596128463745, -0.15381349623203278, 0.7148414254188538, 0.38309597969055176, 0.09934371709823608, -0.009492065757513046, 0.3258165717124939, -0.34097597002983093, -0.16729295253753662, -0.765170156955719, -0.7414157390594482, 0.42310789227485657, -0.3745260238647461, 0.4261542260646...
about the DetailViewController here is that file.** ``` #import "DetailViewController.h" #import "Play.h" @interface DetailViewController () @property (strong, nonatomic) UIPopoverController *masterPopoverController; @end @implementation DetailViewController @synthesize masterPopoverController = _masterPopoverCont...
[ 0.21829012036323547, -0.1811004877090454, 0.889003574848175, 0.07326191663742065, -0.009058383293449879, 0.1940992921590805, 0.21026790142059326, -0.7375531196594238, 0.061826907098293304, -0.5148269534111023, -0.3448907136917114, 0.9105791449546814, 0.08221911638975143, 0.0101022599264979...
popoverController; } - (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UITableViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem { // Called when the view is shown again in the split view, invalidating the button and popover controlle...
[ -0.05012180283665657, -0.0674741268157959, 0.8843913078308105, -0.009757444262504578, -0.3274476230144501, 0.2779381573200226, 0.25830012559890747, -0.38253623247146606, -0.37364763021469116, -0.3068421483039856, -0.35299068689346313, 0.43062126636505127, -0.37987712025642395, 0.2708105742...
rows = 1; break; case 1: // For the media section, there are as many rows as there are media. rows = [play.media count]; break; default: break; } return rows; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ...
[ -0.41377532482147217, -0.31963247060775757, 0.8737269639968872, -0.20894724130630493, 0.05095326900482178, 0.03790492191910744, 0.09978200495243073, -0.3494545519351959, -0.4097720980644226, -0.7298254370689392, -0.14850828051567078, 0.4315595328807831, -0.35993123054504395, 0.163225546479...
[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.autoresizingMask = UIViewAutoresizingFlexibleHeight; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.textLabel.font = [UIFont boldSystemFontOfSize:11]; cell.textLabel.numberOfLines = 13...
[ -0.6107293963432312, -0.2779737114906311, 0.7195976376533508, -0.2120542675256729, 0.12117208540439606, 0.16205042600631714, 0.3693199157714844, -0.6492941379547119, -0.2853643298149109, -0.6962443590164185, -0.48038777709007263, 0.47613444924354553, -0.19243107736110687, 0.284973084926605...
mark Section header titles /* HIG note: In this case, since the content of each section is obvious, there's probably no need to provide a title, but the code is useful for illustration. */ - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { NSString *title = nil; ...
[ 0.3707011044025421, -0.2583918273448944, 0.7707357406616211, 0.06561826914548874, -0.15218424797058105, -0.3519391119480133, 0.16819365322589874, -0.25024881958961487, -0.2720838785171509, -0.2852579951286316, -0.3698292374610901, 0.2684440314769745, 0.14434587955474854, 0.7012665867805481...
break; default: break; } return title; } @end ``` When you do ``` object.property = value; ``` in Objective-C code, that's a short cut for: ``` [object setProperty:value]; ``` Since you don't appear to have a dataController property, there's no setDataController selector. So either: * declare a ...
[ 0.19348816573619843, -0.02773595042526722, 0.2423248291015625, 0.12461031973361969, 0.263145387172699, -0.33773308992385864, 0.38522204756736755, -0.3441009521484375, -0.06682997196912766, -0.35153844952583313, -0.5372525453567505, 0.5852516889572144, -0.30025002360343933, -0.0032630828209...
I'm Hunting the Wumpus, and I've run into an issue. (I'm a high-schooler) I'm in charge of the Trivia Class, and I'm doing something wrong here. In my current code, I'm displaying a form, asking the user for an input, and setting the answerstatus as true/false. I want another class to count the number of answer correct...
[ 0.4684271514415741, 0.02041100710630417, 0.4467645585536957, -0.07082882523536682, -0.0075162919238209724, -0.07922191917896271, 0.29887107014656067, -0.1548871546983719, -0.09242859482765198, -0.5409665703773499, 0.09083819389343262, 0.5489572882652283, -0.407825231552124, 0.2517411112785...
} if(result) { currentPassed++; currentTested++; } else { currentTested++; } } ``` I'm getting the "result" from ``` public bool getQuestionStatus() { return questionStatus; } ``` (on another class) I've tried ``` private void Form1_FormClosing(Object sender, Fo...
[ -0.02374880015850067, -0.1887001395225525, 0.7781628370285034, 0.02451661042869091, 0.3346264958381653, -0.17074480652809143, 0.40654560923576355, -0.24172700941562653, -0.10693985968828201, -0.29599717259407043, -0.22979623079299927, 0.6235053539276123, -0.09352656453847885, 0.36942422389...
window? Programmatically, you should run at init (for instance when the form is loaded) ``` form1.Close += ANewFunction; // registering the handler ``` And write the handler itself: ``` public void ANewFunction(EventsArg e) { ... } ``` But in such a simple case, you should let Visual Studio do the dirty job: ...
[ 0.22285781800746918, -0.031468383967876434, 0.29328423738479614, -0.12287866324186325, -0.11509648710489273, -0.167850062251091, 0.2878865897655487, -0.1424688845872879, 0.05577833577990532, -0.7649000287055969, -0.22479109466075897, 0.5863916873931885, -0.32346704602241516, -0.06042313575...
I have this two entities: ``` public class Course { public int Id { get; set; } public string Name { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } public virtual ICollection<Class> Classes { get; set; } } public class Class { public int Id { get; set...
[ 0.4859182834625244, -0.2352723330259323, 0.4948279857635498, -0.0011199284344911575, 0.37763741612434387, -0.024738473817706108, -0.19609560072422028, 0.1374238282442093, 0.06341154873371124, -0.5810067057609558, -0.015015163458883762, 0.5015912652015686, 0.10232330113649368, 0.40722522139...
] public Course Course { get; set; } } ``` Now I need to list each Class grouping by Course and ordered by (descending) Course.StartDate then by Class.StartTime. I can get to group by Course and order by Course.StartDate: ``` var myList = context.Classes .GroupBy(c => c.Course) .OrderByDescending(g => g...
[ -0.08994954079389572, 0.10859020054340363, 0.36819377541542053, -0.2690503001213074, 0.2511117160320282, 0.11545577645301819, 0.010091534815728664, -0.3719964623451233, -0.26555880904197693, -0.6201716661453247, -0.21618077158927917, 0.4295453429222107, -0.26394563913345337, 0.286712199449...
.OrderByDescending(g => g.Key.StartDate) .ThenBy(g => g.Select(c => c.StartTime)).ToList() ``` But the Classes are never ordered by it's StartTime. \*Edit for better clarification: This is for a WebService and I must return a `List<IGrouping<Course, Class>>` and I really want an elegant way of doing this (i.e. u...
[ 0.09808876365423203, -0.06989021599292755, 0.5321869850158691, -0.23998987674713135, 0.06458563357591629, -0.2706352472305298, 0.06715957075357437, -0.3215044140815735, -0.36283445358276367, -0.7493892312049866, -0.21212852001190186, 0.3601485788822174, -0.3198656141757965, 0.1136075258255...
.GroupBy(cc => cc.Course) .OrderByDescending(gg => gg.Key.StartDate) .ToArray() // <- stops EF and starts L2O .SelectMany(gg => gg.OrderBy(cc => cc.StartTime)) .ToLookup(cc => cc.Course, cc
[ -0.20801474153995514, -0.20016755163669586, 0.39776355028152466, -0.14702968299388885, 0.21517758071422577, 0.06593328714370728, 0.11413311958312988, -0.269662082195282, -0.21153061091899872, -0.5472704172134399, -0.5746274590492249, 0.27783340215682983, -0.37224090099334717, 0.14089414477...
=> cc) .ToList(); ``` This results in a type of signature: `List<IGrouping<Course, Class>>` and has them properly ordered by `StartTime`. This relies on the behavior of `ToLookup` with respect to maintaining the order found and may be subject to change.
[ 0.3352493345737457, -0.032821640372276306, 0.3045840859413147, -0.08683730661869049, 0.2651808559894562, -0.46204590797424316, 0.01692929118871689, -0.20153038203716278, -0.509232759475708, -0.545286238193512, -0.4269695580005646, 0.24949446320533752, -0.1431003361940384, 0.261282563209533...
There seems to be just a little documentation on the grouped\_select feature in simple\_form 2.0 at <http://simple-form.plataformatec.com.br/#usage/collections>. The documentation offers the line: ``` f.input :country_id, :collection => @continents, :as => :grouped_select, :group_method => :countries ``` But that do...
[ 0.12551139295101166, 0.0944383442401886, 0.553659200668335, 0.14178107678890228, -0.09912962466478348, -0.027484290301799774, -0.17846117913722992, -0.1684114933013916, -0.4677885174751282, -0.3866764307022095, 0.1914672702550888, 0.1862853467464447, -0.4254063665866852, 0.2570050954818725...
the ad.title to serve as the optgroup. Then I'd like to have the Ads insertions to serve as the selectable content... so something like: ``` <select> <optgroup label="Ad.Title"> <option value="Ad.Insertion.id">Ad.Insertion.Title</option> <option value="Ad.Insertion.id">Ad.Insertion.Title</option> <option...
[ 0.03177493065595627, -0.03959000110626221, 0.526289165019989, -0.022187016904354095, 0.08032426238059998, -0.010686415247619152, -0.24553954601287842, -0.3519609272480011, 0.06918657571077347, -0.7206400632858276, -0.46604254841804504, 0.8800492286682129, -0.4400720000267029, -0.1996714770...
app if you have insight on how to execute this property. Thanks in advance! UPDATE: I've been able to get something partially working using: ``` = f.input(:insertion_id, :collection => Ad.order(:name), :as => :grouped_select, :group_method => :insertions) ``` The problem with this is that there is no way to specif...
[ 0.11364554613828659, 0.19528664648532867, 0.43660932779312134, -0.10184209793806076, -0.09143983572721481, 0.25891736149787903, 0.17700529098510742, -0.058209486305713654, -0.4852248728275299, -0.8682906627655029, -0.28942012786865234, 0.6786682605743408, -0.7283022403717041, -0.4721996784...
:insertions, :name, :id, :title, include_blank: "Please Choose...") ``` This can be redone in using simple\_form 2.0 with the following syntax: ``` = f.input(:insertion_id, :collection => Ad.order(:name), :as => :grouped_select,
[ -0.2707533538341522, -0.04687068238854408, 0.20463916659355164, -0.20656970143318176, 0.30468904972076416, 0.4039946496486664, -0.005582062993198633, -0.3901080787181854, -0.1575784683227539, -0.4827342927455902, -0.5732243061065674, 0.5139120221138, -0.4564293324947357, -0.200505107641220...
:group_method => :insertions, :group_label_method => :name, :label_method => :title,
[ -0.29184624552726746, 0.2607714533805847, -0.035307615995407104, 0.06442587077617645, 0.17568093538284302, 0.13685742020606995, -0.06875370442867279, -0.4268207848072052, -0.12355173379182816, -0.3152619004249573, -0.30981191992759705, 0.09312112629413605, -0.44357457756996155, 0.066646516...
:include_blank => "Please Choose...") ``` I hope that helps other people in the future.
[ 0.4222480058670044, 0.1625504344701767, -0.009883797727525234, -0.17009569704532623, 0.40098127722740173, -0.08200861513614655, 0.3203258812427521, 0.18082304298877716, -0.0014650595840066671, -0.7336718440055847, -0.12854479253292084, 0.677026093006134, -0.3311697244644165, 0.024321179836...
I'm trying to implement the code from this tutorial: This is the managed bean: ``` import java.io.Serializable; import javax.enterprise.context.SessionScoped; // or import javax.faces.bean.SessionScoped; import javax.inject.Named; /* include SQL Packages */ import java.sql.Connection; import java.sql.PreparedStatemen...
[ 0.06681226938962936, 0.28814712166786194, 0.2613588273525238, -0.03574405238032341, -0.4630337655544281, 0.25442495942115784, 0.39750784635543823, -0.3057954013347626, -0.5938340425491333, -0.5748290419578552, -0.17051784694194794, 0.5260855555534363, -0.4375668168067932, 0.147732585668563...
private int firstRow; private int rowsPerPage; private int totalPages; private int pageRange; private Integer[] pages; private int currentPage; // Sorting. private String sortField; private boolean sortAscending; /* Constructor */ public Sessions() { /* Set default prope...
[ -0.22343991696834564, -0.14960238337516785, 0.6423333883285522, -0.23820504546165466, -0.1327582597732544, 0.3034895062446594, 0.3006114363670349, -0.17970600724220276, -0.4137457311153412, -0.6871033310890198, -0.5489172339439392, 0.42201530933380127, -0.33116614818573, 0.1954650431871414...
pageRange = 10; // Default page range (max amount of page links to be displayed at once). sortField = "ASESSIONID"; // Default sort field. sortAscending = true; // Default sort direction. } private static class ActiveSessionObj { /* Oracle table structure CREATE TABLE ACTIVESES...
[ -0.3168264329433441, -0.11555132269859314, 0.48235827684402466, -0.16154004633426666, 0.12863577902317047, 0.14258545637130737, 0.33284932374954224, -0.35094544291496277, -0.25327906012535095, -0.4386627972126007, -0.36724740266799927, 0.4679643213748932, -0.5241785645484924, -0.1153010874...
USERID VARCHAR2(30 ), ACTIVITYSTART TIMESTAMP(6), ACTIVITYEND TIMESTAMP(6), ACTIVITY CLOB ) */ private String aSessionID; private String userID; private Date activityStart; private Date activityEnd; private String
[ -0.07335155457258224, -0.45218855142593384, 0.5671684145927429, -0.30355513095855713, 0.18663738667964935, 0.034947529435157776, 0.2729000151157379, -0.09341314435005188, -0.042800698429346085, -0.33607691526412964, -0.4151228964328766, 0.7668148279190063, -0.38658612966537476, -0.00504925...
activity; public ActiveSessionObj(String aSessionID, String userID, Date activityStart, Date activityEnd, String activity) { this.aSessionID = aSessionID; this.userID = userID; this.activityStart = activityStart; this.activityEnd = activityEnd; this.a...
[ -0.08207155019044876, -0.3836960792541504, 0.22749197483062744, -0.26039040088653564, 0.2595299780368805, -0.16923296451568604, 0.41213759779930115, 0.08205437660217285, -0.3444484770298004, -0.35181349515914917, -0.5073213577270508, 0.5823501944541931, -0.5587798357009888, -0.134251534938...
public String getaSessionID() { return aSessionID; } public void setaSessionID(String aSessionID) { this.aSessionID = aSessionID; } public String getactivity() { return activity; }
[ 0.5483453273773193, -0.6621084213256836, 0.0911283940076828, -0.07855784893035889, 0.24800194799900055, -0.3127431571483612, 0.4855722188949585, -0.36672475934028625, -0.2438448965549469, -0.37619301676750183, -0.4308355450630188, 0.6691372990608215, -0.6724901795387268, -0.316305100917816...
public void setactivity(String activity) { this.activity = activity; } public Date getactivityEnd() { return activityEnd; } public void setactivityEnd(Date activityEnd) { this.activityEnd = activityEnd; }
[ 0.7266103625297546, -0.40474188327789307, 0.294892817735672, -0.28734278678894043, 0.20522312819957733, -0.47267913818359375, 0.2456943243741989, -0.21284566819667816, -0.1407032608985901, -0.18415716290473938, -0.3655395805835724, 0.5320819616317749, -0.46269556879997253, -0.1034899502992...
public Date getactivityStart() { return activityStart; } public void setactivityStart(Date activityStart) { this.activityStart = activityStart; } public String getuserID() { return userID; }
[ 0.41628098487854004, -0.5601871609687805, 0.5378202795982361, -0.23610928654670715, 0.27390897274017334, -0.3097822666168213, 0.3064948320388794, -0.03134515509009361, -0.10040473937988281, -0.19285713136196136, -0.3700788915157318, 0.7279036641120911, -0.41518327593803406, -0.002336259000...
public void setuserID(String userID) { this.userID = userID; } private ActiveSessionObj() { throw new UnsupportedOperationException("Not yet implemented"); } } // Paging actions ----------------------------------------------------------------------------- pu...
[ -0.10700559616088867, -0.2979781925678253, 0.48578524589538574, -0.19010013341903687, -0.007400975562632084, 0.06698233634233475, 0.4152664542198181, -0.2911481559276581, 0.010218045674264431, -0.7268140316009521, -0.4438498914241791, 0.5005730390548706, -0.5517453551292419, -0.03198582679...
page(firstRow + rowsPerPage); } public void pagePrevious() { page(firstRow - rowsPerPage); } public void pageLast() { page(totalRows - ((totalRows % rowsPerPage != 0) ? totalRows % rowsPerPage : rowsPerPage)); } public void page(ActionEvent event) { page(((Integer) ((U...
[ -0.24185562133789062, -0.4300007224082947, 0.8759111762046814, -0.23784442245960236, -0.14394518733024597, 0.34577032923698425, 0.19224481284618378, -0.4124218821525574, -0.17025744915008545, -0.8308034539222717, -0.5390526652336121, 0.5202413201332092, -0.1501331776380539, 0.1453437656164...
this.firstRow = firstRow; loadDataList(); // Load requested page. } // Sorting actions ---------------------------------------------------------------------------- public void sort(ActionEvent event) { String sortFieldAttribute = (String) event.getComponent().getAttributes().get("sortField"...
[ -0.4157335162162781, -0.6598605513572693, 0.5266032814979553, -0.339154988527298, 0.179795041680336, 0.050047822296619415, 0.029273858293890953, -0.3606584966182709, -0.3290412127971649, -0.5984640717506409, -0.3946142792701721, 0.5361908078193665, -0.3822614252567291, -0.19807849824428558...
} else { sortField = sortFieldAttribute; sortAscending = true; } pageFirst(); // Go to first page and load requested page. } // Loaders ------------------------------------------------------------------------------------ private void loadDataList() { // Loa...
[ -0.3197456896305084, -0.4059005379676819, 0.467808336019516, -0.24372915923595428, 0.12653018534183502, 0.1911647915840149, 0.39004838466644287, -0.25080400705337524, -0.16010716557502747, -0.640962541103363, -0.29690518975257874, 0.5981212854385376, -0.32165345549583435, -0.04109647497534...
dataList = list(firstRow, rowsPerPage, sortField, sortAscending); totalRows = countDBRowNum(); //count the tablerows } catch (Exception e) { throw new RuntimeException(e); } // Set currentPage, totalPages and pages. currentPage = (totalRows / rowsPerPage) - ((to...
[ -0.1985328197479248, -0.42084816098213196, 0.6142362952232361, -0.09329786896705627, 0.05126041918992996, 0.05808868631720543, 0.20002417266368866, -0.46874237060546875, -0.38446226716041565, -0.46762576699256897, -0.32881492376327515, 0.34936434030532837, -0.23324839770793915, 0.102677844...
+ 1; totalPages = (totalRows / rowsPerPage) + ((totalRows % rowsPerPage != 0) ? 1 : 0); int pagesLength = Math.min(pageRange, totalPages); pages = new Integer[pagesLength]; // firstPage must be greater than 0 and lesser than totalPages-pageLength. int firstPage = Math.min(Math.m...
[ -0.527876615524292, -0.17599831521511078, 0.8624140620231628, -0.04198289290070534, -0.3861069083213806, 0.2974964678287506, 0.2778569161891937, -0.41180655360221863, -0.2893489599227905, -0.6794842481613159, -0.374780535697937, 0.1891823559999466, -0.15229693055152893, 0.14110612869262695...
for (int i = 0; i < pagesLength; i++) { pages[i] = ++firstPage; } } // Getters ------------------------------------------------------------------------------------ public List<ActiveSessionObj> getdataList() { if (dataList == null) { loadDataList(); // Preload page f...
[ -0.5028693079948425, -0.42416948080062866, 0.7884519696235657, -0.10902000218629837, -0.17472200095653534, 0.2653558552265167, 0.3439862132072449, -0.3432239890098572, -0.32025080919265747, -0.8239843845367432, -0.5104008913040161, 0.5390142798423767, -0.5933149456977844, -0.28353092074394...
return dataList; } public int getTotalRows() { return totalRows; } public int getFirstRow() { return firstRow; } public int getRowsPerPage() { return rowsPerPage; } public Integer[] getPages() { return pages; } public int getCurrentPage() {
[ -0.0604255348443985, -0.2816506624221802, 0.8957601189613342, -0.08380374312400818, -0.27026864886283875, 0.2255067080259323, 0.1268114596605301, -0.07977405190467834, -0.3485754430294037, -0.7218388915061951, -0.5102313160896301, 0.3852987289428711, -0.15646538138389587, 0.267455041408538...
return currentPage; } public int getTotalPages() { return totalPages; } // Setters ------------------------------------------------------------------------------------ public void setRowsPerPage(int rowsPerPage) { this.rowsPerPage = rowsPerPage; } // Actions --------------...
[ -0.48570480942726135, -0.6254882216453552, 0.9425694942474365, 0.055451828986406326, -0.006399151869118214, 0.19099803268909454, 0.17465488612651825, -0.052924685180187225, -0.31293871998786926, -0.5016413927078247, -0.4067370593547821, 0.6541720032691956, -0.3555409014225006, 0.0080430479...
* @param firstRow First index of rows to be returned. * @param rowCount Amount of rows to be returned. * @param sortField Field to sort the data on. * @param sortAscending Whether to sort data ascending or not. * @return list of ActiveSessionObj items starting at the given first index with the given...
[ -0.1841098964214325, -0.05102255567908287, 0.3191167414188385, -0.04326191917061806, -0.5148767828941345, 0.41566550731658936, 0.35407206416130066, -0.6890065670013428, -0.426942378282547, -0.4128793179988861, -0.3462710678577423, 0.23151475191116333, -0.17557264864444733, -0.1361421793699...
DAO level. */ public List<ActiveSessionObj> list(int firstRow, int rowCount, String sortField, boolean sortAscending) throws SQLException { String SqlStatement = null; if (ds == null) { throw new SQLException(); } Connection conn = ds.getConnection(); if (...
[ -0.40121421217918396, -0.41049453616142273, 0.5667396187782288, 0.08238854259252548, 0.12880268692970276, -0.20765900611877441, 0.3323318660259247, -0.2759245038032532, 0.014675223268568516, -0.6307232975959778, -0.21114581823349, 0.41653984785079956, -0.34776970744132996, 0.01075931359082...
throw new SQLException(); } String sortDirection = sortAscending ? "ASC" : "DESC"; SqlStatement = "SELECT * FROM ACTIVESESSIONSLOG WHERE ROWNUM >= ? AND ROWNUM <= ? ORDER BY %s %s"; String sql = String.format(SqlStatement, sortField, sortDirection); PreparedStatement ps = nul...
[ -0.11853504925966263, -0.1769651621580124, 0.20314505696296692, -0.39769884943962097, -0.2449691742658615, 0.20832951366901398, 0.5390557646751404, -0.5727096796035767, -0.08591647446155548, -0.3017466366291046, -0.37513482570648193, 0.3577229082584381, -0.22546111047267914, 0.135093182325...
try { conn.setAutoCommit(false); boolean committed = false; try { ps = conn.prepareStatement(sql); ps.setInt(1, firstRow); ps.setInt(2,
[ 0.3952803909778595, -0.34897419810295105, 0.1784890592098236, -0.06286998093128204, 0.26882404088974, 0.0653117373585701, 0.4411223530769348, -0.4701249599456787, 0.12778553366661072, -0.4006299078464508, -0.32413387298583984, 0.5263588428497314, -0.35345372557640076, -0.10944248735904694,...
rowCount); resultSet = ps.executeQuery(); /* take the result from the SQL query and insert it into Array List collection */ dataList = ActiveSessionsArrayList(resultSet); conn.commit(); committed
[ -0.06838718056678772, -0.2776638865470886, 0.6328160762786865, -0.16846324503421783, 0.1336299180984497, 0.1848139464855194, 0.23038159310817719, -0.595503568649292, -0.3207246661186218, -0.3300643861293793, -0.18863561749458313, 0.36217576265335083, -0.3987990617752075, -0.008278258144855...
= true; } finally { if (!committed) { conn.rollback(); } } } finally {
[ -0.016732949763536453, -0.323434054851532, 0.5077365636825562, -0.1378869265317917, 0.18576061725616455, -0.015204896219074726, 0.003533611074090004, -0.0317457877099514, -0.13133320212364197, -0.1336250752210617, -0.29726535081863403, 0.7837780117988586, 0.06530497223138809, 0.15846632421...
ps.close(); conn.close(); } return dataList; } /** * Returns total amount of rows in table. * @return Total amount of rows in table. * @throws DAOException If something fails at DAO level. */ public int countDBRowNum() throws Exception { String
[ -0.13144028186798096, -0.19249983131885529, 0.4834277629852295, -0.17388883233070374, 0.09658025950193405, -0.01641748659312725, 0.13896606862545013, -0.415432870388031, -0.33593979477882385, -0.4590701162815094, -0.3109586834907532, 0.22044752538204193, -0.35605961084365845, 0.00852133519...
SqlStatement = null; if (ds == null) { throw new SQLException(); } Connection conn = ds.getConnection(); if (conn == null) { throw new SQLException(); } SqlStatement = "SELECT count(*) FROM ACTIVESESSIONSLOG";
[ -0.1384168118238449, -0.41217708587646484, 0.6615411043167114, -0.1394982933998108, -0.1298905462026596, -0.19382724165916443, 0.5013994574546814, -0.4495795965194702, -0.10699490457773209, -0.3319045603275299, -0.18960388004779816, 0.48383790254592896, -0.48192986845970154, 0.277581721544...
PreparedStatement ps = null; ResultSet resultSet = null; int count = 0; try { conn.setAutoCommit(false); boolean committed = false; try { SqlStatement = "SELECT count(*) FROM ACTIVESESSIONSLOG";
[ 0.16076542437076569, -0.252707839012146, 0.31373870372772217, -0.24893584847450256, 0.05125737562775612, 0.1412648856639862, 0.6443564295768738, -0.8206979036331177, 0.2296392023563385, -0.2427516132593155, -0.11806274205446243, 0.4220515489578247, -0.3617461323738098, 0.000763011630624532...
ps = conn.prepareStatement(SqlStatement); resultSet = ps.executeQuery(); if (resultSet.next()) { count = resultSet.getInt(1); }
[ 0.06552425771951675, -0.5028278231620789, 0.6609921455383301, -0.14131923019886017, 0.09241179376840591, 0.11131604760885239, 0.3868318498134613, -0.6283985376358032, -0.1733340322971344, -0.5105392932891846, -0.18408073484897614, 0.17950955033302307, -0.3049622178077698, -0.07723323255777...
conn.commit(); committed = true; } finally { if (!committed) { conn.rollback(); }
[ -0.16636088490486145, -0.37329167127609253, 0.34235280752182007, -0.2459377944469452, 0.3884545564651489, 0.056215740740299225, -0.04842536896467209, 0.03901294246315956, -0.28055626153945923, -0.2638740837574005, -0.2981966733932495, 1.009226679801941, -0.09300518780946732, 0.147325009107...
} } finally { ps.close(); conn.close(); } return count; } /** * Map the current row of the given ResultSet to ActiveSessionObj. * @param resultSet The ResultSet of which the current row is to be mapped to ActiveSessionObj.
[ -0.2939724624156952, -0.1230272650718689, 0.754031777381897, -0.2512930929660797, 0.19347527623176575, 0.2976357936859131, 0.25058647990226746, -0.32163089513778687, -0.3064296841621399, -0.6216083765029907, -0.40503838658332825, 0.2529442012310028, -0.3385515809059143, -0.0818832293152809...
* @return The mapped ActiveSessionObj from the current row of the given ResultSet. * @throws SQLException If something fails at database level. */ private static ArrayList<ActiveSessionObj> ActiveSessionsArrayList(ResultSet rs) throws SQLException { ArrayList<ActiveSessionObj> al = null; ...
[ -0.204305499792099, -0.13629816472530365, 0.6005768775939941, -0.21164879202842712, 0.11605685949325562, 0.10295294225215912, 0.40496575832366943, -0.4490010738372803, -0.2713495194911957, -0.5936154127120972, -0.17539137601852417, 0.5032620429992676, -0.43853238224983215, -0.1000760272145...
rs.getString("ASESSIONID"), rs.getString("USERID"), timestampToDate(rs.getTimestamp("ACTIVITYSTART")), timestampToDate(rs.getTimestamp("ACTIVITYEND")),
[ 0.09697159379720688, -0.257133811712265, 0.6972141265869141, 0.08796873688697815, 0.22085662186145782, -0.2569464445114136, 0.34754568338394165, -0.12751176953315735, -0.11829323321580887, -0.5593772530555725, -0.5263717770576477, 0.1190112754702568, -0.43053796887397766, -0.15646040439605...