text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I followed these instructions from GitHub web page to create a first repo; ``` Global setup: Set up git git config --global user.name "Your Name" git config --global user.email my_mail@gmail.com Next steps: mkdir OpenSourceContrib cd OpenSourceContrib git init touch README git add README git comm...
[ -0.09522704035043716, -0.24912716448307037, 0.9234656095504761, -0.14050009846687317, -0.040772370994091034, 0.06973595917224884, 0.09652011841535568, -0.33161646127700806, -0.41279134154319763, -0.7054678797721863, -0.3531080484390259, 0.8623177409172058, -0.3354336619377136, 0.0939609408...
add origin ...' (notably, I first tried with the path where README file is located, beginning c:/Users/...). Now, when I write this precise bash command ``` git remote add origin git@github.com:dlib/OpenSourceContrib.git ``` I get ``` fatal: remote origin already exists ``` and when I write the next command...
[ 0.15533655881881714, 0.06498869508504868, 0.3196466863155365, 0.006282840855419636, 0.013563087210059166, -0.03728661313652992, 0.002290802076458931, -0.09184305369853973, -0.06241749972105026, -0.873094379901886, 0.002571854507550597, 0.7235804200172424, -0.08840835094451904, 0.3073335587...
quick reference to bash? Regards. Your question, command sequences and subsequent comments are not adding up. You apparently already have a repository in 'Hello-World' - suggesting you followed the GitHub instructions. But now, when creating OpenSourceContrib, you appear to be in the 'Hello-World' source tree (with .g...
[ 0.3029240667819977, 0.18027172982692719, -0.024067740887403488, 0.03687547147274017, -0.19131827354431152, -0.3551051616668701, 0.3263600468635559, 0.07822652161121368, -0.32321688532829285, -0.7858222723007202, -0.09255950897932053, 0.5271163582801819, -0.05755037069320679, 0.130919367074...
**What I have:** * there are two languages installed: German and English * language-versions are managed with subfolders (www.domain.com/de/ and www.domain.com/en/) * machine: Typo3 4.5.4 / RealUrl installed * mod\_rewrite is enabled an works **What I want to do:** * redirect requests without language subfolder to t...
[ 0.10943511873483658, 0.44043993949890137, 0.6487563848495483, -0.11075714975595474, 0.2590463161468506, -0.12135571241378784, 0.93752121925354, -0.09783439338207245, 0.09204892069101334, -0.8480569124221802, -0.3699665069580078, 0.5450435876846313, -0.17295603454113007, -0.0147584285587072...
files, configured through: # - $TYPO3_CONF_VARS['BE']['versionNumberInFilename'] # - $TYPO3_CONF_VARS['FE']['versionNumberInFilename'] # IMPORTANT: This rule has to be the very first RewriteCond in order to work! RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)\.(\d+)\.(php|js|c...
[ -0.07453722506761551, 0.0260964035987854, 0.9072009325027466, -0.23291294276714325, 0.35596394538879395, 0.00476827984675765, 0.6982781887054443, -0.44675761461257935, -0.04250781238079071, -0.6380690336227417, -0.47215673327445984, 0.8053529858589172, -0.25680696964263916, 0.1239107847213...
In my web application registered users can add new content and edit it later. I want only the content's author to be able to edit it. Is there any smart way of doing this other than manually writing code in all the action methods that checks if the logged user is the same as the author? Any attribute that I could use f...
[ 0.31792595982551575, -0.03640394285321236, 0.49017155170440674, 0.11052943021059036, -0.026279332116246223, -0.28972429037094116, 0.2681238651275635, -0.1817542463541031, -0.1821344792842865, -0.9022207856178284, 0.0016511979047209024, 0.4953412115573883, -0.418477326631546, 0.268399268388...
{ var isAuthorized = base.AuthorizeCore(httpContext); if (!isAuthorized) { // the user is either not authenticated or // not in roles => no need to continue any further return false; } //
[ 0.14884953200817108, -0.3615141808986664, 0.47666868567466736, -0.22374165058135986, 0.23558588325977325, 0.21277937293052673, 0.7035880088806152, -0.3652710020542145, 0.17160283029079437, -0.42724281549453735, -0.05044635757803917, 0.5804068446159363, -0.25425776839256287, -0.145494237542...
get the currently logged on user var username = httpContext.User.Identity.Name; // get the id of the article that he is trying to manipulate // from the route data (this assumes that the id is passed as a route // data parameter: /foo/edit/123). If this is not the case and you ...
[ 0.25119638442993164, -0.10757767409086227, 0.7504829168319702, -0.07658086717128754, 0.23264475166797638, -0.2215520590543747, 0.2586745023727417, -0.02291262522339821, -0.19824178516864777, -0.617092490196228, -0.12242288887500763, 0.3179283142089844, -0.38378146290779114, 0.1317287832498...
var id = httpContext.Request.RequestContext.RouteData.Values["id"] as string; // Now that we have the current user and the id of the article he // is trying to manipualte all that's left is go ahead and look in // our database to see if this user is the owner of the article return IsUs...
[ -0.16310912370681763, 0.10430757701396942, 0.6204556822776794, -0.21523037552833557, 0.10827237367630005, -0.002152160042896867, 0.4164154827594757, -0.2643408179283142, -0.11976294964551926, -0.43467098474502563, -0.12142067402601242, 0.667219877243042, -0.3433968424797058, 0.319810569286...
articleId) { throw new NotImplementedException(); } } ``` and then: ``` [HttpPost] [AuthorizeAuthor] public ActionResult Edit(int id) { ... perform the edit } ```
[ -0.0991959348320961, -0.13964365422725677, 0.7048353552818298, -0.26540133357048035, 0.07277203351259232, -0.2903856635093689, 0.2803923785686493, -0.5015627145767212, 0.012281514704227448, -0.5221024751663208, -0.360533744096756, 0.7298312783241272, -0.46980249881744385, -0.00425325240939...
I developed an application that allows the user to save his two favourite parking spots. It uses a service to retrieve the relevant parking information from an sqlite database. Within the database I have this method to find the first entry: ``` public Cursor firstentry(){ String select = "SELECT PREF1, PREF2 ...
[ 0.4379829466342926, 0.06340488791465759, 0.5678067803382874, -0.028431983664631844, -0.09444320946931839, 0.12822185456752777, -0.11785411834716797, -0.3594793677330017, 0.22113819420337677, -0.5840244889259338, 0.1144385039806366, 0.6332467198371887, -0.3459055423736572, 0.047316595911979...
is giving the error as when I comment it, the applications works perfectly. Here is the logcat of the error: ``` 04-08 18:56:38.673: E/AndroidRuntime(13166): FATAL EXCEPTION: Timer-0 04-08 18:56:38.673: E/AndroidRuntime(13166): java.lang.NullPointerException 04-08 18:56:38.673: E/AndroidRuntime(13166): at stefan.t...
[ 0.06577332317829132, 0.22840912640094757, 0.32328110933303833, -0.1482982337474823, 0.08693326264619827, 0.0297236368060112, 0.9803439974784851, -0.12492252141237259, -0.32770398259162903, -0.3603195548057556, -0.16240456700325012, 0.5640307664871216, -0.6773044466972351, 0.082991927862167...
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:795) 04-08 18:56:39.654: E/ActivityThread(13166): at android.app.ContextImpl.registerReceiver(ContextImpl.java:782) 04-08 18:56:39.654: E/ActivityThread(13166): at android.app.ContextImpl.registerReceiver(ContextImpl.java:776) 04-08 18:56:39.654...
[ -0.12565623223781586, 0.12053621560335159, 0.4006598889827728, -0.36276641488075256, 0.0064534833654761314, 0.41987988352775574, 0.7345010638237, -0.4297427833080292, -0.28923776745796204, -0.5241405963897705, -0.41893619298934937, 0.7352545857429504, -0.586826741695404, -0.233866289258003...
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 04-08 18:56:39.654: E/ActivityThread(13166): at dalvik.system.NativeStart.main(Native Method) 04-08 18:56:40.054: E/ActivityThread(13166): Activity stefan.testservice.TestserviceActivity has leaked ServiceConnection stefan.testservice.TestserviceActivit...
[ -0.15635153651237488, 0.24497567117214203, 0.4175530970096588, -0.022369910031557083, -0.07968239486217499, -0.015493994578719139, 0.8431536555290222, -0.20386812090873718, -0.029630687087774277, -0.636663019657135, -0.5300291776657104, 0.5231768488883972, -0.42281490564346313, 0.111058086...
18:56:40.054: E/ActivityThread(13166): at android.os.Handler.dispatchMessage(Handler.java:99) 04-08 18:56:40.054: E/ActivityThread(13166): at android.os.Looper.loop(Looper.java:123) 04-08 18:56:40.054: E/ActivityThread(13166): at android.app.ActivityThread.main(ActivityThread.java:3683) 04-08 18:56:40.054: E/A...
[ 0.05837630107998848, 0.30030447244644165, 0.4715287387371063, -0.09754752367734909, 0.14183929562568665, 0.1861565113067627, 0.6212105751037598, -0.3550844192504883, -0.09951213747262955, -0.5979524850845337, -0.2906690835952759, 0.630092442035675, -0.46893617510795593, -0.1667943447828292...
} ``` > Any attribute that I could use for the whole controller? Yes, you could extend the `Authorize` attribute with a custom one: ``` public class AuthorizeAuthorAttribute : AuthorizeAttribute { protected override bool AuthorizeCore(HttpContextBase httpContext) { var isAuthorized = base.AuthorizeCo...
[ 0.05634612217545509, -0.44489556550979614, 0.49932071566581726, 0.021537629887461662, 0.32002076506614685, -0.11208269745111465, 0.1321066915988922, -0.365006685256958, 0.05762214958667755, -0.5189030766487122, 0.015119464136660099, 0.6978198289871216, -0.29270368814468384, 0.0684539675712...
=> no need to continue any further return false; } // get the currently logged on user var username = httpContext.User.Identity.Name; // get the id of the article that he is trying to manipulate // from the route data (this assumes that the id is passed as a route
[ 0.05761280655860901, 0.13418295979499817, 0.7811925411224365, -0.3384166955947876, 0.17634177207946777, -0.19476962089538574, 0.5632224678993225, 0.08241725713014603, -0.08522111177444458, -0.733722984790802, -0.11084596067667007, 0.2443128377199173, -0.319126158952713, 0.18561619520187378...
// data parameter: /foo/edit/123). If this is not the case and you // are using query string parameters you could fetch the id using the Request var id = httpContext.Request.RequestContext.RouteData.Values["id"] as string; // Now that we have the current user and the id of the article he ...
[ 0.22449561953544617, -0.13445748388767242, 0.5077099204063416, 0.0800553560256958, 0.09992670267820358, -0.10551968216896057, 0.09124545753002167, -0.5093836188316345, -0.06965796649456024, -0.547290027141571, 0.11103998124599457, 0.752100944519043, -0.2784980535507202, -0.0491484254598617...
// our database to see if this user is the owner of the article return IsUserOwnerOfArticle(username, id); } private bool IsUserOwnerOfArticle(string username, string articleId) { throw new NotImplementedException(); } } ``` and then: ``` [HttpPost] [AuthorizeAuthor] public ActionRes...
[ -0.16161365807056427, -0.09631628543138504, 0.5257589817047119, -0.27533790469169617, 0.16579067707061768, -0.16903170943260193, 0.3290361166000366, -0.2557077407836914, -0.19574882090091705, -0.4860919415950775, -0.4009263813495636, 0.69931560754776, -0.3405231833457947, 0.128111451864242...
I am implementing a distributed chat system, in this system we have the following options : 1. Make the client and server running at each node run as separate threads. The server acting as the receiver will be running as the daemon thread and the client taking the user input as a normal thread. 2. Fork two processes o...
[ 0.3736526072025299, -0.19170671701431274, 0.19564661383628845, 0.06182856857776642, 0.07844322174787521, 0.11567298322916031, 0.047070376574993134, 0.10440351068973541, -0.28376784920692444, -0.7830573320388794, 0.25068894028663635, 0.30404672026634216, -0.4997599422931671, 0.4076023697853...
put them into right queues, m workers that push data to clients and k workers that process data from queues. n workers getting data m workers pushing data k workers processing data and tracking state incoming message que outcoming message que this way you can find best (n, m, k) for you. Only problem here is that it ...
[ 0.2566082775592804, -0.19011035561561584, 0.5265045166015625, 0.12940672039985657, -0.1659480780363083, 0.440701961517334, -0.029350344091653824, -0.28962111473083496, -0.6847501993179321, -0.9134255647659302, 0.303533136844635, 0.5555762648582458, -0.2570677399635315, 0.2738700807094574, ...
could use websockets for this. Something like socket.io <http://socket.io/> or faye <http://faye.jcoglan.com/> And just create front for the chat :) This will solve most of your problems in a really scalable and usable way.
[ 0.5718370079994202, -0.19334012269973755, -0.16814272105693817, 0.3325081169605255, -0.2465074360370636, 0.051426518708467484, -0.022435350343585014, 0.5022880434989929, -0.46107733249664307, -0.773539662361145, 0.28895267844200134, 0.38361260294914246, 0.007779455743730068, 0.070019461214...
I am trying to split up a string by caps using Javascript, Examples of what Im trying to do: ``` "HiMyNameIsBob" -> "Hi My Name Is Bob" "GreetingsFriends" -> "Greetings Friends" ``` I am aware of the `str.split()` method, however I am not sure how to make this function work with capital letters. I've tried: ``...
[ 0.15183068811893463, 0.08326368033885956, 0.31141072511672974, -0.23896855115890503, -0.18847936391830444, 0.12653791904449463, 0.21451479196548462, -0.084650918841362, -0.13640335202217102, -0.541354775428772, -0.24357062578201294, 0.3008277118206024, -0.5292603969573975, 0.16158770024776...
Following Apple example code in: <http://developer.apple.com/library/ios/#documentation/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html> I'm able to successfully generate key-pair with the code snippet below, but unable to print the keys... The function SecKeyGeneratePair() - returns the ke...
[ -0.25614452362060547, 0.0899440348148346, 0.24266166985034943, -0.23412542045116425, 0.15817537903785706, 0.2408502697944641, 0.36176609992980957, -0.36938992142677307, -0.0967436358332634, -0.5942854881286621, -0.11588557064533234, 0.6239112615585327, -0.4554101228713989, 0.01126690395176...
// 1 - (void)generateKeyPairPlease { OSStatus status = noErr; NSMutableDictionary *privateKeyAttr = [[NSMutableDictionary alloc] init]; NSMutableDictionary *publicKeyAttr = [[NSMutableDictionary alloc] init]; NSMutableDictionary *keyPairAttr = [[NSMutableDictionary alloc] init];
[ -0.11034800112247467, -0.18978294730186462, 0.24866057932376862, -0.24819009006023407, 0.3316900432109833, 0.042838118970394135, 0.7321121692657471, -0.13830670714378357, 0.11278023570775986, -0.30573371052742004, -0.4401421546936035, 0.3770958483219147, -0.43122363090515137, 0.05980435758...
// 2 NSData * publicTag = [NSData dataWithBytes:publicKeyIdentifier length:strlen((const char *)publicKeyIdentifier)]; NSData * privateTag = [NSData dataWithBytes:privateKeyIdentifier
[ -0.23317626118659973, -0.2828838527202606, 0.09758599102497101, -0.18336161971092224, 0.0339895598590374, 0.16046901047229767, 0.3705868721008301, -0.17826038599014282, -0.27966248989105225, -0.6065868735313416, -0.39187875390052795, 0.17605668306350708, -0.2683839797973633, -0.12742237746...
length:strlen((const char *)privateKeyIdentifier)]; // 3 SecKeyRef publicKey = NULL; SecKeyRef privateKey =
[ -0.10793658345937729, -0.19953154027462006, 0.14552851021289825, -0.36490774154663086, -0.09314591437578201, 0.16572308540344238, 0.5968632102012634, -0.46037405729293823, -0.18894518911838531, -0.08534263074398041, -0.20079654455184937, 0.5065503716468811, -0.1912514716386795, 0.419046729...
NULL; // 4 [keyPairAttr setObject:(id)kSecAttrKeyTypeRSA forKey:(id)kSecAttrKeyType]; // 5 [keyPairAttr setObject:[NSNumber numberWithInt:1024]
[ -0.41646793484687805, -0.019427834078669548, -0.04422512277960777, -0.28301873803138733, 0.032428473234176636, 0.15458568930625916, 0.4866406321525574, -0.39562681317329407, -0.26471325755119324, -0.16125406324863434, -0.3550800681114197, 0.35435014963150024, -0.2507927715778351, 0.1653704...
forKey:(id)kSecAttrKeySizeInBits]; // 6 [privateKeyAttr setObject:[NSNumber numberWithBool:YES] forKey:(id)kSecAttrIsPermanent]; // 7 [privateKeyAttr setObject:privateTag forKey:(id)kSecAttrApplicationTag]; // 8 [publicKeyAttr setObject:[NSNumber ...
[ -0.31507304310798645, -0.25748559832572937, 0.26211875677108765, -0.021697809919714928, 0.047231871634721756, 0.42674335837364197, 0.3165040910243988, -0.1373186558485031, -0.20553918182849884, -0.2582770586013794, -0.20288479328155518, 0.4287862777709961, -0.2677207887172699, 0.0397251546...
forKey:(id)kSecAttrIsPermanent]; // 9 [publicKeyAttr setObject:publicTag forKey:(id)kSecAttrApplicationTag]; // 10 [keyPairAttr setObject:privateKeyAttr forKey:(id)kSecPrivateKeyAttrs]; // 11
[ -0.35820266604423523, -0.31643638014793396, 0.36228951811790466, -0.016301633790135384, -0.008521207608282566, 0.16822949051856995, 0.32794731855392456, -0.03199140354990959, -0.19345994293689728, -0.21112681925296783, -0.40914273262023926, 0.32127851247787476, -0.37962761521339417, 0.1494...
[keyPairAttr setObject:publicKeyAttr forKey:(id)kSecPublicKeyAttrs]; // 12 status = SecKeyGeneratePair((CFDictionaryRef)keyPairAttr, &publicKey, &privateKey); // 13 // error handling... if(privateKeyAttr) [privateKeyAttr release]; if...
[ -0.2398868203163147, -0.12978121638298035, 0.21823270618915558, -0.1327766627073288, 0.34221193194389343, 0.03463722765445709, 0.6715980768203735, -0.2519243657588959, -0.11618170142173767, -0.10336606204509735, -0.28038161993026733, 0.5976395606994629, -0.2596547305583954, 0.1644794940948...
[publicKeyAttr release]; if(keyPairAttr) [keyPairAttr release]; if(publicKey) CFRelease(publicKey); if(privateKey) CFRelease(privateKey); // 14 } ``` You can use [SecItemCopyMatching](http://developer.apple.com/library/ios/#DOCUMENTATION/Security/Reference/keychainservices/Reference/r...
[ -0.008042869158089161, -0.08554629981517792, 0.3966990113258362, -0.023109694942831993, 0.22393594682216644, -0.11583980917930603, 0.17160286009311676, -0.3570699691772461, -0.32501259446144104, -0.4891377389431, -0.518277645111084, 0.5536019802093506, -0.37881597876548767, -0.263363271951...
I am working on a branch called Lion, I mistakenly done this: ``` git push origin lion:master ``` instead of ``` git push eng lion:master ``` Basically the second line is for pushing the lion branch to a staging heroku app but I mistakenly merge all my code to into origin master. How can I revert than? I have a...
[ 0.5749921202659607, -0.09028913080692291, 0.12353779375553131, -0.11298654228448868, 0.0886167585849762, 0.15563687682151794, 0.3105543851852417, -0.328925222158432, -0.3265635073184967, -0.6810557842254639, 0.10225430130958557, 0.5317481756210327, -0.26017147302627563, 0.05109977349638939...
access to the repository you should be able to do: ``` git checkout -b rework <last-good-commit> git push origin rework:master # The push merge will produce a commit that works back to <last-good-commit> ```
[ 0.23664447665214539, 0.03472848981618881, 0.22253389656543732, -0.015032023191452026, 0.12822768092155457, -0.17829583585262299, 0.06355035305023193, -0.08662834763526917, -0.1671919971704483, -0.8219406604766846, -0.10505950450897217, 0.38571327924728394, -0.10383892059326172, 0.173160359...
> **Possible Duplicate:** > > [Pop up window in asp.net?](https://stackoverflow.com/questions/3625669/pop-up-window-in-asp-net) I need to pop up a window on a button click so that the popped up window contains a checkboxlist and also I need to get the values which were checked in the checkboxlist which is present i...
[ -0.04504423215985298, -0.07763151079416275, 0.3446339964866638, 0.24067437648773193, -0.17269091308116913, 0.013639559037983418, 0.3034248948097229, -0.0948677510023117, -0.37538495659828186, -0.8466336131095886, -0.22048036754131317, 0.4530205726623535, -0.20876416563987732, -0.2904266715...
<OnShown> .. </OnShown> <OnHiding> .. </OnHiding> <OnHidden> .. </OnHidden> </Animations> </ajaxToolkit:ModalPopupExtender> ``` If you are new about this then visit this link:[ModalPopup Demonstration](http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/M...
[ -0.19764819741249084, -0.3846798837184906, 0.2760140299797058, 0.29233160614967346, -0.47056594491004944, -0.2064543217420578, 0.30663275718688965, 0.09336118400096893, -0.28893592953681946, -0.6152917146682739, -0.3140990138053894, 0.3974855840206146, -0.04392154514789581, -0.301617830991...
Suppose I have an enum like ``` data T = A | B | C deriving (Enum) ``` and a list of enum values as input: ``` [B, C, C, A, C, A, C] ``` What I'm looking for is a function that, given this input, returns how often each element occurs in the input. A simple form for the output would be a list of the frequencies (`...
[ 0.06236764416098595, -0.08612997829914093, 0.3445001542568207, -0.36053770780563354, 0.0031048657838255167, 0.05851941928267479, 0.06496652215719223, -0.6463850736618042, 0.19699804484844208, -0.6490966081619263, -0.3172382116317749, 0.4974640905857086, -0.3489915430545807, -0.033558860421...
x ==)) [0 .. length elems - 1] in foldr (zipWith (+)) (replicate (length elems) 0) . map f ``` This works, but I see at least two issues: 1. It uses the `length` function. 2. It requires that the caller specifies all possible values in the first argument. Is there a way to improve this? Usually a bit faster than ...
[ 0.14514097571372986, -0.07804656773805618, 0.728771448135376, -0.3170357644557953, 0.044465236365795135, -0.09757421910762787, 0.4796348810195923, -0.7563779950141907, 0.07868354022502899, -0.814960241317749, -0.13171038031578064, 0.7574388384819031, -0.35702869296073914, -0.00759644852951...
i, f) | (i,f) <- Map.assocs $ enumFreq list]` If your type is itself in `Ord`, you can skip the `fromEnum` and `toEnum`. If you have `Ix` and `Bounded` instances and the type doesn't have too many elements, ``` import Data.Array.Unboxed enumFreq :: (Ix a, Bounded a) => [a] -> UArray a Word enumFreq = accumArray (+)...
[ -0.10351572185754776, -0.2272072434425354, 0.35885003209114075, -0.20281842350959778, -0.19313205778598785, 0.24413207173347473, 0.34921154379844666, -0.2952108681201935, 0.01732972264289856, -0.6752926707267761, -0.3333395719528198, 0.5957324504852295, -0.5671042799949646, 0.0196977127343...
I am trying to build a simple email client with python and IMAPClient. The problem is that the folder names aren't uniform for all servers. If i mark an e-mail as spam, it has to be moved to the spam/junk folder from the inbox folder (?) .. but i am unable to do that because i don't know what the folder name would be ...
[ 0.44691359996795654, 0.2299930304288864, 0.1286025047302246, -0.10622797906398773, -0.31252720952033997, -0.05449642241001129, 0.2032770812511444, 0.27078375220298767, -0.2762955129146576, -0.6323855519294739, 0.11128438264131546, 0.3974837362766266, -0.5935839414596558, 0.3333238959312439...
etc.). Another way of doing it is to let the user decide first time, persist the setting for that account and not ask again. Mixed approach would be to try and detect all common variations and use the first valid one you encounter. If there are more then one simply allow user to choose.
[ 0.4531673491001129, -0.016748841851949692, 0.16629967093467712, 0.22375528514385223, 0.21363785862922668, 0.1813916563987732, 0.06612924486398697, -0.16145578026771545, -0.4111531972885132, -0.4620188772678375, 0.2537647485733032, 0.5035456418991089, -0.29364022612571716, 0.063167810440063...
I have a navbar right under the title to the site, but I want to be line up the first and last items in the navbar with the beginning and end of the Title. I don't have a live preview, but I attached an image. I can get it to line up in one browser, but when I open it in the other, its off again. Is there an easy way t...
[ 0.30174586176872253, -0.06929297000169754, 0.5674392580986023, 0.05997345596551895, -0.08053223788738251, -0.2086474895477295, 0.04505649954080582, -0.2016574591398239, -0.44600051641464233, -0.6243872046470642, -0.02097541280090809, 0.29611581563949585, -0.04703427851200104, 0.00529260700...
<div id="topnav" align="center"> <ul id="list-nav"> <li><a href="home.html">HOME</a></li> <li><a href="about.html">ABOUT</a></li> <li><a href="trailer.html">TRAILER</a></li> <li><a href="stills.html">STILLS</a></li> <li><a href="news.html">NEWS</a></li> ...
[ 0.29533249139785767, -0.025295216590166092, 0.5161757469177246, -0.10624708980321884, -0.44102784991264343, 0.01548409927636385, -0.2752828299999237, -0.48512712121009827, -0.25492656230926514, -0.3889346718788147, -0.26215189695358276, 0.24274155497550964, -0.22582316398620605, -0.0068184...
</ul> </div> <!-- START OF CONTAINER --> <div class="trailer"> <img id="imgHolder" /> </div> </div> <!-- END OF CONTAINER 12 --> ``` CSS: ``` #topnav li { margin-right: 110px; } #topnav li:nth-last-child(1) { margin-right: 0px; } ``` You can work with `text-align: justify` See a [demo](...
[ 0.11312944442033768, -0.11327876150608063, 0.4342958927154541, 0.1036921888589859, 0.06499455869197845, 0.08868204057216644, -0.27911698818206787, -0.5230498909950256, -0.29075106978416443, -0.6432573199272156, -0.11304078996181488, 0.38444000482559204, 0.12145714461803436, 0.1295366287231...
Morning, I must be asking google all the wrong questions, because I can't find anything similar. I have a standard navigation list, but I'm using **page jumping** because I wanted a single web page. ``` <ul> <li><a href="#livestream">Livestream</a></li> <li><a href="#media">Media</a></li> <li><a href="#crew">Crew</a...
[ 0.21608354151248932, 0.1393049955368042, 0.4867148697376251, -0.015005641616880894, -0.07584056258201599, -0.11910314857959747, 0.31446024775505066, -0.21162332594394684, -0.5428127646446228, -0.9113641977310181, -0.007954556494951248, 0.4913692772388458, -0.32617247104644775, -0.052658028...
this: ``` // Wait for the DOM to be ready $(function(){ // Add click-event listener $("li a").click(function(){ // Remove the current class from all a tags $("li a").removeClass("current"); // Add the current class to the clicked a $(this).addClass("current"); }); }); ```
[ -0.11289583146572113, -0.2502065896987915, 0.7093837261199951, -0.4901706576347351, 0.04918232932686806, -0.14891952276229858, 0.25051259994506836, -0.4858701825141907, -0.09377498179674149, -0.2852962911128998, -0.46209314465522766, 0.838238000869751, -0.4558153748512268, 0.28245359659194...
I have this managed bean based on this [tutorial](http://balusc.blogspot.com/2008/10/effective-datatable-paging-and-sorting.html). ``` import java.io.Serializable; import javax.enterprise.context.SessionScoped; // or import javax.faces.bean.SessionScoped; import javax.inject.Named; /* include SQL Packages */ import ja...
[ -0.06193992868065834, 0.46950989961624146, 0.25973621010780334, -0.1195574477314949, -0.4625040292739868, 0.16271907091140747, 0.32122793793678284, -0.403568834066391, -0.49277743697166443, -0.7512809038162231, -0.13101501762866974, 0.46740633249282837, -0.43597128987312317, 0.302104979753...
private int rowsPerPage; private int totalPages; private int pageRange; private Integer[] pages; private int currentPage; // Sorting. private String sortField; private boolean sortAscending; private static class ActiveSessionObj { /* Oracle table structure CREATE TABLE ...
[ -0.24757897853851318, -0.019421624019742012, 0.43963614106178284, -0.15704597532749176, 0.11419576406478882, 0.1995028704404831, 0.3237082362174988, -0.3735552132129669, -0.23009134829044342, -0.29387179017066956, -0.3763246536254883, 0.4018998444080353, -0.514382541179657, 0.0721950381994...
ACTIVITYSTART TIMESTAMP(6), ACTIVITYEND TIMESTAMP(6), ACTIVITY CLOB ) */ private String aSessionID; private String userID; private Date activityStart; private Date activityEnd; private String activity; public
[ 0.17440326511859894, -0.5577512383460999, 0.38668447732925415, -0.221654012799263, 0.25675639510154724, -0.12661215662956238, 0.23151995241641998, 0.05639057233929634, -0.20903436839580536, -0.22612234950065613, -0.527070939540863, 0.6724509596824646, -0.4131094217300415, -0.11333415657281...
ActiveSessionObj(String aSessionID, String userID, Date activityStart, Date activityEnd, String activity) { this.aSessionID = aSessionID; this.userID = userID; this.activityStart = activityStart; this.activityEnd = activityEnd; this.activity = activity; ...
[ -0.12445469200611115, -0.517702579498291, 0.40611371397972107, -0.2927750051021576, 0.22134241461753845, -0.15985752642154694, 0.5555537939071655, -0.12673833966255188, -0.25770482420921326, -0.4154346287250519, -0.47570112347602844, 0.6670174598693848, -0.5440719127655029, -0.258897423744...
return aSessionID; } public void setaSessionID(String aSessionID) { this.aSessionID = aSessionID; } public String getActivity() { return activity; } public void setActivity(String activity) {
[ 0.5529230833053589, -0.5223095417022705, 0.14492157101631165, -0.14946047961711884, 0.20245568454265594, -0.24533775448799133, 0.39029714465141296, -0.4501200020313263, -0.2366662472486496, -0.3716587722301483, -0.4156937301158905, 0.6016560196876526, -0.6373130679130554, -0.31943175196647...
this.activity = activity; } public Date getActivityEnd() { return activityEnd; } public void setActivityEnd(Date activityEnd) { this.activityEnd = activityEnd; } public Date getActivityStart() {
[ 0.49553900957107544, -0.4493364095687866, 0.46082523465156555, -0.33878400921821594, 0.25023913383483887, -0.4647315740585327, 0.35372865200042725, -0.18441154062747955, -0.10687427222728729, -0.17665018141269684, -0.3822302520275116, 0.5417805910110474, -0.2780487835407257, -0.06282417476...
return activityStart; } public void setActivityStart(Date activityStart) { this.activityStart = activityStart; } public String getUserID() { return userID; } public void setUserID(String userID) {
[ 0.5326343774795532, -0.5812258720397949, 0.5168821811676025, -0.2800837457180023, 0.24286562204360962, -0.33029332756996155, 0.3420850336551666, 0.08528132736682892, -0.13037888705730438, -0.23249685764312744, -0.3446381688117981, 0.6106981635093689, -0.46570271253585815, -0.07078327238559...
this.userID = userID; } private ActiveSessionObj() { throw new UnsupportedOperationException("Not yet implemented"); } } // Constructors ------------------------------------------------------------------------------- public Sessions() { // Set default values som...
[ -0.197064608335495, -0.10395506024360657, 0.46242162585258484, 0.12954485416412354, 0.24997514486312866, -0.08973585069179535, 0.4532773792743683, -0.22608186304569244, -0.3119525611400604, -1.013659119606018, -0.3177340626716614, 0.6815550327301025, -0.13383547961711884, 0.049585051834583...
of rows to be displayed at once). 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. } // Paging actions ---------------------------------------------...
[ -0.4843190014362335, -0.17902803421020508, 0.7442052364349365, -0.3734337091445923, -0.031122885644435883, 0.3507244288921356, 0.35569271445274353, -0.4041643738746643, -0.23294489085674286, -0.7647396326065063, -0.3604435622692108, 0.5176897644996643, -0.5824968218803406, -0.1073244363069...
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 = count(); //count the tablerows } catch (Exception e) { throw new RuntimeException(e); // Handle it yourself. } // Set currentPage, totalPages and pages. currentPage = (totalRows / rowsP...
[ -0.18779978156089783, -0.43977591395378113, 0.6071624159812927, -0.09077121317386627, 0.04659751430153847, 0.043344154953956604, 0.2629739046096802, -0.5003294348716736, -0.3782976567745209, -0.5403106212615967, -0.3304935097694397, 0.3249889314174652, -0.2703007757663727, 0.07478126138448...
+ 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 SQL_LIST_BY_ORDER_AND_LIMIT = "SELECT * FROM ACTIVESESSIONSLOG WHERE ROWNUM >= ? AND ROWNUM <= ? ORDER BY ? ?"; if (ds == null) { ...
[ -0.4304630160331726, -0.2557418644428253, 0.4846678376197815, -0.08326002210378647, 0.1803731769323349, -0.14753668010234833, 0.20781858265399933, -0.40490952134132385, 0.05431118980050087, -0.5193554759025574, -0.29796841740608215, 0.4834672510623932, -0.31107187271118164, -0.233788579702...
"ASC" : "DESC"; String sql = String.format(SQL_LIST_BY_ORDER_AND_LIMIT, sortField, sortDirection); Connection conn = ds.getConnection(); PreparedStatement preparedStatement = null; ResultSet resultSet = null; List<ActiveSessionObj> dataList = new ArrayList<ActiveSessionObj>(); ...
[ 0.019704338163137436, -0.43700340390205383, 0.36520764231681824, -0.1483696550130844, 0.07692115008831024, 0.18254636228084564, 0.5823912024497986, -0.6159331798553467, -0.3262959420681, -0.32514509558677673, -0.474090039730072, 0.48874396085739136, -0.4342915713787079, 0.21352429687976837...
preparedStatement = conn.prepareStatement(sql); preparedStatement.setInt(1, firstRow); preparedStatement.setInt(2, rowCount); preparedStatement.setString(3, sortField); preparedStatement.setString(4, sortDirection); resultSet = preparedStat...
[ 0.24126017093658447, -0.025468990206718445, 0.2245207577943802, -0.20473353564739227, -0.0995318815112114, 0.10445088148117065, 0.2854061424732208, -0.8358667492866516, 0.07327529042959213, -0.3308514356613159, -0.34601378440856934, 0.3227384388446808, -0.05572839453816414, 0.1642741858959...
/* take the result from the SQL query and insert it into Array List collection */ dataList = ActiveSessionsArrayList(resultSet); } catch (SQLException e) { throw new SQLException(e); } finally { conn.close(); }
[ -0.0025266988668590784, -0.26554086804389954, 0.5554459095001221, -0.2643481194972992, 0.05469691380858421, -0.16869013011455536, 0.09040828049182892, -0.4478326439857483, 0.059529002755880356, -0.3527315855026245, -0.20089755952358246, 0.5628774166107178, -0.38234955072402954, -0.04728811...
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 count() throws Exception { String SQL_COUNT = "SELECT count(*) FROM ACTIVESESSIONSLOG"; Prepar...
[ -0.1754179447889328, -0.08901088684797287, 0.23239660263061523, -0.27027657628059387, -0.04413566365838051, 0.07713962346315384, 0.26882609724998474, -0.6936051249504089, -0.24570293724536896, -0.3254777491092682, -0.27218544483184814, 0.24858804047107697, -0.3304885923862457, 0.0210535265...
int count = 0; try { Connection conn = ds.getConnection(); preparedStatement = conn.prepareStatement(SQL_COUNT); resultSet = preparedStatement.executeQuery(); if (resultSet.next()) { count = resultSet.getInt(1);
[ -0.04359808191657066, -0.5272483825683594, 0.53586345911026, -0.15745191276073456, 0.15822052955627441, 0.02693668194115162, 0.5000669360160828, -0.6448610424995422, -0.12100975960493088, -0.45259061455726624, -0.22683344781398773, 0.26143354177474976, -0.26895129680633545, 0.3416485190391...
} } catch (SQLException e) { throw new Exception(e); } finally { //close the connection } return count; } /** * Map the current row of the given ResultSet to ActiveSessionObj. * @param
[ -0.05842313915491104, -0.20461727678775787, 0.4117194414138794, -0.03415581211447716, 0.06988454610109329, 0.09515142440795898, 0.25182783603668213, -0.31303831934928894, -0.30179113149642944, -0.4370163679122925, -0.19760632514953613, 0.2308938205242157, -0.43980106711387634, 0.1696037054...
resultSet The ResultSet of which the current row is to be mapped to ActiveSessionObj. * @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(R...
[ -0.25292205810546875, -0.17655940353870392, 0.7179847955703735, 0.01927575282752514, -0.04360251501202583, 0.13648806512355804, 0.1254814714193344, -0.4529469609260559, -0.17065860331058502, -0.6222215294837952, -0.23056453466415405, 0.35061967372894287, -0.48983874917030334, -0.1733801811...
while(rs.next()) { al.add(new ActiveSessionObj( rs.getString("ASESSIONID"), rs.getString("USERID"), timestampToDate(rs.getTimestamp("ACTIVITYSTART")), timestampToDate(rs.getTimestamp("ACTIVITYEND")),
[ -0.0973401740193367, -0.33670562505722046, 0.7189237475395203, -0.31157615780830383, 0.45130348205566406, -0.11033273488283157, 0.46348807215690613, -0.4376479387283325, -0.12189900130033493, -0.5464221239089966, -0.4021685719490051, 0.47273769974708557, -0.53764808177948, -0.0991960912942...
rs.getString("ACTIVITY") )); } } catch(Exception x) {x.printStackTrace();} return al; /* CREATE TABLE ACTIVESESSIONSLOG( ASESSIONID VARCHAR2(30 ) NOT NULL,
[ 0.08127111941576004, -0.23532001674175262, 0.49017444252967834, -0.23239262402057648, 0.22175107896327972, -0.07415137439966202, 0.46089163422584534, -0.6029025316238403, -0.4257107675075531, -0.34219056367874146, -0.26062801480293274, 0.4455339014530182, -0.7265767455101013, -0.0846573561...
USERID VARCHAR2(30 ), ACTIVITYSTART TIMESTAMP(6), ACTIVITYEND TIMESTAMP(6), ACTIVITY CLOB ) */ } // select all button handle private Map<Long, Boolean> selectedIds = new HashMap<Long, Boolean>(); // get the list from the JSF page public Map<Long, Boolean> ge...
[ -0.4747229218482971, -0.615477442741394, 0.5988872051239014, -0.0876118540763855, 0.05372846499085426, -0.13459324836730957, 0.3518487215042114, -0.3552415370941162, -0.13960424065589905, -1.0084648132324219, -0.2556608319282532, 0.5207747220993042, -0.5372912883758545, -0.0483133867383003...
return selectedIds; } // call this method from the JSF page to delete the selected rows public String deleteAction() { // do something with the selected rows return null; } private static Date timestampToDate(java.sql.Timestamp ts) { Date d = null; try ...
[ 0.09686532616615295, -0.47628891468048096, 0.2031993716955185, -0.200264111161232, 0.14280280470848083, 0.1052912250161171, 0.22439435124397278, -0.14156892895698547, -0.20180003345012665, -0.4160062372684479, -0.23212063312530518, -0.020093074068427086, -0.3867664933204651, 0.477812081575...
d = new Date(ts.getTime()); } catch (Exception e) { e.printStackTrace(); } return d; } } ``` I get this error stack when I run the code in Glassfish: ``` java.lang.RuntimeException: java.sql.SQLException: java.sql.SQLSyntaxErrorException: ORA-01745: invalid host/bind variable name a...
[ -0.018617738038301468, 0.0737488642334938, 0.3114694356918335, -0.23567405343055725, 0.21468380093574524, 0.17941638827323914, 0.38505783677101135, -0.3910418748855591, -0.1938248872756958, -0.7161381244659424, -0.10049828886985779, 0.2889438271522522, -0.4556627869606018, 0.36932420730590...
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) at com.sun.el.parser.AstValue.getValue(AstValue.java:138) at com.sun.el.parser.AstValue.getValue(AstValue.java:183) at com.su...
[ -0.3141923248767853, 0.17242570221424103, 0.645534336566925, -0.2683901786804199, -0.15816712379455566, 0.6722845435142517, 0.4341687858104706, -0.6288951635360718, -0.403240829706192, -0.8717036843299866, -0.5056648254394531, 0.3483366072177887, -0.18291503190994263, -0.1666339486837387, ...
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) at com.sun.faces.lifecycle.RenderRespo...
[ -0.18158218264579773, 0.19593802094459534, 0.4657222330570221, -0.0517314150929451, -0.23425647616386414, 0.589679479598999, 0.4546036720275879, -0.35376787185668945, -0.17297610640525818, -0.8288880586624146, -0.19128043949604034, 0.7195723056793213, 0.059910885989665985, -0.1221137195825...
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(De...
[ -0.5075622797012329, 0.38424617052078247, 0.40896347165107727, -0.32426589727401733, -0.020702773705124855, 0.3718196451663971, 0.6241514682769775, -0.13872945308685303, -0.6128972768783569, -0.6463209986686707, -0.23958846926689148, 0.17956799268722534, -0.5491547584533691, 0.181847646832...
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207) at oracle.jdbc.driver.T4CPreparedStatement.exec...
[ -0.04210754856467247, 0.4254714548587799, 0.42087462544441223, -0.20575201511383057, -0.13702017068862915, 0.2943815290927887, 0.3788057863712311, -0.6764495372772217, -0.00766910333186388, -0.36870038509368896, -0.09526550024747849, 0.584662914276123, -0.1007544994354248, -0.0714421644806...
ASESSIONID VARCHAR2(30 ) NOT NULL, USERID VARCHAR2(30 ), ACTIVITYSTART TIMESTAMP(6), ACTIVITYEND TIMESTAMP(6), ACTIVITY CLOB ) / -- ADD KEYS FOR TABLE ACTIVESESSIONSLOG ALTER TABLE ACTIVESESSIONSLOG ADD CONSTRAINT ASESSIONID PRIMARY KEY (ASESSIONID) / ``` The query is the problem, or rather the query paramet...
[ -0.6017907857894897, -0.07020307332277298, 0.7191137671470642, -0.170925110578537, -0.11661902070045471, 0.202226921916008, 0.25101733207702637, -0.6191449165344238, -0.33510538935661316, -0.4700973331928253, -0.4094480276107788, 0.8948118686676025, -0.5380692481994629, -0.0919146910309791...
two lines then need to be removed: ``` preparedStatement.setString(3, sortField); preparedStatement.setString(4, sortDirection); ```
[ -0.058918602764606476, 0.06390158832073212, 0.2594749629497528, -0.22551625967025757, 0.012111134827136993, -0.06825964152812958, 0.17469875514507294, -0.4048365652561188, 0.08693372458219528, -0.5795295238494873, -0.7511146068572998, 0.27735552191734314, -0.25292226672172546, -0.006767266...
I'm trying to get my head around Dependency Injection and I understand it, for the most part. However, say if, for some reason, one of my classes was dependent on several classes, instead of passing all of these to this one class in the constructor, is there a better, more sensible method? I've heard about DI Contai...
[ 0.4634273052215576, 0.1331285834312439, 0.015233582817018032, 0.10428198426961899, 0.01847785711288452, 0.2703424096107483, -0.001284332014620304, -0.1603611707687378, 0.08009505271911621, -0.6287681460380554, 0.35841259360313416, 0.5795901417732239, -0.18381258845329285, 0.049025282263755...
right direction would be fantastic. If you have several dependencies to deal with, then yes a DI container can be the solution. The DI container can be an object or array constructed of the various dependent object you need, which gets passed to the constructor and unpacked. Suppose you needed a config object, a data...
[ 0.041199009865522385, -0.4919053912162781, 0.3176628649234772, 0.47961702942848206, 0.21450258791446686, 0.27085432410240173, -0.11740147322416306, 0.032440196722745895, 0.08081233501434326, -0.6406028270721436, 0.05737396329641342, 0.4300113320350647, -0.2764447033405304, 0.12336795032024...
class $di_container = array( 'config' = new Config(), 'db' = new DB($user, $pass, $db, $whatever), 'client' = new ClientInfo($clientid) ); ``` And your class constructors accept the DI container as a parameter: ``` class SomeClass { private $config; private $db; private $client; public function __cons...
[ -0.02582790143787861, -0.3561673164367676, -0.11003318428993225, -0.062063150107860565, -0.19707883894443512, 0.03210727870464325, 0.05767806991934776, -0.2647787034511566, 0.05952460318803787, -0.5705003142356873, -0.14334750175476074, 0.4093514382839203, -0.6682642102241516, 0.2501150667...
benefit to using an object instead of an array is that by default it will be passed by reference into the classes using it, while an array is passed by value (though objects inside the array are still references). ### Edit There are some ways in which an object is more flexible than an array, although more complicate...
[ 0.33044567704200745, -0.43332159519195557, 0.15303032100200653, 0.2591853141784668, -0.16213597357273102, -0.10067526251077652, -0.09413139522075653, -0.023255756124854088, -0.32043907046318054, -0.8309538960456848, -0.12654469907283783, 0.4909176826477051, -0.285977840423584, 0.0498679317...
object (which itself instantiates several others). ``` Class DIContainer { public $config; public $db; public $client; // The DI container can build its own member objects public function __construct($params....) { $this->config = new Config(); // These vars might be passed in the constructor, or c...
[ 0.028698094189167023, -0.07895677536725998, 0.27335721254348755, -0.21325962245464325, -0.21321195363998413, 0.22625356912612915, 0.21064811944961548, -0.4395633935928345, -0.030020805075764656, -0.46368607878685, -0.17901316285133362, 0.5017313361167908, -0.7748609781265259, 0.37639966607...
I have two entities: ``` Parent { Child[] children; } and Child { Parent parent; } ``` I'm aware about `@JsonBackReference` and `@JsonManagedReference`. They are good, if I'm serializing instances of `Parent`. But I also need to transfer instances of `Child` and I want to have the `parent` field populated....
[ -0.08808980882167816, 0.10806451737880707, -0.08326373249292374, 0.1621660590171814, 0.3087768852710724, 0.3859539330005646, -0.10123790800571442, -0.12057112902402878, -0.014768111519515514, -0.9134427905082703, 0.0307216327637434, 0.22831690311431885, 0.02089519239962101, 0.6126146316528...
I.e. skip serialization of entities which were already serialized instead of marking fields eligible or non-eligible for serialization. Jackson 2.0 does support full cyclic object references. See "[Jackson 2.0 released](http://www.cowtowncoder.com/blog/archives/2012/03/entry_466.html)" (section 'Handle Any Object Graph...
[ -0.09311574697494507, 0.07967737317085266, 0.27034005522727966, 0.03859613463282585, -0.10368892550468445, 0.06652311980724335, 0.2628319561481476, -0.22990497946739197, -0.4098421335220337, -0.19060766696929932, -0.19982114434242249, 0.15919896960258484, -0.5018754601478577, 0.22585771977...
I can't get my subscription to update with my product and also duplicate the attributes of the product to the same fields as my subscription table. My associations are, `subscriptions` and `products` belong to a `User` but a `Product` has many `subscriptions`. **Subscription.rb** ``` class Subscription belongs_to ...
[ 0.28302133083343506, 0.28805291652679443, 0.4509779214859009, -0.012609935365617275, -0.14718249440193176, -0.010542686097323895, -0.047775957733392715, -0.23341690003871918, -0.04761338233947754, -0.7083826065063477, 0.11827899515628815, 0.47376328706741333, -0.3142918050289154, 0.6586425...
t.string :name t.decimal :price t.integer :user_id end create_table :subscriptions do |t| t.string :name t.decimal :price t.integer :subscriber_id # same as user_id t.integer :subscribable_id t.string :subscribable_type end ``` **ProductsController** ``` def edit @product = Product.find(p...
[ 0.20462845265865326, -0.017061447724699974, 0.9306017160415649, -0.03239094465970993, -0.0971425250172615, 0.2069116085767746, -0.25585609674453735, -0.6308774352073669, -0.19102822244167328, -0.6136466264724731, -0.391586035490036, 0.4661499261856079, -0.32661935687065125, 0.2511779963970...
subscription = Subscription.find_by_subscribable_id_and_subscribable_type(subscribable_id, subscribable_type) self.subscription.update_attributes(params[:subscription]).select{ |key, _| Subscription.attribute_names.include? key }) end end end ``` What the `after_update` is suppose to do is: 1. Check if...
[ 0.3537955582141876, -0.014774123206734657, 0.6428809762001038, 0.23624081909656525, -0.3461124897003174, -0.308470755815506, -0.14162977039813995, -0.1377456933259964, -0.27009645104408264, -0.620647132396698, -0.07161127030849457, 0.6107378005981445, -0.17349767684936523, 0.36576679348945...
your observer is wrong. `self` is not your product in an observer. Instead you should use `product` (the given parameter) instead. Secondly your lookup of the subscriptions seems wrong too. You are using `subscribable_id` and `subscribable_type` which are not defined and thus just `nil`. I think you want to use `produ...
[ 0.5741173028945923, 0.0907854437828064, 0.35222703218460083, 0.2567879557609558, -0.2563552260398865, 0.10848229378461838, -0.25552964210510254, -0.0973779708147049, -0.1460341513156891, -0.5202690362930298, 0.363385409116745, 0.7376942038536072, -0.43826109170913696, 0.48254191875457764, ...
do |t| t.string :name t.decimal :price t.integer :user_id end create_table :subscriptions do |t| t.integer :subscriber_id # same as user_id t.integer :subscribable_id t.string :subscribable_type end ``` and inside your subscription model do ``` class Subscription belongs_to :subscriber, :class...
[ 0.28521081805229187, -0.0724780485033989, 0.5746247172355652, 0.12064173817634583, 0.002222952200099826, -0.002715847222134471, -0.2567557692527771, -0.41939324140548706, -0.21194708347320557, -0.5001599192619324, -0.18108750879764557, 0.49486875534057617, -0.18890808522701263, 0.223826006...
I'm looking for some resources on taking an existing monolithic Rails 3.0 application (35K LOC) and breaking it apart into an SOA design. Any books, blogs, screencasts, or example applications would be awesome. The main questions I'm looking to answer are: * Is SOA even the right design? * Where do I start? * What a...
[ 0.16023626923561096, 0.019602784886956215, -0.10209313780069351, 0.023312440142035484, 0.010617046616971493, -0.005371690262109041, 0.21531380712985992, -0.06430321931838989, -0.15141330659389496, -0.7937777638435364, -0.06028154492378235, 0.22540834546089172, 0.07697603106498718, -0.10691...
sure if this book is still relevant) * [SOA Design Patterns](https://rads.stackoverflow.com/amzn/click/com/0136135161) (maybe too "enterprisey"?) > Is SOA even the right design? It depends. Don't you hate these kinds of answers? Breaking up your app to loosely coupled services using messaging or API calls would, by de...
[ 0.13539937138557434, -0.17582425475120544, 0.10663768649101257, 0.16905933618545532, -0.008047799579799175, -0.24920685589313507, 0.5912373661994934, -0.13029344379901886, -0.4233761727809906, -0.3308953642845154, -0.3177698850631714, 0.28758832812309265, -0.42035868763923645, -0.020457806...
role-based sessions. The dilemma, from my experience, is whether to implement synchronous or asynchronous calls. Synchronous calls are obviously easier to program, but may leave your user hanging while they are being executed, and you'd have to handle timeouts for long-running queries. Watch out for database and web s...
[ 0.03926701098680496, -0.3653852641582489, 0.06679698824882507, 0.2498997300863266, -0.18517901003360748, -0.0373215414583683, 0.35278549790382385, -0.1729283183813095, -0.13532689213752747, -0.6528895497322083, 0.07061894237995148, 0.7917051911354065, -0.23478148877620697, -0.4200169742107...
do I start? I'd first see if it's "worth it": after all, SOA is cool, but does introduce multiple points of failure that you do not have currently. If you think your broken up app will result in discrete services that are HA and will serve other projects, I'd start with "the druby book" and "service oriented" as you m...
[ 0.4023302495479584, 0.22788530588150024, 0.19785670936107635, 0.2460647076368332, 0.01136697456240654, -0.1389082968235016, 0.17905616760253906, 0.059291496872901917, -0.21226565539836884, -0.4904806911945343, -0.015529380179941654, 0.5256802439689636, 0.2095395028591156, 0.260379999876022...
call A and it calls B and B calls C and C fails. Who knows that C failed? How will you tell B and A to roll back? Can they? Do they save state? Tough questions for upfront design. One other issue is that life gets complicated when you throw a workflow on top of your SOA: who's the keeper of the business process? Cent...
[ 0.20164285600185394, 0.009525859728455544, 0.24648723006248474, -0.0643058717250824, -0.025412987917661667, 0.05039611831307411, 0.28024622797966003, -0.0772988423705101, -0.5212827324867249, -0.38603106141090393, -0.025784380733966827, 0.5090261697769165, 0.01808006688952446, 0.2145888656...