text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" id="date1_DateFormatOverride" /> </div> </div> </div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWFQLr6MeTCwKb1Zr0AwKVt6utCQKIwaTjAQKdwYzzBwLiwsDhDQKIwdCLBAKHwbCtCgLRr42cCQK...
[ -0.10775169730186462, -0.23443272709846497, 0.46360182762145996, -0.22819411754608154, 0.21015790104866028, 0.07418977469205856, 0.11978845298290253, -0.27490323781967163, -0.42469894886016846, -0.36107972264289856, -0.34224632382392883, 0.2146415263414383, -0.4143424332141876, 0.349597692...
Thread t = new Thread(ts); t.Start(); threads.Add(t); } foreach (Thread t in threads) { t.Join(); } ```
[ 0.239679753780365, -0.2715611457824707, 0.48633864521980286, -0.42285141348838806, 0.18964554369449615, -0.020179715007543564, 0.316120445728302, 0.01774432696402073, -0.32826313376426697, -0.5325729250907898, -0.3860774338245392, 0.3127437233924866, -0.4670693278312683, 0.6693008542060852...
I have just installed VMWare Server 2.0 on a fresh Fedora Core 8 install. The ports for the web access console of VMWare are 8222 and 8333 (like the defaults). When I try a remote http access to myserver:8222 it fails. But when I run ``` /sbin/service iptables stop ``` access becomes possibles (although not very sa...
[ -0.026134764775633812, 0.15722745656967163, 0.971691370010376, -0.2558462619781494, -0.23626214265823364, 0.006661064922809601, 0.31517910957336426, -0.553214967250824, -0.13701017200946808, -0.8348051309585571, -0.12328358739614487, 0.6205635666847229, -0.36441245675086975, 0.123290911316...
50 -j ACCEPT -A RH-Firewall-1-INPUT -p 51 -j ACCEPT -A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A RH-Firewa...
[ -0.24882258474826813, 0.24814818799495697, 0.8733095526695251, -0.020849671214818954, 0.20676887035369873, 0.004352490417659283, 0.2904133200645447, -1.1015684604644775, -0.20105454325675964, -0.18518313765525818, -0.5687121152877808, 0.3205227851867676, -0.10514949262142181, 0.15569636225...
iptables settings it's still not working. Do anyone knows what I am doing wrong? Your rules for VMware need to come before the REJECT entry; otherwise they'll never be reached. A good debugging tool is to add a LOG just before your rules to verify: ``` -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport...
[ -0.3284749388694763, 0.16353526711463928, 0.5682080984115601, 0.2182457149028778, 0.05323362722992897, -0.3757414221763611, 0.44175460934638977, -0.5217345952987671, -0.513340175151825, -0.41193607449531555, -0.018846817314624786, 0.4320017397403717, -0.2861553132534027, 0.1652966588735580...
-j LOG --log-prefix="8333 " -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8333 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT ``` Unlike other targets, `LOG` returns to allow further rules to be processed...
[ -0.36169448494911194, 0.1139771044254303, 0.34253475069999695, -0.0862267017364502, 0.051479630172252655, 0.17919686436653137, 0.34709879755973816, -0.5833519101142883, -0.19363754987716675, -0.0885324478149414, -0.4992287755012512, 0.3695761263370514, -0.4250330626964569, 0.12032595276832...
I have a situation where another developer is including source files from a project that I maintain in a project that he maintains. The nature of the files is such that each source file registers a "command" in an interpretive environment so all you have to do is link in a new source file to register a new "command". W...
[ 0.5431869626045227, 0.15630348026752472, -0.09614704549312592, 0.22631855309009552, 0.31582340598106384, -0.15987835824489594, 0.12497514486312866, -0.13345539569854736, -0.05258909612894058, -0.5770105719566345, 0.051980093121528625, 0.5018748044967651, -0.24924339354038239, 0.28997811675...
to both projects that "includes" a list of source file names in both projects. The problem is that I have no idea whether or how this could be done. Suggestions, anyone? There is no reason a source file can't be in multiple projects. Just add it as an 'existing item' in VS. If you are using precompiled headers then bo...
[ 0.1599191278219223, 0.19091741740703583, 0.1575813889503479, 0.11132016032934189, -0.03560708835721016, -0.12295647710561752, -0.09344135969877243, -0.23411844670772552, -0.3205435574054718, -0.8421884179115295, -0.07617300003767014, 0.42600181698799133, -0.25626859068870544, 0.13281796872...
[include](http://msdn.microsoft.com/en-us/library/2s3hwbhs(VS.80).aspx) option
[ 0.04121711105108261, -0.25885364413261414, 0.11118565499782562, 0.2526395916938782, 0.4126155376434326, -0.09842536598443985, 0.14170175790786743, -0.20848233997821808, -0.2582166790962219, -0.43763020634651184, -0.7320370674133301, 0.7223308682441711, -0.1694972962141037, -0.3731737434864...
Let's make this very easy. What I want: ``` @array = qw/one two one/; my @duplicates = duplicate(@array); print "@duplicates"; # This should now print 'one'. ``` How to print duplicate values of a array/hash? ``` sub duplicate { my @args = @_; my %items; for my $element(@args) { $items{$element}+...
[ 0.05964737758040428, 0.35576874017715454, 0.24334539473056793, -0.03718351572751999, 0.06089144945144653, 0.21197010576725006, 0.06527604162693024, -0.10425030440092087, -0.6040748953819275, -0.644460141658783, 0.13330115377902985, 0.23869191110134125, -0.597314178943634, 0.348540186882019...
I have a app that I'm deploying to a development server using Capistrano. I'd like to force this deployment to use the development database. So far the only way I've managed to do it is to make my production database info in `database.yml` equal to the development info. But this is a complete hack. I've tried setting ...
[ 0.4177391827106476, 0.09547267854213715, 0.3117067813873291, -0.06990320980548859, 0.14298444986343384, 0.06001289188861847, 0.3000161051750183, -0.035050079226493835, -0.09116077423095703, -0.6968355178833008, 0.1599787473678589, 0.5941696763038635, -0.33277902007102966, 0.234351381659507...
mode.
[ 0.27066662907600403, -0.5886679887771606, 0.3770955502986908, 0.12356685101985931, -0.09678902477025986, -0.19778844714164734, 0.2995639443397522, 0.05503104254603386, 0.23623834550380707, -0.4643166661262512, -0.1797320693731308, 0.8730942010879517, -0.37681108713150024, -0.09346693009138...
Say i have this PHP code: ``` $FooBar = "a string"; ``` i then need a function like this: ``` print_var_name($FooBar); ``` which prints: ``` FooBar ``` Any Ideas how to achieve this? Is this even possible in PHP? You could use [get\_defined\_vars()](http://php.net/get_defined_vars) to find the name of a variab...
[ 0.216293603181839, 0.3026528060436249, 0.3984098732471466, -0.2672002613544464, -0.16144415736198425, -0.13637739419937134, 0.23230811953544617, -0.14332215487957, -0.13793914020061493, -0.45538854598999023, 0.17120184004306793, 0.6547496318817139, -0.5621930956840515, 0.08343558758497238,...
so I've changed it to that. ``` function print_var_name($var) { foreach($GLOBALS as $var_name => $value) { if ($value === $var) { return $var_name; } } return false; } ``` Edit: to be clear, there is no good way to do this in PHP, which is probably because you shouldn't have ...
[ 0.20778988301753998, 0.08304242789745331, 0.3466479778289795, -0.3761015832424164, -0.06910239905118942, -0.28604912757873535, 0.24221183359622955, 0.10927741229534149, -0.2790345251560211, -0.5355313420295715, 0.09746966511011124, 0.7331689596176147, -0.3781355321407318, 0.125578001141548...
I'm trying to make a page in php that takes rows from a database, displays them, and then give the viewer a chance to upvote or downvote a specific entry. Here is a snippet: ``` echo("<form action=\"vote.php\" method=\"post\"> \n"); echo("<INPUT type=\"hidden\" name=\"idnum\" value=\"".$row[0]."\">"); echo("<INPUT typ...
[ 0.15202972292900085, 0.06169702485203743, 0.442803293466568, -0.11725669354200363, -0.3620549738407135, 0.128000870347023, 0.2913356125354767, -0.5095255374908447, -0.17687109112739563, -0.40016695857048035, 0.09005076438188553, 0.23497706651687622, -0.2836346924304962, -0.1375403255224228...
`<form/>`, but it should be `</form>`. This makes the entire page a form so it sends all the inputs. With a form that is closed properly though, it will only send the inputs within the form tags that the pressed button was in.
[ 0.028311947360634804, -0.239458829164505, 0.9842345118522644, -0.03989458456635475, -0.19888007640838623, -0.27399787306785583, 0.11161679774522781, -0.17338484525680542, -0.15791799128055573, -0.6791712045669556, -0.46457403898239136, -0.022430559620261192, -0.31136879324913025, -0.070529...
I would like to create an HTML table with row colors changing based on position and content. But instead of alternating every row, I'd like to be able to group rows together, so that I can have some XML like this: ``` <itemlist> <item group="0">Conent...blah blah</item> <item group="0">Content...who cares</item>...
[ 0.19218863546848297, -0.06879628449678421, 0.3483005166053772, 0.0999179556965828, 0.01305421069264412, 0.4020899832248688, -0.04363129660487175, -0.17049960792064667, -0.18510475754737854, -0.82828688621521, -0.013526307418942451, 0.17927388846874237, -0.446872740983963, 0.056594993919134...
is ways to alternate every row, but I can't seem to "get it" when it comes to actually using the node data to help me make the decision. Here's an example of using "choose" to apply a different class value based on the group value. Something similar to this would work if you want to treat each group in a specific way. ...
[ -0.09689589589834213, -0.267945796251297, 0.15551142394542694, 0.023416804149746895, 0.1463552564382553, 0.17287106812000275, -0.14979389309883118, -0.359444260597229, -0.0397380068898201, -0.6908596158027649, 0.14078159630298615, 0.558995246887207, -0.2317236065864563, -0.1435797810554504...
select="itemlist/item"/> </ul> </xsl:template> <xsl:template match="item"> <li> <xsl:attribute name="class"> <xsl:choose> <xsl:when test="@group = 0"> red </xsl:when>
[ -0.26757192611694336, -0.5209750533103943, 0.22588598728179932, -0.004980769008398056, -0.21702536940574646, 0.20200489461421967, -0.09352612495422363, -0.7543842792510986, -0.14641906321048737, -0.5509850978851318, -0.308968722820282, 0.3059068024158478, -0.3434251546859741, -0.0649916827...
<xsl:when test="@group = 1"> green </xsl:when> <xsl:when test="@group = 2"> blue </xsl:when>
[ -0.16905885934829712, -0.13468313217163086, -0.30231723189353943, 0.0316099114716053, 0.0568375401198864, -0.18725115060806274, -0.0139955198392272, -0.17385713756084442, -0.05261490121483803, -0.5021595358848572, -0.30252018570899963, 0.04628697782754898, -0.21705220639705658, -0.35617935...
<xsl:otherwise> black </xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:value-of select="."/> </li> </xsl:template> ```
[ 0.012723639607429504, -0.19400927424430847, 0.05178451165556908, -0.2097848802804947, 0.07750170677900314, -0.13625052571296692, -0.009958417154848576, -0.6253183484077454, 0.11972223222255707, -0.5122411251068115, -0.4014958143234253, 0.36668848991394043, -0.49053263664245605, -0.04340559...
I seem to remember being able to print out (or locate) the specific switches that each -O<num> option turns on. Can you remind? Thanks! The [list of new features on gcc 4.3](http://gcc.gnu.org/gcc-4.3/changes.html) shows a way to do it, via an extension to the `--help` command line option: ``` gcc -c -Q -O3 --help=op...
[ 0.020979540422558784, -0.06225687265396118, 0.5206839442253113, -0.09789182990789413, 0.1448383331298828, -0.06175060197710991, 0.15701717138290405, -0.04803876206278801, -0.4534003734588623, -0.6542916297912598, -0.1842481642961502, 0.8289753198623657, -0.05517503619194031, -0.08771347254...
I would like to know if it is possible to determine if a function parameter with a default value was passed in Python. For example, how does dict.pop work? ``` >>> {}.pop('test') Traceback (most recent call last): File "<stdin>", line 1, in <module> KeyError: 'pop(): dictionary is empty' >>> {}.pop('test',None) >>> ...
[ 0.08585459738969803, 0.15057659149169922, 0.22799985110759735, 0.08668879419565201, -0.03585667163133621, -0.15361334383487701, 0.19491533935070038, 0.0174919031560421, 0.06147817522287369, -0.2983066737651825, -0.10642839968204498, 0.5946824550628662, -0.14984306693077087, 0.1110729128122...
recent call last): File "<stdin>", line 1, in <module> TypeError: pop() takes no keyword arguments ``` That said, the way to detect whether an argument was provided is to use the `*args` or `**kwargs` syntax. For example: ``` def foo(first, *rest): if len(rest) > 1: raise TypeError("foo() expected at m...
[ -0.20497342944145203, -0.13499325513839722, 0.8405042886734009, -0.48647528886795044, 0.21462427079677582, 0.046111829578876495, 0.07745605707168579, -0.3356405794620514, 0.0660979226231575, -0.23041176795959473, -0.4462931454181671, 0.6912599205970764, -0.16071341931819916, 0.055492185056...
print 'second =', rest[0] ``` With some work, and using the `**kwargs` syntax too it is possible to completely emulate the python calling convention, where arguments can be either provided by position or by name, and arguments provided multiple times (by position and name) cause an error.
[ -0.13606856763362885, 0.008183480240404606, -0.04417868331074715, -0.2432897537946701, -0.23512306809425354, 0.07508853822946548, 0.3324137032032013, -0.15305794775485992, 0.031430475413799286, -0.2919289171695709, -0.28816190361976624, 0.5977076888084412, -0.2868705093860626, -0.055369555...
Does anyone have any suggestions (or a regular expression) for parsing the HTTP Accept header? I am trying to do some content-type negotiation in ASP.NET MVC. There doesn't seem to be a built in way (which is fine, because there are a lot of schools of thought here), but the parsing is not entirely trivial and I would...
[ 0.3212437927722931, 0.21023105084896088, 0.005830647423863411, 0.08580198138952255, -0.29645848274230957, -0.4117872416973114, 0.041618213057518005, 0.16348408162593842, -0.20241083204746246, -0.43684616684913635, 0.29407212138175964, 0.40719160437583923, -0.034349508583545685, -0.03596604...
Does anyone have a library or JavaScript snippet to validate the check digit of credit cards before the user hits Submit? The [jQuery Validation Plugin](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) has a [method](http://jquery.bassistance.de/api-browser/plugins.html#jQueryvalidatormethodscreditcard) ...
[ 0.3348942697048187, 0.1939457207918167, 0.2809613347053528, 0.2522161304950714, -0.07444163411855698, -0.18863101303577423, -0.10479575395584106, -0.36125877499580383, -0.4985525906085968, 0.10598103702068329, 0.23183269798755646, 0.4302646815776825, 0.4120629131793976, -0.1418518871068954...
I've noticed that the wmd editor can either output HTML or markdown. Does it make more sense to store the user input (in a database) as markdown or HTML? If as markdown, what is the best way to display it on a webpage later on (any examples would be greatly appreciated). Given that the recommendation is store it as ma...
[ 0.59949791431427, 0.04644550383090973, 0.2648257613182068, 0.11170452833175659, -0.34713542461395264, -0.41955822706222534, 0.1659422665834427, 0.06641141325235367, -0.3342471718788147, -0.8133889436721802, -0.2618998885154724, 0.4072725772857666, -0.3091951310634613, 0.08373276889324188, ...
then when the user wants to edit it, use something like [markdownify](http://milianw.de/projects/markdownify/) to convert it back to markdown - but you don't really gain anything, and lose a lot (the original markdown formatting, for one). It's also rather round-a-bout (you convert the markdown to HTML, store it. Then ...
[ 0.43227219581604004, -0.10647748410701752, 0.20565296709537506, 0.12236187607049942, -0.2517160475254059, -0.33160385489463806, 0.14548064768314362, -0.27687373757362366, -0.28780293464660645, -0.7135871648788452, -0.10038135945796967, 0.5204774737358093, -0.21086929738521576, -0.200392827...
I'm sure this has been asked before, but I can't find it. What are the benefits/limitations of using a browser-based interface for a stand-alone application vs. using a normal GUI framework? I'm working on a Python program currently implement with wxPython for the GUI. The application is simply user-entry forms and ...
[ 0.49862387776374817, 0.09098951518535614, 0.344480037689209, 0.15645228326320648, 0.0228740144520998, -0.11024594306945801, 0.01343609020113945, 0.45278599858283997, -0.24314729869365692, -0.8719357848167419, 0.12902794778347015, 0.4806062579154968, -0.2508685290813446, 0.18475991487503052...
using [Karrigell](http://karrigell.sourceforge.net/) for the web framework if I go browser-based. --- **Edit** For clarification, as of right now the application would be browser-based, not web-based. All the information would be stored locally on the client computer; no server calls would need to be made and no Inte...
[ 0.41710638999938965, 0.004450761713087559, 0.6615775227546692, 0.06505531072616577, -0.29893121123313904, -0.11394855380058289, 0.21637514233589172, -0.04007419943809509, -0.2320399135351181, -0.8480479121208191, -0.15631036460399628, 0.6888730525970459, -0.09157747030258179, 0.22687597572...
the environment that your application will be running in (the server hardware/OS) which makes for easier testing and support compared to the multitude of operating system/hardware configurations that a GUI app will be installed on. And for GUI based: * some applications (e.g.: image editing) arguably work better in a...
[ 0.15884478390216827, 0.15094980597496033, 0.22552931308746338, 0.26608243584632874, -0.16104505956172943, -0.12401515990495682, 0.37594911456108093, 0.1852158159017563, -0.11959641426801682, -0.8682969808578491, -0.0028271700721234083, 0.8065101504325867, -0.3891216218471527, 0.01886100322...
look and **feel**, so even if you were somehow able to get a toolkit that looked native on every platform, you'd have to somehow code your app to feel native on each platform. > > > It comes down to a decision: do you want to minimise development effort and have a GUI that doesn't look and feel quite right on each pl...
[ 0.43740105628967285, 0.05498354136943817, 0.15281537175178528, 0.2728785574436188, -0.15193434059619904, 0.22376230359077454, 0.26242661476135254, -0.08383281528949738, -0.3275940716266632, -0.8069586753845215, 0.045270875096321106, 0.6668469905853271, -0.23017148673534393, -0.043900616466...
had: you also need to consider the kind of data that your application manipulates and where it is stored, and how the users will feel about that. People are obviously okay having their facebook profile data stored on a webserver, but they might feel differently if you're writing a finance application like MYOB and you ...
[ 0.6070223450660706, 0.2154538631439209, 0.13747279345989227, 0.31719648838043213, 0.2038155198097229, -0.20914055407047272, -0.05545445904135704, -0.16798728704452515, -0.12155723571777344, -0.1970909982919693, 0.16395248472690582, 0.3622966706752777, 0.21308913826942444, -0.34674572944641...
situation you might decide that the overall effort is lower if you go with a native GUI app.
[ -0.1903207153081894, -0.0628044605255127, -0.08714213967323303, 0.10212569683790207, 0.02151956409215927, 0.2786209285259247, 0.47071143984794617, 0.10658770054578781, -0.1820189207792282, -1.0874733924865723, -0.34132975339889526, 0.6746008396148682, 0.11443864554166794, -0.32500267028808...
Microsoft's new [Windows Live Application Based Storage API](http://msdn.microsoft.com/en-us/library/cc305108.aspx) is a RESTful API. More info is [here](http://msdn.microsoft.com/en-us/library/cc305108.aspx). Why did they choose not to support WebDAV? WebDAV is for managing files on a remote server, but perhaps is n...
[ 0.27440688014030457, -0.06627814471721649, 0.2904452979564667, 0.24786236882209778, 0.007710773032158613, -0.19277998805046082, 0.09139086306095123, 0.15086263418197632, -0.14776968955993652, -0.6963292956352234, -0.18365822732448578, 0.47387245297431946, -0.2784930467605591, 0.36870217323...
I've heard that projects developed using TDD are easier to refactor because the practice yields a comprehensive set of unit tests, which will (hopefully) fail if any change has broken the code. All of the examples I've seen of this, however, deal with refactoring implementation - changing an algorithm with a more effic...
[ 0.37993305921554565, 0.1516265720129013, 0.08908078074455261, 0.27815505862236023, -0.07037953287363052, -0.019783856347203255, 0.33691030740737915, -0.39741426706314087, -0.16096292436122894, -0.5756124258041382, 0.09272772818803787, 0.6376310586929321, -0.24442383646965027, 0.07427545636...
to do this, but it actually needs to do that), etc... But if each test case is tightly coupled to these unstable classes, wouldn't you have to be constantly rewriting your test cases each time you change a design? Under what situations in TDD is it okay to alter and delete test cases? How can you be sure that alterin...
[ 0.34679076075553894, 0.08302244544029236, -0.04926473647356033, 0.5549936294555664, 0.23758627474308014, -0.23891538381576538, 0.28994113206863403, -0.14570000767707825, -0.13922818005084991, -0.4348379969596863, 0.15559400618076324, 0.6209992170333862, -0.2303573042154312, 0.4307256042957...
is built, stable, and functioning, but that's late in the game wheras TDD is supposed to help early on as well. Lastly, would a good book on TDD and/or refactoring address these sort of issues? If so, which would you recommend? > Plus it seems that having to > synchronize a comprehensive test suite > with constantly...
[ 0.02158491499722004, 0.1778065711259842, 0.36180827021598816, 0.17268171906471252, 0.23925696313381195, -0.2282901108264923, 0.3460215926170349, -0.21997088193893433, 0.21927666664123535, -0.7255688905715942, -0.02838214300572872, 0.753624439239502, 0.1333571970462799, -0.23609380424022675...
on as well. I do agree that the overhead of having a unit test suite in place can be felt at these early changes, when major architectural changes are taking place, but my opinion is that the benefits of having unit tests far outweigh this drawback. I think too often the problem is a mental one - we tend to think of o...
[ 0.9518738389015198, 0.29707619547843933, -0.1127423346042633, 0.15965940058231354, 0.1811896711587906, 0.1487036794424057, 0.21337416768074036, -0.14788992702960968, -0.1771051585674286, -0.6794254183769226, -0.15466450154781342, 0.6415648460388184, 0.26096034049987793, 0.28789371252059937...
as no less important and no less worthy of maintenance and work as any other part of the code base. Are the major architecural "changes" taking place truly only refactorings? If you are only refactoring, however dramatically, and tests begin to fail, that may tell you that you've inadvertantly changed functionality so...
[ 0.5257437825202942, 0.3429626524448395, 0.2372841238975525, 0.13045859336853027, 0.10016798228025436, 0.0758165568113327, 0.39496034383773804, -0.09436612576246262, -0.30138349533081055, -0.5830646753311157, -0.23984551429748535, 0.4942416548728943, -0.06868777424097061, 0.3152666985988617...
changes to functionality (and breaking tests) while refactoring. Update (based on comments): @Cybis has raised an interesting objection to my claim that refactoring shouldn't break tests because refactoring shouldn't change behavior. His objection is that refactoring *does* change the API, and therefore tests "break"...
[ 0.5920388102531433, 0.6128357648849487, 0.3722641170024872, -0.26291507482528687, -0.0686916932463646, 0.005894394591450691, 0.5624712705612183, -0.4542541205883026, -0.19141358137130737, -0.5197452306747437, 0.04601172357797623, 0.42343103885650635, -0.7690926790237427, 0.3117552399635315...
that the *behavior* has changed. Again, Fowler emphasizes that his definition of refactoring is that the changes are behavior *preserving*. In light of this, if a test or tests has to change during a refactoring, I don't see this as "breaking" the test(s). It's simply part of the refactoring, of preserving the behavio...
[ 0.48532676696777344, 0.33660605549812317, -0.17104753851890564, -0.015541374683380127, 0.2506491243839264, -0.0014770684065297246, 0.4888099133968353, -0.12636269629001617, -0.24347886443138123, -0.4491095244884491, 0.033711738884449005, 0.6723265647888184, -0.33826544880867004, 0.40305194...
would expect the tests, even the modified tests, to *continue to pass* once the refactoring is done. Whatever that test was testing (probably the assert(s) in that test) should still be valid after a refactoring is done. Otherwise, that's a red flag that behavior changed/regressed somehow during the refactoring. Maybe...
[ 0.7940744161605835, 0.22832827270030975, 0.03805205598473549, 0.14921410381793976, 0.07991638779640198, 0.008504567667841911, 0.724126398563385, -0.18146176636219025, -0.3225357234477997, -0.3540170192718506, 0.09575816988945007, 0.45093172788619995, 0.2176031917333603, 0.1553414911031723,...
changes the API that a test must call, or a class that a test must use, but in the end the point of the test should not change because of a refactoring. (The only exception I can think of to this is tests that test low-level implementation details that you may want to change during a refactoring, such as replacing a L...
[ 0.49344420433044434, 0.2515104413032532, 0.08168991655111313, 0.13615112006664276, 0.117347352206707, -0.24351340532302856, 0.39200037717819214, -0.20211640000343323, -0.060148097574710846, -0.7726612091064453, -0.2858808934688568, 0.257779061794281, -0.4566035568714142, 0.0493164323270320...
Is there a practical algorithm that gives "multiplication chains" To clarify, the goal is to produce a multiplication change of an **arbitrary and exact** length Multiplication chains of length 1 are trivial. A "multiplication chain" would be defined as 2 numbers, {start} and {multiplier}, used in code: ``` Giv...
[ 0.0725683942437172, -0.09798765927553177, 0.26082488894462585, -0.19463275372982025, -0.24008318781852722, 0.1200699582695961, -0.09917660057544708, -0.5275008082389832, -0.5460624098777771, -0.2339426726102829, -0.030826106667518616, 0.3937658667564392, -0.3665890097618103, 0.190275922417...
} while (a != {constant} ) // Postcondition: all {count} entries are filled. ``` I'd like to find a routine that takes three parameters 1. Power of 2 2. Stopping {constant} 3. {count} - Number of times the loop will iterate The routine would return {start} and {multiplier}. Ideally, a {Constant} ...
[ 0.15433014929294586, -0.07018575817346573, 0.2772831618785858, -0.2643698453903198, 0.04307868704199791, 0.06500247120857239, 0.5461434125900269, -0.700066864490509, -0.43091145157814026, -0.1267731636762619, 0.017440592870116234, 0.6744180917739868, -0.49729588627815247, 0.010164514183998...
the loop = 49 returns {25, 19} ``` The maximum {count} for a given power of 2 can be fairly small. For example, 2^4 (16) seems to be limited to a count of 4 Here is a method for computing the values for start and multiplier for the case when constant is odd: 1. Find such odd m (m = multiplier) that order of m ...
[ 0.06797397136688232, -0.19482938945293427, 0.16045205295085907, -0.27091965079307556, -0.11475490033626556, 0.06406693905591965, 0.45410507917404175, -0.6765652298927307, -0.4716958999633789, -0.39532169699668884, -0.11959641426801682, 0.41498082876205444, -0.3798086643218994, 0.1169250309...
guess, but from a little experimenting it seems that half of odd numbers between 1 and 2^D have order 2^(D-2) which is maximal. (I tried for D at most 12.) 2. Compute x such that x \* m^count = 1 (mod 2^D) and set start = x \* constant (mod 2^D). Such x can be found with "extended euclidean algorithm": Given a and b w...
[ -0.12441558390855789, -0.3747555613517761, 0.0587051622569561, -0.12134998291730881, 0.025856461375951767, 0.3033072054386139, 0.14067037403583527, -0.49141019582748413, -0.1612272560596466, -0.658310055732727, 0.09096100181341171, 0.32156503200531006, -0.13127918541431427, -0.145262524485...
it with a power of 2, say 2^k, to make in odd, then do the above for input {constant/2^k, count, 2^(D-k)} and finally return {start\*2^k,multiplier}.
[ -0.43350881338119507, -0.176374152302742, 0.36750560998916626, -0.2917644679546356, -0.0023066673893481493, 0.25801295042037964, 0.04685219004750252, -0.5883677005767822, -0.026741713285446167, -0.5009339451789856, -0.1858261078596115, 0.2066175788640976, -0.28395700454711914, 0.0942220464...
I got an HTML with the `<body onload="window.print()">`. The question I'm trying to ask is: * Is there any way to remove the strings that the web browsers add to the printed page? * Such as: + Web site from where the page was printed + Page count + Title of the web page + Date of printing Google Docs is now [ski...
[ 0.586600124835968, 0.00914353970438242, 0.7263838052749634, 0.08559135347604752, -0.18753795325756073, -0.12342099845409393, 0.26887786388397217, -0.1283532679080963, -0.2616836726665497, -0.5765535831451416, -0.07835062593221664, 0.3513961434364319, -0.17121921479701996, 0.216023668646812...
necessarily obvious behavior). While I don't find this to be an elegant solution, one should be able to recreate this fairly easily using most existing web technologies.
[ 0.11924615502357483, -0.08110405504703522, 0.15735355019569397, 0.33817821741104126, 0.16551025211811066, -0.42686429619789124, 0.5229358673095703, -0.09402599185705185, -0.11854880303144455, -0.616675853729248, -0.12025346606969833, 0.6560459733009338, -0.5203365683555603, -0.003135107457...
Which sql data type should we use for number bases primary key: 1. int 2. bigint 3. numeric 4. float Generally, `int`. `bigint` if you think you'll have more rows than there are atoms in the universe. `uniqueidentifier` is useful if you need *globally* unique keys (keys that are guaranteed to be unique across all ta...
[ 0.2438773363828659, -0.04939587414264679, 0.24949805438518524, 0.23205570876598358, -0.357138454914093, -0.28422674536705017, -0.2882404029369354, -0.060028139501810074, -0.2186499387025833, -0.34629541635513306, 0.2790336310863495, 0.2837003469467163, -0.22427119314670563, 0.1899200826883...
At work we do almost everything in Java and perl, but I wanted to build out a feature using PHP and sessions. Some peeps thought that it was a bad idea to try to do PHP sessions on our system, cause it's distributed to many servers. What would the specific problem be? The answer to your specific question, what would th...
[ 0.6213182806968689, 0.13603225350379944, 0.03752691671252251, 0.2852521538734436, -0.06425037235021591, -0.2964911460876465, 0.32846397161483765, -0.0587993822991848, -0.43764063715934753, -0.5233463048934937, 0.23301628232002258, 0.3978012800216675, -0.13982850313186646, -0.13730567693710...
you had two load-balanced webservers serving requests? Imagine hitting the first webserver with a request, which creates your session file on its file system. Then, your next request hits the second webserver. The second webserver will of course not see the session file. To the user, you might log in to a website, and...
[ 0.12474826723337173, -0.1633881777524948, 0.26024627685546875, 0.2042362093925476, -0.2554614245891571, -0.19159595668315887, 0.09718165546655655, 0.01281273365020752, -0.488132506608963, -0.535871684551239, 0.0820322260260582, 0.33812984824180603, -0.33444276452064514, 0.2359287291765213,...
or some shared memory cache server like memcached.
[ 0.14654876291751862, -0.08023256063461304, -0.1629813015460968, 0.6273674964904785, -0.04887997359037399, -0.024814123287796974, -0.2541652321815491, 0.6890522241592407, -0.332421213388443, -0.26869621872901917, 0.06824945658445358, 0.23487310111522675, 0.005465711932629347, 0.153427541255...
I am interested if it's safe to install both TortoiseCVS and TortoiseSVN on the same computer? All our corporate projects are controlled by CVS, but I want to use SVN for my personal documents (and TortoiseSVN as client). Is it possible? Thanks! They both can be used together with no (ok, almost no) problems. One prob...
[ 0.2938629686832428, 0.02852909453213215, 0.8129319548606873, 0.21312464773654938, 0.34319695830345154, 0.14122962951660156, 0.1040644571185112, 0.14010415971279144, -0.6106399297714233, -0.45321860909461975, -0.0891152024269104, 0.9923544526100159, 0.0671517625451088, -0.12735377252101898,...
this: [The overlay icons appear, but not all of them!](http://tortoisesvn.tigris.org/faq.html#ovlnotall) However, TortoiseSVN has created a common overlay handler, which other Tortoise clients can use to avoid this very issue. TortoiseCVS now uses that common handler too, but that isn't included in the stable release ...
[ 0.13832013309001923, -0.01088908314704895, 0.5080850720405579, 0.01682528480887413, 0.1818605661392212, 0.09597636014223099, 0.42462339997291565, -0.1714850217103958, -0.3624873757362366, -0.3930274546146393, -0.06247295066714287, 0.8085694909095764, -0.3193769156932831, -0.199307411909103...
I have a class that contains a dynamically allocated array, say ``` class A { int* myArray; A() { myArray = 0; } A(int size) { myArray = new int[size]; } ~A() { // Note that as per MikeB's helpful style critique, no need to check against 0.
[ -0.023745955899357796, -0.15963269770145416, 0.08626207709312439, -0.3895397484302521, -0.12880678474903107, 0.12242283672094345, 0.24170364439487457, -0.09828458726406097, -0.013841822743415833, -0.3968047499656677, -0.18028898537158966, 0.2205304503440857, -0.31524479389190674, 0.1824487...
delete [] myArray; } } ``` But now I want to create a dynamically allocated array of these classes. Here's my current code: ``` A* arrayOfAs = new A[5]; for (int i = 0; i < 5; ++i) { arrayOfAs[i] = A(3); } ``` But this blows up terribly. Because the new `A` object created (with the `A(3)` call) gets destru...
[ -0.0325549840927124, 0.17623576521873474, 0.41146260499954224, -0.2852267622947693, 0.08995131403207779, 0.060326673090457916, 0.6369869709014893, -0.2047063559293747, -0.2638378441333771, -0.5240932703018188, -0.19652530550956726, 0.5862554311752319, -0.3755623996257782, 0.308774620294570...
avoid: * Creating a copy constructor for `A`. * Using `vector<int>` and `vector<A>` so I don't have to worry about all this. * Instead of having `arrayOfAs` be an array of `A` objects, have it be an array of `A*` pointers. I would think this is just some beginners thing where there's a syntax that actually works when...
[ 0.28162306547164917, 0.1850304752588272, 0.11321117728948593, 0.1732649952173233, -0.20071573555469513, -0.14489227533340454, 0.34002411365509033, -0.28854429721832275, -0.43718448281288147, -0.7027645707130432, -0.03806991130113602, 0.6388322710990906, -0.290752112865448, -0.1368265748023...
useful "rule of 4," but I really suggest reading them all. Some are good, succinct statements of what's wrong, and some point out correctly how and why `vector`s are a good way to go. For building containers you obviously want to use one of the standard containers (such as a std::vector). But this is a perfect example ...
[ 0.08820074796676636, 0.1063244640827179, 0.22006921470165253, 0.1018756777048111, -0.10140271484851837, -0.24074360728263855, 0.13463850319385529, -0.22510424256324768, -0.23031897842884064, -0.6276150345802307, -0.21012400090694427, 0.6772119998931885, -0.4040968716144562, -0.363962799310...
Move Assignment (C++11) This is because if not defined the compiler will generate its own version of these methods (see below). The compiler generated versions are not always useful when dealing with RAW pointers. The copy constructor is the hard one to get correct (it's non trivial if you want to provide the strong ...
[ -0.10551226884126663, -0.266214519739151, 0.1351102888584137, -0.05867958441376686, -0.22036093473434448, -0.21764816343784332, -0.17068901658058167, -0.3670917749404907, -0.07764284312725067, -0.4016317129135132, -0.14587269723415375, 0.5756946802139282, -0.705890953540802, -0.47613793611...
to get it correct you should consider using std::vector rather than a pointer to an array of integers. The vector is easy to use (and expand) and covers all the problems associated with exceptions. Compare the following class with the definition of A below. ``` class A { std::vector<int> mArray; public: ...
[ -0.12574253976345062, -0.02927428111433983, 0.34563374519348145, -0.04245493561029434, 0.07444281876087189, 0.007307527121156454, 0.3969147503376007, -0.4496971666812897, -0.426222562789917, -0.32271742820739746, -0.13562226295471191, 0.5662090182304382, -0.43068328499794006, 0.12063056975...
problem is on this line. arrayOfAs[i] = A(3); // What is happening: // 1) A(3) Build your A object (fine) // 2) A::operator=(A const&) is called to assign the value // onto the result of the array access. Because you did // not define this operator the compiler generated one is // ...
[ 0.3464556932449341, 0.09125455468893051, 0.35184866189956665, -0.339803546667099, -0.0670192614197731, -0.027556955814361572, 0.2909244894981384, -0.7457534074783325, -0.40395301580429077, -0.4447006285190582, -0.007671068888157606, 0.8606651425361633, -0.46079736948013306, -0.144462779164...
you need to pay attention. In your case it is causing a problem because of the **shallow copy** problem. You have ended up with two objects that contain pointers to the same piece of memory. When the A(3) goes out of scope at the end of the loop it calls delete [] on its pointer. Thus the other object (in the array) no...
[ 0.286764919757843, 0.14587999880313873, 0.24129171669483185, 0.010906372219324112, 0.007262509316205978, -0.13062261044979095, 0.35507047176361084, -0.14480151236057281, -0.37212061882019043, -0.5321298837661743, -0.04185491055250168, 0.4540078341960907, -0.5260555148124695, 0.491749912500...
the source object to the destination object (hence shallow copy). **The compiler generated assignment operator**; copies each member variable by using that members assignment operator. For pointers this just means the pointer value is copied from the source object to the destination object (hence shallow copy). So th...
[ 0.02747940458357334, 0.11540572345256805, 0.15417468547821045, -0.10949776321649551, 0.16563862562179565, -0.10916846990585327, 0.32103800773620605, -0.1634458601474762, -0.050878286361694336, -0.44322213530540466, -0.17410561442375183, 0.6715760231018066, -0.4700641930103302, 0.5902200341...
A(size_t s = 0) {mSize=s;mArray = new int[mSize];} ~A() {delete [] mArray;} // Copy constructor needs more work A(A const& copy) { mSize = copy.mSize; mArray = new int[copy.mSize];
[ -0.07010427862405777, -0.14745230972766876, 0.45997947454452515, -0.3802216053009033, 0.2205360382795334, 0.38824743032455444, 0.49847546219825745, -0.5380306839942932, -0.1308336704969406, -0.326948881149292, -0.5218624472618103, 0.5876750349998474, -0.43413108587265015, 0.319168925285339...
// Don't need to worry about copying integers. // But if the object has a copy constructor then // it would also need to worry about throws from the copy constructor. std::copy(&copy.mArray[0],&copy.mArray[c.mSize],mArray); } // Define assignment operator in te...
[ 0.02762521617114544, 0.15507987141609192, 0.002276558196172118, -0.1173364520072937, 0.16225098073482513, -0.01644906774163246, 0.1613457351922989, -0.42581114172935486, -0.14364959299564362, -0.2404850572347641, -0.05153130367398262, 0.602398157119751, -0.5252695679664612, 0.0198946464806...
of the copy constructor // Modified: There is a slight twist to the copy swap idiom, that you can // Remove the manual copy made by passing the rhs by value thus // providing an implicit copy generated by the compiler. A& operator=(A rhs) // Pass by value
[ 0.4909096956253052, 0.20381522178649902, 0.0518743135035038, -0.07524403184652328, 0.14372144639492035, -0.09146973490715027, 0.35405251383781433, -0.3823528587818146, 0.03834544122219086, -0.22617726027965546, -0.216278076171875, 0.6212100386619568, -0.4496292173862457, 0.0202766209840774...
(thus generating a copy) { rhs.swap(*this); // Now swap data with the copy. // The rhs parameter will delete the array when it
[ 0.19801710546016693, 0.019120406359434128, 0.1632826179265976, 0.004103272221982479, 0.41982966661453247, -0.15027639269828796, 0.15567468106746674, -0.36224913597106934, -0.1305730640888214, -0.31267526745796204, -0.30916351079940796, 0.4885980784893036, -0.4726071357727051, 0.23842351138...
// goes out of scope at the end of the function return *this; } void swap(A& s) noexcept { using std::swap; swap(this.mArray,s.mArray); swap(this.mSize ,s.mSize);
[ -0.03688347712159157, -0.1331009417772293, 0.11243583261966705, -0.45404258370399475, 0.6148414015769958, -0.026715004816651344, 0.4864248037338257, -0.3022559583187103, -0.04023577272891998, -0.27925243973731995, -0.6218183636665344, 0.5147991180419922, -0.5110952258110046, 0.072866916656...
} // C++11 A(A&& src) noexcept : mSize(0) , mArray(NULL) { src.swap(*this); } A& operator=(A&& src) noexcept
[ 0.07015536725521088, -0.19291609525680542, 0.12672649323940277, -0.4082626700401306, 0.6217454075813293, 0.1479499489068985, 0.4808056056499481, -0.4902072846889496, 0.0037548779509961605, 0.05713801458477974, -0.34013351798057556, 0.7058826088905334, -0.5013599991798401, -0.08012133091688...
{ src.swap(*this); // You are moving the state of the src object // into this one. The state of the src object
[ -0.13704636693000793, -0.2903175354003906, 0.06858468800783157, -0.09524758905172348, 0.4484734833240509, -0.04654035344719887, -0.06530734896659851, -0.22909744083881378, -0.2660008370876312, -0.34988242387771606, -0.3251410722732544, 0.29985398054122925, -0.39534834027290344, 0.025242606...
// after the move must be valid but indeterminate. // // The easiest way to do this is to swap the states
[ 0.16350288689136505, 0.0034337732940912247, 0.08292283862829208, 0.11282896995544434, 0.3754207193851471, -0.016020195558667183, 0.2792220711708069, -0.41317814588546753, -0.030709542334079742, -0.3325080871582031, -0.3080883026123047, 0.17867402732372284, 0.01697991043329239, -0.050165381...
// of the two objects. //
[ 0.31895726919174194, 0.23394086956977844, 0.014401480555534363, -0.09746924787759781, 0.03885940834879875, 0.643261194229126, 0.049501027911901474, 0.28690844774246216, 0.08973806351423264, -0.6466754674911499, -0.2020871490240097, 0.4008471369743347, 0.14979320764541626, 0.017426332458853...
// Note: Doing any operation on src after a move // is risky (apart from destroy) until you put it // into a specific state. Your object should have
[ 0.1585521101951599, 0.0429222397506237, 0.15382710099220276, -0.07784581184387207, 0.12776221334934235, -0.4843040108680725, 0.43828800320625305, -0.31680989265441895, -0.33145835995674133, -0.05874494090676308, -0.4066402316093445, 0.3225972354412079, 0.022115059196949005, -0.146178975701...
// appropriate methods for this. //
[ 0.3806787133216858, 0.1747644692659378, -0.09325805306434631, 0.15742744505405426, 0.2651495933532715, -0.027571113780140877, 0.36231523752212524, 0.16166581213474274, 0.2142082005739212, -0.6456350684165955, -0.09412870556116104, 0.40036627650260925, 0.26302728056907654, -0.36216557025909...
// Example: Assignment (operator = should work). // std::vector() has clear() which sets //
[ 0.17312397062778473, -0.4271147847175598, 0.06904464215040207, -0.18333812057971954, 0.05121516436338425, 0.016876788809895515, 0.011890500783920288, -0.3394436240196228, -0.012614000588655472, -0.5207672715187073, -0.3251609206199646, 0.4887915849685669, -0.5035957098007202, -0.3511259853...
a specific state without needing to // know the current state. return *this; } } ```
[ 0.18527820706367493, 0.16464528441429138, 0.017225828021764755, 0.11986078321933746, 0.24067047238349915, -0.1991482526063919, 0.5110698938369751, 0.08132857084274292, 0.04563577473163605, -0.5105646252632141, -0.4752494692802429, 0.3321688175201416, -0.3586594760417938, 0.3588247895240783...
In my website, users have the possibility to store links. During typing the internet address into the designated field I would like to display a suggest/autocomplete box similar to Google Suggest or the Chrome Omnibar. Example: User is typing as URL: ``` http://www.sta ``` Suggestions which would be displayed: `...
[ 0.5979543924331665, 0.31258025765419006, 0.6090566515922546, -0.12230806797742844, 0.0013814886333420873, 0.08395121246576309, -0.14957109093666077, 0.08751701563596725, 0.02758835442364216, -0.6969432234764099, 0.4569256901741028, 0.27840977907180786, -0.08237066864967346, 0.2740612626075...
So I've got a Ruby method like this: ``` def something(variable, &block) .... end ``` And I want to call it like this: ``` something 'hello' { do_it } ``` Except that isn't working for me, I'm getting a syntax error. If I do this instead, it works: ``` something 'hello' do do_it end ``` Except there I'm ki...
[ 0.19117753207683563, 0.25581875443458557, 0.23221725225448608, -0.21680948138237, -0.07477051764726639, -0.28062328696250916, 0.6901082992553711, -0.008642368018627167, -0.3245757818222046, -0.4805068075656891, -0.07707174867391586, 0.2635763883590698, -0.30446499586105347, 0.2306277006864...
missing. Is there? You need to parenthesize your argument: ``` something('hello') { do_it } ``` That should work.
[ 0.08893531560897827, 0.49091750383377075, -0.029011357575654984, -0.004514309111982584, 0.4102604389190674, -0.17788822948932648, 0.2100161761045456, 0.1687309294939041, -0.11931753158569336, -0.40777236223220825, -0.43431052565574646, 0.47037017345428467, -0.3445780575275421, 0.3003752231...
I have the following line: ``` "14:48 say;0ed673079715c343281355c2a1fde843;2;laka;hello ;)" ``` I parse this by using a simple regexp: ``` if($line =~ /(\d+:\d+)\ssay;(.*);(.*);(.*);(.*)/) { my($ts, $hash, $pid, $handle, $quote) = ($1, $2, $3, $4, $5); } ``` But the ; at the end messes things up and I don't k...
[ -0.17362074553966522, 0.17102603614330292, 0.5797895193099976, -0.13179688155651093, 0.18589630722999573, 0.15074114501476288, 0.3963840901851654, -0.2965555489063263, -0.1851491928100586, -0.2734605073928833, -0.5097646713256836, 0.15785087645053864, -0.38669824600219727, 0.41338694095611...
the last one non-greedy, so they grab as little as possible and still match the string: ``` (\d+:\d+)\ssay;(.*?);(.*?);(.*?);(.*) ```
[ -0.28207653760910034, -0.06375163048505783, 0.225229874253273, -0.1381721943616867, 0.20869919657707214, 0.14624057710170746, 0.1065664067864418, -0.2133859395980835, 0.0231158509850502, -0.3409002721309662, -0.32997754216194153, 0.6027567386627197, -0.39057186245918274, 0.0614582374691963...
I have some event handler on a boundary class that manages a persistence mechanism for a given generic transaction: ``` void MyBoundaryClass::MyEventHandler(...) { //retrieve stuff from the UI //... //declare and initialize trasaction to persist SimpleTransaction myTransaction(.../*pass down stuff*/); //do s...
[ -0.21505136787891388, 0.0353858508169651, 0.41039395332336426, -0.08855492621660233, -0.017715899273753166, -0.10258814692497253, 0.39516347646713257, -0.33226731419563293, -0.19690418243408203, -0.6220653653144836, -0.0177781842648983, 0.38455167412757874, -0.4176061749458313, 0.421475291...
objects? Is there any useful rule of thumb to understand if I need a further level of encapsulation? At the moment the rule of thumb I follow is "if the method gets too big - do something about it". It is hard sometimes to find the right balance between procedural and object oriented when dealing with boundary event...
[ 0.4075312912464142, 0.02535819821059704, 0.07965203374624252, 0.197599858045578, -0.1820269674062729, -0.38800522685050964, 0.2400653064250946, -0.1255599409341812, -0.4183657765388489, -0.275655597448349, -0.1501455157995224, 0.48387575149536133, -0.1311125010251999, -0.023801790550351143...
(I.e. the definition of a new object) If the services (i.e the API) offered by this new object are coherent, and are better exposed to the rest of the program when regrouped in one special object, then by all means, use a new object. Otherwise, it is probable an overkill. Since you expose a ***public*** API by creat...
[ 0.42372453212738037, 0.18905721604824066, -0.30576613545417786, 0.22023117542266846, -0.018989436328411102, -0.23564660549163818, 0.4251629114151001, -0.17710769176483154, -0.33701613545417786, -0.6548587679862976, -0.33723291754722595, 0.4704212248325348, -0.22537100315093994, 0.194800272...
must actually test MyEventHandler of MyBoundaryClass, in order to retrieve data from the UI. But if you define a TransactionManager, that gives you the opportunity to **lower coupling of different architecture levels** (GUI vs. data) present in MyBoundaryClass, and to export data management into a dedicated class. ...
[ -0.13041585683822632, 0.013013651594519615, 0.41981762647628784, 0.372062623500824, -0.113237664103508, -0.4411587417125702, 0.2533065974712372, -0.16879282891750336, -0.22920674085617065, -0.6806961297988892, -0.18275494873523712, 0.5000170469284058, -0.10779059678316116, -0.0613704994320...
a well-define service boundary. Since it can be argued that [Coupling and Cohesion are two cornerstones of OO Programming](http://javaboutique.internet.com/tutorials/coupcoh/), the cohesion of a new class like TransactionManager can be evaluated in term of the set of actions it will perform. > Cohesive means that a c...
[ -0.04857853055000305, -0.1248108521103859, -0.11728274822235107, 0.11137288808822632, 0.04388543963432312, -0.33410775661468506, 0.363005131483078, -0.41536766290664673, -0.28234779834747314, -0.7103992700576782, -0.36715415120124817, 0.24328985810279846, -0.4028263986110687, 0.08986686915...
your TransactionManager, it should be fine, provided that its public API represent clear steps of what a transaction involves and not "stuff about transaction" like various utility functions. A name in itself is not enough to judge the cohesiveness of a class. The combination of the name and its public API is needed. ...
[ -0.0021451537031680346, -0.13051261007785797, -0.18400228023529053, 0.39005348086357117, -0.23727117478847504, -0.3339429795742035, 0.09551608562469482, -0.1600286215543747, -0.23276354372501373, -0.6130741834640503, -0.026219218969345093, 0.5300484299659729, -0.315753698348999, 0.24569524...
API around transaction steps (like initTransaction(), persistTransaction(), ...), avoiding any getter or setter for any Transaction instance.
[ -0.13878677785396576, -0.1502264440059662, 0.018388545140624046, 0.0961127057671547, 0.013129021041095257, -0.16943977773189545, 0.13813284039497375, -0.014440112747251987, -0.20570598542690277, -0.3907768130302429, 0.036913610994815826, 0.30787503719329834, -0.4604591429233551, 0.11921646...
I'm having a lot of issues with NSDate objects being prematurely deallocated. I suspect that the issues may be related to the way that I deal with the objects returned from NSDate convenience methods. I *think* that my showDate property declaration in the JKShow class should be "retain", but changing it to assign or co...
[ 0.2677704989910126, 0.07399558275938034, 0.6152060031890869, -0.42090222239494324, -0.05279170349240303, -0.36564022302627563, 0.4300965964794159, -0.30533263087272644, -0.2545497715473175, -0.2827399969100952, -0.4484386742115021, 0.551706850528717, -0.10156840831041336, 0.273770421743392...
in the code copied here. In my `JKShow init` method I was not retaining the date returned from the `NSDate` convenience method. Thanks for your help, everyone. I figured it out, thanks for all your help, but the problem was outside of the code I posted here. I was not retaining the `NSDate` I created in my init method....
[ 0.18888302147388458, 0.1669604331254959, 0.0716409683227539, 0.294277548789978, -0.1343570053577423, -0.3149859309196472, 0.2980042099952698, 0.294736385345459, -0.4508861005306244, -0.5742040276527405, 0.20443594455718994, 0.36390221118927, -0.09888974577188492, 0.3422074317932129, -0.3...
I was trying to solve my [XNA Font problem](https://stackoverflow.com/questions/254718/how-do-you-use-fonts-after-installing-xna), when I found this [here](http://www.xnaresources.com/pages.asp?pageid=33): > Visual Studio doesn’t recognize any > fonts you add after it is up and > running. Is there a way to use font...
[ 0.2185697853565216, 0.04169553890824318, 0.2814968526363373, -0.2352508008480072, -0.1744190752506256, -0.02090529352426529, 0.2613098919391632, 0.11302915960550308, -0.2906002104282379, -0.6163639426231384, 0.07849686592817307, 0.4580940902233124, -0.10228140652179718, 0.07582845538854599...
I want to make an MVC route for a list of news, which can be served in several formats. * news -> (X)HTML * news.rss -> RSS * news.atom -> ATOM Is it possible to do this (the more general "optional extension" situation crops up in several places in my planned design) with one route? Or do I need to make two routes li...
[ 0.22063206136226654, -0.35932615399360657, 0.572252631187439, 0.24452637135982513, 0.02267918922007084, -0.14374499022960663, 0.02648071013391018, -0.0399254709482193, -0.37606295943260193, -0.8146190643310547, -0.08091140538454056, 0.28327304124832153, -0.43561434745788574, 0.027683930471...
format = "" }); routes.MapRoute("News-ExplicitFormat", "news.{format}" new { controller = "News", action = "Browse" }); ``` It seems like it would be useful to have the routing system support something like: ``` routes.MapRoute("News", "news(.{format})?", ...
[ 0.029191305860877037, -0.19212505221366882, 0.5861513018608093, 0.12002910673618317, 0.06628672033548355, -0.14939533174037933, 0.20886561274528503, -0.19916750490665436, -0.3575175702571869, -0.9197927117347717, -0.2814287543296814, 0.37270015478134155, -0.26028546690940857, -0.1039307266...
method to support adding pairs like this as follows: ``` public static void MapRouteWithOptionalFormat(this RouteCollection routes, string name,
[ -0.034031640738248825, -0.17836922407150269, 0.1518399864435196, -0.05011320859193802, 0.022624514997005463, -0.12445592880249023, 0.20451760292053223, -0.28342825174331665, -0.017528649419546127, -0.7641560435295105, -0.0927896648645401, 0.2600792348384857, -0.5659953355789185, 0.15640020...
string url, object defaults) { Route implicitRoute = routes.MapRoute(name + "-ImplicitFormat",
[ -0.2448347806930542, -0.042021606117486954, 0.49239107966423035, -0.15554213523864746, -0.013578333891928196, 0.20648479461669922, 0.1711353212594986, 0.165696918964386, -0.1380833089351654, -0.7585919499397278, -0.10742516070604324, 0.287880539894104, -0.4541645348072052, 0.21288277208805...
url, defaults); implicitRoute.Defaults.Add("format", string.Empty); Route explicitRoute = routes.MapRoute(name + "-ExplicitFormat",
[ -0.11535174399614334, 0.006795643828809261, 0.5626522898674011, -0.08264697343111038, -0.09599389135837555, -0.03327265754342079, 0.24719980359077454, 0.05253894254565239, -0.19052475690841675, -0.7751147747039795, -0.3900229334831238, 0.31111767888069153, -0.4455519914627075, 0.1938587874...