text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
ok ,fuera } else { throw null; } } catch (Exception e) { // TODO Auto-generated catch block // Log.d("Error",e.getMessage()); httpClient.getConnectionManager().shutdown(); return null; } } ``` Try to add [`Accept-Language`](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) request header. In .NET
[ -0.020814530551433563, -0.2254289984703064, 0.1548154205083847, -0.18983839452266693, -0.039305079728364944, -0.26306241750717163, 0.41746315360069275, -0.31856638193130493, -0.023038482293486595, -0.25017663836479187, -0.5674512386322021, 0.5322846174240112, -0.38080522418022156, 0.081397...
you could use [`HttpRequestHeader.ContentLanguage`](http://msdn.microsoft.com/en-us/library/yfb6df42%28v=vs.100%29.aspx) like this: ``` request.Headers[HttpRequestHeader.AcceptLanguage] = "tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4"; ```
[ 0.011699212715029716, -0.17010724544525146, 0.5992757081985474, 0.4310438632965088, -0.0873665139079094, -0.17283748090267181, 0.05075661838054657, -0.022371860221028328, -0.2132183313369751, -0.6722986102104187, -0.4323312044143677, 0.3571247160434723, -0.1315091848373413, 0.2721139788627...
A toy example but still frustrating: ``` numberMapper:: IO () numberMapper = do codes <- forM [1 .. 4] (\num -> do putStrLn $ "Enter a code for " ++ show num code <- getLine return code)
[ 0.3100625276565552, -0.10899174213409424, 0.21486406028270721, -0.01140621304512024, 0.24010005593299866, 0.14004762470722198, 0.09225775301456451, -0.10264478623867035, -0.1494539976119995, -0.5276556611061096, 0.015308026224374771, 0.31044653058052063, -0.17018385231494904, 0.20202897489...
let numberCodes = zip [1 .. 4] codes in forM numberCodes (\(num,code) -> putStrLn $ "Got code " ++ show code ++ " for " ++ show num) ``` `ghci` tells me I have a `Parse error in pattern: putStrLn` and I can't figure out why it should fail to parse. Correction: ``` numberMapper:: IO
[ 0.2469891607761383, 0.07293150573968887, 0.2295045554637909, -0.0813855528831482, 0.19076158106327057, 0.05651453882455826, 0.19294914603233337, -0.3705556392669678, -0.21010835468769073, -0.6334890127182007, -0.20873726904392242, 0.10004297643899918, -0.36235514283180237, 0.09353104233741...
() numberMapper = do codes <- forM [1 .. 4] $ \num -> do putStrLn $ "Enter a code for " ++ show num getLine let numberCodes = zip [1 .. 4] codes forM_ numberCodes $ \(num,code) -> putStrLn $ "Got code " ++ show code ++ " for " ++ show num ``` **Fix:** The lines inside a `do` block should line up. ``` -- wrong a = do codes <- something
[ 0.16141077876091003, -0.16348367929458618, 0.565788209438324, -0.19598150253295898, 0.08198538422584534, 0.15628187358379364, 0.3055824041366577, -0.40765780210494995, -0.27863627672195435, -0.553921103477478, -0.3979142904281616, -0.048280276358127594, -0.2843628227710724, -0.017304746434...
let numberCodes = zip [1..4] codes -- right a = do codes <- something let numberCodes = zip [1..4] codes ``` **Fix 2:** When using `let` inside a `do` block, don't use `in`. ``` -- wrong func = do let x = 17 in print x -- right func = do let x = 17 print x ``` **Fix 3:** Use `forM_` (which returns `()`, a.k.a. void) instead of `forM` (which returns a list). ``` codes <- forM [1..4] func... -- returns a list forM_ numberCodes $ ...
[ 0.2937649190425873, 0.17106805741786957, 0.3954457938671112, -0.27965429425239563, -0.059440501034259796, -0.020457452163100243, 0.21584610641002655, -0.7755094170570374, -0.17555764317512512, -0.3222774863243103, -0.44024544954299927, 0.37244749069213867, -0.44825273752212524, -0.23614417...
-- discards list, returns () ``` So `forM_` could (almost) be written like this: ``` forM_ xs f = do forM xs f return () ``` **Minor change:** You don't need `return` here: ``` do func1 x <- func2 return x ``` You can change it to the equivalent, ``` do func1 func2 -- value of func2 is returned ```
[ -0.14572371542453766, -0.05613161623477936, 0.42466962337493896, -0.21827808022499084, -0.21583078801631927, -0.23527875542640686, 0.026357147842645645, -0.12632758915424347, -0.11185272783041, -0.35903283953666687, -0.3197452425956726, 0.6974996328353882, -0.4255829155445099, -0.188251703...
I have file: * `String0.ml` extracted from `String.v` (It is from Coq library) * `String.ml` : is a string library of Ocaml After extracted my test file from Coq to Ocaml, I want to used `String.ml` in the library of Ocaml, so I write an replace command to replace all `String0` to `String`. The problem is in the file `test.v`, I used one of the definition: ``` Definition beq_string := beq_dec string_dec. ``` function `string_dec` is not occur in the library of Ocaml, but it has in the string library of Coq So I have an error when I compile `test.ml` ``` open String let beq_string = beq_dec string_dec ``` **Error: Unbound
[ 0.17729221284389496, 0.2924162447452545, 0.2525984048843384, -0.22060266137123108, -0.005551144015043974, -0.04387427866458893, 0.13140693306922913, -0.21508556604385376, -0.014853163622319698, -0.7094428539276123, 0.1975284218788147, 0.5613435506820679, -0.3219571113586426, 0.162041768431...
value string\_dec** I want to used the string library of Ocaml for all my extraction files. How can I able to compile `string_dec` ? Extract the `string_dec` function as well. If you're willing to trust the OCaml library a little, you'll get a lot better performance by extracting `beq_string` to use the built-in equality on strings: ``` Extract Constant beq_string => "((=) : string->string->bool)". ```
[ -0.035986460745334625, 0.26568567752838135, 0.358189195394516, -0.19849248230457306, 0.010265224613249302, 0.24313266575336456, -0.03024939075112343, -0.19857269525527954, -0.027825091034173965, -0.39454230666160583, 0.10589737445116043, 0.7869841456413269, -0.17969700694084167, -0.0143878...
I´m working on a Java RMI topic and need some information about the connection pooling on the client side. In the literature and the documentation there are no clear answers to these topics. I know that connection pooling is not a part of the RMI specification. But in some implementations (e.g. in SUN´s implementation) it is done. So my questions refer to this implementation. I suppose that the socket (java.net.Socket) which is created by the RMI socket factory is cached in the pool. Is that correct? How are these connections saved? I would except that a HashMap is used with the destination
[ 0.27833062410354614, 0.18774773180484772, -0.032036229968070984, -0.16852538287639618, -0.08987055718898773, -0.2605329155921936, 0.055913910269737244, -0.20214463770389557, -0.2468424290418625, -0.7211471199989319, 0.2827603220939636, 0.3623932898044586, -0.16347858309745789, 0.0876766964...
ip/port as key and the socket as value. Sockets are closed by using a timeout. How is the information on the connection idle time gained? Possibly there is some kind of timestamp when the connection is used the last time. Bearing in mind that I am talking about the Sun implementation only: > I suppose that the socket (java.net.Socket) which is created by the > RMI socket factory is cached in the pool. Is that correct? Yes, after it is released from the remote call, and of course the remote call looks in the pool first before it asks the socket factory to create
[ 0.048031531274318695, 0.08330050855875015, 0.10715775936841965, -0.04106491431593895, 0.059780560433864594, -0.1954420804977417, 0.012559400871396065, 0.030347710475325584, -0.28450122475624084, -0.572460412979126, -0.14383244514465332, 0.42244255542755127, -0.18680472671985626, 0.38653445...
a new Socket. > How are these connections saved? I would except that a HashMap is used > with the destination ip/port as key and the socket as value. Let's just say there must logically be a Map from ip:port to Socket. The implementation details aren't actually important. > Sockets are closed by using a timeout. How is the information on the > connection idle time gained? By noting the time when the connection was put into the pool.
[ 0.09444557130336761, -0.18750311434268951, 0.4756251573562622, 0.15848372876644135, -0.01870783418416977, -0.09387065470218658, -0.025626441463828087, -0.004251099657267332, -0.4084891080856323, -0.8207864761352539, -0.0357435867190361, 0.5427007079124451, -0.0835716500878334, 0.4424146115...
Consider the following code: ``` class ExtType extends MyType{}; class MyClass { MyType myField; public <T extends MyType> T foo(Class<T> clazz) { return (T)myField; } } ``` Now I want to call `foo` method, I can do this two ways: 1 way: ``` (new MyClass()).foo(ExtType.class); ``` 2 way: ``` (new MyClass()).<ExtType>foo(ExtType.class); ``` Interesting, that even the method is declared as parametrized, Eclipse doesn't issue any warning on 1 call. Here is my question, in first code snippet, which of `T`s is used in casting return value. Is it a `T` from parameter or `T` from return value? Why if I don't
[ 0.34765446186065674, -0.1594059020280838, 0.45267269015312195, -0.1837143450975418, -0.24813269078731537, -0.09143542498350143, 0.16013342142105103, -0.3242073357105255, 0.054744135588407516, -0.4703643321990967, 0.1747668981552124, 0.7618672847747803, -0.5240012407302856, 0.19204391539096...
explicitly specify return type (as in "1 way") no warning is issued? Normally the parameter type is used but if there is a return type defined (like in way 2) the compiler would check that as well. The return type declaration would be necessary if there's no parameter to get the type of `T` from, which then is called type inference. Thus you could even write: ``` public <T extends MyType> T foo() { return (T)myField; } ExtType t = (new MyClass()).foo(); ``` In some cases you need to help the compiler and specify the type to be used thus getting code like `(new
[ 0.5685848593711853, -0.21644465625286102, 0.2761640250682831, -0.16004948318004608, -0.004317133687436581, -0.3039323091506958, 0.29323050379753113, -0.28806227445602417, 0.22517018020153046, -0.5071026086807251, -0.058985643088817596, 0.824476957321167, -0.590248167514801, 0.0576239600777...
MyClass()).<ExtType>foo(ExtType.class);`. Note, however, that if you'd define different types, e.g. `(new MyClass()).<MyType>foo(ExtType.class);`, you'd get a compile time error, since the compiler now doesn't know which one is used.
[ 0.30654749274253845, -0.1460517793893814, 0.46880602836608887, -0.17562948167324066, -0.007308327127248049, -0.18579566478729248, 0.5236582159996033, -0.025643568485975266, 0.0085903936997056, -0.6783392429351807, -0.09313993901014328, 0.6517088413238525, -0.6338235139846802, 0.29553806781...
For an XSLT template, I need an XPath expression targeting elements which have a specific child element, but no text nodes. ```xml <!-- 1: matches --> <a><b/></a> <!-- 2: does not match --> <a>foo bar quux<b/></a> <!-- 3: does not match --> <a>whatever <b/> further text</a> <!-- 4: does not match --> <a>whatever <b/> further text <b/></a> <!-- 5: does not match --> <a><x/><b/></a> <!-- 6: does not match --> <a>foo bar quux</a> ``` I came up with `a[*[1 = last() and name() = 'b']]`, but then case 2 or 3 are matched when they should not. The reason, of course, is that the `*` selects elements and does not care about text nodes.
[ -0.10250435024499893, 0.2090056836605072, 0.5174011588096619, -0.15295763313770294, -0.005128716584295034, 0.055025260895490646, 0.1335110068321228, -0.5120894312858582, 0.381274938583374, -0.7015215754508972, -0.18817345798015594, 0.49445971846580505, -0.70185786485672, -0.126846760511398...
So how do I do this instead? ``` a[b and not(text() or *[2])] ``` This selects every `a` child of the current node (context node) that has a `b` child, and doesn't have any text node children or a second element child. If you also don't want to have any PI or comment children, you can use a shorter version: ``` a[b and not(node()[2])] ```
[ 0.0014017694629728794, 0.010563666000962257, -0.03166287764906883, -0.1044728234410286, 0.1687135547399521, 0.13781976699829102, 0.06805826723575592, -0.2809167206287384, 0.019073881208896637, -0.5024283528327942, -0.24648168683052063, 0.2994752526283264, -0.2771892249584198, -0.0596640184...
I am facing one problem in my application, when i checked settings --> Display --> Auto-rotate screen and run my application in which all activities will display in landscape mode, so when i launch one acivity from other activity and rotate the device in vertical form and comes back to the previous activity upon click on button, in buton click event i am finish the activity which will bring previous activity on top,but it looses all its previuos configured data but when i unchecked device's Auto-rotate screen option it keeps the previous state of activity. so not sure , why this
[ 0.15242134034633636, -0.3124952018260956, 0.7767927646636963, 0.09609846025705338, -0.010692999698221684, 0.006775430869311094, 0.4005189836025238, 0.17199666798114777, -0.591047465801239, -0.5003718137741089, 0.047109078615903854, 0.6793937683105469, -0.30990615487098694, -0.0962794646620...
behavior occurs? Please help me to resolve it. Regards, Piks Set `android:configChanges="orientation|screenSize"` to all your activities in **AndroidManifest.xml** to override the orientation change manually
[ -0.037504736334085464, -0.044935762882232666, 0.43837428092956543, 0.1463925838470459, 0.22523756325244904, -0.18355536460876465, 0.7653271555900574, 0.01460785698145628, -0.3735486567020416, -0.49798065423965454, -0.07136262953281403, 0.6533913612365723, -0.3714899718761444, -0.1097007319...
I'm running a powershell file which are going to gather information an save it to an XML-file. This script will run on several computers, and so I want to save them all to a rootpath. The question is, how do I save an XML-file to root on a computer? To specify: The script will always run on a local computer, hence I need to save the xml file to a local path.. That's because the second passes a `__main__.ClassA`, whereas `ClassB` expects a `ClassA.ClassA`. Find a different way of doing this, such as putting `ClassA` in its own module.
[ 0.032216303050518036, -0.13490091264247894, -0.03179321065545082, -0.014186247251927853, 0.045242421329021454, -0.08549129217863083, 0.347758948802948, 0.22972741723060608, -0.011703445576131344, -0.902518093585968, 0.12955589592456818, 0.2654326260089874, -0.21466121077537537, 0.335909277...
I've some class with these methods: ``` public class TestClass { public void method1() { // this method will be used for consuming MyClass1 } public void method2() { // this method will be used for consuming MyClass2 } } ``` and classes: ``` public class MyClass1 { } public class MyClass2 { } ``` and I want `HashMap<Class<?>, "question">` where I would store (key: class, value: method) pairs like this ( class "type" is associated with method ) ``` hashmp.add(Myclass1.class, "question"); ``` and I want to
[ 0.3201511800289154, 0.0941825807094574, 0.19395887851715088, -0.03653854504227638, 0.07359306514263153, -0.022541169077157974, 0.07219429314136505, -0.03441501408815384, 0.06922552734613419, -0.6539047956466675, 0.11598772555589676, 0.5718457102775574, -0.16383740305900574, 0.1275202780961...
know how to add method references to HashMap (replace "question"). p.s. I've come from C# where I simply write `Dictionary<Type, Action>` :) This is feature which is likely to be Java 8. For now the simplest way to do this is to use reflection. ``` public class TestClass { public void method(MyClass1 o) { // this method will be used for consuming MyClass1 } public void method(MyClass2 o) { // this method will be used for consuming MyClass2
[ 0.3502562940120697, 0.06300200521945953, 0.3132757246494293, 0.058272283524274826, 0.18372417986392975, -0.510109543800354, 0.43349674344062805, -0.07484693080186844, 0.1344430297613144, -0.8487105965614319, 0.3807651996612549, 0.6152468323707581, -0.15779106318950653, -0.04707495868206024...
} } ``` and call it using ``` Method m = TestClass.class.getMethod("method", type); ```
[ 0.19705858826637268, -0.012529808096587658, -0.00036871148040518165, -0.04314589500427246, 0.34113723039627075, -0.17073427140712738, 0.4656023681163788, -0.32113024592399597, 0.16636769473552704, -0.41899463534355164, -0.2801957130432129, 0.5609197616577148, -0.390922486782074, 0.19941510...
I have been reading that the overheads of encryption in HTTP protocol is negligible. Is the same true for SMTP too ? If I send a mail encrypted will the bandwidth consumption be any significantly larger ? I did a research project on this a few years ago. 1700 data points changing every parameter we could think of, including SSL vs plaintext. We discovered, rather to my surprise, that over practical Internet links SSL was 33% as fast as plaintext. I expected it to me much slower.
[ 0.039498623460531235, -0.21726782619953156, 0.4156147539615631, 0.05521758645772934, -0.48787441849708557, -0.03456782177090645, 0.4989655911922455, 0.12123357504606247, -0.5119940042495728, -0.9121637344360352, 0.15155300498008728, 0.14383527636528015, -0.3275139629840851, 0.3253551125526...
I am working on Android ICS contacts porting. I want to add a contextual menu for starred(favorites) TAB, but the ListView in that Fragment is very special. There is a normal ListView, and Every item in ListView has two small customized View. I want to implement that when the user press the small view for a longer time, it will show a contextual menu for me. How do I do? Please give me a hint! thanks very much! Define the element as an inline block and you can control the width and height like a block element while keeping it inline with
[ 0.42394551634788513, -0.09204459190368652, 0.5190644264221191, 0.16912823915481567, -0.13135237991809845, 0.17983655631542206, 0.19043339788913727, -0.2929648160934448, -0.06973847001791, -0.790238082408905, 0.2824150025844574, 0.5241844654083252, -0.05997723713517189, 0.047145307064056396...
surrounding content. ``` #element { display: inline-block; width: 50%; } ```
[ -0.057387541979551315, 0.29834723472595215, 0.6458442807197571, -0.012555956840515137, -0.07134441286325455, 0.0692729577422142, 0.09192638844251633, 0.005484466906636953, -0.034410759806632996, -0.6536130309104919, -0.47279179096221924, 0.48702284693717957, -0.26669347286224365, -0.035701...
i have two files, `utility.h` and `utility.cpp`. i declare a struct `BoundingSphere` in the .h file ``` struct BoundingSphere { BoundingSphere(); D3DXVECTOR3 _center; float _radius; }; BoundingSphere::BoundingSphere() { _radius = 0; } ``` if i put the `BoundingSphere::BoundingSphere()` implementation into the .h file, i get a link error, error LNK2005: "public: \_\_thiscall BoundingSphere::BoundingSphere(void)" already defined in bounding.obj but, if i put the implementation into .cpp file, it works ok. my question is that how it could happen? This happens because your first code example breaks the **[One Definition Rule](http://en.wikipedia.org/wiki/One_Definition_Rule)**. When you include the definition in the header file the
[ 0.23116028308868408, -0.12298095971345901, 0.5395137071609497, 0.08828651160001755, 0.019920822232961655, -0.2717905640602112, 0.16180771589279175, -0.1346498429775238, -0.16776591539382935, -0.9690797924995422, -0.1284126192331314, 0.28973767161369324, -0.43175801634788513, 0.322643637657...
precompiler merely copy pastes the content of the header in every translation unit where you include the header. What you end up with is multiple definitions of the same function, this breaks the One Definition rule and hence the linker error. If you need to add definitions in the header file then you need to mark the function as `inline`. Though you should note that request to `inline` a function is merely a suggestion to the compiler and it is free to accept or reject it.
[ 0.6130290627479553, 0.05694901570677757, 0.12587763369083405, 0.09429902583360672, -0.22286802530288696, -0.19839511811733246, 0.34240689873695374, 0.00993391964584589, 0.22121958434581757, -0.66623455286026, 0.023607032373547554, 0.7044581174850464, -0.6158855557441711, 0.1143424212932586...
If you use [*string*`.split()`](http://docs.python.org/library/stdtypes.html#str.split) on a Python string, it returns a list of strings. These substrings that have been split-out are copies of their part of the parent string. Is it possible to instead get some cheaper slice object that holds only a reference, offset and length to the bits split out? And is it possible to have some 'string view' to extract and treat these sub-strings as if they are strings yet without making a copy of their bytes? (I ask as I have very large strings I want to slice and am running out of memory occasionally; removing the copies would
[ 0.4750421941280365, -0.16219530999660492, 0.02877379022538662, 0.052062708884477615, -0.1542728990316391, 0.009849227033555508, -0.09185124933719635, -0.1278693825006485, -0.34982767701148987, -0.515142560005188, -0.2402947098016739, 0.39630618691444397, -0.18121764063835144, 0.16936269402...
be a cheap profile-guided win.) `buffer` will give you a read-only view on a string. ``` >>> s = 'abcdefghijklmnopqrstuvwxyz' >>> b = buffer(s, 2, 10) >>> b <read-only buffer for 0x7f935ee75d70, size 10, offset 2 at 0x7f935ee5a8f0> >>> b[:] 'cdefghijkl' ```
[ -0.2579391598701477, -0.27106690406799316, 0.4385835826396942, -0.049175407737493515, 0.051746100187301636, 0.07772644609212875, 0.24121397733688354, -0.4441877603530884, 0.09830921143293381, -0.5511179566383362, -0.10669882595539093, 0.7725527286529541, -0.2749592661857605, -0.36313518881...
Let's say i have html structure like this: How can I make a check something like this with jquery: if **"tab2"** is before **"tab3 Active"** do something... And if **"tab2"** is after **"tab3 Active"** do something else? Thank you guys!!! ``` <html> <head> </head> <body> <ul class="Mytabs"> <li class="tab1"></li> <li class="tab2"></li> <li class="tab3 Active"></li> <li class="tab4"></li> <li class="tab5"></li> </ul> ``` You can use `prev()` and `next()` to check to see where the element is in relation to another. Try this: ``` var $tab = $(".tab2"); if ($tab.prev(".active").length) { // tab2 is after the active tab } else if ($tab.next(".active").length) { // tab2 is
[ 0.11307384818792343, -0.10078149288892746, 0.3752940893173218, -0.1336439996957779, -0.3584299087524414, -0.26276373863220215, 0.18922863900661469, -0.29587283730506897, -0.03839893266558647, -0.6905003190040588, -0.002920278115198016, 0.5193967223167419, -0.3071587383747101, -0.2265991419...
before the active tab } ``` Using this method you an easily change the tab you want to inspect, and it doesn't matter which tab has the `active` class on it.
[ 0.0781082883477211, -0.14304447174072266, 0.4781283140182495, -0.17875359952449799, 0.055072423070669174, -0.2481197565793991, 0.12908807396888733, 0.06055280938744545, -0.2034246027469635, -0.9368699789047241, -0.29729264974594116, 0.7773679494857788, -0.33492279052734375, 0.3323644697666...
According to the developer documentation on Apple's website: <https://developer.apple.com/library/ios/#qa/qa1719/_index.html> > Starting in iOS 5.0.1 a new "do not back up" file attribute has been introduced allowing developers to clearly specify which files should be backed up. (com.apple.MobileBackup) I'm wondering if this is supported in PhoneGap / Cordova, as I want to be able to store some offline data (data that can be downloaded or otherwise recreated, but that the user expects to be reliably available when offline) that is not backed up on iCloud. Persistance is clearly documented (LocalFileSystem.PERSISTENT - <http://docs.phonegap.com/en/1.5.0/phonegap_file_file.md.html#LocalFileSystem>) on the PhoneGap website, but there seems to be no way
[ 0.0796704888343811, -0.02147737517952919, 0.6940065026283264, 0.04813385009765625, 0.1637990027666092, -0.2606108486652374, 0.18287119269371033, 0.029941361397504807, -0.5164895057678223, -0.054221611469984055, -0.40008002519607544, 0.6156663298606873, -0.18351785838603973, 0.2115775197744...
of ensuring a saved file is not backed up to the iCloud. I'm still holding out for a solution within PhoneGap / Cordova but as a temporary work around... In my AppDelegate init: ``` NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); // Get documents directory NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *formularyPath = [documentsDirectory stringByAppendingPathComponent:@"OfflineData"]; if (![[NSFileManager defaultManager] fileExistsAtPath:formularyPath]) [[NSFileManager defaultManager] createDirectoryAtPath:formularyPath withIntermediateDirectories:NO attributes:nil error:nil]; // Prevent iCloud backup u_int8_t b = 1; setxattr([formularyPath fileSystemRepresentation], "com.apple.MobileBackup", &b, 1, 0, 0); ``` Don't forget **#import "sys/xattr.h"** This creates a new folder under documents and sets the no backup attribute. You can then save your files in PhoneGap using the persisted local file store option
[ -0.15046067535877228, -0.1254023313522339, 0.6801707744598389, 0.17835871875286102, 0.48851242661476135, -0.1020280048251152, 0.5658867955207825, -0.10002335906028748, -0.2547745406627655, -0.6441724896430969, -0.32189735770225525, 0.8711557388305664, -0.17356881499290466, -0.0379578433930...
and files saved in your new subdirectory will not be backed up.
[ 0.31800082325935364, 0.11403858661651611, 0.5507667064666748, 0.5366293787956238, 0.5065990686416626, -0.45830920338630676, 0.0902022048830986, 0.17259155213832855, -0.3572404682636261, -0.32015129923820496, -0.43210968375205994, 0.4808200001716614, 0.06457134336233139, 0.13080821931362152...
I have a vector storing the distance to certain reference point along a line. So, I want for example the index where distance is 700 meters or the nearest value to that distance. I have asumed the vector is sorted, and used lower\_bound with success. The problem is that in real life, errors happen, so I can not assure I'm going to have always a sorted vector, because when storaging data the user may not have followed the line for example. How can I find the nearest value then, if data is not sorted? copy your `vector` into an stl `set` and then use
[ -0.02384883165359497, -0.09085409343242645, 0.4701833426952362, 0.16405734419822693, -0.08631680905818939, 0.30715233087539673, 0.1360945701599121, -0.2597753405570984, -0.23434269428253174, -0.7922694087028503, 0.056367743760347366, 0.4650481939315796, -0.18158303201198578, 0.135155022144...
the same logic as you have done for vector for finding the element.
[ -0.17973650991916656, -0.3108474910259247, -0.012138321064412594, 0.17657862603664398, -0.18679991364479065, -0.14433377981185913, -0.10377264767885208, -0.24172410368919373, -0.062206510454416275, -0.5764903426170349, 0.2630000412464142, 0.5998662114143372, -0.15977030992507935, -0.102356...
I am developeing a barcode app. in which captured barcode camera image are decode through ZXing library. so simply i have download jar file and add it as external jar. but my problem is that how can i start use of that class there are no sample code at all. so can you provide me some initial thing so i can easily go through that process. The way to call the ZXing SCAN Intent from your application, like this: ``` public Button.OnClickListener mScan = new Button.OnClickListener() { public void onClick(View v) { Intent
[ 0.5326535701751709, -0.1520041823387146, 1.054427146911621, -0.3043834865093231, -0.0003375129890628159, -0.13517403602600098, 0.07220399379730225, -0.5176690816879272, -0.08008146286010742, -0.4945392906665802, 0.30287688970565796, 0.8706121444702148, -0.4223201870918274, 0.17806732654571...
intent = new Intent("com.google.zxing.client.android.SCAN"); intent.putExtra("SCAN_MODE", "QR_CODE_MODE"); startActivityForResult(intent, 0); } }; public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == 0) { if (resultCode == RESULT_OK) { String contents = intent.getStringExtra("SCAN_RESULT"); String format = intent.getStringExtra("SCAN_RESULT_FORMAT"); // Handle successful scan
[ 0.08864108473062515, -0.37575384974479675, 1.2790619134902954, -0.16826915740966797, 0.21380488574504852, 0.17205499112606049, 0.4747706949710846, -0.628145158290863, 0.03362959623336792, -0.5446611046791077, -0.23702910542488098, 0.6828436255455017, -0.1601785570383072, -0.079341925680637...
} else if (resultCode == RESULT_CANCELED) { // Handle cancel } } } Ref:http://code.google.com/p/zxing/wiki/ScanningViaIntent Sample code:http://as400samplecode.blogspot.in/2011/09/android-barcode-scanner-using-zxing.html ```
[ 0.41208091378211975, 0.08443000167608261, 0.46629616618156433, -0.06722807139158249, 0.04017650708556175, -0.03967339172959328, 0.01375663187354803, -0.6725079417228699, 0.014451373368501663, -0.42008334398269653, -0.12738750874996185, 0.4010428488254547, -0.38564735651016235, 0.0306611210...
I'm trying to implement search in one of my models. I'm using the gem "mongoid\_search" and I'm mixing it with the railscast #240 on search. It seems to be returning an empty array and I can't figure out why. Can anyone point me in the right direction? My model looks like this: ``` include Mongoid::Search attr_accessible :twitterUsername, :twitterName, :twitterLocation, :twitterDescription, :projects def self.search(search) if search search_in :twitterUsername, :twitterName, :twitterLocation, :twitterDescription, :projects else scoped end end ``` My controller: ``` def index @users =
[ -0.04644014313817024, 0.03494114801287651, 0.33100858330726624, 0.11641950905323029, -0.07577697932720184, 0.05025913193821907, 0.28579726815223694, -0.08909591287374496, -0.3709636330604553, -0.8255724906921387, -0.019420446828007698, 0.7365419864654541, -0.31846940517425537, 0.2169661819...
User.search(params[:search]) respond_to do |format| format.html # index.html.erb format.json { render json: @users } end end ``` And my view: ``` <%= form_tag users_path, :method => 'get', :id => "users_search" do %> <p> <%= text_field_tag :search, params[:search] %> <%= submit_tag "Search", :name => nil %> </p> <% end %> ``` UPDATE I define the twitterUsername (sorry for the bad naming convention) in the model as well: ``` field :provider, :type => String field
[ -0.2022598534822464, -0.043694209307432175, 0.7438812851905823, -0.148914635181427, -0.08001253008842468, 0.2405128926038742, 0.06781361252069473, -0.16129256784915924, -0.2611953616142273, -0.881879985332489, -0.00028089177794754505, 0.4997556507587433, -0.45963749289512634, -0.1193781122...
:uid, :type => String field :twitterName, :type => String field :twitterUsername, :type => String field :twitterAvatar, :type => String field :twitterUrl, :type => String field :twitterPortfolioUrl, :type => String field :twitterLocation, :type => String field :twitterDescription, :type => String field :email, :type => String field :description, :type => String field :portfolioUrl, :type => String field :watchers, :type => Integer field :inspirations, :type => Integer field :invitees, :type => Integer field :shot, :type => String field :remote_image_url, :type => String field :hireMe, :type => Boolean field :projects, :type => Integer key :twitterUsername def self.create_with_omniauth(auth) create! do |user| user.provider = auth['provider'] user.uid = auth['uid']
[ 0.4565219283103943, -0.0034537422470748425, 0.4974679946899414, -0.13419336080551147, 0.11255805194377899, 0.06777636706829071, 0.20958295464515686, 0.10760539025068283, 0.013461810536682606, -0.4069633185863495, -0.18463195860385895, 0.4665510058403015, -0.3299846947193146, -0.12640406191...
if auth['info'] user._id = auth['info']['nickname'] || "" user.twitterName = auth['info']['name'] || "" user.twitterUsername = auth['info']['nickname'] || "" user.twitterAvatar = auth['info']['image'] || "" user.twitterUrl = auth['info']['urls']['Twitter'] || ""
[ 0.1451563984155655, 0.14773470163345337, 0.5729652047157288, 0.05112496390938759, 0.10425892472267151, 0.29561957716941833, 0.19305072724819183, -0.08985694497823715, -0.11332527548074722, -0.6105480790138245, -0.2977885901927948, 0.5470728278160095, -0.34835582971572876, -0.05320091918110...
user.twitterPortfolioUrl = auth['info']['urls']['Website'] || "" user.twitterLocation = auth['info']['location'] || "" user.twitterDescription = auth['info']['description'] || "" end end end ``` UPDATE 2 If I count the users, it seems to be returning a single user (which is correct since I'm the only one signed up right now): ``` <% if @users.count > 0 %> <%= @users.count %> <% end %> ``` if I do: ``` <% if @users.count > 0 %> <%= @users.twitterUsername %> <% end %> ``` it gives me
[ 0.27458202838897705, 0.045510027557611465, 0.7558375597000122, -0.1756001114845276, -0.05595661327242851, 0.2172134518623352, 0.35678040981292725, -0.05904985964298248, -0.2146168351173401, -0.9272242784500122, 0.06086587905883789, 0.40007826685905457, -0.4374021291732788, -0.1305362731218...
this error: undefined method `twitterUsername' for User:Class. UPDATE 3 It gives me an error when I try to run tail log/development.log: ``` ± % tail log/development.log
[ 0.035557821393013, 0.052114345133304596, 0.40945327281951904, -0.23126356303691864, -0.05617266893386841, -0.0934680625796318, 0.7309302091598511, 0.2626180648803711, 0.02655314840376377, -0.6007890701293945, 0.3866341710090637, 0.4362576901912689, -0.32175925374031067, 0.18418839573860168...
22: app/views/users/index.html.erb:19:in `block in _app_views_users_index_html_erb__1766206529136141992_2490506940' app/views/users/index.html.erb:18:in `each' app/views/users/index.html.erb:18:in `_app_views_users_index_html_erb__1766206529136141992_2490506940' app/controllers/users_controller.rb:7:in `index' Rendered /Users/holgersindbaek/.rbenv/versions/1.9.3-p125-perf/lib/ruby/gems/1.9.1/gems/actionpack-3.2.2/lib/action_dispatch/middleware/templates/rescues/_trace.erb (5.3ms) Rendered /Users/holgersindbaek/.rbenv/versions/1.9.3-p125-perf/lib/ruby/gems/1.9.1/gems/actionpack-3.2.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.2ms) Rendered /Users/holgersindbaek/.rbenv/versions/1.9.3-p125-perf/lib/ruby/gems/1.9.1/gems/actionpack-3.2.2/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (13.9ms) ``` UPDATE 4 I get this in my console if when I run a search: ``` Started GET "/users?utf8=%E2%9C%93&search=holgersindbaek" for 127.0.0.1 at 2012-04-10 23:24:55 +0200 Processing by UsersController#index as HTML Parameters: {"utf8"=>"✓", "search"=>"holgersindbaek"} MONGODB (1ms) flow04_development['users'].find({:_id=>"holgersindbaek"}).limit(-1).sort([[:_id, :asc]]) Rendered users/index.html.erb within layouts/application (4.7ms) Completed 500 Internal Server Error in 8ms ActionView::Template::Error (undefined method `id' for User:Class): 22:
[ -0.20168344676494598, 0.23896582424640656, 0.9645047783851624, 0.003663394134491682, -0.14049315452575684, 0.4017673134803772, 0.4598073661327362, -0.7273845076560974, -0.6588378548622131, -0.5589610934257507, -0.1165538802742958, 0.446031779050827, -0.25173911452293396, -0.044654898345470...
<% if current_user == user %> 23: 24: <% else %> 25: <% if current_user.follower_of?(user) %> 26: <%= link_to "Unfollow", unfollow_user_path(user), :remote => true, :class=>'unfollow' %> 27: <% else %> 28: <%= link_to "Follow", follow_user_path(user), :remote => true, :class=>'follow' %> app/views/users/index.html.erb:25:in `block in _app_views_users_index_html_erb__83132873031271873_2505118720' app/views/users/index.html.erb:18:in
[ -0.3857477605342865, 0.07571006566286087, 1.2251886129379272, -0.2530543804168701, 0.3177538812160492, 0.25885117053985596, 0.35379186272621155, -0.5579323172569275, -0.21378688514232635, -0.33582526445388794, -0.287238746881485, 0.34017878770828247, -0.5625615119934082, 0.1779821515083313...
`each' app/views/users/index.html.erb:18:in `_app_views_users_index_html_erb__83132873031271873_2505118720' app/controllers/users_controller.rb:7:in `index' ``` insert empty time range works in some cases, but we found it wasn't good enough as it broke when we let the user rewind/fast-forward and change on the time bar. To solve this we added a black video clip when nothing else was showing.
[ 0.24319882690906525, 0.10242802649736404, 0.42183947563171387, 0.011422688141465187, 0.19502276182174683, 0.4454762637615204, 0.22584746778011322, -0.30572274327278137, -0.4080647826194763, -0.40982645750045776, -0.12644410133361816, 0.4963299632072449, -0.30721840262413025, 0.147674337029...
I am trying to create Spring-based solution for running batch of SQL queries on MySQL 5.5 server. By "query" I mean any SQL statement that compiles, so the SQL batch job can contain for example several CREATE TABLE, DELETE and then INSERT statements. I am using [Spring Batch](http://static.springsource.org/spring-batch/) for this purpose. I have `transactionManager` configured as follows. ``` <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> ``` and the `dataSource`: ``` <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
[ 0.002513683633878827, 0.1545744091272354, 0.2596038579940796, -0.3372306227684021, -0.1256686896085739, 0.10021660476922989, 0.04341442137956619, -0.3106338083744049, -0.37225043773651123, -0.33352985978126526, 0.0014354828745126724, 0.3436034023761749, -0.20379960536956787, 0.224388822913...
destroy-method="close"> <property name="driverClassName" value="${batch.jdbc.driver}" /> <property name="url" value="${batch.jdbc.url}" /> <property name="username" value="${batch.jdbc.user}" /> <property name="password" value="${batch.jdbc.password}" /> <property name="maxIdle" value="10" /> <property name="maxActive" value="100" /> <property name="maxWait" value="10000" /> <property name="validationQuery" value="select 1" /> <property name="testOnBorrow" value="false" /> <property name="testWhileIdle" value="true" /> <property name="timeBetweenEvictionRunsMillis" value="1200000" /> <property name="minEvictableIdleTimeMillis" value="1800000" /> <property name="numTestsPerEvictionRun" value="5" /> <property
[ 0.46630385518074036, 0.28764331340789795, -0.11136109381914139, 0.06284353137016296, 0.08616457134485245, 0.0997837483882904, 0.48977363109588623, -0.45217061042785645, 0.18520575761795044, -0.4473724961280823, -0.046377334743738174, 0.7241062521934509, -0.005515499971807003, 0.56770104169...
name="defaultAutoCommit" value="true" /> </bean> ``` My DAO class has the method configured with ``` @Transactional(propagation = Propagation.REQUIRES_NEW) ``` and I loop over a collection of the SQL statements calling the method with single SQL statement a time. The processing inside the method is as simple as: ``` simpleJdbcTemplate.getJdbcOperations().execute(sql); ``` I expected that when the DAO method completes, I would see the results in the DB. However, it seems like only when the Spring job execution completes the results become available in the DB. I tried to do the commit inside my DAO method: ``` @Transactional(propagation = Propagation.REQUIRES_NEW) private void executeSingleQuery(String sql) { PlatformTransactionManager transactionManager = (PlatformTransactionManager)context.getBean("transactionManager"); DefaultTransactionDefinition def = new
[ 0.014720520004630089, 0.14007507264614105, 0.4452414810657501, -0.2587728798389435, 0.06445401906967163, -0.04787757247686386, 0.38050612807273865, -0.43521133065223694, -0.1056838184595108, -0.44784843921661377, -0.20343920588493347, 0.6544030904769897, -0.21329690515995026, 0.18910320103...
DefaultTransactionDefinition(); def.setPropagationBehavior(Propagation.REQUIRED.ordinal()); TransactionStatus status = transactionManager.getTransaction(def); try { // execute your business logic here log.info("about to execute SQL query[" + sql + "]"); simpleJdbcTemplate.getJdbcOperations().execute(sql); } catch (Exception e) { log.info("SQL query was not committed due to exception and was marked for rollback"); transactionManager.rollback(status); } transactionManager.commit(status);
[ -0.10502269119024277, -0.2746877074241638, 0.40274688601493835, -0.19589699804782867, 0.38781413435935974, 0.031568583101034164, 0.3996635377407074, -0.32976505160331726, -0.39586976170539856, -0.1937011480331421, -0.30550915002822876, 0.7585119009017944, -0.40909135341644287, -0.034593719...
if (transactionManager.getTransaction(null).isRollbackOnly() && transactionManager.getTransaction(null).isCompleted()) { log.info("SQL query commited!"); } else { log.info("SQL query was not committed due to: 1) the transaction has been marked for rollback " + "2) the transaction has not completed for some reason"); } log.info("the query has completed"); } ``` I debugged the Spring code and
[ -0.15285724401474, -0.030229076743125916, 0.31100893020629883, -0.020083677023649216, 0.295591801404953, -0.12682154774665833, 0.1467011272907257, -0.32595133781433105, -0.5284774303436279, -0.005053948611021042, -0.2166801393032074, 0.517859935760498, -0.2997502088546753, 0.32727062702178...
saw that the commit I call from my DAO method is executed by TransactionTemplate (the flow reaches the line `this.transactionManager.commit(status);` and passes without exceptions) I would appreciate any advice what should be done in order to make the DAO method to commit on every call (commit after every SQL statement it executes). You cannot proxy private methods. i.e. The @Transactional you have here has no effect. Pull the method to your parent interface and it should work. Unless you have the proxyTargetClass setting enabled which is not recommended.
[ 0.031803566962480545, -0.1297050416469574, 0.2833526134490967, -0.08463601022958755, -0.06035097315907478, -0.3799368739128113, 0.3098980188369751, 0.07450215518474579, -0.16004490852355957, -0.6369495987892151, -0.1234787181019783, 0.8117385506629944, -0.24339903891086578, 0.3369340002536...
I am really new to database and this is my first program in database using java Netbeans 7.1 --- It is summer on our country now and I am a student with the course I.T. Our next subject on programming is about database and since there's no class I spend my time learning database for preparation for the next school semester and I refer to this site as my guide for the first database program I currently making now. <http://www.homeandlearn.co.uk/java/databases_and_java_forms.html> I did everything in the tutorial and I actually done doing the program. The final thing I did is I clean and
[ 0.7627209424972534, 0.34245961904525757, 0.09611286222934723, -0.18132218718528748, 0.05989788472652435, -0.39981409907341003, 0.3876135051250458, 0.15648670494556427, -0.3020244836807251, -0.7185428142547607, 0.2965858578681946, 0.16149629652500153, 0.21472328901290894, 0.1828205287456512...
build the program since I want the program to run with out opening the netbeans again I downloaded the JRE and make my database\_form.jar as a jar executable. "database\_form" the name of my Netbeans Project. I do that by making javaw in JRE.7 as my dafault when opening any jar files. Anyway, this is how i run the program. 1. Running Program in Netbeans IDE Using Netbeans, before my program works I first need to "Start Server" on JavaDB. because if I didn't do that an Exception occurred "Err. connecting to server localhost 1527 and so on" 1. Running Program using jar
[ 0.2797805964946747, 0.08615703880786896, 0.1763632446527481, -0.2953979969024658, -0.24820265173912048, -0.1616615355014801, 0.2968522608280182, -0.10513415187597275, -0.01641242206096649, -0.867962121963501, 0.2236068695783615, 0.5773892998695374, -0.14126388728618622, 0.2800671458244324,...
executable alone. The Problem is there's an Exception and Err in connecting still occurred. What I want to achieve? I want the program to run without opening the Netbeans IDE and going to Java DB to click the "Start Server", I dont want to do that anymore. Or my second option is to start the server using command prompt so that I just have to make a bat file so that whenever I open my program database\_form.jar I just place the bat file on my desktop and run it. Second Problem! Actually, I already try my second option by using command prompt to start
[ 0.15802039206027985, -0.017518818378448486, 0.22958408296108246, -0.040470462292432785, -0.4161856770515442, -0.10177017003297806, 0.4331248998641968, 0.07161740213632584, -0.0030655008740723133, -0.9589863419532776, 0.07604052126407623, 0.6925451755523682, -0.40612664818763733, 0.16407610...
the server but I forgot how I did it, I just found it on some website the only thing I remember is the Exception says "Failed to lunch the server because the database Employees is missing. Employees is the name of my created database. The O.S. I am using is Windows 7. Thank you for all the reply and sorry for the long text I just want to be specific, :D Right, from your description there seems to be a couple of things you are confusing. First, databases are typically run as servers with multiple clients connecting to them thus allowing they contain to
[ 0.14889709651470184, 0.19798457622528076, 0.4039567708969116, 0.19627512991428375, 0.3068191707134247, -0.2606407701969147, 0.17192022502422333, 0.3279466927051544, -0.49185264110565186, -0.6234123110771179, 0.11033038049936295, 0.3597103953361511, -0.22849927842617035, 0.3109499216079712,...
be shared. When you start Java DB you are starting the Java DB database server. That said, lightweight databases, such as Java DB can be run in an embedded mode as explained [here](https://stackoverflow.com/questions/3810198/using-embedded-javadb). Remember that the directory you point to with the `derby.system.home` property will need to contain the database files, if not you'll need to create that programatically too. Second, there's various ways to run a Java application outside of an IDE, but jars themselves are not executable in the same way an exe file is in Windows. The simplest way is to call the java executable passing the necessary
[ 0.5283132791519165, 0.05611949786543846, 0.09231123328208923, 0.010636433027684689, -0.3160116672515869, -0.324491411447525, 0.14985203742980957, -0.11661895364522934, 0.007106541655957699, -0.7640864253044128, 0.3059304654598236, 0.5478268265724182, -0.3264492452144623, 0.4235335886478424...
classpath and the name of the class containing the main method. For example if I had a class called `com.example.Application` that had been compiled to a directory `C:\dev\example\classes` the following command line would run the application: ``` java -cp C:\dev\example\classes com.example.Application ``` If there were dependencies on external libraries, as there will be in your case on the Derby JDBC driver, then those would also need including in the classpath resulting in something like: ``` java -cp C:\dev\example\classes;C:\dev\lib\derby.jar com.example.Application ``` There's a full set of document on the Java launcher [here](http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html). Now, back to the jar. Like I said, jars are not executable but there is something that's know
[ 0.2264540046453476, 0.19547928869724274, 0.18132953345775604, -0.137155681848526, -0.21006298065185547, 0.03215824067592621, 0.08527318388223648, -0.0365704670548439, -0.042815957218408585, -0.6918317675590515, 0.42891427874565125, 0.6084500551223755, -0.27340206503868103, 0.22581894695758...
as an 'executable jar'. This is the same as any jar except there are some special additions to the manifest to specify the application entry point or main-class and the class-path as described [here](http://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html). Once the main-class and class-path are specified in the jar's manifest, the following command line would run the application: ``` java -jar C:\dev\example.jar ``` You can even associate the jar extension with the java exe and double clicking the jar will cause the application to launch (though on a dev machine it's probably more useful that the jar extension be associated with WinZip or simlar in order to open that
[ 0.08115071803331375, 0.0838509052991867, 0.2591930031776428, -0.2627686858177185, -0.30415594577789307, -0.13672013580799103, 0.340141624212265, -0.05215303227305412, -0.10520168393850327, -0.5348188877105713, -0.4115171432495117, 0.5197063088417053, -0.410449355840683, 0.3915552496910095,...
jar).
[ -0.03789152577519417, 0.6853163242340088, 0.18753598630428314, -0.17778442800045013, -0.13730236887931824, 0.3784097135066986, 0.2806340754032135, -0.34634700417518616, -0.041027069091796875, -0.08891034126281738, -0.16873405873775482, 0.4686181843280792, -0.22143864631652832, 0.7943012118...
Have someone used ExtJs 4 with maven ? As for now, the Sencha SDK tool work only with a deployed and started webapp (it's a java webapp), even in this case the generated app-all.js does not contain all dependencies and Ext download a lot of dep. at runtime. What I need is to somehow integrate the production file generation in the build process. It looks as though you haven't defined a settings object, however it doesn't seem to be in the tutorial either. Personally though I would use AForge.NET library as this provides an extremely easy interface to webcams. <http://aforgenet.com/> Tutorial: <http://vimeo.com/7526663> Thanks
[ 0.29712894558906555, -0.024059565737843513, 0.22490811347961426, 0.21010726690292358, -0.39644530415534973, -0.21845750510692596, 0.3820209205150604, -0.04252377524971962, -0.14493751525878906, -0.6036778092384338, -0.003828379325568676, 0.8062319755554199, -0.1337614208459854, -0.09534606...
I have unit test sample code that basically runs 2 threads: the main test thread and another thread I'm launching that is supposed to fail the test execution after some time (this is basically a timeout thread) Code is as follows: ``` [TestClass] public class SomeTestClass { [TestInitialize] public void BeforeTest() { var task = new Task(abortIfTestStilRunsAfterTimeout); task.Start(); } [TestMethod] public void TestMethod() {
[ 0.6496610045433044, -0.24776485562324524, 0.12865664064884186, -0.004988832399249077, 0.1192769780755043, 0.23161308467388153, 0.37315833568573, -0.4510144889354706, 0.18406347930431366, -0.6909257769584656, 0.18509653210639954, 0.601784884929657, -0.07386365532875061, 0.25805485248565674,...
Thread.Sleep(5000); } private void abortIfTestStilRunsAfterTimeout() { Assert.Fail("timeout passed!"); } } ``` Well, I was expecting that the `TestMethod()` test should fail but what actually happens is that the task thread that runs the `Assert.Fail` method gets an exception while the other thread keeps on running and the test passes. I'm looking for a way to fail the test method You can try and get a reference to the test thread and call `Abort()` on it. You can pass an exception state object to `Abort()` which
[ 0.34416306018829346, -0.05093580111861229, 0.12067633122205734, -0.22451907396316528, 0.3046586513519287, -0.11079651862382889, 0.6166794300079346, -0.21828295290470123, -0.2831871509552002, -0.60127192735672, -0.150550976395607, 0.7525195479393005, -0.35280531644821167, 0.2438054382801056...
you can use to pass a fail message: ``` [TestClass] public class SomeTestClass { Thread testThread; [TestInitialize] public void BeforeTest() { testThread = Thread.CurrentThread; var task = new Task(abortIfTestStilRunsAfterTimeout); task.Start(); } [TestMethod] public void TestMethod() { try {
[ 0.41354942321777344, -0.162847101688385, 0.133384108543396, -0.13700690865516663, 0.2710144817829132, 0.1111454963684082, 0.7303445935249329, -0.21610909700393677, 0.1147371456027031, -0.6320874691009521, -0.11602296680212021, 0.48891112208366394, -0.262673556804657, 0.3119828402996063, ...
Thread.Sleep(5000); } catch (ThreadAbortException e) { Assert.Fail((string)e.ExceptionState); } } private void abortIfTestStilRunsAfterTimeout() { testThread.Abort("timeout passed!"); } } ``` In case you do not want to modify some 100 tests you can use a tool like PostSharp to modify your test
[ 0.387964129447937, -0.21564476191997528, 0.19384543597698212, -0.0853009894490242, 0.3599746525287628, -0.0021105948835611343, 0.5303626656532288, -0.32794347405433655, -0.21772366762161255, -0.5559377074241638, -0.07948227226734161, 0.41625890135765076, -0.26501354575157166, 0.38569852709...
cases by inserting the `try {} catch {}` logic around each test case for you. All it boils down to is to write an attribute and decorate you test assembly with it (it's called Aspect Oriented Programming and the framework in PostSharp for that is called Laos).
[ 0.2846139669418335, -0.018482886254787445, -0.14793719351291656, 0.2683364152908325, 0.017772849649190903, 0.06914931535720825, 0.20354609191417694, 0.12136360257863998, 0.009686642326414585, -0.37167707085609436, -0.09102337807416916, 0.2670387029647827, -0.2626170217990875, -0.3876185417...
Suppose I deploy an Azure role supplying a service package and a service configuration. Then I change the configuration one or more times without redeploying the role. Is it possible to get the initial configuration? You can create table in MySQL workbench using designer interface, If you are looking for alternatives try [HeidiSQL](http://www.heidisql.com/) or [SQLYOG](http://www.webyog.com/en/), for more options [visit this](http://alternativeto.net/software/mysql-workbench/).
[ -0.048357266932725906, -0.48846516013145447, 0.0666205957531929, 0.09484178572893143, -0.06966910511255264, 0.28531867265701294, -0.01923559606075287, -0.20306555926799774, -0.0015880775172263384, -0.9175184369087219, -0.05633266270160675, 0.44052064418792725, -0.22788839042186737, -0.1972...
We use Altova Stylevision which produces XSLT 2.0 files. We use Saxon 9 for Java to execute these XSLT files. This has been working well for a few years, alas none of us actually understand XSLT. Now we have the error: ``` Error at /xsl:stylesheet/xsl:function[9] XPDY0002: Axis step child::element(item, xs:anyType) cannot be used here: the context item is undefined ``` The 9th function is: ``` <xsl:function name="sps:GoogleChartDataSourceUnitCount" as="xs:string"> <xsl:sequence select="concat(string-join(item/string(if ( number($XML/report/calculation-data[@data-source-name = $DataSourceParent]/item/variable[@name=&apos;unit_count&apos;]/@value) &lt; 0 ) then 0 else round-half-to-even(number(variable[@name=&apos;unit_count&apos;]/@value),2)),&apos;,&apos;),&apos;&amp;chxl=0:|&apos;,string-join(item/variable[@name=&apos;month&apos;]/@value,&apos;|&apos;),&apos;|2:||Min&amp;chds=0,&apos;,string(round-half-to-even( max(item/(number(variable[@name=&apos;unit_count&apos;]/@value)))+1 , 0 )),&apos;&amp;chxr=1,0,&apos;,string(round-half-to-even( max(item/(number(variable[@name=&apos;unit_count&apos;]/@value)))+1 , 0 )))"/> </xsl:function> ``` Does anyone have any idea what's going on? The problem is that the function uses path expressions like `item`
[ -0.2525785565376282, -0.1269548535346985, 0.8900524377822876, 0.12788723409175873, 0.12989820539951324, 0.4324183762073517, 0.38085582852363586, -0.25613704323768616, -0.0773148238658905, -0.5219571590423584, -0.15280897915363312, 0.3566170036792755, -0.2288816273212433, 0.0069611989893019...
which need a context item as [the specification mandates](http://www.w3.org/TR/xslt20/#stylesheet-functions) "Within the body of a stylesheet function, the focus is initially undefined; this means that any attempt to reference the context item, context position, or context size is a non-recoverable dynamic error. [XPDY0002]". So the function needs to have a parameter that passes in the node or sequence of nodes to which the path should be applied e.g. ``` <xsl:function name="sps:GoogleChartDataSourceUnitCount" as="xs:string"> <xsl:param name="nodes"/> <xsl:sequence select="concat(string-join($nodes/item/string(...)))"/> </xsl:function> ``` and then needs to be called with e.g. `sps:GoogleChartDataSourceUnitCount(.)`. If the stylesheet is generated by some tool from Altova you might want to enquire in the [Altova
[ -0.11410677433013916, -0.0519656240940094, 0.9643017053604126, 0.006033835932612419, 0.0807981789112091, -0.04076728597283363, 0.028081931173801422, -0.4400347173213959, -0.20446836948394775, -0.5243037343025208, -0.8011620044708252, 0.35635656118392944, -0.3169499933719635, -0.26926609873...
forums](http://www.altova.com/forum/default.aspx) whether this is a known issue and whether a fix is available.
[ -0.18057505786418915, -0.2958194315433502, 0.4812922775745392, 0.015143240801990032, 0.19740885496139526, -0.0888456180691719, -0.04868461191654205, 0.04277752339839935, -0.6026378273963928, -0.09914834797382355, -0.0165523961186409, 0.7202723622322083, 0.028619378805160522, -0.15488691627...
my wordpress .htaccess file look like ``` # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress ``` i want add my owm rewriterule but is not working rule have to rewrite page/([a-z,A-Z]+).html$ to pages?page\_name=$1 Here's how id did it using jquery to set the selected value of the dropdownlist before triggering the postback. ``` $(".myDropDownList").val("sort2"); __doPostBack(uniqueIdOfMyButton,''); ```
[ 0.011486418545246124, 0.17651614546775818, 1.1024805307388306, -0.1290593147277832, 0.0116958012804389, 0.034249648451805115, 0.36660003662109375, -0.4045332968235016, 0.11205846816301346, -0.8154487013816833, 0.020812250673770905, 0.46715980768203735, -0.2669948935508728, 0.09965846687555...
I have the following scala class definition (found in a paper), modeling categories: ``` trait Category[~>[_, _]] { def compose[A, B, C] (f: B ~> C) (g: A ~> B) : A ~> C def id[A]: A ~> A } ``` can someone explain me what the '~>' means in the Category type parameter, and in the methods return type? Or direct me to a resource that explains it... I'm new to Scala (coming from Java), so forgive me if that's something a scala user should have known... Thank
[ 0.10332822054624557, 0.008985089138150215, 0.10672499984502792, -0.2419414073228836, -0.07270326465368271, -0.0549195371568203, 0.09812773019075394, -0.3500978648662567, -0.1859835386276245, -0.47687047719955444, -0.037525150924921036, 0.5313896536827087, -0.31188878417015076, 0.1222093254...
you in advance `~>` is just the placeholder-name for the type-parameter of `Category`. Like the `T` in `class Option[T]`. Additionally, Scala syntax allows you to write `B ~> C` as a shorthand for `~>[B, C]`. Maybe things get clearer, if you rename it: ``` trait Category[Mapping[_, _]] { def compose[A, B, C](f: Mapping[B, C])(g: Mapping[A, B]): Mapping[A, C] def id[A]: Mapping[A, A] } ```
[ 0.20013783872127533, -0.5741872191429138, 0.36890992522239685, -0.13153892755508423, 0.2634997069835663, -0.01818283274769783, -0.19543419778347015, -0.15690037608146667, -0.1790003776550293, -0.5291239619255066, -0.2783662974834442, 0.7112943530082703, -0.019059043377637863, 0.08571086823...
I'm trying to compile a library with a UNIX makefile, but using Visual Studio 2010. I modified the makefile so it should work, but I have trouble with the linker. My compiler options are simple : ``` CSWITCHES = -O2 -I$(INC_DIR) -L$(LIB_DIR) ``` (with INC\_DIR and LIB\_DIR pointing to VC's include and lib directories). I don't have include problems so I assume -I is ok, but the -L option is ignored by the compiler : ``` ignoring unknown option -Lblahblah ``` I have checked msdn site <http://msdn.microsoft.com/en-us/library/y0zzbyt4(v=vs.80).aspx> linker options, I tried to use the LIBPATH option, but I doesn't work either. so here is my question : what is the
[ 0.21761801838874817, 0.14510683715343475, 0.3180406391620636, -0.09677749127149582, 0.1140623390674591, 0.04654378816485405, 0.19212576746940613, -0.16067713499069214, 0.016514373943209648, -0.8323643207550049, 0.07951866090297699, 0.6856200098991394, -0.6475786566734314, 0.045750815421342...
msvc command line option to specify a library directory path to the linker ? MSVC has no equivalent of -L option, paths are provided directly to `LINK`. As for standard library search path, it is set correctly by `vcvar32.bat` (see [this MSDN article](http://msdn.microsoft.com/en-us/library/f2ccy3wt%28v=vs.100%29.aspx))
[ -0.06321876496076584, -0.2148059606552124, 0.6944578886032104, 0.00012868878548033535, 0.13905823230743408, -0.10111288726329803, 0.4009714126586914, 0.06445600837469101, -0.24456021189689636, -0.7629590034484863, -0.28317734599113464, 0.5783186554908752, -0.23321838676929474, 0.1202920600...
Currently I am using the following method to validate the data for not being Null. ``` if ([[response objectForKey:@"field"] class] != [NSNull class]) NSString *temp = [response objectForKey:@"field"]; else NSString *temp = @""; ``` Problem comes when the response Dictionary contains hundreds of attributes (and respective values). I need to add this kind of condition to each and every element for the dictionary. Any other way around to accomplish? Any Suggestion for making any change to the web service (except not inserting the null value to database)? Any Idea, Anyone ?? What I've done is put a category on NSDictionary ``` @interface NSDictionary (CategoryName) /** *
[ 0.03193884342908859, 0.09606534987688065, 0.3497147560119629, -0.04346085339784622, -0.2696389853954315, 0.017828883603215218, 0.38250789046287537, -0.13688111305236816, -0.35965225100517273, -0.6005436778068542, 0.0632886216044426, 0.6317574977874756, -0.17292878031730652, 0.3731831908226...
Returns the object for the given key, if it is in the dictionary, else nil. * This is useful when using SBJSON, as that will return [NSNull null] if the value was 'null' in the parsed JSON. * @param The key to use * @return The object or, if the object was not set in the dictionary or was NSNull, nil */ - (id)objectOrNilForKey:(id)aKey; @end @implementation NSDictionary (CategoryName) - (id)objectOrNilForKey:(id)aKey { id object = [self objectForKey:aKey]; return [object isEqual:[NSNull null]] ? nil : object; } @end ``` Then you can just use `[response objectOrNilForKey:@"field"];` You can modify this to return a blank string
[ -0.3131292760372162, -0.13442882895469666, 0.40100160241127014, -0.26886099576950073, -0.3425680100917816, 0.25992193818092346, 0.493237167596817, -0.6947373747825623, -0.4828035831451416, -0.1819717437028885, -0.2780628502368927, 0.6025102734565735, -0.47156408429145813, 0.026088705286383...
if you'd like.
[ 0.4248371720314026, 0.19461160898208618, 0.29690009355545044, -0.0020311411935836077, 0.31203773617744446, -0.07506316900253296, -0.06924217194318771, 0.4113912582397461, 0.03810708969831467, 0.05357881262898445, -0.08398942649364471, 0.16723676025867462, 0.22264420986175537, 0.08275835961...
First of all forgive my English :-( I have a problem with hours on java. Let's see it by an example: ``` DateFormat datos = new SimpleDateFormat ("hh:mm:ss"); Date ac, lim; String actual,limit; actual="18:01:23"; limit="00:16:23"; ac=datos.parse(actual); lim=datos.parse(limit); if(ac.compareTo(lim)==-1){....... ``` I need to solve this case in which limit is past midnight and actual hour is before
[ 0.11662628501653671, -0.052318233996629715, 0.47079506516456604, -0.051541294902563095, -0.034238796681165695, -0.13663771748542786, 0.5594624876976013, -0.24309822916984558, -0.06786045432090759, -0.7137215733528137, -0.09862209856510162, 0.8632338643074036, -0.23193016648292542, -0.04202...
midnight. My program says that actual has reached limit and it isn't correct because at the example, it has still 6 hours to finish. I tried to solve it with DateFormat class but it doesnt see this case. I tried it with Time class too but its methods are deprecated. How can I solve this? Use `HH` instead of `hh` in your `SimpleDateFormat`: ``` DateFormat datos = new SimpleDateFormat("HH:mm:ss"); ``` `hh` is the 12-hour clock (hours go from 1 to 12). `HH` is the 24-hour clock (hours go from 0 to 23). But besides that, there are other things wrong with this. Class `Date` is not very well suited
[ 0.577377438545227, -0.11357992142438889, 0.764142632484436, 0.041243404150009155, 0.20078743994235992, -0.27078479528427124, 0.27708330750465393, -0.24842727184295654, -0.17202600836753845, -0.7710806131362915, 0.15477780997753143, 0.7061460614204407, 0.052961792796850204, 0.38573202490806...
to contain only a time. If you do this, it will be parsed as 01-01-1970 with the specified time. So 18:01:23 becomes 01-01-1970, 18:01:23 and 00:16:23 becomes 01-01-1970, 00:16:23. You probably wanted to compare 18:01:23 to 00:16:23 the next day. Try something like this: ``` String actual = "18:01:23"; String limit = "00:16:23"; String[] parts = actual.split(":"); Calendar cal1 = Calendar.getInstance(); cal1.set(Calendar.HOUR_OF_DAY, Integer.parseInt(parts[0])); cal1.set(Calendar.MINUTE, Integer.parseInt(parts[1])); cal1.set(Calendar.SECOND, Integer.parseInt(parts[2])); parts = limit.split(":"); Calendar cal2 = Calendar.getInstance(); cal2.set(Calendar.HOUR_OF_DAY, Integer.parseInt(parts[0])); cal2.set(Calendar.MINUTE, Integer.parseInt(parts[1])); cal2.set(Calendar.SECOND, Integer.parseInt(parts[2])); // Add 1 day because you mean 00:16:23 the next day cal2.add(Calendar.DATE, 1); if (cal1.before(cal2)) { System.out.println("Not yet at the limit"); } ``` The library [Joda Time](http://joda-time.sourceforge.net/) is a popular Java date and time library that is
[ 0.2711378037929535, -0.16838710010051727, 0.5548787713050842, -0.19366586208343506, -0.024293305352330208, 0.16787172853946686, 0.06831467151641846, -0.15744729340076447, -0.31976449489593506, -0.5376304984092712, 0.10599333792924881, 0.4524606466293335, -0.4506869614124298, 0.047829445451...
much better designed than the standard Java date and calendar API; consider using it if you have to work with dates and times in Java. With Joda Time you could do this: ``` String actual = "18:01:23"; String limit = "00:16:23"; DateTimeFormatter df = DateTimeFormat.forPattern("HH:mm:ss"); DateTime ac = df.parseLocalTime(actual).toDateTimeToday(); DateTime lim = df.parseLocalTime(limit).toDateTimeToday().plusDays(1); if (ac.isBefore(lim)) { System.out.println("Not yet at the limit"); } ```
[ 0.04944663867354393, -0.5923522114753723, 0.9497595429420471, -0.13043417036533356, 0.31486940383911133, -0.050333574414253235, -0.11217329651117325, -0.2895442545413971, -0.27800410985946655, -0.6811960935592651, 0.013819150626659393, 0.5981695652008057, 0.01745467633008957, 0.15634521842...
``` <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ``` it is not working like i have my site which can be translated in 20 languages but in some languages like turkish , japanese it shows � symbol instead of space or " and many others for php, you need to add a utf-8 header ``` header ('Content-type: text/html; charset=utf-8'); ```
[ 0.31499090790748596, 0.08620751649141312, 0.5062568783760071, -0.04517839476466179, -0.08623494952917099, 0.07435833662748337, 0.7024450898170471, -0.21910829842090607, 0.1598544865846634, -0.7741798758506775, -0.16448387503623962, 0.40862154960632324, -0.5452417731285095, -0.0667793527245...
I know that PHP does allow you to create a server but what about client? I would need a script that connects to my TCP/IP server on given port and send some data. Is that possible in PHP and if so, could you help me please? I did not find anything useful. I have my TCP/IP server running on port 1301 and I would need users to be able by clicking on web page send one char to the server. It's similar to how you would create a server. I'd recommend taking a look at the documentation for [socket\_connect](http://php.net/socket_connect). Summaries: * [socket\_create](http://php.net/manual/en/function.socket-create.php) * [socket\_bind](http://php.net/manual/en/function.socket-bind.php) * [socket\_connect](http://php.net/manual/en/function.socket-connect.php) *
[ 0.4409177005290985, 0.12678855657577515, 0.11165757477283478, 0.10219549387693405, -0.29426199197769165, -0.10936876386404037, 0.06295537948608398, 0.10171142220497131, -0.2190060019493103, -0.923955500125885, 0.30851998925209045, 0.48356878757476807, -0.11309285461902618, 0.34568864107131...
[socket\_write](http://php.net/manual/en/function.socket-write.php) * [socket\_read](http://php.net/manual/en/function.socket-read.php) * [socket\_close](http://php.net/manual/en/function.socket-close.php) Workflow: * Create the socket * Optionally bind it * Connect to the server * Read/write data * Close the socket
[ 0.12998588383197784, 0.09624109417200089, 0.3666996657848358, -0.2995302379131317, -0.3310040533542633, 0.3214264512062073, -0.23108632862567902, 0.11964523792266846, 0.13717573881149292, -0.7297784090042114, -0.4997689127922058, 0.32815104722976685, -0.10841012746095657, 0.158919751644134...
I am working on a blog: <http://poweryogatrainings.blogspot.com/search>. If you check the link you can see that currently the blog posts are just below the thumbnail. Now I am trying to make the blog posts align beside (on the right side of) the thumbnail but I am not sure how. Does anyone know what is causing the line break and what can I do to avoid it? Also I think there was a website where you could edit codes of your website and watch the preview without actually changing the codes. Any ideas about it? Simply add left float to the image, and
[ 0.6528607606887817, -0.1415853053331375, 0.2723439931869507, 0.28840699791908264, -0.10728690773248672, -0.032810259610414505, 0.3239988088607788, 0.16326701641082764, -0.246326744556427, -0.9024094343185425, 0.5356536507606506, 0.4075787663459778, 0.10804995894432068, 0.1486569046974182, ...
give it some space to the right and bottom, as below: ``` img.postthumb { float: left; margin: 0 10px 10px 0; } ```
[ -0.29384711384773254, 0.3391713798046112, 0.5132891535758972, -0.21102231740951538, 0.26296621561050415, 0.05142411217093468, -0.20081692934036255, -0.07018736749887466, -0.04910176247358322, -0.6074352264404297, -0.14542821049690247, 0.1168084517121315, 0.02589534781873226, 0.082162700593...
I need to add a private reference to a Unit object `_Unit`. Attached is both classes (`Unit` and `Result`). I understand I need to have the code below, however it results in errors (listed below): ``` // 14. create new class class Result : Unit ``` and the below creates the error that `base()` requires two constructors: ``` // 17. Create constructor for the class public Result(string grade, Unit _Unit) : base(_Unit) ``` In my unit class there are two private strings `_Code` and `_Name`. Please ask if you need any other class codes put in or the assignment question. ``` namespace SIT232_Assignment1 { // 14. create new class class Result
[ 0.29362359642982483, 0.35537394881248474, 0.1837783008813858, 0.11895523965358734, 0.08764736354351044, 0.28130897879600525, 0.06866933405399323, -0.2836454510688782, 0.04706445708870888, -0.48884615302085876, 0.04664478078484535, 0.574178159236908, 0.028742672875523567, 0.5325202941894531...
{ // 15. Add a private reference to a Unit objectand a private string attributes. private string _Grade, _Unit; // 16. Encapsulate the above attributes with public read-only properties public string Grade { get { return _Grade; } } // 17. Create constructor for the class public Result(string grade, Unit _Unit) {
[ 0.47150981426239014, 0.2602958381175995, 0.09480557590723038, 0.097756028175354, 0.09509842097759247, 0.32281532883644104, 0.0875784307718277, -0.5548477172851562, 0.21336331963539124, -0.32991358637809753, -0.15005461871623993, 0.6206416487693787, 0.2579925060272217, 0.3957379162311554, ...
_Grade = grade; } // 18. create a public read-only property of type bool public bool Passed (string grade) { bool result = true; if (_Grade == "N") result = false;
[ 0.2834417521953583, -0.007073713932186365, -0.016176946461200714, -0.22331242263317108, -0.054965268820524216, -0.08578944206237793, 0.5251168012619019, -0.32442930340766907, 0.20311519503593445, -0.001795578165911138, -0.2717469036579132, 0.3216001093387604, -0.17345666885375977, 0.373456...
return result; } // 19. Create a public static methods public static bool ValidateGrade(string grade) { bool result = false; if (_Grade == "N" || _Grade == "P" || _Grade == "C" || _Grade == "D" || _Grade =="HD") result = true; return result;
[ 0.006877633277326822, -0.19098685681819916, 0.22371549904346466, -0.12594525516033173, 0.039683662354946136, -0.06555601209402084, 0.34892866015434265, -0.35199812054634094, 0.28065332770347595, -0.14528997242450714, -0.5163713693618774, 0.6475540995597839, 0.01654863730072975, 0.429880678...
} // 20. Define a ToString method public override string ToString() { return String.Format("{0}\t{1}", _Grade); } } namespace SIT232_Assignment1 { // 8. Create new class class Unit { // 9. Add private string attributes for the unit code and unit name private string _Code, _Name; // 10. Encapsulate the above attributes with public read-only properties. public string Code
[ 0.0576016791164875, -0.14374831318855286, 0.22491705417633057, 0.0456368587911129, 0.35026997327804565, 0.06320168823003769, 0.07376983016729355, -0.5468102097511292, -0.0025567084085196257, -0.5902729034423828, -0.2602880597114563, 0.6640400290489197, 0.07048648595809937, 0.28065696358680...
{ get { return _Code; } } public string Name { get { return _Name; } } // 11. Create constructor with two string parameters
[ -0.010193266905844212, -0.15187470614910126, -0.10904809087514877, -0.07231904566287994, 0.01724870502948761, 0.008511129766702652, 0.09503746777772903, -0.10461161285638809, 0.07252266258001328, -0.6694280505180359, -0.17752934992313385, 0.7458335161209106, -0.3512747585773468, -0.1128831...
public Unit( string code, string name) { _Code = code; _Name = name; } // 27. create a private list<> private List<Student> _EnrolledStudents = new List<Student>(); // 28. Encapsulate the above list with read-only public ReadOnlyCollection<Student> EnrolledStudents { get { return _EnrolledStudents.AsReadOnly(); } } // 29. Create a method
[ 0.24614456295967102, -0.08222856372594833, 0.259520024061203, 0.08753368258476257, 0.3799898028373718, 0.39124172925949097, 0.14874498546123505, -0.3771935701370239, -0.08713757991790771, -0.5407099723815918, -0.3255505859851837, 0.2990679442882538, -0.10073961317539215, 0.3329880833625793...
that accecpts a single parameter public void RecordEnrollment(Student student) { _EnrolledStudents.Add(student); } // 30. Create a method that accecpts a single parameter public void RemoveEnrollment(Student student) { _EnrolledStudents.Remove(student); } // 12. Define a ToString method public override string ToString() { return String.Format("{0} {1}", _Code, _Name); } } ``` Furthermore,
[ 0.12002778798341751, 0.03822287917137146, 0.39311209321022034, 0.09213469922542572, 0.2747904062271118, 0.014137262478470802, -0.22898267209529877, -0.028937162831425667, -0.33181464672088623, -0.2201758772134781, -0.2776114046573639, 0.46969953179359436, -0.38411012291908264, 0.1901803165...
one other error I'm getting that I simply cannot full understand is the below method HAS to be *static*, I've researched that also making the attributes and properties of `_Grade` *static* solves the error showing on each individual `_Grade`, however it still shows on the first one? ``` if (_Grade == "N" || _Grade == "P" || _Grade == "C" || _Grade == "D" || _Grade =="HD") public static bool ValidateGrade(string grade) ``` For your first question: Your class `Result` inherites from `Unit` and your constructor of `Result` calls the one of the base class. However, in `Unit` there is only one constructor defined needing two
[ 0.2266296148300171, 0.002189244609326124, -0.024432284757494926, 0.19610421359539032, -0.15445435047149658, -0.08950225263834, 0.13057976961135864, -0.3343644440174103, 0.20720182359218597, -0.5284883379936218, -0.14205163717269897, 0.6018381118774414, 0.04454917088150978, 0.51826363801956...
arguments (`code` and `name`), so your call to `base` at the `Result` constructor needs to have two parameters. But you probably don't want to inherit from `Unit` but add a private reference to it. There you would have something like ``` class Result { private Unit _Unit; ... public Result(..., Unit _Unit) { this._Unit = _Unit; ... } } ``` Your second error: A static method can only access static fields and properties, so from a static method you can't access your instance variables. You just want to verify that the
[ -0.14341597259044647, 0.06460493803024292, 0.13185319304466248, 0.01740340329706669, -0.03327276185154915, 0.13123001158237457, 0.1967017650604248, -0.24801988899707794, -0.0864412859082222, -0.4052886664867401, -0.030753593891859055, 0.6698095798492432, -0.19969989359378815, 0.37327721714...