text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
training in secure development. Thinking about security really does require a shift in thinking from normal development, so we'd try to get developers thinking in a how-to-break-things frame of mind. One prop we used was one of those home safes with the digital keypad. We'd let developers examine it inside and out to t... | [
0.4520992040634155,
-0.32823529839515686,
-0.2746450901031494,
0.3514817953109741,
0.44007977843284607,
-0.20756708085536957,
0.2741428315639496,
-0.5077943205833435,
-0.08446317166090012,
-0.2834175229072571,
-0.02052735909819603,
0.6379982829093933,
0.2500866651535034,
-0.432771623134613... | |
give them specific black-hat techniques, we'd talk about the implementation errors that cause those vulnerabilities -- especially things they might not have encountered before, like integer overflows or compilers optimising out function calls (like memset to clear passwords). We published a monthly security newsletter ... | [
0.32914459705352783,
0.3958464562892914,
-0.3892521262168884,
0.23942169547080994,
-0.08064626157283783,
-0.2119317501783371,
0.24030987918376923,
0.043010253459215164,
-0.07521101832389832,
0.03289572522044182,
-0.25355780124664307,
0.654495894908905,
0.2057410031557083,
-0.26076781749725... | |
team, who were mostly former developers, understanding the black-hat techniques was very important to us. One of the things we were responsible for was receiving security alerts from third parties, and knowing how difficult it would be for a black hat to exploit some weakness was an important part of the triage and inv... | [
0.34804075956344604,
0.07939895987510681,
-0.4149341285228729,
0.3164115846157074,
0.06100330874323845,
-0.15077468752861023,
0.22189125418663025,
-0.11127864569425583,
-0.167558491230011,
-0.09324827790260315,
-0.14110620319843292,
0.7272768020629883,
0.14093413949012756,
-0.4798699021339... | |
developers who are good enough at writing code, but just do not have the security mindset. So my answer to your question is this: expecting all developers to have black-hat knowledge would be an unwelcome and detrimental burden, but *somebody* in your company should have that knowledge, whether it be a security audit a... | [
0.6581270694732666,
0.4234403371810913,
-0.39637020230293274,
0.14326557517051697,
-0.137474924325943,
-0.5650638937950134,
0.3265308439731598,
0.16204355657100677,
-0.08872085064649582,
-0.2740001976490021,
-0.2673446536064148,
0.6651731729507446,
0.0066644372418522835,
-0.080462940037250... | |
When trying to use the paging part of GridView in my application, I receive the following error:
> The GridView 'GridView1' fired event PageIndexChanging which wasn't handled.
I mixed your answers and I get my answer.
I solved this problem whit this code :
```
protected void GridView1_PageIndexChanging(object sender,... | [
0.08683647215366364,
0.053368959575891495,
0.3710242807865143,
-0.02597249671816826,
-0.13554877042770386,
0.052581965923309326,
0.44069263339042664,
-0.33249714970588684,
-0.06542383134365082,
-0.6688403487205505,
-0.10668907314538956,
0.6062970161437988,
-0.5324424505233765,
0.1451034545... | |
Are there any libraries that support JSTL style coding in an ASP MVC view?
I much prefer
```
<c:forEach var="c" items="${Customers}">
<c:out value="${c.Name}"/><br/ >
</c:forEach>
```
to
```
<% foreach(Customer c in customers) { %>
<%= c.Name %><br/ >
<% } %>
```
Yep, [Spark](https://github.com/SparkViewEngin... | [
0.25631898641586304,
0.050337228924036026,
0.09912768751382828,
-0.02922978810966015,
-0.27085253596305847,
0.042309559881687164,
-0.2967950701713562,
-0.010204668156802654,
-0.07070893049240112,
-0.625809371471405,
0.04872971773147583,
0.6733999848365784,
-0.1240616962313652,
-0.139628261... | |
I have a one-to-many relationship but I'd like to get only one instance to have a one-to-one relationship.
I have a class vehicles that may have several owners throughout their life. I only want to map the class to obtain the assets. Is there some way to do this?
The problem is in the hbm.xml file. One vehicle may ha... | [
0.13042671978473663,
0.13549526035785675,
0.2773866653442383,
0.22836224734783173,
-0.1894027292728424,
0.009106629528105259,
0.09314021468162537,
-0.10138073563575745,
-0.07256152480840683,
-0.6935163140296936,
0.25250545144081116,
0.4967580735683441,
0.07606985419988632,
0.42499017715454... | |
= VehiculeService.SearchVehicule(id);
I'd like v.Owner must contain the last vehicle's owner.
I can't store the owner's ID on the vehicle table because the owner depend on the date. I can have for example:
Vehicle Owner StartDate EndDate
1 1 04/04/2009 04/10/2009
1 2 05/10/2009 NULL
For this reason i must filter b... | [
0.11959416419267654,
0.27520179748535156,
0.6117966771125793,
-0.04145267233252525,
-0.027990078553557396,
0.08092815428972244,
0.023293782025575638,
-0.18147709965705872,
-0.0898008793592453,
-0.3264576196670532,
0.2355973869562149,
0.536960244178772,
0.4628959000110626,
0.300059884786605... | |
spirit.
```
<c:forEach var="c" items="${Customers}">
<c:out value="${c.Name}"/><br/ >
</c:forEach>
```
becomes
```
<for each="var c in Customers">
${c.Name}<br/>
</for>
``` | [
0.19447503983974457,
0.2721925377845764,
0.7887033224105835,
-0.011208810843527317,
-0.05871328338980675,
0.14139798283576965,
0.44271352887153625,
-0.3637939393520355,
-0.14562484622001648,
-0.7378116846084595,
-0.3705812692642212,
0.6389853954315186,
0.12966255843639374,
0.34647232294082... | |
I have to implement an algorithm to decompose 3D volumes in voxels. The algorithm starts by identifying which vertexes is on each side of the cut plan and in a second step which edge traverse the cutting plan.
This process could be optimized by using the benefit of sorted list. Identifying the split point is O log(n)... | [
-0.07900907099246979,
0.22533850371837616,
0.5300186276435852,
0.07307441532611847,
-0.3909083902835846,
0.30615484714508057,
-0.15178008377552032,
-0.33489298820495605,
-0.19096457958221436,
-0.9347932934761047,
-0.03968026489019394,
0.4102013111114502,
-0.14028748869895935,
0.27381503582... | |
imposed.
With a complete "voxelization" I expect to endup with ~4000 points, and 12000 edges. Fortunately this can be optimized by using a smarter strategy to get rid of processed voxels and order residual volumes cutting to keep their number to a minimum. In this case I would expect to have less then 100 points and ... | [
0.3571155369281769,
-0.2527022361755371,
0.3676683306694031,
0.3392094075679779,
-0.28926968574523926,
0.06105224788188934,
0.23989421129226685,
-0.40096578001976013,
-0.3457114100456238,
-0.7216634750366211,
-0.05903451144695282,
0.30421528220176697,
-0.4489738643169403,
0.074838019907474... | |
overhead compared to simple intrusive linked lists.
The question will ALWAYS boil down to which operator is most common, accessing, or adding.
If you have an unordered list, adding to it takes no time, and accessing particular items takes extra time.
If you have a sorted list, adding to it takes more time, but accessin... | [
0.4061816334724426,
-0.17940253019332886,
0.070915088057518,
0.3698892891407013,
0.04195918142795563,
-0.13509945571422577,
-0.06545668840408325,
-0.22724850475788116,
-0.3874887228012085,
-0.7235008478164673,
-0.19575446844100952,
0.6902002096176147,
-0.24424906075000763,
-0.0892679169774... | |
lot of churn in your data (which it doesn't sound like there is) then maintaining a sorted list isn't necessarily advisable, because you will be constantly resorting the list as considerable CPU cost.
The complexity of the data structures only matters if they *cannot* be sorted in a useful way. If they can be sorted, ... | [
0.17679087817668915,
0.0782928392291069,
0.013511049561202526,
0.34205785393714905,
0.08904989808797836,
0.11304087191820145,
0.3015354573726654,
0.07419421523809433,
-0.5108385682106018,
-0.6830774545669556,
-0.03296875208616257,
0.40502867102622986,
-0.08710409700870514,
0.30461862683296... | |
I'm aware of some Windows Thread Libs for Delphi(OmniThread Lib, BMThreads, etc).
But is there a lib that is built to be cross-platform and that can both be used under Delphi and FreePascal?
Although these are not links to threading libraries per se, the information on the following pages might (or might not) be of us... | [
-0.014996159821748734,
0.0451618954539299,
0.025055143982172012,
0.11786485463380814,
-0.3508296310901642,
-0.09850159287452698,
0.21401412785053253,
0.11843711882829666,
-0.5825113654136658,
-0.6917610168457031,
-0.05031873658299446,
0.40031829476356506,
-0.37354469299316406,
0.1060470789... | |
I recently had to change my development to another PC. I installed TortoiseSVN because I still had source code lying around that had still to be checked in SVN. But apparently the new installation of Tortoise does not recognize my source folders, although the '.SVN' folders are still there I see no overlay icons appear... | [
0.2326701581478119,
-0.03253308683633804,
0.4631505310535431,
-0.2148941457271576,
0.15128564834594727,
0.23893719911575317,
0.4207933247089386,
0.1006217896938324,
-0.35120558738708496,
-0.4929749071598053,
0.05121367797255516,
1.0540361404418945,
-0.060971491038799286,
0.2639842927455902... | |
trouble.
Since it's an old work-folder you've recovered from an old system, I would consider removing all ".svn" folders, checkout the code again (optionally from a revision number you remember the working folder was at), and move the old files (without ".svn" folders) over it. | [
0.05657435208559036,
0.08110462129116058,
0.31735125184059143,
0.23418305814266205,
0.4439929723739624,
-0.12659956514835358,
-0.04437790438532829,
0.03690533712506294,
-0.5085874199867249,
-0.49523118138313293,
-0.25686267018318176,
0.4275919198989868,
0.1006878986954689,
0.29817679524421... | |
Often when you fill in a form on the web you are asked to type in some characters from an image to validate you aren't a robot etc.
Does anyone know A) what you actually call these things? B) are there any third party tools that can be used to generate the images? (.NET focus here)
[Captcha](http://en.wikipedia.org/wi... | [
0.5961976051330566,
-0.2876180410385132,
-0.0894709900021553,
0.45095503330230713,
-0.1743626445531845,
-0.28481337428092957,
0.17279285192489624,
0.18435081839561462,
-0.42527079582214355,
-0.3605974018573761,
-0.5356351733207703,
0.1393747329711914,
-0.3239489793777466,
0.147123977541923... | |
Is there any way to subscribe to volume buttons press events?
**After the recent rejections from Apple**
Do not use this. Apple now uses some patch which would reject your app straightaway if it uses any of the private APIs - though should note here that quite some apps on the App Store use this already and are still ... | [
0.28208911418914795,
-0.02007925882935524,
0.45275717973709106,
0.1714174747467041,
0.018951047211885452,
-0.2187088578939438,
0.3918555974960327,
-0.15769878029823303,
-0.2569681406021118,
-0.47833284735679626,
-0.004548039752990007,
0.9979201555252075,
-0.3952791392803192,
0.145137548446... | |
READ THE ABOVE NOTE**
Yes, Use the MPVolumeView
```
MPVolumeView *volume = [[[MPVolumeView alloc] initWithFrame:CGRectMake(18.0, 340.0, 284.0, 23.0)] autorelease];
[[self view] addSubview:volume];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumeChanged:)
... | [
-0.31905585527420044,
-0.24150419235229492,
1.0562549829483032,
-0.0019238247768953443,
0.17698703706264496,
0.2021200805902481,
0.04919220134615898,
-0.325277715921402,
-0.662298321723938,
-0.5182983875274658,
-0.1852458268404007,
0.7602497339248657,
-0.17134754359722137,
0.26296031475067... | |
object:nil];
for (UIView *view in [volume subviews]){
if ([[[view class] description] isEqualToString:@"MPVolumeSlider"]) {
volumeViewSlider = view; //volumeViewSlider is a UIView * object
}
}
[volumeViewSlider _updateVolumeFromAVSystemController];
-(IBAction)volumeChanged:(id)sender{
[volum... | [
-0.3739059269428253,
-0.07277420908212662,
1.173850417137146,
-0.1976396143436432,
-0.18948742747306824,
0.17297209799289703,
0.31487610936164856,
-0.36347222328186035,
-0.3683202862739563,
-0.6100884675979614,
-0.14235132932662964,
0.9229640364646912,
-0.26575085520744324,
0.4039733409881... | |
I'll be more specific.
Lets say I have a contract defined for my WCF service. And I have two different WCF clients which reference to this service : "ClientA" and "ClientB".
Now , lets say I want to add an operation (method) to my service which only "ClientB" will use , Lets say I added this operation to the contract... | [
0.48945796489715576,
0.21040496230125427,
0.6849542856216431,
-0.2016642540693283,
0.009532371535897255,
-0.14539237320423126,
0.1312042772769928,
-0.25609007477760315,
-0.5613437294960022,
-0.6637295484542847,
0.09611829370260239,
0.6829850673675537,
-0.4089006781578064,
0.168005436658859... | |
out this article: [Versioning WCF Contracts](http://www.dasblonde.net/2006/01/05/VersioningWCFServiceContracts.aspx) | [
0.10943674296140671,
-0.2942250967025757,
0.3105265498161316,
-0.10763943940401077,
-0.13325782120227814,
-0.3698512017726898,
0.29540756344795227,
-0.25303173065185547,
-0.5311963558197021,
-0.33623501658439636,
-0.06345163285732269,
0.44200214743614197,
-0.08361674845218658,
0.0283056031... | |
I want to make a many to many connection with a field in it.
example:
User *-----works (**hours**)-----* Company
Hours is a field in the many-to-many table. The field describes how many hours a user works in the company.
How is this best modeled in the entity framework?
Can you even model this without making a enti... | [
0.552973210811615,
0.01555569190531969,
0.4523935317993164,
0.022255809977650642,
0.1435229480266571,
-0.14000791311264038,
-0.1565258651971817,
-0.08370431512594223,
-0.3538356125354767,
-0.5838444828987122,
0.28150254487991333,
0.5799693465232849,
0.0092711690813303,
0.21183140575885773,... | |
Yeah, I know is obsolete and old and everything you all might say... But I just needed... This stuff happens... xD any clues?
The client only needs to update his reference, if it's going to use the new Operation contract.
Check out this article: [Versioning WCF Contracts](http://www.dasblonde.net/2006/01/05/Versioning... | [
0.49548017978668213,
0.02106071449816227,
0.4154796004295349,
0.07448302954435349,
0.21336449682712555,
-0.4861839711666107,
0.37014278769493103,
0.0507441945374012,
-0.4720540940761566,
-0.42493873834609985,
0.1139148622751236,
0.6070793271064758,
-0.25558724999427795,
0.15995833277702332... | |
I just finished Scott Gu's Nerd Diner tutorial. I found it very helpful because it not only taught the basics of ASP.Net MVC, but also how to use with Repositories, Validation, Unit testing, Ajax, etc.. Very thourough, but still manageable.
However, I am curious about his site structure:
Specifically, he used this vi... | [
0.13364678621292114,
0.2576555609703064,
-0.052413634955883026,
0.07640400528907776,
-0.28656673431396484,
-0.04849874973297119,
0.10930562764406204,
0.27661579847335815,
-0.11432911455631256,
-0.39848920702934265,
0.11953228712081909,
0.1566077619791031,
0.044551048427820206,
0.1317391246... | |
good, so I am assuming his structure is right. But I would like to know why.
Thanks!
[Edit for clarification]
I realize that many times it is necessary for there to be multiple actions (and views) to handle differences in creates and edits. It is the case of the very simple edit and create, where the only differenc... | [
0.3401791453361511,
0.27552446722984314,
-0.04143596813082695,
0.2211994081735611,
0.041105907410383224,
-0.04541284218430519,
0.0934397354722023,
0.12474138289690018,
-0.38710451126098633,
-0.4474779963493347,
0.21072882413864136,
0.7533396482467651,
-0.22374679148197174,
0.07493070513010... | |
using the same view to handle both cases going to cause major problems?
The view structure is based on the controllers, not the model directly. In the Mvc methodology, you should have a view for each action (each public method, essentially) in a controller. The controller actions don't have to match up directly to each... | [
0.05249638855457306,
-0.2385389357805252,
0.4692617952823639,
0.41863760352134705,
-0.14035584032535553,
0.057326242327690125,
-0.0901101604104042,
-0.26323550939559937,
-0.41396597027778625,
-0.6112433075904846,
-0.0022449379321187735,
0.4585479497909546,
-0.232484370470047,
-0.1119778826... | |
* Index: list the items
* Details: view a specific item
* Edit: edit an item
* Create: new item
* Delete: delete an item
Each of these actions will require a view (and sometimes more than one).
So, yes, you can collect a large number of views if it is a large application. The way to minimize the code is:
* Extract ... | [
0.04340239614248276,
-0.34543660283088684,
0.19312754273414612,
0.5010254383087158,
-0.18092095851898193,
0.1399218738079071,
0.049063727259635925,
-0.22619099915027618,
-0.4617004096508026,
-0.6759834885597229,
0.06267004460096359,
0.512548565864563,
-0.17749063670635223,
-0.2098228335380... | |
that any large application is going to have lots of forms. Whether it's Mvc or Web Forms, if there is a lot of data to work with, there are going to be a lot of forms necessary to do it. | [
0.6732056736946106,
0.27400270104408264,
0.22715555131435394,
0.34007129073143005,
0.19279445707798004,
-0.2017032951116562,
-0.3483855724334717,
0.13084866106510162,
-0.37421727180480957,
-0.44284579157829285,
-0.004381285514682531,
0.4647364616394043,
-0.13615131378173828,
0.089096210896... | |
Hypothetical example:
I have an SQL table that contains a billion or so transactions:
```
| Cost | DateTime |
| 1.00 | 2009-01-02 |
| 2.00 | 2009-01-03 |
| 2.00 | 2009-01-04 |
| 3.00 | 2009-01-05 |
| 1.00 | 2009-01-06 |
...
```
What I want is to pair down the data so that I only see the cost *transitions*:
```
... | [
-0.01660720258951187,
0.044075705111026764,
0.14908456802368164,
0.20390169322490692,
0.19635331630706787,
0.20810376107692719,
-0.10547102242708206,
-0.12460308521986008,
-0.2070382982492447,
-0.5307525992393494,
0.06820939481258392,
0.4469526410102844,
-0.2938476502895355,
-0.10916953533... | |
do this in SQL?
The view structure is based on the controllers, not the model directly. In the Mvc methodology, you should have a view for each action (each public method, essentially) in a controller. The controller actions don't have to match up directly to each table in database but there is likely some sort of dire... | [
0.22363059222698212,
-0.1814231276512146,
0.24782811105251312,
0.46791744232177734,
-0.15542666614055634,
-0.1631220579147339,
-0.15559303760528564,
-0.24354954063892365,
-0.2786925137042999,
-0.5674396753311157,
0.1293649524450302,
0.25350505113601685,
-0.28996384143829346,
0.059436369687... | |
item
* Edit: edit an item
* Create: new item
* Delete: delete an item
Each of these actions will require a view (and sometimes more than one).
So, yes, you can collect a large number of views if it is a large application. The way to minimize the code is:
* Extract shared functionality to partial views, as to keep t... | [
0.06967172026634216,
-0.3099936246871948,
0.17982575297355652,
0.47591665387153625,
-0.19304798543453217,
0.21468645334243774,
0.13862963020801544,
-0.27023932337760925,
-0.5674477219581604,
-0.6149894595146179,
0.033296577632427216,
0.4318527281284332,
-0.19699518382549286,
-0.17713232338... | |
of forms. Whether it's Mvc or Web Forms, if there is a lot of data to work with, there are going to be a lot of forms necessary to do it. | [
0.7453041076660156,
0.3270629346370697,
0.484389990568161,
0.32668957114219666,
0.13089561462402344,
-0.36773398518562317,
-0.20829448103904724,
-0.30004197359085083,
-0.35607782006263733,
-0.7054280638694763,
-0.02657093107700348,
0.44646236300468445,
-0.01683630235493183,
-0.162109002470... | |
I've created the following structure which maps unique double values to one or more pairs of integers:
```
@SuppressWarnings("boxing")
private static final HashMap<Double, Integer[][]> rules =
new HashMap<Double, Integer[][]>() {
private static final long serialVersionUID = 1L;
{
... | [
0.43357083201408386,
-0.047290701419115067,
0.3319689631462097,
-0.3634195029735565,
-0.10263431072235107,
-0.007153091486543417,
0.442649245262146,
-0.589907169342041,
-0.16600948572158813,
-0.1882016509771347,
-0.10776448249816895,
0.47535890340805054,
-0.17723309993743896,
0.26198813319... | |
} });
put(0.0, new Integer[][] { { 2, 4 }, { 3, 3 }, { 4, 2 } });
put(0.3, new Integer[][] { { 4, 4 } });
put(0.6, new Integer[][] { { 5, 3 } });
}
};
```
Can I rewrite this so it's simpler - i.e not have to deal with warnings (serialVersionUID, boxing), and it | [
0.344900518655777,
-0.008231191895902157,
0.20578210055828094,
-0.37505054473876953,
0.159917414188385,
-0.07679114490747452,
0.4481111764907837,
-0.5698956251144409,
-0.14030833542346954,
-0.4273121654987335,
-0.1282930225133896,
0.547674834728241,
-0.46018004417419434,
0.1106815561652183... | |
being so verbose?
Using a class for the pairs of integers should be the first. Or is this a coincidence, that all arrays containing a bunch of pairs?
The second thing is, that these initialization-data could be read from a configuration-file.
**Edit:** As I looked again on this code, I realized that Doubles as keys i... | [
0.4562292993068695,
0.037482988089323044,
0.13672001659870148,
0.1869715303182602,
-0.22060240805149078,
0.09229602664709091,
0.024405213072896004,
-0.0602446012198925,
-0.5033580660820007,
-0.4911811649799347,
0.15971626341342926,
0.7200993895530701,
-0.1483154594898224,
-0.19773012399673... | |
want to associate the values with the interval (example 0.0-0.3) and not the value itself. You may avoid trouble, if you always use the same constants as keys in the array. But in this case you could use an enum as well, and no new programmer runs into trouble, if he uses his calculated doubles as keys in the map. | [
0.3990592062473297,
-0.15118449926376343,
-0.03417779505252838,
0.2660379707813263,
0.0746925100684166,
-0.21287965774536133,
-0.10184945911169052,
-0.1583268642425537,
-0.4767649471759796,
-0.5165846347808838,
0.13838143646717072,
0.749826192855835,
-0.16557592153549194,
-0.17808833718299... | |
I want to be able to read the content of pdf files. I need to do that with C on Linux.
The closer i can get to this was [here](https://stackoverflow.com/questions/58730/open-source-pdf-library-for-cc-application) but I think Haru can only create pdf and is not able to read them (not 100% sure).
PS: I only need the pl... | [
0.28357869386672974,
0.0020410227589309216,
0.24825522303581238,
0.15889373421669006,
-0.14300128817558289,
-0.38081151247024536,
0.15251265466213226,
0.07949378341436386,
-0.174737349152565,
-0.7001724243164062,
-0.2475104182958603,
0.4901708662509918,
-0.17012017965316772,
-0.02115091495... | |
A friend of mine was talking about a word game she liked to play where you try to convert one word to another (they have the same number of letters) by switching one letter at a time, where each iteration produces a real word.
Example:
> MOON --> WOLF
>
> GOON
>
> GOOF
>
> GOLF
>
> WOLF
I figured it'... | [
0.37210360169410706,
0.2227819710969925,
-0.2017156183719635,
-0.14111870527267456,
-0.34103211760520935,
0.4895564615726471,
0.16065886616706848,
0.07669459283351898,
-0.13656668365001678,
-0.6499447226524353,
0.17694878578186035,
0.1442539542913437,
-0.10079717636108398,
-0.0294403173029... | |
solution.
Problem is I'm having trouble finding free word lists that I can easily access programmatically. I'm also thinking about using this as an excuse to learn Python, so it'd be great if anyone knows of free word lists and pointers on how to parse and access it from Python. The algorithm for figuring out how to f... | [
-0.027513060718774796,
0.1277724653482437,
0.08119750767946243,
0.04960252717137337,
-0.10537093132734299,
0.3053141236305237,
0.18959259986877441,
-0.2644254267215729,
-0.048269256949424744,
-0.7321463227272034,
0.14848661422729492,
0.4555812478065491,
-0.33905115723609924,
-0.03733225911... | |
and it worked nicely.
For bonus points, here's something to get you started on your word program:
```
import re
startwith = "MOON"
endwith = "GOLF"
cklength = re.compile('.{' + str(len(startwith)) + '}(\n)?$', re.I)
filename = "C:/dict.txt"
words = set(x.strip().upper() for x in open(filename) if x.match(cklength))
... | [
0.46193253993988037,
0.2334020584821701,
0.7020455598831177,
-0.07074087858200073,
-0.1625923365354538,
0.10702681541442871,
0.15783773362636566,
-0.12218637019395828,
-0.08474843204021454,
-0.5320824384689331,
-0.06865580379962921,
0.9368221759796143,
0.025527069345116615,
0.0025670123286... | |
I've got an AIX script I would like to run from a .NET application. I'm not opposed to kicking off a Windows batch file if that gives me better options.
Most of what I've seen on Google relates to using a tool such as rsh or Plink, or using ssh or telnet. I don't have access to rsh or Plink (although I do have PuTTY a... | [
0.6325381994247437,
0.25652360916137695,
-0.026324773207306862,
-0.1163153275847435,
-0.05812935158610344,
-0.09366972744464874,
0.34111931920051575,
0.3135002553462982,
-0.07079458236694336,
-0.8792769908905029,
0.23478196561336517,
0.46955201029777527,
-0.19611141085624695,
0.11260011792... | |
Windows application?
Install cygwin. Include the ssh function. Set up your ssh keys - private key on windows, public key on the AIX box. Then you can run "ssh user@aixbox script-on-aix-box.sh".
Best to have the script on AIX, though you can use scp to copy the file to AIX first. Passing a long command line through ssh... | [
0.11693990975618362,
0.19982270896434784,
0.41713622212409973,
-0.006224007345736027,
-0.03430049121379852,
-0.2514256536960602,
0.607413113117218,
-0.026452260091900826,
-0.17094570398330688,
-0.9966722726821899,
-0.29725196957588196,
0.6208417415618896,
-0.32957783341407776,
-0.015144139... | |
single command which can then be a script that does multiple things.
To answer your comments, which would take too long for another comment:
(1) Why is it better to use cygwin's ssh utility instead of the Windows ssh utility?
a) I know it better, so I wouldn't know to suggest any windows ssh utility (I didn't even k... | [
0.3615732789039612,
-0.05846387520432472,
-0.0367116816341877,
0.22943826019763947,
-0.2914723753929138,
-0.3495453894138336,
0.15432021021842957,
-0.18850034475326538,
-0.15454518795013428,
-0.49659815430641174,
-0.12844611704349518,
0.6101338267326355,
-0.46775880455970764,
0.11037664860... | |
of asymmetrically encrypting the password?
The keys allow passwordless access. If you set up your private key as passwordless (not usually recommended, but if you can keep your machine secure, it works well for automated tools), your tool will be able to just ssh over with no password prompts - this makes things much ... | [
-0.010929249227046967,
-0.02799290232360363,
0.21450288593769073,
0.0890614464879036,
0.27688083052635193,
-0.3344830572605133,
0.38862892985343933,
-0.1049690768122673,
-0.3056883215904236,
-0.6592073440551758,
-0.2102178931236267,
0.6000735759735107,
-0.0677737221121788,
0.09068875759840... | |
### Duplicate:
> [Is it possible to make a parameter implement two interfaces?](https://stackoverflow.com/questions/772053/is-it-possible-to-make-a-parameter-implement-two-interfaces)
---
Looking for a way to do this :
```
public interface INumber1 {}
public interface INumber2 {}
public class TestObject : INumber1,... | [
0.2812669277191162,
-0.18600359559059143,
-0.18853545188903809,
0.12452820688486099,
-0.16769137978553772,
-0.04688292741775513,
0.0644381195306778,
-0.27711576223373413,
-0.1869630217552185,
-0.8750694394111633,
-0.02846023067831993,
0.44890064001083374,
-0.40812376141548157,
-0.050611402... | |
I have a configuration file that I consider to be my "base" configuration. I'd like to compare up to 10 other configuration files against that single base file. I'm looking for a report where each file is compared against the base file.
I've been looking at diff and sdiff, but they don't completely offer what I am loo... | [
0.6751795411109924,
0.06246482580900192,
0.32750698924064636,
0.043924588710069656,
0.06240314245223999,
0.12693479657173157,
0.07471819967031479,
-0.14166773855686188,
-0.12064896523952484,
-0.8749140501022339,
0.23786330223083496,
0.5956116318702698,
-0.14955942332744598,
0.0254455711692... | |
easy to visualize manner.
Notice that some rows are missing in several of the config files (when compared individually to the base). I'd like to be able to put those on the same line (as above).
Note, the screenshot above is simply a mockup, and not an actual application.
I've looked at using some Delphi controls f... | [
0.19608396291732788,
0.013195705600082874,
0.5496742129325867,
-0.11124566197395325,
0.058432530611753464,
-0.03350527957081795,
-0.1003517359495163,
-0.2986798882484436,
-0.444673091173172,
-0.48598313331604004,
0.09499518573284149,
0.5340782999992371,
-0.22160013020038605,
-0.23880209028... | |
[diffuse](http://diffuse.sourceforge.net/) is the closest answer, it does N-way merge by way of displaying all files and doing three way merge among neighboors. | [
-0.16071094572544098,
-0.027707263827323914,
0.29117006063461304,
0.025561140850186348,
-0.22740912437438965,
-0.087107352912426,
0.25531747937202454,
-0.371696412563324,
0.035611171275377274,
-0.3171932101249695,
-0.2213534712791443,
-0.19507093727588654,
-0.23092660307884216,
-0.26002955... | |
Using the following text as a sample, I need to be able to extract text between LI tags. Notice that the first LI is intentionally mal-formed as this may be the case. Said another way, I want everything from an LI tag to either it's closing LI tag or the next LI opening tag.
```
<UL>
<LI class="test">This is the ... | [
-0.09287165850400925,
-0.05231257528066635,
0.12793177366256714,
-0.16698777675628662,
-0.5315638184547424,
0.08390319347381592,
0.21986007690429688,
-0.5975691676139832,
0.1298045665025711,
-0.7116519808769226,
-0.13773813843727112,
0.5065489411354065,
-0.6067559719085693,
-0.215839937329... | |
of the 2nd LI tag. I've managed to get it to return the first set but never both. I'm using the "Dot matches newline" option as well and this is .NET for which I need it to work. Thanks!
*UPDATE*
I had done some research prior to posting this question and did in fact see and understand that using regex's to parse htm... | [
0.3070332109928131,
-0.31865957379341125,
0.6655707955360413,
0.0436331070959568,
-0.27454960346221924,
-0.2163548320531845,
0.3329774737358093,
-0.03562401607632637,
-0.25002604722976685,
-0.800426721572876,
-0.013502364978194237,
0.5477237105369568,
-0.47081711888313293,
-0.2671962976455... | |
a simpler way to do it rather than dealing with a separate library, especially when use of third party libraries is tricky to deal with where I work. Unfortunately it appears that the HTML can end up mal-formed in certain situations when using an html rich text entry box on a page that allows you to bulletize text. Tha... | [
0.4261205196380615,
0.2215918004512787,
-0.07475546002388,
0.3709746301174164,
-0.1916728913784027,
-0.2734578549861908,
0.5182538032531738,
-0.09175056964159012,
-0.2870718240737915,
-0.48663386702537537,
0.19660820066928864,
0.5045400261878967,
-0.35554391145706177,
0.20948676764965057,
... | |
this is a recurring scenario, I would rather use an HTML parser. Parsing HTML with Regex will take a tremendous amount of time, and might still turn out buggy, because of malformed input (that you mentioned).
Here's one I found with a basic Google search:
<http://www.netomatix.com/products/Documentmanagement/HtmlPa... | [
0.01757769286632538,
0.20163865387439728,
0.06324835866689682,
0.07523845881223679,
-0.10036993771791458,
-0.13455764949321747,
0.24263016879558563,
-0.18715012073516846,
-0.3417334258556366,
-0.4023542106151581,
0.18959835171699524,
0.5012248158454895,
-0.19041530787944794,
-0.18472772836... | |
Is there a more elegant way of doing this in Java?
```
String value1 = "Testing";
String test = "text goes here " + value1 + " more text";
```
Is it possible to put the variable directly in the string and have its value evaluated?
```
String test = String.format("test goes here %s more text", "Testing");
```
... | [
0.2429800033569336,
-0.04392561316490173,
-0.19407017529010773,
-0.17433208227157593,
-0.3400421142578125,
-0.3601958453655243,
0.35316163301467896,
-0.36632078886032104,
0.1724204272031784,
-0.5143623352050781,
0.09296327829360962,
0.6044970750808716,
-0.30613771080970764,
-0.339651405811... | |
I totally understand the purpose of arrays, yet I do not feel I have "mastered" them. Does anyone have some really good problems or readings involving arrays. I program in PHP and C++ so if there are examples with those languages that would be preferable but is not necessary.
Draw everything out on graph paper.
Memo... | [
0.5342721939086914,
0.11213942617177963,
-0.045578621327877045,
0.14875692129135132,
-0.21168969571590424,
0.053173791617155075,
0.15531645715236664,
0.017171109095215797,
-0.3349747359752655,
-0.6618195176124573,
0.3227667808532715,
0.22730828821659088,
-0.2468968778848648,
-0.50834566354... | |
I'm looking to build a rails web app with an admin control panel. I'd like the control panel to use a tabbed interface for controlling users, projects, tasks etc, and I'd like to switch between tabs using jquery tab UI controls with ajax. Also using restful authentication for users and my own code for projects, tasks e... | [
0.3448638617992401,
0.0499737411737442,
0.1297670155763626,
0.30512186884880066,
-0.28149160742759705,
0.0007361687603406608,
0.16040119528770447,
0.061050962656736374,
0.039383139461278915,
-0.6736786961555481,
0.20737269520759583,
0.6065797209739685,
-0.179221048951149,
-0.11990562826395... | |
if I'm not refreshing (to different controllers between tabs) how does this work? Do I need to have one massive controller with all the user, project, task validation and controls (ie. crud operations)? Seems like not the greatest design.
Or is there some way I can use an 'admin' controller that encompasses separate c... | [
0.348659485578537,
0.08863256871700287,
0.6684264540672302,
0.33864566683769226,
-0.2349088191986084,
-0.1490255445241928,
0.06878667324781418,
0.0954534187912941,
-0.16558261215686798,
-0.8934226632118225,
0.1911095827817917,
0.7708557844161987,
-0.008951223455369473,
0.10785011947154999,... | |
for a tab when it is used; you won't be processing code/downloading html for tabs that the user doesn't use.
If you don't want to use this route, (i.e. you feel you need to load all the contents of the tabs on page download in a single request) then you could separate out the code using helper methods and partials. Se... | [
0.03536709398031235,
-0.26887521147727966,
0.4173843264579773,
0.2324131429195404,
0.2229028344154358,
-0.06770587712526321,
0.08566838502883911,
-0.16148099303245544,
-0.5653277635574341,
-0.45154574513435364,
-0.3036777079105377,
0.3088001012802124,
-0.36417004466056824,
0.14818622171878... | |
I am attempting to do some data conversion. Unfortunately, much of the data is in strings, where it should be int's or double, etc...
So what I've got is something like:
```
double? amount = Convert.ToDouble(strAmount);
```
The problem with this approach is if strAmount is empty, if it's empty I want it to amount ... | [
0.38920149207115173,
0.09341660141944885,
0.26059430837631226,
-0.3850323557853699,
-0.19695468246936798,
0.2939910590648651,
0.306453138589859,
-0.44122618436813354,
-0.082069031894207,
-0.734093189239502,
0.3011646866798401,
0.4107207953929901,
-0.3666170537471771,
0.1575765311717987,
... | |
little more difficult to read, especially when I have a large amount of columns to convert.
I thought I'd use an extension to the string class and generic's to pass in the type, this is because it could be a double, or an int, or a long. So I tried this:
```
public static class GenericExtension
{
public static Nu... | [
0.24508075416088104,
-0.5323804020881653,
0.5162830948829651,
-0.09934180974960327,
-0.21916607022285461,
0.15561559796333313,
0.3482331335544586,
-0.26387619972229004,
-0.035638902336359024,
-0.4687451422214508,
-0.0994969829916954,
0.522454023361206,
-0.3958359360694885,
0.29120576381683... | |
return (Nullable<T>)s;
}
return null;
}
}
```
But I get the error: Cannot convert type 'string' to 'T?'
Is there a way around this? I am not very familiar with creating methods using generics.
Another thing to keep in mind is that the string itself might be null.
```
public static Nullable<T> To... | [
0.1533292979001999,
-0.4373728632926941,
0.06126362457871437,
-0.11238602548837662,
-0.04120663180947304,
0.01674562692642212,
0.5873092412948608,
-0.31536489725112915,
-0.3445659577846527,
-0.44548502564430237,
-0.2803100347518921,
0.5301803946495056,
-0.3998568654060364,
0.41949591040611... | |
{
TypeConverter conv = TypeDescriptor.GetConverter(typeof(T));
result = (T)conv.ConvertFrom(s);
}
}
catch { }
return result;
}
``` | [
0.08812081068754196,
-0.371959924697876,
0.45930173993110657,
-0.3164494037628174,
0.06734001636505127,
0.08476102352142334,
0.24764510989189148,
-0.3168398141860962,
0.003971840254962444,
-0.39254310727119446,
-0.37586721777915955,
0.5450083017349243,
-0.6331067085266113,
0.23030455410480... | |
Are there any best practices to column ordering when designing a database? Will order effect performance, space, or the ORM layer?
I am aware of [SQL Server - Does column order matter?](https://stackoverflow.com/questions/34818/sql-server-does-column-order-matter). I am looking for more general advice.
I don't believe... | [
0.08954918384552002,
0.2485715001821518,
0.33269962668418884,
0.16134443879127502,
0.0667780265212059,
-0.015590683557093143,
-0.20717620849609375,
-0.029608791694045067,
-0.3319001793861389,
-0.485983669757843,
0.032714612782001495,
0.3806951642036438,
-0.23572790622711182,
0.050471693277... | |
I can see benefits in both, but I would tend to go for the "logically" method. | [
0.3104863166809082,
0.12657320499420166,
-0.34918224811553955,
0.22424164414405823,
0.040023960173130035,
0.0928400531411171,
-0.038060929626226425,
-0.06301231682300568,
0.25307849049568176,
-0.36612367630004883,
0.22235922515392303,
0.6387989521026611,
0.17566248774528503,
0.061459407210... | |
I'm looking for a fast and reliable way to read/parse large PDF files in Ruby (on Linux and OSX).
Until now I've found the rather old and simple [PDF-toolkit](http://pdf-toolkit.rubyforge.org/) (a [pdftotext](http://en.wikipedia.org/wiki/Pdftotext)-wrapper) and [PDF-reader](http://github.com/yob/pdf-reader/tree/maste... | [
0.175328329205513,
0.17788243293762207,
0.1859292984008789,
0.08266916126012802,
-0.30297738313674927,
-0.3147162199020386,
0.2970615029335022,
-0.13686755299568176,
-0.3201816976070404,
-0.5978783965110779,
0.00975627452135086,
0.5320102572441101,
-0.3202119767665863,
0.21814195811748505,... | |
page images or thumbnails in any format, PDFs, single pages, and document metadata (title, author, number of pages...) | [
0.09350903332233429,
0.1797904372215271,
0.7692351341247559,
0.4081036448478699,
0.055145520716905594,
-0.3536958396434784,
-0.11009365320205688,
0.12899327278137207,
-0.40691694617271423,
-0.8259761929512024,
-0.8458951711654663,
0.12468568235635757,
0.05882212892174721,
0.186245322227478... | |
I sometimes get emails that I want to keep but to move them into the appropriate folder can be a pain. How can I execute a script that will move (like using C-S-v) the email I'm looking at into a certain folder called "buffer", for instance?
I'm using Outlook 2007.
thanks.
---
EDIT:
there isn't any criteria that ca... | [
-0.15559400618076324,
0.031916506588459015,
0.37180984020233154,
-0.21727688610553741,
-0.22335714101791382,
0.08143045008182526,
-0.02441474236547947,
0.025684183463454247,
-0.32977843284606934,
-0.6847403049468994,
-0.054889898747205734,
0.11913696676492691,
-0.042907100170850754,
-0.328... | |
As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem
Set objNS = Application.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
'For the "Item" portion, I used the name of the folder exactly as it appear in the ToolTip when I hover over it.
Set ob... | [
-0.4262882471084595,
-0.3098435401916504,
0.6151703596115112,
-0.36214178800582886,
-0.24434401094913483,
0.20080851018428802,
0.37368345260620117,
-0.13961651921272278,
-0.3033791184425354,
-0.7032711505889893,
-0.36937999725341797,
0.26843541860580444,
-0.5149077773094177,
0.045972499996... | |
= 0 Then
'Require that this procedure be called only when a message is selected
Exit Sub
End If
For Each objItem In Application.ActiveExplorer.Selection
If objFolder.DefaultItemType = olMailItem Then
If objItem.Class = olMail Then
objItem.Move objFolder | [
-0.46530383825302124,
-0.34004899859428406,
0.7206581234931946,
-0.36458447575569153,
0.022831670939922333,
0.3662605881690979,
0.4275767207145691,
-0.22179466485977173,
-0.03564094752073288,
-0.6435161828994751,
-0.5329157114028931,
0.020457390695810318,
-0.737108051776886,
0.282855004072... | |
End If
End If
Next
``` | [
-0.02554926648736,
0.24063682556152344,
0.3380225896835327,
-0.09491945058107376,
-0.0836857482790947,
-0.3006778061389923,
0.03160878270864487,
-0.04126816615462303,
-0.024205127730965614,
-0.5237504839897156,
-0.3239850699901581,
0.18732497096061707,
-0.1384630650281906,
0.25397759675979... | |
I want to draw some data into a texture: many items in a row. They aren't created in order, and they may all be different sizes (think of a memory heap). Each data item is a small rectangle and I want to be able to distinguish them apart, so I'd like each of them to have a unique colour.
Now I could just use rand() to... | [
0.3005676567554474,
0.006951162125915289,
-0.05944237858057022,
0.1403367519378662,
-0.11578603833913803,
0.499944269657135,
-0.3226240575313568,
-0.12460005283355713,
-0.5712795853614807,
-0.8934283256530762,
0.38368189334869385,
0.2657632827758789,
-0.19854533672332764,
0.143018960952758... | |
through different colours before they (nearly) repeat?
The colours don't have to match with any data in the items. I just want to be able to look at many values and see that they are different, as they are adjacent.
I could figure something out but I think this is an interesting question. :)
Using the RGB color mode... | [
0.5383955836296082,
-0.10499650985002518,
0.44969871640205383,
0.10281927138566971,
-0.15326377749443054,
-0.20486068725585938,
0.29042330384254456,
-0.209981769323349,
-0.3606434464454651,
-0.7244255542755127,
-0.006343345623463392,
0.3853283226490021,
-0.22372858226299286,
0.301767081022... | |
want to vary the [Hue](http://en.wikipedia.org/wiki/Hue).
If you want X different color values, vary them from 0 to 360 with a step size of 360 divided by X. | [
0.5535469055175781,
-0.28936052322387695,
0.15494202077388763,
0.06369783729314804,
0.09638650715351105,
0.39814385771751404,
0.011858421377837658,
-0.16816940903663635,
-0.26878759264945984,
-0.5453370213508606,
0.21048885583877563,
0.48804354667663574,
-0.3127014935016632,
0.074241064488... | |
I have few subreports in a sql main report(.rdl file) using `VS`/`SSRS 2008`.
The subreports start approximately on the middle of the page in the main report detail section. I have one group in main report, shows header information and pass one parameter - `ReportID` to each subreport.
I also have checked both:
... | [
-0.11534236371517181,
0.20865236222743988,
0.5494595766067505,
0.053531989455223083,
-0.27247872948646545,
0.01943271979689598,
0.4105187654495239,
-0.22679945826530457,
0.03937091678380966,
-0.7982723116874695,
-0.11708936840295792,
0.32725977897644043,
-0.08858203887939453,
0.02963810414... | |
on page one, everything is ok.
If I have more detail lines in the subreport so that it's not possible to print all on one page, the subreport renders from the fist page and moves on to page two, three and so on.
When I have more than one page of data in the subreport, it is also started on page one, and continues r... | [
-0.11485335230827332,
0.15436148643493652,
0.7820423245429993,
0.033287279307842255,
-0.2242797613143921,
-0.0026502138935029507,
0.08204459398984909,
-0.05961013212800026,
-0.3900340795516968,
-0.633943498134613,
-0.2762763202190399,
0.5481593012809753,
-0.15767288208007812,
0.05771578475... | |
it prints column header only on the first page but not any subsequent page and so on...
I also tried to check only ONE, either
1. Row Headers – “Repeat header rows on each page” OR
2. Column Headers – “Repeat header columns on each page”
on general tab of Tablix properties of the main report BUT didn’t work?
Any i... | [
0.4777912199497223,
0.4141714572906494,
0.722880482673645,
-0.15073275566101074,
-0.3884578347206116,
-0.1364976018667221,
0.028288310393691063,
-0.5596500635147095,
-0.024087542667984962,
-0.4576472342014313,
0.4159392714500427,
0.49308186769485474,
-0.2135726511478424,
-0.061146307736635... | |
something more to your liking :-) | [
0.40794485807418823,
-0.14969956874847412,
0.31435659527778625,
0.2793594002723694,
0.2515076994895935,
-0.037890348583459854,
-0.09736577421426773,
0.5927854776382446,
-0.053841691464185715,
-0.254806250333786,
-0.09257646650075912,
0.305833101272583,
0.04554767161607742,
-0.1499767154455... | |
Is it possible to customize the window used in Outlook to type in meetings (calendar tab) to add new fields to it ?
That data would be stored in Exchange, then queried by another app that would do something with it.
My problem is to see how I could affect the meeting edit dialog as it is now, to add my new fields.
A... | [
0.43382859230041504,
-0.11169295758008957,
0.43993017077445984,
0.20621541142463684,
0.31633543968200684,
-0.16191668808460236,
0.04304490610957146,
0.03730624169111252,
-0.16579675674438477,
-0.5988600850105286,
0.3300813138484955,
0.4334878623485565,
-0.3085940182209015,
-0.0804810523986... | |
switchType="System.Diagnostics.SourceSwitch" >
<listeners>
<add name="console" />
<remove name ="Default" />
</listeners>
</source>
</sources>
<switches>
<!-- You can set the level at which tracing is to occur -->
<add name="SourceSwitch" value="Warning" />
... | [
0.5484926104545593,
-0.4639725387096405,
0.54534512758255,
0.36750027537345886,
0.1453908532857895,
-0.5000258684158325,
0.23433953523635864,
-0.35608386993408203,
-0.08672834932804108,
-0.6407302618026733,
0.18296347558498383,
0.325412780046463,
-0.17496752738952637,
-0.04332735389471054,... | |
can turn tracing off -->
<!--add name="SourceSwitch" value="Off" -->
</switches>
<sharedListeners>
<add name="console"
type="System.Diagnostics.ConsoleTraceListener"
initializeData="false"/>
</sharedListeners>
<trace autoflush="true" indentsize="4">
<listeners>
... | [
0.6664597392082214,
-0.2570488452911377,
0.39429181814193726,
0.2737123668193817,
0.316120445728302,
-0.18068668246269226,
0.3491516411304474,
-0.3857220411300659,
0.10764440894126892,
-0.7373712062835693,
0.09170535206794739,
0.601772129535675,
-0.07088042795658112,
0.2338632494211197,
... | |
from `System.Diagnostics.ConsoleTraceListener` to any other trace listener, e.g. to log to the system's EventLog or to trace to a custom application. | [
0.20042650401592255,
-0.2965104281902313,
0.043440211564302444,
0.26115748286247253,
0.2794640064239502,
-0.2903560698032379,
0.10139717161655426,
0.05959189310669899,
-0.03420179337263107,
-0.4107813239097595,
-0.335613876581192,
0.3391473889350891,
-0.06076715514063835,
0.158451020717620... | |
Trying to do the following:
```
order.ExpirationDate =(DateTime) ( ExpMonth + "/" + ExpYear);
```
ExpMonth, Expyear are both ints.
This is going to be better for you:
```
order.ExpirationDate = new DateTime(ExpYear, ExpMonth, 1)
``` | [
0.1953975260257721,
-0.375778466463089,
0.6795551776885986,
-0.42768147587776184,
0.32026004791259766,
0.04097863659262657,
0.11278732866048813,
-0.057201750576496124,
-0.2338835448026657,
-0.5277785658836365,
-0.2276107519865036,
0.5681576132774353,
-0.3155547082424164,
0.2337633222341537... | |
What is the best way to convert an array of bytes declared as TBytes to a RawByteString in Delphi 2009? This code actually works, maybe there is a faster way (without loop):
```
function Convert(Bytes: TBytes): RawByteString;
var
I: Integer;
begin
SetLength(Result, Length(Bytes));
for I := 0 t... | [
-0.16154314577579498,
-0.4219679832458496,
0.5500865578651428,
-0.19368956983089447,
-0.27657273411750793,
0.12546300888061523,
0.2065519392490387,
-0.48502254486083984,
-0.17822641134262085,
-0.6255828142166138,
0.031215228140354156,
0.5199797749519348,
-0.3956856429576874,
-0.09554205834... | |
Length(Bytes))
end;
```
And use "const" for the parameter so the array is not copied twice. | [
0.1106732040643692,
-0.1577814817428589,
0.4627985656261444,
-0.13269133865833282,
-0.08163590729236603,
-0.05917511507868767,
0.03805676847696304,
-0.20846502482891083,
-0.16278527677059174,
-0.17239859700202942,
-0.08458255976438522,
0.4263983368873596,
-0.2689970135688782,
0.20293185114... | |
This is all asp.net c#.
I have an enum
```
public enum ControlSelectionType
{
NotApplicable = 1,
SingleSelectRadioButtons = 2,
SingleSelectDropDownList = 3,
MultiSelectCheckBox = 4,
MultiSelectListBox = 5
}
```
The numerical value of this is stored in my database. I display this value in a data... | [
-0.10891050845384598,
0.04187558591365814,
0.6613167524337769,
0.08088290691375732,
-0.1300961971282959,
-0.09531767666339874,
0.11390586942434311,
-0.5615644454956055,
0.0032814110163599253,
-0.5596387982368469,
-0.05323038622736931,
0.13739429414272308,
-0.573197603225708,
-0.13058152794... | |
lot better... However, it would be great if there was a simple function I can put around the Enum to split it by Camel case so that the words wrap nicely in the datagrid.
Note: I am fully aware that there are better ways of doing all this. This screen is purely used internally and I just want a quick hack in place to ... | [
0.44824957847595215,
0.08830776065587997,
0.4007449448108673,
0.01075455266982317,
-0.07253636419773102,
-0.06277161836624146,
0.09518028795719147,
0.11472143977880478,
-0.25406715273857117,
-0.8978109359741211,
0.07259862124919891,
0.793863832950592,
0.03461996093392372,
0.074639216065406... | |
using System.ComponentModel;
using System.Reflection;
```
...
```
public static string GetDescription(System.Enum value)
{
FieldInfo fi = value.GetType().GetField(value.ToString());
DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttrib... | [
0.19796960055828094,
-0.3437734544277191,
0.6755892038345337,
-0.003737999824807048,
0.32358449697494507,
0.03610215708613396,
0.12418331205844879,
-0.5721069574356079,
-0.062467169016599655,
-0.5497621893882751,
-0.35969090461730957,
0.7828379273414612,
-0.36999180912971497,
0.15374973416... | |
ControlSelectionType
{
[Description("Not Applicable")]
NotApplicable = 1,
[Description("Single Select Radio Buttons")]
SingleSelectRadioButtons = 2,
[Description("Completely Different Display Text")]
SingleSelectDropDownList = 3,
}
```
Taken from
<http://www.codeguru.com/forum/archive/index.... | [
0.20320256054401398,
-0.18979203701019287,
0.6143705248832703,
0.2448892742395401,
0.15623518824577332,
-0.1910691112279892,
0.0667647272348404,
-0.8296284675598145,
-0.13803376257419586,
-0.19904392957687378,
-0.09790417551994324,
0.3994947075843811,
-0.6221398711204529,
-0.07646397501230... | |
If I have a credit number that is an int and I just want to display the last 4 numbers with a \* on the left, how would I do this in C#?
For example, 4838382023831234 would shown as \*1234
```
// assumes that ccNumber is actually a string
string hidden = "*" + ccNumber.Substring(ccNumber.Length - 4);
``` | [
0.3537532091140747,
0.17903588712215424,
0.21162939071655273,
-0.07867727428674698,
0.21614255011081696,
-0.05347295105457306,
0.05942784994840622,
-0.315398633480072,
-0.3028596043586731,
0.016595272347331047,
0.14534743130207062,
0.7086912989616394,
-0.1007419005036354,
0.300036936998367... | |
I need a structure to hold a value based on a key that has a range.
My implementation is C++, so any STL or Boost would be excellent.
I have as range-key, which are doubles, and value
* [0,2) -> value1
* [2,5) -> value2
* [5,10) -> value3
* etc
Such that a search of 1.23 should return value1, and so on.
Right now I... | [
0.08109745383262634,
0.10204988718032837,
0.45677468180656433,
-0.057780999690294266,
-0.03886788710951805,
-0.02782483398914337,
0.2238902896642685,
-0.4320647716522217,
-0.04505394399166107,
-0.6892542243003845,
0.004447671119123697,
0.7182020545005798,
-0.1762276291847229,
-0.0353642776... | |
work just fine. Thanks for the class Range solutions as well, they are filed away for future reference.
If your ranges are contiguous and non-overlapping, you should use std::map and the upper\_bound member function. Or, you could use a sorted vector with the upper\_bound algorithm. Either way, you only need to record ... | [
-0.015229823999106884,
-0.07804962247610092,
0.31205111742019653,
0.0017564981244504452,
0.16405418515205383,
-0.029078567400574684,
-0.1527484655380249,
-0.15684151649475098,
-0.3745184540748596,
-0.7492336630821228,
-0.0786239504814148,
0.5305206179618835,
-0.5233998894691467,
-0.0050563... | |
std::map<double, double> MyMap;
MyMap lookup;
lookup.insert(std::make_pair(0.0, dummy_value));
lookup.insert(std::make_pair(2.0, value1));
lookup.insert(std::make_pair(5.0, value2));
lookup.insert(std::make_pair(10.0, value3));
MyMap::iterator p = lookup.upper_bound(1.23);
if (p == lookup.begin() || p == lookup.end())
... | [
-0.4616502523422241,
-0.14586785435676575,
0.5726222991943359,
-0.15930922329425812,
0.08990001678466797,
0.10328342020511627,
0.31680405139923096,
-0.8207730650901794,
-0.27302929759025574,
-0.4538959264755249,
-0.6100627183914185,
0.6385159492492676,
-0.41328561305999756,
-0.101859703660... | |
I tried :
```
UPDATE closure JOIN item ON ( item_id = id )
SET checked = 0
WHERE ancestor_id = 1
```
And:
```
UPDATE closure, item
SET checked = 0
WHERE ancestor_id = 1 AND item_id = id
```
Both works with MySQL, but those give me a syntax error in SQLite.
How can I make this UPDATE / JOIN works with SQLite ... | [
-0.138099804520607,
0.1757727861404419,
0.569482147693634,
-0.24982888996601105,
-0.1256212294101715,
0.11621933430433273,
0.38090410828590393,
-0.1810600906610489,
-0.2030467689037323,
-0.6838863492012024,
0.19950687885284424,
0.38824573159217834,
-0.5618942975997925,
0.3163987100124359,
... | |
your schema is. | [
0.3082282841205597,
0.12414149194955826,
0.025680163875222206,
0.021861538290977478,
0.18690472841262817,
-0.1458137035369873,
0.11818993836641312,
-0.1997642070055008,
-0.10370221734046936,
-0.6746902465820312,
-0.052335355430841446,
0.33558106422424316,
-0.13878338038921356,
0.0259485505... | |
Sometimes my iPhone application crashes with a weird crashlog, that reads exception code is 0x8badf00d. The stacktraces show random snapshots of app execution, but nothing suspicious. This happens very rarely and I'm not able to find out how to reproduce it. Does anybody know more about this kind of exception and excep... | [
-0.0031217061914503574,
0.5183055400848389,
0.06399999558925629,
0.00045114426757209003,
0.14099425077438354,
0.008301030844449997,
0.543687105178833,
0.4175132215023041,
-0.5173566937446594,
-0.5380988717079163,
0.00826285220682621,
0.2917937636375427,
-0.3670584261417389,
0.0265713240951... | |
>
> < nothing suspicious here >
>
> ...
>
>
> Unknown thread crashed with unknown flavor: 5, state\_count: 1
`0x8badf00d` is the error code that the watchdog raises when an application takes too long to launch or terminate. See Apple's [Crash Reporting for iPhone OS Applications](http://developer.apple.com/ipho... | [
0.18775629997253418,
0.21483469009399414,
0.11003181338310242,
-0.07425553351640701,
0.3066656291484833,
-0.11900592595338821,
0.5372720956802368,
0.0043127997778356075,
-0.4045518636703491,
0.05716549977660179,
-0.13007752597332,
0.23929183185100555,
-0.2662305533885956,
0.095750220119953... | |
This is such a dumb question it's frustrating even asking it. Please, bear with me, I'm feeling particularly dumb over this one today....
I've got a library with a certain typedef struct. basically:
```
typedef struct {int x; int y;} coords;
```
What I really wanted to do was declare in my header a variable array... | [
-0.14888200163841248,
0.39748522639274597,
0.21569965779781342,
0.02045510523021221,
-0.009052639827132225,
-0.15137618780136108,
0.02307414636015892,
-0.004153142217546701,
-0.12433997541666031,
-0.3679647445678711,
0.25808873772621155,
0.2961609959602356,
-0.25252681970596313,
0.11882404... | |
not letting me do any manner of simply putting in even something simple like `MyCoords[0] = {0, 0}`
sorry about some of the syntax above. Thanks for any help. I don't even care about hard-coding all the values at once. I'm now fine with just geting `MyCoords[0] = {0, 0}` working. I could do `MyCoords[0].x = 0; MyCoord... | [
0.4855966866016388,
0.11054189503192902,
-0.09778512269258499,
0.29782429337501526,
-0.03343285620212555,
-0.26802679896354675,
0.44049838185310364,
0.07563278079032898,
-0.11133956909179688,
-0.3280341327190399,
0.06377297639846802,
0.49088814854621887,
-0.31555691361427307,
0.26407560706... | |
defined in C++. What you can do is to make it just a declaration by putting `extern` before it.
```
extern coords MyCoords[];
```
Then, in the .cpp file that initializes it, you can then create (define) that array - beware you should do it at namespace scope, outside any function, of course:
```
coords MyCoords[] ... | [
0.041391339153051376,
0.013804842717945576,
0.42289766669273376,
-0.09875568747520447,
0.1452699899673462,
-0.2011484056711197,
0.02189819887280464,
-0.13261957466602325,
-0.1034943014383316,
-0.3759341537952423,
-0.2114233523607254,
0.7110922932624817,
-0.7151386737823486,
-0.162789866328... | |
array and then initialize the vector using a copy of the elements of that array:
```
coords c[] = ....;
MyCoords.insert(MyCoords.end(), c, c + sizeof c / sizeof *c);
```
Well, in C, it is slightly different than in C++. You *can* define an array whose dimension isn't known. What happens is that it's taken to be a "t... | [
0.020260218530893326,
-0.05038788914680481,
0.17121946811676025,
-0.25638818740844727,
-0.19801867008209229,
-0.015326060354709625,
-0.018278004601597786,
-0.36749425530433655,
-0.26630809903144836,
-0.47641709446907043,
-0.22914046049118042,
0.38922905921936035,
-0.3591281473636627,
0.019... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.