text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
= [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]]; theRequest.cachePolicy = NSURLRequestReloadIgnoringLocalCacheData; ``` but nothing seems to free up the memory! Usually it's easier to create the request like this ``` NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLReq...
[ -0.3584069311618805, 0.056129999458789825, 0.5801369547843933, -0.036311354488134384, 0.05242210999131203, -0.062092311680316925, 0.5577606558799744, -0.340525358915329, -0.21045660972595215, -0.6844252943992615, -0.31075116991996765, 0.44315072894096375, -0.24024194478988647, 0.2920492291...
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I ca...
[ 0.31412169337272644, 0.2058544158935547, -0.019289789721369743, -0.02157200500369072, -0.3975575864315033, -0.08064821362495422, 0.24668851494789124, 0.4695819616317749, -0.17697358131408691, -0.5412075519561768, 0.020477892830967903, 0.44607219099998474, -0.2818405330181122, -0.1619519889...
- This might seem like a flame bait but it's not really, I'm just trying not to go crazy from OCD about switching from RoR to Python/Django and back. I'd go with Ruby. It's got all kinds of metaprogramming and duck punching hacks that make it really easy to extend. Features like blocks may not seem like much at first, ...
[ 0.39198341965675354, -0.04983241483569145, 0.020426815375685692, 0.17224375903606415, -0.2610185444355011, -0.2506640553474426, 0.4200960099697113, 0.3662145733833313, -0.21578451991081238, -0.5659476518630981, -0.2191343456506729, 0.29281625151634216, -0.019883275032043457, 0.125048935413...
(Python can do this too, I think, but with a bit more pain) PS: Check out ["Why Ruby is an acceptable LISP"](http://www.randomhacks.net/articles/2005/12/03/why-ruby-is-an-acceptable-lisp).
[ 0.0667104721069336, -0.05642195791006088, -0.09440290927886963, -0.16392411291599274, -0.46806424856185913, -0.35818788409233093, 0.6119584441184998, 0.11171189695596695, -0.3593664765357971, -0.143180713057518, -0.29697078466415405, 0.24624301493167877, -0.6117061376571655, -0.63567388057...
what will happen with the overlapping portion of boost once C++0x becomes mainstream? Will boost still contain everything it used to, or will they adapt the library to update it with the new std:: stuff? Will boost have both a normal c++ version and a c++0x version that they will maintain? One would *hope* that Boost...
[ 0.2268209457397461, -0.03355918079614639, 0.21403902769088745, 0.1128249540925026, 0.065255306661129, -0.2598949372768402, -0.001572957611642778, 0.1036151871085167, -0.4348680377006531, -0.21431373059749603, -0.10719209164381027, 0.64240962266922, -0.34715956449508667, 0.07619921863079071...
difference between std::Frob and Boost::Frob that is important to my project, and having a choice is good. In the long term, though, I would expect a migration toward the standard from both the application writers and the tools providers. That makes it a less risky choice to go with std::.
[ 0.2234286069869995, -0.025153547525405884, 0.44121700525283813, 0.011956669390201569, -0.15922501683235168, -0.12676116824150085, -0.1980239301919937, 0.08385583013296127, -0.07308710366487503, -0.3176199197769165, -0.07749892771244049, 0.9621013402938843, 0.12840552628040314, -0.476032406...
I'm working on an open-source project that I want to release under a permissive license, because it's a library, not an application and personally, I don't like copyleft for library code. If I were to browse through GPL code written in a different programming language just to get a general idea of how to do something, ...
[ 0.9137933254241943, 0.5115334987640381, -0.1418493241071701, 0.1261824667453766, 0.17081423103809357, -0.5134739875793457, 0.16121000051498413, 0.17292119562625885, -0.22367221117019653, -0.2629762291908264, 0.34134364128112793, 0.5084960460662842, -0.11489248275756836, 0.4239930808544159,...
do these gray areas typically work? I typically use the X11 license (aka 3 clause BSD) when releasing any kind of library, even though I'm known to lean to the GPL2/3 when releasing a program. I do this because I want to ensure that my library can be used without restriction by any FLOSS project, this is more important...
[ 0.7659189701080322, 0.5099177956581116, 0.0953255146741867, -0.007322667166590691, -0.18241284787654877, -0.7676479816436768, 0.117470383644104, 0.10514769703149796, -0.07858245819807053, -0.35743409395217896, -0.1997622847557068, 0.740919828414917, -0.4507875442504883, 0.3545917272567749,...
in point for why you probably can do what you intend to do. If you are looking at some example written in Scheme, or say LISP, perhaps even PERL .. and writing some implementation of it in C, you should be perfectly fine. There is absolutely nothing wrong with studying existing implementations when working on making y...
[ 0.28512105345726013, 0.2237376868724823, 0.18316808342933655, 0.07805933058261871, -0.10575268417596817, -0.31851908564567566, -0.10571365058422089, -0.22820019721984863, -0.2543712854385376, -0.3761298358440399, 0.07290326803922653, 0.5563760995864868, -0.18881484866142273, -0.12793950736...
can be tedious, they expect and welcome these kinds of questions.
[ 0.5580503940582275, 0.25835245847702026, -0.09874109923839569, 0.5004021525382996, 0.12511156499385834, -0.30391284823417664, 0.12291456013917923, 0.16703063249588013, -0.009083347395062447, -0.36429354548454285, -0.14117813110351562, 0.5242540836334229, 0.2357620745897293, 0.0509468801319...
Is it possible to define a policy which restricts a user to enumerate only accounts in his own OU? For example lets consider a domain Contosos and OUs Sales and HR.The Sales OU has two users A and B and the HR OU has users C and D. Is it possible to define a policy so that A can only enumerate accounts A and B and C ...
[ 0.358159601688385, 0.3340940475463867, 0.2325935810804367, -0.015195941552519798, -0.19246341288089752, 0.1470031440258026, -0.09401612728834152, -0.09396077692508698, -0.20344944298267365, -0.3058941662311554, -0.05477973073720932, 0.5756335854530334, -0.23308269679546356, 0.1363402754068...
change the permission on every other OU to deny this group the "list content" permission. I don't think that there is a way to configure this without scripting. But as the rule is simple it can be scripted. That said. I would advise you not to dare and change the active directory default permission without having a de...
[ 0.6689816117286682, 0.04659208282828331, 0.19202464818954468, 0.01223757490515709, 0.07786872237920761, -0.7148582339286804, 0.6003273129463196, 0.20817698538303375, -0.337228924036026, -0.6004087328910828, -0.28122055530548096, 0.777338981628418, -0.2779763638973236, 0.20232005417346954, ...
) will suffer from subtle errors. So the rule is. If you have to ask, don't do it. if you need to become an expert, then: <http://www.google.com/search?hl=en&q=active+directory+permission+site:microsoft.com&btnG=Search> **Update:** The "If you need to ask" rule refers to asking on a public site like this. Where non-...
[ 0.6922606825828552, 0.0791001245379448, 0.31289735436439514, -0.03157048672437668, 0.034831468015909195, -0.31754615902900696, 0.22708819806575775, -0.3891368508338928, 0.052279237657785416, -0.37534070014953613, -0.08268606662750244, 0.5046600699424744, 0.19074803590774536, -0.15313889086...
I would like to start learning ASP.NET on a for-fun project. I'm hoping to setup a local server to do my development on, but I don't want to pollute my user account with a webserver, database, and developer tools. I'm using Vista Home Premium as my desktop OS. Is it possible to setup a separate user in vista and conta...
[ 0.4530734717845917, 0.25819408893585205, 0.044919453561306, 0.16242189705371857, -0.06271659582853317, -0.20097176730632782, 0.13154210150241852, 0.18336553871631622, -0.13561740517616272, -0.8286197185516357, 0.10609159618616104, 0.7138221263885498, -0.09063383936882019, 0.271386414766311...
separate user for this. There's a webdevserver bundled with VS for development use. This only runs when you start it. And VS itself doesn't do anything unless you are using it... SQL Server can be set to be started manually. If you're just getting started, check out the [express editions](http://www.microsoft.com/exp...
[ 0.43904900550842285, -0.21460318565368652, 0.30704838037490845, 0.2319103479385376, -0.32847532629966736, -0.262029230594635, 0.2591800093650818, 0.12815655767917633, -0.13833212852478027, -0.8269338607788086, 0.02632787823677063, 0.5615323781967163, -0.06843626499176025, -0.07677177339792...
Consider this trigger: ``` ALTER TRIGGER myTrigger ON someTable AFTER INSERT AS BEGIN DELETE FROM someTable WHERE ISNUMERIC(someField) = 1 END ``` I've got a table, someTable, and I'm trying to prevent people from inserting bad records. For the purpose of this question, a bad record has a field "s...
[ 0.2506691515445709, 0.5263053774833679, 0.1296246349811554, -0.3410889506340027, 0.07976945489645004, -0.28407642245292664, 0.10855317115783691, -0.1207081526517868, -0.3749410808086395, -0.32455962896347046, 0.23088394105434418, 0.6042979955673218, -0.5001848936080933, 0.16966916620731354...
delete it right away, which is good enough for my needs. The trigger works, with one problem... when it fires, it never seems to delete the just-inserted bad record... it deletes any OLD bad records, but it doesn't delete the just-inserted bad record. So there's often one bad record floating around that isn't deleted ...
[ 0.06386689096689224, 0.03406976908445358, 0.23094919323921204, 0.06110854819417, -0.0002708762767724693, 0.06870785355567932, 0.2509255111217499, -0.2922767400741577, -0.2892555594444275, -0.24313651025295258, 0.02146906405687332, 0.6947958469390869, -0.24219739437103271, 0.206903606653213...
trigger again. One option would be for the trigger to roll back the transaction. **Edit:** The reason for this is that the standard for SQL is that inserted and deleted rows cannot be modified by the trigger. The underlying reason for is that the modifications could cause infinite recursion. In the general case, this ...
[ -0.02339976839721203, 0.03602362796664238, 0.4685688018798828, -0.08205099403858185, 0.08376214653253555, -0.04944406449794769, 0.2446761131286621, -0.23485000431537628, -0.571326494216919, -0.42767977714538574, -0.03270493075251579, 0.6225450038909912, -0.5124886631965637, 0.1399782150983...
it can roll back the transaction. ``` create table Foo ( FooID int ,SomeField varchar (10) ) go create trigger FooInsert on Foo after insert as begin delete inserted where isnumeric (SomeField) = 1 end go Msg 286, Level 16, State 1, Procedure FooInsert, Line 5 The logical t...
[ -0.19867698848247528, -0.05779793858528137, 0.6812784671783447, -0.289310097694397, 0.18800635635852814, -0.24855045974254608, -0.028157955035567284, -0.14330872893333435, -0.10657043009996414, -0.17959029972553253, -0.14489701390266418, 0.7487618923187256, -0.5681303143501282, 0.026813393...
int ,SomeField varchar (10) ) go create trigger FooInsert on Foo for insert as if exists ( select 1 from inserted where isnumeric (SomeField) = 1) begin rollback transaction end go insert Foo values (1, '1') Msg 3609, Level 16, State 1, Line 1 The transaction ...
[ -0.05616649612784386, 0.03753446042537689, 0.6671438813209534, -0.4665226638317108, 0.33193647861480713, -0.10086352378129959, 0.24736380577087402, -0.26468658447265625, -0.07155419886112213, 0.02322540432214737, -0.2531812787055969, 0.7864236831665039, -0.40566956996917725, 0.085996441543...
Each page of my site has 10 (almost) identical divs, varying only in the text within. When a certain part of a div is clicked, I want a different part of that div to be modified. I'm using this code: ``` $(document).ready(function(){ $(".notLogged img").mouseover(function(){ $(this).parent()>$("span").html("You mu...
[ 0.5698497891426086, 0.00483011594042182, 0.6267181634902954, -0.19597956538200378, 0.04997887462377548, -0.04574010521173477, 0.22635939717292786, -0.15166184306144714, -0.210378959774971, -0.8592681288719177, -0.05976890027523041, 0.4309142827987671, -0.2749250829219818, 0.113088451325893...
so only the div in which the mouseover originated is modified?** Try it like this: ``` $(document).ready(function(){ $(".notLogged img").mouseover(function(){ $(this).parent().find("span").html("You must be logged in to vote."); }); }); ```
[ 0.41587209701538086, -0.319731742143631, 0.4899396002292633, -0.1676771193742752, 0.24388350546360016, -0.22474820911884308, 0.13343513011932373, -0.07077285647392273, -0.3398147523403168, -0.4628283679485321, -0.22971752285957336, 0.527561366558075, -0.30535608530044556, 0.091403588652610...
I'm currently writing an implementation of a JDBC driver (*yes, you read that correctly*) in a TDD manner and while I have only finished class stubs at this point and only some minor functionality, it just occured to me that since `Statement` is a superclass for `PreparedStatement` which is a superclass for `CallableSt...
[ 0.302619069814682, 0.3111680746078491, -0.12958337366580963, -0.14590239524841309, -0.3143237829208374, -0.11825333535671234, 0.45075613260269165, -0.21262438595294952, 0.24176281690597534, -0.43873006105422974, 0.029294947162270546, 0.7910627722740173, -0.17566479742527008, 0.039502453058...
Test each implementation individually ignoring the methods inherited from superclass(es). 3. Rigorously test every single method individually for each implementation class; It is possible that some inherited methods work differently depending on implementation after all. Mild variation of this would be that I'd test al...
[ 0.31913256645202637, -0.09264455735683441, -0.34105029702186584, 0.10956033319234848, -0.47663912177085876, 0.008390420116484165, 0.44838133454322815, -0.635894238948822, -0.02334693819284439, -0.6077563166618347, 0.4130079448223114, 0.5496608018875122, -0.28454917669296265, -0.05454457923...
actual class hierarchy) if this means you will be running the same tests repeatedly for each test subclass. I am also generally sceptical of subclassing test classes other than the general utility base class. I normally make 1 test for each class in a hierarchy, abstract or not. So the base class has a separate test (...
[ 0.4973674714565277, -0.1535130888223648, -0.22452248632907867, 0.32135632634162903, -0.33893027901649475, 0.04821737855672836, 0.5594485402107239, -0.13899420201778412, -0.18568125367164612, -0.48196759819984436, 0.03146117180585861, 0.6217455267906189, -0.07273810356855392, -0.01893512904...
Using the standard MVC set up in Zend Framework, I want to be able to display pages that have anchors throughout. Right now I'm just adding a meaningless parameter with the '#anchor' that I want inside the .phtml file. ``` <?= $this->url(array( 'controller'=>'my.controller', 'action'=>'my.action', 'anchor'...
[ 0.31712520122528076, 0.022909412160515785, 0.911827564239502, 0.15799975395202637, -0.010716771706938744, -0.09739792346954346, -0.12155910581350327, -0.04884373024106026, -0.4164251685142517, -0.49770334362983704, -0.09064362943172455, 0.4892214834690094, -0.40573450922966003, 0.224372059...
a new one. ``` class My_View_Helper_Url extends Zend_View_Helper_Url { public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true) { if (isset($urlOptions['anchor']) && !empty($urlOptions['anchor'])) { $anchor = $urlOptions['anchor']; ...
[ -0.03505990654230118, -0.036891140043735504, 0.9320679306983948, -0.24325130879878998, 0.0682099238038063, 0.21393267810344696, 0.11736617237329483, -0.13198594748973846, -0.33212265372276306, -0.38867896795272827, -0.5447748303413391, 0.5178133249282837, -0.4013630449771881, 0.27040696144...
{ $anchor = ''; } return parent::url($urlOptions, $name, $reset, $encode).$anchor; } } ``` this helper override url helper, problem is, that you can't use parameter called 'anchor', because it will be changed into anchor in url. you will call it as in your's example ``` <?= $this->...
[ -0.012736288830637932, -0.2089240401983261, 0.7690647840499878, 0.19855058193206787, 0.32302024960517883, 0.08254088461399078, -0.046979211270809174, 0.08355659246444702, -0.2955522835254669, -0.4646714925765991, -0.39642059803009033, 0.4356599748134613, -0.2264574021100998, 0.539242863655...
This question is for the java language in particular. I understand that there is a static protion of memory set aside for all static code. My question is how is this static memory filled? Is a static object put into static memory at import, or at first reference? Also, do the same garbage collection rules apply to sta...
[ 0.16753217577934265, -0.08802811056375504, 0.029838472604751587, -0.2721913158893585, -0.07731577008962631, 0.033446233719587326, 0.2867763340473175, 0.29431837797164917, -0.44713032245635986, -0.462270051240921, -0.057631511241197586, 0.4638585150241852, -0.6001051068305969, 0.15012900531...
){ // Or is the static object put into memory at first reference? Example.someO.someMethod(); // Do the same garbage collection rules apply to a // static object as they do all others? Example.someO = null; System.gc(); } } ``` Imports don't correlate with any instructions in compiled cod...
[ 0.1764579862356186, 0.010730518028140068, -0.08875878155231476, 0.0028839719016104937, 0.17392195761203766, -0.1937951147556305, 0.41358813643455505, 0.1508960723876953, -0.3129110336303711, -0.3505840003490448, -0.40821918845176697, 0.5683942437171936, -0.4152042865753174, 0.2099276632070...
whenever a class is referenced, it has been initialized. Static member initializers and static blocks are executed as if they were all one static initializer block in source code order. An object referenced through a static member variable is strongly referenced until the class is unloaded. A normal `ClassLoader` nev...
[ -0.22246477007865906, -0.0019166149431839585, 0.25695645809173584, 0.09734217077493668, -0.08146720379590988, -0.28503406047821045, 0.32102450728416443, 0.13443683087825775, -0.2749938368797302, -0.3285222053527832, -0.4495469927787781, 0.4854927062988281, -0.3668886125087738, 0.4254206120...
instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main(String... argv) { System.out.println(Foo.instance.x); } } ``` What will this code print? Try it, and you'll see that it prints "6". Th...
[ 0.242666095495224, 0.1337931752204895, 0.33414509892463684, -0.5285740494728088, 0.009962678886950016, 0.12091340124607086, 0.4969765841960907, -0.3150365650653839, -0.32378995418548584, -0.40280094742774963, -0.23766513168811798, 0.541093647480011, -0.6114412546157837, 0.4962834119796753,...
static final int DELTA = 6; private static int BASE; static { instance = null; BASE = 0; instance = new Foo(); /* BASE is 0 when instance.x is computed. */ BASE = 7; } private int x; private Foo() { x = BASE + 6; /* "6" is inlined, because it's a constant. */ } } ```
[ 0.0385134294629097, -0.0776161253452301, 0.5866684913635254, -0.4221367835998535, -0.01903870701789856, 0.22197742760181427, 0.3692851662635803, -0.2514571249485016, -0.20746085047721863, -0.11227743327617645, -0.3539153039455414, 0.5215960144996643, -0.4723650813102722, 0.3138709962368011...
Given this line of code in C: > `printf("%3.0f\t%6.1f\n", fahr, **(**(5.0/9.0) * (fahr-32)**)**);` Is there a way to delete or yank from the first bold parenthesis to its matching parenthesis? I thought about **df)**, but that only will get you to just after the 9.0. Is there a similar way to get vim to grab everyth...
[ -0.03593285381793976, -0.06717511266469955, 0.9674474000930786, 0.04527587071061134, -0.18457838892936707, 0.21095740795135498, 0.3545368015766144, -0.35885921120643616, -0.3735903799533844, -0.21552354097366333, -0.4824225902557373, 0.3186591565608978, -0.36683130264282227, -0.08052852749...
because `%` is a "motion command", so it can be used anywhere vim expects such a command. From [`:help y`](http://vimdoc.sourceforge.net/htmldoc/change.html#y): ``` ["x]y{motion} Yank {motion} text [into register x]. When no characters are to be yanked (e.g., "y0" in column 1), ...
[ 0.128032386302948, -0.14949728548526764, 0.6484650373458862, 0.009960970841348171, 0.2374580055475235, 0.29429998993873596, 0.08545645326375961, -0.23127271234989166, -0.36810460686683655, -0.34854021668434143, -0.5305360555648804, 0.34924572706222534, -0.16801637411117554, 0.0221933256834...
flag. ``` By default, "item" includes brackets, braces, parens, C-style comments and various precompiler statements (`#ifdef`, etc.). There is a plugin for "extended % matching" that you can find on the [Vim homepage](http://www.vim.org/scripts/script.php?script_id=39). You can read the documentation on `%` and rel...
[ 0.4010695815086365, -0.19552652537822723, 0.7476012110710144, 0.24498437345027924, -0.1310017704963684, 0.25521042943000793, 0.06106563284993172, -0.34961646795272827, -0.599702000617981, -0.3414911925792694, -0.019087938591837883, 0.5392135381698608, -0.33263739943504333, -0.0612350106239...
^ ``` Let's say your cursor is positioned at `^`. Enter the following sequence to select the part you are looking for: ``` v2a) ``` First `v` enters Visual mode, then you specify that you want to go `2` levels of parens up. Finally the `a)` selects "a block". After that you can use `d` or `x` to delete, etc. If y...
[ -0.35758742690086365, -0.231288343667984, 0.8971511125564575, -0.13591201603412628, -0.19963960349559784, 0.1989300400018692, 0.2083791345357895, -0.4515781104564667, -0.2124418020248413, -0.43427807092666626, -0.4599611163139343, 0.6071668863296509, -0.2632395327091217, -0.400843143463134...
Coming from a C++ background, I've run into a snag with overloading based on a specific instance of a generic type. The following doesn't work since only once instance of the code for the `Foo<T>` class is ever generated, so inside the `Method`, the type of `this` is simply `Foo<T>`, not `Foo<A>` or `Foo<B>` as I'd hop...
[ 0.270923376083374, 0.19376857578754425, -0.10133463144302368, -0.11133383214473724, -0.12025889754295349, -0.15644188225269318, 0.2434992641210556, -0.33860963582992554, -0.30856701731681824, -0.5020462870597839, 0.06859327107667923, 0.35685276985168457, -0.674126386642456, 0.3072730302810...
public void OverloadedMethod(Foo<B> b) {} // do some B related stuff public void OverloadedMethod(OtherFoo of) {} // do some other stuff public void VisitFoo(FooBase fb) { fb.Method(this); } } abstract class FooBase { public abstract void Method(Bar b); } class Foo<T> : FooBase { // Class that deals...
[ 0.5080305933952332, 0.11968318372964859, 0.1920642852783203, -0.19834734499454498, 0.21311599016189575, -0.14342622458934784, 0.3346903324127197, -0.3456321656703949, -0.24322474002838135, -0.13580915331840515, -0.08702176809310913, 0.47620031237602234, -0.8655100464820862, 0.1652614027261...
: FooBase { public override void Method(Bar b) { b.OverloadedMethod(this); } } class Program { static void Main(string[] args) { List<FooBase> ListOfFoos = new List<FooBase>(); ListOfFoos.Add(new OtherFoo()); ListOfFoos.Add(new Foo<A>()); ListOfFoos.Add(new F...
[ 0.1529412567615509, 0.08710769563913345, 0.4170210659503937, -0.6888896822929382, 0.24595537781715393, 0.11456388235092163, 0.39609670639038086, -0.40575116872787476, -0.04119759052991867, -0.11985642462968826, -0.4543406069278717, 0.5256000757217407, -0.9130008816719055, 0.187312513589859...
ListOfFoos) b.VisitFoo(fb); // Hopefully call each of the Bar::Overloaded methods } } ``` Is there a way to get something like this to work in C#? I'd rather not have to duplicate the code in Foo as separate classes for every type I want to use it for. Edit: Hopefully this is a little clearer...
[ 0.3160070776939392, 0.22885559499263763, 0.2460179477930069, -0.06174151226878166, -0.24100087583065033, -0.4577038586139679, 0.39785540103912354, -0.2131192684173584, -0.45119476318359375, -0.4107131361961365, -0.05730678513646126, 0.632286012172699, -0.67378169298172, -0.0429723560810089...
methods. ``` class Program { static void Main(string[] args) { var testA = new Foo<A>(); testA.Method(); var testB = new Foo<B>(); testB.Method(); Console.ReadLine(); var testString = new Foo<string>(); //Fails testString.Method(); Console.ReadLi...
[ 0.34211084246635437, -0.03185368701815605, -0.14217129349708557, -0.32365870475769043, 0.03598674759268761, 0.1654866635799408, 0.5000840425491333, -0.3503607511520386, 0.024391228333115578, -0.3091183006763458, -0.38426855206489563, 0.4235769212245941, -0.6769766211509705, 0.2959702610969...
} class Bar { public static void OverloadedMethod(Foo<A> a) { Console.WriteLine("A"); } public static void OverloadedMethod(Foo<B> b) { Console.WriteLine("B"); } } class Foo<T> { static Foo() { overloaded = (Action<Foo<T>>)Delegate.CreateDelegate(typeof(Action<Foo...
[ 0.07155615836381912, -0.060382381081581116, 0.31271496415138245, -0.0846005529165268, 0.11507431417703629, 0.2822440564632416, 0.4161607325077057, -0.5543600916862488, -0.21599429845809937, -0.2697203755378723, -0.26331764459609985, 0.4423154890537262, -0.7208940982818604, 0.30781504511833...
} private static readonly Action<Foo<T>> overloaded; } ```
[ -0.3086519241333008, -0.02044723369181156, -0.005231118761003017, -0.2720946669578552, 0.15867356956005096, -0.16893133521080017, 0.2524689733982086, 0.1848253309726715, 0.06314089149236679, -0.3113558292388916, -0.3880131244659424, 0.8560295104980469, -0.5711123943328857, 0.13112275302410...
I want to fill a map with class name and method, a unique identifier and a pointer to the method. ``` typedef std::map<std::string, std::string, std::string, int> actions_type; typedef actions_type::iterator actions_iterator; actions_type actions; actions.insert(make_pair(class_name, attribute_name, identifier, metho...
[ -0.00021500373259186745, -0.025647493079304695, 0.3501805067062378, -0.3331548869609833, 0.23593005537986755, 0.4855596721172333, 0.26098135113716125, -0.5543143153190613, -0.2727811932563782, -0.61393141746521, -0.2121892273426056, 0.49196240305900574, -0.6828442215919495, -0.062206447124...
//class and method match //create a new class instance //call method } } } ``` If the method is static then a simple pointer is enough and the problem is simple, but I want to dynamically create the object so I need to store a pointer to class and an offset for the method and I do...
[ 0.04324730485677719, -0.013462058268487453, 0.10188300907611847, 0.06261130422353745, 0.023938611149787903, -0.04895223304629326, 0.2338416576385498, -0.18382862210273743, 0.028540169820189476, -0.4638650417327881, 0.2534031867980957, 0.8969854116439819, -0.6535057425498962, 0.056102674454...
(if the offset is always the same etc). The problem is that C++ lacks reflection, the equivalent code in a interpreted language with reflection should look like this (example in PHP): ``` $actions = array ( "first_identifier" => array("Class1","method1"), "second_identifier" => array("Class2","method2"), ...
[ 0.2722815275192261, 0.01070223469287157, 0.35350659489631653, -0.2829480767250061, -0.26919010281562805, 0.2618808150291443, 0.29760730266571045, -0.6467931866645813, -0.30352506041526794, -0.2510358393192291, -0.21779613196849823, 0.6515286564826965, -0.5334143042564392, -0.37919262051582...
$className = $action[0]; $methodName = $action[1]; $object = new $className() ; $method = new ReflectionMethod($className , $methodName); $method -> invoke($object); } } } ``` PS: Yes I'm trying to make
[ 0.2694259285926819, -0.2197810411453247, 0.31561070680618286, -0.26342877745628357, 0.09588773548603058, 0.30737295746803284, 0.7046483159065247, -0.2693769037723541, -0.0253258366137743, -0.5646529793739319, -0.2991738021373749, 0.48854953050613403, -0.5068488121032715, 0.2024912089109420...
a (web) MVC front controller in C++. I know I know why don't use PHP, Ruby, Python (insert your favorite web language here) etc?, I just want C++. I wrote that stuff last hours, and added it to my collection of useful stuff. The most difficult thing is to cope with the factory function, if the types you want to create ...
[ 0.006973193492740393, -0.07715470343828201, 0.6732279062271118, -0.0339481346309185, -0.0885249525308609, -0.1921701729297638, -0.02739587426185608, 0.02127649448812008, -0.34151899814605713, -0.40703898668289185, -0.031295038759708405, 0.6413002610206604, -0.5812666416168213, 0.0869877710...
is a so-called discriminated union). The second problem is how you store your function pointers. The problem is that a pointer to a member of `A` can't be stored to a pointer to a member of `B`. Those types are incompatible. To solve this, i store the function pointers in an object that overloads its `operator()` and t...
[ -0.16884130239486694, -0.06303449720144272, 0.33073216676712036, -0.12221105396747589, -0.26323166489601135, -0.06447910517454147, 0.1646769493818283, -0.5615168213844299, -0.19879308342933655, -0.385429322719574, -0.17918090522289276, 0.5028497576713562, -0.42842206358909607, -0.194725990...
unrelated classes // struct foo { std::string one() { return "I "; } }; struct bar { std::string two() { return "am "; } }; struct baz { std::string three() const { return "happy!"; } }; // The following are the parameters you have to set // // return type typedef st...
[ 0.06245443969964981, -0.1585136502981186, 0.37852567434310913, -0.10454811900854111, -0.03527224063873291, 0.42048242688179016, 0.060838449746370316, -0.22625106573104858, -0.19796717166900635, -0.33833155035972595, -0.18689082562923431, 0.47651898860931396, -0.743615984916687, 0.008426479...
> variant_type; // type used to call a function on the object currently active in // the given variant typedef boost::function<return_type (variant_type&)> variant_call_type; // returned variant will know what type is stored. C++ got no reflection, // so we have to have a function that returns the correct type based ...
[ 0.18369963765144348, -0.4085692763328552, 0.6489556431770325, -0.300607830286026, -0.13381117582321167, 0.5836734771728516, 0.05988707020878792, -0.6195338368415833, -0.13878601789474487, -0.5225193500518799, -0.10659883171319962, 0.515938937664032, -0.3620873987674713, -0.2065815627574920...
fn::parameter_types< T, mpl::identity<mpl::_> >, 0>::type actual_type; // type of boost::get we use typedef actual_type& (*get_type)(variant_type&); // prints _2 if n is 0 #define PLACEHOLDER_print(z, n, unused) BOOST_PP_CAT(_, BOOST_PP_ADD(n, 2)) #define GET_print(z, n, unused) ...
[ -0.20758722722530365, -0.23118537664413452, 0.8919532895088196, -0.26252034306526184, 0.2620474696159363, 0.2578372061252594, -0.30245667695999146, -0.4931187629699707, -0.1878727227449417, -0.49051812291145325, -0.44063135981559753, 0.33239904046058655, -0.18861687183380127, -0.3391819000...
\ static variant_call_type get( \ typename boost::enable_if_c<fn::function_arity<U>::value ==
[ -0.1368061602115631, -0.2634071111679077, 0.5911582708358765, -0.41513633728027344, 0.09296407550573349, 0.1726282685995102, 0.3177018165588379, -0.3859466016292572, 0.2641901969909668, -0.42377740144729614, -0.53957200050354, 0.7321070432662964, -0.4854051470756531, -0.08923089504241943, ...
\ BOOST_PP_INC(n), U>::type t \ ) {
[ -0.3515304923057556, -0.18660715222358704, 0.6849138736724854, -0.3319271504878998, 0.2916766405105591, 0.1611078828573227, -0.04425999894738197, -0.13468556106090546, -0.031973373144865036, -0.25327208638191223, -0.4774967432022095, 0.7280299663543701, -0.45003581047058105, -0.09262216091...
\ /* (boost::get<actual_type>(some_variant).*t)(n1,...,nN) */ \ return boost::bind( \
[ -0.16051021218299866, -0.26819485425949097, 0.3497261703014374, -0.3763543367385864, 0.11692597717046738, 0.025423144921660423, 0.3031313717365265, -0.36412501335144043, 0.0009978734888136387, -0.4510696530342102, -0.4286946952342987, 0.49678972363471985, -0.1925792098045349, -0.1812273710...
t, boost::bind( \ (get_type)&boost::get<actual_type>, \ _1)
[ -0.16539925336837769, -0.2752297520637512, 0.4929880201816559, -0.21369168162345886, 0.031705498695373535, 0.21944577991962433, 0.18211577832698822, -0.22450320422649384, 0.2322435826063156, -0.30546510219573975, -0.4958873391151428, 0.6884812712669373, -0.37150031328201294, -0.26388865709...
BOOST_PP_ENUM_TRAILING(n, PLACEHOLDER_print, ~) \ ); \ } // generate functions for up to 8 parameters BOOST_PP_REPEAT(9, GET_print, ~) #undef GET_print #undef PLACEHOLDER_print }; } // incoming type T is a member function
[ -0.32725825905799866, -0.46071770787239075, 0.8494469523429871, -0.2483014017343521, -0.12009286135435104, 0.3756450116634369, -0.015533295460045338, -0.4017256498336792, -0.11045743525028229, -0.13285420835018158, -0.41915643215179443, 0.3755395710468292, -0.3435817360877991, -0.327874869...
type. we return a boost::bind object that // will call boost::get on the variant passed and calls the member function template<typename T> variant_call_type make_caller(T t) { return detail::build_caller<T>::template get<T>(t); } // actions stuff. maps an id to a class and method. typedef std::map<std::string, ...
[ 0.10154683887958527, -0.26027658581733704, 0.591632068157196, -0.26450109481811523, -0.05647940933704376, 0.2407415807247162, 0.059177838265895844, -0.4443773329257965, -0.11094207316637039, -0.6742734909057617, -0.12770265340805054, 0.41418108344078064, -0.42812493443489075, -0.3071480691...
std::pair<factory_function, variant_call_type> > class_method_map_type; // this will be our test function. it's supplied with the actions map, // and the factory map std::string test(std::string const& id, actions_type& actions, class_method_map_type& factory) { // pair contain...
[ 0.1400715559720993, -0.15789414942264557, 0.07787314057350159, -0.20031549036502838, -0.16115303337574005, 0.3889297544956207, 0.17053361237049103, -0.44126975536346436, 0.18957304954528809, -0.6338667273521423, 0.024968255311250687, 0.3549354076385498, -0.3063028156757355, -0.122254334390...
actions[id]; // real code should take the maps by const parameter and use // the find function of std::map to lookup the values, and store // results of factory lookups. we try to be as short as possible. variant_type v(factory[class_method].first()); // execute the function associated, giving it...
[ -0.039663173258304596, -0.4350551664829254, 0.08171655237674713, -0.3744643032550812, 0.1265353560447693, 0.35926270484924316, 0.24123135209083557, -0.41980940103530884, -0.2454015165567398, -0.5186834335327148, -0.2704826295375824, 0.4477021098136902, -0.643945574760437, -0.19118972122669...
actions["second"] = std::make_pair("bar", "two"); actions["third"] = std::make_pair("baz", "three"); // connect the strings to the actual entities. This is the actual // heart of everything. class_method_map_type factory_map; factory_map[actions["first"]] = std::make_pair(&factory<foo>, ma...
[ 0.16273853182792664, -0.0945967510342598, 0.20049172639846802, -0.4413936138153076, 0.06720978766679764, 0.40030619502067566, 0.41428184509277344, -0.34627005457878113, -0.3081415891647339, -0.42941921949386597, -0.3272179365158081, 0.36461877822875977, -0.5343592762947083, -0.344158738851...
<< test("second", actions, factory_map) << test("third", actions, factory_map) << std::endl; } ``` It uses pretty fun techniques from boost preprocessor, function types and bind library. Might loop complicated, but if you get the keys in that code, it's not much to grasp anymore. If you want to change t...
[ -0.33272841572761536, -0.3068983256816864, 0.29515954852104187, -0.3446103036403656, -0.3363212049007416, 0.28376680612564087, 0.09949777275323868, -0.4633672535419464, -0.10195036232471466, -0.4071751832962036, 0.0226714089512825, 0.4870183765888214, -0.39063599705696106, -0.2592159509658...
look: ``` return factory[class_method].second(v, 42); ``` Have fun! --- If you now say the above is too complicated, i have to agree with you. It *is* complicated because C++ is *not* really made for such dynamic use. If you can have your methods grouped and implemented in each object you want create, you can use ...
[ 0.173893541097641, -0.15156124532222748, 0.21586614847183228, 0.05263145640492439, 0.14134050905704498, -0.17526717483997345, 0.3079109787940979, 0.05550949275493622, -0.46087202429771423, -0.6217060685157776, -0.15174224972724915, 0.7413960695266724, -0.47643324732780457, -0.0435076616704...
virtual std::string two() { not_implemented(); } private: void not_implemented() { throw std::runtime_error("not implemented"); } }; ``` For creating objects, a usual factory will do ``` struct object_factory { boost::shared_ptr<my_object> create_instance(std::string const& name) { // ... } }; ``...
[ -0.13959337770938873, -0.25335410237312317, 0.40129128098487854, -0.05816225707530975, -0.14295594394207, 0.47177115082740784, 0.2192133069038391, -0.21546253561973572, -0.18510301411151886, -0.7364317774772644, -0.11899634450674057, 0.5597670674324036, -0.34174323081970215, 0.256712168455...
&my_object::one; class_method_map[actions["second"]] = &my_object::two; ``` Calling the function would work like this: ``` boost::shared_ptr<my_object> p(get_factory(). create_instance(actions["first"].first)); std::cout << class_method_map[actions["first"]](*p); ``` Of course, with this approach, you loose fl...
[ 0.031106552109122276, -0.27214717864990234, 0.35671883821487427, -0.34839487075805664, -0.07243141531944275, 0.1171218752861023, 0.05437612161040306, -0.30421432852745056, -0.13639026880264282, -0.6129619479179382, -0.2143755406141281, 0.8070432543754578, -0.33337822556495667, -0.002346167...
I'm am looking for specific suggestions or references to an algorithm and/or data structures for encoding a list of words into what would effectively would turn out to be a spell checking dictionary. The objectives of this scheme would result in a very high compression ratio of the raw word list into the encoded form. ...
[ 0.4626302719116211, 0.4290494918823242, 0.3144002854824066, -0.12185557186603546, -0.12315738201141357, 0.17012467980384827, 0.4552510380744934, -0.3762475252151489, 0.1098666712641716, -0.5175300240516663, -0.17272277176380157, 0.25504064559936523, -0.09738005697727203, -0.072252191603183...
dictionary. It is ***not*** a requirement for the encoded dictionary form to be able to be [easily] converted back into the original word list form - a binary yes/no result is all that is needed for each word tested against the resulting dictionary. I am assuming the encoding scheme, to improve compression ratio, woul...
[ 0.1322576105594635, 0.2194092869758606, 0.3256698250770569, 0.04018445685505867, 0.052332162857055664, 0.20509840548038483, 0.1712181270122528, -0.06189747527241707, 0.14994853734970093, -0.628637969493866, -0.49505844712257385, 0.357778936624527, -0.09231828898191452, -0.21415965259075165...
I have in mind you can assume is for embedded devices where non-volatile storage space is at a premium and the dictionary would be a randomly accessible read-only memory area. ***EDIT***: To sum up the requirements of the dictionary: * zero false positives * zero false negatives * very high compression ratio * no nee...
[ 0.3002088665962219, 0.29551753401756287, 0.061865199357271194, -0.08465886861085892, -0.20577076077461243, -0.032476793974637985, 0.46329423785209656, -0.4805287718772888, 0.025879858061671257, -0.5591775178909302, 0.025715455412864685, 0.21273691952228546, -0.06733450293540955, -0.2533934...
I'd go with Bloom filters probably in preference to the method he picked, which squeezes a few more kB out at significant cost in speed. (*Programming Pearls* has a short chapter about this paper.) See also the methods used to store the lexicon in full-text search systems, e.g. [Introduction to Information Retrieval](...
[ 0.14114485681056976, -0.21759887039661407, -0.2316054105758667, 0.06301217526197433, -0.14102019369602203, -0.07034070044755936, 0.15559203922748566, -0.04684528708457947, 0.022453974932432175, -0.47614747285842896, -0.07648947089910507, 0.5985948443412781, -0.24789726734161377, -0.1091669...
Currently I am binding a dataset with a datagrid. ``` ds = query.ExecuteReadQuery("select PollQuestionText as 'Survey Question', PollAnswer1Text as 'Selection 1', PollAnswer2Text as 'Selection 2', PollAnswer3Text as 'Selection 3', PollEnabled 'Status' from tbl_pollquestions") For Each row As Data.DataRow In ds...
[ 0.03962108865380287, 0.17192170023918152, 1.1046721935272217, -0.23744794726371765, -0.207712784409523, -0.04627351835370064, 0.03979085758328438, -0.8986984491348267, 0.0036221009213477373, -0.6528603434562683, -0.10422245413064957, 0.14590850472450256, -0.18259234726428986, 0.59926724433...
border=""0""> </a>" End If Next GridView1.DataSource = ds GridView1.DataBind() ``` Since I am inserting html code, why this is not being converted to html? The output result is all text. (Suppose an icon is being displayed with no redirect url) I dont know why. Thanks Here's one quick way to solves ...
[ 0.11358954757452011, -0.326314777135849, 0.8357285261154175, 0.1754763275384903, -0.13734577596187592, -0.22569988667964935, 0.2204347401857376, -0.34838801622390747, -0.29231345653533936, -0.9872912764549255, 0.11492539942264557, 0.7559231519699097, -0.23103846609592438, 0.057596422731876...
to VB. ``` protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.Cells[4].Text == "0") { e.Row.Cells[4].Text = "<a href=''> <img src='img/box_icon_edit_pencil1.gif' border='0'> </a>" ...
[ 0.2995711863040924, 0.01742761768400669, 0.7228490710258484, -0.10365770757198334, 0.13899873197078705, 0.04173452779650688, 0.15258227288722992, -0.49869582056999207, -0.24012835323810577, -0.48490503430366516, -0.40719878673553467, 0.553495466709137, -0.43468090891838074, 0.3889277875423...
} } } ``` As a side note, you might want to change ``` <a href=''> <img src='img/box_icon_edit_pencil1.gif' border='0'> </a> <a href=''> <img src='img/box_icon_edit_pencil2.gif' border='0'> </a> ``` to ``` <a href="" class="Pencil1"></a> <a href="" class="Pencil2"></a> ``` and set the background image usin...
[ -0.08093013614416122, 0.0035766218788921833, 0.3469789922237396, -0.2385433316230774, 0.16951726377010345, 0.12495878338813782, -0.10552696883678436, -0.0028490759432315826, -0.13104352355003357, -0.5495731234550476, -0.24145644903182983, 0.6704806089401245, -0.2379477620124817, -0.2562586...
I have a Repeater contol bound to a custom object (an EntitySpaces query) and have noticed there are a couple of ways to conditionally format the values being displayed. 1) From my aspx I can call a method in my code-behind and pass through the bound value and use that to drive any conditional logic: ``` <a ...
[ 0.22896966338157654, -0.23003040254116058, 0.543046772480011, -0.40819069743156433, 0.1744537204504013, 0.02456907369196415, 0.4198567867279053, -0.5083694458007812, 0.12371959537267685, -0.4741276502609253, -0.135423943400383, 0.47472596168518066, -0.3195575177669525, 0.14886225759983063,...
} ``` 2) I can hook into the ItemDataBound event, retrieve e.Item.DataItem as a DataRowView and then go crazy: ``` protected void PackageList_ItemDataBound(Object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem) { return; ...
[ 0.023102769628167152, -0.21706289052963257, 0.49574151635169983, -0.10506298393011093, 0.2935789227485657, 0.12305346876382828, 0.451530396938324, -0.4411346912384033, 0.01670888252556324, -0.6257813572883606, -0.2503036856651306, 0.5739407539367676, -0.3985661268234253, 0.3682266473770141...
dr) { HtmlAnchor p = (HtmlAnchor)e.Item.FindControl("packageLink"); if (p != null) { p.HRef = string.Format("/Packages/View.aspx?p={0}", dr["packageId"]); p.InnerHtml = HttpUtility.HtmlEncode((string)dr["packageName"]); } } ``` I've also noticed that usi...
[ -0.11986315995454788, 0.01300441287457943, 0.7495700120925903, -0.18353472650051117, -0.12409462779760361, -0.05861577019095421, 0.19448044896125793, -0.49460846185684204, -0.2018527239561081, -0.6293286085128784, -0.4647112190723419, 0.5880435109138489, -0.21976323425769806, 0.12748430669...
and generally messing up the HTML. I'm keen to hear from anyone that has come up with a nice approach for dealing with these sorts of issues. Here's one quick way to solves your problem without using content template. First, add `RowDataBound` event to your GridView. ``` <asp:GridView ID="GridView1" runat="server" o...
[ -0.1075243279337883, 0.01068180426955223, 0.43044599890708923, -0.1349749118089676, -0.2515023946762085, -0.026858648285269737, 0.2479974627494812, -0.2138092815876007, -0.15573714673519135, -0.863921582698822, -0.15568794310092926, 0.751325249671936, -0.390666663646698, 0.0094988653436303...
if (e.Row.Cells[4].Text == "0") { e.Row.Cells[4].Text = "<a href=''> <img src='img/box_icon_edit_pencil1.gif' border='0'> </a>" } else { e.Row.Cells[4].Text = "<a href=''> <img src='img/box_icon_edit_pencil2.gif' border='0'> </a>" } } } ``` As a side note, you m...
[ -0.2821693420410156, 0.05903822183609009, 0.5278670787811279, -0.2371407151222229, 0.3672062158584595, 0.06560909748077393, 0.04387366399168968, -0.41641321778297424, -0.20905819535255432, -0.5202827453613281, -0.6318455934524536, 0.5445902943611145, -0.15191897749900818, -0.06512127816677...
<img src='img/box_icon_edit_pencil1.gif' border='0'> </a> <a href=''> <img src='img/box_icon_edit_pencil2.gif' border='0'> </a> ``` to ``` <a href="" class="Pencil1"></a> <a href="" class="Pencil2"></a> ``` and set the background image using CSS.
[ -0.27989083528518677, -0.059999968856573105, 0.39743107557296753, -0.21701094508171082, -0.08866441249847412, 0.5136144757270813, -0.12801167368888855, -0.1479223668575287, -0.34249719977378845, -0.5727974772453308, -0.2699444890022278, 0.2684614658355713, -0.24608059227466583, -0.28868275...
Kind of related to my [other question](https://stackoverflow.com/questions/405480/best-practices-when-applying-conditional-formatting-in-data-bound-controls) - I've only ever used HTMLControls with runat="server" and WebControls grudgingly, preferring to have control over the markup that gets generated (including the i...
[ 0.52166748046875, -0.24005334079265594, -0.02715856023132801, 0.19097357988357544, -0.37319788336753845, -0.3475222587585449, 0.04478096216917038, -0.11031100153923035, -0.44835954904556274, -0.37052688002586365, 0.12824168801307678, 0.17699255049228668, -0.4065546691417694, 0.028248686343...
using any ASP.NET server control (or HTML server control) in general? Because, if you just want to avoid using server controls in general, but don't want to use Response.Write either, you're seriously limited in your options. Personally, if you want control over markup, why not just loop through a SqlDataReader or so...
[ 0.12943539023399353, -0.3236365020275116, 0.4065079092979431, 0.14166441559791565, -0.2584607005119324, -0.1383570432662964, 0.17473217844963074, 0.08707462251186371, -0.3510630428791046, -0.6697188019752502, -0.26986458897590637, 0.29150208830833435, -0.3599388897418976, -0.24183389544487...
Does anybody know of a tool that allow me to inspect what files an installer just added to a system after it ran? Its sounds like this should be something that should exist. After a long sleepless night and research I have found this solution.When I thougt carefully I have came up with this. I am testing too many beh...
[ 0.39677733182907104, 0.08891166746616364, 0.34854575991630554, 0.014005397446453571, -0.3323240280151367, -0.10279975086450577, 0.36023297905921936, 0.059169139713048935, -0.2684791684150696, -0.6303960680961609, 0.23432078957557678, 0.5583666563034058, -0.2856113612651825, 0.3886480629444...
private IClassGenerationView view; private ClassGenerationPresenter presenter; [SetUp] public void Setup() { mockRepository =new MockRepository(); properties = new Dictionary<string, Type>(); clazz = mockRepository.DynamicMock<IClass>(); view = mockRepository.DynamicMoc...
[ 0.15507039427757263, -0.30962711572647095, 0.32385027408599854, -0.159002885222435, -0.25339463353157043, 0.21055446565151215, 0.3439388573169708, -0.27887025475502014, -0.14415967464447021, -0.6286785006523132, -0.19408078491687775, 0.6649823188781738, -0.15311181545257568, 0.278995156288...
using(mockRepository.Record()) { SetupResult.For(clazz.Properties).Return(properties); view.ClassProperties = properties; } using(mockRepository.Playback()) { presenter = new ClassGenerationPresenter(view, clazz, tableRepository); presente...
[ 0.09430208057165146, -0.11533154547214508, 0.462741494178772, -0.02619190700352192, -0.0929466038942337, 0.33724042773246765, 0.20708857476711273, -0.3018152117729187, -0.5389412045478821, -0.6206410527229309, -0.11611626297235489, 0.5667857527732849, -0.08812233060598373, 0.50973820686340...
[Test] public void View_Should_Display_Class_Name_As_A_Table_Name() { using (mockRepository.Record()) { SetupResult.For(clazz.Name).Return("ClassName"); view.TableName = "ClassName"; } using (mockRepository.Playback()) { presenter = ne...
[ 0.4359681010246277, -0.13092952966690063, 0.3052719533443451, -0.1214810460805893, -0.16891011595726013, 0.001281459117308259, 0.5222815871238708, -0.16978825628757477, -0.05158330500125885, -0.5537150502204895, -0.042449384927749634, 0.4755805432796478, -0.1008751168847084, 0.449156671762...
presenter.Load(); } } [Test] public void View_Should_Display_SQL_Data_Types() { List<string> dataTypes = new List<string>(); using(mockRepository.Record()) { SetupResult.For(tableRepository.GetDataTypes()).Return(dataTypes); view.DataTypes = data...
[ 0.15864655375480652, -0.14061987400054932, 0.4944642186164856, -0.1513536423444748, -0.3821350038051605, 0.2106662094593048, 0.46052980422973633, -0.031063152477145195, -0.3115187883377075, -0.5421779751777649, 0.026352550834417343, 0.44903743267059326, -0.26298773288726807, 0.256724745035...
using(mockRepository.Playback()) { presenter = new ClassGenerationPresenter(view, clazz, tableRepository); presenter.Load(); } } [Test] public void View_Should_Show_Table() { using (mockRepository.Record()) { SetupResult.For(clazz.Name...
[ 0.26828762888908386, 0.043421823531389236, 0.4216042757034302, -0.34697991609573364, -0.1437506377696991, 0.22687192261219025, 0.30187708139419556, -0.14468123018741608, -0.2656213343143463, -0.48738130927085876, -0.052237238734960556, 0.5407578349113464, -0.19140753149986267, 0.5029748082...
view.Table = null; LastCall.IgnoreArguments(); } using (mockRepository.Playback()) { presenter = new ClassGenerationPresenter(view, clazz, tableRepository); presenter.Load(); } } } ``` I have used lots of Dynamic mock to test one
[ 0.15639659762382507, 0.11323722451925278, 0.4505322277545929, -0.14800693094730377, -0.27700576186180115, 0.29731008410453796, 0.2788594365119934, -0.21439129114151, -0.3420782685279846, -0.5485090613365173, 0.1399405300617218, 0.6948198080062866, -0.15694579482078552, 0.3880305588245392, ...
behaviour at time. Also you can read Dave's [One Mock Per Test](http://laribee.com/blog/2007/08/04/one-mock-per-test/) article about this
[ 0.27161428332328796, -0.12544891238212585, -0.09665074944496155, -0.3249818980693817, -0.448122501373291, 0.14373908936977386, 0.793161153793335, 0.11056441068649292, -0.3860318064689636, -0.22100766003131866, 0.1536901742219925, 0.18550953269004822, -0.11283992230892181, -0.00140997802373...
Are all Enum enumerations constants? Do they get **converted to their value at compile-time**, or at run-time? They are constant. Yes, compile time. Reference: <http://msdn.microsoft.com/en-us/library/sbbt4032.aspx> From the intro: > The enum keyword is used to declare > an enumeration, a distinct type that > cons...
[ 0.05644599720835686, 0.0617285780608654, 0.15182776749134064, 0.07594630867242813, -0.08571014553308487, -0.10791139304637909, 0.09659984707832336, -0.2963915467262268, -0.03716810420155525, -0.7158979773521423, -0.38549044728279114, 0.2955434322357178, -0.47347620129585266, 0.081589490175...
When I build my c# solution the .tt files will not create the .cs file outputs. But if I right click the .tt files one at a time in solution explorer and select "Run Custom Tool" the .cs is generated, so the build tool setting is correct. What do I do to get the overall solution build to force the custom tool to run on...
[ 0.4071117341518402, 0.13816457986831665, 0.4307151734828949, -0.0771513506770134, -0.22437843680381775, 0.31686460971832275, 0.2574494183063507, -0.4956170618534088, -0.28367486596107483, -0.4268501400947571, -0.12570515275001526, 0.7257200479507446, -0.327021062374115, -0.0865854844450950...
T4 runs in Visual Studio vs. the command-line host.
[ -0.03477814793586731, -0.507803201675415, 0.21109506487846375, -0.2132558375597, -0.1819019615650177, -0.10696198046207428, 0.20644810795783997, 0.1620970368385315, -0.05629228055477142, -0.3714652955532074, -0.4458101987838745, 0.5730584263801575, -0.26932936906814575, -0.2344270348548889...
I have been reading through the CodePlex supported open source licenses, i couldn't quite understand everything, What i am looking for is a License that restrict the use of my source code commercialy. is there one? Thanks Why do you want to do that? It is not in the open-source spirit! Even the GPL [allows](http://ww...
[ 0.918095052242279, 0.32857775688171387, 0.09691459685564041, 0.16821818053722382, -0.2924484312534332, -0.5637063980102539, -0.14295904338359833, 0.10615459084510803, -0.14234991371631622, 0.007529866881668568, -0.09252721816301346, 0.4895891547203064, -0.11370580643415451, 0.5055928230285...
Code, Savannah, Launchpad etc. The [website says it supports](http://www.codeplex.com/CodePlex/Wiki/View.aspx?title=CodePlex%20FAQ#License) the following licenses: > Apache License 2.0, Common Development and Distribution License (CDDL), Eclipse Public License (EPL), GNU General Public License (GPL) v2, GNU Library Ge...
[ 0.8700461983680725, 0.34985169768333435, 0.43206989765167236, 0.1631641685962677, -0.38424259424209595, -0.2145857810974121, 0.29177674651145935, -0.3100852072238922, -0.11963748931884766, -0.28236696124076843, -0.2332914024591446, 0.43712177872657776, -0.3451038897037506, 0.28357848525047...
code in your product but give me credit.* * *Level 2: **Gimme fixes** (Mozilla Public License, CDDL, LGPL) You can use, modify and redistribute my code in your product but give me the source for any fixes you make to it.* * *Level 3: **Gimme it ALL!** (GPL) You can use, modify and redistribute my code in your product...
[ 0.7752220630645752, 0.4689107835292816, 0.24499736726284027, -0.07796477526426315, 0.0800589844584465, -0.36909958720207214, 0.1901528388261795, -0.12865492701530457, 0.011803519912064075, -0.26664140820503235, -0.3036559820175171, 1.091935157775879, -0.4100934565067291, 0.1481152325868606...
nothing prevents them from using the software internally for their own use — and that's a good thing). If you want to avoid feeling "ripped-off" by a commercial company "stealing" your code, the GPL is what you should use. They can make improvements to it, but the improvements will be available to everyone. Note that ...
[ 0.7127751708030701, 0.4194078743457794, 0.06793096661567688, 0.17911118268966675, 0.0786547064781189, -0.5521717667579651, 0.24223071336746216, 0.09631069004535675, -0.3048395812511444, -0.26385894417762756, -0.18271365761756897, 0.7651897668838501, -0.14791302382946014, 0.1403267979621887...
yours to give away, of course.)
[ 0.07911057025194168, -0.2490435540676117, 0.11350303143262863, 0.26549628376960754, 0.24244152009487152, 0.3877038359642029, 0.11594735831022263, -0.31730061769485474, -0.10902872681617737, 0.33085930347442627, -0.04227406159043312, 0.4671757221221924, -0.40460753440856934, 0.0758779719471...
I'm trying to write a query that updates rows in a table if a certain column has a value in a list I'm providing: ``` UPDATE MY_TABLE SET COL1 = 'xyz' WHERE COL2 IN ('x', 'y', 'z'); ``` I'm getting a syntax error, but I know that this should be possible. It's essentially a single command to execute the following 3 c...
[ -0.16528424620628357, 0.13483422994613647, 0.8440824747085571, -0.022012632340192795, -0.01977820321917534, 0.1960579752922058, 0.13484084606170654, -0.14426344633102417, -0.1501394659280777, -0.6474178433418274, -0.32827046513557434, 0.5679160356521606, -0.7136052846908569, -0.09617027640...
number of values (or I would just code it the long and awful way and be done with it. The only information I can find on the *IN* clause is concerned with subqueries. Can someone help me rewrite this query? Many thanks. You should post the *precise* error message. The error message will give a clue about what part of ...
[ 0.11905255913734436, 0.3329892158508301, 0.423488050699234, 0.11213324964046478, -0.1787606179714203, 0.0974462628364563, 0.15321803092956543, -0.07853592187166214, -0.1948421597480774, -0.375894695520401, 0.1193118467926979, 0.39890244603157043, -0.46586546301841736, 0.1686488837003708, ...