text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
break; case PrimitiveType.STRING: sb.Append(@"([a-zA-Z0-9]*)"); break; } } sb.Append("$"); _pattern = new Regex(sb.ToString(), RegexOptions.Compiled); ``` The actual slow part... ``` public System.Text.RegularExpressions.Match Match(string input) { if (input == null) th...
[ -0.10672542452812195, -0.14624829590320587, 0.5451227426528931, -0.327119380235672, 0.3522668480873108, 0.22479912638664246, 0.49775639176368713, -0.31201907992362976, -0.3139181137084961, -0.45682570338249207, -0.40374499559402466, 0.49313125014305115, -0.6184999942779541, -0.040994279086...
over each case in the Match object later on. Any tips or modifications that could drastically help? Or is this running slowly to be expected? EDIT FOR CLARITY: Sorry, I don't think I was clear enough the first time around. I use an xml file to generate regex's for a specific layout. I then run through a file for a d...
[ 0.5920029282569885, -0.13599924743175507, 0.47018975019454956, 0.1775551438331604, -0.07319821417331696, 0.040474336594343185, 0.004337863065302372, -0.029341958463191986, -0.2537810206413269, -0.8519721627235413, 0.23520848155021667, 0.18118669092655182, -0.7224794030189514, -0.1498636454...
regex? You should just remove duplicate tabs, then split the text on \t. Now you have all of your columns in an array. You can use your ColumnDef object collection to tell you what each column is. **Edit:** Once you have things split up, you could optionally use regex to verify each value, this should be much faster ...
[ 0.16761015355587006, -0.14692257344722748, 0.49716898798942566, 0.16597464680671692, -0.12841179966926575, 0.16923555731773376, 0.1683967411518097, -0.021915659308433533, -0.4298717975616455, -0.7546516060829163, 0.01388084888458252, 0.5448946356773376, -0.41569784283638, 0.005471053067594...
I try to answer [this question](https://stackoverflow.com/questions/803936/clear-remove-javascript-event-handler) a few minutes ago and prepared this example for myself : ``` <script> function trialMethod() { alert('On Submit Run!'); return true; } function trialMethod2() { alert('On Submit Run tria...
[ 0.000952238857280463, -0.10849282890558243, 0.1446966677904129, -0.12385803461074829, -0.13075193762779236, 0.0795515701174736, 0.38198840618133545, -0.5790464282035828, 0.09065181016921997, -0.6788744330406189, -0.091034896671772, 0.5728743672370911, -0.40650683641433716, -0.0373230725526...
jQuery stores every event handler function in an array that you can access via `$("#foo").data('events')`. The `unbind` function looks just for given function in this array. So, you can only `unbind()` event handlers that were added with `bind()`
[ 0.08109260350465775, -0.19210535287857056, 0.18789860606193542, -0.11584058403968811, 0.0428047738969326, -0.21720129251480103, 0.05532434210181236, 0.1682630330324173, -0.12110630422830582, -0.4307004511356354, -0.16007757186889648, 0.4398961663246155, -0.4099952280521393, 0.0597360506653...
I want to be able to distinguish between a generic and regular (non-generic) version of a class. Much like the .NET framework does with it's generic and non-generic versions of several of it's interfaces and collection classes. ([Queue](http://msdn.microsoft.com/en-us/library/system.collections.queue.aspx), [Queue(T)](...
[ 0.20146045088768005, 0.05485418438911438, -0.1356593668460846, -0.01130584068596363, -0.26684221625328064, -0.1553255319595337, 0.21008482575416565, 0.24222542345523834, -0.41114136576652527, -0.7979567050933838, -0.1589328497648239, 0.12442068010568619, -0.1538892388343811, 0.444041103124...
I have a domain object used in an identity map (the keys are the object's `Id` property). Pseudocode: ``` map = new Mapping(); map[domainObj.Id] = 'foo'; ``` I observe the object to tell me when it has been saved to the database: ``` domainObj.bind('saved', function() { map[domainObj.Id] = 'new foo!' }) ``` ...
[ -0.07151315361261368, 0.16164377331733704, 0.41669315099716187, -0.1561596393585205, 0.2052922397851944, -0.2988126873970032, 0.19638963043689728, -0.30027544498443604, -0.007183940149843693, -0.8108665943145752, 0.012976672500371933, 0.3529399037361145, -0.42288118600845337, 0.48555186390...
am using a language that does not allow objects as keys in a mapping [JavaScript] 2. The `Id` field *must* be generated on the server when saving a new object --- **Update** Thanks for the feedback. I really would like to have value objects mapped the same way as entities: just because the value object has not been ...
[ 0.10033062845468521, 0.2667659819126129, 0.27402395009994507, -0.008958392776548862, 0.12743298709392548, -0.24281951785087585, 0.19224637746810913, -0.35551193356513977, -0.19083692133426666, -0.678013026714325, 0.1980975717306137, 0.40348467230796814, -0.10881424695253372, 0.136915639042...
pretty much straight from Igor's answer: each object gets a random id assigned to it upon instantiation. It is unique, immutable and unchanging during the lifetime of the context in which the object lives. It is there for both entities from the db and new instantiations. The tweak for entities is that it is set to matc...
[ 0.4149158000946045, -0.038695093244314194, 0.28000450134277344, 0.2130149006843567, -0.11375146359205246, -0.13345888257026672, 0.12276517599821091, -0.04776142165064812, -0.10180722177028656, -0.3049643635749817, 0.08202943950891495, 0.14866885542869568, -0.24930408596992493, 0.2673447430...
an **entity**. Until the object becomes an entity you cannot really put it in an identity map like yours - it doesn't make sense, since you cannot pull it out (since you don't have a unique key to find it). One possible approach: 1. Add a flag to the class which indicates the state of the object (new / saved). 2. I...
[ 0.022345127537846565, -0.3710719347000122, 0.06566222012042999, 0.2505524158477783, 0.04024398699402809, -0.24014276266098022, 0.28582870960235596, -0.1309269219636917, -0.2857430577278137, -0.7005288004875183, -0.27197587490081787, 0.3346644639968872, -0.1902817189693451, 0.19894102215766...
between client and server IDs) 4. Once the object has been saved, replace the client ID with the server ID, set the state to saved, move to the main identity map (if necessary). See here about the [entities vs. value objects](http://calenlegaspi.blogspot.com/2007/02/entity-vs-value-object_27.html)
[ 0.11727803945541382, -0.19163231551647186, 0.2473210096359253, 0.16914965212345123, 0.3007250428199768, 0.08472462743520737, -0.0645446926355362, -0.19877609610557556, -0.2658429443836212, -0.3393409848213196, -0.02131914719939232, 0.6597988605499268, -0.20539125800132751, 0.01180175505578...
**Problem:** to understand the following timestamp ``` 1241036430 ``` at ~/.history ``` : 1241036336:0;vim ~/.zshrc : 1241036379:0;vim ~/bin/HideTopBar : 1241036421:0;ls : 1241036430:0;cat ~/.history ``` when I have ``` setopt EXTENDED_HISTORY HISTFILE=~/.history ``` in .zshrc. **How can you read the timesta...
[ -0.05192553251981735, -0.04270340874791145, 0.8673102259635925, -0.28236040472984314, 0.12132176011800766, -0.12410476803779602, 0.11791403591632843, -0.167920783162117, -0.32847678661346436, -0.7274425029754639, -0.40495455265045166, 0.39948058128356934, -0.21851563453674316, 0.2517393529...
$t; "@a\n" } ``` * (There is also a little [presentation](http://perl.plover.com/classes/mybin/samples/slide017.html) :)) It handles lots of cases, and seem to understand both timestamps in seconds and mini-seconds, etc. ``` $ localtime < ~/.histfile <snip> : Sat Sep 17 05:55:17 2016:0;cat localtime ```
[ 0.10497213155031204, -0.14386622607707977, 0.544633686542511, -0.1712374985218048, 0.06735195219516754, 0.1452505886554718, 0.6171308159828186, 0.2138107717037201, -0.2876860499382019, -1.1682534217834473, -0.38142475485801697, 0.13607487082481384, -0.13407810032367706, 0.4674113094806671,...
I created my own build.xml which has: ``` <target name="compile"> <mkdir dir="build"/> <javac destdir="build"> <src path="src"/> </javac> </target> <target name="build" depends="compile"> <mkdir dir="dist"/> <jar destfile="dist/app.jar" basedir="build" /> </target> <target name="run" d...
[ 0.31224384903907776, 0.2839755713939667, 0.17074215412139893, -0.3747752606868744, -0.3373074531555176, 0.3807149827480316, 0.5076910853385925, -0.2810221314430237, -0.07598243653774261, -1.0136778354644775, 0.26925259828567505, 0.3725924789905548, -0.20301969349384308, 0.05024474486708641...
exception that it couldn't locate my icons. When I move them by myself then it works. I tried to use ``` <copy todir="build/app/icons"> <fileset dir="src/app/icons"/> </copy> ``` It works, but I would like to do it without the copy command. Is there any parameter to javac? Or something else? Thank you for answ...
[ -0.032081976532936096, 0.13133715093135834, 0.21109804511070251, 0.009396007284522057, 0.04993455111980438, 0.09890386462211609, 0.4206615090370178, -0.01971692219376564, -0.3244207203388214, -0.8246573209762573, 0.09938053041696548, 0.6264779567718506, -0.3392737805843353, 0.0047868052497...
Assuming I want to sell a hardware appliance with only my software on it, what do I need to do? * Where can I find the hardware? * How can I remote into the machine to fix things if I need to? Google used to do this with the search appliance (don't know if they still do). VMWare should have a website like cafepress w...
[ 0.48350298404693604, 0.4597470164299011, 0.4305041432380676, 0.22153343260288239, 0.2143799066543579, 0.03884807601571083, 0.3437878489494324, -0.03884444385766983, -0.3883940279483795, -0.6196832060813904, 0.19050858914852142, 0.6521989107131958, 0.00821211189031601, 0.02163749188184738, ...
out [here](http://www.google.com/enterprise/search/gsa.html) Here is another example, [trixbox](http://www.trixbox.com/products/appliance?utm_source=trixboxOrg&utm_medium=link&utm_content=products-appliance&utm_campaign=fonalitysites). You need to make some decisions. For example: Are you going to provide the hardwar...
[ 0.6211357712745667, 0.004911173600703478, 0.4736146926879883, -0.015471835620701313, 0.2198515087366104, 0.1711929738521576, -0.20701707899570465, -0.21370463073253632, -0.33437997102737427, -0.16576291620731354, -0.01639050617814064, 0.27181828022003174, 0.09907662868499756, 0.18476097285...
react. Actually VMWARE image could be the first prototype and might be the way to go. Just sell them the image and let your customers take care of the hardware.
[ 0.6777853965759277, -0.277902215719223, 0.16623632609844208, 0.5548039674758911, -0.31970179080963135, 0.13515989482402802, -0.05645935237407684, 0.40447700023651123, 0.14371907711029053, -0.455993115901947, 0.3490341305732727, 0.7718316316604614, 0.14077426493167877, -0.01664724014699459,...
I encounter a totally strange behavior of the Java compiler. I can't cast a supertype to a subtype when **cyclic generic type relation** is involved. **JUnit test case** to reproduce the problem: ``` public class _SupertypeGenericTest { interface ISpace<S extends ISpace<S, A>, A extends IAtom<S, A>> { } ...
[ 0.008466875180602074, -0.044549353420734406, 0.0530102476477623, 0.045876793563365936, -0.19832339882850647, -0.12126586586236954, 0.34476906061172485, -0.40011489391326904, 0.04250946268439293, -0.8237727284431458, 0.012497996911406517, 0.09678391367197037, -0.612555205821991, 0.311548680...
implements IAtom<Space, Atom> { } public void test() { ISpace<?, ?> spaceSupertype = new Space(); IAtom<?, ?> atomSupertype = new Atom(); Space space = (Space) spaceSupertype; // cast error Atom atom = (Atom) atomSupertype; // cast error } } ``` **Compiler error output:...
[ -0.006769566331058741, -0.03998323529958725, -0.34788063168525696, -0.05968436971306801, 0.11554859578609467, 0.15652386844158173, 0.6040403246879578, -0.5792672038078308, 0.1594228297472, -0.7316370010375977, -0.21621139347553253, 0.2451767921447754, -0.6689948439598083, -0.13603687286376...
Space space = (Space) spaceSupertype; ^ _SupertypeGenericTest.java:34: inconvertible types found : pinetag.data._SupertypeGenericTest.IAtom<capture#94 of ?,capture#48 of ?> required: pinetag.data._SupertypeGenericTest.Atom Atom atom = (Atom) atomSupertype;
[ -0.09842675179243088, 0.11825976520776749, 0.08596295118331909, 0.20923097431659698, 0.1911517083644867, 0.1508011519908905, 0.16052216291427612, -0.36023569107055664, -0.1725487858057022, -0.626784086227417, -0.5514182448387146, -0.18163518607616425, -0.6527765989303589, -0.01655649021267...
^ 2 errors ``` Note: I'm using Netbeans latest trunk, bundled Ant, latest Java 6 release. I tried using Ant from command line (Netbeans generates a build.xml file) but it results in same errors. **What is wrong?** Is there an elegant way solve the problem? The strange thing is: Netbeans doesn't mark errors (n...
[ 0.2475419044494629, 0.3587874472141266, 0.0845194160938263, -0.024853987619280815, -0.31856951117515564, -0.20498700439929962, 0.4384687840938568, 0.09569629281759262, -0.2837459146976471, -0.8246700763702393, 0.1661074012517929, 0.5249520540237427, -0.4018513858318329, -0.0960988551378250...
Ant from command line along with build.xml provided by Netbeans' would be neutral. **Am I missing something?** **EDIT 2:** Using **JDK7** library and JDK7 code format, netbeans compiles without errors/warnings! **(I'm using 1.7.0-ea-b55)** **EDIT 3:** Changed title to indicate that we're dealing with a ja...
[ 0.2883354723453522, 0.13590297102928162, 0.11519139260053635, -0.007891418412327766, -0.1534731686115265, -0.06582300364971161, 0.35043221712112427, 0.031096259132027626, -0.329716295003891, -0.9118391871452332, 0.08774780482053757, 0.373198926448822, -0.7470709085464478, -0.09508150815963...
their respective URLs, although for Sun it may take a while before the bug is publicly accessible). I've done that in the past and got really good responses where 1. one of the teams figured out what the correct approach was (give compile error, warning or nothing) 2. and the faulty compiler was fixed Since both com...
[ 0.5589753985404968, 0.43296632170677185, 0.06635896116495132, -0.04966126009821892, -0.16750839352607727, -0.2208627164363861, 0.49557963013648987, -0.18575410544872284, -0.04091528430581093, -0.5305877327919006, 0.02485641837120056, 0.5157912373542786, -0.6380124092102051, -0.086143769323...
any `.class` files, while `ecj` only complained about some unused variables (warnings) and produced all the expected `.class` files.
[ -0.2302766591310501, -0.09031658619642258, 0.05041591823101044, 0.25623592734336853, 0.053364019840955734, -0.4650707542896271, 0.3922245502471924, 0.20361314713954926, -0.07980530709028244, -0.21602347493171692, -0.6323079466819763, 0.4233432710170746, -0.4294942021369934, 0.2343679517507...
I have an app where I get a list of drives on the computer and when you select one I populate a tree control with the directories and files. I was thinking of trying this using linq to loop round each directory and get its child directories. Has anyone done anything like this before? Thanks You can use LINQ no probl...
[ 0.389962762594223, 0.11266344040632248, 0.48547640442848206, 0.3406270146369934, 0.26110056042671204, -0.14532729983329773, 0.05198034271597862, 0.011832977645099163, -0.4754762649536133, -0.4046597182750702, -0.09516016393899918, 0.7445954084396362, -0.40047526359558105, 0.235445365309715...
IEnumerable<TreeNode> subdirNodes = from subdir in subdirs select AddDirectory(subdir); IEnumerable<TreeNode> fileNodes = from file in files select new TreeNode(file.Name); return new TreeNode( directory.Name, subdirNodes.Concat(fileNodes).ToArray()); } ```
[ -0.2793426513671875, -0.20380455255508423, 0.3735230565071106, -0.3052385449409485, 0.12475251406431198, -0.1839320808649063, 0.3643660843372345, -0.26265305280685425, -0.22041970491409302, -0.6895198822021484, -0.6834433674812317, 0.4913060963153839, -0.3026287257671356, -0.01937292702496...
I have what I'd thought would be a simple query, but it takes 'forever'. I'm not great with SQL optimizations, so I thought I could ask you guys. Here's the query, with EXPLAIN: ``` EXPLAIN SELECT * FROM `firms_firmphonenumber` INNER JOIN `firms_location` ON ( `firms_firmphonenumber`.`location_id` = `...
[ -0.18462976813316345, 0.2543203830718994, 0.40446043014526367, 0.019916392862796783, 0.3289386034011841, 0.060389723628759384, -0.25966158509254456, -0.36638787388801575, -0.04927212744951248, -0.5853296518325806, -0.03460218757390976, 0.2757282853126526, -0.07614827156066895, 0.1981994062...
type, possible_keys, key, key_len, ref, rows, Extra 1, 'SIMPLE', 'firms_location', 'ALL', 'PRIMARY', '',
[ -0.07106560468673706, 0.10234355181455612, 0.30908358097076416, 0.13769114017486572, 0.5608177781105042, 0.6799632906913757, 0.05902063846588135, 0.20096100866794586, -0.12782174348831177, -0.5755855441093445, -0.36496758460998535, 0.12491100281476974, -0.49676352739334106, 0.1728289127349...
'', '', 73030, 'Using temporary; Using filesort' 1, 'SIMPLE', 'firms_firmphonenumber', 'ref', 'firms_firmphonenumber_firm_id', 'firms_firmphonenumber_firm_id', '4', 'citiadmin.firms_location.id', 1, '' ``` Keys on firms\_location: ``` Keyname Type Unique Packed Field Cardinality P...
[ -0.6112897396087646, 0.002909623319283128, 0.4830414950847626, 0.1392347365617752, 0.48309147357940674, 0.5629600286483765, -0.3416523039340973, 0.03712722659111023, -0.2670705020427704, -0.49148139357566833, -0.5901330709457397, 0.5541712641716003, -0.403016597032547, 0.36563944816589355,...
BTREE Yes No id 65818 firms_location_name_en BTREE No No name_en 65818 ``` Keys on firms\_firmphonenumber: ``` Keyname Type Unique Packed Field Cardinality PRIMARY
[ -0.4473980665206909, 0.4052535593509674, 0.1327674239873886, -0.048857904970645905, 0.1883290410041809, 0.3358975946903229, -0.16118508577346802, 0.058381255716085434, -0.31857040524482727, -0.278278648853302, -0.5628764033317566, 0.5471751689910889, -0.39760637283325195, 0.261596262454986...
BTREE Yes No id 85088 firms_firmphonenumber_firm_id BTREE No No location_id 85088 ``` It seems (to me) that mySQL refuses to use the firms\_location table's primary key - but I have no idea why. Any help would be *much* appreciated. --- Edit after solution posted -----------------------...
[ -0.3162333369255066, 0.6127596497535706, 0.549949586391449, -0.06557212769985199, 0.43939605355262756, 0.1915825456380844, -0.007356411311775446, 0.014801880344748497, -0.02907681278884411, -0.6404151320457458, -0.36476609110832214, 0.2755710482597351, -0.15130279958248138, 0.1445269137620...
) ORDER BY `firms_location`.`name_en` ASC, `firms_location`.id ASC LIMIT 100; #`firms_firmphonenumber`.`location_id` ASC LIMIT 100; ``` Result: ``` "id","select_type","table","type","possible_keys","key","key_len","ref","rows","Extra" 1,"SIMPLE","firms_location","index","PRIMARY","firm...
[ -0.37585029006004333, 0.1859184056520462, 0.4978002905845642, -0.06227530911564827, 0.4919029474258423, 0.452763170003891, -0.13903698325157166, -0.48496508598327637, -0.28503185510635376, -0.5275214910507202, -0.3884336054325104, 0.7252171635627747, -0.24546675384044647, 0.240690395236015...
FirmPhoneNumber(models.Model): location = models.ForeignKey(Location, db_index=True) number = PhoneNumberField(db_index=True) class Meta: ordering = ("location", "number") ``` Changing the Locaion's class's Meta.ordering field to `("name_en", )` fixed the query to not have the spurious order by. T...
[ -0.29908743500709534, -0.16379939019680023, 0.5887361168861389, -0.20122244954109192, 0.38446515798568726, 0.28997132182121277, 0.005409283563494682, -0.15122957527637482, -0.033410973846912384, -0.5680354833602905, -0.2177075743675232, 0.7126820683479309, -0.33766067028045654, 0.269741028...
My ASP.NET application loads an assembly and creates a class instance from an object within it. The assembly itself has a reference to a dll called "Aspose.Cells.dll" which it can access without any problems and is located on the same path as the assembly file itself. However, when I make a method call to one of its me...
[ 0.16399924457073212, -0.06379716843366623, 0.05475694313645363, -0.17206217348575592, 0.005617910530418158, 0.12311779707670212, 0.5203760862350464, -0.0692644789814949, -0.19812974333763123, -0.7921066880226135, 0.19234885275363922, 0.17528943717479706, -0.49188128113746643, 0.29420810937...
assembly DLL which is loaded is not located within the root of the web application and I'm hoping that it doesn't have to be. I can load the assembly like this: ``` Assembly asm = Assembly.LoadFile(@"D:\Dev\EasyFlow\Plugins\ImportExportLibrary\bin\Debug\Aspose.Cells.dll"); ``` But I can not use it like this: ``` A...
[ 0.37476491928100586, 0.10533668100833893, 0.20621497929096222, -0.06695293635129929, 0.05510156601667404, -0.12713098526000977, 0.4444007873535156, -0.38981008529663086, -0.2921472489833832, -0.9051761031150818, -0.21085040271282196, 0.240813210606575, -0.5502898693084717, 0.28188928961753...
not having to manually copy files into the main project. However, the `AssemblyResolve` event seems interesting and I will give it a try later. There are a few ways to do this. One way is described in the Microsoft Knowledge Base article "[How to load an assembly at runtime that is located in a folder that is not the...
[ 0.5098756551742554, -0.19153280556201935, -0.1207728311419487, -0.0262527484446764, -0.08468800783157349, -0.28342434763908386, 0.4228149652481079, -0.04572983831167221, -0.3728431165218353, -0.4976852536201477, -0.18728362023830414, 0.42525362968444824, -0.2134704291820526, 0.004548310302...
I want to be able to move a particle in a straight line within a 3D environment but I can't think how to work out the next location based on two points within a 3D space? I have created a struct which represents a particle which has a location and a next location? Would this be suitable to work out the next location t...
[ 0.1918559968471527, -0.3795982301235199, 0.6865226030349731, 0.0796801894903183, 0.10529379546642303, 0.07324598729610443, -0.016700658947229385, -0.301967054605484, -0.027859531342983246, -0.8583746552467346, 0.11412541568279266, 0.11502761393785477, -0.1860041320323944, 0.381482899188995...
float xnp = p->location.x + p->velocity; float ynm = (p->location.y * -1) - p->velocity; float ynp = p->location.y + p->velocity; float znm = (p->location.z * -1) - p->velocity; float znp = p->location.z + p->velocity; struct point3f nextLocation = { randFloat(xnm, xnp), randFloat(ynm, ynp), randFl...
[ -0.6373962759971619, -0.4864117205142975, 0.9119634628295898, -0.04413646459579468, 0.009169288910925388, 0.22212310135364532, -0.28904470801353455, -0.34568509459495544, -0.4892645478248596, -0.5747872591018677, -0.14281228184700012, 0.07359566539525986, 0.08659528940916061, 0.13129521906...
enum TYPES type; float radius; float velocity; struct point3f location; struct point3f nextLocation; struct point3f colour; }; ``` Am I going about this completely the wrong way? here's all my code <http://pastebin.com/m469f73c2> The other answer is a little mathish, it's actually pretty straight...
[ -0.11999431252479553, -0.061762794852256775, 0.7262153029441833, 0.09873470664024353, -0.024499651044607162, 0.1933862715959549, 0.01338295079767704, -0.224284827709198, -0.11187256127595901, -0.6811660528182983, 0.08111125230789185, -0.019510097801685333, 0.11157514154911041, 0.2471652776...
can have an "Acceleration" (also x,y,z) For instance, your z acceleration could be gravity, a constant. Every time period your velocity should be recalcualted in the same way, Call velocity x "vx", so vx should become vx + ax, repeat for y and z (again). It's been a while since math, but that's how I remember it, pre...
[ 0.2938171327114105, -0.26720893383026123, 0.5413752198219299, 0.08259294927120209, -0.19320300221443176, 0.2669960856437683, 0.02754444256424904, 0.011301054619252682, -0.5113586783409119, -0.40943965315818787, 0.21005026996135712, 0.3653327226638794, 0.20213434100151062, 0.297802597284317...
Wondering if there is any way to get the lambda expressions that result from a LINQ "query" syntax expression. Given: ``` var query = from c in dc.Colors where c.ID == 213 orderby c.Name, c.Description select new {c.ID, c.Name, c.Description }; ``` Is there any way to get the gen...
[ 0.2727402448654175, 0.03128847852349281, 0.24807792901992798, 0.22000963985919952, 0.22445525228977203, 0.3000580072402954, 0.02280723676085472, -0.27014419436454773, -0.5818061232566833, -0.3075965642929077, -0.021848900243639946, 0.291566401720047, -0.24192127585411072, 0.001948041375726...
.ThenBy(c => c.Description) .Select(c => new {c.ID, c.Name, c.Description, }); ``` I know these are very simple examples and that the C# compiler generates a lambda expression from the query expression when compiling the code. Is there any way to get a copy of that expression? I am hoping to use this as a traini...
[ -0.04568164423108101, 0.12779463827610016, 0.32414761185646057, -0.0660976991057396, -0.032909978181123734, -0.16381436586380005, -0.013369975611567497, -0.2656494379043579, -0.043513666838407516, -0.6129769086837769, -0.17756444215774536, 0.7506654262542725, -0.37424004077911377, -0.03538...
is formatted all one line.
[ -0.0754566639661789, 0.04602493718266487, 0.0897383838891983, -0.16382494568824768, -0.0877966433763504, 0.2202112227678299, 0.2026544213294983, 0.043320074677467346, -0.02223850227892399, -0.714743435382843, -0.4767633080482483, -0.0739399716258049, -0.08822520077228546, -0.00921198353171...
I have a large collection of data chunks sized 1kB (in the order of several hundred million), and need a way to store and query these data chunks. The data chunks are added, but never deleted or updated. Our service is deployed on the S3, EC2 platform. I know Amazon SimpleDB exists, but I want a solution that is plat...
[ 0.4421690106391907, -0.07588567584753036, 0.0038207434117794037, 0.27850744128227234, -0.16446352005004883, 0.06902207434177399, 0.2873026728630066, -0.0271403007209301, 0.07235226035118103, -0.5659906268119812, -0.10947124660015106, 0.3314058184623718, 0.17975373566150665, -0.004224600270...
data chunks as files on S3 and GET them when needed * Store the data chunks on a MySQL Server cluster Would there be that much of a performance difference? Do you need to provide access to these data chunks directly to the users of your application? If not, then S3 and HTTP GET requests are an overkill. Having also in...
[ 0.15208515524864197, -0.278056263923645, 0.3173478841781616, 0.45293790102005005, -0.3313305079936981, -0.18935249745845795, 0.2891978919506073, -0.24635346233844757, -0.36865323781967163, -0.5116997957229614, -0.4604557454586029, 0.3075565993785858, -0.08851926773786545, -0.10786399245262...
do not rule out SimpleDB. It is perhaps the best solution for your problem. Design your system carefully and you would be able to easily migrate in other database systems (distributed or relational) in the future.
[ 0.3933883309364319, 0.040788669139146805, -0.13647183775901794, 0.38341110944747925, 0.05742790177464485, -0.3067261874675751, 0.020712491124868393, 0.16038845479488373, -0.14487677812576294, -0.5392435193061829, 0.0403716117143631, 0.4878251850605011, -0.5819101929664612, 0.20867890119552...
I'm wondering what's the best way -- or if there's a simple way with the standard library -- to convert a URL with Unicode chars in the domain name and path to the equivalent ASCII URL, encoded with domain as IDNA and the path %-encoded, as per RFC 3986. I get from the user a URL in UTF-8. So if they've typed in `http...
[ 0.1734616607427597, 0.37453579902648926, 0.6173633933067322, -0.054175909608602524, -0.09478569030761719, -0.2874480187892914, -0.021991485729813576, 0.011057697236537933, -0.11377175152301788, -0.44948500394821167, -0.20348867774009705, 0.11420562118291855, -0.011956695467233658, 0.516607...
separately encode the path and query string with different `urllib.quote()` calls. ``` # url is UTF-8 here, eg: url = u'http://➡.ws/㉌'.encode('utf-8') match = re.match(r'([a-z]{3,5})://(.+\.[a-z0-9]{1,6})' r'(:\d{1,5})?(/.*?)(\?.*)?$', url, flags=re.I) if not match: raise BadURLException(url) prot...
[ -0.042750027030706406, 0.3385944366455078, 0.47376400232315063, 0.04307205602526665, -0.35402387380599976, 0.46294644474983215, 0.2675098478794098, -0.9077451229095459, -0.18196040391921997, -0.2680184245109558, -0.2338157296180725, 0.23136256635189056, -0.39654776453971863, 0.138166323304...
urllib.quote(query, safe='=&?/') url = protocol + '://' + domain + port + path + query # url is ASCII here, eg: url = 'http://xn--hgi.ws/%E3%89%8C' ``` Is this correct? Any better suggestions? Is there a simple standard-library function to do this? Code: ----- ``` import urlparse, urllib def fixurl(url): # tur...
[ 0.007102451752871275, -0.02252207137644291, 0.6806359887123108, -0.03132575750350952, -0.0815301164984703, 0.12484734505414963, -0.14745204150676727, -0.1419290155172348, -0.09150818735361099, -0.5480837225914001, -0.3143649101257324, 0.2423883080482483, -0.47067415714263916, 0.42418560385...
hostport.partition(':') # encode each component scheme = parsed.scheme.encode('utf8') user = urllib.quote(user.encode('utf8')) colon1 = colon1.encode('utf8') pass_ = urllib.quote(pass_.encode('utf8')) at = at.encode('utf8') host = host.encode('idna') colon2 = colon2.encode('utf8') p...
[ -0.13771095871925354, -0.06607559323310852, 0.40627601742744446, -0.14373739063739777, -0.13737253844738007, 0.14778649806976318, 0.1625347137451172, -0.2291698008775711, -0.22645476460456848, -1.0387513637542725, 0.09121204912662506, 0.2926101088523865, -0.5196621417999268, 0.644247949123...
fragment = urllib.quote(urllib.unquote(parsed.fragment).encode('utf8')) # put it back together netloc = ''.join((user,colon1,pass_,at,host,colon2,port)) return urlparse.urlunsplit((scheme,netloc,path,query,fragment)) print fixurl('http://\xe2\x9e\xa1.ws/\xe2\x99\xa5') print fixurl('http://\xe2\x9e\xa1.ws/...
[ -0.19854792952537537, 0.07097669690847397, 0.5668116807937622, 0.0990465059876442, -0.1785990446805954, 0.3413125276565552, 0.1153828352689743, -0.1871921718120575, -0.3682973384857178, -0.12489647418260574, -0.5787996053695679, 0.548119068145752, -0.42584654688835144, -0.00010503473458811...
Is there a way to lock a SELECT in a Transaction? If a SELECT occurs, no more SELECTs are executed while the first one is not finished. Thanks! Not sure I understand your question correctly, but if you want to impose more rigorous locking than SQL Server's default, then you can either bump up the isolation level or us...
[ 0.3446521759033203, -0.3067814111709595, 0.0340849868953228, 0.2852674722671509, 0.18426552414894104, -0.4039325416088104, 0.0680685043334961, -0.16871963441371918, -0.48506495356559753, -0.4206874668598175, 0.01892240345478058, 0.4758777320384979, -0.20537403225898743, 0.08168389648199081...
the SELECT and UPDATE), you can impose an update lock on your SELECT statement. Eg: ``` select * from mytable with (holdlock, xlock) ``` Notice that the SELECT statement above uses the more rigorous update lock & holds that lock for the duration of the transaction. You would also want to wrap your statements in an...
[ 0.024473335593938828, -0.10715014487504959, 0.4202524721622467, -0.11383087188005447, 0.05857904255390167, -0.1925603449344635, -0.2200898379087448, -0.12039091438055038, -0.17442119121551514, -0.2952224016189575, -0.377534955739975, 0.732312798500061, -0.3945622444152832, 0.16597869992256...
I have a problem with MouseEvents on my WinForm C# application. I want to get *all* mouse clicks on my application, but I don't want to put a listener in every child component neither use Windows mouse hook. On Flash I could put a listener on Stage to get all the MouseEvents on the movie. Is there such thing on C#? ...
[ -0.17546144127845764, 0.16463330388069153, 0.3833356201648712, -0.18903584778308868, 0.193825826048851, -0.05455171316862106, 0.4434315860271454, -0.06915797293186188, -0.11581555753946304, -0.6386814713478088, 0.10925179719924927, 1.0049282312393188, -0.3371492326259613, 0.263527542352676...
WM_LBUTTONDOWN) { // Do stuffs } return false; } } ``` And put this code on the Controls that need listen global clicks: ``` GlobalMouseHandler globalClick = new GlobalMouseHandler(); Application.AddMessageFilter(globalClick); ``` One straightforward way to do this is to add a messa...
[ -0.21697324514389038, -0.2953936457633972, 0.5381259322166443, -0.16020919382572174, 0.04325340688228607, -0.22652290761470795, 0.4691070318222046, -0.2595228850841522, -0.309649795293808, -0.8120362758636475, -0.17206095159053802, 0.49227604269981384, -0.5288291573524475, 0.03120562806725...
pass these messages on to the specific control to which they're destined. One piece of complexity that this approach introduces is having to deal with Windows messages, via the Message struct passed to your `PreFilterMessage` method. This means referring to the Win32 documention on `WM\_LBUTTONDOWN, WM\_MOUSEMOVE`, `W...
[ 0.07422886788845062, -0.2882564663887024, 0.3568292260169983, 0.08000817894935608, 0.3954907953739166, -0.3051561117172241, 0.2535625994205475, -0.07656929641962051, -0.052624039351940155, -0.5963620543479919, -0.3823741376399994, 0.5928547978401184, -0.31469273567199707, 0.111518256366252...
What's the latency to GET an object from S3 from an EC2 Instance. For example, how many ms before the actual data stream for that object starts streaming back when requesting a object by it's full path. * If the object exists on S3 * If the object does not exist and to send a 404 Latency, not Throughput. I don't t...
[ 0.23863540589809418, -0.28179970383644104, 0.5361886620521545, 0.258993536233902, -0.00776086188852787, -0.16756625473499298, 0.49955883622169495, 0.06908272951841354, -0.37114769220352173, -0.7169027924537659, -0.1391870379447937, 0.42812618613243103, -0.026710515841841698, -0.24315060675...
site only gives throughput statistics, but I figure you may be interested in that anyway. You may also be interested in their availability guarantee: <http://aws.amazon.com/s3-sla/>
[ 0.7905398607254028, -0.402998685836792, -0.023615701124072075, 0.28151407837867737, -0.17840737104415894, -0.21140658855438232, 0.3958110213279724, 0.13652156293392181, -0.1808997243642807, -0.4292144179344177, 0.23889091610908508, 0.09824823588132858, 0.339550256729126, -0.182462155818939...
For some time now I've been storing my connection and app settings in an external file and just referencing that file via my web.config. This works really well because it allows me to keep separate connection strings and app settings. This is really handy since I find during development I will often make many changes t...
[ 0.3848951458930969, 0.13967519998550415, 0.3784502446651459, 0.16411343216896057, -0.010291527025401592, -0.16483217477798462, 0.294083833694458, 0.1977766901254654, -0.47558265924453735, -0.8738155961036682, 0.193688303232193, 0.5364290475845337, -0.31960219144821167, 0.20938730239868164,...
<smtp configSource="MailSettings.config"/> </mailSettings> </system.net> ``` Then put your mailSettings configuration data in MailSettings.config So then your MailSettings.config file would have something like: ``` <network host="relayServerHostname" port="portNumber" userName="username" pas...
[ 0.1016528531908989, -0.07084450870752335, 0.5468480587005615, -0.24767789244651794, 0.12687498331069946, -0.3084360957145691, 0.43125516176223755, 0.04174034297466278, -0.4757126271724701, -0.8750829100608826, 0.03493810445070267, 0.025262104347348213, -0.5104576349258423, 0.21460577845573...
Pros: 1. ***I can't remember "good" passwords anyway*** so remembering them is not an issue. 2. they don't look like passwords 3. they are darn near impossible to guess (128 bits of entropy) 4. easy to generate (offloads the "good PRNG" problem) Cons: 1. ??? In particular; what about for passwords that computers en...
[ -0.06208523362874985, 0.18516983091831207, 0.4342680871486664, 0.19591966271400452, 0.0013510020216926932, -0.15715979039669037, 0.26573434472084045, -0.10797885805368423, -0.05252894014120102, -0.4865748882293701, -0.20779351890087128, 0.9200129508972168, -0.21890991926193237, -0.13707330...
WinAPI GUID has shown given the initial state one can predict up to next 250,000 GUIDs returned by the function UuidCreate For example, I have about a 50% chance of guessing the first digit in the first position of the third group of digits since it will be either 1 (for V1 guids) or 4 (for V4 guids) Source: <http://...
[ -0.31375008821487427, -0.22244110703468323, 0.3013018071651459, -0.003310950007289648, -0.012454871088266373, -0.0574013851583004, 0.1785905510187149, -0.1486736387014389, 0.07687711715698242, -0.49242103099823, 0.04585298150777817, 0.5192124843597412, 0.06553860753774643, -0.1015587151050...
In the [Memory Management Programming Guide for Cocoa](http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/MemoryMgmt/Articles/mmNibObjects.html#//apple_ref/doc/uid/TP40004998-SW4) Apple talks about Top-Level Objects. They say, that I need an Outlet for each of them. > If there are any top-level objects you > d...
[ -0.22517982125282288, 0.3664582669734955, 0.09394294023513794, 0.11000359803438187, 0.13128207623958588, 0.15917649865150452, -0.14317332208156586, 0.05497431382536888, -0.6618466973304749, -0.3671122193336487, -0.24920952320098877, 0.5878623127937317, -0.07353132218122482, 0.1204586550593...
want to load their nib manually? Or does it apply for any nib and any case? Top-level objects are objects that appear in the main nib window in Interface Builder, other than File’s Owner and Application.
[ 0.041467439383268356, -0.07423870265483856, 0.16283659636974335, 0.35708269476890564, 0.17418265342712402, -0.3720998466014862, -0.09291539341211319, 0.23161284625530243, -0.2037373036146164, -0.8145672678947449, -0.4819069504737854, 0.37775397300720215, -0.15614046156406403, 0.26463681459...
Is it posible to notify user that session has expired? Can browser act as server and receive such notifications? One solution would be to generate JavaScript that does countdown on client side and notifies client in the end, but I am iterested if it is postible to do it the first way? And what are the consequences o...
[ 0.008101919665932655, -0.06856578588485718, 0.4212510287761688, -0.06668468564748764, -0.3572002947330475, -0.3374577462673187, 0.2722514271736145, -0.17476564645767212, -0.44825464487075806, -0.364425390958786, 0.07814321666955948, 0.36846819519996643, -0.2767519950866699, 0.0432327687740...
put something at that URL that indicates it, and then a notification could be popped up. This is how Stackoverflow implements the notifications that someone else has answered a question already if you're in the middle of composing an answer.
[ 0.2413410246372223, -0.0888780802488327, 0.13600733876228333, 0.2634023129940033, 0.04530610144138336, -0.292766809463501, -0.14898838102817535, -0.07519635558128357, -0.4564172923564911, -0.2768176794052124, -0.06659984588623047, 0.308631032705307, 0.03613901510834694, 0.04444817081093788...
I have a Windows batch file I'm creating, but I have to ECHO a large complex string, so I'm having to put double quotes on either end. The problem is that the quotes are also being ECHOed to the file I'm writing it to. How do you ECHO a string like that and strip the quotes off? **UPDATE:** I've spent the last two da...
[ 0.5603535175323486, 0.2962265908718109, 0.19084618985652924, -0.0023964785505086184, -0.08407392352819443, -0.022669954225420952, 0.5946193337440491, -0.30520883202552795, -0.10636241734027863, -0.2588827908039093, 0.1783100962638855, 0.3679540753364563, -0.020122412592172623, 0.0801571682...
on the chars in the string. I'll accept Richard's answer since it answers the question asked. I ended up using Greg's sed solution, but had to modify it because of sed/windows bugs/features (it didn't help that it came with no documentation). There are a few caveats to using sed in Windows: you have to use double quot...
[ 0.2608669102191925, 0.17041200399398804, 0.09487543255090714, -0.008210659958422184, -0.090004563331604, 0.20062950253486633, 0.34460973739624023, 0.06655773520469666, -0.11137913912534714, -0.2741010785102844, -0.09593100100755692, 0.5013136267662048, -0.30176207423210144, 0.0418872945010...
there's a bug with a pipe being in the string (I didn't get to verify this since in my final solution, I just found a way not to have all quotes in the middle of the string, and just removed all quotes, **I never could get the endquote to be removed by itself.**) Thanks for all the help. The call command has this funct...
[ 0.16587917506694794, 0.041519757360219955, 0.29737964272499084, -0.06702862679958344, 0.1971784234046936, 0.11174154281616211, 0.42139384150505066, -0.02133515477180481, -0.14514458179473877, -0.5812835693359375, 0.03639296069741249, 0.8914039134979248, -0.33054396510124207, 0.044667594134...
removing any surrounding quotes (") ``` Here is a primitive example: ``` @echo off setlocal set mystring="this is some quoted text" echo mystring=%mystring% call :dequote %mystring% echo ret=%ret% endlocal goto :eof :dequote setlocal rem The tilde in the next line is the really important bit. set thestring=%~1 endl...
[ 0.034465134143829346, 0.18295493721961975, 0.17508569359779358, -0.18965236842632294, 0.0449441559612751, -0.15124717354774475, 0.12253140658140182, -0.22354449331760406, 0.10797182470560074, -0.19206789135932922, -0.10612504184246063, 0.5192866325378418, -0.34170863032341003, -0.159334510...
UPDATE: So pretty much everyone here has told me that I just need to start all over again on how I designed my classes (thank you folks for your excellent answers by the way!). Taking the hint, I started doing extensive reading on the [strategy pattern](http://www.dofactory.com/Patterns/PatternStrategy.aspx). I want to...
[ 0.5950098037719727, -0.21672604978084564, 0.0813124030828476, 0.03349637985229492, 0.10751516371965408, -0.035174306482076645, -0.05848727375268936, -0.20047152042388916, -0.1672050505876541, -0.9687241911888123, 0.20980247855186462, 0.5366966128349304, -0.10463003814220428, -0.22573409974...
get; set; } public abstract decimal Min { get; set; } public abstract decimal Mid { get; set; } public decimal CompaRatio { get { if (this.Mid == 0) { return 0; } else { return this.Salary / this.Mid; } } } } public class InternalCurrentSalaryStrategy { publi...
[ -0.21344564855098724, -0.33199313282966614, 0.20239505171775818, 0.19364240765571594, 0.10641156136989594, 0.555773913860321, -0.3017980754375458, -0.03543706238269806, 0.053608816117048264, -0.3749406039714813, -0.19139133393764496, 0.5566771626472473, 0.19010372459888458, 0.2757739126682...
{ get; set; } public override decimal Min { get { return this.Salary * .25m; } set { } } public override decimal Mid { get; set; } } public class Candidate { public int Id { get; set; } public string Name { get; set; } public SalaryStrategy CurrentSalaryStrategy { get; set; } } ...
[ -0.0751747414469719, -0.5324966311454773, 0.6824408769607544, -0.011331004090607166, 0.11502914130687714, 0.36561644077301025, -0.11934556812047958, -0.3957618772983551, 0.08495821058750153, -0.3616860806941986, -0.13507314026355743, 0.25550639629364014, 0.14979270100593567, 0.545766294002...
internal.CurrentSalaryStrategy = new InternalCurrentSalaryStrategy(); var internalElp = new Candidate(); internalElp.CurrentSalaryStrategy = new InternalCurrentSalaryStrategy(); var elp = new Candidate(); // elp.CurrentSalaryStrategy can stay null cause it's not used for elps } ``` Any comments or sug...
[ -0.12656041979789734, 0.08600383251905441, 0.7934394478797913, -0.0284788366407156, 0.054443228989839554, 0.11240329593420029, 0.10712171345949173, -0.33845919370651245, -0.03584178537130356, -0.7430292367935181, -0.0107914162799716, 0.3368125259876251, -0.29077857732772827, -0.11253517121...
{ get; set; } // lots more properties and behaviors... } public class InternalCandidate : Candidate { public decimal CurrentMid { get; set; } public decimal CurrentMax { get { return this.CurrentMin * 1.3m; } // lots more properties and behaviors... } public class EntryLevelCandidate : Ca...
[ 0.018972055986523628, -0.22634541988372803, 0.4291156232357025, 0.23877163231372833, 0.5111958980560303, 0.061095885932445526, -0.08011212944984436, -0.1635848879814148, -0.1241040825843811, -0.2576449513435364, -0.04205704480409622, 0.5133609175682068, -0.012060488574206829, 0.63896030187...
needs all of the properties and behaviors of // EntryLevelCandidate but also needs the CurrentMin and // CurrentMax (and possibly more) in InternalCandidate } ``` The InternalEntryLevelCandidate class is primarily an EntryLevelCandidate but needs to share some of the *implementations* of InternalCandidate. I ...
[ 0.061979565769433975, 0.16653884947299957, 0.37502244114875793, 0.08478807657957077, 0.06936800479888916, -0.07567905634641647, 0.07754969596862793, -0.21973219513893127, 0.11274123936891556, -0.489972323179245, 0.1561458706855774, 0.6354318857192993, -0.231174498796463, 0.1570500135421753...
seem to be something similar to what I want to do. I also read this interesting blog post that discusses an idea for a behavior type where a class would be able to inherit multiple behaviors while still maintaining a single "is a" relationship: <http://www.deftflux.net/blog/post/A-good-design-for-multiple-implementatio...
[ 0.6734281778335571, -0.2702161371707916, -0.05738680437207222, 0.2181044965982437, -0.25883588194847107, -0.023748064413666725, 0.3935587704181671, -0.26126211881637573, -0.4739396572113037, -0.6153504848480225, 0.30291083455085754, 0.646543025970459, -0.25724276900291443, 0.32411083579063...
your distinct Candidate subclasses can then use the data type, but your code is still encapsulated in the data classes. **Extension methods.** These could be overloaded to work with any classes. I'd avoid the decorator pattern and stick with compiled/reflectable functionality. **Composition.** Develop the unique beh...
[ 0.36578691005706787, -0.27352195978164673, -0.2254539579153061, 0.2841637432575226, -0.09628472477197647, 0.18961381912231445, 0.535670280456543, -0.24483194947242737, -0.1354304403066635, -0.8667775988578796, -0.0878870040178299, 0.4586583971977234, -0.3674669563770294, -0.082625247538089...
so instead of reimplementing interfaces (which you wanted to avoid), you could actually cast your object into the type/implementation you need for whatever purpose. Another thing I just thought of, related to that last paragraph, is to have a leasing system, where your class spawns and object of the appropriate type, ...
[ 0.5537542104721069, -0.32616254687309265, -0.23783127963542938, 0.44328001141548157, 0.17598135769367218, -0.033785708248615265, -0.0655481368303299, 0.12656770646572113, -0.13236165046691895, -0.6671009659767151, 0.19062499701976776, 0.5970439314842224, -0.08477017283439636, 0.21701900660...
I am trying to find a pattern in files. When I get a match using `Select-String` I do not want the entire line, I just want the part that matched. Is there a parameter I can use to do this? For example: If I did ``` select-string .-.-. ``` and the file contained a line with: ``` abc 1-2-3 abc ``` I'd like to...
[ 0.20685000717639923, 0.048265136778354645, 0.20971351861953735, -0.06093442067503929, -0.12047390639781952, 0.017751419916749, 0.27031397819519043, -0.3317151367664337, -0.06510578840970993, -0.6312897801399231, 0.0833432525396347, 0.24583156406879425, -0.8676930069923401, 0.17396600544452...
| foreach-object {$_.Value} ``` You could wrap that in a function if that is too verbose.
[ -0.11843793839216232, 0.36872199177742004, 0.2426617294549942, -0.32252568006515503, -0.0606231652200222, -0.271822065114975, 0.39137789607048035, 0.13204213976860046, 0.0500519797205925, -0.45516839623451233, -0.579226553440094, 0.5283455848693848, -0.4721027910709381, 0.18218523263931274...
I am using VB.NET and I am trying to come up with some algorithm or some pseudo-code, or some VB.NET code that will let me do the following (hopefully I can explain this well): I have 2 collection objects, Cob1 and Cob2. These collection objects store objects that implement an interface called ICob. ICob has 3 propert...
[ 0.015312324278056622, 0.17944155633449554, 0.10409475117921829, 0.15751685202121735, 0.015268072485923767, -0.06127018481492996, -0.12777204811573029, -0.13780222833156586, -0.28724053502082825, -0.4261624813079834, 0.3819301128387451, 0.02520616538822651, -0.16357733309268951, 0.427360832...
select objects from Cob1 and copy them over to Cob2. I want the following rules obeyed when selecting the objects though: 1. I want to be able to specify a timespan and I want enough objects to be selected to fit into the timespan I specify (based on the Length property). So for example, if I pass a 10 minute timespan...
[ 0.15108107030391693, -0.040774088352918625, 0.2846398949623108, -0.03945520892739296, 0.18558865785598755, -0.019265033304691315, 0.10484044998884201, -0.11155848205089569, -0.1671067476272583, -0.7685251235961914, -0.204970121383667, -0.03322508558630943, -0.23129093647003174, 0.067096211...
should have a better chance at being picked then other objects. 4. No object that has been selected in the last 30 minutes should be selected again (so that each object will eventually get selected at least once), regardless of rating. Can anyone give me some tips on how to achieve this? The tips can be in the form of...
[ 0.7342828512191772, -0.04494449123740196, 0.40610605478286743, 0.43450742959976196, -0.28866711258888245, -0.22254225611686707, 0.3348678946495056, -0.05015905573964119, -0.34710386395454407, -0.5170727968215942, 0.1373443603515625, 0.5125784277915955, 0.034407004714012146, -0.033105146139...
select the music and advertisments to play, kinda of like a computerized program manager. The length represents the length of the sound byte (either a song or an advertisement) and the rating is just that. If the song is popular, it gets more airtime. If an advertiser pays more money, then it also gets more airtime. ...
[ 0.3196318745613098, 0.09130045771598816, 0.4119437634944916, 0.21478381752967834, -0.3591899275779724, -0.31511786580085754, -0.14976905286312103, -0.39700156450271606, -0.1295488327741623, -0.2589431703090668, 0.06224043667316437, 0.9919141530990601, -0.27845948934555054, 0.24600353837013...
works on sets, as requested by restriction 2. Restriction 3 is rather vague. It is better to have higher value or higher coverage of the lifespan? If you don't specify a objective function to maximaze (or, to be precise, there are two: lifespan itself and rate), there are some pareto optimal solutions. Restriction 4 ...
[ 0.3798240125179291, -0.41906777024269104, 0.0953831896185875, -0.020876703783869743, -0.02494172379374504, -0.3532068729400635, 0.22031888365745544, -0.30996572971343994, -0.2398301362991333, -0.7474521994590759, -0.18972870707511902, 0.4677968919277191, -0.6710157990455627, -0.05174328386...
I want a ASP.NET cache item to be recycled when a specific file is touched, but the following code is not working: ``` HttpContext.Current.Cache.Insert( "Key",
[ 0.260389119386673, -0.09029928594827652, 0.2667747437953949, 0.0010073153534904122, 0.1749296486377716, -0.27279093861579895, 0.15492549538612366, -0.1775009036064148, -0.2332395762205124, -0.4953533411026001, 0.029722929000854492, 0.19548729062080383, -0.20304104685783386, 0.1544807851314...
SomeObject, new CacheDependency(Server.MapPath("SomeFile.txt")), DateTime.MaxValue, TimeSpan.Zero,
[ -0.09574845433235168, -0.24861907958984375, 0.1709219068288803, 0.1268445998430252, 0.08697757124900818, 0.33790233731269836, 0.15022492408752441, 0.5758873820304871, -0.20383770763874054, -0.6028035879135132, 0.1382463425397873, 0.2982175648212433, -0.03654779493808746, 0.3974525034427643...
CacheItemPriority.High, null); ``` "SomeFile.txt" does not seem to be checked when I'm hitting the cache, and modifying it does not cause this item to be invalidated. What am I doing wrong? Problem Solved: =============== This was a unique and interesting problem, so I'm going to documen...
[ 0.29810866713523865, 0.5346598625183105, 0.0621022991836071, 0.06173660233616829, 0.11211767792701721, -0.028038134798407555, 0.6485567092895508, 0.21524468064308167, -0.3255455791950226, -0.6388862133026123, 0.35495489835739136, 0.39244771003723145, -0.10096994787454605, 0.239153206348419...
cache insertion was happening in a service class implementing the singleton pattern. In a nutshell: ``` public class Service { private static readonly Service _Instance = new Service(); static Service () { } private Service () { } public static Service Instance { ...
[ -0.10549566149711609, -0.06904009729623795, -0.26986002922058105, -0.08378300815820694, 0.08847176283597946, 0.23655706644058228, 0.45172804594039917, -0.15438415110111237, -0.13472935557365417, -0.5067958235740662, -0.15636566281318665, 0.16125090420246124, -0.45648226141929626, 0.4764319...
// The expensive data that this service exposes private someObject _data = null; public someObject Data { get { if (_data == null)
[ 0.04693989083170891, -0.3247958719730377, -0.01827479712665081, 0.1548764705657959, 0.27417808771133423, 0.042533472180366516, 0.5523405075073242, 0.1722480058670044, -0.026962885633111, -0.5065643787384033, -0.42387670278549194, 0.7535205483436584, -0.23894663155078888, -0.091701745986938...
loadData(); return _data; } } private void loadData() { _data = GetFromCache(); if (_data == null)
[ -0.05191023275256157, -0.4915459454059601, 0.19954127073287964, -0.1665150672197342, 0.23610424995422363, -0.12332683801651001, 0.34368759393692017, 0.030225032940506935, -0.20176145434379578, -0.26416945457458496, -0.4721214771270752, 0.6696284413337708, -0.6033924221992493, 0.10583377629...
{ // Get the data from our datasource _data = ExpensiveDataSourceGet(); // Insert into Cache HttpContext.Current.Cache.Insert(etc);
[ 0.07178114354610443, -0.30168119072914124, 0.3071916699409485, 0.19037742912769318, 0.6427339911460876, -0.083671435713768, 0.15949992835521698, -0.1319703459739685, 0.12254036217927933, -0.6073236465454102, -0.21654455363750458, 0.5908107757568359, -0.35647422075271606, 0.1500865519046783...
} } } ``` It may be obvious to some, but the culprit here is lazy loading within the singleton pattern. I was so caught up thinking that the cache wasn't being invalidated, that I forgot that the state of the singleton would be persisted for as long as the worker process was alive. Cache.Insert has an overlo...
[ 0.17633101344108582, -0.0054610962979495525, -0.4429484009742737, -0.1937127262353897, 0.2586674690246582, -0.08503465354442596, 0.23883551359176636, 0.23915132880210876, -0.22374095022678375, -0.44089487195014954, -0.08498732000589371, 0.5750939846038818, -0.6078732013702393, 0.3021793365...
being cleared, I realized that "\_data" was not being reset to null, so the next request to the singleton loaded the lazy loaded value. In a sense, I was double caching, though the singleton cache was very short lived, but long enough to be annoying. The solution? ``` HttpContext.Current.Cache.Insert( "Key", ...
[ 0.1516333669424057, -0.09832935780286789, 0.33886978030204773, 0.030403465032577515, 0.25035202503204346, 0.12422972172498703, 0.3873780071735382, 0.12782834470272064, -0.3212234377861023, -0.5617485046386719, -0.07521418482065201, 0.4348635673522949, -0.18197070062160492, 0.31291589140892...
_data = null; } ); ``` When the cache is cleared, the state within the singleton must also be cleared...problem solved. Lesson learned here? Don't put state in a singleton.
[ -0.09171256422996521, 0.19044333696365356, -0.3107181191444397, -0.025636354461312294, 0.3631398677825928, -0.20024937391281128, 0.747334897518158, 0.15435825288295746, -0.14319883286952972, -0.7213197350502014, -0.3320901393890381, 0.4775715172290802, -0.3981272280216217, 0.57460844516754...
is it better to develop ruby on rails in a) windows b) linux or c) mac. why ? edited : the reason why i am asking this is that i heard that developing ruby on rails in windows is not as stable/good compared when you used ruby on rails in mac. (not sure though if that is true or not). plus the fact that David Heinem...
[ 0.17531490325927734, 0.0618036724627018, -0.4373142123222351, 0.16680453717708588, -0.020231708884239197, -0.14769697189331055, 0.18778808414936066, 0.18391549587249756, -0.05182042345404625, -0.5028823614120483, 0.232969731092453, 0.6398061513900757, -0.27909743785858154, -0.2379561513662...
are a lot of things that break on Windows with every upgrade and the majority of gem or plugin creators don't use windows so they don't care about windows and don't run tests on it(there are several big name people who have flat out said that windows is NOT their problem it's yours). You'll find the \*nix vs Windows pr...
[ 0.5946522951126099, 0.25955331325531006, 0.02944156900048256, 0.12349303066730499, -0.24653637409210205, -0.05696500092744827, 0.5759736895561218, 0.32774215936660767, -0.2995430827140808, -0.5873227119445801, -0.19045017659664154, 0.7921796441078186, -0.15928947925567627, 0.39788118004798...
back of your head every time you have to debug something saying "Is this a problem only on Windows?" and that little voice is a cost to you..using up some of your battery every single day. Macs are more expensive in terms of upfront dollars (which sadly I don't have) and linux platforms are more expensive terms of sp...
[ 0.6319332718849182, 0.232042595744133, 0.11167071014642715, 0.2630598545074463, 0.13407662510871887, -0.0814763754606247, 0.34533652663230896, 0.1874588429927826, -0.23361840844154358, -0.36618173122406006, 0.29214388132095337, 0.6498489379882812, 0.09474112093448639, 0.12114816904067993, ...