text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
std::string const& to_str() const { return m_para; } bool operator==(Paragraph const& rhs) const { return m_para == rhs.m_para; } bool operator!=(Paragraph const& rhs) const {
[ -0.059630271047353745, 0.17948941886425018, 0.3590279817581177, -0.3839195966720581, -0.3852481245994568, 0.5025774240493774, 0.764751672744751, -0.8497617840766907, -0.24389876425266266, -0.31464526057243347, -0.7687193155288696, 0.44703400135040283, -0.4682327210903168, -0.04236335307359...
// Define != operator in terms of the == operator return !(this->operator==(rhs)); } bool operator<(Paragraph const& rhs) const { return m_para < rhs.m_para; } private: friend std::ostream & operator<<(std::ostream &os,
[ -0.15358015894889832, 0.03463122621178627, 0.4584426283836365, -0.29170092940330505, 0.25744500756263733, 0.31610825657844543, 0.7116966247558594, -0.5922229290008545, -0.12425343692302704, -0.5839472413063049, -0.5580419301986694, 0.6657454967498779, -0.36351966857910156, -0.0737098455429...
const Paragraph& p); std::string m_para; }; std::ostream & operator<<(std::ostream &os, const Paragraph& p) { return os << p.to_str(); } int main() { Paragraph p("Plop"); Paragraph q(p); std::cout << p << std::endl << (p == q) << std::endl; } ```
[ -0.5149226188659668, -0.020991742610931396, 0.8048794865608215, -0.4714603126049042, 0.10497967153787613, 0.4172835052013397, 0.27939218282699585, -0.26559191942214966, -0.19979646801948547, -0.44526782631874084, -0.9128549098968506, 0.5316012501716614, -0.49626415967941284, -0.03640192002...
I have a method that creates a MessageDigest (a hash) from a file, and I need to do this to a lot of files (>= 100,000). How big should I make the buffer used to read from the files to maximize performance? Most everyone is familiar with the basic code (which I'll repeat here just in case): ``` MessageDigest md = Mes...
[ 0.1757494956254959, -0.02318086102604866, 0.6289684772491455, -0.1308254450559616, 0.13988906145095825, 0.036306846886873245, 0.2275114506483078, -0.39214545488357544, -0.3332224488258362, -0.8141746520996094, 0.08967892080545425, 0.5323781371116638, -0.3058818578720093, -0.135963678359985...
is the ideal size of the buffer to maximize throughput? I know this is system dependent, and I'm pretty sure its OS, FileSystem, *and* HDD dependent, and there maybe other hardware/software in the mix. (I should point out that I'm somewhat new to Java, so this may just be some Java API call I don't know about.) **Ed...
[ 0.3281656801700592, -0.04528496414422989, 0.10653255879878998, -0.16586880385875702, -0.16860012710094452, -0.07565592974424362, 0.16847339272499084, 0.0889115184545517, -0.28581273555755615, -0.812385082244873, 0.16409832239151, 0.4334995746612549, -0.20148584246635437, -0.103134810924530...
size is related to a number of things: file system block size, CPU cache size and cache latency. Most file systems are configured to use block sizes of 4096 or 8192. In theory, if you configure your buffer size so you are reading a few bytes more than the disk block, the operations with the file system can be extremel...
[ -0.02074914053082466, 0.0804237425327301, 0.029635271057486534, 0.11341246962547302, 0.12398425489664078, 0.09769301116466522, 0.05376487225294113, -0.21119424700737, -0.605887770652771, -0.5357115864753723, -0.11401021480560303, 0.2985087037086487, 0.08929203450679779, 0.3025769591331482,...
-> L3/L2 cache latency. If you are unlucky and the blocks are not in cache yet, the you pay the price of the disk->RAM latency as well. This is why you see most buffers sized as a power of 2, and generally larger than (or equal to) the disk block size. This means that one of your stream reads could result in multiple ...
[ 0.2380521446466446, -0.2847420275211334, 0.2839747667312622, 0.09373360127210617, 0.06416591256856918, 0.04535960406064987, 0.06232614815235138, -0.12861111760139465, -0.31624725461006165, -0.6808760762214661, -0.10410433262586594, 0.4534764587879181, -0.11984746903181076, 0.08550994843244...
to still be in memory when you hit the next read (we are doing sequential reads here, after all) - so you wind up paying the RAM -> L3/L2 cache latency price on the next read, but not the disk->RAM latency. In terms of order of magnitude, disk->RAM latency is so slow that it pretty much swamps any other latency you mig...
[ 0.18784691393375397, 0.06517075002193451, 0.34560805559158325, 0.20234963297843933, 0.22217001020908356, 0.08189314603805542, 0.22858156263828278, 0.0769890621304512, -0.45748984813690186, -0.551348090171814, 0.0946747288107872, 0.5523842573165894, 0.5600865483283997, 0.06206698715686798, ...
Above that, I suspect that things would level out pretty quickly. There are a *ton* of conditions and exceptions here - the complexities of the system are actually quite staggering (just getting a handle on L3 -> L2 cache transfers is mind bogglingly complex, and it changes with every CPU type). This leads to the 're...
[ 0.2125764638185501, 0.0016629485180601478, 0.34559181332588196, 0.13052888214588165, 0.21097373962402344, 0.12346713244915009, 0.3048463761806488, 0.22991840541362762, -0.39708587527275085, -0.7035974860191345, -0.17535558342933655, 0.6356993913650513, -0.09524153918027878, -0.002384909661...
throughput, craft your implementation so you can swap out different disk interaction strategies, and provide the knobs and dials to allow your users to test and optimize (or come up with some self optimizing system).
[ 0.2414310872554779, 0.19289401173591614, 0.22387199103832245, 0.3102864921092987, 0.16655497252941132, 0.06289899349212646, -0.22299039363861084, -0.07918798923492432, -0.0928846225142479, -0.8971646428108215, -0.08256642520427704, 0.9420497417449951, 0.20295676589012146, -0.24371406435966...
Does a print version of the Java >= 1.5 API exist? Where can I buy it online? Preferably in Canada, but just a title is great. [Java in a Nutshell](http://www.amazon.co.uk/gp/reader/0596007736/ref=sib_dp_pt/026-8599590-2045232#reader-link) by O'Reilly
[ 0.31574371457099915, 0.2112686187028885, -0.15958771109580994, -0.03677818924188614, 0.017075806856155396, -0.09668125957250595, 0.37737441062927246, 0.2811603844165802, -0.21467062830924988, -0.24592112004756927, -0.16229619085788727, 0.13293665647506714, -0.14307901263237, -0.12011700868...
I have some code that generates image of a pie chart. It's a general purpose class, so any number of slices can be given as input. Now I have problem picking good colors for the slices. Is there some algorithm that is good at that? Colors need to follow some rules: * they need to look nice * adjacent colors should no...
[ 0.2783612906932831, -0.10497482866048813, 0.09551271051168442, -0.03595631942152977, -0.13010528683662415, 0.5911948084831238, -0.0026963658165186644, 0.04052124544978142, -0.2019098401069641, -1.069541096687317, 0.11812681704759598, 0.2992253601551056, -0.21270446479320526, 0.014063332229...
with the *2nd* color. This way you won't break your second rule. Also, if someone makes a pie chart with more than 20 slices, they have bigger problems. :)
[ 0.09597478061914444, 0.004091703798621893, 0.0927148312330246, 0.004153149668127298, -0.1646031141281128, 0.4121447801589966, 0.356590211391449, 0.003289365442469716, -0.6245843768119812, -0.9847797155380249, -0.34460878372192383, 0.1008811742067337, -0.24246589839458466, -0.37382736802101...
I'm creating a CSS editor and am trying to create a regular expression that can get data from a CSS document. This regex works if I have one property but I can't get it to work for all properties. I'm using preg/perl syntax in PHP. ### Regex ``` (?<selector>[A-Za-z]+[\s]*)[\s]*{[\s]*((?<properties>[A-Za-z0-9-_]+)[\s]...
[ -0.05119221284985542, 0.053946781903505325, 0.4508332312107086, -0.11052708327770233, -0.17847080528736115, 0.07501444220542908, 0.3360961079597473, -0.3454054594039917, 0.05660007521510124, -0.48007288575172424, -0.14468947052955627, 0.5177762508392334, -0.29617512226104736, -0.0410896502...
[0] => body ) [1] => Array( [0] => body ) [2] => font: 12px Arial;
[ 0.054639782756567, -0.14004956185817719, 0.20871588587760925, -0.33551931381225586, -0.3841693699359894, 0.3731721043586731, 0.4748762249946594, -0.3380282521247864, 0.3241264224052429, -0.5848896503448486, -0.47379791736602783, 0.45164671540260315, -0.3700099587440491, -0.2383103966712951...
[properties] => Array( [0] => font ) [3] => Array( [0] => font ) [values] => Array(
[ -0.056241899728775024, 0.072200246155262, 0.0983528420329094, -0.21320879459381104, -0.21154683828353882, 0.0334087535738945, 0.30660584568977356, -0.8459118604660034, 0.04094818979501724, -0.5157712697982788, -0.41221052408218384, 0.5006120204925537, -0.2215445339679718, -0.13865131139755...
[0] => 12px Arial [1] => background: #f00 ) [4] => Array( [0] => 12px Arial [1] => background: #f00
[ 0.16113659739494324, -0.3210727870464325, 0.1312587559223175, -0.12796038389205933, -0.07105404138565063, 0.3106270730495453, 0.43321099877357483, -0.3767756521701813, -0.02723073586821556, -0.4168054759502411, -0.42370855808258057, 0.3945961892604828, -0.48673948645591736, -0.290059566497...
) ) ) ``` ### Real Outcome ``` Array( [0] => Array ( [0] => body { background: #f00; font: 12px Arial; } [selector] => body [1] => body [2] => font: 12px Arial;
[ -0.051634714007377625, -0.09929726272821426, 0.4628394544124603, -0.24588169157505035, -0.20487621426582336, 0.22376121580600739, 0.20617452263832092, -0.6543604731559753, 0.11679492890834808, -0.505100667476654, -0.6157572865486145, 0.5240564942359924, -0.31040409207344055, -0.22346493601...
[properties] => font [3] => font [values] => 12px Arial [4] => 12px Arial ) ) ``` Thanks in advance for any help - this has been confusing me all afternoon! That just seems too convoluted for a single regular expression. Well, I'm sure that with the right extentions, an...
[ 0.1614343374967575, 0.34011027216911316, 0.35113441944122314, 0.05938320234417915, -0.08857516199350357, -0.11007723957300186, 0.5011805295944214, -0.16145390272140503, 0.06070501357316971, -0.6313455700874329, -0.25555431842803955, 0.6423562169075012, 0.08611595630645752, -0.1134218052029...
user could create the right regex. But then you'd need an even more advanced user to debug it. Instead, I'd suggest using a regex to pull out the pieces, and then tokenising each piece separately. e.g., ``` /([^{])\s*\{\s*([^}]*?)\s*}/ ``` Then you end up with the selector and the attributes in separate fields, and...
[ -0.022077344357967377, 0.02790890261530876, 0.07064343243837357, 0.22228579223155975, -0.27993637323379517, 0.06565596163272858, 0.081205353140831, -0.19591155648231506, -0.035460930317640305, -0.7049077749252319, -0.023262500762939453, 0.441055029630661, -0.21065296232700348, -0.010955304...
by parsing one field at a time, perhaps by using a recursive-descent parser or yacc/bison or whatever.
[ 0.18664968013763428, -0.031224191188812256, -0.6346444487571716, 0.36662179231643677, -0.17148414254188538, 0.18568743765354156, 0.4330805540084839, -0.007360407151281834, 0.008911940269172192, -0.28277307748794556, -0.18459296226501465, 0.3435908257961273, -0.24442127346992493, -0.4336586...
So, I'm writing a Cocoa application that needs to be able to display web content using Opera's rendering engine. This is for a feature, not because I'm an Opera fanboi (I'm not). All I've been able to find on the subject is this [press release about Adobe's use of the Opera engine](http://www.opera.com/pressreleases/en...
[ 0.4072445034980774, 0.10779137909412384, 0.250296026468277, 0.02372187003493309, -0.20970211923122406, -0.13188424706459045, -0.16970409452915192, 0.03080027922987938, -0.1033177375793457, -0.22228090465068817, 0.020119352266192436, 0.6701195240020752, -0.0841750055551529, 0.04054269939661...
money. What that probably means is Adobe has access to the library and SDK documentation so they can embed it in their applications. Opera doesn't give its engine away for free as in beer or freedom. It appears there are several B2B opportunities and I'm sure for the right amount of money you can get access to it. More...
[ 0.459221750497818, -0.004621224477887154, -0.20782871544361115, 0.1880393773317337, 0.01385188102722168, -0.1711048036813736, -0.12628278136253357, -0.050327129662036896, -0.303012877702713, 0.05871036648750305, 0.08087761700153351, 0.47457751631736755, 0.03742709010839462, -0.198436528444...
I know that systems are using their own time zone databases at different levels. Is there a central place where all timezeone and DST information lives, that makes it easy for programmers to write updates to their time zone data sources? For example, do people make provisions for a time zone for each possible combina...
[ 0.5785669088363647, -0.20714206993579865, 0.46439602971076965, 0.553021252155304, 0.38117700815200806, -0.2450944036245346, 0.17049549520015717, 0.30406200885772705, -0.39282944798469543, -0.6442494988441467, 0.17468306422233582, 0.3409273326396942, 0.016537649556994438, 0.1553091257810592...
Here's my problem: I have a virtual method defined in a .h file that I want to call in a class that inherits from the base class. Sadly though, the method in the derived class doesn't get called. Is there a better way to implement what I'm trying to do? ``` #ifndef ofxBASE_SND_OBJ #define ofxBASE_SND_OBJ #include "of...
[ -0.010408873669803143, 0.11763755232095718, 0.5174963474273682, 0.014752601273357868, 0.16873426735401154, -0.34046831727027893, 0.29574742913246155, -0.26945459842681885, -0.13254748284816742, -0.6722844839096069, 0.035977333784103394, 0.7109419107437134, -0.5517882704734802, 0.2161506712...
doesn't get called! return s; } ``` Then in another class I try to call it this way: ``` string ofxSndObj::createFilter(ofxBaseSndObj obj) { string str = obj.getType(); if(str.compare("ofxSOBuzz") == 0) { printf(" all is well "); } } ``` In the method above I need to be able to pass in ...
[ 0.005183479283004999, -0.004914665129035711, 0.5433205366134644, -0.2944223880767822, -0.10977194458246231, -0.34223300218582153, 0.7264119982719421, -0.3973079323768616, -0.1251770704984665, -0.4711216390132904, -0.34473732113838196, 0.2658689022064209, -0.6086229681968689, 0.138165235519...
copy). This means you are copying the object to the function. Because the function does not know what type you are actually passing it only passes the type defined in the function declaration and thus it makes a copy of the base class (this is know as the [slicing](http://www.cs.ualberta.ca/~hoover/Courses/201/201-New...
[ 0.3984106779098511, 0.1497744768857956, 0.4404280185699463, 0.11664844304323196, 0.12142618745565414, -0.3159814476966858, 0.22763293981552124, -0.010446895845234394, -0.035258058458566666, -0.6196838021278381, -0.17503374814987183, 0.41687795519828796, -0.6353956460952759, 0.6728427410125...
getType() const; // If the method does not change the object mark it const string key; }; string ofxSndObj::createFilter(ofxBaseSndObj const& obj) { // allowed to call this if getType() is a const string str = obj.getType(); if(str.compare("ofxSOBuzz") == 0) { printf(" all i...
[ 0.05696665495634079, -0.09746244549751282, 0.6933537125587463, -0.5675994753837585, 0.11826545000076294, -0.2526606321334839, 0.6686174869537354, -0.5508535504341125, 0.13046401739120483, -0.4696292579174042, -0.3674072027206421, 0.7053649425506592, -0.5066274404525757, 0.03005332313477993...
I've created a one-line batch file to run SqlMetal to regenerate a LINQ to SQL DataContext for my database; this works great. *Refresh\_DataContext.bat*: ``` "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\sqlmetal.exe" /server:.\sqlexpress /database:MyDatabaseName /code:"%~dp0\DataContext.vb" /contex...
[ 0.2997894883155823, 0.3721938729286194, 0.467846542596817, -0.19628404080867767, 0.12906090915203094, 0.06028307229280472, 0.13934968411922455, 0.08709217607975006, -0.1081179529428482, -0.7920138835906982, 0.064339280128479, 0.45405906438827515, 0.007202626205980778, 0.08688536286354065, ...
projects have pre- and post- build events; Web Site projects don't.
[ 0.721593976020813, 0.007777940947562456, -0.19367289543151855, 0.16498540341854095, 0.0712456926703453, -0.1000826358795166, 0.06861434876918793, 0.012094035744667053, -0.1341555267572403, -0.5319868922233582, -0.4694887101650238, 0.12674273550510406, 0.4216213524341583, -0.073500595986843...
I have a C# Windows application which runs a service. I would like to leverage PowerShell in order to offer a command line management interface for administering my running service. From my point of view, I am trying to offer the same administrative interface a la Exchange 2007. Do you have any suggestion or sample c...
[ 0.4554412066936493, 0.2156420797109604, 0.3125670254230499, 0.18071898818016052, 0.004824681673198938, -0.268914133310318, -0.168019101023674, 0.015628136694431305, -0.46535637974739075, -0.7992140054702759, 0.13184982538223267, 0.5403882265090942, -0.30369502305984497, 0.2593628168106079,...
many outbound connections my Windows service is using when the cmdlet is executed. A practical example or web link to an example would be more than welcomed. Thanks, Robert The key here is to start by writting an API that you can access from .Net, then you can easily wrap the calls to this API into a DLL that exposes...
[ 0.45591169595718384, 0.06484134495258331, 0.06670515984296799, 0.23276309669017792, -0.2097683548927307, -0.1337512731552124, 0.29149165749549866, 0.11831080913543701, -0.40506473183631897, -0.8399156928062439, 0.14646579325199127, 0.5581806898117065, -0.37996211647987366, 0.23833952844142...
If you have a look on codeplex you will find some examples of administer remote web based services like GoGrid and SQL Data Services that will give you some sample code to get you started.
[ 0.7088930606842041, -0.08098767697811127, -0.0940454974770546, 0.4178868234157562, -0.3682476282119751, -0.41960182785987854, 0.3384018838405609, -0.04371482506394386, -0.051750317215919495, -0.7195674180984497, 0.2854815125465393, 0.15379826724529266, -0.14125925302505493, 0.2932254970073...
What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: ``` function contains(a, obj) { for (var i = 0; i < a.length; i++) { if (a[i] === obj) { return true; } } return false; } ``` Is there a better...
[ -0.046814609318971634, 0.15500806272029877, 0.08241204172372818, -0.2771138548851013, -0.12698952853679657, -0.1507626324892044, 0.4480575919151306, -0.45686066150665283, 0.09265775978565216, -0.4630582332611084, -0.06279353052377701, 0.6543368101119995, -0.5115165710449219, -0.09873979538...
Stack Overflow question *[Best way to find an item in a JavaScript Array?](https://stackoverflow.com/questions/143847/best-way-to-find-an-item-in-a-javascript-array)* which addresses finding objects in an array using `indexOf`. Modern browsers have [`Array#includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScr...
[ -0.32369279861450195, 0.27387458086013794, 0.361393004655838, -0.06031326577067375, 0.11491633951663971, 0.09548410028219223, 0.2646576762199402, -0.5061970949172974, -0.27233418822288513, -0.27471381425857544, -0.4126507043838501, 0.42413726449012756, -0.22877909243106842, -0.107782833278...
[from])`](https://lodash.com/docs#includes) (is `_.contains` prior 4.0.0) * Ramda: [`R.includes(value, array)`](https://ramdajs.com/docs/#includes) Notice that some frameworks implement this as a function, while others add the function to the array prototype.
[ 0.29672005772590637, 0.1977233588695526, -0.08807160705327988, -0.3657158315181732, 0.103876031935215, -0.11591662466526031, 0.2767457067966461, -0.5455470085144043, -0.3181937038898468, -0.282894492149353, -0.4487100839614868, 0.293740838766098, -0.3659307658672333, 0.12388718873262405, ...
I'm just learning to work with partial classes in VB.NET and VS2008. Specifically, I'm trying to extend a LINQ to SQL class that was automatically created by SqlMetal. The automatically generated class looks like this: ``` Partial Public Class DataContext Inherits System.Data.Linq.DataContext ... <Table(Name:...
[ 0.13304004073143005, 0.20599249005317688, 0.1352611780166626, -0.03363354131579399, 0.06524530053138733, -0.3884969651699066, -0.10409992188215256, -0.298451691865921, -0.2008102685213089, -0.6925579905509949, 0.13356547057628632, 0.39291778206825256, 0.030291711911559105, 0.51958364248275...
Concession Public Function Foo() as String Return DoSomeProcessing(Me.Country) End Function End Class End Class ``` ... but I get blue jaggies under '`Me.Country`' and the message **`'Country' is not a member of 'DataContext.Concession'`**. Both halves of the partial class are in th...
[ 0.1686016470193863, 0.22098763287067413, 0.11551229655742645, 0.13287708163261414, -0.030441535636782646, -0.007475733291357756, 0.020016029477119446, 0.10171011090278625, -0.09724238514900208, -0.2885218560695648, -0.054035719484090805, 0.30109429359436035, -0.03544893115758896, 0.4111202...
from C# the classes of the DB tables aren't within the DataContext class, just beside it. So you have the class **MyNamespace.DataContext.Concession** when the other half of the partial class is realy **MyNamespace.Concession**
[ -0.15309639275074005, -0.14466345310211182, 0.24141860008239746, 0.28765952587127686, -0.13845200836658478, -0.09676011651754379, -0.06591225415468216, 0.09562847018241882, -0.10451839119195938, -0.8380950093269348, -0.343488872051239, 0.4212794303894043, 0.21235691010951996, 0.27950686216...
I'm doing some research work into content aggregators, and I'm curious how some of the current craigslist aggregators get data into their mashups. For example, www.housingmaps.com and the now closed www.chicagocrime.org If there is a URL that can be used for reference, that would be perfect! While continuing to resea...
[ 1.136793851852417, 0.055984485894441605, 0.5068894624710083, 0.3668639659881592, -0.06780824065208435, -0.4991653859615326, 0.03206011652946472, 0.26051366329193115, -0.28147873282432556, -0.25962769985198975, 0.5791214108467102, 0.37218213081359863, -0.10311142355203629, 0.322957128286361...
similar to my needs, and why I'm interested in this topic.
[ 0.47026199102401733, 0.28165242075920105, 0.1336047202348709, 0.022279370576143265, 0.10634519159793854, 0.2932952046394348, -0.23597559332847595, -0.09871562570333481, -0.08683568984270096, -0.5077154040336609, 0.1823883056640625, 0.28381383419036865, 0.2094106376171112, 0.178141623735427...
Is there a way to accept input from more than one mouse separately? I'm interested in making a multi-user application and I thought it would be great if I could have 2 or more users holding wireless mice each interacting with the app individually with a separate mouse arrow. Is this something I should try to farm out ...
[ 0.40506651997566223, -0.19960302114486694, 0.16459181904792786, 0.36858248710632324, -0.09417840093374252, 0.2607971429824829, 0.09148798137903214, -0.033837899565696716, -0.43020984530448914, -0.7140786647796631, 0.20775920152664185, 0.5338488221168518, -0.3512091338634491, -0.07021817564...
Windows MultiPoint Software Development Kit 1.1](http://www.microsoft.com/downloads/details.aspx?familyid=F851122A-4925-4788-BC39-409644CE0F9B&displaylang=en) or the new [Microsoft Windows MultiPoint Software Development Kit 1.5](http://www.microsoft.com/downloads/details.aspx?FamilyID=0eb18c26-5e02-4c90-ae46-06662818...
[ 0.13730992376804352, -0.09866773337125778, 0.4092470407485962, -0.08560897409915924, -0.2311147302389145, 0.10192246735095978, -0.08220894634723663, -0.12887457013130188, -0.433155357837677, -0.6880724430084229, -0.27925941348075867, 0.23884359002113342, -0.12575377523899078, 0.28324022889...
I'm experimenting with the NavBar sample project for iPhone. When I tap on one of the rows in the table in the default view a new view slides in (so far so good). I want to remove the UINavigationBar bar at the top of the new view that slides in. How can I do this? EDIT: I meant "UINavigationBar". Thanks to everyone ...
[ 0.06306403875350952, -0.03576235473155975, 0.4444531798362732, -0.10190712660551071, 0.11482394486665726, 0.033283933997154236, 0.49230849742889404, -0.02379295974969864, -0.2655368149280548, -0.6986761689186096, -0.10282829403877258, 0.6403253078460693, -0.08024376630783081, 0.05225028842...
in your `-applicationDidFinishLaunching:` method. * To hide the UINavigationBar, you'll want to use the `navigationBarHidden` property of your UINavigationController.
[ -0.13344156742095947, 0.20019832253456116, 0.6130765676498413, 0.13896748423576355, 0.2534961700439453, -0.22370928525924683, 0.5384967923164368, 0.008513569831848145, -0.14082394540309906, -0.6289958357810974, -0.32528117299079895, 0.40324458479881287, 0.03093162551522255, -0.160396590828...
For my application there are several entity classes, User, Customer, Post, and so on I'm about to design the database and I want to store the date when the entities were created and updated. This is where it gets tricky. Sure one option is to add created\_timestamp and update\_timestamp columns for each of the entity ...
[ 0.3873575031757355, 0.30613890290260315, 0.4651835262775421, 0.11363298445940018, 0.33055585622787476, -0.041276715695858, 0.024445507675409317, 0.1568067967891693, -0.3240492045879364, -0.8418008685112, 0.3256989121437073, 0.3875190317630768, -0.13861505687236786, 0.3697088360786438, 0....
I can think of: 1. The design of the log table will (probably) constrain the design of all the other tables. Most likely the log table would have one column named TableName and then another column named PKValue (which would store the primary key value for the record you're logging). If some of your tables have compoun...
[ 0.08311592787504196, 0.028139468282461166, 0.3200010657310486, 0.11860567331314087, 0.06787458807229996, -0.18541325628757477, 0.1657877266407013, -0.17432494461536407, -0.4482858180999756, -0.4708292782306671, 0.14580461382865906, 0.4351003170013428, -0.3185032308101654, 0.179993763566017...
available from a trigger would be the application's account, instead of the ID of the web app user (which is most likely what you really want to store in your CreatedBy field). This would only help you distinguish between records created by your web app code and records created otherwise. CreatedDate and ModifiedDate ...
[ 0.6921177506446838, -0.0009026339394040406, 0.4339935779571533, 0.06812259554862976, 0.10270176827907562, 0.20369747281074524, -0.009700268507003784, -0.27695930004119873, -0.2812349498271942, -0.39861759543418884, 0.09584571421146393, 0.24361181259155273, -0.3042871057987213, 0.1936790049...
the timestamp and user fields from my application code.
[ 0.39394664764404297, 0.26713746786117554, 0.32724103331565857, -0.053902074694633484, 0.09310608357191086, -0.03639945760369301, -0.019902735948562622, -0.00780672300606966, -0.11026659607887268, -0.48135673999786377, -0.20046445727348328, 0.26979419589042664, -0.04627380892634392, 0.16881...
In my django application I am using a template to construct email body, one of the parameters is url, note there are two parametes separated by ampersand in the url. ``` t = loader.get_template("sometemplate") c = Context({ 'foo': 'bar', 'url': 'http://127.0.0.1/test?a=1&b=2', }) print t.render(c) ``` After re...
[ 0.2614796459674835, 0.690451443195343, 0.3128030002117157, -0.45433884859085083, -0.3056854009628296, -0.05169565603137016, 0.25384238362312317, -0.38623955845832825, 0.2326296716928482, -0.39389148354530334, 0.24302329123020172, 0.5435526371002197, -0.5184869170188904, -0.2908807992935180...
ampersands? To turn it off for a single variable, use `mark_safe`: ``` from django.utils.safestring import mark_safe t = loader.get_template("sometemplate") c = Context({ 'foo': 'bar', 'url': mark_safe('http://127.0.0.1/test?a=1&b=2'), }) print t.render(c) ``` Alternatively, to totally turn autoescaping off f...
[ 0.28199294209480286, 0.07019209116697311, 0.4202634394168854, -0.19099518656730652, -0.13078655302524567, -0.022331124171614647, 0.107867531478405, -0.5056367516517639, -0.08353495597839355, -0.02745405212044716, -0.13315905630588531, 1.120356798171997, -0.35668545961380005, -0.12677198648...
At work, we have one of those nasty communal urinals. There is no flush handle. Rather, it has a motion sensor that sometimes triggers when you stand in front of it and sometimes doesn't. When it triggers, a tank fills, which when full is used to flush the urinal. In my many trips before this nastraption, I have ponde...
[ 0.771567165851593, -0.25367864966392517, 0.5172683596611023, 0.2697167694568634, 0.041105128824710846, 0.06081240996718407, 0.06794429570436478, -0.12456300109624863, -0.07561329752206802, -0.4097822904586792, 0.23239830136299133, 0.33358076214790344, -0.07436486333608627, 0.14005796611309...
chance to share their ideas. ``` OnUserEnter() { if (UsersDetected == 0) { FirstDetectionTime = Now(); } UsersDetected++; CurrentlyInUse = true; } OnUserExit() { CurrentlyInUse = false; if (UsersDetected >= MaxUsersBetweenFlushes || Now() - FirstDetectionTime > StinkInterval) { ...
[ 0.03409546986222267, -0.040761798620224, 0.48270028829574585, 0.04926104471087456, 0.4297674000263214, 0.0261091236025095, 0.3964432179927826, -0.09869042038917542, 0.0983065813779831, -0.8625888228416443, -0.0793142095208168, 0.575366199016571, 0.016064975410699844, 0.14856114983558655, ...
{ Flush(); } } Flush() { FlushTheUrinal(); UsersDetected = 0; } ```
[ -0.13051624596118927, -0.259633332490921, 0.45505034923553467, -0.25909921526908875, 0.35460594296455383, -0.1036830022931099, 0.06570699065923691, 0.13774371147155762, -0.08974876999855042, -0.6461754441261292, -0.13369815051555634, 0.7664281725883484, -0.1593361794948578, -0.079730056226...
I'm looking for a way to configure the color used for line numbering (as in: `:set nu`) in Vim. The default on most platforms seems to be yellow (which is also used for some highlighted tokens). I would *like* to color the line numbers a dim gray; somewhere in the vicinity of `#555`. I'm not picky though, any subdued c...
[ 0.23232638835906982, -0.25223904848098755, 0.4378878176212311, -0.30764636397361755, -0.09477194398641586, 0.12554048001766205, 0.2089640200138092, -0.005964535288512707, -0.15212807059288025, -0.9028435945510864, -0.15217919647693634, 0.29282090067863464, 0.06288827210664749, 0.1377318650...
terminal to grey. If you are using gVim, you can: ``` :highlight LineNr guifg=#050505 ```
[ -0.18956705927848816, -0.3085157871246338, 0.673527181148529, -0.3675900101661682, 0.2263934314250946, 0.14617489278316498, -0.14286832511425018, 0.644830048084259, -0.107968270778656, -1.024824857711792, -0.18555031716823578, 0.5170848965644836, -0.20951855182647705, 0.3669600486755371, ...
Steve Yegge recently posted an [interesting blog post](http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html) on what he calls the universal design pattern. In there he details using prototypes as a modelling tool, instead of classes. I like the way this introduces less coupling compared to inheritance....
[ 0.4197552502155304, 0.4083171784877777, -0.2340773046016693, -0.15300877392292023, -0.42215657234191895, 0.20654986798763275, 0.21911336481571198, 0.10982181131839752, -0.5353101491928101, -0.5204411149024963, 0.15106052160263062, 0.19027094542980194, -0.2416679412126541, 0.319447755813598...
very welcome. One interesting bit is that it's easy to make a prototype-based language act OO but it's difficult to make an OO language act prototype-based. * Alex Arnell's [inheritance.js](http://code.google.com/p/inheritance/) is a short and sweet chunk of code that makes JavaScript act OO, complete with access to ...
[ -0.03267229348421097, 0.3186032772064209, -0.47064292430877686, -0.05990863963961601, -0.2614854574203491, 0.41840898990631104, 0.19144263863563538, 0.2818065285682678, -0.15342797338962555, -0.6067184209823608, -0.00039311591535806656, -0.0716744065284729, -0.23016493022441864, -0.1110738...
makes complex inheritance behavior easy. You can implement [multiple inheritance](http://www.lua.org/pil/16.3.html), [mixin](http://en.wikipedia.org/wiki/Mixin)-like behavior, or just pick and choose what you want from one object to add to another. [Wikipedia's article](http://en.wikipedia.org/wiki/Prototype-based_pro...
[ 0.1831132024526596, -0.012473837472498417, -0.23179826140403748, 0.11473704874515533, 0.00527454586699605, -0.06610452383756638, 0.03363323584198952, -0.2670716643333435, -0.1301846206188202, -0.5879785418510437, -0.003122876863926649, 0.558934211730957, -0.5399254560470581, 0.297404468059...
is all pros and no cons. If OO is more restrictive, it's because it chooses to be. I can see where all that flexibility might get you into trouble if you aren't careful.
[ 0.28602874279022217, -0.11851070821285248, 0.18642614781856537, 0.28625187277793884, 0.48004233837127686, -0.1654825508594513, -0.18418458104133606, 0.13316866755485535, 0.07487978786230087, -0.5174711346626282, -0.06477754563093185, 0.5084195733070374, 0.036958739161491394, -0.15116618573...
I'm currently displaying a UIViewController like this: ``` [[self navigationController] presentModalViewController:modalViewController animated:YES]; ``` and hiding it like this: ``` [self.navigationController dismissModalViewControllerAnimated:YES]; ``` The animation is "slide up from the bottom"... then slide b...
[ 0.011363050900399685, -0.22983835637569427, 0.6882991194725037, 0.17610912024974823, -0.14262655377388, 0.18387433886528015, 0.3469294607639313, 0.014859512448310852, -0.13418766856193542, -1.0003113746643066, -0.19477610290050507, 0.30998414754867554, -0.27346470952033997, 0.2909358143806...
autorelease]; controller.view.alpha = 0.0; [navController presentModalViewController: controller animated: NO]; [UIView beginAnimations: nil context: nil]; controller.view.alpha = 1.0; [UIView commitAnimations]; ``` However, what you probably want is a crossfade, or at least a fade-over. When the UINavigationControll...
[ -0.10187795013189316, -0.40418481826782227, 0.7020760774612427, -0.12913838028907776, -0.14822223782539368, -0.029835566878318787, 0.6326335072517395, -0.07919816672801971, -0.3864014148712158, -1.0407874584197998, -0.15018603205680847, 0.4964410960674286, -0.4987056255340576, 0.3900874853...
You'd think it would be easy, but keep reading. I can change many of the styles associated with a resizable JQuery Dialog, but not the handles. The code below isolates the problem. Why does the handle disappear entirely? There must be some logic I'm interfering with in ui.resizable.js, but I don't see it. ``` <script ...
[ -0.3343685567378998, 0.021688399836421013, 0.6581047773361206, -0.04190617427229881, -0.0802769735455513, -0.05701908469200134, -0.006011678371578455, -0.5520016551017761, -0.3746926486492157, -0.5852421522140503, -0.19994783401489258, 0.6063548922538757, -0.06766804307699203, -0.266755610...
it to work. I couldn't find the line of code my css was in conflict with, but when I added positioning and size related css, things worked. There must be some logic that says, "use the default css unless the programmer has supplied his own". So, while I thought I was appending info, I was somehow swapping info.
[ 0.4891008138656616, -0.08264309167861938, 0.17467628419399261, 0.07013669610023499, 0.2381116896867752, -0.07601067423820496, 0.13374358415603638, 0.053213514387607574, -0.02246023155748844, -0.3904976546764374, 0.09141412377357483, 0.8950412273406982, -0.24608764052391052, -0.361142188310...
The UPSERT operation either updates or inserts a row in a table, depending if the table already has a row that matches the data: ``` if table t has a row exists that has key X: update t set mystuff... where mykey=X else insert into t mystuff... ``` Since Oracle doesn't have a specific UPSERT statement, what'...
[ -0.11703336983919144, -0.06279551982879639, 0.4064793288707733, -0.043271541595458984, 0.14356008172035217, 0.007790361065417528, -0.16944575309753418, -0.25275200605392456, 0.11849848181009293, -0.553593635559082, -0.28521430492401123, 0.8366715312004089, -0.3790014088153839, -0.079479016...
set mystuff = 123 where mykey = 'X'; end; ```
[ 0.33721157908439636, 0.07354255020618439, 0.45332130789756775, -0.2300337553024292, 0.17795351147651672, -0.13780778646469116, 0.16987287998199463, -0.2359105348587036, 0.08722138404846191, -0.4048771262168884, -0.2536005675792694, 0.5571528077125549, -0.46500781178474426, 0.19391524791717...
Photoshop has a lot of cool [artistic filters](http://alanwho.com/photoshop/photoshop-artistic-filters/), and I'd love to understand the underlying algorithms. One algorithm that's particularly interesting is the Cutout filter (number 2 at the link above). It has three tunable parameters, Number of Levels, Edge Simpl...
[ 0.2109074592590332, -0.10106530785560608, 0.3979453444480896, 0.273395836353302, -0.3231509029865265, 0.10602869093418121, -0.31180188059806824, -0.37893247604370117, -0.18376125395298004, -0.6713862419128418, 0.17752623558044434, 0.27183905243873596, -0.3270076513290405, -0.39665004611015...
any source for technical descriptions of the Photoshop filters? Alternatively, do you have any thoughts about how this particular filter might be implemented? Very old question but maybe someone searching for an answer and maybe this helps. Opencv's findcontours and approxPolyDP functions can do this. But we need to pr...
[ 0.2445489913225174, -0.2624490261077881, 0.7139182090759277, 0.18380539119243622, -0.1063607707619667, 0.10697123408317566, 0.04846462607383728, -0.5276254415512085, -0.2819996178150177, -0.7155096530914307, 0.10855600982904434, 0.5440578460693359, -0.4392859935760498, -0.31071776151657104...
its pre-calculated color. My another suggestion is eliminate very small contours while calculating contourArea. Photoshop cutout effects parameters; Number Of Levels=K-Means-find most used N colors. Edge Simplicity=I guess gaussian blur or other removing noise filters like bilateral filter or meanshift filter with edg...
[ -0.11479638516902924, -0.43206003308296204, 0.7541171312332153, 0.10998909175395966, -0.13160395622253418, -0.055858999490737915, 0.18530836701393127, -0.7134363651275635, 0.21159419417381287, -0.8784820437431335, 0.13693156838417053, 0.7580979466438293, -0.13285911083221436, -0.5503584742...
For the sake of simplicity: There is a permission based system in place with different kinds of user levels and actions (think: UNIX file system permissions) What would be the best approach to visualize this in UML? I typically have classes that represent Users, Roles, and Permissions. Users belong to Roles and Roles...
[ -0.1790890395641327, -0.0854138657450676, 0.24158336222171783, 0.24017971754074097, -0.0326075442135334, -0.07201912999153137, 0.018665356561541557, 0.09837762266397476, -0.1432473510503769, -0.527798056602478, -0.2130155861377716, 0.5684869885444641, -0.15414559841156006, 0.09684419631958...
or inclusions). Each role, then has one Permission. That permission allows or denies access to one or more other classes. Permission is by default denied, and access only allowed if the class is in the appropriate set for the action requested.
[ -0.3907215893268585, -0.36383867263793945, -0.0018548162188380957, 0.31836116313934326, 0.21988508105278015, 0.2954338788986206, 0.34558215737342834, -0.04610953852534294, -0.2302120178937912, -0.4873570501804352, -0.64989173412323, 0.3788120150566101, -0.2385951727628708, 0.07522193342447...
Is there a better way to do this? ``` string[] s = {"zero", "one", "two", "three", "four", "five"}; var x = s .Select((a,i) => new {Value = a, Index = i}) .Where(b => b.Value.StartsWith("t")) .Select(c => c.Index); ``` i.e. I'm looking for a more efficient or more elegant way to get the positions of the items matc...
[ 0.03491499274969101, -0.27922239899635315, 0.5276042819023132, 0.060210708528757095, 0.20227739214897156, 0.10158895701169968, -0.025327758863568306, -0.5319758653640747, -0.15706638991832733, -0.6490559577941895, -0.31889715790748596, 0.5268816351890564, -0.24690179526805878, 0.1320064216...
yield return index; } index++; } } ``` Then use it with: ``` string[] s = {"zero", "one", "two", "three", "four", "five"}; var x = s.IndexesWhere(t => t.StartsWith("t")); ```
[ -0.11193688958883286, -0.25343793630599976, 0.5206490755081177, -0.29680129885673523, 0.0666838213801384, 0.12187670916318893, 0.11449167877435684, -0.28937777876853943, -0.12296275794506073, -0.5837628841400146, -0.242268905043602, 0.5177600979804993, -0.22818508744239807, 0.2365188151597...
Recently I made a bunch of changes to my local svn config file. Mainly I corrected svn:mime-type properties of about 15 different file types. Now I need reset all previously checked in files according to this new configuration. SVN seems to trigger auto-prop only for ADDs and IMPORTs. So how do I do this without going ...
[ 0.46228867769241333, 0.11123581230640411, 0.40666764974594116, 0.018619239330291748, -0.30494555830955505, -0.056190937757492065, 0.7814688682556152, -0.16887184977531433, -0.546262264251709, -0.5951855182647705, 0.016122659668326378, 0.8620436787605286, -0.23352783918380737, 0.11626645177...
I have a local Git repository I've been developing under for a few days: it has eighteen commits so far. Tonight, I created a private Github repository I was hoping to push it to; however, when I did so, it only ended up pushing eight of the eighteen commits to Github. I deleted the Github repo and retried, with the sa...
[ 0.6505929231643677, 0.056305430829524994, 0.2869488596916199, 0.21212396025657654, -0.07144823670387268, -0.008316281251609325, 0.19081135094165802, 0.1936325877904892, -0.3660133183002472, -0.6370831727981567, -0.11496906727552414, 0.21371391415596008, 0.02016325667500496, 0.2906300723552...
a few of the posted answers... I took a look at the repository in question and here's what was going on: * At some point, rpj had performed `git checkout [commit id]`. This pointed HEAD at a loose commit rather than a recognized branch. I believe this is the "dangling HEAD" problem that CesarB is referring to. * Not r...
[ 0.5446341037750244, 0.012957852333784103, 0.17492873966693878, 0.20204924046993256, 0.013464751653373241, -0.12670522928237915, -0.09770055115222931, 0.04223575070500374, -0.5770690441131592, -0.3705653250217438, 0.3490493595600128, 0.24156664311885834, -0.1036425307393074, 0.2169346362352...
to the top of master, which was only about halfway through the current tree he was on. * Confusion ensued This diagram should make it more clear: ``` -- D -- E -- F / ^ A -- B -- C - |
[ -0.11283471435308456, -0.09553921967744827, 0.20184564590454102, -0.15449652075767517, -0.2900261878967285, -0.034563444554805756, 0.3930571675300598, -0.22026951611042023, -0.4825793206691742, -0.4329772889614105, -0.057996414601802826, 0.1094752699136734, -0.05706186220049858, 0.03102926...
^ ^ HEAD | | remote master ``` When he tried to push his changes, only `A` through `C` were pushed and `remote` moved up to `C`. He couldn't get commits `D` through `F` to push because they aren't referenced by a known branch. Here's what you see when you're in this state: ``` $...
[ -0.1613810807466507, -0.17787793278694153, 0.6564397215843201, -0.15689833462238312, 0.36378559470176697, -0.10397525131702423, -0.21449163556098938, 0.006386152468621731, -0.47367140650749207, -0.4668097496032715, -0.2181653082370758, 0.19516487419605255, -0.4609050452709198, 0.5242587924...
chain of commits. Here's how I did it. * Create a legitimate branch for the current state: `git checkout -b tmp` + The `tmp` branch is now pointing at commit `F` in the diagram above * Fast-forward `master` to `tmp` `git checkout master` `git merge tmp` + `master` is now pointing at commit `F`. * Throw away you...
[ 0.35114237666130066, -0.06315311789512634, 0.6305482983589172, -0.037874214351177216, 0.17757351696491241, -0.05779578164219856, 0.19326268136501312, -0.0840698629617691, -0.47566425800323486, -0.556032121181488, -0.05349414795637131, 0.40600016713142395, -0.37494751811027527, 0.5247509479...
I'm fairly new to deploying desktop applications, so this is the first time I'm building an installer for my software. Currently, the first time I run my software after installing it, it crashes. After that, it runs fine. I'm still in the process of debugging this issue, but I've noticed that a reboot immediately after...
[ 0.3420051336288452, 0.39547964930534363, 0.14450401067733765, 0.24876846373081207, 0.27925190329551697, -0.30054110288619995, 0.4188072681427002, 0.2607726454734802, -0.18379950523376465, -0.6984332799911499, -0.06714974343776703, 0.8442633152008057, -0.004413507413119078, 0.14147460460662...
you're replacing system DLLs that are locked. The installer sets up a run-once registry entry that copies the DLLs during boot before they're locked by Windows, and then your application can use the new DLL that you laid down. In general, this is highly discouraged. There should be no reason anymore for anyone other t...
[ 0.684729814529419, 0.016097843647003174, -0.00897765252739191, 0.3476153314113617, 0.28638824820518494, -0.5550600290298462, 0.3268301784992218, 0.4262252151966095, -0.4120742082595825, -0.4463154971599579, -0.34571781754493713, 0.5043361783027649, -0.25803685188293457, 0.35741928219795227...
I'm using GCC; \_\_FILE\_\_ returns the current source file's entire path and name: `/path/to/file.cpp`. Is there a way to get just the file's name `file.cpp` (without its path) at compile time? Is it possible to do this in a portable way? Can template meta programming be applied to strings? I am using this in an erro...
[ 0.48331794142723083, 0.14820949733257294, 0.33994606137275696, -0.00861956924200058, 0.2778044641017914, -0.1805930733680725, 0.07243061810731888, -0.02273102104663849, -0.18957236409187317, -0.755854606628418, -0.08851148933172226, 0.5310634970664978, -0.4884088635444641, 0.41655087471008...
For example, in your `makefile`, change the line: ``` file.o: file.c gcc -c -o file.o src/file.c ``` to: ``` file.o: src/file.c gcc "-DMYFILE=\"`basename $<`\"" -c -o file.o src/file.c ``` This will allow you to use `MYFILE` in your code instead of `__FILE__`. The use of `basename` of the source file `$<...
[ 0.15840572118759155, 0.0708598643541336, 0.5959904789924622, -0.1829456388950348, 0.2555874288082123, -0.06606674939393997, -0.15246133506298065, -0.26617470383644104, -0.09853681176900864, -0.6051381826400757, -0.26505619287490845, 0.6529944539070129, -0.23872779309749603, 0.2680507600307...
char *argv[]) { printf ("file = %s\n", MYFILE); return 0; } ``` Finally, a transcript showing it running: ``` pax:~$ mainprog file = main.c ``` Note the `file =` line which contains *only* the base name of the file, not the directory name as well.
[ -0.09466816484928131, 0.05817842110991478, 0.16307136416435242, -0.36059433221817017, 0.21200698614120483, 0.10918311029672623, 0.5359829664230347, 0.3752603530883789, 0.11578888446092606, -0.19268643856048584, -0.2800319194793701, 0.5297374129295349, -0.046164147555828094, 0.2620913982391...
Background ---------- I am working on a legacy small-business automation system (inventory, sales, procurement, etc.) that has a single database hosted by SQL Server 2005 and a bunch of client applications. The main client (used by all users) is an MS Access 2003 application (ADP), and other clients include various VB...
[ 0.21563096344470978, 0.281993567943573, 0.47686323523521423, 0.051941558718681335, 0.17144925892353058, 0.3421240746974945, -0.36834239959716797, 0.2707448899745941, -0.2572041451931, -0.41838598251342773, 0.11363491415977478, 0.39685437083244324, -0.027621576562523842, 0.06073838472366333...
mass of T-SQL code (and thus is shared by all clients). Overall, the system's code (including the T-SQL code) is not very well organized and is very refactoring-resistant, so to speak. In particular, schemata of most of the tables cry for all kinds of refactorings, small (like column renamings) and large (like normali...
[ 0.48776233196258545, 0.49699458479881287, 0.2024811953306198, -0.04329316318035126, -0.036006562411785126, -0.07283042371273041, 0.32847702503204346, 0.09752880036830902, -0.13955479860305786, -0.41015127301216125, 0.07173167169094086, 0.36375200748443604, -0.1163482815027237, 0.2059149295...
course), I've come up with the following idea: 1. For each table, create a "wrapper" view that (a) has all the columns that the table has; and (b) in some cases, has some additional computed columns based on the table's "real" columns. A typical (albeit simplistic) example of such additional computed column would be ...
[ 0.5478500127792358, -0.04160372540354729, 0.4005015790462494, 0.12617118656635284, 0.10623544454574585, 0.21162235736846924, -0.36624252796173096, -0.39822643995285034, -0.05829349905252457, -0.4618816673755646, -0.008806001394987106, 0.6903741359710693, -0.20002976059913635, 0.17881610989...
a table, they'd do that against the corresponding "table wrapper" view, not against the table directly. So, essentially this is about **isolating all the tables by views from the rest of the system**. This approach seems to provide a lot of benefits, especially from maintainability viewpoint. For example: * When a t...
[ 0.20151779055595398, 0.16175639629364014, 0.2364063560962677, 0.13983064889907837, -0.19088520109653473, -0.29715219140052795, 0.38261041045188904, 0.11630180478096008, -0.36814725399017334, -0.6417953372001648, 0.010628731921315193, 0.6113394498825073, -0.23776768147945404, 0.163978829979...
sure that I am seeing all the catches lurking out there. Did anybody try this approach in practice? What are the major pitfalls? One obvious disadvantage is the cost of maintaining "wrapper" views in sync with their corresponding tables (a new column in a table has to be added to a view too; a column deleted from a t...
[ 0.4000101089477539, 0.07447098195552826, 0.14474700391292572, 0.3206987977027893, -0.08947950601577759, -0.06532116234302521, 0.2632702887058258, 0.15698495507240295, -0.26905810832977295, -0.43137603998184204, 0.24400931596755981, 0.5394030213356018, -0.2591418921947479, 0.011132341809570...
likely to have some adverse performance impact, but is this impact going to be substantial enough to worry about it? Also, while using ADODB, it is very easy to get a recordset that is not updateable even when it is based just on a few joined tables; so, are the "wrapper" views going to make things substantially worse?...
[ 0.32810503244400024, 0.15101702511310577, 0.23741856217384338, 0.09354126453399658, -0.2854955494403839, -0.31540125608444214, 0.16832880675792694, 0.16953960061073303, -0.2239924669265747, -0.516959547996521, 0.14378999173641205, 0.6486126184463501, -0.022568317130208015, 0.27135500311851...
I do not really see any good reasons against this idea in the article. Quite the contrary, in its list of good reasons to create a view, almost each item is exactly why it is so tempting to create a "wrapper" view for each and every table (especially in a legacy system, as a part of refactoring process). The article i...
[ 0.18340125679969788, 0.35718825459480286, 0.22659063339233398, -0.047134846448898315, 0.17882494628429413, -0.3654463291168213, -0.08159709721803665, 0.40392929315567017, -0.5302096605300903, -0.4586572051048279, 0.41522735357284546, 0.31806835532188416, 0.1413775533437729, 0.4845263063907...
SQL Server and MS Access... When designing a database, I prefer the following: * no direct table access by the code (but is ok from stored procedures and views and functions) * a base view for each table that includes all columns * an extended view for each table that includes lookup columns (types, statuses, etc.) * ...
[ 0.12672364711761475, 0.27888545393943787, 0.4816040098667145, -0.20996201038360596, -0.08291035145521164, -0.2927928864955902, 0.1472812294960022, -0.12933631241321564, -0.21828141808509827, -0.3848048150539398, -0.20133797824382782, 0.4400254487991333, -0.375125527381897, 0.10272986441850...
otherwise) there may be performance penalties for doing things this way, but so far they have not been significant - and the benefits of the layer of insulation have been life-savers several times
[ 0.4899316430091858, -0.03489219769835472, 0.34752240777015686, 0.02112920954823494, 0.07947845757007599, -0.06840696930885315, 0.5202990770339966, -0.2018951028585434, -0.20042680203914642, -0.5498715043067932, -0.03127599507570267, 0.3250541388988495, 0.0024444719310849905, -0.09889210015...
std::next\_permutation (and std::prev\_permutation) permute all values in the range `[first, last)` given for a total of n! permutations (assuming that all elements are unique). is it possible to write a function like this: ``` template<class Iter> bool next_permutation(Iter first, Iter last, Iter choice_last); ``` ...
[ -0.21177059412002563, -0.4502612352371216, 0.29001206159591675, -0.07493235915899277, 0.11258610337972641, 0.19189617037773132, 0.05590806528925896, -0.5008119940757751, -0.18906979262828827, -0.6958625912666321, -0.0830019935965538, 0.33284834027290344, -0.3571773171424866, -0.06811787933...
iterator, then great! * The less amount of external memory needed the better, but for my purposes it doesn't matter. * The chosen elements on each iteration are input to the first elements of the sequence. *Is such a function possible to implement? Does anyone know of any existing implementations?* Here is essentiall...
[ -0.008969764225184917, -0.3352661728858948, 0.1478184461593628, 0.03688977286219597, 0.14833569526672363, 0.28435054421424866, 0.14008581638336182, -0.2458305060863495, -0.07578974217176437, -0.4683826267719269, 0.06258449703454971, 0.8665610551834106, -0.142277792096138, -0.02083373628556...
`{ 0, 1, 2, ... R - 1 }` to serve as an index to the elements of `V` * On each iteration, build a vector `C` of length `R` with values `{ V[I[0]], V[I[1]], ... V[I[R - 1]] }` * Do something with the values in `C`. * Apply a function to permute the elements of `I` and iterate again if it was able to. That function look...
[ -0.2802034020423889, -0.21404431760311127, 0.49226871132850647, -0.1661672592163086, 0.13324788212776184, 0.2027319073677063, 0.07276993244886398, -0.6410422921180725, -0.16644889116287231, -0.525992751121521, -0.2033979445695877, 0.45096176862716675, -0.44562092423439026, 0.07854791730642...
(I[i] < N - R + i) { ++I[i]; return true; } if (i == 0) return false; if (I[i] > I[i-1] + 1) { ++I[i-1];
[ -0.030983680859208107, 0.026797126978635788, 0.08598791807889938, -0.5610184073448181, 0.023851223289966583, 0.058523792773485184, 0.8339848518371582, -0.601073682308197, 0.25190985202789307, -0.09307078272104263, -0.5786399841308594, 0.6069109439849854, -0.24916203320026398, 0.15137468278...
for (int j = i; j < R; ++j) I[j] = I[j-1] + 1; return true; } } } ``` That function is very complicated due to all the possible off-by-one errors, as well everything using it are more complicated than is probably necessary. --- ***EDIT:*** It turns out that it was **signific...
[ 0.08767318725585938, -0.008370038121938705, 0.22833630442619324, -0.17198841273784637, 0.08465304970741272, -0.0752178207039833, 0.36624160408973694, -0.48766136169433594, -0.20492495596408844, -0.6305432915687561, -0.029577134177088737, 0.6593688726425171, -0.37874457240104675, -0.3415019...
of many of the exact algorithms I needed (combinations, permutations, etc.). ``` template<class BidirectionalIterator> bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last) { std::reverse(midd...
[ -0.3646848797798157, -0.2764764726161957, 0.4096502661705017, -0.2656432092189789, 0.0746571496129036, 0.3102845549583435, -0.046752363443374634, -0.612665057182312, -0.0300805252045393, -0.696628987789154, -0.18367792665958405, 0.4440298080444336, -0.5465707182884216, -0.10187038034200668...
implementation of that is much more complication though. To iterate over nPk permutations, I've used the `for_each_permutation()` algorithm presented in [this old CUJ article](http://www.ddj.com/cpp/184401912) before. It uses a nice algorithm from Knuth which rotates the elements in situ, leaving them in the original o...
[ 0.07019989937543869, 0.12225062400102615, 0.1084434911608696, -0.0800648182630539, -0.12080955505371094, -0.10071199387311935, 0.10719230026006699, -0.26589661836624146, -0.22873333096504211, -0.46412935853004456, 0.08712515980005264, 0.2599741518497467, -0.42940181493759155, 0.32846558094...