text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I need to dynamically construct a set of JOIN statements where the table and column names are passed in from another ColdFusion query. When passing the string values to into the statement, CFQUERYPARAM adds single quotes around it - that's part of the point of CFQUERYPARAM. Given that this breaks the SQL statement, is ...
[ 0.39357149600982666, 0.17894281446933746, 0.17684736847877502, 0.1589270532131195, -0.18027924001216888, -0.16532157361507416, 0.5216884613037109, -0.12942944467067719, -0.20977523922920227, -0.4306700825691223, 0.2309989035129547, 0.27334046363830566, -0.5824702382087708, 0.05879553407430...
single quotes - it uses bind variables. I am instantly suspicious of the statement "dynamically construct a set of JOIN statements" - it doesn't sound like you're necessarily doing things properly if you're dynamically joining. However, for table/column names, **once you are definitely sanitizing fully** - if `cfquer...
[ 0.40733879804611206, 0.1836612969636917, 0.3665613532066345, 0.15394729375839233, -0.4396889805793762, -0.01786121539771557, 0.2866491675376892, -0.2831307053565979, -0.09870371222496033, -0.464964896440506, -0.0023357286117970943, 0.44532111287117004, -0.5400591492652893, 0.14491498470306...
Compiling on linux using gcc. I would like to convert this to hex. 10 which would be a. I have managed to do this will the code below. ``` unsigned int index = 10; char index_buff[5] = {0}; sprintf(index_buff, "0x%x", index); data_t.un32Index = port_buff; ``` However, the problem is that I need to assign it to a s...
[ 0.14834578335285187, 0.30624669790267944, 0.0646161437034607, -0.1876726746559143, -0.4145418405532837, -0.0906214490532875, 0.4531066119670868, 0.03480669483542442, -0.0998879075050354, -0.815466582775116, -0.020055215805768967, 0.8507007360458374, -0.5113816857337952, 0.04966862499713898...
advice, Huh? The decimal/hex doesn't matter if you have the value in a variable. Just do ``` data_t.un32index = index; ``` Decimal and hex are just notation when printing numbers so humans can read them. For a C (or C++, or Java, or any of a number of languages where these types are "primitives" with semantics clos...
[ 0.2999092638492584, 0.4225105047225952, 0.0794043093919754, 0.3558683395385742, 0.45538586378097534, -0.18436527252197266, 0.035330455750226974, 0.5273227691650391, 0.29585957527160645, -0.1373925656080246, 0.02190895564854145, 0.718735933303833, -0.041009146720170975, -0.3812201917171478,...
generate various string representations, which is when you need to pick a base to use.
[ 0.3972914218902588, -0.09702704101800919, -0.3202018439769745, 0.3568277060985565, -0.16467876732349396, -0.003970875404775143, -0.02131243608891964, -0.23779048025608063, -0.10706308484077454, -0.3021334409713745, -0.0752570629119873, 0.21012303233146667, -0.3497801125049591, 0.0223778076...
I have two dates of the form: ``` Start Date: 2007-03-24 End Date: 2009-06-26 ``` Now I need to find the difference between these two in the following form: ``` 2 years, 3 months and 2 days ``` How can I do this in PHP? > Use this for legacy code (PHP < 5.3). For up to date solution see jurka's answer below You...
[ 0.40758875012397766, 0.09112749993801117, 0.9031323790550232, -0.13839773833751678, -0.20338627696037292, 0.1297064572572708, 0.19424816966056824, 0.17459474503993988, -0.22270876169204712, -0.48515963554382324, 0.04871340095996857, 0.37590882182121277, 0.3188225030899048, 0.58007842302322...
365*60*60*24) / (30*60*60*24)); $days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); printf("%d years, %d months, %d days\n", $years, $months, $days); ``` **Edit:** Obviously the preferred way of doing this is like described by jurka below. My code is generally only recommended if you do...
[ 0.6456912159919739, 0.3354104459285736, 0.4424854815006256, -0.17505495250225067, 0.14046348631381989, 0.07668834179639816, 0.5679373741149902, -0.0241683479398489, -0.2125663459300995, -0.5744778513908386, 0.13336841762065887, 0.29054704308509827, 0.2927556335926056, 0.3178480863571167, ...
want to do that, just output the date. Despite all that, I've decided to address the complaints. If you truly need an exact range but haven't got access to PHP 5.3, use the code below (it should work in PHP 4 as well). This is a direct port of the code that PHP uses internally to calculate ranges, with the exception ...
[ 0.9093621373176575, -0.17617057263851166, 0.4400567412376404, -0.08227480947971344, -0.09308185428380966, -0.23957818746566772, 0.38987234234809875, 0.0636344701051712, -0.11155102401971817, -0.4533427357673645, 0.28773558139801025, 0.5329513549804688, 0.038524895906448364, -0.233577027916...
DateTime::diff() * implementation by Derick Rethans. Ported to PHP by Emil H, 2011-05-02. No rights reserved. * * See here for original code: * http://svn.php.net/viewvc/php/php-src/trunk/ext/date/lib/tm2unixtime.c?revision=302890&view=markup * http://svn.php.net/viewvc/php/php-src/trunk/ext/date/lib/interval.c?r...
[ -0.46804967522621155, -0.30771738290786743, 0.8928399682044983, -0.30643460154533386, 0.03828158229589462, 0.32090839743614197, 0.09916839748620987, -0.2454598993062973, -0.23245736956596375, -0.44208481907844543, -0.14219118654727936, 0.19981667399406433, -0.5500592589378357, 0.1657475084...
$result[$b] += intval($result[$a] / $adj); $result[$a] -= $adj * intval($result[$a] / $adj); } return $result; } function _date_range_limit_days($base, $result) { $days_in_month_leap = array(31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); $days_in_month = array(31, 31, 28, 31, 30, 31, 30,...
[ 0.032060086727142334, -0.0832362025976181, 0.6795649528503418, -0.5703791975975037, 0.17427557706832886, 0.4905686378479004, 0.5092502236366272, -0.1595713049173355, -0.3494219481945038, 0.09754954278469086, -0.34273040294647217, 0.11573735624551773, -0.3541790246963501, 0.3057350218296051...
while ($result["d"] < 0) { $month--; if ($month < 1) { $month += 12; $year--; } $leapyear = $year % 400 == 0 || ($year %
[ -0.02027112804353237, 0.0332891009747982, 0.4480445683002472, -0.3134324848651886, 0.35727596282958984, 0.05800587683916092, 0.35961130261421204, 0.01723836176097393, -0.293545126914978, 0.0498981699347496, -0.26104238629341125, 0.1270589679479599, -0.010580128990113735, 0.381198525428772,...
100 != 0 && $year % 4 == 0); $days = $leapyear ? $days_in_month_leap[$month] : $days_in_month[$month]; $result["d"] += $days; $result["m"]--; } } else { while ($result["d"] < 0) { $leapyear = $year % 400 == 0 || ($year %
[ 0.06071691960096359, 0.2097277045249939, 0.7008931636810303, -0.2530582547187805, 0.42320773005485535, 0.1226843073964119, 0.4745732247829437, -0.30069440603256226, -0.2985115349292755, -0.01283920370042324, -0.33483028411865234, 0.3971143066883087, -0.05792536959052086, 0.3794617354869842...
100 != 0 && $year % 4 == 0); $days = $leapyear ? $days_in_month_leap[$month] : $days_in_month[$month]; $result["d"] += $days; $result["m"]--; $month++; if ($month > 12) { $month -= 12;
[ 0.26049894094467163, 0.19497834146022797, 0.6140682697296143, -0.3508407473564148, 0.30784550309181213, 0.05225145071744919, 0.5223621726036072, -0.31709715723991394, -0.27065974473953247, 0.0068697030656039715, -0.42584317922592163, 0.37407252192497253, -0.12335813790559769, 0.28329488635...
$year++; } } } return $result; } function _date_normalize($base, $result) { $result = _date_range_limit(0, 60, 60, "s", "i", $result); $result = _date_range_limit(0, 60, 60, "i", "h", $result); $result = _date_range_limit(0, 24, 24, "h", "d", $result); $result = _date_range...
[ 0.0892031341791153, -0.22927653789520264, 0.8771247863769531, -0.35077592730522156, 0.49097880721092224, 0.28177332878112793, 0.33281394839286804, -0.2032640278339386, -0.20298922061920166, -0.12493915855884552, -0.41072118282318115, 0.0996234342455864, 0.06208300217986107, 0.6898580789566...
$result = _date_range_limit(0, 12, 12, "m", "y", $result); return $result; } /** * Accepts two unix timestamps. */ function _date_diff($one, $two) { $invert = false; if ($one > $two) { list($one, $two) = array($two, $one); $invert = true; } $key = array("y", "m", "d", "h", "i", ...
[ 0.10722048580646515, -0.322029709815979, 0.4367540180683136, -0.6967565417289734, 0.15318650007247925, 0.06301262229681015, -0.023698978126049042, -0.42086517810821533, -0.052854590117931366, -0.3280644118785858, -0.3448750376701355, 0.557534396648407, -0.17953039705753326, 0.1072589084506...
H i s", $two)))); $result = array(); $result["y"] = $b["y"] - $a["y"]; $result["m"] = $b["m"] - $a["m"]; $result["d"] = $b["d"] - $a["d"]; $result["h"] = $b["h"] - $a["h"]; $result["i"] = $b["i"] - $a["i"]; $result["s"] = $b["s"] - $a["s"]; $result["invert"] = $invert ? 1 : 0; $resu...
[ 0.10954594612121582, -0.3782767951488495, 0.7445666790008545, -0.4239727258682251, 0.18533001840114594, -0.028755664825439453, 0.47443923354148865, -0.5037549734115601, -0.1433955878019333, -0.13782131671905518, -0.664622962474823, 0.41589832305908203, -0.38630411028862, 0.2789464592933655...
_date_normalize(&$b, &$result); } return $result; } $date = "1986-11-10 19:37:22"; print_r(_date_diff(strtotime($date), time())); print_r(_date_diff(time(), strtotime($date))); ```
[ 0.17078259587287903, -0.11143454164266586, 0.6678386926651001, -0.20453661680221558, 0.40593695640563965, 0.09827737510204315, 0.29273879528045654, 0.04199570417404175, -0.253344863653183, -0.259433776140213, -0.2576651871204376, 0.36041125655174255, -0.3338020443916321, 0.66249680519104, ...
Native web services is a new feature of the XML DB technology. In google i found that it`s very close to SOA. Can anyone simply explain: 1) what is the main usage of Native web services 2) what is the main difference of XML DB 11g and previous XML DB releases. Thanks. I found documentation. It was hard ) [What's New...
[ -0.1402110755443573, 0.1372382491827011, 0.32875481247901917, -0.08648686110973358, -0.4695630967617035, -0.20781166851520538, 0.5411245226860046, -0.12862396240234375, -0.20909255743026733, -0.7182318568229675, -0.22327277064323425, 0.47067633271217346, -0.24861449003219604, 0.40154138207...
New Oracle XML DB Privileges * Web Services * In-Place XML Schema Evolution * Support for Recursive XML Schemas * Support for XLink and XInclude * Support for XML Translations * Support for Large XML Nodes * Unified Java API * Oracle Data Pump Support for XMLType * Support for XMLType by Oracle Streams and Logical Stan...
[ 0.2312266081571579, 0.12455669045448303, 0.27489566802978516, 0.2164333611726761, -0.33472928404808044, -0.23300530016422272, 0.03961484134197235, -0.3877957761287689, -0.08158251643180847, -0.5053040385246277, -0.21288669109344482, 0.2663338780403137, -0.18318845331668854, 0.0452161505818...
applications can access Oracle Database using native Oracle XML DB Web services. One available service lets you issue SQL and XQuery queries and receive results as XML data. Another service provides access to all PL/SQL stored functions and procedures. You can customize the input and output document formats when you us...
[ 0.28552669286727905, 0.1332368105649948, 0.294513463973999, 0.1303889900445938, -0.20827320218086243, 0.05426640808582306, 0.20519262552261353, -0.053738612681627274, -0.08515840768814087, -0.5313515067100525, -0.19763463735580444, 0.16600261628627777, -0.2907278835773468, 0.14217936992645...
Oracle XML DB Web services and WSDL documents using the Oracle XML DB configuration file, xdbconfig.xml. You can also configure security settings for the Web services using the same configuration file.
[ 0.5159671306610107, 0.37873658537864685, -0.1335722804069519, 0.2393433153629303, -0.2092834711074829, -0.2834203541278839, 0.07569454610347748, -0.15843906998634338, 0.06314756721258163, -0.2911577820777893, -0.39981988072395325, 0.16400088369846344, -0.2508265972137451, 0.037513103336095...
I would like to determine the IP address of a printer, using C# (.NET 2.0). I have only the printer share name as set up on the Windows OS, in the format `\\PC Name\Printer Name`. The printer is a network printer, and has a different IP address to the PC. Does anyone have any pointers? Thanks in advance for your help....
[ 0.5986438393592834, 0.1910792887210846, 0.4499196708202362, -0.0081570940092206, 0.32340219616889954, -0.2659015953540802, -0.22109408676624298, 0.07876772433519363, -0.2509887218475342, -0.8789451122283936, 0.2368057370185852, 0.5252155065536499, -0.11538681387901306, 0.2721558213233948, ...
I have a few images with some text, I need to show the image with the relevant text in a listbox. Browsing google I came across this sample class, ``` public class Customer { public string Fname; public string Lname; public Customer(string firstName, string lastName) { Fname = firstName; Lname = la...
[ 0.07407302409410477, -0.01818867027759552, 0.6988866925239563, -0.3125362992286682, -0.07098490744829178, 0.24001704156398773, 0.014837652444839478, -0.058601800352334976, -0.036854088306427, -0.5108335018157959, 0.16956110298633575, 0.5065550804138184, -0.09320975840091705, 0.004685108084...
use a `DataTemplate` to display your objects in the `ListBox`. Create a data object that contains string properties and an Image property: ``` public class Img { public Img(string value, Image img) { Str = value; Image = img; } public string Str { get; set; } public Image Image { get; set; } } ``` Creat...
[ 0.05764913931488991, 0.08116767555475235, 0.4623861312866211, -0.0102302897721529, -0.10327525436878204, 0.09020732343196869, -0.22927643358707428, -0.33910438418388367, -0.24597367644309998, -0.6862843036651611, -0.41033825278282166, 0.4902470111846924, -0.34917953610420227, 0.08365758508...
<TextBlock Margin="3" Text="{Binding Str}"/> <ContentControl Margin="3" Content="{Binding Image}"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> ``` Now add the `Img` items (or your data objects) to the `ListBox` like so: ``` lstBox.Items.Add(new Img("Value...
[ -0.1094747930765152, 0.06227855384349823, 0.9872028231620789, -0.11118485778570175, -0.12859031558036804, -0.058924511075019836, -0.1179133728146553, -0.5320776700973511, -0.47659555077552795, -0.6116448044776917, -0.2579585909843445, 0.22361168265342712, -0.32626816630363464, 0.0019865499...
I want to save results in a text file. How can I do that? Write command? yes, the write command. And the open command to open the file. Something like this, if my rusty FORTRAN memory serves: ``` OPEN(UNIT=1, FILE=FNAME, STATUS='NEW') WRITE(UNIT=1,FMT=*) "your data" ``` Your other option is to simply write to stdout...
[ 0.12474088370800018, 0.12845700979232788, 0.3571544587612152, -0.2848413288593292, 0.07932684570550919, 0.2058320939540863, 0.3688928484916687, 0.02573365718126297, -0.2062285989522934, -0.7579754590988159, -0.16036517918109894, 1.000010371208191, -0.1344911754131317, 0.10804332047700882, ...
One of my users had a single error while opening a file (I'm using standard xml 1.0): ``` The remote name could not be resolved: 'www.w3.org' ``` I found a post here in [StackOverflow](https://stackoverflow.com/questions/217841/net-autogenerated-web-service-client-how-do-i-avoid-requesting-schemas-from-w3o) that dea...
[ 0.12034844607114792, 0.3245519697666168, 0.2978156805038452, -0.1423414796590805, 0.02091488055884838, -0.4483402967453003, 0.560542643070221, -0.07492057979106903, -0.19215887784957886, -0.5807938575744629, -0.11038809269666672, 0.4823509752750397, -0.206936314702034, 0.22740605473518372,...
with the files that you *do* have (I have one that reads known files from resx for example). But the simplest option is just to disable it... and of course your unit tests will quickly identify any problem ;-p
[ 0.18440653383731842, 0.08553344011306763, 0.2611526548862457, 0.2420114129781723, 0.3656000792980194, -0.26269516348838806, 0.40294939279556274, -0.25788965821266174, -0.25857841968536377, -0.654761016368866, -0.5084304213523865, 0.7017082571983337, -0.12490402907133102, 0.3641061782836914...
Using PHP, given a URL, how can I determine whether it is an image? There is no context for the URL - it is just in the middle of a plain text file, or maybe just a string on its own. I don't want high overhead (e.g. reading the content of the URL) as this could be called for many URLs on a page. Given this restrict...
[ 0.25252652168273926, 0.3188670575618744, 0.20252829790115356, 0.10933903604745865, -0.2888093590736389, -0.20614902675151825, 0.01011096965521574, -0.041602905839681625, -0.2758943438529968, -0.4161701500415802, 0.21118170022964478, 0.2566818296909332, -0.13149164617061615, 0.1270894110202...
a better way than this. Here is what I currently have: ``` function isImage( $url ) { $pos = strrpos( $url, "."); if ($pos === false) return false; $ext = strtolower(trim(substr( $url, $pos))); $imgExts = array(".gif", ".jpg", ".jpeg", ".png", ".tiff", ".tif"); // this is far from complete b...
[ 0.1951378583908081, -0.058192260563373566, 0.6268464922904968, -0.04629436507821083, 0.026537328958511353, -0.22519685328006744, 0.44700947403907776, -0.4089778959751129, -0.16181309521198273, -0.5783118009567261, -0.3586021661758423, 0.789491593837738, -0.2144063115119934, -0.030285965651...
else here is the final function using the technique from Emil H's answer: ``` function isImage($url) { $params = array('http' => array( 'method' => 'HEAD' )); $ctx = stream_context_create($params); $fp = @fopen($url, 'rb', false, $ctx); if (!$fp) return...
[ 0.005362146068364382, 0.13620464503765106, 0.5799835920333862, 0.013277520425617695, 0.015009500086307526, 0.18093034625053406, 0.4233156740665436, -0.6768670082092285, -0.1985788643360138, 0.011658093892037868, -0.5455372333526611, 0.33397117257118225, -0.3796449899673462, 0.2792126238346...
$meta = stream_get_meta_data($fp); if ($meta === false) { fclose($fp); return false; // Problem reading data from url } $wrapper_data = $meta["wrapper_data"]; if(is_array($wrapper_data)){ foreach(array_keys($wrapper_data) as $hh){ if (substr($wrapper_data[$hh], 0, 1...
[ 0.12163203954696655, -0.09307580441236496, 0.8005033135414124, -0.25618526339530945, -0.14267374575138092, 0.190665140748024, 0.46417704224586487, -0.7976901531219482, -0.1162889301776886, -0.38023462891578674, -0.4231020212173462, 0.7049335837364197, -0.6749646663665771, 0.022372266277670...
fclose($fp); return true; } } } fclose($fp); return false; } ``` You could use an [HTTP HEAD](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4) request and check the content-type. This might be a good compromise. It can be done using [PHP Streams](http://se2.php.n...
[ 0.0895700603723526, -0.14177058637142181, 0.8853196501731873, 0.08601836115121841, -0.2488080859184265, -0.3834024667739868, 0.14783035218715668, -0.5056368112564087, -0.12904125452041626, -0.39602130651474, -0.12849202752113342, 0.17227588593959808, -0.4830211400985718, 0.0741672515869140...
instead. You can retrieve the headers from an http response using [stream\_get\_meta\_data()](http://se2.php.net/manual/en/function.stream-get-meta-data.php). Of course this isn't really 100%. Some servers send incorrect headers. It will however handle cases where images are delivered through a script and the correct ...
[ 0.26942750811576843, -0.2532963752746582, 0.37897008657455444, 0.3866526186466217, -0.012078315950930119, -0.024651745334267616, 0.206961527466774, -0.2814442813396454, -0.1241493672132492, -0.5700125694274902, -0.18156233429908752, 0.3027966320514679, -0.3857503831386566, -0.0178480073809...
A certain site I know recently upgraded their bandwith from 2,5 TB monthly to 3,5 TB. Reason is they went over the 2,5 limit recently. They're complaining they don't know how to get down the bandwidth usage. One thing I haven't seen them consider is the fact that JPEG and other images that are displayed on the site(a...
[ 0.9646520614624023, -0.025304613634943962, 0.5381990075111389, 0.2014157474040985, 0.05407191812992096, -0.38787606358528137, 0.376148521900177, 0.15695683658123016, -0.42381367087364197, -0.40929192304611206, 0.3465862572193146, 0.6220446825027466, -0.29248228669166565, 0.3057131171226501...
increases the filesize of every images from a few bytes to a few kilobytes. On a site that uses up more then 2,5 TB per month, stripping the several thousands images of their metadata will help decrease the bandwidth usage at least by a few Gigabytes per month I think, if not more. So is there a way to do this in PHP...
[ 0.6708874702453613, -0.05768808349967003, 0.6088753938674927, 0.1988430619239807, -0.23921549320220947, -0.060218147933483124, 0.27151453495025635, -0.010809424333274364, -0.4869253933429718, -0.7735720276832581, 0.00424428703263402, 0.4624007046222687, -0.035932525992393494, -0.0297553800...
all un-necs info from an image. They have an **[API](http://smush.it/faq.php#results-table)** you can use to crunch the images. **Note:** *By Design*, it ***may*** change the filetype on you. This is on purpose. If another filetype can display the same image with the same quality, with less bytes it will give you a ne...
[ 0.44606828689575195, -0.1348389983177185, 0.2715493142604828, 0.3947673738002777, 0.038093484938144684, -0.10305008292198181, 0.030069388449192047, 0.28068479895591736, -0.32684919238090515, -0.7933189868927002, -0.22451217472553253, 0.4123092591762543, -0.07516267895698547, 0.200113475322...
I have this query running in my PHP script: ``` $insertQuery = "INSERT INTO blog_articles VALUES '$title', $tags', '$category', '$blog', '$author', '$date'"; ``` I then run this script: ``` if ($result = $connector->query($insertQuery)){ // It worked, give confirmation echo '<center><b>Article add...
[ 0.3773997128009796, 0.24278321862220764, 0.541391909122467, -0.012199820950627327, 0.05875062569975853, -0.22466827929019928, 0.4090254008769989, -0.27126190066337585, -0.05480093136429787, -0.44635921716690063, 0.17394812405109406, 0.6391209363937378, -0.47991129755973816, 0.1277302056550...
to use near 'Title Number 1, General, Blogging, Kayaking, General, Tgis is blog number spelli' at line 2 But I cannot tell what the error is. Your query should be more like this ``` INSERT INTO blog_articles (`title`, `tags`, `category`, `blog`, `author`, `date`) VALUES ('$title', '$tags', '$category', '$blog', '$aut...
[ -0.46973004937171936, 0.24719074368476868, 0.6625447273254395, -0.13787832856178284, 0.20640745759010315, -0.0784127488732338, 0.20028755068778992, -0.3159092962741852, 0.3309245705604553, -0.5433205366134644, -0.268932968378067, 0.44147950410842896, -0.46747830510139465, 0.306583464145660...
documentation has some great examples.
[ 0.4628443121910095, 0.4267490804195404, -0.3074789047241211, 0.2219771295785904, 0.34761884808540344, -0.12199708819389343, -0.08289609849452972, -0.12187305837869644, -0.4964631199836731, -0.5626494288444519, -0.23018017411231995, 0.37542152404785156, 0.28035300970077515, 0.07488393783569...
is it at all possible to generate sound on-the-fly in a Silverlight app and play it? I.e. if I want to play a sine-wave, can I generate a buffer and feed it to some media API? Cheers Nik Pete Brown already has a working prototype: <http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/03/23/Creating...
[ 0.09738009423017502, 0.29720932245254517, 0.6236281991004944, 0.19408857822418213, 0.043147094547748566, -0.16333778202533722, 0.010002540424466133, -0.474049836397171, -0.1968616098165512, -0.3531753718852997, 0.20333820581436157, 0.4145192801952362, 0.026414554566144943, -0.2771613299846...
Every once in a while I want to replace all instances of values like: ``` <BarFoo> ``` with ``` <barfoo> ``` i.e. do a regular expression replace of all things inside angle brackets with its lowercase equivalent. Anyone got a nice snippet of Lisp that does this? It's safe to assume that we're dealing with just A...
[ -0.048174962401390076, -0.06735460460186005, 0.4360511898994446, 0.1514107584953308, -0.06733210384845734, -0.06801406294107437, 0.30554670095443726, 0.010143556632101536, -0.3345007598400116, -0.657450795173645, -0.19907227158546448, 0.8109493851661682, -0.15840713679790497, 0.03199930116...
Emacs 22 and later, see this [Steve Yegge blog post](http://steve-yegge.blogspot.com/2006/06/shiny-and-new-emacs-22.html) for more details on how Lisp expressions can be used in the replacement string. For earlier versions of Emacs you could try something like this: ``` (defun tags-to-lower-case () (interactive) ...
[ -0.31812340021133423, 0.023782050237059593, 0.5571808815002441, 0.02478858456015587, -0.06611292064189911, 0.2197880893945694, 0.2163998931646347, -0.16296952962875366, -0.39511191844940186, -0.396720826625824, -0.21625462174415588, 0.618235170841217, -0.5899038314819336, -0.14841166138648...
I must customize .NET `ListView` control. `ListViewItem` must have following structure: [alt text http://img257.imageshack.us/img257/1575/85834837.jpg](http://img257.imageshack.us/img257/1575/85834837.jpg) Is there any good tutorial which will help me to make this customization? I am using Visual Studio 2008, C#....
[ 0.5760971903800964, -0.03784669563174248, 0.48370644450187683, -0.07326890528202057, -0.2260192483663559, -0.30256542563438416, 0.4476093649864197, -0.41514256596565247, -0.12079630047082901, -0.5161269307136536, -0.053855862468481064, 0.39779356122016907, -0.3791436553001404, -0.018723607...
If I click a button event in form1, form2 should be focus and if I click button event in form2, form1 should focus in c#. How can I do this? The problem was that I need Installshield Premier and not Installshield Professional (which is the one I have).
[ 0.04051430523395538, -0.40076062083244324, 0.4365346133708954, -0.15023377537727356, -0.2604775130748749, -0.6712471842765808, 0.22031165659427643, -0.07991039752960205, -0.08838905394077301, -0.6576862335205078, -0.015410899184644222, 0.9454002976417542, -0.3265770375728607, -0.2186018973...
here are two routes from my global.asax file. I'm trying to go to the second route and I'm getting a default 404 resource not found error. When i remove the first route (listed in this example), it works. How can i fix this, please? ### Snippet of global.asax code ``` // GET: /user/PureKrome/Alert/69 routes.MapRout...
[ -0.13653001189231873, -0.3090633153915405, 0.5630286335945129, 0.02105587348341942, 0.0765615776181221, 0.23684997856616974, 0.03707126900553703, -0.06874524056911469, -0.3964102566242218, -0.9344408512115479, 0.15478944778442383, 0.3880058825016022, -0.5442622900009155, -0.187848925590515...
will happily accept "create" as the alertId in the last parameter. It appears that you intend the alertId parameter to be numeric only, so you should add a constraint to tell the route system that that last parameter must be numeric. See this [tutorial](http://www.asp.net/learn/mvc/tutorial-24-cs.aspx). For example: ...
[ -0.0052828374318778515, 0.05907972529530525, 0.8584808707237244, -0.0816066712141037, 0.5262125730514526, -0.4503953158855438, -0.01526818796992302, -0.18457333743572235, -0.19667066633701324, -0.7543174028396606, -0.44024115800857544, 0.2894790768623352, -0.21244974434375763, -0.149359390...
you can also reverse the order of the routes, but even if you do, you should still include a constraint for correctness if you want alertId to always be a number.
[ 0.175620898604393, -0.4528738260269165, 0.36978214979171753, 0.289644718170166, 0.20740622282028198, -0.4130486249923706, 0.4228331446647644, -0.12407732754945755, -0.2912213206291199, -0.581707775592804, -0.036760177463293076, 0.403981477022171, -0.21040679514408112, -0.2304474115371704, ...
I'm sure there must be a much better way of doing this. I'm trying to do a count operation on a Flags enum. Before I was itterating over all the possible values and counting the succesful AND operations. e.g. ``` [Flags] public enum Skills { None = 0, Skill1 = 1, Skill2 = 2, Skill3 = 4, Skill4 = 8...
[ 0.0910748764872551, -0.18752458691596985, 0.16154791414737701, 0.10804548859596252, 0.29997438192367554, 0.08670680224895477, 0.026582786813378334, -0.30784380435943604, -0.18943464756011963, -0.41537508368492126, -0.11783919483423233, 0.5367987155914307, 0.19930307567119598, -0.0776898860...
Skills skill; for (int i = 0; i < SkillSet.AllSkills.Count; i++) { skill = SkillSet.AllSkills[i]; if ((skillsToCount & skill) == skill && skill != Skills.None) count++; } return count; } ``` I'm sure there must be a better way of doing this though, but must be suffering from a mental ...
[ 0.10705341398715973, -0.05219469591975212, 0.085797518491745, 0.10986284911632538, 0.20083890855312347, 0.02562142163515091, 0.49902188777923584, -0.22553741931915283, -0.15688282251358032, -0.8032566905021667, -0.15037132799625397, 0.7455925941467285, 0.22221174836158752, -0.1785303503274...
the code for anyone else: ``` internal static UInt32 Count(this Skills skills) { UInt32 v = (UInt32)skills; v = v - ((v >> 1) & 0x55555555); // reuse input as temporary v = (v & 0x33333333) + ((v >> 2) & 0x33333333); // temp UInt32 c = ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >>...
[ 0.14179767668247223, -0.10695459693670273, 0.4303644597530365, -0.1041843369603157, 0.20675192773342133, 0.265247642993927, 0.37995803356170654, -0.3346518576145172, -0.26463302969932556, -0.670373797416687, -0.4313028156757355, 0.7061886787414551, 0.15077878534793854, -0.12402967363595963...
return c; } ```
[ -0.09963399171829224, 0.29144397377967834, -0.30089816451072693, -0.38840794563293457, 0.2121361941099167, -0.23597757518291473, 0.25530189275741577, 0.2132646143436432, 0.3011102080345154, -0.25158706307411194, -0.6057295799255371, 0.7808647751808167, -0.39695754647254944, 0.2125244140625...
I need to Copy folder C:\FromFolder to C:\ToFolder Below is code that will CUT my FromFolder and then will create my ToFolder. So my FromFolder will be gone and all the items will be in the newly created folder called ToFolder ``` System.IO.Directory.Move(@"C:\FromFolder ", @"C:\ToFolder"); ``` But i just want to C...
[ 0.4691729247570038, 0.22442330420017242, 0.4546363651752472, 0.0845390111207962, -0.017994990572333336, -0.062299102544784546, -0.06323689222335815, -0.1071959137916565, -0.18476100265979767, -0.5889461636543274, 0.05233676731586456, 0.31467965245246887, -0.09963110834360123, 0.55885338783...
all subfolders under the current directory, see // "How to: Iterate Through a Directory Tree.") // Note: Check for target path was performed previously // in this code example. if (System.IO.Directory.Exists(sourcePath)) { string[] files = System.IO.Directory.GetFiles(sourcePath); // Copy the files and overw...
[ 0.2353636473417282, -0.1733681857585907, 0.6821099519729614, -0.09452813118696213, 0.17791984975337982, -0.02934185415506363, 0.3075314462184906, -0.46892839670181274, -0.33552268147468567, -0.9989756345748901, -0.3440228998661041, 0.5394949913024902, -0.41842707991600037, 0.38655132055282...
I have the following code: ``` class SuperClass { public static String getName() { return "super"; } } class SubClass extends SuperClass { public static String getName() { return "sub"; } } public class Dummy<T extends SuperClass> { public void print() { System.out.println("SuperClass: " + SuperC...
[ 0.08458276838064194, -0.30914032459259033, 0.4766101539134979, -0.2903366684913635, 0.029991280287504196, 0.08779878169298172, 0.4140577018260956, -0.3313586711883545, -0.023686202242970467, -0.7073479294776917, -0.3313274681568146, 0.5266368389129639, -0.3158370852470398, 0.38768598437309...
} } ``` This code outputs the following: ``` SuperClass: super SubClass: sub T: super ``` My question is: Why doesn't T.getName() return the value of SubClass.getName()? After all, I specified that T == SubClass. Or are static function calls invalid for generic references? Thanks a lot in advance! This isn't just...
[ -0.13078252971172333, -0.18684273958206177, 0.3379543721675873, -0.21112388372421265, 0.13718155026435852, -0.16685761511325836, 0.3546796441078186, -0.008135154843330383, -0.27142244577407837, -0.5407232642173767, -0.36331430077552795, 0.6459240913391113, -0.5936068892478943, 0.3120265007...
I want to check whether a value is equal to 1. Is there any difference in the following lines of code Evaluated value == 1 1 == evaluated value in terms of the compiler execution In most languages it's the same thing. People often do 1 == evaluated value because 1 is not an lvalue. Meaning that you can't accidental...
[ 0.17014282941818237, 0.1581224948167801, -0.18125824630260468, -0.17739231884479523, -0.10325244069099426, -0.16801564395427704, 0.30131739377975464, -0.33427050709724426, -0.1266685128211975, -0.39831027388572693, 0.05275470390915871, 0.5133631825447083, -0.5983445644378662, -0.0673612803...
takes this question to a new meaning. The 6 == x wouldn't compile in that case but the x == 6 would.
[ 0.2976807653903961, 0.032642293721437454, 0.19708119332790375, 0.033853743225336075, -0.1526610106229782, 0.012575465254485607, 0.30594462156295776, -0.3373752236366272, 0.07189599424600601, -0.18025334179401398, -0.13952666521072388, 0.271146297454834, -0.2751450836658478, 0.2205510437488...
I've just parallelized a fortran routine that simulates individuals behavior and I've had some problems when generating random numbers with Vector Statistical Library (a library from the Math Kernel Library). The structure of the program is the following: ``` program example ... !$omp parallel do num_threads(proc) def...
[ -0.1341599076986313, -0.12336195260286331, 0.5417493581771851, 0.01361023634672165, -0.02949344925582409, 0.28114432096481323, -0.0006898313295096159, -0.22668318450450897, -0.28118324279785156, -0.6768882274627686, 0.1920340657234192, 0.2027035653591156, -0.5821378827095032, 0.31472635269...
-lmkl_ia32 -lguide -lpthread Example.o: $(libdir)Example.f90 $(f90comp) -O3 -fpscomp logicals -openmp -c $(libdir)Example.f90 Firstroutine.o: $(libdir)Firstroutine.f90 $(f90comp) -O3 -fpscomp logicals -openmp -c $(libdir)Firstroutine.f90 Secondroutine.o: $(libdir)Secondroutine.f90 $(f90comp) -O3 -f...
[ 0.1100882813334465, -0.28455373644828796, 0.49676066637039185, -0.2013557255268097, 0.13015131652355194, 0.06345278024673462, 0.368867427110672, -0.2772783041000366, -0.39060744643211365, -0.32598617672920227, -0.20851483941078186, 0.4818635880947113, -0.7981002330780029, -0.25028517842292...
found any patern to when does this corruption happen. Any idea on why is it happening? In most languages it's the same thing. People often do 1 == evaluated value because 1 is not an lvalue. Meaning that you can't accidentally do an assignment. Example: ``` if(x = 6)//bug, but no compiling error { } ``` Instead y...
[ 0.03598804026842117, 0.031720079481601715, -0.06264957040548325, 0.11447469890117645, -0.02881558984518051, -0.23960773646831512, 0.32477328181266785, 0.11096253991127014, -0.23399235308170319, -0.5517270565032959, 0.09953536093235016, 0.5381541848182678, -0.3136141002178192, 0.10901261866...
the x == 6 would.
[ 0.24859248101711273, -0.028383178636431694, 0.5175463557243347, 0.0523042231798172, -0.04804224148392677, -0.1635679006576538, 0.2706502377986908, -0.48584216833114624, 0.12408839911222458, -0.37477728724479675, -0.3086371421813965, 0.4987014830112457, -0.4425886571407318, 0.42020040750503...
I am trying to limit the size of my generic list so that after it contains a certain amount of values, it won't add any more. I am trying to do this using the Capacity property of the List object, but this does not seem to work. ``` Dim slotDates As New List(Of Date) slotDates.Capacity = 7 ``` How w...
[ 0.6229707598686218, 0.1183556616306305, 0.3493414521217346, -0.09616918116807938, 0.04541971534490585, -0.101731076836586, 0.04536052420735359, -0.13771851360797882, -0.5131821036338806, -0.6007744669914246, 0.23072467744350433, 0.5228606462478638, -0.33698803186416626, 0.640491247177124, ...
to a `List<T>`: Add, AddRange, Insert, etc. Consider a solution that inherits from `Collection<T>`: ``` Public Class LimitedCollection(Of T) Inherits System.Collections.ObjectModel.Collection(Of T) Private _Capacity As Integer Public Property Capacity() As Integer Get Return _Capacity...
[ -0.2620055675506592, -0.48784658312797546, 0.10807041078805923, 0.11368526518344879, 0.12270247936248779, -0.04281001538038254, -0.06711164116859436, -0.302268922328949, -0.357078492641449, -0.578809380531311, -0.4013492166996002, 0.37159308791160583, -0.3570961058139801, 0.341180741786956...
Set End Property Protected Overrides Sub InsertItem(ByVal index As Integer, ByVal item As T) If Me.Count = Capacity Then Dim message As String = String.Format("List cannot hold more than {0} items", Capacity) Throw New InvalidOperationException(message) ...
[ 0.28589922189712524, -0.34448564052581787, 0.7400039434432983, -0.2128971815109253, 0.13642765581607819, -0.1301308125257492, 0.29390281438827515, -0.5591872930526733, -0.1035306453704834, -0.2562505602836609, -0.4152400493621826, 0.6149148941040039, -0.20637984573841095, 0.381655693054199...
MyBase.InsertItem(index, item) End Sub End Class ``` This way the capacity is respected whether you `Add` or `Insert`.
[ 0.2309531718492508, 0.15098440647125244, 0.16672460734844208, -0.10817190259695053, 0.04672054201364517, -0.362993448972702, -0.12033922970294952, 0.021640121936798096, 0.29886311292648315, -0.5968304872512817, 0.014310633763670921, 0.5889731049537659, -0.2268928438425064, 0.03429595008492...
the title is my question. i don't know the details of the web server that my project will be deployed on. in one class i execute a batch file in the project directory. should i just say "C:\Inetpub\wwwroot\etcetcetc" and hope for the best? There are several different ways to add things to a `List<T>`: Add, AddRange, In...
[ 0.18367181718349457, -0.21724456548690796, 0.09469638764858246, 0.12163279950618744, 0.1581481397151947, 0.06598362326622009, -0.05907275900244713, -0.03534460440278053, -0.32469505071640015, -0.6010245680809021, -0.13039983808994293, 0.2792589068412781, -0.04599704220890999, 0.43664240837...
Return _Capacity End Get Set(ByVal value As Integer) _Capacity = value End Set End Property Protected Overrides Sub InsertItem(ByVal index As Integer, ByVal item As T) If Me.Count = Capacity Then Dim message As String =
[ -0.06342928111553192, -0.32906341552734375, 0.6890456080436707, -0.16885729134082794, 0.29190653562545776, 0.012529833242297173, 0.2798154950141907, -0.3739001452922821, -0.048635244369506836, -0.2871539890766144, -0.22222228348255157, 0.7815613746643066, -0.14954839646816254, 0.3695429265...
String.Format("List cannot hold more than {0} items", Capacity) Throw New InvalidOperationException(message) End If MyBase.InsertItem(index, item) End Sub End Class ``` This way the capacity is respected whether you `Add` or `Insert`.
[ 0.1530245542526245, -0.10663773864507675, 0.2970607876777649, -0.19046641886234283, 0.10361363738775253, -0.245127871632576, 0.11314789205789566, -0.21883071959018707, -0.014334632083773613, -0.39247143268585205, -0.15627260506153107, 0.49073347449302673, -0.17812800407409668, 0.3439386785...
In my WPF Application I have a canvas with a Listbox in it. I want to overlay an Listboxitem with another control after it was clicked on the item. But for that I need the position of the Listboxitem in the canvas. I see the problem because the single Item is not child of the canvas. Only the Listbox itself is. Is the...
[ -0.03329414874315262, -0.34836065769195557, 0.6906768083572388, -0.22614507377147675, 0.0012484993785619736, 0.06904705613851547, 0.05852052941918373, -0.50373774766922, -0.2867293357849121, -0.961470365524292, 0.03654731810092926, 0.5038260221481323, -0.4090184271335602, -0.06514067947864...
Point to the canavas location. HTH.
[ -0.4407997727394104, 0.22740983963012695, 0.6230531930923462, -0.19898594915866852, 0.2558218538761139, 0.044827237725257874, 0.09800150245428085, 0.11712532490491867, -0.1655074954032898, -0.5396845936775208, -0.13306018710136414, -0.05601673573255539, 0.15369480848312378, 0.0949148237705...
I got a quick question about sprites in css: Will I send two HTTP Request if I include the same image twice in a css file? For example if I want to load two different buttons from the same icon set image: ``` .btn-1 { background:url('img/icons.png') 0 0; } .btn-2 { background:url('img/icons.png') 0 -60px; } ...
[ 0.28694242238998413, -0.1401648223400116, 0.158626526594162, -0.07769422233104706, -0.6130433082580566, 0.300357848405838, 0.2463647723197937, -0.14940181374549866, -0.39184466004371643, -0.7198125720024109, 0.0900588184595108, 0.41467657685279846, -0.45058125257492065, -0.0398492701351642...
`<a>` for example. ``` a { background: url('img/icons.png'); } .btn-1 { background-position:0 0; } .btn-2 { background-position: 0 -60px; } ```
[ 0.06995678693056107, 0.13251188397407532, 0.15926297008991241, -0.3223406672477722, 0.08453890681266785, 0.2664811611175537, 0.2474137246608734, 0.04842555522918701, -0.26087266206741333, -0.6332636475563049, -0.733472466468811, 0.2837104797363281, -0.324323832988739, 0.13416025042533875, ...
How can i solve this problem "Error updating JScript IntelliSense: D:\myProject\js\jquery-1.3.2.js: Object doesn't support this property or method @ 2139:1", i did all in this [Visual Studio jscript intellisense error with jQuery 1.2.6?](https://stackoverflow.com/questions/218578/visual-studio-jscript-intellisense-err...
[ -0.0740734338760376, -0.053131431341171265, 0.30895349383354187, 0.2606359124183655, 0.027481265366077423, -0.17092886567115784, 0.20789337158203125, 0.059525541961193085, -0.21340695023536682, -0.6815119981765747, -0.1374819278717041, 0.723289966583252, -0.18666231632232666, -0.0436945743...
JavaScript Intellisense, by Jeff King (the Program Manager in charge of tooling): <http://blogs.msdn.com/webdevtools/archive/2008/11/18/jscript-intellisense-faq.aspx>
[ -0.34977421164512634, -0.09381093084812164, -0.29308852553367615, -0.1919250786304474, 0.04851759970188141, 0.40302881598472595, 0.330982506275177, 0.017689203843474388, 0.10154104232788086, -0.744263768196106, -0.521981418132782, 0.0014069735771045089, -0.6302746534347534, -0.700396776199...
In my Tomcat logs (catalina) I am getting the following error preventing my application from starting up: ``` SEVERE: Error listenerStart 24-Mar-2009 13:23:10 org.apache.catalina.core.StandardContext start SEVERE: Context [/exampleA] startup failed due to previous errors ``` I do not know why I am getting this. In ...
[ 0.0568586029112339, 0.3533782660961151, 0.811408519744873, -0.10367108136415482, -0.10874725878238678, -0.29636430740356445, 0.7527695298194885, -0.29672619700431824, -0.31790077686309814, -0.2417239397764206, -0.16000917553901672, 1.0978811979293823, 0.027465902268886566, -0.3526833653450...
static Log log = LogFactory.getLog(SessionAttributeListener.class.getName()); public void attributeAdded(HttpSessionBindingEvent hsbe) { log.debug("VALUE attributeAdded to THE SESSION:" + hsbe.getName()); } public void attributeRemoved(HttpSessionBindingEvent hsbe) { log.debug("VALUE attri...
[ -0.32316675782203674, -0.2246658056974411, 0.34893661737442017, -0.12249979376792908, 0.07562095671892166, -0.1301470696926117, 0.5941259860992432, -0.1665797233581543, -0.22179320454597473, -0.45936211943626404, -0.5869736671447754, 0.8030445575714111, -0.505584180355072, 0.28833773732185...
private static int activeSessions = 0; public void sessionCreated(HttpSessionEvent evt) { activeSessions++; log.debug("No. of active sessions on:"+ new java.util.Date()+" : "+activeSessions); } public void sessionDestroyed (HttpSessionEvent evt) { activeSessio...
[ 0.16898515820503235, -0.18362389504909515, 0.5040032267570496, -0.054326511919498444, -0.006165932863950729, -0.3461526036262512, 0.6285894513130188, 0.08254125714302063, -0.46135765314102173, -0.47738754749298096, -0.585889458656311, 0.8022016882896423, -0.4564082622528076, 0.187973007559...
be a problem with SessionAttributeListener from starting up. The SessionListener was not starting up because the <listener> were declared after the <servlet> **UPDATE** There was a problem with the JAR file used. The class for SessionAttributeListener was not included. When it was included the application started. *...
[ 0.4734141528606415, -0.1500106304883957, 0.36563822627067566, -0.2262216955423355, -0.22811923921108246, -0.42943519353866577, 0.6629641652107239, -0.16147984564304352, -0.0347960889339447, -0.6468614339828491, 0.04322477802634239, 0.9279901385307312, -0.5870885848999023, 0.044314585626125...
have you tried adding a static initialiser? something like ``` static { log.debug("static initialiser called"); } ``` that way the first time that the class is referenced you should get a log record.
[ 0.1467156559228897, -0.13001619279384613, -0.16594703495502472, 0.059243492782115936, 0.003243897343054414, -0.2933773696422577, -0.01865372806787491, 0.19480054080486298, -0.35362333059310913, -0.4845658242702484, 0.04677613824605942, 0.5223472118377686, -0.3807063102722168, 0.21561811864...
My application is suspending on a line of code that appears to have nothing wrong with it, however my IDE appears to be suspending on that line with the error: > gdb/mi (24/03/09 13:36) (Exited. Signal 'SIGSEGV' received. Description: Segmentation fault.) The line of code simply calls a method which has no code in it...
[ 0.1787058562040329, 0.32418227195739746, 0.550137996673584, -0.19357028603553772, 0.02552461251616478, -0.046120863407850266, 0.6310697197914124, -0.037901900708675385, -0.4017597734928131, -0.3138463795185089, -0.11166183650493622, 0.2088509500026703, -0.35505223274230957, 0.4712864458560...
the line using the `read(...)` method is commented out, the problem goes away. ### Update: I have changed the question to point toward the actual problem, and I have removed all the irrelevant code - and I also [answered my own question](https://stackoverflow.com/questions/677444/why-is-my-c-code-causing-a-segmentati...
[ 0.3013193905353546, 0.43593600392341614, 0.5203498601913452, -0.11725544929504395, -0.018722500652074814, -0.003924453165382147, 0.3355932831764221, 0.16027678549289703, -0.3784915506839752, -0.2360072135925293, -0.2711901366710663, 0.5120561122894287, -0.31672409176826477, 0.2661599814891...
BUFFER_SIZE); ``` or you can use calloc(1, BUFFER\_SIZE) to get some memory allocated (and zeroed out).
[ -0.21597997844219208, -0.008497949689626694, 0.15053008496761322, -0.2627681493759155, 0.2477094531059265, 0.24531769752502441, 0.026897752657532692, -0.075617216527462, -0.1690555065870285, -0.610718309879303, -0.21149656176567078, 0.49454715847969055, -0.33313965797424316, 0.121071487665...
I'm using PHP to extract data from a MySQL database. I am able to build an XML file using DOM functions. Then using `echo $dom->saveXML();` , I am able to return the XML from an AJAX call. Instead of using AJAX to get the XML, how would I save the XML file to a spot on the server? Thanks Use the [`DOMDocument::save()`...
[ 0.26675596833229065, 0.18838708102703094, 0.35460612177848816, -0.08389461785554886, -0.006391802337020636, -0.027284277603030205, 0.19868768751621246, -0.3376691937446594, -0.13092289865016937, -0.48683401942253113, -0.13063864409923553, 0.6381090879440308, -0.09342863410711288, 0.1329648...
I want to have client-side validation for quick response to the user without a roundtrip to the server. I also want the same validation for securing the code behind action ***on the business and data access layer***. How do you reuse that kind of code pragmatically in ASP.NET? (note: ASP.NET, C# 3.0, .NET 3.5, Visu...
[ 0.4901120662689209, 0.13975107669830322, 0.039323460310697556, 0.07696808874607086, -0.2670687437057495, -0.3426789939403534, 0.34505003690719604, -0.059690508991479874, -0.26369258761405945, -0.2573574185371399, -0.046844515949487686, 0.813529908657074, 0.0991397500038147, -0.126327186822...
kind of unification you're talking about is often too difficult to justify.
[ 0.3961353003978729, -0.034828078001737595, 0.006695973686873913, 0.0713227391242981, -0.1077745109796524, -0.1780991554260254, 0.13061633706092834, 0.237892746925354, -0.26730528473854065, -0.22576794028282166, -0.13385838270187378, 0.23724265396595, -0.33156275749206543, 0.402550160884857...
I am writing a webpart for MOSS 2007. I need to validate a text field in that webpart, or which I am using th required field validator. I am creating the required field validator as follows: ``` vldProjectError = new RequiredFieldValidator(); vldProjectError.ForeColor = Color.Red; vldProjectError.ErrorMessage = Reso...
[ -0.0835035890340805, 0.15128621459007263, 0.7035815715789795, -0.22924214601516724, 0.07719898223876953, -0.04347415640950203, 0.5016883015632629, -0.5059377551078796, 0.10912370681762695, -0.5981389880180359, -0.0050913202576339245, 0.7177421450614929, -0.24583521485328674, 0.117775194346...
validators in sharepoint webparts? Is there anything I am missing? I was able to solve the problem. we should use ``` txtProjectName.ID = "txtProjectName"; vldProjectError.ControlToValidate = txtProjectName.ID; ``` instead of ``` vldProjectError.ControlToValidate = txtProjectName.ClientID; ``` and this sh...
[ 0.08303938060998917, 0.10552677512168884, 0.26296037435531616, 0.1392964869737625, -0.10350661724805832, -0.16665397584438324, 0.2854763865470886, -0.5449795126914978, -0.0972844660282135, -0.11319897323846817, -0.1535116583108902, 0.6649296879768372, -0.21030734479427338, 0.09090506285429...
I am dealing with a master page split into various content placeholders as per usual. On a number of pages I use a multiview to show and hide the content based on different view modes (view / edit / add). This means one multiview per master page content placeholder... The trouble comes when I need to switch view modes...
[ 0.669672429561615, 0.40570637583732605, 0.22365722060203552, 0.39291486144065857, -0.14986002445220947, 0.032960109412670135, 0.3807585537433624, -0.16086439788341522, -0.30452537536621094, -0.5690280199050903, -0.10468349605798721, 0.39290913939476013, -0.3013157546520233, 0.5068974494934...
is a way to sync or link all multiviews on a page, so that when one changes - they all change accordingly? Like through some sort of master multiview? I've thought about using the View's Activate Event, but this would still mean doing a lot of wiring up to begin with, which is what I'm trying to avoid. C#eers! The be...
[ 0.6049474477767944, -0.22849462926387787, 0.1899888515472412, 0.1750349998474121, 0.043185971677303314, -0.15060020983219147, 0.08958593010902405, -0.08737660944461823, -0.5524849891662598, -0.6425324082374573, 0.09137521684169769, 0.5683653950691223, -0.3191090524196625, 0.181554615497589...
from MultiView for all your instances.
[ 0.5377205014228821, -0.051482535898685455, 0.08675285428762436, 0.3306789696216583, -0.18109209835529327, 0.027995582669973373, 0.38115423917770386, 0.33151164650917053, -0.22634032368659973, -0.9721725583076477, -0.13960519433021545, 0.6405342221260071, -0.49347618222236633, 0.50674200057...
I'm using Eclipse on Windows, with the PyDev plugin for Python development. When I use 'Run' to start my application, it spawns a new Python (CPython) instance. When I use the 'terminate' button (red square), it kills the process. However, it appears to do a SIGKILL, so my shutdown handler is unable to clean up. Is th...
[ 0.289388507604599, 0.010050187818706036, -0.0015751960454508662, -0.12733879685401917, -0.1466381847858429, -0.1901116967201233, 0.20505090057849884, 0.24032503366470337, -0.14300914108753204, -0.5208566188812256, 0.11972936242818832, 0.6064187288284302, -0.45616254210472107, 0.15456499159...
the Java Process API which sends the signal. This is a native API and there is no way to change that. I assume that you've tried to install a handler for SIGKILL, too, and that didn't work. Therefore, the only solution would be to write a small batch file which lists the processes and sends SIGTERM to one of them. Inv...
[ 0.18753507733345032, -0.24556712806224823, 0.03741804510354996, -0.01829521544277668, -0.2476535141468048, -0.1934552788734436, 0.08377619087696075, 0.03977082297205925, -0.17028044164180756, -0.6135334372520447, 0.25459903478622437, 0.6301669478416443, -0.4404468238353729, -0.086723797023...
I have a situation where before doing a particular task I have to check whether a particular flag is set in DB and if it is not set then rest of the processing is done and the same flag is set. Now, in case of concurrent access from 2 different transactions, if first transaction check the flag and being not set it proc...
[ -0.008460680022835732, -0.1107167899608612, -0.02865818329155445, 0.16663619875907898, -0.37413403391838074, -0.13476945459842682, 0.24671107530593872, -0.3844151496887207, -0.4165751039981842, -0.542411208152771, -0.021677620708942413, 0.22139385342597961, -0.518535315990448, 0.2810720503...
transaction completes its processing and set the flag. I wanted to implement it at the DB level with locks/hints. But no hint restrict SELECT queries and I cannot go for Isolation level restrictions. You can create an [Application Lock](http://weblogs.sqlteam.com/mladenp/archive/2008/01/08/Application-Locks-or-Mutexe...
[ -0.245130717754364, -0.013804401271045208, 0.4948902130126953, 0.04347290098667145, 0.11383595317602158, -0.23791541159152985, 0.2230895757675171, -0.4610992968082428, -0.39124929904937744, -0.30547988414764404, -0.2505461573600769, 0.11126672476530075, -0.3378993272781372, 0.2209216654300...
I have a standard user/role setup which returns the current user's roles in a list. I then use the permissions="" attribute and the preFuseaction phase to check whether this user is authorised to access this fuseaction. This allows some blocks of a page to be displayed and some supressed for different users. I cannot ...
[ -0.03330415114760399, 0.1369568407535553, 0.6846135258674622, -0.13684265315532684, -0.06252164393663406, 0.15595470368862152, 0.08105766773223877, -0.39623913168907166, -0.017535626888275146, -0.850182056427002, -0.24409915506839752, 0.48462578654289246, -0.4035419523715973, 0.09012909233...
'admin' role. If a normal user clicks on this link, they don't get anywhere, because when the fuseaction is actually run, it kicks them out. I would rather that the link wasn't there in the first place. This can be done by hardcoding the roles into the .cfm files, so: ``` <ul> <li><a href="#xfa.mainmenu#>Main Menu...
[ 0.21109779179096222, 0.08973249793052673, 0.4622076153755188, -0.03095373883843422, -0.19341598451137543, -0.223882794380188, -0.042352642863988876, -0.5253686308860779, 0.12491603940725327, -0.5699692964553833, -0.12548071146011353, 0.7430989742279053, -0.5665727257728577, -0.132275596261...
Fusebox creates? Don't compare to true - it's an unnecessary waste of time... ``` <cfif checkRole('admin') >...</cfif> ``` However, in the display file I would do simply this: ``` <cfif StructKeyExists( Xfa , 'AdminMenu' )> <li><a href="#xfa.adminmenu#>Admin Menu</a></li> </cfif> ``` Then, within your circuit...
[ 0.21283400058746338, 0.041586536914110184, 0.3502860963344574, -0.18287043273448944, 0.09979503601789474, -0.07551737874746323, 0.2638637125492096, -0.6595046520233154, 0.2617218792438507, -0.8185513615608215, -0.1459616720676422, 0.46216249465942383, -0.7515797019004822, -0.22482682764530...
<if condition="checkRole('admin')"> <true> <do action="AdminMenuLinks"/> </true> </if> ... </fuseaction> ``` Which is a bit ugly, but should work. Of course, if you only have a single XFA, you can just use that directly rather than doing the separate fuseactions, but if you have multiple XF...
[ 0.4828752279281616, 0.07528290152549744, 0.3404287099838257, 0.14521647989749908, 0.04710714891552925, -0.3280574679374695, 0.08150360733270645, -0.4184238612651825, 0.0012273831525817513, -0.8007221221923828, -0.19176487624645233, 0.2969607710838318, -0.6783251762390137, -0.17874462902545...
I've been wrestling with Project Euler [Problem #16](http://projecteuler.net/index.php?section=problems&id=16) in C# 2.0. The crux of the question is that you have to calculate and then iterate through each digit in a number that is 604 digits long (or there-abouts). You then add up these digits to produce the answer. ...
[ 0.1982574611902237, 0.434994637966156, 0.2048874795436859, -0.05490357428789139, -0.1985078901052475, 0.16975858807563782, 0.16134652495384216, -0.26834383606910706, -0.32967817783355713, -0.12848296761512756, 0.13149797916412354, 0.2924920618534088, -0.21848392486572266, -0.06909193843603...