text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Foo.bar end # things_controller def index Foo.bar end ```
[ -0.12951841950416565, 0.09202060103416443, 0.40033459663391113, -0.1023574098944664, 0.20933140814304352, -0.5008471012115479, 0.04908062517642975, 0.06404748558998108, -0.3325095772743225, -0.3201812207698822, -0.3156561553478241, 0.39030519127845764, -0.5490472316741943, 0.46715408563613...
Sorry for a long question and not a very descriptive title, but my problem is very difficult to explain briefly. I have three database tables: ``` TABLE A: AID PK STATUS VARCHAR TABLE B: BID PK AID FK CID FK TABLE C: CID PK CREATIONTIME DATE ``` For each STATUS = 'OK' row in table A I want to find t...
[ -0.2981586456298828, 0.5634362101554871, 0.6111435890197754, 0.3325290083885193, -0.29747411608695984, 0.32333609461784363, 0.03941957280039787, -0.3253017067909241, 0.03375258669257164, -0.5695133209228516, 0.21399199962615967, 0.2413220852613449, 0.14869681000709534, 0.3094732463359833, ...
continue from there? For example: ``` select AID, CID from B where AID in (select AID from A where STATUS = 'OK') ``` could return something like: ``` AID, CID 1 1 2 2 2 3 3 4 4 5 4 6 ``` Let's say that CID 2 has later creation time than CID 3 and CID 6 is newer than CID 5. This m...
[ -0.28964146971702576, 0.11028928309679031, 0.5573272705078125, 0.023289352655410767, 0.07861004024744034, 0.3272932171821594, -0.010904370807111263, -0.30168282985687256, -0.146527498960495, -0.6293102502822876, -0.23628468811511993, 0.7406018972396851, 0.0959736630320549, -0.0429528988897...
to express this with a query? EDIT: Sorry that I wasn't specific enough. What I want to get is the CIDs from table C. EDIT: I counted returned rows with the different solutions. Results were very interesting - and diversified: HAINSTECH: 298 473 rows JMUCCHIELLO: 298 473 rows RUSS CAM: 290 121 rows CHRIS:...
[ 0.26282835006713867, 0.3475944995880127, 0.18099695444107056, 0.43698734045028687, -0.16271893680095673, 0.5338206887245178, 0.009982344694435596, 0.3355766832828522, -0.3774930536746979, -0.7296682000160217, 0.03713938593864441, 0.33575665950775146, -0.05129653587937355, 0.134570345282554...
A.AID FROM A INNER JOIN B ON A.AID = B.AID INNER JOIN C ON B.CID = C.CID WHERE A.STATUS = 'OK' GROUP BY A.AID ``` **EDIT:** I have now checked the following in SQL Server (I would epxect the same outcome in Oracle) and it returns the `CID` for the `C` record with the Maximum `CR...
[ -0.35420548915863037, 0.3173312246799469, 0.47482621669769287, -0.09349113702774048, -0.19832395017147064, 0.09796743839979172, 0.302631139755249, -0.6272786259651184, 0.1258910596370697, -0.6521723866462708, -0.16204941272735596, 0.7064208388328552, -0.24114733934402466, 0.027639510110020...
SELECT MAX(C.CREATIONTIME) CREATIONTIME, A.AID FROM A A INNER JOIN B B ON A.AID = B.AID INNER JOIN C C ON B.CID = C.CID
[ 0.2244829535484314, -0.2752167880535126, 0.15253981947898865, 0.11445430666208267, 0.050493042916059494, 0.2610556483268738, 0.21436582505702972, -0.5314938426017761, 0.08791153877973557, -0.610731303691864, -0.20255687832832336, 0.6709339618682861, -0.1700226068496704, -0.0258294977247715...
WHERE A.STATUS = 'OK' GROUP BY A.AID ) ABC ON B.AID = ABC.AID AND C.CREATIONTIME = ABC.CREATIONTIME ``` Demonstrated with the following ***T-SQL*** ``` DECLARE @A TABLE(AID INT IDENTITY(1,1), STATUS VARCHAR(10)) DECLARE @B TABLE(BID INT IDENTITY(1,1), AID INT, CID INT) DECLARE @C TABLE(CID INT ID...
[ -0.11125560104846954, 0.2583482563495636, 0.3543526530265808, -0.143149733543396, 0.015308777801692486, 0.15775802731513977, 0.10447388142347336, -0.6290794610977173, 0.06632719933986664, -0.5620589256286621, -0.013517966493964195, 0.3743683695793152, -0.21247491240501404, 0.33323889970779...
('17 MAR 2008') INSERT INTO @C VALUES ('21 MAR 2008') INSERT INTO @B VALUES (1,1) INSERT INTO @B VALUES (1,2) INSERT INTO @B VALUES (1,3) INSERT INTO @B VALUES (2,2) INSERT INTO @B VALUES (2,3) INSERT INTO @B VALUES (2,4) INSERT INTO @B VALUES (3,3) INSERT INTO @B VALUES (3,4) INSERT INTO @B VALUES (3,5) INSERT INTO @...
[ -0.005423211492598057, 0.2747139036655426, 0.5269039273262024, -0.029688306152820587, -0.2655653953552246, 0.40833529829978943, 0.10354353487491608, -0.441657155752182, 0.14822687208652496, -0.5284626483917236, 0.16733531653881073, 0.3709297180175781, -0.05981656163930893, 0.21027539670467...
@C C ON B.CID = C.CID WHERE A.STATUS = 'OK' GROUP BY A.AID ) ABC ON B.AID = ABC.AID AND C.CREATIONTIME = ABC.CREATIONTIME ``` Results in the following ``` CID ----------- 3 4 5 ``` **EDIT 2:** In response to your comment about each of the statements giving different results, I have ran some of th...
[ 0.07465386390686035, 0.34773099422454834, 0.41745540499687195, -0.10694388300180435, -0.21082311868667603, -0.017105061560869217, 0.12370448559522629, -0.3614012598991394, 0.019348781555891037, -0.3886699378490448, 0.025251036509871483, 0.5430527925491333, -0.21647781133651733, 0.223946750...
AID INT, CID INT) DECLARE @C TABLE(CID INT IDENTITY(1,1), CREATIONTIME DATETIME) INSERT INTO @A VALUES ('OK') -- AID 1 INSERT INTO @A VALUES ('OK') -- AID 2 INSERT INTO @A VALUES ('NOT OK') INSERT INTO @A VALUES ('OK') -- AID 4 INSERT INTO @A VALUES ('NOT OK') INSERT INTO @C VALUES ('10 MAR 2008') INSERT INTO @C VALU...
[ -0.4941987693309784, 0.37272900342941284, 0.5139069557189941, -0.10795097798109055, -0.31004518270492554, 0.4317902624607086, 0.28039494156837463, -0.613415539264679, 0.45397457480430603, -0.6183926463127136, -0.025344669818878174, 0.550798237323761, -0.2545067369937897, -0.014188726432621...
@B VALUES (2,4) -- Will be CID 4 For AID 2 INSERT INTO @B VALUES (3,3) INSERT INTO @B VALUES (3,4) INSERT INTO @B VALUES (3,5) INSERT INTO @B VALUES (4,5) -- Will be CID 5 FOR AID 4 INSERT INTO @B VALUES (4,1) INSERT INTO @B VALUES (4,2) -- Russ Cam SELECT C.CID, ABC.CREATIONTIME FROM @C C INNER JOIN @B B ON C.CID =...
[ 0.3727673590183258, 0.17971013486385345, 0.4270242750644684, 0.13089518249034882, 0.01732965186238289, 0.37168088555336, 0.14105373620986938, -0.26360684633255005, 0.08571649342775345, -0.6325715780258179, 0.054952796548604965, 0.4969457983970642, -0.19857798516750336, 0.3052845299243927, ...
B.CID = C.CID WHERE A.STATUS = 'OK' GROUP BY A.AID ) ABC ON B.AID = ABC.AID AND C.CREATIONTIME = ABC.CREATIONTIME -- Tyrannosaurs select A.AID, max(AggC.CREATIONTIME) from @A A, @B B, ( select C.CID, max(C.CREATIONTIME) CREATIONTIME from
[ 0.3872731924057007, 0.23962797224521637, 0.26068952679634094, 0.27597397565841675, 0.023318272083997726, 0.42184141278266907, 0.10668960213661194, -0.25709596276283264, -0.02689053677022457, -0.39958226680755615, -0.07308727502822876, 0.5067346692085266, -0.46416816115379333, 0.31283465027...
@C C group by CID ) AggC where A.AID = B.AID and B.CID = AggC.CID and A.Status = 'OK' group by A.AID -- jmucchiello SELECT c.cid, max(c.creationtime) FROM @B b, @C c WHERE b.cid = c.cid AND b.aid IN (SELECT a.aid FROM @A a WHERE status = 'OK') GROUP BY c.cid -- hainstech SELE...
[ -0.25836625695228577, 0.08701703697443008, 0.4573972821235657, 0.15121978521347046, -0.027087239548563957, 0.47322309017181396, -0.08078550547361374, -0.3319563865661621, -0.20390115678310394, -0.433225154876709, -0.5732040405273438, 0.5379068851470947, -0.0072615849785506725, 0.0684344917...
,max(c.creationtime) as maxcCreationTime FROM @C c INNER JOIN @B b ON b.cid = c.cid INNER JOIN @A a on a.aid = b.aid WHERE a.status = 'OK' GROUP BY a.aid, c.cid ) as agg --chris SELECT A.AID, C.CID, C.CREATIONTIME FROM @A A, @B B, @C C WHERE A.STATUS = 'OK' AND A.AID = B.AID AND B.CID = C.CID AND C...
[ -0.06970278173685074, 0.07776040583848953, 0.5351131558418274, 0.08392854779958725, 0.07494071871042252, 0.5882914662361145, 0.11578617990016937, -0.3691365122795105, -0.2519140839576721, -0.596710205078125, -0.4158124625682831, 0.7142212986946106, 0.061087898910045624, 0.01455467473715543...
CREATIONTIME for reference) CID CREATIONTIME ----------- ----------------------- 3 2008-03-15 00:00:00.000 4 2008-03-17 00:00:00.000 5 2008-03-21 00:00:00.000 --Tyrannosaurs - No CIDs in the resultset AID ----------- ----------------------- 1 2008-03-15 00:00:00...
[ -0.20388488471508026, 0.14489145576953888, 0.13386160135269165, 0.6713182330131531, -0.16797512769699097, 0.20971180498600006, 0.17942258715629578, 0.14509589970111847, -0.1373174786567688, -0.5785471200942993, 0.0904259979724884, 0.7801232933998108, 0.14897485077381134, 0.1037380769848823...
00:00:00.000 --jmucchiello - Incorrect CIDs in the resultset cid ----------- ----------------------- 1 2008-03-10 00:00:00.000 2 2008-03-13 00:00:00.000 3 2008-03-15 00:00:00.000 4 2008-03-17 00:00:00.000 5 2008-03-21 00:00:00.000 --hainstech - Too many CIDs ...
[ -0.2602740228176117, 0.18267637491226196, 0.5509746670722961, 0.45200276374816895, -0.3885596692562103, 0.388260155916214, 0.25471511483192444, -0.5684008002281189, 0.24551738798618317, -0.6406840085983276, -0.08340892195701599, 0.5448474287986755, 0.10284887999296188, -0.04421269521117210...
cid ----------- ----------- 1 1 1 2 1 3 2 2 2 3 2 4 4 1 4 2 4
[ -0.1543128788471222, 0.2728540599346161, 0.2860274910926819, 0.2588818371295929, -0.16939546167850494, 0.09056144207715988, -0.3980535566806793, -0.07594223320484161, 0.17953133583068848, -0.4326399564743042, 0.35438475012779236, 0.35050827264785767, 0.11849980056285858, 0.3505026996135711...
5 --chris - Correct CIDs, it is the same SQL as mine AID CID CREATIONTIME ----------- ----------- ----------------------- 1 3 2008-03-15 00:00:00.000 2 4 2008-03-17 00:00:00.000 4 5 2008-03-21 00:00:00.000 ``` I
[ -0.4256996512413025, 0.4054981768131256, 0.4508476257324219, 0.3450184762477875, -0.3564978241920471, -0.1396913379430771, 0.32981252670288086, -0.11072850227355957, -0.015038087032735348, -0.4291592240333557, 0.1369154006242752, 0.7062335014343262, 0.34803298115730286, 0.09293783456087112...
would recommend running each of the given answers against a smaller number of records, so that you can ascertain whether the resultset returned is the expected one.
[ 0.30424270033836365, -0.16973961889743805, -0.07001454383134842, 0.4690342843532562, 0.12111391872167587, 0.1128663718700409, 0.09988783299922943, -0.23682443797588348, -0.04930363968014717, -0.38562506437301636, 0.013240478932857513, 0.31194764375686646, 0.20420026779174805, -0.1248697414...
What's the best way in C# to set up a utility app that can be run from the command line and produce some output (or write to a file), but that could be run as a Windows service as well to do its job in the background (e.g. monitoring a directory, or whatever). I would like to write the code once and be able to either ...
[ 0.4418032169342041, -0.1934887319803238, 0.12415096908807755, 0.1448405385017395, 0.28443941473960876, -0.3474469482898712, -0.13645203411579132, -0.0020560170523822308, -0.10200890898704529, -0.33297231793403625, -0.11595164984464645, 0.7291229367256165, -0.23495477437973022, -0.391284406...
this? And if so: how can I do this? Yes you can. One way to do it would be to use a command line param, say "/console", to tell the console version apart from the run as a service version: * create a Windows Console App and then * in the Program.cs, more precisely in the Main function you can test for the presence ...
[ 0.28407755494117737, 0.10985862463712692, 0.35481590032577515, 0.12061112374067307, -0.07142516225576401, 0.20107050240039825, 0.3588148057460785, -0.3440227210521698, -0.3526683747768402, -0.5335399508476257, -0.4176782965660095, 0.322456032037735, -0.2857833504676819, 0.082921102643013, ...
ServiceBase { protected override void OnStart(string[] args) { // Run the service version here // NOTE: If you're task is long running as is with most // services you should be invoking it on Worker Thread // !!! don't take too long in this function !!! base.OnStart...
[ 0.19447816908359528, -0.07739748805761337, 0.18501681089401245, -0.5633212924003601, 0.06209833547472954, -0.04072623327374458, 0.7742451429367065, 0.08117535710334778, -0.0047165993601083755, -0.6581999659538269, -0.1386672407388687, 0.5782766342163086, -0.34342390298843384, 0.14794008433...
protected override void OnStop() { // stop service code goes here base.OnStop(); } } ``` ... Then in Program.cs: ``` static class Program { // The main entry point for the application. static void Main(string[] args) { ServiceBase[] ServicesToRun; ``` ``` if ((args...
[ 0.026413070037961006, -0.07872322201728821, 0.5825802683830261, -0.4016585052013397, 0.5797029137611389, -0.02172413282096386, 0.5437922477722168, 0.005233568139374256, 0.013783128932118416, -0.549725353717804, -0.5917540788650513, 0.5975172519683838, -0.3805219233036041, 0.468367069959640...
} else { ServicesToRun = new ServiceBase[] { new serviceSample () }; ServiceBase.Run(ServicesToRun); } } ``` }
[ 0.021475201472640038, -0.2569361925125122, 0.41307422518730164, -0.6301904916763306, 0.12678536772727966, 0.17810185253620148, 0.6010552048683167, -0.042545270174741745, -0.2009788453578949, -0.942509114742279, -0.4862138628959656, 0.5538485646247864, -0.3941170275211334, 0.206669360399246...
I want to create a class with a nested enum. ``` public class Foo { public enum Views { } } ``` However System.Reflection.Emit.TypeBuilder class has no DefineNestedEnum only DefinedNestedType. ModuleBuilder.DefineEnum exists that let's me create an enum but I find no way to make it nested. Can I create a...
[ 0.07827363908290863, 0.19537003338336945, 0.13275936245918274, -0.10861281305551529, 0.001269657164812088, 0.022013166919350624, 0.326080858707428, -0.37200552225112915, 0.030563218519091606, -0.4731636345386505, 0.049515217542648315, 0.4165944755077362, -0.4058338403701782, 0.400957733392...
values. This is essentially what the C# compiler is doing based on what I've learned by disassembling it. If I do this and reference the assembly Intellisense recognizes it as an enum and functions just like an enum. --- This is exactly the method MSDN shows that Jeremy linked.
[ 0.23016580939292908, 0.2903212308883667, 0.05762970820069313, 0.09273234754800797, -0.009856224991381168, -0.13486208021640778, 0.09962409734725952, -0.3968544900417328, -0.031008191406726837, -0.3738234341144562, 0.2738008499145508, 0.5025738477706909, -0.3882520794868469, 0.0166744738817...
### EDIT: Now a Major Motion Blog Post at <http://messymatters.com/sealedbids> The idea of [rot13](http://rot13.com) is to obscure text, for example to prevent spoilers. It's not meant to be cryptographically secure but to simply make sure that only people who are sure they want to read it will read it. I'd like to d...
[ 0.3263866901397705, 0.17857322096824646, 0.3194262683391571, -0.08720383048057556, -0.31278717517852783, -0.17193996906280518, 0.19565699994564056, -0.23867608606815338, -0.28237834572792053, -0.3541514277458191, 0.07343202829360962, -0.036032747477293015, -0.08184308558702469, 0.150699093...
from me or any third party. (Added: Note the assumption that the recipient is being trusted not to cheat.) It's not as simple as rot13 because certain numbers, like 1 and 2, will recur often enough that you might remember that, say, 34.2 is really 1. Here's what I'm looking for specifically: A function seal() that...
[ 0.2562901973724365, -0.041941966861486435, 0.2767959535121918, 0.19221429526805878, -0.07250714302062988, -0.5152390003204346, 0.1911252737045288, -0.22776499390602112, -0.14501862227916718, -0.417490154504776, -0.29045701026916504, 0.6751747131347656, -0.21984116733074188, -0.002698459895...
or unseal to call any webservices or even get the system time (because I don't want to assume synchronized clocks). (Added: It's fine to assume that all bids will be less than some maximum, known to everyone, say a million.) Sanity check: ``` > seal(7) 482.2382 # some random-seeming number or string. > seal(7) 71.9...
[ -0.10128678381443024, 0.10826251655817032, 0.7706656455993652, 0.16281035542488098, 0.07816866040229797, -0.2039128690958023, 0.3447960615158081, -0.535064697265625, -0.4901980757713318, -0.25017088651657104, -0.3905961513519287, 0.7115166783332825, -0.09939544647932053, 0.1598116010427475...
x unseal(x) = x % M ``` Sanity check: ``` > seal(7) 716017 > seal(7) 518497 > unseal(seal(7)) 7 ``` This needs tweaking to allow negative bids though: ``` M = 9999 # Numbers between -M/2 and M/2 can be sealed. seal(x) = M * randInt(9,99) + x unseal(x) = m = x % M; if m > M/2 return m - M else return m ```...
[ -0.15437182784080505, 0.33100736141204834, 0.7465924024581909, -0.08671453595161438, -0.01989714242517948, 0.12067948281764984, 0.45047619938850403, -0.5083487629890442, -0.24039575457572937, -0.29921528697013855, -0.49142977595329285, 0.6250516176223755, -0.13250106573104858, 0.1059409528...
at most 6 digits long. (This is plenty security for what I have in mind -- if the bids can possibly exceed $5k then I'd use a more secure method. Though of course the max bid in this method can be set as high as you want.) ### Instructions for Lay Folk Pick a number between 9 and 99 and multiply it by 9999, then add ...
[ 0.16328459978103638, 0.04594006389379501, 0.7564538717269897, 0.05651162937283516, -0.010537801310420036, 0.18059150874614716, 0.15556375682353973, -0.46624255180358887, -0.2742170989513397, -0.16847865283489227, -0.1551128774881363, 0.5630480647087097, 0.17728598415851593, -0.009958094917...
and mathematicians as "finding the remainder when dividing by 9999" or "mod'ing by 9999", respectively.) This works for nonnegative bids less than 9999 (if that's not enough, use 99999 or as many digits as you want). If you want to allow negative bids, then the magic 9999 number needs to be twice the biggest possible ...
[ -0.1958768367767334, -0.0807659775018692, 0.33139634132385254, -0.09194622188806534, -0.240692138671875, 0.105953648686409, 0.27034685015678406, -0.5660645365715027, -0.5065422654151917, -0.21217159926891327, -0.31249141693115234, 0.349454402923584, 0.09099381417036057, -0.1585401594638824...
you see it.
[ 0.2918832004070282, 0.40193986892700195, -0.1312880665063858, -0.022087816148996353, -0.0035279584117233753, -0.14370763301849365, 0.0671515241265297, 0.2872306704521179, -0.5253912210464478, -0.7220712304115295, 0.35486602783203125, 0.2932482659816742, -0.056367985904216766, 0.46552306413...
I'm new to Scala and don't know Java. I want to create a jar file out of a simple Scala file. So I have my HelloWorld.scala, generate a HelloWorld.jar. Manifest.mf: ``` Main-Class: HelloWorld ``` In the console I run: ``` fsc HelloWorld.scala jar -cvfm HelloWorld.jar Manifest.mf HelloWorld\$.class HelloWorld.clas...
[ -0.34108519554138184, 0.3917383551597595, 0.48053282499313354, -0.31825149059295654, 0.06119880452752113, 0.20238755643367767, 0.4044869840145111, -0.28099387884140015, -0.42211079597473145, -0.7054271697998047, -0.07963134348392487, 0.3743039667606354, -0.3846699297428131, 0.3937628865242...
Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:316) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoa...
[ -0.3290941119194031, 0.029669590294361115, 0.5058958530426025, -0.028394294902682304, 0.013119938783347607, 0.19673354923725128, 0.3866622745990753, -0.6692885756492615, -0.17322219908237457, -0.45831313729286194, -0.03398019075393677, 0.18920020759105682, -0.5703079104423523, 0.1160738542...
*META-INF/MANIFEST.MF* file: the main class; relative URLs to any dependencies. The documentation notes: > **-jar** > > > Execute a program encapsulated in a > JAR file. The first argument is the > name of a JAR file instead of a > startup class name. In order for this > option to work, the manifest of the > JA...
[ 0.15550729632377625, 0.060478150844573975, 0.3154463469982147, -0.12027221918106079, -0.1272055059671402, 0.08145976811647415, 0.4233365058898926, -0.33823779225349426, 0.021557094529271126, -0.7011705040931702, -0.15800204873085022, 0.466350257396698, -0.4935283958911896, 0.41802841424942...
the Jar > trail of the Java Tutorial for > information about working with Jar > files and Jar-file manifests. > > > When you use this option, the JAR file > is the source of all user classes, > **and other user class path settings are ignored.** * [java command line usage](http://java.sun.com/javase/6/docs/tech...
[ 0.19161634147167206, 0.43201497197151184, 0.2987097501754761, -0.2708861231803894, -0.1669837385416031, -0.1377292424440384, 0.43352940678596497, -0.5111542344093323, -0.2799968123435974, -0.7923922538757324, -0.014790860936045647, 0.23350197076797485, -0.24922700226306915, 0.2411399632692...
exit fi if [ ! -f scala-library.jar ] then cp $SCALA_HOME/lib/scala-library.jar . fi scalac -sourcepath src -d bin src/foo/HelloWorld.scala cd bin jar -cfm ../hellow.jar ../MANIFEST.MF * cd .. java -jar hellow.jar ```
[ -0.19577577710151672, 0.0745992660522461, 0.9271106123924255, -0.3447810709476471, 0.31148460507392883, 0.16043472290039062, -0.0006547564989887178, -0.28594768047332764, 0.06415330618619919, -0.5592014789581299, -0.11593031883239746, 0.21455222368240356, -0.3356819152832031, 0.17937093973...
I am using C# to read a ~120 MB plain-text CSV file. Initially I did the parsing by reading it line-by-line, but recently determined that reading the entire file contents into memory first was multiple times faster. The parsing is already quite slow because the CSV has commas embedded inside quotes, which means I have ...
[ 0.11749394983053207, 0.2624351978302002, 0.6284437775611877, -0.12465888261795044, 0.12668296694755554, 0.008068899624049664, 0.2431347519159317, -0.2635217308998108, -0.2012747973203659, -0.5415688753128052, -0.2511853277683258, 0.44055402278900146, -0.21710743010044098, -0.00454161129891...
an array containing each line. However, when I do this on the 120 MB file, I get a `System.OutOfMemoryException`. Why does it run out of memory so quickly when my computer has 4 GB of RAM? Is there a better way to quickly parse a complicated CSV? You can get an OutOfMemoryException for basically any size of allocation....
[ 0.19624757766723633, 0.11305726319551468, 0.3875066936016083, 0.18756389617919922, -0.040043752640485764, 0.32459014654159546, 0.13436582684516907, -0.10034175962209702, -0.6294905543327332, -0.6216277480125427, 0.036835670471191406, 0.4896726608276367, -0.3403409719467163, 0.1751875430345...
GB RAM is split into 2 GB kernel space and 2 GB user space, so your .NET application cannot access more that 2 GB per default. When doing string operations in .NET you risk creating a lot of temporary strings due to the fact that .NET strings are immutable. Therefore you may see memory usage rise quite dramatically.
[ -0.04242980107665062, 0.10058434307575226, 0.2541325092315674, 0.21389305591583252, -0.09348750114440918, 0.11498814076185226, 0.16347993910312653, -0.01619870774447918, -0.5890494585037231, -0.4399780035018921, -0.10525801032781601, 0.39320337772369385, -0.20167598128318787, 0.28746807575...
I'm looking for an effective way to execute a method everyday at 3PM regardless of when the application was initially run or how long it has been running. This must be done entirely from the application with no OS intervention (ex. Windows Task Scheduler) I have been experimenting with java.util.Timer in varies confi...
[ 0.363445520401001, -0.03854666277766228, 0.012423340231180191, -0.0835089236497879, -0.027192460373044014, -0.17890840768814087, 0.3704521059989929, -0.09029551595449448, -0.11711343377828598, -0.6511639356613159, 0.2433280050754547, 0.7257983684539795, 0.05411496013402939, -0.337942659854...
In reference to this related [question](https://stackoverflow.com/questions/538996/constants-in-objective-c) on stackoverflow: If you create a constants file, how do you "link" to it in your target, so you don't have to ``` #import "Constants.h" ``` in every file you use constants? You can put the import line in y...
[ 0.2880384027957916, 0.12561863660812378, 0.22567418217658997, 0.17641471326351166, 0.16762606799602509, -0.1914919763803482, -0.3475392460823059, -0.09274180978536606, -0.6004526019096375, -0.150774285197258, 0.003337681293487549, 0.5171478986740112, -0.4718870222568512, 0.0907893776893615...
I was wondering if it was possible (and, if so, how) to chain together multiple managers to produce a query set that is affected by both of the individual managers. I'll explain the specific example that I'm working on: I have multiple abstract model classes that I use to provide small, specific functionality to other...
[ -0.2108660638332367, -0.3621252775192261, 0.0980972871184349, 0.2621728181838989, 0.22659346461296082, 0.1314692199230194, 0.1573517918586731, 0.06426355987787247, -0.24532537162303925, -0.3070773184299469, 0.23223654925823212, 0.4470687806606293, -0.5642807483673096, 0.41386860609054565, ...
def delete(self): self.deleted = True self.save() ``` Basically it provides a pseudo-delete (the deleted flag) instead of actually deleting the object. The GlobalMixin is defined as such: ``` class GlobalMixin(models.Model): is_global = models.BooleanField(default=True) objects = GlobalMana...
[ -0.2605978548526764, -0.471202552318573, 0.3000354766845703, 0.07383337616920471, 0.1532597839832306, -0.09815142303705215, 0.3749432861804962, 0.0724792405962944, -0.40348488092422485, -0.3429919481277466, -0.10332585871219635, 0.5055215358734131, -0.5267350077629089, 0.2630290389060974, ...
returned. My DeleteManager filters the queryset to only return results that have the deleted flag set to False, while the GlobalManager filters the queryset to only return results that are marked as global. Here is the declaration for both: ``` class DeleteManager(models.Manager): def get_query_set(self): ...
[ -0.22277532517910004, -0.36591702699661255, 0.39108583331108093, 0.01969151757657528, -0.0465201772749424, -0.028840191662311554, 0.29520750045776367, -0.1932573914527893, -0.390715628862381, -0.7395082712173462, -0.11148902773857117, 0.7481749057769775, -0.4925675690174103, 0.321657329797...
ran a test case on a model with 4 instances: one was global and non-deleted, one was global and deleted, one was non-global and non-deleted, and one was non-global and deleted. If I try to get result sets as such: SomeModel.objects.all(), I get instance 1 and 3 (the two non-deleted ones - great!). If I try SomeModel.ob...
[ -0.48277610540390015, -0.22559526562690735, 0.09979069977998734, -0.04612142965197563, -0.17163197696208954, 0.06970798224210739, 0.3522500693798065, 0.020242949947714806, -0.27076390385627747, -0.531690776348114, 0.05594528466463089, 0.422526478767395, -0.41620996594429016, 0.157259434461...
to attach GlobalManager to globals instead of objects (so the new command would be SomeModel.globals.globals()), I get instances 1 and 2 (the two globals), while my intended result would be to only get instance 1 (the global, non-deleted one). I wasn't sure if anyone had run into any situation similar to this and had ...
[ -0.26733601093292236, -0.07985646277666092, 0.33047914505004883, 0.013668191619217396, -0.2817198932170868, -0.05461060628294945, 0.2736641466617584, 0.32953667640686035, -0.4829782545566559, -0.8627994060516357, 0.033963195979595184, 0.32964515686035156, -0.3993717432022095, 0.27648943662...
glad to provide it. **Edit:** I have posted the eventual solution I used to this specific problem below. It is based on the link to Simon's custom QuerySetManager. See this snippet on Djangosnippets: <http://djangosnippets.org/snippets/734/> Instead of putting your custom methods in a manager, you subclass the query...
[ 0.007329830899834633, -0.03494010493159294, -0.06878583878278732, 0.006049628835171461, -0.1901150941848755, -0.14937610924243927, 0.398136705160141, -0.013553175143897533, -0.4597371518611908, -0.7785198092460632, 0.23192599415779114, 0.6439527869224548, -0.09522334486246109, 0.0435402244...
I follow the example in [Atlas: Creating a Confirmation Using the ModalPopup Extender](http://blogs.vertigosoftware.com/alanl/archive/2006/07/25/Creating_a_Confirmation_Using_the_ModalPopup_Extender.aspx) to make a postback when the OkButton in a ModalPopup is clicked (it uses the ModalPopupExtender that comes in ASP.N...
[ 0.023187896236777306, 0.16303858160972595, 0.4960290491580963, -0.0276084765791893, -0.5123372673988342, -0.32000482082366943, 0.07755956053733826, 0.13380880653858185, -0.004200230352580547, -0.2162609100341797, 0.19088846445083618, 0.3351791203022003, -0.09163941442966461, 0.014341662637...
using the [ConfirmButtonExtender](http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ConfirmButton/ConfirmButton.aspx)? You get the modal "bling" through the extender, and you'll have the PostBack processing you need. You wire the button click event as normal for processing, but the Confirm extender will "intercept" ...
[ 0.3437105119228363, -0.34295621514320374, 0.6003016829490662, 0.03080870769917965, 0.37497273087501526, -0.5112307667732239, -0.020703857764601707, -0.3080592751502991, 0.11712343990802765, -0.0358169749379158, -0.25427138805389404, 0.4950633645057678, -0.1865113079547882, -0.4059311449527...
I use Hibernate with Java. I have two tables which are associated with foreign keys. ``` Table: country Fields: ID, Name POJO class name : Country POJO class properties: id, name, cities Table: city Fields: ID, Name, CountryID POJO class name : Country ``` Then I use "hibernate reverse engineering" of MyEclipse. ...
[ -0.2828647792339325, 0.03388894349336624, 0.4139725863933563, 0.018959779292345047, -0.258576363325119, 0.016946593299508095, 0.2557668685913086, -0.20161619782447815, 0.0840936079621315, -0.8044844269752502, -0.1939021497964859, 0.34524837136268616, -0.2959408760070801, 0.1010339707136154...
should I edit to get cities ordered by ID when I obtain Country instances from the CountryDAO class? Are you using XML mapping, or annotations? Usually, on mapped collections there is an "order-by" attribute that lets you specify a column to order the collection by, and asc or desc ordering. See this page: <http://d...
[ 0.5350071787834167, -0.15617689490318298, 0.4043862521648407, 0.2534952163696289, -0.21131199598312378, -0.06987808644771576, -0.012146621011197567, -0.15462270379066467, -0.5539510250091553, -0.6375018954277039, -0.31097397208213806, 0.0862240344285965, -0.35855376720428467, 0.24999687075...
I am writing a C++ application and would like to request several data files through a HTTP GET request simultaneously, where should I look to get started (needs to be cross-platform). 1. Run Application 2. Create a list of URLs { "<http://host/file1.txt>", "<http://host/file2.txt>", "<http://host/file3.txt>"} 3. Requ...
[ 0.22837141156196594, 0.1478671133518219, 0.4426521062850952, 0.05825718492269516, -0.3212650418281555, 0.0478358119726181, 0.25019362568855286, -0.4792773425579071, -0.09381195902824402, -0.7520503401756287, -0.027253801003098488, 0.2863970696926117, -0.1731925904750824, 0.0712440982460975...
GET requests simultaneously. Most likely I will do this in batches (100 at a time, and creating more connections as made one are completed). I would recommend [libcurl](http://curl.haxx.se/). I'm not super-familiar with it, but it does have a [multi-interface](http://curl.haxx.se/libcurl/c/libcurl-multi.html) for perfo...
[ 0.2663961946964264, -0.2193017154932022, 0.44205906987190247, 0.07309354096651077, 0.024518148973584175, 0.06809067726135254, 0.09403257817029953, -0.3016100823879242, -0.5577606558799744, -0.7321133613586426, -0.21975280344486237, 0.37694770097732544, -0.2827973961830139, 0.11959124356508...
worrying about blocking.
[ 0.3031984269618988, 0.24769555032253265, -0.17151615023612976, 0.14829526841640472, -0.3830801844596863, -0.23643279075622559, 0.06062093749642372, -0.018698478117585182, -0.22624759376049042, -0.5154190063476562, 0.2740902900695801, 0.5078281760215759, -0.35821089148521423, -0.24386288225...
We're replacing a static web-site with a Django app. All the uri's will change. The current web-site has a substantial presence on the search engine rankings and we don't want to mess that up too much. Is it simply a case of setting up 301 redirects to the new uri's, or is there something more subtle we need to do to e...
[ 0.6334930658340454, 0.09164457023143768, 0.20943611860275269, 0.18911199271678925, -0.10009685158729553, -0.4067510962486267, 0.43826988339424133, 0.1074167862534523, -0.05460406467318535, -0.3795439302921295, 0.19597391784191132, 0.23098920285701752, -0.1619490385055542, 0.097358040511608...
301 redirects on both Apache, IIS, and other variants. Take a look [here](http://www.apexinternet.co.nz/blog/How-to-setup-a-301-Permanent-Redirect/). Steven Hargrove also has a good article on it [here](http://www.stevenhargrove.com/redirect-web-pages/comment-page-20/) with a follow up here. In addition, Webmaster Wo...
[ 0.2530718147754669, -0.2910037040710449, 0.6061841249465942, -0.12220349162817001, -0.35538652539253235, -0.1076088473200798, 0.40357673168182373, -0.16129307448863983, -0.24343343079090118, -0.301592618227005, 0.17650409042835236, 0.378952294588089, -0.22664329409599304, -0.24447907507419...
help keep the rankings up when you start the migration. I'll keep looking and see what I can find for you. Cheers and good luck!
[ 0.5553982853889465, 0.03152378275990486, 0.6360692381858826, 0.20929056406021118, -0.04224014654755592, -0.24863764643669128, 0.2317839413881302, 0.8851880431175232, -0.391639769077301, -0.7530144453048706, 0.07094790786504745, 0.3131411373615265, 0.5656655430793762, -0.09663796424865723, ...
What is the best way to view the HTTP response headers from a request against a particular URL? Telnet or is there some other really good command or tool? I use the [httpfox](https://addons.mozilla.org/en-US/firefox/addon/6647) Firefox extension to view all HTTP requests and responses (including header and body) initia...
[ 0.3197779059410095, -0.03237202763557434, 0.5280570983886719, -0.003160848282277584, 0.0007379178423434496, -0.1601845771074295, -0.08400201052427292, -0.23751267790794373, -0.4075814485549927, -0.622203528881073, -0.12579616904258728, 0.6593608260154724, -0.17572222650051117, -0.240228116...
I'm trying to use MVC for a new project after having been around the block with all the samples and tutorials and such. However, I'm having a hard time figuring out where certain things should take place. As an example, I have an entity called Profile. This entity contains the normal profile type stuff along with a Da...
[ 0.5996992588043213, 0.05817921459674835, 0.49777868390083313, -0.04713444411754608, -0.014124222099781036, -0.2815472483634949, 0.10633126646280289, 0.13891401886940002, -0.29026100039482117, -0.6053354740142822, 0.18745848536491394, -0.04353359714150429, 0.06553224474191666, 0.43256437778...
date? Should I be checking for that in the model binder? Should all my validation go in the model binder? Is it ok to have only a few things validated in the model binder and validate the rest in the controller or the model itself? Here's the code I have now, but it just doesn't look right to me. Seems dirty or smelly...
[ 0.446088582277298, -0.14303076267242432, 0.6544387340545654, -0.10677541792392731, 0.28933167457580566, -0.2701570689678192, 0.011752592399716377, -0.16021199524402618, -0.03947209194302559, -0.5648641586303711, 0.15493470430374146, 0.21613743901252747, -0.13705682754516602, 0.403829902410...
DateTime birthDate; var form = controllerContext.HttpContext.Request.Form; var state = controllerContext.Controller.ViewData.ModelState; var profile = new Profile(); profile.FirstName = form["FirstName"]; profile.LastName = form["LastName"]; prof...
[ -0.03187317028641701, -0.8056989908218384, 0.8450278639793396, 0.017762750387191772, 0.24285118281841278, 0.296987920999527, 0.23359040915966034, -0.03612476587295532, -0.2630704641342163, -0.5860896110534668, -0.1523730754852295, -0.07296989858150482, 0.05114087089896202, 0.52636748552322...
profile.Address2 = form["Address2"]; profile.City = form["City"]; profile.State = form["State"]; profile.Zip = form["Zip"]; profile.Phone = form["Phone"]; profile.Email = form["Email"]; profile.Created = DateTime.UtcNow;
[ 0.26431751251220703, -0.6808124780654907, 0.4962913691997528, 0.03908969461917877, 0.15203750133514404, 0.1133933961391449, 0.4917636513710022, 0.0997677892446518, -0.06917313486337662, -0.9921730160713196, -0.31404492259025574, -0.0950532853603363, -0.08636792749166489, 0.2921539843082428...
profile.IpAddress = controllerContext.HttpContext.Request.UserHostAddress; var dateTemp = string.Format("{0}/{1}/{2}", form["BirthMonth"], form["BirthDay"], form["BirthYear"]); if (string.IsNullOrEmpty(dateTemp)) state.AddModelError("BirthDate", "Required"); ...
[ -0.07606051862239838, -0.3623693287372589, 0.9182974696159363, -0.3066999316215515, 0.3937126100063324, 0.24387480318546295, 0.28768470883369446, -0.09492219984531403, -0.3657482862472534, -0.6131293773651123, -0.1715857833623886, 0.11773376166820526, -0.17468829452991486, 0.08676379919052...
state.AddModelError("BirthDate", "Invalid"); else profile.BirthDate = birthDate; return profile; } } } ``` Building on the sample code above, how would you do the validation message for a 3 part field? In the case above, I'm using a completely separate key ...
[ 0.5486761927604675, 0.0059487465769052505, 0.15511691570281982, -0.13133931159973145, 0.3120403587818146, 0.19776128232479095, 0.3616529107093811, -0.42998677492141724, -0.05157224461436272, -0.3255292475223541, -0.09407418966293335, 0.14563001692295074, -0.15536712110042572, 0.39543831348...
a field in the form, because I don't want an error message to appear beside all 3 fields. I only want it to appear to the right of the Year field. I think it is reasonable to do validation in the model binder. As Craig points out, the validation is mostly the property of your business domain, however: 1. Sometimes you...
[ 0.19936001300811768, 0.36949265003204346, 0.16034792363643646, 0.18723542988300323, -0.13377879559993744, -0.25109001994132996, 0.45716020464897156, -0.28628116846084595, -0.07772614806890488, -0.16879619657993317, -0.07157471776008606, 0.4003494679927826, -0.16880935430526733, 0.101202517...
desribe validation knowlege using attributes (like the DataAnnotation attribute [Required]), or inject some business layer validation service into a custom model binder. In these situations the model binder is an ideal place to take care of validation. That being said, model binding (finding, converting, and shufflin...
[ 0.3490437865257263, -0.1497187316417694, 0.37318530678749084, 0.5048049688339233, -0.05113080143928528, -0.41646990180015564, 0.15632596611976624, -0.6667768359184265, -0.03366411104798317, -0.40702024102211, -0.0522129163146019, 0.8562475442886353, -0.03191085904836655, 0.0037849468644708...
of object you can derive from the DefaultModelBinder and override the OnPropertyValidating method for property level validations or OnModelUpdated if you need the holistic view. > Here's the code I have now, but it > just doesn't look right to me. Seems > dirty or smelly. For your specific code I would try to writ...
[ 0.006958204787224531, 0.07700386643409729, 0.3402807414531708, -0.06369682401418686, -0.11659200489521027, -0.09594731032848358, 0.22545012831687927, -0.2154504954814911, 0.00038794081774540246, -0.9109055995941162, 0.10089269280433655, 0.3322541415691376, -0.45142045617103577, 0.336652904...
directly to the form. These things can give you more flexibility. More thoughts here: [6 Tips for ASP.NET MVC Model Binding](http://odetocode.com/Blogs/scott/archive/2009/04/27/12788.aspx).
[ 0.18268953263759613, -0.2874143421649933, 0.3251655697822571, 0.19905985891819, -0.052499886602163315, -0.004050202202051878, 0.07972922921180725, -0.42161068320274353, -0.13750049471855164, -0.5270552039146423, -0.3052723705768585, 0.3744319677352905, 0.00616335729137063, -0.2792564332485...
I've tried looking at similar problems, but could not easily find one that helped my problem. I've created a project in C++ and am working on UNIX to compile, link, and run it. My specific problem is an undefined reference to a method I declare in a separate file. In the file SharedCache.cpp, I have the following met...
[ 0.05751544609665871, -0.047557272017002106, 0.3403163254261017, -0.060513440519571304, 0.09712674468755722, 0.194181427359581, -0.0419999398291111, -0.21136878430843353, 0.030610766261816025, -0.5460274815559387, 0.13814719021320343, 0.22714655101299286, -0.6587983965873718, 0.325674027204...
if(cache[cacheSet][cacheLine] != NULL){ evictPID = cache[cacheSet][cacheLine]->PID; } uint PID= calcPID(address); uint tag= calcTag(address); cache[cacheSet][cacheLine]->setLine(PID, tag); //mutex method return PID; } ``` The line `uint cacheLine = static_cast<uint>( uniformDistr( numLi...
[ 0.057435180991888046, -0.2179979532957077, 0.41779524087905884, -0.16375182569026947, -0.017124276608228683, 0.2959512770175934, -0.04942215979099274, -0.3018695116043091, 0.0816001147031784, -0.6846802234649658, -0.15270595252513885, 0.3330656588077545, -0.5039907693862915, 0.183479934930...
the distributions.cpp to make sure a distributions.o file exists to link with. From here, I don't know where to go, because this has not solved the problem. I've not used KDevelop, however, on the command line you would just add distributions.o as an input file to the linking process. No need for dashes or leaving of...
[ 0.546716034412384, -0.11719875782728195, 0.12919050455093384, 0.31295689940452576, -0.08942567557096481, -0.36792266368865967, -0.37260109186172485, 0.3885062038898468, -0.4965090751647949, -0.8079695105552673, 0.06412161886692047, 0.2697712779045105, -0.3816205561161041, 0.264204114675521...
I'm creating a Powershell script to deploy some code and part of the process is to call a command-line compression tool called RAR.EXE to back-up some folders. I'm attempting to dynamically build out the parameters and then have powershell call the command with the variables but I'm running into trouble. It isn't wor...
[ 0.5671283006668091, 0.1962885707616806, -0.0664082020521164, 0.00952528789639473, -0.08492251485586166, -0.2985297739505768, 0.4379219710826874, -0.1911468356847763, -0.34990593791007996, -0.36650940775871277, 0.15072768926620483, 0.45518502593040466, -0.5447540879249573, 0.511053562164306...
succeed" & cmd /c echo foo echo "why does this echo out an additional double quote?" $param = "/c echo foo" & cmd "$param" echo "this does the same" $param = "/c echo foo" & cmd $param echo "escaping the slash doesn't work either..." $param = "`/c echo foo" & cmd $param echo "this fails, but why?" $cmd = "cmd /c ec...
[ 0.3726217746734619, 0.22548606991767883, 0.35004326701164246, -0.35401037335395813, 0.33048659563064575, 0.06637922674417496, 0.9353649020195007, -1.0893886089324951, -0.06178050860762596, -0.026263071224093437, -0.21843142807483673, 0.6261438727378845, -0.5604646801948547, -0.137688606977...
discarded after the command finishes and the scope goes away. However since the cmd is an EXE it executes in a completely different process. FWIW, you get similar output directly from cmd.exe: ``` > cmd "/c echo foo" foo" ``` So the extra quote on the end is a cmd.exe issue. Typically you need to keep the command s...
[ 0.44383370876312256, -0.15583384037017822, 0.5206969380378723, -0.317481130361557, 0.11304930597543716, -0.10858803987503052, 0.22179044783115387, -0.2558649480342865, -0.3689839839935303, -0.3807888329029083, -0.14404550194740295, 0.5286855697631836, -0.4827166199684143, 0.239849403500556...
scope 48> $foo foo ``` The notable exception here is that Invoke-Expression behaves like an "evaluate this string" function. Use with care, *especially* if the user provides the string. Your day could suck if they provided "ri C:\ -r". In this case, as others have suggested I would pull the /c out of the string $pa...
[ 0.519282877445221, 0.05335107073187828, 0.20973125100135803, -0.19149504601955414, -0.20946799218654633, -0.09322741627693176, 0.5011337399482727, -0.6010516881942749, -0.09755537658929825, -0.3868629038333893, -0.0504632405936718, 0.7433356046676636, -0.41671323776245117, -0.1549848616123...
$param Arg 0 is </c echo foo> ``` This shows that cmd.exe receives "/c echo foo" as a *single* argument. "/c" should be a separate argument from "echo foo" (the command to execute).
[ 0.27285557985305786, 0.25356635451316833, 0.1381826549768448, -0.3854701817035675, -0.17447344958782196, 0.2014085352420807, 0.3886285722255707, -0.62735515832901, -0.2893120050430298, 0.24292750656604767, -0.16456224024295807, 0.4218549132347107, -0.5762599110603333, -0.02830611728131771,...
I was wandering if it's possible to open a source code in text editor and display it with decorations (Java for example)? I don't need fancy eclipse editor features, just properly decorated source code with line numbers, it can even be read-only. I read that RCP have many limitations with text editors as it drags behin...
[ 0.6381044387817383, 0.12675532698631287, 0.08869238942861557, 0.3147551119327545, -0.23779837787151337, -0.3512228727340698, 0.23613044619560242, 0.127048522233963, -0.3517736792564392, -0.4967377781867981, 0.3162800073623657, 0.20214664936065674, 0.27991941571235657, 0.07228271663188934, ...
(3.4.2) itself ships with a sample XML editor that implements syntax highlighting. Just create a new plugin project, select 'This plugin will make contributions to the UI' and choose 'No' for Rich client application. The following wizard page offers a 'Plugin with an editor' template, which is your friend. It may be t...
[ -0.1229691132903099, -0.24800466001033783, 0.3085385262966156, 0.04148746654391289, -0.22218722105026245, -0.1774284839630127, 0.18840447068214417, 0.08969032764434814, -0.06901885569095612, -0.6346936225891113, -0.1899888515472412, 0.5233957171440125, -0.2915416359901428, -0.2785930037498...
I need to tweak some things inside Tomcat 6.0 before any web applications or listeners are started. What's the standard method for doing this? I can't do this from a web application or servlet init() since it is too late by the time it is loaded. Creating a custom [LifecycleListener](http://tomcat.apache.org/tomcat-6.0...
[ 0.5882620811462402, 0.09811839461326599, 0.41874074935913086, 0.010750050656497478, -0.03398425132036209, -0.3579646944999695, 0.29692959785461426, -0.24097318947315216, -0.011602438054978848, -0.25378796458244324, 0.19173729419708252, 1.0133776664733887, -0.10341993719339371, 0.0017741976...
In a controller in my Rails app, I can do this: ``` before_filter :login_required, :except => :index ``` But I would like to apply the filter not only based on the action name but on the format of the request. In other words, I would like to do something like this: ``` before_filter :login_required, :except => {:ac...
[ 0.018816817551851273, -0.5548586249351501, 0.6126134395599365, 0.1139913871884346, 0.015102352015674114, -0.25822940468788147, -0.07850729674100876, -0.2688468098640442, -0.31658628582954407, -0.6135635375976562, 0.044693414121866226, 0.6043522953987122, -0.540722131729126, -0.029507096856...
I have a view and it's composed of two tables. I want to edit a value in each table through the view and save those changes but LINQ is throwing an error about not being able to edit two values on the same view. Does anyone know of a good workaround? Thanks SQLServer doesn't support updating columns from multiple tab...
[ 0.48310109972953796, 0.07993253320455551, 0.34963178634643555, -0.07109633833169937, -0.14575015008449554, 0.1982521116733551, 0.12276642769575119, -0.10294923931360245, -0.39024922251701355, -0.8061521053314209, 0.3249320387840271, 0.30751654505729675, -0.26523372530937195, 0.294752508401...
also use a stored procedure to update the individual tables independently in the same transaction. This stored procedure could be added as a method on your data context using the designer. Assuming that it returns the same schema as the view when it completes, it could return an object of the same type as the view. [R...
[ 0.23198308050632477, -0.010471141897141933, 0.6590569615364075, 0.20556293427944183, -0.041625916957855225, 0.29651588201522827, -0.09232795983552933, -0.2677914500236511, -0.5240553617477417, -0.6158803105354309, -0.050707314163446426, 0.6376693248748779, -0.37190139293670654, 0.194300726...
base > table. The columns being modified in > the view must directly reference the > underlying data in the table columns. > The columns cannot be derived in any > other way, such as through the > following: An aggregate function: > AVG, COUNT, SUM, MIN, MAX, GROUPING, > STDEV, STDEVP, VAR, and VARP. A > compu...
[ 0.07330857217311859, -0.04856846481561661, 0.5525469183921814, 0.14763854444026947, -0.210857093334198, 0.2921927869319916, 0.246933713555336, -0.40416914224624634, 0.07139962166547775, -0.5375312566757202, -0.13778601586818695, 0.04511326923966408, -0.446544349193573, 0.11134503781795502,...
updatable. The columns > being modified are not affected by > GROUP BY, HAVING, or DISTINCT clauses. > TOP is not used anywhere in the > select\_statement of the view together > with the WITH CHECK OPTION clause.
[ -0.28525176644325256, -0.2138785719871521, 0.48770871758461, -0.1380554437637329, 0.06124028563499451, -0.16421328485012054, -0.0029904332477599382, -0.06610829383134842, -0.4504527449607849, -0.37141793966293335, -0.5392814874649048, 0.34957513213157654, -0.6396201848983765, -0.1760793477...
I am thinking that this would be an Apache server with some custom pages, or possibly a java application. Used for browser or http client testing, it should give me a variety of 500 errors when a specific page is requested. Give me a page that responds in 5 seconds, 10, 30 or whatever. Give me a page where the first by...
[ 0.3199785351753235, 0.01958114095032215, 0.260841429233551, 0.31182852387428284, -0.23785360157489777, 0.18279510736465454, 0.3908722996711731, -0.030819188803434372, -0.18265563249588013, -0.640922486782074, 0.21456970274448395, 0.13499385118484497, -0.12385430932044983, -0.03124049864709...
I would certainly like to use what someone else has already made. You can't frequently run all your tests, because they're too slow. This is an inevitable consequence of your project getting bigger, and won't go away. Sure, you may be able to run the tests in parallel and get a nice speedup, but the problem will just c...
[ 0.603338897228241, 0.050316739827394485, -0.16539090871810913, 0.548588752746582, 0.33874914050102234, 0.13396431505680084, 0.0408184789121151, -0.03630167245864868, -0.2928560674190521, -0.6439319252967834, 0.3632548451423645, 0.4372600018978119, 0.13051432371139526, 0.2524362802505493, ...
can do this effectively: run the tests for the module you're working on frequently, the tests for the component you're working on occasionally, and the project-wide tests infrequently (perhaps before you're thinking of checking it in). You may have integration tests, or full system tests which you may run overnight: th...
[ 0.5709769129753113, -0.1155504360795021, -0.28624284267425537, 0.14063136279582977, 0.22594504058361053, -0.43482688069343567, 0.2890891134738922, -0.3515291213989258, -0.24700811505317688, -0.5348055958747864, 0.008157161064445972, 0.8708191514015198, -0.10496027767658234, -0.392476439476...
Consider this scenario. I have an object, lets call it.... Foo. Foo raises a simple event named "Loaded". As part of the information for the event, consumers will need to know which foo object raised the event. Our team has adopted the following pattern. 1) Create a new class that inherits from EventArgs - for example...
[ -0.06310591846704483, -0.05400635674595833, 0.1691465675830841, -0.1956363171339035, -0.17197631299495697, 0.03860369697213173, -0.165114626288414, -0.41775327920913696, -0.21430563926696777, -0.243130624294281, -0.1100037470459938, 0.5806135535240173, -0.352594792842865, 0.174203842878341...
signature: ``` Loaded(this, new FooEventArgs(this)); ``` Essentially what this does is makes the "sender" the foo object, but it *also* puts the foo object reference into the event argument as a strongly typed property. One advantage for doing this is that no one has to bother with casting "sender" when they handl...
[ 0.10932906717061996, 0.11036469787359238, 0.39101627469062805, -0.2788968086242676, -0.1411670744419098, -0.29298096895217896, 0.24032732844352722, -0.10317327827215195, -0.08859942108392715, -0.3264080584049225, -0.11368091404438019, 0.5954029560089111, -0.23762404918670654, 0.31226068735...
it comes out as null, the API actually breaks so it can be fixed at compile time. To me, this pattern seems like it might be overkill. Should they be trusting the "sender" parameter more, and ditching the custom event arguments? My team argues that no one really uses the sender parameter. What's the best practice for ...
[ 0.08715440332889557, -0.002684633247554302, 0.20198887586593628, 0.004544205032289028, -0.34619566798210144, -0.12469657510519028, 0.4258648157119751, 0.17291420698165894, -0.21809139847755432, -0.42368587851524353, -0.047989025712013245, 0.4523495137691498, -0.38947832584381104, 0.1463516...
used for other state like a tree node for a tree event, a (settable) boolean for a cancelable event etc. We use the common pattern since it is used by the BCL classes also, and making a difference for "self-made events" is potentially confusing. Also, we have a global IoC publisher-subscriber pattern but this one only...
[ 0.44873592257499695, -0.2741646468639374, 0.04126488417387009, 0.3091709613800049, -0.09659354388713837, -0.5150286555290222, 0.02521316334605217, -0.15012386441230774, -0.20349742472171783, -0.323225736618042, -0.17264379560947418, 0.0324510857462883, -0.43333131074905396, 0.1005924567580...
I am having a problem with my regular expression: `<a.*href=[\"'](.*?)[\"'].*>(.*?)</a>`. It is, as you can probably tell, supposed to take all the links from a string of HTML and return the link text in group 2, and the link target in group 1. But I am having a problem. If I try it in Javascript (using <http://www.reg...
[ -0.212992861866951, 0.056179292500019073, 0.5160828232765198, -0.3243100345134735, -0.14102818071842194, -0.2304317057132721, 0.5371779799461365, -0.2371714562177658, -0.09308014065027237, -0.5836219787597656, -0.27842268347740173, 0.5345859527587891, -0.690141499042511, -0.161142036318779...
more and it works exactly like it is supposed to, but with the Java version, it just get 1 or 2 links per page. Sorry if this is obvious, but I am new to regular expressions. Thanks, Isaac Waller Edit: I think it might be something wrong with my regex. See, from this Apache indexof page: ``` <tr><td valign=...
[ 0.13961614668369293, -0.03515280783176422, 0.3322962522506714, 0.4504687488079071, -0.3044412434101105, 0.1960480958223343, 0.38208648562431335, -0.6792730689048767, -0.21866552531719208, -0.5354579091072083, 0.4267241060733795, 0.8102573156356812, 0.3131236732006073, -0.36518871784210205,...
valign="top"><img src="/icons/sound2.gif" alt="[SND]"></td><td><a href="Colbie%20Caillat%20-%20Bubbly.mp3">Colbie Caillat - Bubbly.mp3</a></td><td align="right">27-Aug-2008 11:49 </td><td align="right">215K</td></tr> <tr><td valign="top"><img src="/icons/sound2.gif" alt="[SND]"></td><td><a href="Colbie%20Caillat%20-%...
[ -0.9787521958351135, -0.14133155345916748, 0.590457022190094, -0.04495299980044365, -0.43052077293395996, -0.03111858293414116, 0.7567498683929443, -0.2850475013256073, -0.2742792069911957, -0.5812959671020508, 0.06585707515478134, 0.9073024988174438, 0.33153659105300903, -0.02426379546523...
align="right">26-Aug-2008 19:03 </td><td align="right">193K</td></tr> <tr><td valign="top"><img src="/icons/sound2.gif" alt="[SND]"></td><td><a href="David%20Bowie%20-%20Absolute%20Beginners.mp3">David Bowie - Absolute Beginners.mp3</a></td><td align="right">26-Aug-2008 19:04 </td><td align="right">155K</td></tr> <tr...
[ -0.1475405991077423, 0.1377173811197281, 0.41868722438812256, 0.1201077476143837, -0.26354676485061646, -0.29636430740356445, 0.25727832317352295, -0.6638491749763489, 0.04162837564945221, -0.36764517426490784, -0.13176140189170837, 0.7835957407951355, 0.09103667736053467, -0.4270149171352...
backslashes are not really needed in the pattern. There are some other possible issues with the pattern. You are using a greedy match before the href property, which means that it will match from the start of the first link on the line to the href property of the last link on the line. Make the match non-greedy by cha...
[ 0.1417931169271469, -0.36489567160606384, 0.5219816565513611, 0.1049739420413971, -0.10166364163160324, -0.15187403559684753, 0.5480832457542419, -0.036613915115594864, -0.20240584015846252, -0.38995540142059326, -0.304299920797348, 0.5091690421104431, -0.4969441592693329, 0.21798335015773...
breaks, so if there are line breaks in the link code or in the text in the link, the link will not be matched. You can use `[\W\w]` instead of `.` to match any character. So, removing the backslashes, making the matches non-greedy and allowing line breaks would make the pattern: ``` Pattern myPattern = Pattern.compil...
[ 0.09447171539068222, 0.07534974068403244, 0.5887411832809448, -0.007935470901429653, 0.36936530470848083, -0.10118073225021362, 0.7205168008804321, -0.06529262661933899, -0.29038429260253906, -0.44148775935173035, -0.318774551153183, 0.28049004077911377, -0.4937937557697296, 0.166675180196...
I've been banging my head on my desk for hours trying to figure out why I can't access the entry.author.name content? I've tried every possible way to access it but failed. But when I loop through all nodes with xml.children I see the author node. I see the author node is apart of the atom namespace but it doesn't ...
[ -0.1762993186712265, 0.051024165004491806, 0.5063748359680176, 0.025526372715830803, -0.5689088106155396, -0.07585390657186508, 0.2072954624891281, -0.5232827067375183, -0.6016160845756531, -0.22058196365833282, -0.26558056473731995, 0.255769819021225, -0.44533199071884155, 0.4792076349258...