text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
a second search with different parameters.
You should separate the code for your order search from the code that builds the SQL. The SQL should be built in a derivative (or [Strategy](http://en.wikipedia.org/wiki/Strategy_pattern) derivative) of the `OrderSearch` class. Once you have made this separation, it doesn't re... | [
0.02350687049329281,
-0.3888590335845947,
0.2068473994731903,
-0.009806284680962563,
-0.2508634924888611,
-0.14113309979438782,
0.03910370543599129,
-0.20904158055782318,
-0.1377735733985901,
-0.6168152689933777,
-0.05464205518364906,
0.49840283393859863,
-0.5453990697860718,
-0.0330328345... | |
subclass. This is very important. This independence allows you to disregard whether the SQL is built in the setter methods, or in the search method. See [The Dependency Inversion Principle (DIP)](http://www.objectmentor.com/resources/articles/dip.pdf).
Once you have this kind of seperation, you can replace the derivat... | [
0.2669723629951477,
-0.17782345414161682,
-0.007983949035406113,
0.28127923607826233,
-0.23468632996082306,
-0.19427254796028137,
0.4557487964630127,
-0.44084060192108154,
-0.34606772661209106,
-0.3626340925693512,
0.06226705014705658,
0.5885592699050903,
-0.3935348391532898,
0.31572413444... | |
database connections, pre-existing data, etc. | [
0.12249456346035004,
0.06520445644855499,
0.20900170505046844,
0.5511490702629089,
0.47627243399620056,
-0.31557586789131165,
-0.16190986335277557,
0.14961348474025726,
-0.443917840719223,
-0.6371241211891174,
-0.33695024251937866,
0.08200525492429733,
-0.053809333592653275,
0.379967987537... | |
I am fairly new to ASP.NET. I recently set up automated email from my website to notify me of an unhandled exceptions. Just a few hours ago in 3 minutes there were 10 unhandled exceptions and all stack traces were similar. There is a lot in the error messages I do not understand, but I do not like the way this looks.
... | [
0.10026834160089493,
0.1255403310060501,
0.3013218343257904,
-0.25815457105636597,
-0.094447061419487,
-0.17794297635555267,
0.5137239098548889,
-0.2796601355075836,
-0.4760374128818512,
-0.7979751825332642,
0.189469113945961,
0.3570442497730255,
-0.03650882467627525,
-0.07322767376899719,... | |
at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, I... | [
-0.04780270531773567,
-0.13346759974956512,
0.2906199097633362,
-0.004898318089544773,
-0.002500516129657626,
0.009797937236726284,
0.6001724600791931,
-0.5549106001853943,
-0.20689044892787933,
-0.5311552286148071,
-0.35857343673706055,
0.47443345189094543,
-0.15343651175498962,
-0.047470... | |
determine, especially when not occuring in a web farm.
IE 5.5 was not causing the problem as I had earlier thought.
It was not easily found, but a post on my web host forum by one of the staff mentioned reports of Viewstate errors. The cause was attributed to the asp worker process or the server recycling.
The asp... | [
0.10058603435754776,
-0.24914294481277466,
0.05913560092449188,
-0.21012309193611145,
0.4305973947048187,
0.296365886926651,
0.42077741026878357,
-0.13645587861537933,
-0.018237179145216942,
-0.7628651261329651,
0.1245233416557312,
0.483690083026886,
-0.22932426631450653,
0.004493333399295... | |
and solved the problem thanks to the handy ASP.NETResources site which has a MachineKey Generator. See <http://www.aspnetresources.com/tools/keycreator.aspx>.
This exception is thrown when the assembly resource handler gets an invalid request. It is unlikely this is related to any malicious activity; it's usually cause... | [
0.12928488850593567,
-0.07482936978340149,
-0.04772057756781578,
0.1828889697790146,
0.06630471348762512,
0.17501987516880035,
0.3622170686721802,
-0.05984345078468323,
-0.7065770626068115,
-0.680584728717804,
-0.3345346450805664,
0.2097330391407013,
-0.08194919675588608,
0.032967269420623... | |
resource, which might expose clues about how your code works. Instead, it uses information in the machine.config on the server to encrypt a unique identifier to the resource. This exception gets thrown when a resource is requested, but when the server tries to decrypt the identifier provided, it fails. | [
0.07468489557504654,
-0.09510673582553864,
-0.08692903816699982,
0.5339815020561218,
0.13336770236492157,
-0.07856511324644089,
0.24795427918434143,
-0.039441224187612534,
-0.28327423334121704,
-0.67457515001297,
0.028011133894324303,
0.34594467282295227,
-0.23944926261901855,
0.2228452414... | |
I have a PHP application where I would like to certain objects to persist in the following manner:
1. The object must not exist in the $\_SESSION. Separate web browser windows must control separate instances of the object.
2. The end-user must not be able to modify the object by changing the content of the $\_REQUEST ... | [
0.4599458873271942,
0.3829509913921356,
0.1579809933900833,
-0.09982622414827347,
-0.18036071956157684,
-0.4351235330104828,
0.4027659595012665,
0.2815609276294708,
0.0021995448041707277,
-0.35778945684432983,
0.24890364706516266,
0.5252732634544373,
-0.17480941116809845,
0.529740631580352... | |
the creation and manipulation of complex objects without using a database until they are to be committed, then I will use a proper transaction to commit them to the database in full. I want to make it so that my database contains only the complete invoice, or no invoice at all.
My current method is as follows:
```
<?... | [
-0.11426045000553131,
0.25510504841804504,
0.4997391700744629,
-0.16076882183551788,
0.053843140602111816,
0.098270945250988,
0.5785576701164246,
-0.3529885709285736,
-0.14856469631195068,
-0.5407013297080994,
-0.20832164585590363,
0.4467064440250397,
-0.48503348231315613,
0.08562299609184... | |
$invoice->addLine(new invoiceLine($_REQUEST['description'], $_REQUEST['qty'], $_REQUEST['unitprice']);
}
?>
<form action="index.php" method="post">
<input type="text" name="qty" />
...
<input type="hidden" name="invoice" value="<?php echo(base64_encode(encrypt(serialize($invoice)))); ?>" />
</form>
```
You could also... | [
0.43047383427619934,
0.27533188462257385,
-0.3043135702610016,
-0.07759936898946762,
0.37333056330680847,
0.3559578061103821,
0.2013269066810608,
-0.22492298483848572,
-0.15186089277267456,
-0.5635665059089661,
-0.05565565824508667,
0.2705058157444,
-0.1808876395225525,
0.25045379996299744... | |
My company is building an ASP.NET HR application and we have decided to create one database per client. This ensures that clients cannot accidentally view another client's data, while also allowing for easy scalability (among other benefits, already discussed [here](https://stackoverflow.com/questions/13348/what-are-th... | [
0.3428851366043091,
0.39814627170562744,
0.22621190547943115,
-0.048634737730026245,
0.2990306615829468,
0.08495599776506424,
-0.12310917675495148,
-0.09287633001804352,
-0.4042511284351349,
-0.4923974275588989,
0.09348957240581512,
0.523459792137146,
-0.05708082765340805,
0.21039068698883... | |
each individual client database, but others on my team feel that the lack of security on each database is a huge hole (but they cannot articulate how duplicating the common access logic would be useful).
Am I missing something? Should we add an extra layer of security/authentication at the client database level?
**Up... | [
0.1291414201259613,
0.020775293931365013,
0.3412429392337799,
0.21145999431610107,
0.10174121707677841,
-0.09540480375289917,
0.1719522476196289,
0.008310412056744099,
-0.44517531991004944,
-0.6654219627380371,
-0.08917617052793503,
0.7326440811157227,
-0.22210751473903656,
0.0995716154575... | |
it still seems feasible for this to be in a central database, but my team doesn't agree. Thoughts?
I've always been of the opinion that security should be enforced at the application level, not the database level. With that said, I see no problem with your intended approach. Managing accounts and roles through a centra... | [
0.4412471652030945,
0.27889275550842285,
0.052163463085889816,
0.07087066769599915,
0.2667882740497589,
-0.18407289683818817,
0.25455889105796814,
0.030378222465515137,
-0.22617316246032715,
-0.4020812213420868,
0.13233140110969543,
0.5661253929138184,
-0.26766255497932434,
0.0147265624254... | |
Visual studio debugger hangs while loading symbols for my application(native IA64), SP1 is installed. This started to occur, after i install debugging tools for windows(64 bit version), and reboot my computer. This issue is not depend on my project, even with new project debugger hangs.
**UPDATE:**
When i try to atta... | [
0.3529185354709625,
-0.034135159105062485,
0.160786435008049,
-0.05851273983716965,
-0.25397732853889465,
-0.355139821767807,
0.4337419271469116,
-0.09122295677661896,
-0.2752479910850525,
-0.6179983615875244,
-0.18956626951694489,
0.5378188490867615,
-0.21504464745521545,
0.17584373056888... | |
I'm looking for an IDE with use with the [Symfony Framework](http://www.symfony-project.org).
I have a bit of experience using the [NetBeans 6.5 IDE](http://www.netbeans.org) but it does not always seem to complete the class methods, plus it doesn't seem to have any PHP code snippets built in.
Here are the features I... | [
0.31917905807495117,
0.056225620210170746,
0.2414819449186325,
0.2799084782600403,
-0.06737245619297028,
-0.18868587911128998,
0.14915773272514343,
0.04256322607398033,
-0.18017014861106873,
-0.680554211139679,
0.10249601304531097,
0.5033791661262512,
-0.08542681485414505,
0.06017195060849... | |
with Zend Studio 5.5's debugging and inspection features for the time being. | [
0.04942001402378082,
-0.09274201095104218,
0.34564515948295593,
0.08002353459596634,
-0.06559304147958755,
-0.41260385513305664,
0.2952003479003906,
-0.14518925547599792,
0.13605599105358124,
-0.26737678050994873,
-0.24388034641742706,
0.4202280640602112,
-0.09747499972581863,
0.0497702807... | |
In my app I have a drill-down type interface as follows:
My root view, which has a list of items and an "Add" button.
Selecting an item pushes the "Detail" view on the navigationController.
Selecting the "Add" button pushes an "Add" view.
How would I transition between the Add view to the Detail view?
I'm th... | [
0.3447241187095642,
-0.323111891746521,
0.5819193124771118,
0.1532353311777115,
0.10855424404144287,
0.4756949543952942,
0.2530989348888397,
0.07856357097625732,
-0.3294512629508972,
-0.7106235027313232,
0.04868990555405617,
0.5905558466911316,
-0.05616118386387825,
-0.03503355383872986,
... | |
pages MapPath method:-
```
ctl.SaveAs(MapPath("~/UserFiles/[username]/[filename]"));
``` | [
-0.23288148641586304,
-0.018902022391557693,
0.5661205649375916,
0.030182478949427605,
0.05688374489545822,
0.037189215421676636,
0.04644832760095596,
0.27991390228271484,
-0.28130587935447693,
-1.1337676048278809,
-0.5357385873794556,
0.3626973628997803,
-0.40828073024749756,
-0.025373212... | |
I have an application that requires .NET Framework 3. I am planning to deploy the application using a Setup Kit built by VS2005 deployment project.
What is the best practice to include the last known .NET version (3.5 SP1 in my case) bootstrapper with the deployment package or include exactly what my project needs (.... | [
0.44394010305404663,
0.04726266860961914,
0.22798869013786316,
0.042352087795734406,
-0.019957154989242554,
-0.42796048521995544,
0.366206556558609,
-0.24561114609241486,
-0.07140681147575378,
-0.7808502912521362,
-0.03740444779396057,
0.6433950662612915,
-0.20797231793403625,
-0.229008734... | |
which simplifies your deployment. And installing 3.0 on a 3.5SP1 machine will just skip the installation, so no harm in shipping 3.0.
I'd still deploy 3.5SP1 because of the bug fixes and performance improvements, and because 3.5SP1 is completely backward-compatible to 3.0. | [
0.11692527681589127,
0.06989841908216476,
0.5276098847389221,
0.018713632598519325,
0.06156584620475769,
-0.19063664972782135,
0.4774768650531769,
-0.05481487512588501,
-0.14473938941955566,
-0.46972015500068665,
-0.08861362189054489,
0.7964222431182861,
-0.38342365622520447,
-0.3248361945... | |
If the user selects an option in a dropdown box, there must be added a label and a textbox. Using `appendChild`, these elements get added to the end of the `container`.
```
var newFreeformLabel = document.createElement('label');
newFreeformLabel.innerHTML = 'Omschrijving:';
var newFreeformField = document.createEleme... | [
-0.10223039984703064,
-0.21790073812007904,
0.6568781733512878,
-0.09813648462295532,
0.5273087024688721,
-0.006722084246575832,
0.09925378113985062,
-0.27689164876937866,
-0.07871729135513306,
-0.5869739055633545,
-0.7504318356513977,
0.49199482798576355,
-0.33006858825683594,
0.268996417... | |
I need the openssl lib for some C code in my iPhone App.
So I've put the lib into my project.
But when I compile it, Xcode throws me some errors:
> error: openssl/ssl.h: No such file or directory
That's my code for including:
```
#include <openssl/ssl.h>
```
Target settings in Xcode:
[alt text http://img17.imag... | [
0.17966939508914948,
0.4936622083187103,
0.4622904360294342,
-0.12461674958467484,
0.0019955483730882406,
-0.22751484811306,
0.5167932510375977,
-0.07388051599264145,
-0.14802971482276917,
-0.8269145488739014,
-0.24255551397800446,
0.3534938097000122,
-0.4140700697898865,
0.144928157329559... | |
I need an sql query that will retrieve all items that have both tags, not any of tags. I already have a query but returns all items that hove both tags, not expected result. Find detailed description below. Thanks!
Table structure:
```
ITEMS TABLE
------------
item_id
item_name
TAGS TABLE
----------
tag_id
tag_name
... | [
-0.2567310035228729,
0.08290747553110123,
0.5576617121696472,
0.17969520390033722,
-0.11446256190538406,
0.1981901228427887,
0.053188640624284744,
-0.4345325827598572,
-0.2832033634185791,
-0.7725489735603333,
-0.11925466358661652,
0.44041508436203003,
-0.07325214147567749,
0.2739522755146... | |
I have a silverlight application, which requires charts with printing. As silverlight does not support printing, I was thinking of including some flash charts inside my application. I know it sounds weird.... But is it possible?
Hey.. Check [this](http://forums.asp.net/t/1211511.aspx) .The second post talks about embed... | [
0.7642232775688171,
0.34320172667503357,
0.058108728379011154,
0.04465712234377861,
0.029781464487314224,
-0.020472627133131027,
0.3551793396472931,
0.31130942702293396,
-0.4690972566604614,
-0.7029106616973877,
0.23473571240901947,
0.23426616191864014,
-0.29557231068611145,
-0.03509638085... | |
The following catch() is not called:
```
void test(void)
{
int i=1,j=0,k;
try
{
k = i/j;
}
catch(...)
{
...handle it...
}
}
```
Is there a way to catch this kind of exception?
below code implement \_\_try/\_\_except effect like in visual studio c++
or
how to simulate \_\_t... | [
0.10487479716539383,
-0.24987012147903442,
0.15831716358661652,
-0.13849171996116638,
0.028345298022031784,
-0.013701943680644035,
0.1657879799604416,
-0.2274225652217865,
-0.25467753410339355,
-0.39878806471824646,
-0.19907371699810028,
0.29622945189476013,
-0.47938039898872375,
0.1457087... | |
//jmp to setjmp_return and rc will equal to non zero
longjmp(*gThreadData, 10001);
}
int main(int argc, char *argv[])
{
//setup a callback function for access violation exception
signal(SIGSEGV, (__sighandler_t)FPE_ExceptionHandler);
//allocate a jmp_buf struct and assign it to thread local storage po... | [
-0.2130327969789505,
-0.1923595517873764,
0.7448658347129822,
-0.24687039852142334,
0.13215968012809753,
0.39346063137054443,
0.38408735394477844,
-0.5029348731040955,
-0.3559598922729492,
-0.3726145625114441,
-0.223031148314476,
0.4697452783584595,
-0.5709599256515503,
0.27415087819099426... | |
{
*(int*)0 = 1; //generate a exception
}
printf("return from exception\n");
delete (jmp_buf *)gThreadData;
}
``` | [
-0.14211440086364746,
0.05639411509037018,
0.12211748957633972,
-0.31672486662864685,
0.2068692445755005,
0.01103605143725872,
0.46052220463752747,
-0.11639685928821564,
-0.14796115458011627,
-0.25792983174324036,
-0.571692168712616,
0.5696468353271484,
-0.44779878854751587,
0.245226666331... | |
Hy,
as we all know, developing a multithreading application is a hard thing. Especially the point when and what to lock is not so obvious IMHO. Often I'm looking at a method / class and I must ask myself, if I share some data, which can be modified by multiple threads. And when I'm not sure it ends in a lock( ) over a... | [
0.36052364110946655,
0.20405468344688416,
0.0808030292391777,
0.3441599905490875,
-0.06684577465057373,
-0.2945041060447693,
0.033529940992593765,
-0.1329774260520935,
-0.44713294506073,
-0.5062713027000427,
-0.17958450317382812,
0.27102527022361755,
-0.3175908625125885,
0.2047090530395507... | |
they lock the field.)
* Reference type'd parameters of a method should not be passed "directly". Always pass a clone.
By the way:
Microsoft Research is working on [**CHESS**](http://research.microsoft.com/en-us/projects/chess/). A tool for finding and reproducing Heisenbugs in concurrent programs. I hope this and PLI... | [
0.3256222903728485,
0.16243119537830353,
0.13666687905788422,
0.19912166893482208,
-0.011766063049435616,
-0.2990592420101166,
0.08405940234661102,
-0.0011360857170075178,
-0.3090779483318329,
-0.5840522646903992,
0.13966216146945953,
0.16836237907409668,
-0.3922252357006073,
0.46063435077... | |
(currently) have immutable collections built into the .NET framework, althoughthere are third party ones around, [including one by our own JaredPar](http://code.msdn.microsoft.com/BclExtras). | [
0.4552595019340515,
0.20064057409763336,
-0.0007909408304840326,
0.13153085112571716,
0.08938512951135635,
0.030858656391501427,
0.2411222904920578,
0.07328259944915771,
-0.6174945831298828,
-0.1565769910812378,
-0.21599939465522766,
0.04705451428890228,
-0.005949499551206827,
0.0896246060... | |
I'm quite new to Java and from Python and PHP, I'm used to default values for function parameters.
So I have a habit of writing methods that are designed to be called from slightly different situations where you want to set only some of the values. For example, in my PHP code, this would be common where I have factory... | [
0.4536811113357544,
0.19255796074867249,
-0.06004244461655617,
-0.13574522733688354,
-0.2930164039134979,
-0.11121054738759995,
0.27156150341033936,
-0.012155469506978989,
-0.025525100529193878,
-0.43239063024520874,
0.29834112524986267,
0.7216158509254456,
-0.3924363851547241,
-0.34572935... | |
some provided by the caller. Which is, well, OK, but can get on my nerves sometimes.
I remember that this already annoyed me in some brief excursions to C++ and ActionScript. Now, do more experienced Java developers have some shortcut for this?
*It seems to me that, technically, the question has been answered by the ... | [
0.38522541522979736,
0.04937269911170006,
0.31603705883026123,
0.12936918437480927,
-0.23886433243751526,
0.14616051316261292,
0.3517681658267975,
0.2904181182384491,
-0.2109650820493698,
-0.4708632826805115,
-0.23409169912338257,
0.3710196912288666,
0.2644989788532257,
0.11962739378213882... | |
is", except:
Similar effects could be achieved with [varargs](http://java.sun.com/developer/JDCTechTips/2005/tt0104.html#1) as suggested by Paul Whelan or by defining an extra type carrying the parameters as fields with the proper default values as suggested by Jon Skeet. Boris Pavlović adds that his type could be an ... | [
0.02590988390147686,
-0.2757347524166107,
0.22144362330436707,
-0.12428272515535355,
-0.18845652043819427,
-0.06595951318740845,
0.21148055791854858,
-0.36422646045684814,
-0.08677875995635986,
-0.061422184109687805,
-0.4446300268173218,
0.4777693450450897,
-0.6599765419960022,
-0.29945302... | |
in the question, the method would have to perform various checks on the list in order to interpret it, which seems not more, but less convenient.
A special type carrying the parameters seems most useful if the resulting type could be of other uses than just being passed to one particular method, or when it is a more c... | [
0.37357115745544434,
0.026016129180788994,
0.1637798696756363,
0.26371169090270996,
-0.10271217674016953,
0.12445139139890671,
0.10151542723178864,
-0.48298463225364685,
-0.18285125494003296,
-0.23502829670906067,
-0.09463359415531158,
0.3969002962112427,
-0.23625659942626953,
-0.086545415... | |
I inherited an assembly with MSTest, but these tests were run using nunit-console on the build machine (not sure how it worked). So I decided to sort it out and change them to proper NUnit tests, but now nunit-console (or gui) can't find any tests. They run just fine using ReSharper test runner though. Any idea what co... | [
0.5047686100006104,
0.3083149194717407,
-0.3881111145019531,
0.18926504254341125,
-0.11086508631706238,
-0.20575106143951416,
0.4694380462169647,
0.010605611838400364,
-0.2885024845600128,
-0.6145580410957336,
0.15972784161567688,
0.3849780261516571,
-0.005714074708521366,
-0.0467471629381... | |
The following code does not produce an exception but instead passes the value 4 to tst. Can anyone explain the reason behind this?
```
public enum testing
{
a = 1,
b = 2,
c = 3
}
testing tst = (testing)(4);
```
In C#, unlike Java, enums are not checked. You can have any value of the underlying type.... | [
0.4971282184123993,
0.19821734726428986,
-0.05787191912531853,
-0.11184515804052353,
-0.11226103454828262,
-0.22974447906017303,
0.5005326271057129,
-0.33277684450149536,
-0.13942140340805054,
-0.39510732889175415,
-0.22584645450115204,
0.46672800183296204,
-0.3138705790042877,
0.116233438... | |
I love stackoverflow and I love my new [Kindle](http://www.amazon.com/kindle) and I'm looking to bridge the gap.
Anybody devised a clever way to do this?
Disclaimer: Yes i know this is not technically a programming question but theres always so many things on here I want to read but want to do it out by the pool and ... | [
0.5004236698150635,
-0.15663835406303406,
0.6041899919509888,
0.271624892950058,
-0.11857061088085175,
-0.33114442229270935,
0.13122707605361938,
0.03263682872056961,
-0.6130753755569458,
-0.4620417654514313,
0.028866171836853027,
0.29912877082824707,
0.22457832098007202,
-0.00551510229706... | |
I am trying to change the colour theme of an old VB6 application (make it look a bit more modern!).
Can someone tell me how I could change the backcolor of every control on a form without doing it for each and every control (label, button, frame etc!).
I have about 50 forms, all containing such controls and doing thi... | [
0.9792702794075012,
-0.002103588078171015,
0.29988738894462585,
-0.007447856944054365,
0.024232858791947365,
0.023696858435869217,
0.12873463332653046,
-0.018694991245865822,
-0.1867842674255371,
-0.4940588176250458,
0.1574060320854187,
0.6355584263801575,
-0.3729674220085144,
0.2674473226... | |
frmThing as Form
Dim ctlThing as Control
For Each frmThing In Forms
frmThing.BackColor = vbYellow
For Each ctlThing In frmThing.Controls
If (TypeOf ctlThing Is TextBox) Or _
(TypeOf ctlThing Is CheckBox) Or _
(TypeOf ctlThing Is ComboBox) Then
ctlThing.BackColor = vbYellow
End If
Next
N... | [
0.042916033416986465,
-0.3082315921783447,
0.950177013874054,
-0.1993415355682373,
-0.38840991258621216,
0.012598572298884392,
0.2516897916793823,
-0.4976879358291626,
0.043894004076719284,
-0.5284927487373352,
-0.35712775588035583,
0.5878710150718689,
-0.42857831716537476,
-0.007508613169... | |
Learning Java, so be gentle please. Ideally I need to create an array of bytes that will point to a portion of a bigger array:
```
byte[] big = new byte[1000];
// C-style code starts
load(file,big);
byte[100] sub = big + 200;
// C-style code ends
```
I know this is not possible in Java and there are two work-ar... | [
-0.021504977717995644,
-0.37563467025756836,
-0.12026951462030411,
0.09348879009485245,
-0.15207907557487488,
-0.4552036225795746,
0.43930473923683167,
-0.03844465687870979,
-0.23962518572807312,
-0.7996249198913574,
0.06806240975856781,
0.3533223569393158,
-0.23013563454151154,
-0.3045771... | |
structure.
The task I am trying to solve is to load a file into memory an then gain read-only access to the records stored withing the file through a class. The speed is paramount, hence ideally I'd like to avoid copying or accessor methods. And since I'm learning Java, I'd like to stick with it.
Any other alternativ... | [
0.22060656547546387,
0.2286279946565628,
-0.15482006967067719,
0.0572006031870842,
-0.2309514433145523,
-0.26024115085601807,
-0.08992795646190643,
-0.2023768126964569,
-0.5301098823547363,
-0.6614665985107422,
-0.12034963816404343,
0.33188170194625854,
-0.2655995488166809,
0.2308291792869... | |
instance:
```
ByteBuffer subBuf = ByteBuffer.wrap(big, 200, 100).slice().asReadOnlyBuffer();
```
No copying involved (some object creation, though). As a standard library class, I'd also assume that ByteBuffer is more likely to receive special treatment wrt. "JIT" optimizations by the JVM than a custom one. | [
0.15828362107276917,
0.06316617876291275,
0.09054023027420044,
-0.2531089782714844,
-0.3385446071624756,
-0.17781415581703186,
0.3589573800563812,
-0.014783446677029133,
-0.39942440390586853,
-0.5429205894470215,
-0.2549145817756653,
0.39193233847618103,
-0.4015653729438782,
0.181751444935... | |
Is there any difference in performance when running two executables with mono in linux, if:
1) the one executable has been compiled from c# source code previously in windows (e.g.VS).
2) the other executable has been compiled from the same source with gmcs in linux.
It shouldn't matter from mono runtime's perspectiv... | [
0.3417675793170929,
-0.16994856297969818,
-0.28145188093185425,
0.3433540165424347,
-0.1390708088874817,
-0.22937491536140442,
0.0930662751197815,
-0.32070502638816833,
-0.3050057888031006,
-0.49883443117141724,
-0.19397275149822235,
0.6846286654472351,
-0.36559751629829407,
-0.30167829990... | |
What's the easiest way to convert a `BindingList<T>` to a `T[]` ?
EDIT: I'm on 3.0 for this project, so no LINQ.
Well, if you have LINQ (C# 3.0 + either .NET 3.5 or [LINQBridge](http://www.albahari.com/nutshell/linqbridge.aspx)) you can use `.ToArray()` - otherwise, just create an array and copy the data.
```
T[] arr... | [
0.5581477880477905,
0.0008814505417831242,
0.49274900555610657,
-0.1633080095052719,
-0.13307951390743256,
-0.17728814482688904,
0.05703037232160568,
-0.5036450624465942,
-0.3707599937915802,
-0.5392227172851562,
0.11412008851766586,
0.4600391387939453,
-0.6350138187408447,
0.1104923412203... | |
I have been having problems working with dates. I need to have a DateTime instance that has the "dd-MM-yyyy" format. I'm NOT asking to have a string of my date instance in the "dd-MM-yyyy", that I know.
I need to seed my date obj through the Entity framework, that calls a stored procedure that receives a param that i... | [
0.22444847226142883,
-0.13037043809890747,
0.6896668076515198,
-0.21572653949260712,
0.06938910484313965,
0.0590803325176239,
-0.001853875583037734,
0.022316448390483856,
-0.28733688592910767,
-0.1923922598361969,
-0.04578334093093872,
0.5373052954673767,
-0.283150315284729,
0.417169839143... | |
As Date = DateTime.ParseExact(sdate, CurrentUICulture.DateTimeFormat.ShortDatePattern, CurrentUICulture) 'sdate = 19/03/2009
'CurrentUICulture = pt-PT - ShortDatePattern = "dd-MM-yyyy"
'odate is 03/19/2009 !!!
Convert.ToDateTime(sdate, CurrentUICulture)
'its the same!
```
HELP!
Problem solved...because, there was no... | [
-0.1404929906129837,
-0.06290127336978912,
0.905409038066864,
-0.23529593646526337,
0.010716395452618599,
-0.028957834467291832,
0.4361218512058258,
0.13352906703948975,
-0.5260180234909058,
-0.35567596554756165,
-0.06451959908008575,
0.3089008033275604,
-0.1037006676197052,
0.486356616020... | |
I have to produce a versioning system to store multiple versions of my articles in a database to allow the user to roll-back if required. My first thoughts are when the user wants to edit an article really I get the sql to no longer update but you insert their information back into the database. Currently the problem i... | [
0.45580577850341797,
0.5819527506828308,
0.4135018289089203,
-0.06496979296207428,
-0.07202347368001938,
-0.1873742938041687,
0.21467196941375732,
-0.025344736874103546,
-0.2592971920967102,
-0.6587061285972595,
0.29273420572280884,
0.35788410902023315,
-0.25952064990997314,
0.559885263442... | |
thinking I need a new table for the older articles but then I have problem of the originals in that first table dbArticles, I also need so why of telling which article they have choosen, for example if they have 3 edits so 3 articles lets all made on seperate days may 1st,2nd and 3rd how I need to show they have choose... | [
0.5896733403205872,
0.0267669428139925,
0.5899458527565002,
0.03727003559470177,
-0.39406609535217285,
-0.1824812889099121,
0.2971799075603485,
0.13252848386764526,
-0.07231864333152771,
-0.9673668146133423,
0.03955790773034096,
0.7012492418289185,
0.2410092055797577,
-0.08890113234519958,... | |
2 tables:
* article: here you store article\_id, article name and any other meta data
* article\_version: Here you store each version of the article (including the original one) and link with article\_version.article\_id=article.article\_id. Be sure to add a timestamp and version etc in this table. | [
0.061619214713573456,
0.04729597270488739,
0.3403807282447815,
-0.12563563883304596,
-0.032582756131887436,
-0.2615269720554352,
-0.024067316204309464,
-0.2026398628950119,
-0.06842782348394394,
-0.8903754353523254,
-0.32408565282821655,
0.31488534808158875,
-0.5226916074752808,
0.01102002... | |
I've got a really frustrating problem with a web application I work on (I didn't originally write it). It uses frames for the layout scarily enough. The problem I'm having is that all elements with a background colour and border set via CSS default to 100% width. I've just tested div elements, paragraph elements etc.
... | [
0.49196869134902954,
0.05422466993331909,
0.39560210704803467,
-0.031775496900081635,
-0.07751930505037308,
-0.15893995761871338,
0.21555179357528687,
-0.20543137192726135,
-0.3044843375682831,
-0.5747093558311462,
0.030495064333081245,
0.35613906383514404,
-0.3211120069026947,
0.180033728... | |
the same problem. Here's the example code.
```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#test {
border:1px solid #ccc;
background-color:#ddd;
}
</style>
</head>
<body>
<div id="test">
Te... | [
0.5028954148292542,
-0.021509822458028793,
0.36497482657432556,
0.06476306170225143,
-0.12471941858530045,
-0.05423231050372124,
0.1430143564939499,
-0.4194793701171875,
-0.4228634834289551,
-0.6781809329986572,
-0.02789829857647419,
0.2084876000881195,
-0.2317350059747696,
0.0196112859994... | |
I've got a list of files in an array. I want to enumerate those files, and remove specific files from it. Obviously I can't remove items from an array, so I want to use an `ArrayList`.
But the following doesn't work for me:
```
$temp = Get-ResourceFiles
$resourceFiles = New-Object System.Collections.ArrayList($temp)
... | [
0.2722303867340088,
0.10701771825551987,
0.10496640205383301,
-0.022102272137999535,
-0.10502322018146515,
0.08197985589504242,
0.19814634323120117,
-0.3831764757633209,
-0.5557042360305786,
-0.6691593527793884,
0.052445024251937866,
0.6649485230445862,
-0.4820709526538849,
0.0309722069650... | |
you just filter the wanted values into a fresh array?
**Edit:**
It seems that you can use the array constructor like this:
```
$resourceFiles = New-Object System.Collections.ArrayList(,$someArray)
```
Note the comma. I believe what is happening is that when you call a .NET method, you always pass parameters as an ... | [
0.21319063007831573,
-0.237159863114357,
0.14225170016288757,
-0.020565960556268692,
-0.05531958118081093,
-0.09676601737737656,
0.12670710682868958,
-0.19090528786182404,
-0.45803898572921753,
-0.6947447061538696,
0.06458102911710739,
0.6198309063911438,
-0.4704495966434479,
0.05501753464... | |
I think that is what is going on. | [
0.3575345575809479,
0.47819435596466064,
0.17445270717144012,
-0.19374383985996246,
0.15357279777526855,
-0.46911582350730896,
0.14800694584846497,
0.4551822245121002,
-0.1653108298778534,
-0.3330955505371094,
0.1566828042268753,
0.2970837950706482,
0.17769958078861237,
0.4058699905872345,... | |
I have a DataGrid which displays the available Classes and Methods in an Assembly.
Here i ave attached the picture of dataGrid
[alt text http://img150.imageshack.us/img150/5109/datagrid.png](http://img150.imageshack.us/img150/5109/datagrid.png)
Now my task is to Generate testCases based on the values in the DataGrid.... | [
0.2874912917613983,
0.13014529645442963,
-0.1552475243806839,
-0.02632838301360607,
-0.24296604096889496,
0.28506144881248474,
0.3084351122379303,
-0.5590266585350037,
0.17307448387145996,
-0.8102325201034546,
0.02111448533833027,
0.40223047137260437,
-0.21852172911167145,
0.12064040452241... | |
[Test()]
public virtual void Testadd1() {
Class1 Class1 = new Class1();
int a = 2147483647;
int b = 2147483647;
} | [
0.4785603880882263,
-0.20761965215206146,
-0.3842981457710266,
-0.07729648798704147,
0.2285923957824707,
0.13798025250434875,
0.6448894143104553,
-0.2020808756351471,
0.2039235383272171,
-0.5801623463630676,
-0.20564337074756622,
0.4813132882118225,
-0.43169739842414856,
0.2528820633888244... | |
[Test()]
public virtual void Testadd2() {
Class1 Class1 = new Class1();
int a = 2147483647;
int b = -2147483648;
} | [
0.4589793086051941,
-0.21130776405334473,
-0.3864278197288513,
-0.08683627098798752,
0.2196967452764511,
0.13901492953300476,
0.6205146312713623,
-0.23392727971076965,
0.19519636034965515,
-0.6035900115966797,
-0.22040404379367828,
0.48230981826782227,
-0.38300687074661255,
0.2182522416114... | |
[Test()]
public virtual void Testadd3() {
Class1 Class1 = new Class1();
int a = 2147483647;
int b = -2147483647;
}
[Test()] | [
0.44247907400131226,
-0.15746252238750458,
-0.32673391699790955,
-0.1551116704940796,
0.15588968992233276,
0.1008186787366867,
0.6370991468429565,
-0.2968112528324127,
0.1805052012205124,
-0.49531468749046326,
-0.21724744141101837,
0.4218709170818329,
-0.40285882353782654,
0.19274242222309... | |
public virtual void Testadd4() {
Class1 Class1 = new Class1();
int a = 2147483647;
int b = 2147483646;
}
}
}
```
Now the problem, all values in the DataGrid are as String. I need to convert into types like System.Reflection.MethodInfo, System.Type etc | [
0.16910763084888458,
-0.07377005368471146,
0.1384022831916809,
0.090699702501297,
0.20317675173282623,
0.06308215856552124,
0.43809279799461365,
-0.09835193306207657,
-0.13843154907226562,
-0.5617981553077698,
0.04586729779839516,
0.588903546333313,
-0.3576505184173584,
0.5358606576919556,... | |
so that i can generate such test cases?
How can I do it, or is there any other possibility to generate such testcases?
You shouldn't really take the values from the dataGrid itself, because this is just the UI control. Instead, you should find out where are they coming from (where the grid is populated) and hook up th... | [
0.5547497868537903,
-0.048065461218357086,
0.24304641783237457,
0.45598500967025757,
-0.0566190741956234,
-0.18153448402881622,
0.0657985508441925,
-0.21668677031993866,
0.07658284902572632,
-0.604057252407074,
0.0844573825597763,
0.3754135072231293,
-0.14833086729049683,
0.046457987278699... | |
I'm currently running a PHP based Content-Management-System that generates its HTML content with the help of [Markdown Extra](http://michelf.com/projects/php-markdown/extra/). Most of the content is structured by headings and sub-headings which results in a very long page. At the beginning of each page I create a table... | [
0.32371264696121216,
0.10424745082855225,
0.4262830913066864,
-0.01698865182697773,
-0.34037068486213684,
0.03339694067835808,
-0.21469232439994812,
-0.033241186290979385,
-0.4722735285758972,
-0.5149561762809753,
-0.1300467997789383,
0.3609459400177002,
0.07156948745250702,
0.153395578265... | |
expecting because [Markdown Extra](http://michelf.com/projects/php-markdown/extra/) is not wrapping the content of a section into a separate div-tag.
Is there a way how to make those two libraries work together?
### EDIT
This is what the HTML output is looking like:
```
<p>Some intro text...</p>
<h3>Table of cont... | [
0.012091116979718208,
-0.250593364238739,
0.5819717049598694,
0.04308463633060455,
-0.2865341007709503,
0.10467948764562607,
0.023916639387607574,
-0.3890625834465027,
-0.05885666608810425,
-0.6055606603622437,
-0.38659483194351196,
0.3818577229976654,
-0.22600609064102173,
-0.348872125148... | |
of this topic.
###Topic 2### {#sub2}
The content of this topic.
###Topic 3### {#sub3}
The content of this topic.
```
### Solution
With a little help of cobbal I made this jQuery statement that will transform the Markdown markup into something that the Tabs plugin will work with:
```
$("#tabs :header").each(fu... | [
0.06384337693452835,
-0.25761789083480835,
0.653581976890564,
-0.021826570853590965,
-0.4944668412208557,
-0.08776333183050156,
0.14452892541885376,
-0.1299227774143219,
-0.22792010009288788,
-0.39774805307388306,
-0.3603113293647766,
0.6085025072097778,
-0.3950953781604767,
0.090830989181... | |
div.append(this);
});
$(this).removeAttr("id");
div.attr("id", id);
$(this).before(div);
div.prepend(this);
});
```
But the fact that I need to transform the markup to fit the Tabs plugin rather than just tell the Tabs plugin that it should select its content in a different way may made this sol... | [
-0.0427025631070137,
-0.1217685118317604,
0.8718687295913696,
-0.24792568385601044,
0.030579086393117905,
-0.09114896506071091,
0.22817161679267883,
-0.28127023577690125,
-0.10219945013523102,
-0.647695004940033,
-0.6659547686576843,
0.5704204440116882,
-0.3457658290863037,
0.2738316953182... | |
The following code gives me an array of PSCustomObjects, how can I get it to return an array of Strings?
```
$files = Get-ChildItem $directory -Recurse | Select-Object FullName | Where-Object {!($_.psiscontainer)}
```
(As a secondary question, what's the psiscontainer part for? I copied that from an example online)
... | [
-0.008610633201897144,
0.09708121418952942,
0.5454347133636475,
0.04798598960042,
0.3449697196483612,
0.36626118421554565,
-0.016905905678868294,
-0.2180006355047226,
0.02610751986503601,
-0.4156447649002075,
-0.13294818997383118,
0.5756842494010925,
-0.13537554442882538,
-0.05709153786301... | |
What is that enumerating over?"
Sung Meister's explanation is very good, but I'll add a walkthrough here because it could be helpful.
The key concept is the pipeline. Picture a series of pingpong balls rolling down a narrow tube one after the other. These are the objects in the pipeline. Each stage of pipeline--the c... | [
0.3395380973815918,
-0.06243289262056351,
0.0018188541289418936,
0.30373379588127136,
0.05238618701696396,
0.2511541247367859,
-0.48548370599746704,
0.03594595566391945,
-0.032004620879888535,
-0.31865110993385315,
-0.0009781140834093094,
0.275166779756546,
-0.1249363124370575,
-0.01237443... | |
out into the output pipeline or sends out new, replacement objects.
```
Get-ChildItem $directory -Recurse
```
Get-ChildItem walks through the filesystem creating FileSystemInfo objects that represent each file and directory it encounters, and puts them into the pipeline.
```
Select-Object FullName
```
Select-Obje... | [
0.1365455985069275,
-0.016072949394583702,
0.42328011989593506,
-0.19758713245391846,
0.38845714926719666,
0.38484081625938416,
-0.25498735904693604,
-0.077028289437294,
-0.051212649792432785,
-0.6166229844093323,
-0.29632681608200073,
0.44040337204933167,
-0.3880450427532196,
0.0971880704... | |
here has a bug, by the way. The custom objects that arrive here don't have a psiscontainer property. This stage doesn't actually do anything. Sung Meister's code is better.
```
foreach {$_.FullName}
```
Foreach, whose long name is ForEach-Object, grabs each object as it arrives, and here, grabs the FullName property... | [
0.023568840697407722,
-0.13054335117340088,
0.2158469706773758,
-0.2268683910369873,
0.2877926528453827,
0.031894978135824203,
-0.032788004726171494,
0.13727186620235443,
-0.14804138243198395,
-0.5382007360458374,
-0.14294323325157166,
0.5172187089920044,
-0.5384190082550049,
0.08818220347... | |
output. There are four values in that code block. None of them are consumed. Notice that they all appear in the output. Now try this:
```
foreach {'hello'; $_.FullName; $ x = 1; 2; 3}
```
Notice that one of the values is being captured by a variable. It doesn't appear in the output pipeline. | [
0.06582328677177429,
0.0034551862627267838,
0.29209113121032715,
-0.15448954701423645,
0.12967278063297272,
-0.08969085663557053,
0.18798187375068665,
0.13393758237361908,
-0.10489614307880402,
-0.6001368761062622,
-0.3330708146095276,
0.5751794576644897,
-0.5159180760383606,
0.23106977343... | |
We're working on a PHP project, which has been in development for more than 2 years, and now the team is ready and feel the willingness to switch the development on to an ORM. Because it really speeds up the development and allow you to operate by Objects and not think in terms of SQL code and database tables most of t... | [
0.566689133644104,
0.3377690017223358,
0.2026219516992569,
0.32767775654792786,
0.08301655203104019,
-0.12125574052333832,
0.4918799102306366,
-0.3090430498123169,
-0.16872043907642365,
-0.25237149000167847,
0.08094462007284164,
0.4845353066921234,
0.33601805567741394,
-0.16421270370483398... | |
the site's performance. We can't make a shared connection between current database abstraction layer (which uses `pg_connect` syntax, not [PDO](http://en.wikipedia.org/wiki/PHP_Data_Objects)-compatible). The database connection mechanism can't be switched to PDO-compatible, because there are lots of SQL code incompatib... | [
0.2630583345890045,
0.14906679093837738,
0.33861401677131653,
0.2700148820877075,
-0.0538235642015934,
-0.16046400368213654,
0.15191736817359924,
0.17065905034542084,
-0.23050418496131897,
-0.6941800713539124,
0.21993930637836456,
0.5159642696380615,
-0.1759805828332901,
0.1436102092266082... | |
to use SQLite then I would make the legacy database layer PDO compatible and re-use the connections until you can fully migrate to Doctrine.
That said, the level of connections is not going to be your only performance concern moving to an ORM. They are inherently inefficient so I'd expect slower queries, higher bandwi... | [
0.44115376472473145,
0.36245256662368774,
0.3009900152683258,
0.2786966562271118,
-0.08236315101385117,
-0.17024679481983185,
0.12580454349517822,
0.04845631867647171,
-0.17530493438243866,
-0.7517972588539124,
0.2294355183839798,
0.6773841977119446,
-0.08306552469730377,
0.128549143671989... | |
because they are just traits of ORMs in general and not Doctrine in particular, with which I've had no experience. | [
0.6325666904449463,
0.5657912492752075,
-0.1003326028585434,
-0.05060778930783272,
0.07017271220684052,
0.16724848747253418,
0.515318751335144,
-0.03353399410843849,
-0.06683633476495743,
-0.31523972749710083,
-0.1760810911655426,
0.6389618515968323,
0.2556123435497284,
0.3357658386230469,... | |
How can I access a shadowed global variable in C? In C++ I can use `::` for the global namespace.
If your file-scope variable is not static, then you can use a declaration that uses extern in a nested scope:
```
int c;
int main() {
{
int c = 0;
// now, c shadows ::c. just re-declare ::c in a
... | [
-0.08483792096376419,
-0.2916290760040283,
0.5203403830528259,
-0.1462896168231964,
0.2641098201274872,
0.041480451822280884,
0.18333077430725098,
0.03897007927298546,
-0.1178513839840889,
-0.44850537180900574,
-0.007583208382129669,
0.581199049949646,
-0.42412251234054565,
-0.002484453376... | |
extern int c;
c = 1;
}
// outputs 0
printf("%d\n", c);
}
// outputs 1
printf("%d\n", c);
return 0;
}
```
If the variable is declared with static, i don't see a way to refer to it. | [
-0.12885695695877075,
-0.2348141074180603,
0.3145500421524048,
-0.4682002663612366,
-0.12284354120492935,
-0.006041443906724453,
0.2952132523059845,
0.03839763253927231,
0.2120622992515564,
-0.1313033103942871,
-0.27589699625968933,
0.6698061227798462,
-0.5602496862411499,
0.26657563447952... | |
I have to encrypt the output file in A application, then decrypt it in B application, but I found there are some limitations with MS encryption, if I encrypt a 1000 bytes buffer and then want to decrypt start for different position with different size in B application, the return values are error. Is there any encrypti... | [
0.002003319561481476,
0.40170878171920776,
0.3406248092651367,
0.13231784105300903,
0.2742292582988739,
0.18082313239574432,
0.25606197118759155,
-0.4495859444141388,
-0.08540143817663193,
-0.44483786821365356,
-0.09411027282476425,
0.5487999320030212,
-0.1246790885925293,
-0.1687793880701... | |
two possibilities:
1. Stream-ciphers. They encrypt one byte (or maybe even bit) at the time and you have to start at the beginning of the encrypted stream to decrypt it properly. Some ciphers have synchronization abilities that help you recover after some small error in the transmission.
2. Block-ciphers. They encrypt... | [
0.09861887246370316,
-0.3823842704296112,
-0.1362437903881073,
0.3139812648296356,
-0.05973033607006073,
-0.11122836917638779,
0.2511529326438904,
-0.08964721858501434,
-0.41931459307670593,
-0.3033941388130188,
-0.5635960698127747,
0.18048220872879028,
-0.5116034150123596,
0.1063491553068... | |
where an attacker knows some encrypted text and tries to find the key you used. CBC or some other mode with feedback is more secure, but in this case you need again to start decrypting at the beginning of your encrypted file.
Here are some relevant Wikipedia articles:
* [Block ciphers on Wikipedia](http://en.wikipedi... | [
0.00008336495375260711,
0.0848797932267189,
-0.009894047863781452,
-0.0901833325624466,
0.039794329553842545,
-0.32342904806137085,
0.5964866280555725,
-0.22732923924922943,
-0.4963473975658417,
-0.593001663684845,
-0.6210941672325134,
0.40598994493484497,
-0.17246362566947937,
-0.05448675... | |
**Update**: In fact, the only acceptable solution for this problem would be sorting the array ascending and then reversing it.
Let **S** be the following sequence of events:
```
Event | Time
A | 0:00
B | 0:01
C | 0:01
D | 0:02
```
I have a simple Comparator to sort **S**, which sorts the elements ac... | [
-0.3669164180755615,
-0.19532261788845062,
0.30121010541915894,
-0.23408670723438263,
-0.08187570422887802,
0.22440925240516663,
0.08119645714759827,
-0.4057166874408722,
-0.1337706446647644,
-0.5476402044296265,
-0.02179020829498768,
0.31174975633621216,
-0.42370492219924927,
0.1654402017... | |
return e2.getTime() - e1.getTime(); /* time is long */
return e1.getTime() - e2.getTime();
}
```
The problem is: when the sort order is ascending, **S** is sorted correctly: A, B, C, D.
But when I use reverse sorting, **S** becomes D, B, C, A:
```
Event | Time
D | 0:02
B | 0:01 /* B and C should be rev... | [
-0.5906421542167664,
-0.20754504203796387,
0.45973092317581177,
-0.31923240423202515,
0.20292241871356964,
0.05755415931344032,
0.25720226764678955,
-0.4092506170272827,
-0.3202875256538391,
-0.7315347194671631,
-0.4218694567680359,
0.26114514470100403,
-0.4570656418800354,
0.1362396925687... | |
I sort it reverse without keeping the original order?
**Note:** I know I can sort **S** ascending and further simply revert it, but unfortunately this is not an option in my case.
The sorting algorithm is correct: 0.01 is 0.01. Unless there's something you're not telling us. If however you want the exact reverse orde... | [
0.05918816104531288,
-0.01021078135818243,
0.3789539933204651,
-0.44040238857269287,
-0.15106578171253204,
0.2823884189128876,
0.2855806052684784,
-0.3445417881011963,
-0.2028813660144806,
-0.5623118281364441,
0.1790168434381485,
0.25400957465171814,
-0.42623206973075867,
0.046758294105529... | |
be "equal". Either include another field or add a synthetic one (such as the current index or the primary key if it is a number). This will give you a reproducible, consistent and mirrored order; or
2. Implement your own sorting algorithm. This is not recommended as it's simply too error prone.
Now before you say you ... | [
0.020922092720866203,
-0.28188130259513855,
0.28983643651008606,
-0.4272148311138153,
-0.3560023903846741,
0.1125318706035614,
0.059772733598947525,
-0.647895336151123,
-0.23294900357723236,
-0.5101262927055359,
0.06710168719291687,
0.4332847595214844,
-0.6258134841918945,
-0.1389352530241... | |
i.set((T)a[j]);
}
}
```
So it copies the collection into an array, sorts that array and then uses that to reorder the collection.
Are you sure you can't afford a reversal? | [
0.3009367883205414,
-0.027910266071558,
0.023069627583026886,
-0.15127426385879517,
0.37342891097068787,
-0.10114239156246185,
-0.10066359490156174,
-0.11881516128778458,
-0.21978110074996948,
-0.4465092718601227,
-0.15378177165985107,
0.6437636613845825,
-0.5509926676750183,
0.17021983861... | |
I tried to do several searches before posting this question. If this is a duplicate, please let me know and I will delete it.
My question revolves around the proper way to handle errors produced through our web application. We currently log everything through log4j. If an error happens, it just says "An error has occu... | [
0.8025760054588318,
0.36958304047584534,
0.27545127272605896,
0.2580063045024872,
0.30963873863220215,
0.007331055589020252,
0.3840144872665405,
0.16036808490753174,
-0.29764774441719055,
-0.5667781829833984,
0.2618282437324524,
0.20429258048534393,
-0.08346706628799438,
0.3077213168144226... | |
go to the error log folder and try finding this error. Let me also mention that the folder is full of logs from the past week. Each time there is an error, one log file is created for that user and email is sent to the IT staff assigned to work on errors. This email does not mention the log file name but it is a copy o... | [
0.4672911465167999,
0.13817048072814941,
0.2385929375886917,
0.2887936234474182,
0.18813341856002808,
0.025890104472637177,
0.6583771705627441,
0.14118802547454834,
-0.4271048605442047,
-0.4040675163269043,
0.3504196107387543,
0.6306862831115723,
-0.01742161624133587,
0.027119895443320274,... | |
have to go through each log file trying to find hers.
What I was proposing to my fellow co-workers is adding an Error Log table into the database. This would write a record to the table for each error, record who it is for, the error, what page it happened on, etc. The bonus of this would be that we can return the pr... | [
0.3283960521221161,
0.3523963987827301,
0.19064712524414062,
0.11204318702220917,
0.49253129959106445,
0.14218240976333618,
0.16861417889595032,
-0.39893245697021484,
-0.4290558993816376,
-0.22927257418632507,
0.08975280821323395,
0.48779428005218506,
0.1834861934185028,
0.3337939083576202... | |
handy for future use". When we get the email, it would tell us the id of the error for quick reference. Or if the user is persistent, they can contact us with the id and we can find the error rather quickly.
How do you setup your error logging? By the way, our system uses Java Servlets that connect to a SQL Server dat... | [
0.3469901978969574,
-0.28489238023757935,
0.2794222831726074,
0.26210829615592957,
0.08780831098556519,
-0.27452945709228516,
-0.07297996431589127,
0.021490197628736496,
-0.41258808970451355,
-0.7002955675125122,
0.239298477768898,
0.734062910079956,
-0.3369300663471222,
-0.454147368669509... | |
and then log that on every log line, so you can easily grep those logs later by that ID and find all relevant lines.
If you think it is very tedious to add that ID to every log statement, then you are not alone - java logging frameworks have made it transparent with the use of [Mapped Diagnostic Context](http://logbac... | [
0.007072617765516043,
-0.40689900517463684,
0.4147287607192993,
0.42812666296958923,
-0.05450410395860672,
-0.26369771361351013,
0.14681695401668549,
-0.1276095062494278,
-0.23480859398841858,
-0.8121667504310608,
0.08157116174697876,
0.4101244807243347,
-0.08007722347974777,
-0.0247797779... | |
- better use file-system. Or, the simplest approach is to just use the requestID - then you do not need to do anything special at the moment error occurs. It just helps you to locate the correct logfile and search inside that file.
How would one requestID look like?
We use the following pattern:
> <instanceName>:<cu... | [
0.00988486222922802,
-0.3769243061542511,
0.5981394052505493,
0.14588363468647003,
-0.04387079179286957,
-0.06623932719230652,
0.31478050351142883,
-0.37143751978874207,
-0.18145541846752167,
-0.6458310484886169,
0.02835390344262123,
0.3198775053024292,
-0.07589597254991531,
0.160743296146... | |
need to either synchronize it or create a new one on each request).
* *counter* is request counter in that particular millisecond - in the rare case you might need to generate more than one request ID in one millisecond
As you can see, the ID format has been set up in such a way that *currentTimeInMillis.counter* comb... | [
0.17003589868545532,
-0.28740715980529785,
0.7270486354827881,
0.32925915718078613,
0.08028730750083923,
-0.2375362068414688,
0.19764328002929688,
-0.2437821328639984,
-0.3213696777820587,
-0.5035563111305237,
-0.17439934611320496,
0.05180208012461662,
0.024496760219335556,
0.1395691037178... | |
node. Also, the use of *instanceName* variable gives you the possibility to limit the number of log files you later need to look in to find that request.
Then, the final question: *"that is fine and dandy in single-JVM solution, but how do you scale that to several JVMs, communicating over some network protocol?"*
As... | [
-0.1041921004652977,
-0.1381099373102188,
0.5878815650939941,
0.10552732646465302,
0.09826936572790146,
-0.016976915299892426,
0.22336788475513458,
-0.24891965091228485,
-0.3003019690513611,
-0.6863262057304382,
-0.06903421878814697,
0.4276712238788605,
-0.17365878820419312,
0.298492699861... | |
implement it with plain-RMI or other remoting methods. | [
0.37099018692970276,
0.0680260956287384,
-0.0996190756559372,
0.07659413665533066,
-0.07047834247350693,
-0.28827711939811707,
0.22477784752845764,
-0.186796635389328,
0.2349732667207718,
-0.4014245569705963,
-0.4924778640270233,
0.4690905809402466,
-0.29999667406082153,
-0.540727972984314... | |
I'm trying to read raw video frames from a video capture device using JMF - the Java Media Framework.
I've successfully written the "capture" part - using a *Player* object created by *Manager*, I can display realtime video from a webcam. I don't know how to go about creating a custom component to access the actual fr... | [
0.6282241344451904,
-0.012503905221819878,
0.3658272325992584,
0.05729787424206734,
-0.16040650010108948,
-0.3768766522407532,
-0.012680472806096077,
-0.03818673640489578,
-0.15395867824554443,
-0.7534474730491638,
0.2195110321044922,
0.7078671455383301,
-0.2575888931751251,
0.176774024963... | |
I'd say something derived from a, say, JPanel that draws the video when a repaint request is made or a new frame is available.) I would like to be able to process every new frame and loop on x/y over all the pixels. I have access to the raw/RGB format on my device, but automatic conversion from, say, YUV wouldn't hurt.... | [
0.6319687962532043,
-0.14576636254787445,
0.39010557532310486,
0.24043171107769012,
-0.15594911575317383,
0.23708565533161163,
-0.09008529037237167,
-0.09606754779815674,
-0.03074496053159237,
-0.6992230415344238,
-0.022830301895737648,
0.3719429075717926,
-0.0911436602473259,
0.2555413544... | |
and timing control functions, for example; and I wouldn't know how to implement them in the first place. Deriving from *DataSink* seems like a simpler option with less useless abstract functions. However, in either case, I'm at a complete loss as how to:
a) Connect the component to my video capture DataSource
b) A... | [
0.1947156935930252,
-0.14202912151813507,
0.2978661358356476,
0.17894203960895538,
-0.048256468027830124,
-0.24226640164852142,
0.030048709362745285,
-0.2672803997993469,
-0.35828766226768494,
-0.4094690680503845,
0.04768892005085945,
0.6558817625045776,
-0.39483383297920227,
0.01374366506... | |
have a simple solution for this. I've seen an example along the lines of: `x = new Image(captureDevice.getFrame())` which seems to suggest pixel-level access is possible, through Image if not the intermediate type.
But I would really like to see how hard it is in JMF first.
I answered a similar question [here](https:/... | [
0.1889582872390747,
-0.16869434714317322,
0.47919508814811707,
0.11194198578596115,
-0.13905157148838043,
-0.15089578926563263,
-0.025236694142222404,
-0.2993893027305603,
-0.3899395763874054,
-0.8094469904899597,
-0.09135524928569794,
0.4901392459869385,
-0.2122488021850586,
0.05296881496... | |
that ID and find all relevant lines.
If you think it is very tedious to add that ID to every log statement, then you are not alone - java logging frameworks have made it transparent with the use of [Mapped Diagnostic Context](http://logback.qos.ch/manual/mdc.html) (MDC) (at least log4j and logback have this).
Request... | [
0.12992657721042633,
-0.3502594530582428,
0.4439934194087982,
0.3864090144634247,
-0.09665761142969131,
-0.32066577672958374,
0.15087367594242096,
-0.19612736999988556,
-0.19871611893177032,
-0.8363085389137268,
0.035292547196149826,
0.4707370698451996,
-0.06446393579244614,
-0.10477553308... | |
do not need to do anything special at the moment error occurs. It just helps you to locate the correct logfile and search inside that file.
How would one requestID look like?
We use the following pattern:
> <instanceName>:<currentTimeInMillis>.<counter>
In consists of the following variables:
* *instanceName* uniq... | [
0.08542466163635254,
-0.2619057595729828,
0.6847215890884399,
0.04136499762535095,
-0.04844037443399429,
-0.12560716271400452,
0.30042198300361633,
-0.39383965730667114,
-0.23734775185585022,
-0.5381320118904114,
0.025290334597229958,
0.19229556620121002,
0.05553451552987099,
0.20213164389... | |
in that particular millisecond - in the rare case you might need to generate more than one request ID in one millisecond
As you can see, the ID format has been set up in such a way that *currentTimeInMillis.counter* combination is guaranteed to be unique in particular JVM and the whole ID is guaranteed to be globally ... | [
0.07630090415477753,
-0.15061476826667786,
0.5359513163566589,
0.3081645667552948,
0.22873954474925995,
-0.3006049394607544,
0.16092371940612793,
-0.31264179944992065,
-0.37387797236442566,
-0.5560116171836853,
-0.10851572453975677,
0.3034237027168274,
0.06333430856466293,
0.17486743628978... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.