text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I recently learnt that oracle has a feature which was pretty useful to me - as the designer/implementator didn't care much about data history - I can query the historical state of a record if it's available yet in the oracle cache, like this: ``` select * from ( select * from sometable where some_condit...
[ 0.24156150221824646, 0.0293937586247921, -0.048722852021455765, -0.06700557470321655, 0.19740450382232666, 0.1755886822938919, -0.2471926212310791, 0.020771881565451622, -0.4317565858364105, -0.3620178997516632, 0.06716261804103851, 0.36832183599472046, 0.08119852095842361, 0.4216162562370...
SAL ---------- 5800 SQL> update emp set sal = sal+100 where empno=7369; 1 row updated. SQL> commit; Commit complete. SQL> update emp set sal = sal-100 where empno=7369; 1 row updated. SQL> commit; Commit complete. SQL> select empno, sal, versions_starttime,versions_xid 2 from emp 3 versions b...
[ -0.5731486678123474, -0.2678734064102173, 0.8137911558151245, -0.010823938064277172, -0.04361063241958618, 0.3459891378879547, -0.04030630365014076, -0.21360567212104797, -0.376282274723053, -0.5346439480781555, 0.054103970527648926, 0.40399909019470215, -0.09864465147256851, 0.04469938576...
VERSIONS_XID ---------- ---------- --------------------------------------------------------------------------- -- 7369 5900 11-DEC-08 16.05.32
[ -0.6936019659042358, -0.07793768495321274, 0.6317816376686096, 0.16031382977962494, -0.07361837476491928, 0.047820378094911575, -0.015481690876185894, 0.37833893299102783, 0.10130222886800766, -0.8462611436843872, -0.4381556510925293, 0.44696104526519775, -0.307646781206131, -0.02911733463...
0014001300002A74 7369 5800 11-DEC-08 16.03.32 000D002200012EB1 7369 5800 ``` Note that how
[ 0.05396415293216705, 0.2979050278663635, 0.40067723393440247, 0.23904462158679962, -0.10617797076702118, 0.06326781958341599, 0.3723263442516327, -0.14821219444274902, -0.3706605136394501, -0.4948812425136566, -0.09388255327939987, 0.36046209931373596, 0.07291564345359802, 0.20791682600975...
far back you can go is limited by the UNDO\_RETENTION parameter, and will typically be hours rather than days.
[ 0.16146068274974823, -0.08935894072055817, 0.5840683579444885, 0.1486334502696991, 0.6347075700759888, -0.2788325846195221, 0.08529525250196457, 0.2770763039588928, -0.13994334638118744, -0.2325824350118637, -0.12009131163358688, 0.40798723697662354, 0.32152047753334045, 0.1707326769828796...
I have a microcontroller that must download a large file from a PC serial port (115200 baud) and write it to serial flash memory over SPI (~2 MHz). The flash writes must be in 256 byte blocks preceded by a write command and page address. The total RAM available on the system is 1 kB with an 80 byte stack size. This is...
[ 0.20560359954833984, 0.45763689279556274, 0.6513705253601074, 0.009374696761369705, 0.12032674252986908, 0.07985985279083252, -0.028281068429350853, -0.14360259473323822, 0.010991829447448254, -0.8200480937957764, -0.15772120654582977, 0.6421725153923035, 0.0456378348171711, 0.040918476879...
busy writes. The buffer swapping is repeated until the operation is complete. I would prefer to setup TX/RX interrupt handlers for both the SPI and UART ports that operate on seperate circular buffers. So, instead of polling for new bytes and waiting for operations to complete I can simply fill the TX buffers and enab...
[ 0.11497178673744202, 0.02758239582180977, 0.7054141759872437, -0.010826071724295616, -0.010716558434069157, 0.07918445765972137, 0.08848678320646286, 0.02709440514445305, -0.18849535286426544, -0.6036579608917236, -0.14530964195728302, 0.7197390198707581, -0.41903480887413025, -0.013703193...
the SPI TX buffer to do the file transfer. The problem I am having with this approach is that I don't have sufficient RAM for the buffers and the PC receive buffer is filling up faster than I get the data over to the flash transmit buffer. Obviously, transmission speed is not the problem (115.2 kHz in and 2 MHz out), b...
[ -0.03478129208087921, 0.20066004991531372, 0.6815728545188904, -0.05743854120373726, -0.20557934045791626, -0.19596433639526367, 0.11290176957845688, -0.3415893316268921, -0.3240443468093872, -0.6196700930595398, -0.12904669344425201, 0.682733416557312, -0.25377029180526733, -0.11623634397...
ring buffer for the UART receive interrupt and feed the data into a 256 byte page buffer that is sent to the serial flash by polling for byte transfers and write completion. A 128 ring buffer is big enough to prevent overflows during the SPI write. I'd do something like a scatter gather on a PC. Create a linked list of...
[ 0.002214520238339901, 0.005343051627278328, 0.8391802906990051, -0.08322437107563019, -0.019482159987092018, -0.03713960200548172, -0.2153218686580658, -0.42869001626968384, -0.13332970440387726, -0.34333914518356323, -0.167201966047287, 0.6787410974502563, -0.297008752822876, -0.225879579...
in your linked list to keep the flash from catching the UART as it writes or vice versa. If the flash gets to a buffer block that isn't "ReadyToFlash" it would stall and you'd need to have your UART IRQ start it back up. If the UART gets to a block that is "ReadyToFlash" or "Flashing" it is filling too fast and you pr...
[ 0.31144869327545166, -0.3752833306789398, 0.37358567118644714, 0.2628863751888275, -0.14715851843357086, -0.3350468575954437, 0.1631900817155838, 0.08078348636627197, -0.16534239053726196, -0.6480381488800049, -0.036034584045410156, 0.6739130616188049, -0.5156816840171814, 0.01360688451677...
How do I set tab ordering in WPF? I have an ItemsControl with some items expanded and some collapsed and would like to skip the collapsed ones when I'm tabbing. Any ideas? You can skip elements in the tab sequence by setting [KeyboardNavigation.IsTabStop](http://msdn.microsoft.com/en-us/library/system.windows.input.ke...
[ -0.164526104927063, -0.14574192464351654, 0.3902994692325592, -0.12866437435150146, 0.11631548404693604, 0.03994310647249222, 0.21844272315502167, -0.01580120623111725, -0.49064135551452637, -0.6209232211112976, -0.11987301707267761, 0.5512328743934631, -0.27139073610305786, -0.12901221215...
My company uses a sales model of dealers, territory managers and regional managers, each with a different level of area scope (IE manage based on zips codes, states, or regions.) I want to create a slimmed down map that is similar to [this US state map](http://www.onlineatlas.us/map/united-states-map.gif) that would a...
[ 0.5846543908119202, 0.15203489363193512, 0.2988603711128235, -0.01127203181385994, 0.37687960267066956, -0.017211517319083214, -0.2311013787984848, 0.19680742919445038, -0.31712737679481506, -0.5851430892944336, 0.14882022142410278, 0.26513102650642395, 0.09562063962221146, 0.3422085344791...
I'm trying to determine if any changes were made to a particular entity object. Essentially, I want to know if SubmitChanges() will actually change anything. I would prefer to be able to determine this after SubmitChanges() has been called, but it doesn't really matter. Anyone know how I would do this? This is what I ...
[ 0.12937211990356445, -0.028256550431251526, 0.7421546578407288, -0.10252789407968521, 0.0507725365459919, -0.09045738726854324, 0.02290896326303482, 0.01105699222534895, -0.4016328454017639, -0.5542795658111572, -0.20685234665870667, 0.5400532484054565, -0.5265501141548157, 0.2465273588895...
My application has just started exhibiting strange behaviour. I can boot it through the Carbide Debugger (using TRK) and it works fine with no visible errors and is left installed on the device. Any further attempts to launch the application fail, even after a restart. Uninstalling and downloading the .sisx file manu...
[ 0.43206578493118286, 0.22198422253131866, 0.36774900555610657, 0.14663317799568176, 0.10914435237646103, -0.15721261501312256, 0.12306290864944458, -0.02646983042359352, 0.013487222604453564, -0.6009885668754578, -0.02019825577735901, 0.8349472880363464, -0.5499706864356995, 0.279779791831...
int[] indices = new int[a.Rank]; for (int d = a.Rank - 1; d >= 0; d--) { var l = a.GetLength(d); indices[d] = i % l; i /= l } a.SetValue(value, indices); } ``` Test Code: ``` static void Main(string[] args) { int[, ,] arr2 = { {{0,1,2}, {3,4,5}, {6,7,8}}, {...
[ -0.10339168459177017, -0.1252162903547287, 0.34023335576057434, -0.4084337055683136, 0.13436798751354218, 0.584498941898346, 0.4517337679862976, -0.4910987317562103, -0.06919077038764954, -0.18992990255355835, -0.273027241230011, 0.45060375332832336, -0.32831519842147827, 0.234446197748184...
{{18,19,20}, {21,22,23}, {24,25,26}} }; for (int i = 0; i < arr2.Length; i++) { arr2.SetValue2(30, i); } } ```
[ 0.10545089095830917, -0.1247824877500534, 0.5032135248184204, -0.4279865324497223, 0.20093417167663574, 0.2672317922115326, 0.4017513692378998, -0.6800624132156372, -0.2293110191822052, -0.36967143416404724, -0.2048262655735016, 0.6754136681556702, -0.4268423318862915, 0.18463820219039917,...
I'm using an image component that has a FromBinary method. Wondering how do I convert my input stream into a byte array ``` HttpPostedFile file = context.Request.Files[0]; byte[] buffer = new byte[file.ContentLength]; file.InputStream.Read(buffer, 0, file.ContentLength); ImageElement image = ImageElement.FromBinary(b...
[ 0.2325681447982788, -0.15184007585048676, 0.4414987862110138, -0.14763572812080383, -0.2425912767648697, 0.23596595227718353, 0.18690770864486694, -0.2998194098472595, -0.1848473995923996, -0.7890678644180298, -0.145759716629982, 0.6233277916908264, -0.3518773317337036, 0.3101899325847626,...
I have a UINavigationController containing an UIViewController initialized with a UIView. The UINavigationController also has a UINavigationBar as usual. Previously when I positioned a new element in the UIView at 0,0 using ``` CGRectMake(0,0,height,width); ``` It would position it directly beneath the UINavigatio...
[ -0.08522313833236694, -0.02426327019929886, 1.0502818822860718, -0.11300941556692123, -0.115260548889637, 0.05748692527413368, 0.15831169486045837, -0.17321278154850006, 0.11045752465724945, -0.813920259475708, 0.1372303068637848, 0.5262568593025208, 0.07425927370786667, 0.0221060290932655...
compatible with 2.1 Has anyone seen this behaviour, or know anything more about this? Thanks! There is a whole (very useful) thread on things that 2.2 broke over on the Apple dev forums. It includes this issue (though without any fix). I've seen it mentioned elsewhere as well. It's worth checking it out <https://de...
[ 0.27701535820961, -0.19165466725826263, 0.4043157696723938, 0.08793274313211441, 0.0041978079825639725, -0.4474073648452759, 0.6827201247215271, 0.034228041768074036, -0.35202279686927795, -0.21973024308681488, -0.13802114129066467, 0.7393171191215515, -0.4331211447715759, -0.1548937857151...
I used this code to upload the picture. I got this code from stackoverflow. I am still unable to upload the image. I changed the db connection settings in table settings 2. I made the table but I am not sure whether the properties of the table I created are correct. ``` <html> <head><title>Store Some Binary File to a ...
[ 0.16446344554424286, 0.0077276029624044895, 0.4366965591907501, -0.12794186174869537, -0.05157050862908363, -0.019625762477517128, 0.26353344321250916, -0.1552012860774994, 0.008873065933585167, -0.8424572348594666, -0.0369047112762928, 0.567379355430603, -0.42023515701293945, 0.4432771801...
$data = addslashes(file_get_contents($_FILES['form_data']['tmp_name']) $result = mysql_query ("INSERT INTO your_table ". "(description,bin_data,filename,filesize,filetype) ". "VALUES ('$form_description','$data','$form_data_name',". "'$form_data_size','$form_data_type')", $conn)...
[ -0.04376855120062828, 0.13152004778385162, 0.8975861072540283, -0.24609555304050446, -0.034803543239831924, 0.1164512112736702, 0.42153507471084595, -0.7000514268875122, -0.18921540677547455, -0.43168723583221436, -0.2871223986148834, 0.4046413004398346, -0.3480606973171234, 0.019494177773...
size="40"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <br>File to upload/store in database:<br> <input type="file" name="form_data" size="40"> <p><input type="submit" name="submit" value="submit"> </form> <?php } ?> </body> </html> ``` Also, help me in retrieving the image fro...
[ 0.3029557466506958, 0.04268370568752289, 0.5745006799697876, 0.04317636042833328, -0.2404557764530182, 0.13942572474479675, 0.17865121364593506, -0.18245632946491241, -0.4632391929626465, -0.6693931818008423, 0.15200351178646088, 0.625779390335083, -0.06482343375682831, -0.0500440262258052...
I've got a test class in a module that extends another test class in one of its dependency modules. How can I import the dependency's test code into the test scope of the dependent module? To illiterate, I've got two modules, "module-one" being a dependency of "module-two". `SubTestCase` is a subclass of `TestCase`. ...
[ 0.5883552432060242, 0.35904181003570557, 0.11366836726665497, -0.4369494318962097, 0.028479311615228653, -0.13271677494049072, 0.38591939210891724, -0.3662261664867401, 0.11743880063295364, -0.7578145861625671, -0.0001693498488748446, 0.5823554992675781, -0.10001560300588608, 0.17168484628...
files in addition to the regular modulename.jar file. You deploy these to repos like regular artifacts. This is not totally flawless, but works decently for code artifacts. Then you would add test scoped dependencies to the test-jars to other modules. You can also solve this by putting test scoped artifacts in "main...
[ 0.46475037932395935, 0.05883904919028282, 0.0071319942362606525, 0.42525714635849, -0.25656163692474365, -0.28011029958724976, 0.5606368780136108, -0.39737623929977417, -0.39138782024383545, -0.5214745998382568, 0.16319334506988525, 0.6744921207427979, -0.0643179640173912, 0.12489578127861...
both of these solution when we realize that the number of classes is fairly limited and there are problems associated with both of these solution. We just put them in an appropriately named package in "main" scope. I just keep forgetting why the two first solutions are a pain.
[ -0.05934413522481918, -0.40175724029541016, -0.41079798340797424, 0.15556198358535767, -0.04916692152619362, -0.0038905288092792034, 0.07087799161672592, -0.07453674077987671, -0.22979232668876648, -0.836506187915802, -0.021260764449834824, 0.6146711111068726, -0.2248479425907135, 0.226413...
EDIT: I found out that I can get it to compile if I cast the IMetadataType object to the TMetadata type. Why do I need to do this? EDIT #2: The "Values" property is a .NET dictionary of type <TMetadata, TData>. I have this generic method: ``` private void FillMetadata<TMetadata, TData> (Metadata<TMetadata, TData...
[ 0.21056602895259857, -0.02841620333492756, 0.2288103997707367, 0.10069933533668518, -0.005757361650466919, -0.18938857316970825, 0.278871089220047, -0.43334710597991943, 0.12833423912525177, -0.5665370225906372, 0.0730879083275795, 0.581017017364502, -0.4652899503707886, 0.1578096896409988...
convert from 'IMetadataType' to 'TMetadata'." Isn't that what the "where" clause on the method is for? What am I missing? First, try with boost::signal anyway. Don't assume it will not be fast enough until you try in your specific case that is your application If it's not efficient enough, maybe something like [FastD...
[ 0.1659635454416275, -0.5446134805679321, 0.36232250928878784, 0.20336145162582397, -0.1545039266347885, -0.0860232338309288, 0.10047721862792969, -0.2180912047624588, -0.23365722596645355, -0.6838283538818359, -0.08525572717189789, 0.6523032188415527, -0.24884112179279327, -0.2817325592041...
hold objects/functors that will be called each frame. Signal is more made to allow immediate "events" management than to make a loop cycle dynamic (allowing changing the functions called each frame). (I have [my own solution](https://github.com/Klaim/gamecore/blob/master/GCore/GC_TaskManager.h) (UPDATE: it's very old a...
[ 0.09246774762868881, -0.09963604062795639, 0.44939863681793213, 0.03831099718809128, -0.04771191254258156, -0.12602177262306213, 0.20525680482387543, -0.10647402703762054, -0.46301090717315674, -0.4104784429073334, 0.02202436327934265, 0.11300524324178696, -0.2557239532470703, 0.0323116704...
In my Symbian S60 application, my Options menu works as expected. But the Exit button does nothing. I am developing with Carbide and have used the UI Designer to add items to the options menu. Does anyone know how to enable the exit button, or why else it might not work? Thanks! Are you handling (in your `appui::Han...
[ -0.025377437472343445, 0.19759003818035126, 0.2962803244590759, 0.03719305247068405, 0.24715907871723175, 0.26204580068588257, 0.07246353477239609, -0.03433534502983093, 0.07678165286779404, -0.6137881875038147, -0.035122450441122055, 0.8200765252113342, -0.4314630329608917, -0.01303421147...
I am new here so first of all my greetings to you I am writing an application to run on my Windows Mobile (Pocket PC). FYI, I am using VB.NET. My idea is to use my e-mail account with my provider, who gives me a lot GB:s to use, as a virtual online storage disk. In a few words, more or less like the GMAIL-drive which...
[ 0.6633795499801636, 0.4251147210597992, 0.4519925117492676, 0.06019655242562294, -0.0555514395236969, 0.016558390110731125, 0.37999093532562256, 0.5313332676887512, -0.16982899606227875, -0.8473641276359558, 0.0008652224205434322, 0.39223513007164, 0.03685322776436806, 0.23891298472881317,...
I'm not interested in the e-mails themselfes but actually the attachments which will be my files on this virtual storgae-card. I have found a lot of free classes, mostly in C#, for downloading e-mails with attachments and most important, the MIME-parsing. Unfortunately all these classes, in one way or another, uses cla...
[ 0.2837449312210083, 0.3074532747268677, 0.04997634515166283, 0.1954921931028366, -0.13128557801246643, -0.023116495460271835, 0.40505972504615784, 0.36172792315483093, 0.05209391936659813, -0.766670823097229, -0.052102986723184586, 0.5103456974029541, -0.20967558026313782, -0.0869631245732...
thinking that once I have downloaded all bytes on my device, I would simply parse the full e-mail (verifying where the boundaries are) and get the part(s) which have been encoded in Base64 and then decode it and rename it using the name and the extension of the file which I wrote in the subject-field of the e-mail at t...
[ 0.24155829846858978, 0.12343303114175797, 0.5735411047935486, 0.14251641929149628, -0.10846544057130814, 0.07930480688810349, 0.34113380312919617, 0.10108624398708344, -0.18267354369163513, -0.3122541010379791, -0.105086550116539, 0.1621086746454239, -0.21241863071918488, 0.239303886890411...
you think - can I skip getting MIME-parsers and just use ordinary string-parsing? Kind regards, Moster67 "Versions prior to Microsoft Virtual Server 2005 supported splitting of disk images, if the disk image grew larger than the maximum supported file size on the host file system. Some file systems, such as the FAT32...
[ 0.22696144878864288, -0.4978988468647003, 0.08986642956733704, 0.2636070251464844, -0.3724844455718994, -0.15640844404697418, -0.017322981730103493, 0.19993312656879425, -0.6398680210113525, -0.11455078423023224, -0.11705739051103592, 0.7439535856246948, -0.30336374044418335, 0.03111842833...
has the footer stored at the end of the file. The first file in the split disk image has an extension of .vhd. The following split files use the .v01, .v02, … filename extension. The split files will be in the same directory as the main hard disk image. The maximum number of split files that can be present is 64.The si...
[ 0.718075692653656, -0.33521896600723267, 0.4710248112678528, -0.006208370439708233, -0.01578679122030735, 0.0726056843996048, 0.00226956931874156, -0.17615115642547607, -0.2179473340511322, -0.3857406675815582, -0.10856737196445465, 0.7003943920135498, -0.17089033126831055, 0.3324857950210...
I have an array of different type objects and I use a BinaryWriter to convert each item to its binary equivalent so I can send the structure over the network. I currently do something like ``` for ( i=0;i<tmpArrayList.Count;i++) { object x=tmpArrayList[i]; if (x.GetType() == typeof(byte)) { wrt.Write...
[ 0.280240923166275, 0.2526736259460449, 0.4129893183708191, -0.13336704671382904, -0.19331876933574677, -0.006327155511826277, 0.6455544233322144, -0.607319176197052, -0.13554154336452484, -0.6216441988945007, 0.13207970559597015, 0.5086401104927063, -0.3589591681957245, 0.4608096182346344,...
I came up with for the function. For testing this function sends the array to syslog. ``` private void TxMsg(ArrayList TxArray,IPAddress ipaddress) { Byte[] txbuf=new Byte[0]; int sz=0; // caculate size of txbuf foreach (Object o in TxArray) { if ( o is String ) { ...
[ 0.1755920648574829, -0.07595078647136688, 0.835270881652832, -0.43879470229148865, 0.008398951031267643, 0.42352208495140076, 0.11514697223901749, -0.34045106172561646, -0.29886913299560547, -0.6086524724960327, -0.1117040291428566, 0.4684542715549469, -0.3641468584537506, 0.16676907241344...
} else if ( o is Byte[] ) { sz+=((Byte[])(o)).Length; } else if ( o is Char[] ) { sz+=((Char[])(o)).Length; } else // take care of non arrays
[ -0.05397426709532738, -0.36325645446777344, 0.34962198138237, -0.1256282925605774, -0.1398574560880661, 0.10639174282550812, 0.21745461225509644, -0.40164321660995483, -0.5160419344902039, -0.20151861011981964, -0.4556278586387634, 0.6238817572593689, -0.23516525328159332, -0.0735893398523...
{ sz+=Marshal.SizeOf(o); } } txbuf = new Byte[sz]; System.IO.MemoryStream stm_w = new System.IO.MemoryStream( txbuf, 0,txbuf.Length); System.IO.BinaryWriter wrt = new System.IO.BinaryWriter( stm_w ); foreach (Object o in TxArray) { bool otypefound=false; ...
[ 0.11560679227113724, -0.08416535705327988, 0.5380347967147827, -0.20457684993743896, 0.17690546810626984, 0.5283799767494202, 0.35929250717163086, -0.35046252608299255, -0.2915616035461426, -0.3921659588813782, -0.2038356214761734, 0.5931712985038757, -0.35316282510757446, 0.19869421422481...
byte per char { otypefound=true; String st=(String)o; for(int i=0;i<st.Length;i++) { wrt.Write((byte)st[i]); } } else
[ 0.18480971455574036, -0.012962747365236282, 0.22673358023166656, -0.365812748670578, 0.009171940386295319, 0.6100304126739502, 0.45412808656692505, -0.4518217146396637, -0.04522329568862915, -0.14189299941062927, 0.03228689357638359, 0.5451288819313049, -0.15115299820899963, 0.124314703047...
{ foreach (MethodInfo mi in typeof(BinaryWriter).GetMethods()) { if (mi.Name == "Write") { ParameterInfo[] pi = mi.GetParameters(); if
[ -0.311949223279953, -0.08940640836954117, 0.39939260482788086, -0.037940237671136856, 0.577602207660675, 0.40325337648391724, 0.6142253875732422, -0.4756438136100769, 0.18065303564071655, -0.4670833349227905, -0.21227715909481049, 0.36611151695251465, -0.23312480747699738, 0.09776798635721...
((pi.Length == 1)&&(pi[0].ParameterType==o.GetType())) { otypefound=true; mi.Invoke(wrt, new Object[] { o }); } }
[ -0.04068022221326828, -0.10519057512283325, 0.42658737301826477, -0.20513713359832764, 0.5712095499038696, 0.4427551031112671, 0.6120033264160156, -0.551146924495697, 0.16226708889007568, -0.44201114773750305, -0.22203144431114197, 0.6965512633323669, -0.13555008172988892, 0.27085798978805...
} } if(otypefound==false) { throw new InvalidOperationException("Cannot write data of type " + o.GetType().FullName); } } IPEndPoint endpoint = new IPEndPoint(ipaddress, 514); //syslog port UdpClient udpClient_txmsg = new UdpClient(); udpClient_txmsg.Send(t...
[ -0.2671245336532593, -0.1519305557012558, 0.8191289901733398, -0.14773774147033691, 0.09236142784357071, 0.19500283896923065, 0.284742534160614, -0.23017334938049316, -0.3074914216995239, -0.7078328728675842, -0.37683600187301636, 0.3944879174232483, -0.42783811688423157, 0.297305643558502...
} ``` Here is a solution for BinaryWriter that uses reflection. This basically scans BinaryWriter for methods named Write that takes exactly one parameter, then builds a dictionary of which method handles which type, then for each object to write, finds the right method and calls it on the writer. Dirty, and you sho...
[ 0.19831755757331848, 0.1966162919998169, 0.12138988822698593, 0.0044744317419826984, 0.04246581345796585, 0.10908930748701096, 0.24153493344783783, -0.30740147829055786, 0.025909284129738808, -0.6232916712760925, 0.22173020243644714, 0.745735228061676, -0.3788180947303772, 0.18304657936096...
public static void Main() { Dictionary<Type, MethodInfo> mapping = new Dictionary<Type, MethodInfo>(); foreach (MethodInfo mi in typeof(BinaryWriter).GetMethods()) { if (mi.Name == "Write") {
[ -0.12326401472091675, -0.0679263100028038, 0.17938971519470215, -0.16470426321029663, 0.6441555619239807, 0.21897895634174347, 0.5609896183013916, 0.08863259106874466, 0.2475007176399231, -0.4066218137741089, -0.38173580169677734, 0.46940848231315613, -0.3633926808834076, 0.358757942914962...
ParameterInfo[] pi = mi.GetParameters(); if (pi.Length == 1) mapping[pi[0].ParameterType] = mi; } }
[ -0.2904716730117798, -0.601895809173584, 0.5782241821289062, 0.16310882568359375, 0.12552084028720856, 0.3623605966567993, 0.3699730336666107, -0.48912402987480164, -0.07689222693443298, -0.5846871137619019, 0.008258651942014694, 0.5421215295791626, -0.1669725924730301, 0.10025995969772339...
List<Object> someData = new List<Object>(); someData.Add((Byte)10); someData.Add((Int32)10); someData.Add((Double)10); someData.Add((Char)10); someData.Add("Test"); using (FileStream file = new FileStream(@"C:\test.dat", FileMode.Create, FileAcces...
[ 0.4760296642780304, -0.2564796507358551, 0.10036331415176392, -0.0949375107884407, 0.0986969918012619, 0.11271711438894272, 0.17276421189308167, -0.24615570902824402, -0.26254013180732727, -0.4592666029930115, -0.34354913234710693, 0.43004488945007324, -0.39597252011299133, 0.0234195273369...
using (BinaryWriter writer = new BinaryWriter(file)) { foreach (Object o in someData) { MethodInfo mi; if
[ -0.07096599787473679, -0.13419388234615326, 0.21336716413497925, -0.24501703679561615, 0.6927509903907776, 0.21432533860206604, 0.3572919964790344, -0.14260776340961456, 0.13637611269950867, -0.3147329092025757, -0.1037745401263237, 0.5590050220489502, -0.1952332705259323, 0.21547791361808...
(mapping.TryGetValue(o.GetType(), out mi)) { mi.Invoke(writer, new Object[] { o }); } else
[ -0.5220600366592407, -0.12404418736696243, 0.2178535759449005, -0.24579322338104248, 0.618707001209259, 0.2509782910346985, 0.6011658310890198, -0.01456954050809145, 0.23342332243919373, -0.7218007445335388, -0.41992485523223877, 0.26818835735321045, -0.10722040385007858, 0.271880805492401...
throw new InvalidOperationException("Cannot write data of type " + o.GetType().FullName); } } } } } ```
[ 0.020658209919929504, 0.19309714436531067, 0.2192648947238922, -0.21917888522148132, 0.08095160871744156, -0.07438410818576813, 0.5776845216751099, -0.21571236848831177, 0.07908347249031067, -0.5940071940422058, -0.42253589630126953, 0.4331340491771698, -0.3191201090812683, 0.4375444948673...
I've been trying to find a good video that I can show at a "Lunch and Learn" on Agile Development / Scrum. Our organization is primarily Waterfall and most people have never even heard of Agile development let alone have any concrete knowledge of the topic. There are plenty of great resources out there that talk about ...
[ 0.673719584941864, -0.01959364488720894, -0.19299261271953583, 0.42681649327278137, -0.054256558418273926, -0.4090122878551483, 0.23516695201396942, 0.5452735424041748, -0.2662501335144043, -0.4078805446624756, 0.19721604883670807, 0.4887857139110565, 0.46344757080078125, -0.09349037706851...
**Autumn of Agile** video-cast series is exactly what you're looking for. It's produced by Steve, who blogs at [http://unhandled-exceptions.com](http://unhandled-exceptions.com/). **<http://www.autumnofagile.net/>** The quality and depth of the presentation is very good. You will be impressed.
[ 0.262952595949173, -0.19149474799633026, -0.03205205872654915, 0.14174048602581024, -0.1555493026971817, 0.11935047060251236, 0.20881448686122894, 0.26449260115623474, -0.055997807532548904, -0.4986250698566437, -0.3847033977508545, 0.25046053528785706, 0.4073338210582733, -0.3549749553203...
I have an interface that defines some methods I would like certain classes to implement. ``` public interface IMyInterface { MethodA; MethodB; } ``` Additionally I would like all classes implementing this interface to be serializable. If I change the interface definition to implement ISerializable as below....
[ -0.012316289357841015, 0.218206524848938, 0.3132725656032562, -0.05697587877511978, -0.15688620507717133, -0.10845949500799179, 0.15122291445732117, -0.10145717859268188, 0.04421517252922058, -0.8466029763221741, -0.0624212883412838, 0.55012446641922, -0.6999055743217468, 0.376279026269912...
them to custom implement serialization? Thanks, Will Thanks for the replies. It would be nice to be able to force classes derived from an interface to implement serialization without this then forcing them to custom serialize but it doesn't seem to be possible.
[ 0.37335726618766785, -0.23150894045829773, 0.050199322402477264, 0.7682842016220093, -0.3300842344760895, 0.08664930611848831, 0.06446459144353867, 0.28963273763656616, -0.4056050777435303, -0.6808812022209167, 0.2309424728155136, 0.6188454031944275, 0.046772513538599014, 0.261682063341140...
I have a visual studio 2005 solution which has a web application and a class library project. The web application has a reference to the library project. I'd like the library project's code documentation XML to output to the web application's bin folder, along with the library's DLL. I can't seem to find any easy way o...
[ 0.18528512120246887, 0.12504687905311584, 0.03105846606194973, 0.10718879848718643, -0.21397772431373596, -0.022876707836985588, 0.028284287080168724, -0.09650832414627075, -0.08002391457557678, -0.5584560036659241, 0.17597471177577972, 0.5134377479553223, -0.11192605644464493, 0.062946870...
So for viewing a current object's state at runtime, I really like what the Visual Studio Immediate window gives me. Just doing a simple ``` ? objectname ``` Will give me a nicely formatted 'dump' of the object. **Is there an easy way to do this in code, so I can do something similar when logging?** You could base ...
[ 0.3371025025844574, -0.008711554110050201, 0.20064520835876465, 0.08762194961309433, -0.1461217999458313, -0.1797690987586975, 0.1014878898859024, 0.051528558135032654, -0.4866485595703125, -0.6234821677207947, -0.05708667263388634, 0.4171111285686493, -0.04485569894313812, 0.0620828643441...
Has anyone attempted this? Is it possible, and if so, what kind of problems will I run into if I try to accomplish it? Sure, you can easily subclass controllers in Cake.. and then you'd typically utilize their hook function such as 'beforeFilter', 'afterFilter', etc. to add runtime logic to your controllers.. I typical...
[ 0.03031025268137455, -0.21975617110729218, 0.12892720103263855, 0.2318824827671051, -0.15060913562774658, -0.09845931828022003, 0.20754222571849823, -0.18614916503429413, -0.20375362038612366, -0.6430442929267883, 0.08328349143266678, -0.007096524816006422, 0.08503996580839157, -0.13203467...
As the question states, i am a C#/Java programmer who is interested in (re)learning C++. As you know C#/Java have a somewhat strict project file structure (especially Java). I find this structure to be very helpful and was wondering if it is a) good practice to do a similar structure in a C++, b) if so, what is the bes...
[ 0.5775531530380249, 0.4283657371997833, -0.07916443049907684, -0.20165635645389557, -0.15689702332019806, -0.32289692759513855, 0.020501354709267616, -0.09416690468788147, -0.22820736467838287, -0.48971763253211975, -0.07494711130857468, 0.5449289083480835, -0.21844622492790222, -0.0539770...
{ namespace bar { // declare/define the stuff (classes, functions) here } } // foo::bar ``` in code. I keep the source in *root/src/foo/bar/baz.cpp* . If i have some stuff that is not exposed to the outside, i put it into a *detail/* directory and namespace. I keep the makefiles at *root/*.
[ 0.7237734794616699, 0.3592427670955658, 0.3527732193470001, -0.3689556419849396, 0.5227358341217041, 0.09168757498264313, 0.380709171295166, -0.18006068468093872, -0.013483259826898575, -0.6314866542816162, -0.31233227252960205, 0.31078040599823, -0.1244710311293602, 0.24000480771064758, ...
This relates to Composite Application Guidance for WPF, or Prism. I have one "MainRegion" in my shell. My various modules will be loaded into this main region. I can populate a list of available modules in a menu and select them to load. On the click of the menu I do: ``` var module = moduleEnumerator.GetModule(modul...
[ 0.03298189491033554, -0.32463783025741577, 0.7459677457809448, -0.36833223700523376, 0.23354007303714752, -0.12921932339668274, 0.22956880927085876, -0.23589001595973969, -0.2792547047138214, -0.6852863430976868, -0.31746482849121094, 0.6390424966812134, -0.35243138670921326, -0.1363422572...
method has been executed? Thank you for your help! You don't actually activate the module. You activate a view in a region. Take a read of this [article](http://compositewpf.codeplex.com/Thread/View.aspx?ThreadId=42862). The Initialize method is only called the once for any module. The fact that you are seeing a view...
[ 0.3063173294067383, -0.4597206115722656, 0.5605047345161438, -0.14379018545150757, 0.0003333243075758219, -0.16871167719364166, 0.3298669457435608, -0.44415611028671265, -0.5559845566749573, -0.5961343050003052, 0.07717287540435791, 0.46339988708496094, -0.287145733833313, 0.12992075085639...
the Activate method of the region (assuming an injected IUnityContainer and IRegionManager)... ``` // Get a view from the container. var view = Container.Resolve<MyView>(); // Get the region. var region = RegionManager.Regions["MyRegion"]; // Activate the view. region.Activate(view); ``` Depending on the type of r...
[ -0.3574296832084656, -0.5485899448394775, 0.8566380739212036, -0.08722258359193802, 0.05914803966879845, -0.07163306325674057, -0.04567178338766098, -0.10428151488304138, -0.14978252351284027, -0.9285404086112976, -0.42135506868362427, 0.4468827247619629, -0.1444300413131714, 0.31849151849...
We are scheduling a task programatically. However, the executable to be scheduled could be installed in a path that has spaces. ie c:\program Files\folder\folder\folder program\program.exe When we provide this path as a parameter to the Tasjk Scheduler it fails to start because it cannot find the executable. It obviou...
[ 0.30288663506507874, -0.022586781531572342, 0.14980798959732056, 0.1508897840976715, 0.3003779947757721, -0.0754435807466507, 0.013886677101254463, -0.0906965509057045, -0.31265029311180115, -0.8326454162597656, -0.09028209745883942, 0.5025379061698914, -0.3276064693927765, -0.176828950643...
have any idea how to force the quotes to be included in the path? **EDIT: Answer to comment:** We had the same idea, and here is the problem. the ~1 format is based on the index of the folder, so if say you had these 3 folders: ``` Program Applications Program Files Program Zips ``` then the path would be: progra~...
[ 0.3301863968372345, -0.04468917101621628, 0.4074113965034485, 0.16047048568725586, -0.03761106729507446, 0.182566300034523, 0.2683311104774475, -0.25533780455589294, -0.2584983706474304, -0.5466299653053284, 0.07406610250473022, 0.8821248412132263, -0.3493809700012207, -0.3006756007671356,...
a little cumbersome and not very clean IMO. We are hoping there is a better way. **EDIT 2: Added applicable code snippet** You asked for the code: this is how we build the Args string that we pass to the scheduler: ``` string args = "/CREATE /RU SYSTEM /SC " + taskSchedule + " /MO " + taskModifier + " /SD " + taskS...
[ 0.09195363521575928, -0.057452745735645294, 0.4834246337413788, 0.037582430988550186, 0.1604112684726715, -0.1663314253091812, 0.323172390460968, -0.21653778851032257, -0.40986722707748413, -0.7952094078063965, -0.1979674994945526, 0.5685620307922363, -0.2945592403411865, -0.05428780242800...
than to find an answer! More details please! :) I found an answer with [a quick google search](http://tinyurl.com/6z6m8j) Try this code: ``` string args = "/CREATE /RU SYSTEM /SC " + taskSchedule + " /MO " + taskModifier + " /SD " + taskStartDate + " /ST " + taskStartTime + " /TN " + taskName + " /TR \"\\\"" + taskSo...
[ -0.02323310077190399, -0.30010369420051575, 0.6382236480712891, 0.0946132093667984, 0.3244357407093048, -0.1036224290728569, 0.24106936156749725, -0.21757885813713074, -0.2045087367296219, -0.5721469521522522, -0.026665443554520607, 0.5566491484642029, -0.21451744437217712, 0.2854222357273...
Is there a way to define styles for a combination of classes? For example, I'd like my HTML to look like this, but the output to render in the appropriate color: ``` <span class="red">Red Text</span><br/> <span class="green">Green Text</span><br/> <span class="red green">Yellow Text</span><br/> ``` **Edit:** The abo...
[ 0.11221973598003387, -0.3454190790653229, 0.4792860448360443, -0.10209939628839493, -0.42842236161231995, 0.3032393753528595, 0.10920882970094681, -0.21509431302547455, -0.4593466818332672, -0.6691544055938721, -0.08425652980804443, 0.425650954246521, -0.44600868225097656, -0.5496007204055...
class="action style2">Do Action 2</li> <li class="action style1 highlight">Do Action 1</li> <li class="action style2 highlight">Do Action 2</li> </ul> <script language="javascript" type="text/javascript"> $("li.action").bind("click", function(e) { e.preventDefault(); // Do some stuff $(this).add...
[ 0.10445261001586914, -0.373420774936676, 0.31603720784187317, -0.2790239453315735, -0.28337717056274414, -0.06518170237541199, 0.40865781903266907, -0.5387362837791443, -0.29062187671661377, -0.4899883568286896, -0.09022456407546997, 0.49005505442619324, -0.591999351978302, -0.272359967231...
or 7 - the highlighted text for both .style1 and .style2 elements end up being blue. You can select on multiple classes: ``` span.red.green { color: yellow; } ``` That will apply to any span element with red and green classes. Which may not be what you want, since it will also apply to, say: ``` <span class="red gr...
[ 0.3181420564651489, -0.07747650891542435, 0.4923904836177826, -0.3222750425338745, -0.05969519540667534, -0.05585775524377823, 0.29666468501091003, 0.14218375086784363, -0.14926496148109436, -0.5698250532150269, -0.38525182008743286, 0.8559618592262268, -0.24887163937091827, -0.08132420480...
I'm trying to use reflection to get a property from a class. Here is some sample code of what I'm seeing: ``` using System.Reflection; namespace ConsoleApplication { class Program { static void Main(string[] args) { PropertyInfo[] tmp2 = typeof(TestClass).GetProperties(); ...
[ 0.4730790853500366, -0.08005431294441223, 0.31850871443748474, -0.12749046087265015, -0.045988988131284714, 0.045451320707798004, 0.4501523971557617, -0.5064875483512878, 0.04069940373301506, -0.5164706707000732, -0.18134161829948425, 0.558107852935791, -0.21581099927425385, 0.350771188735...
} } public class TestClass { public Int32 TestProp { get; set; } } } ``` When I trace through this, this is what I see: * When I fetch all properties using `GetProperties()`, the resulting array has one entry, for property `TestProp`. *
[ 0.11468628793954849, 0.05196094885468483, 0.025535842403769493, -0.15481165051460266, 0.1322896033525467, -0.007197291124612093, 0.2088823765516281, -0.44146019220352173, 0.035582393407821655, -0.674464762210846, -0.12652628123760223, 0.46690312027931213, -0.2143591195344925, 0.16653932631...
When I try to fetch `TestProp` using `GetProperty()`, I get null back. I'm a little stumped; I haven't been able to find anything in the MSDN regarding `GetProperty()` to explain this result to me. Any help? EDIT: If I add `BindingFlags.Instance` to the `GetProperties()` call, no properties are found, period. This i...
[ 0.03562892973423004, 0.1754736453294754, 0.03092956356704235, -0.0119357630610466, -0.13593578338623047, -0.23811191320419312, 0.51444411277771, 0.09308447688817978, -0.3316930830478668, -0.5099354386329651, -0.2981729209423065, 0.5772120952606201, -0.37472832202911377, 0.3475073277950287,...
returns the property. Note: It's a good idea to actually make your property do something before you try to retrieve it (VS2005) :) ``` using System.Reflection; namespace ConsoleApplication { class Program { static void Main(string[] args) { PropertyInfo[] tmp2 = typeof(TestClass).G...
[ 0.19140948355197906, -0.17426623404026031, 0.32636186480522156, -0.03552928939461708, 0.2543509900569916, -0.06839977204799652, 0.3617340624332428, -0.5203186273574829, -0.12619665265083313, -0.41754770278930664, -0.3694706857204437, 0.6988710761070251, -0.06475935876369476, 0.317609399557...
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); Console.WriteLine(test.Name); } } public class TestClass { public Int32 TestProp {
[ 0.09166296571493149, 0.03043532744050026, 0.1325487345457077, -0.18586088716983795, 0.0513431653380394, -0.09727609157562256, 0.6230757832527161, -0.4374436140060425, 0.29011839628219604, -0.6286936402320862, -0.18641678988933563, 0.33480048179626465, -0.5337849259376526, 0.166974604129791...
get { return 0; } set { } } } } ```
[ -0.3990420401096344, 0.1029265969991684, 0.05953523889183998, -0.07544437795877457, 0.22112160921096802, -0.2389136254787445, 0.2660975456237793, -0.22216442227363586, 0.27097707986831665, -0.4482388496398926, -0.5292549729347229, 0.6841438412666321, -0.39814552664756775, 0.063759125769138...
Back in college, only the use of pseudo code was evangelized more than OOP in my curriculum. Just like commenting (and other preached 'best practices'), I found that in crunch time psuedocode was often neglected. So my question is...who actually uses it a lot of the time? Or do you only use it when an algorithm is real...
[ 0.8306508660316467, 0.3133186399936676, -0.1411539912223816, 0.17985019087791443, -0.0882253646850586, -0.12849433720111847, 0.5367894172668457, 0.45083296298980713, -0.08593586087226868, -0.36622896790504456, 0.13287512958049774, 0.4752940237522125, -0.051729124039411545, -0.5893298983573...
all the time. Any time I have to explain a design decision, I'll use it. Talking to non-technical staff, I'll use it. It has application not only for programming, but for explaining how anything is done. Working with a team on multiple platforms (Java front-end with a COBOL backend, in this case) it's much easier to e...
[ 0.6950106024742126, 0.17730766534805298, -0.05258263275027275, 0.10985801368951797, -0.07719562947750092, -0.011251278221607208, 0.20494094491004944, -0.03368314355611801, -0.30316877365112305, -0.5967101454734802, -0.044798098504543304, 0.39348188042640686, -0.13823369145393372, -0.186281...
try to implement them and realize I couldn't even generate pseudocode. Turned out, the designer had never tried thinking about a theoretical implementation. Had he tried to write up some pseudocode representing his solution, I never would have had to waste 2 weeks trying to figure out why I couldn't get it to work.
[ 0.2883342504501343, 0.19027428328990936, -0.2767084538936615, 0.29507938027381897, -0.0996290072798729, 0.1431404948234558, 0.5137228965759277, -0.03790786862373352, -0.21484605967998505, -0.4286676347255707, 0.12888160347938538, 0.30558234453201294, -0.5060437321662903, 0.1286411583423614...
I'm beginning to plan a complete redesign of our departments intranet pages. As it stands, every department gets their own folder within root. They all share the same look and feel but don't use CSS everything in each file is straight up static text. Basically, if a change has to be made to the header, *every* file mus...
[ 0.563052237033844, -0.04170713573694229, 0.3162500858306885, 0.22733059525489807, -0.03869111090898514, -0.09643114358186722, 0.20776647329330444, 0.378158837556839, -0.5585424304008484, -0.7849862575531006, -0.22214150428771973, -0.020305432379245758, -0.08018319308757782, 0.2614644467830...
was to create a new C# Web Project to utilize the C# Master Pages. Within that project, each page would use the master page. Since I know they like to make many minor cosmetic changes, master pages would make things much simpler and quite frankly, I don't have time to manually edit a header 564 (random) times. The othe...
[ 0.4872097671031952, 0.17556338012218475, -0.07472020387649536, 0.2830134332180023, -0.07801859080791473, -0.09071777760982513, 0.015461886301636696, 0.020940260961651802, -0.4093000888824463, -0.16857782006263733, 0.19095951318740845, 0.4094814658164978, -0.11605053395032883, 0.01813114807...
fixed it. Also, would it be worth upgrading IIS and .NET to their latest version? If you are already working in .NET 2.0, then you shouldn't need to do any upgrades, and there won't be any additional infrastructure cost. I would highly recommend using Master pages, as they do make it painless to have a common look an...
[ 0.4805819094181061, -0.13619254529476166, 0.2023358792066574, 0.30477046966552734, 0.024876326322555542, -0.13375994563102722, 0.010878117755055428, 0.135120689868927, -0.5112525224685669, -0.6819044351577759, -0.004131772555410862, 0.5029630064964294, -0.23711949586868286, -0.064335562288...
I'm wanting to use jQuery to wrap a mailto: anchor around an email address, but it's also grabbing the whitepace that the CMS is generating. Here's the HTML I have to work with, the script as I have it and a copy of the output. HTML ``` <div class="field field-type-text field-field-email"> <div class="field-item">...
[ 0.22303234040737152, 0.112575463950634, 0.7113084197044373, -0.2254824936389923, 0.049269214272499084, 0.10325642675161362, -0.15785495936870575, -0.5505616068840027, -0.1245257630944252, -0.666283369064331, -0.32093632221221924, 0.3944646716117859, -0.14147040247917175, -0.117830082774162...
I suspect that others reading this question might want to just strip the leading and tailing whitespace, I'm quite happy to lose all the whitespace considering it's an email address I'm wrapping. Use the `replace` function in js: ``` var emailAdd = $(this).text().replace(/ /g,''); ``` That will remove all the spaces...
[ 0.0867125615477562, 0.24270334839820862, 0.5023537278175354, -0.2978766858577728, 0.1994030922651291, -0.008593468926846981, 0.1334248036146164, -0.13304054737091064, 0.007547413464635611, -0.4603419899940491, -0.43208277225494385, 0.7562277317047119, -0.5019243955612183, -0.10752876102924...
I wonder if there is a less verbose way to do Input Verification in my methods. For example, i commonly write stuff like this: ``` public string SomeFunction(string param1, int param2) { if(string.IsNullOrEmpty(param1)){ throw new ArgumentException("bla", "param1"); } if(param2 < 0 || param2 > 100 ...
[ 0.18240058422088623, 0.13133811950683594, 0.2311088889837265, 0.0065123094245791435, -0.03557005524635315, 0.17087222635746002, 0.3611513376235962, -0.4159037470817566, -0.35911157727241516, -0.3341507315635681, -0.09583889693021774, 0.35478851199150085, -0.2364741861820221, 0.041596289724...
already handle that for me? I believe that this is called "Contract" and I remember seeing that Spec# is supposed to do that, but that seems to be an experimental research project at the moment. So I wonder: Is there anything that can give a clean enforcing of Constraints (at least the simple and often recurring ones ...
[ 0.7193769216537476, -0.14340536296367645, 0.10323458909988403, 0.055051278322935104, -0.0013850332470610738, -0.11664216965436935, -0.12578846514225006, -0.4385482668876648, -0.3747613728046417, -0.37944990396499634, 0.10036365687847137, 0.794258713722229, -0.23833833634853363, -0.15392300...
My company has been evaluating Spring MVC to determine if we should use it in one of our next projects. So far I love what I've seen, and right now I'm taking a look at the Spring Security module to determine if it's something we can/should use. Our security requirements are pretty basic; a user just needs to be able...
[ 0.4523560106754303, 0.10486936569213867, 0.074700728058815, -0.005328191444277763, 0.21406053006649017, -0.13383015990257263, -0.030760735273361206, 0.1854044646024704, -0.33765658736228943, -0.11031173914670944, 0.0031653756741434336, 0.2899799048900604, 0.3357321321964264, -0.13028752803...
user should be given access. In the prototype I've been creating, I have been storing a "LoginCredentials" object (which just contains username and password) in Session for an authenticated user; some of the controllers check to see if this object is in session to get a reference to the logged-in username, for example...
[ 0.2173827439546585, -0.00292592728510499, 0.280861496925354, 0.25419166684150696, 0.12133292108774185, -0.2962196171283722, 0.03987488895654678, 0.0006260386435315013, -0.39660051465034485, -0.5143576860427856, -0.20768465101718903, 0.4569876194000244, -0.04166875779628754, 0.0847029387950...
object to be able to access the username/principal info from anywhere in your app... ``` Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); ``` ... which seems very un-Spring like as this object is a (global) singleton, in a way. My question is this: if this is the standard wa...
[ -0.10070846974849701, -0.08596491068601608, 0.2638185918331146, 0.18074335157871246, 0.19518700242042542, -0.18218527734279633, 0.3314807116985321, -0.21330535411834717, -0.10988646745681763, -0.42901256680488586, -0.42744043469429016, 0.5781388282775879, -0.08714239299297333, 0.2263607531...
... SecurityContextHolder.getContext().setAuthentication( new UsernamePasswordAuthenticationToken(testUser.getLogin(), testUser.getPassword())); ... } ``` This seems overly verbose. Is there an easier way? The `SecurityContextHolder` object itself seems very un-Spring-like... The problem is that Spr...
[ 0.004129298496991396, -0.01701093465089798, 0.1298755556344986, 0.0950174480676651, -0.07350318133831024, -0.2277761846780777, 0.2541503608226776, -0.24018821120262146, 0.0014837628696113825, -0.16338177025318146, -0.12816618382930756, 0.4102439880371094, -0.2949053645133972, 0.05791821703...
into other services that needed knowledge of the current Principal. If you are implementing your own authentication service, you could basically do the same thing: create a session-scoped bean with a "principal" property, inject this into your authentication service, have the auth service set the property on successfu...
[ 0.29489943385124207, -0.10696536302566528, 0.10391755402088165, 0.19433952867984772, -0.03635730594396591, -0.30965426564216614, 0.43987274169921875, -0.09789407253265381, -0.12169839441776276, -0.30925360321998596, 0.024220343679189682, 0.46564018726348877, -0.16737954318523407, 0.1721764...
Servlet container, thread-scoped in a JUnit test, etc. The real limiting factor of a Singleton is when it provides an implementation that is inflexible to different environments.
[ -0.10529138147830963, -0.19382306933403015, -0.14166535437107086, 0.263058602809906, 0.08209530264139175, -0.15039020776748657, 0.08468598872423172, -0.1877143532037735, -0.17272509634494781, -0.7960909008979797, -0.3191531300544739, 0.35673561692237854, -0.28977280855178833, 0.32605862617...
I would like to know how to change the colour of the equality sign and double quotes for html documents in the eclipse PDT IDE. I can change most colours in Preferences -> Web & XML -> HTML Files -> syntax coloring, but can't change the characters `=` or `"` e.g. in an anchor tag `<a href="">`. How to change these col...
[ 0.3995659351348877, -0.06619662791490555, 0.2746064066886902, -0.18231604993343353, -0.1720108538866043, 0.10014455020427704, 0.08904247730970383, -0.31555160880088806, -0.11320663243532181, -0.6148135662078857, 0.12265469133853912, 0.44890978932380676, -0.22591489553451538, -0.38742065429...
we would create a session-scoped bean in the container to store the Principal, inject this into an "AuthenticationService" (singleton) and then inject this bean into other services that needed knowledge of the current Principal. If you are implementing your own authentication service, you could basically do the same t...
[ 0.27371448278427124, -0.12000296264886856, 0.04803888127207756, 0.3348119258880615, 0.0006075898418202996, -0.1253465712070465, 0.20920051634311676, -0.09763406962156296, 0.09202300012111664, -0.3267860412597656, 0.1663529872894287, 0.4952697455883026, -0.2228788584470749, 0.28530633449554...
/ Singleton and that Spring discourages using such things but their implementation takes care to behave appropriately depending on the environment: session-scoped in a Servlet container, thread-scoped in a JUnit test, etc. The real limiting factor of a Singleton is when it provides an implementation that is inflexible ...
[ 0.21869102120399475, -0.2158799022436142, -0.3408268988132477, 0.24582788348197937, -0.01098234299570322, -0.3102141320705414, 0.24209189414978027, -0.1043815165758133, -0.15992969274520874, -0.5234230160713196, -0.13945506513118744, 0.39972689747810364, -0.16203302145004272, 0.11094459891...
I am a part time developer (full time student) and the company I am working for uses SQL Server 2005. The thing I find strange about SQL Server that if you do a script that involves inserting, updating etc there isn't any real way to undo it except for a rollback or using transactions. You might say what's wrong with ...
[ 0.38690856099128723, 0.49686282873153687, 0.3302498459815979, -0.48336830735206604, -0.18662996590137482, -0.07831589132547379, 0.5049513578414917, 0.2968936562538147, -0.5439759492874146, -0.2994453012943268, 0.2888665795326233, 0.39359623193740845, -0.06448165327310562, 0.474128574132919...
have the wrath of 13k bobs to face since that "someone" forgot to use a transaction and if you do a rollback you are going to undo critical changes that were needed in other fields. In my studies I have Oracle. In Oracle you can first run the script then commit it if you find that there isn't any mistakes. I was wonde...
[ 0.4074735939502716, 0.34941914677619934, 0.1320481300354004, -0.09053809940814972, -0.24643701314926147, -0.21485982835292816, 0.22599157691001892, 0.10347079485654831, -0.5553460121154785, -0.5238924622535706, 0.31481289863586426, 0.7814440131187439, 0.0931716188788414, -0.108222998678684...
and it is the same mechanism Oracle uses to protected the end user. The difference is that Oracle implicitly begins a transaction for you whereas in SQL Server you must do it explicitly.
[ 0.1249079778790474, 0.10391709208488464, -0.19184981286525726, 0.28308790922164917, -0.06812519580125809, -0.38013631105422974, -0.09510897845029831, -0.18877600133419037, 0.12444134056568146, -0.04576355963945389, 0.04959488660097122, 0.5762080550193787, -0.06692162901163101, 0.1128709092...
Is there a way to vertically stack selected td elments? I would like to have the same table, though display it differently using only css. Would this be possible, or do I have to have separate html markups? I would like to try to have the same html markup, though use different css for different sites/looks. ``` <table...
[ 0.4043877124786377, -0.05741652101278305, 0.4394613802433014, -0.12562181055545807, -0.5466359853744507, 0.3455004096031189, 0.15395709872245789, -0.6838391423225403, -0.3470557928085327, -0.7859065532684326, 0.12990421056747437, 0.5333080291748047, -0.36698418855667114, -0.154811978340148...
<tr> <td class="vertical">i'm</td> <td class="horizontal" rowspan="3">i'm horizontal</td> </tr> <tr> <td class="vertical">above</td> </tr> <tr> <td class="vertical">this</td> </tr> </table> ``` That is what tables are made for. If you want to use CSS you have to use DIVs.
[ -0.011092228814959526, -0.3244657814502716, 0.5658968091011047, 0.01891986094415188, -0.3137434720993042, 0.39854124188423157, -0.04418306052684784, -0.2885923981666565, -0.440207839012146, -0.8084294199943542, -0.22704856097698212, 0.2068965584039688, -0.1339569240808487, -0.0942034125328...
I have a gridview control that can get loaded with multiple pages worth of data. When I switch pages, the columns widths will change to accommodate the largest value in the column for *that page*. If possible, I would like to set the widths of each column to the widest necessary width for the entire dataset. You can s...
[ 0.5257318019866943, -0.1528564989566803, 0.544514536857605, 0.13678929209709167, -0.10058555752038956, 0.1942865401506424, -0.019777527078986168, -0.20118293166160583, -0.048915520310401917, -0.8826630115509033, 0.4827185273170471, 0.5336189270019531, 0.004087461624294519, 0.34909313917160...
to figure this out dynamically, you will have to examine your data first, before binding your grid, figure out the width that you want, then bind your gird and dynamically set the ItemStyle-Width in the RowDataBound event of the gridview.
[ -0.02519206702709198, -0.5986648201942444, 0.7224028706550598, 0.2698654532432556, -0.16486287117004395, 0.0704505518078804, -0.1356274038553238, -0.34484705328941345, -0.24520309269428253, -0.7403429746627808, -0.08432872593402863, 0.3156322240829468, -0.055023763328790665, 0.178080350160...