text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
return $fileList
}
``` | [
0.022548221051692963,
0.5167262554168701,
-0.08391544967889786,
-0.236145481467247,
0.25090959668159485,
-0.23511266708374023,
0.16959616541862488,
0.12779425084590912,
-0.11655064672231674,
-0.4698471128940582,
-0.32522517442703247,
0.6350390315055847,
-0.3850615322589874,
0.2926885187625... | |
I'm using Instruments to try to determine if there are places in my application that I could be more efficient with use of memory. I've taken the time to get somewhat familiar with Instruments but I'm generally a newbie with hunting memory management issues having come from a Java background. I seem to be using about 1... | [
0.18145009875297546,
-0.16560965776443481,
0.4481307864189148,
-0.2632203996181488,
0.12050443142652512,
0.03900950029492378,
0.2940095067024231,
-0.5692909955978394,
-0.1369655877351761,
-0.6358728408813477,
0.21675561368465424,
0.4638492465019226,
0.1522461622953415,
0.14764679968357086,... | |
result = nil;
if (nil != (dateFormatter = [[NSDateFormatter allocWithZone:[self zone]] init])) {
[dateFormatter setDateFormat:format];
if (nil != (result = [dateFormatter stringFromDate:date])) {
[dateFormatter release];
return result;
}
[dateFormatter r... | [
0.17841611802577972,
-0.453152060508728,
0.8209162950515747,
-0.3386538028717041,
0.00042256785673089325,
-0.13425631821155548,
0.380691260099411,
-0.49640795588493347,
-0.19745926558971405,
-0.3874984681606293,
-0.40060022473335266,
0.39949682354927063,
0.14921629428863525,
0.552337706089... | |
the date formatter I'm wondering if the NSString *result* is my issue. It seems to me that the stringFromDate library call would return an autoreleased object so there's nothing I can do to 'manually' manage it. A bit unsure of how to optimize this method.
Is this method getting called a lot of times in a loop? Autorel... | [
0.28713518381118774,
-0.1611841917037964,
0.4792221188545227,
0.16753222048282623,
-0.041947998106479645,
-0.27263808250427246,
0.08209070563316345,
0.20735064148902893,
-0.5063481330871582,
-0.3874697983264923,
0.09819340705871582,
0.6759274005889893,
-0.38563844561576843,
0.1783020049333... | |
solution is to create your own NSAutoreleasePool in an appropriate place, and release it to clear up autoreleased objects. An extreme example that illustrates the point:
```
int i;
NSAutoreasePool* pool = nil;
for (i = 0; i < 1000000; ++i) {
/* Create a new pool every 10000 iterations */
if ((i % 10000) == 0) ... | [
-0.1365251988172531,
-0.40712451934814453,
0.253231942653656,
-0.011249706149101257,
0.34464001655578613,
-0.04991922527551651,
0.2509402334690094,
-0.30704572796821594,
-0.13898175954818726,
-0.46791335940361023,
-0.17135414481163025,
0.35296520590782166,
-0.438916951417923,
0.09745590388... | |
every 10,000 iterations and a new one is created. You can read more about memory management in the [Memory Management Programming Guide](http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/AutoreleasePools.html#//apple_ref/doc/uid/20000047) section on autorelease pools. | [
0.06059550493955612,
0.14237214624881744,
0.1545078456401825,
0.09602106362581253,
0.4376436173915863,
0.18557551503181458,
-0.01675470545887947,
-0.1520511656999588,
-0.778152585029602,
-0.42453962564468384,
0.0161773432046175,
0.40956440567970276,
-0.009035301394760609,
-0.00494629796594... | |
this is what I did. is there a better way in python?
```
for k in a_list:
if kvMap.has_key(k):
kvMap[k]=kvMap[k]+1
else:
kvMap[k]=1
```
Thanks
Use defaultdict
```
from collections import defaultdict
kvmap= defaultdict(int)
for k in a_list:
kvmap[k] += 1
``` | [
0.11929521709680557,
0.026712996885180473,
0.321073979139328,
-0.31239691376686096,
-0.19837306439876556,
-0.19409911334514618,
0.6593774557113647,
-0.38107216358184814,
-0.46473127603530884,
-0.38343513011932373,
-0.18604634702205658,
0.715644359588623,
-0.36157524585723877,
-0.0816419199... | |
I'm currently using ReSharper's 30-day trial, and so far I've been impressed with the suggestions it makes. One suggestion puzzles me, however.
When I explicitly define a variable, such as:
```
List<String> lstString = new List<String>();
```
ReSharped adds a little squiggly green line and tells me to:
> Use impli... | [
0.3667500913143158,
-0.15885640680789948,
0.3882560133934021,
-0.3564774990081787,
-0.1557796597480774,
0.0828012079000473,
0.2134094387292862,
-0.3199247419834137,
-0.16738834977149963,
-0.5080327987670898,
-0.06118195503950119,
0.6901518702507019,
-0.2707744836807251,
0.12094468623399734... | |
than using a dynamic, is more optimal.
> So, is there some sort of performance gain to be had from changing the List to a var
No but this is not the only valid reason for a refactoring. More importantly, it removes redundance and makes the code shorter without any loss in clarity.
> I've always been taught that expli... | [
0.2920650541782379,
-0.23359373211860657,
-0.19111491739749908,
-0.013457609340548515,
-0.3975437879562378,
0.07100092619657516,
0.2615763545036316,
-0.26158249378204346,
-0.10850103199481964,
-0.6416634917259216,
0.08463967591524124,
0.6324782371520996,
-0.48521995544433594,
-0.0827041789... | |
It's obviously capable of doing so, since this is the same mechanism used to test for type safety and correctness.
It also removes a completely useless code duplication. For simple types, this might not be much. But consider:
```
SomeNamespace.AndSomeVeryLongTypeName foo = new SomeNamespace.AndSomeVeryLongTypeName();... | [
0.2139892429113388,
0.1458691507577896,
0.16311028599739075,
-0.22194024920463562,
0.025244740769267082,
-0.3913956582546234,
0.36601635813713074,
-0.0949627086520195,
-0.12848113477230072,
-0.33984264731407166,
0.1216580793261528,
0.693226158618927,
-0.30258113145828247,
0.139635533094406... | |
I was wondering if there is a way (hopefully keyboard shortcut) to create auto generate function headers in visual studio.
Example:
```
Private Function Foo(ByVal param1 As String, ByVal param2 As Integer)
```
And it would automagically become something like this...
```
'----------------------------------
'Pre:
... | [
0.2371147722005844,
0.2520187497138977,
0.10565166920423508,
-0.023918572813272476,
-0.5179882645606995,
0.2390879988670349,
0.047273918986320496,
-0.5499359965324402,
-0.27523350715637207,
-0.3661803901195526,
-0.2830343544483185,
0.48847827315330505,
-0.37885749340057373,
-0.261546283960... | |
Greetings stackers,
I'm trying to come up with the best database schema for an application that lets users create surveys and present them to the public. There are a bunch of "standard" demographic fields that most surveys (but not all) will include, like First Name, Last Name, etc. And of course users can create an u... | [
0.236673504114151,
0.3449055552482605,
0.5211082696914673,
0.34897923469543457,
-0.1910323053598404,
-0.07617072761058807,
-0.14636462926864624,
-0.05534889176487923,
-0.329364538192749,
-0.22409558296203613,
0.14375819265842438,
0.16704775393009186,
-0.13907739520072937,
-0.03674738481640... | |
seems dangerously close to [Inner Platform Effect](http://thedailywtf.com/Articles/The_Inner-Platform_Effect.aspx)
An improvement would be to include as many fields as I can think of in advance in the responses table:
```
Responses
SurveyID
SubmitTime
FirstName
LastName
Birthdate
[...]
```
Then at least... | [
0.20868709683418274,
-0.07247254252433777,
0.5305771827697754,
-0.14149627089500427,
-0.038949113339185715,
0.3018735945224762,
0.28593167662620544,
0.012385828420519829,
-0.26923856139183044,
-0.6100128293037415,
0.07393642514944077,
0.0992346704006195,
0.39119449257850647,
0.150881022214... | |
I guess, a bitfield in Survey) AND what's in the SurveyQuestions table. And I have to worry about special cases, like if someone tries to create a "custom" question that duplicates a "common" question in the Responses table.
Is this the best I can do? Am I missing something?
Your first schema is the better choice of t... | [
0.3120039403438568,
-0.11854439973831177,
0.11964383721351624,
0.4301343262195587,
0.09183967858552933,
0.03204820305109024,
0.09248675405979156,
-0.22605285048484802,
-0.35528358817100525,
-0.6464625597000122,
0.2592371106147766,
0.6024444699287415,
0.10806339979171753,
-0.102901697158813... | |
solve a performance problem that may not even materialize is a bad decision.
Besides, many (perhaps most) survey results are only viewed periodically and by a small number of people (event organizers, administrators, etc.), so you won't constantly be querying the database for all of the results. And even if you were, ... | [
0.05686488747596741,
-0.13944801688194275,
-0.09613078087568283,
0.5806750655174255,
0.05540594831109047,
-0.03678865358233452,
0.2370140254497528,
-0.21974273025989532,
-0.19723336398601532,
-0.4910481572151184,
-0.23007094860076904,
0.5565569996833801,
-0.353065550327301,
-0.343133568763... | |
to three questions out of five hundred, that's a really simple SQL query. You could set up a cascading delete to automatically deleting responses and questions when a survey is deleted. Generating statistics will be much easier with this schema too.
Here is a slightly modified version of the schema you provided. I ass... | [
0.2355237603187561,
0.09222103655338287,
0.37134233117103577,
0.31488004326820374,
-0.12528985738754272,
-0.02054063230752945,
-0.09831230342388153,
-0.5125250816345215,
-0.37541860342025757,
-0.4606614410877228,
0.3539501130580902,
0.6421361565589905,
-0.17008191347122192,
0.1100780293345... | |
to surveys->survey_id)
question
responses
response_id (index, auto increment)
survey_id (link to surveys->survey_id)
submit_time
answers
answer_id (index, auto increment)
question_id (link to questions-question_id)
answer
``` | [
0.1141042411327362,
0.22343909740447998,
0.23349250853061676,
0.40800610184669495,
-0.3198621869087219,
0.2630314230918884,
0.17622755467891693,
-0.5368491411209106,
-0.19241029024124146,
-0.46534621715545654,
-0.2496408075094223,
0.33382749557495117,
-0.12553979456424713,
-0.0589619129896... | |
I distinctly remember that, at one time, the guideline pushed by Microsoft was to add the "Base" suffix to an abstract class to obviate the fact that it was abstract. Hence, we have classes like `System.Web.Hosting.VirtualFileBase`, `System.Configuration.ConfigurationValidatorBase`, `System.Windows.Forms.ButtonBase`, a... | [
0.5291675925254822,
0.0627015233039856,
0.2327421009540558,
0.1146518811583519,
-0.023915821686387062,
-0.1358328014612198,
0.05357859283685684,
0.05690217390656471,
-0.11640604585409164,
-0.6630219221115112,
0.05939378961920738,
0.4560627341270447,
-0.18076808750629425,
0.2403719872236251... | |
to say, to make sure I wasn't crazy. I found the [Names of Classes, Structs, and Interfaces](http://msdn.microsoft.com/en-us/library/ms229040.aspx) on MSDN at [Design Guidelines for Developing Class Libraries](http://msdn.microsoft.com/en-us/library/ms229042.aspx). Oddly, I can find no mention of the guideline to add "... | [
0.45374470949172974,
0.10315863788127899,
-0.0148890046402812,
0.28401973843574524,
0.037876829504966736,
-0.5744544863700867,
0.5680207014083862,
0.42832911014556885,
-0.4126438796520233,
-0.11939705163240433,
0.1527627557516098,
-0.07300154864788055,
-0.012352819554507732,
0.462991505861... | |
The guideline existed. [Krzysztof Cwalina gripes about it in 2005.](https://learn.microsoft.com/en-us/archive/blogs/kcwalina/i-dont-like-the-base-suffix)
In [Framework Design Guidelines](http://www.amazon.co.uk/Framework-Design-Guidelines-Conventions-Libraries/dp/0321246756/ref=sr_1_2?ie=UTF8&qid=1231531546&sr=8-2) p 1... | [
0.319425106048584,
-0.12193272262811661,
0.483178973197937,
-0.12876366078853607,
-0.3372195363044739,
-0.31041884422302246,
0.6406121850013733,
-0.4285500645637512,
0.09425511211156845,
0.06874433159828186,
-0.17065908014774323,
-0.04068603366613388,
-0.2889522314071655,
0.292690545320510... | |
I have a client/server application. One of the clients is a CLI. The CLI performs some basic validation then makes SOAP requests to a server. The response is interpreted and relevant information presented to the user. Every command involved a request to a web service.
Every time services are modified server-side, a ne... | [
0.4062742590904236,
0.16823603212833405,
0.5233866572380066,
-0.0456676222383976,
-0.1112985834479332,
-0.005707700736820698,
0.06508749723434448,
-0.1311369240283966,
-0.021733207628130913,
-0.36261701583862305,
0.06924852728843689,
0.3207565248012543,
-0.17423540353775024,
0.291846811771... | |
the server's cooperation.)
I feel in my case this would simplify development and reduce maintenance work.
Are there pitfalls I am overlooking?
**UPDATE**
Scalability issues are not a high priority.
I think this is really just a matter of taste. The validation has to happen somewhere; you're just trading off complex... | [
0.4396989941596985,
0.3237292170524597,
0.3912249505519867,
0.15530237555503845,
0.04155735298991203,
0.09011659026145935,
0.5697839260101318,
0.16524198651313782,
-0.2654390037059784,
-0.5822668075561523,
0.16295713186264038,
0.6609607934951782,
-0.03895776346325874,
-0.1213696300983429,
... | |
CLI validation is doing the same things as some of your services (parsing numbers, for example), then refactor to avoid the duplication. | [
0.38420960307121277,
0.1110910028219223,
0.3684164881706238,
0.5224320292472839,
0.1289324164390564,
-0.4022744297981262,
-0.0385185182094574,
-0.2984394133090973,
-0.1422504484653473,
-0.26893118023872375,
0.2788238525390625,
0.2918459177017212,
-0.14798609912395477,
-0.20812681317329407,... | |
So I've got a for loop that processes a list of IDs and has some fairly complex things to do. Without going into all the ugly details, basically this:
```
DECLARE
l_selected APEX_APPLICATION_GLOBAL.VC_ARR2;
...snip...
BEGIN
-- get the list ids
l_selected := APEX_UTIL.STRING_TO_TABLE(... | [
0.28234755992889404,
0.001306572463363409,
0.4827977418899536,
-0.00001088245971914148,
0.23727908730506897,
0.05278467759490013,
-0.2002250850200653,
-0.21614009141921997,
-0.37500637769699097,
-0.5886701941490173,
0.06983949989080429,
0.409047394990921,
-0.4111047387123108,
0.00236880057... | |
-- do some data checking stuff...
-- here we will look for duplicate entries, so we can noop if duplicate is found
BEGIN
SELECT county_id INTO v_dup_check FROM org_county_accountable
WHERE organization_id = :P4_ID AND county_id = v_county_id;
-- NEXT;! NOOP;! but there is ... | [
0.07893416285514832,
0.04461317136883736,
0.4551594853401184,
0.472586452960968,
0.15548665821552277,
-0.3229616582393646,
0.10465704649686813,
0.09920450299978256,
-0.5660483837127686,
-0.7907931804656982,
-0.08071396499872208,
0.10227924585342407,
-0.02709149941802025,
0.0553768128156662... | |
dbms_output.put_line('no dups found, proceeding');
END;
-- here we have code we only want to execute if there are no dupes already
IF v_dup_check IS NULL THEN
-- if not a duplicate record, proceed...
ELSE
-- reset duplicate check variable | [
0.33862975239753723,
-0.22631196677684784,
0.17760808765888214,
0.0036704710219055414,
0.08362673223018646,
0.06509705632925034,
0.42904606461524963,
-0.26934516429901123,
-0.22999027371406555,
-0.4580404758453369,
-0.22205372154712677,
0.3890414237976074,
-0.5140613913536072,
0.3908718824... | |
v_dup_check := NULL;
END;
END LOOP;
END;
```
How I normally handle this is by selecting into a value, and then wrap the following code in an IF statement checking to make sure that duplicate check variable is NULL. But it's annoying. I just want to be able to say NEXT; or NOOP; or something. Especia... | [
0.6011220216751099,
0.09931604564189911,
0.4132571816444397,
-0.2489800602197647,
-0.06528771668672562,
-0.22624273598194122,
0.3818812370300293,
-0.1693035513162613,
-0.18873432278633118,
-0.5557947158813477,
0.03603183478116989,
0.5336783528327942,
-0.38683509826660156,
0.437673658132553... | |
this in a function, too, but I was looking for something a little cleaner/simpler.
To count the number of rows is also possible (see Pourquoi Litytestdata) but you can also do what you want to do in the `when_no_data_found exception` block.
```
declare
l_selected apex_application_global.vc_arr2;
l_county_id ... | [
-0.14874784648418427,
-0.18052755296230316,
0.6609647870063782,
0.0013052013237029314,
-0.0022432792466133833,
-0.04874805733561516,
-0.2919386923313141,
0.020562291145324707,
-0.3907933235168457,
-0.7120357155799866,
-0.23819245398044586,
0.16413255035877228,
-0.36551928520202637,
-0.0310... | |
:p4_id
and county_id = v_county_id;
exception
when no_data_found then
-- here we have code we only want to execute if there are no dupes already
-- if not a duplicate record, proceed...
end;
end loop;
end;
``` | [
0.2849031984806061,
0.1565207839012146,
0.2656846344470978,
0.23275043070316315,
0.3111768364906311,
-0.14247816801071167,
0.4192858636379242,
-0.1970633566379547,
-0.39793986082077026,
-0.1766107827425003,
-0.5291661620140076,
0.20040684938430786,
-0.2658061385154724,
0.31991806626319885,... | |
I want to proxy all requests to Mongreel except for a few ruby apps that are running with fastcgi on apache.
So basically i have <http://domain.com/> Mongreel app
<http://domain.com/appa> ruby app handled by apache
<http://domain.com/app_testb> ruby app handled by apache
My httpd.conf looks like this:
```
Rewr... | [
0.24569183588027954,
0.24209994077682495,
0.5036360621452332,
-0.11176255345344543,
-0.30871450901031494,
0.02916533127427101,
0.5515143275260925,
-0.2308376580476761,
-0.1424655318260193,
-0.7081425786018372,
0.04636788368225098,
0.5769880414009094,
-0.23470182716846466,
0.159525737166404... | |
/ http://127.0.0.1:port/
``` | [
0.14477942883968353,
0.23190385103225708,
0.34787026047706604,
-0.22256244719028473,
0.30068930983543396,
0.08040673285722733,
0.07207456976175308,
0.5902602672576904,
-0.4629388153553009,
-0.4521438181400299,
-0.05586126446723938,
0.5299022197723389,
-0.0244661346077919,
0.603885054588317... | |
> **Possible Duplicate:**
>
> [What's the use/meaning of the @ character in variable names in C#?](https://stackoverflow.com/questions/91817/whats-the-use-meaning-of-the-character-in-variable-names-in-c)
I understand that the @ symbol can be used before a string literal to change how the compiler parses the string.... | [
0.14338675141334534,
0.14928144216537476,
0.14842994511127472,
-0.07822433859109879,
-0.0947943851351738,
-0.002370207104831934,
0.05292648449540138,
-0.021312370896339417,
-0.11899667978286743,
-0.42040595412254333,
-0.0015068904031068087,
0.6028370261192322,
-0.27422624826431274,
-0.0573... | |
Is there a lightweight process execution timer like Unix's [time](http://en.wikipedia.org/wiki/Time_(Unix)) included with Windows? Sometimes I just want a rough estimate, without having to get out a real profiler. While I could roll my own, I would prefer to use an existing solution.
You can grab a release of cygwin at... | [
0.2995637059211731,
0.09561560302972794,
-0.1441672295331955,
0.07800626009702682,
0.031232554465532303,
-0.18399342894554138,
-0.09867296367883682,
0.32921141386032104,
-0.31851354241371155,
-0.5341083407402039,
0.1807735711336136,
0.593408465385437,
0.1540907472372055,
0.0455471538007259... | |
I trying to export an HTML table named Table that is dynamically binded to ViewData.Model in C#. I have a method called export that is called based on another method's actions. so everything before that is set up.. I just don't know how to export the data to a CSV or Excel file.. So when the I step inside the Export me... | [
0.2336714267730713,
0.21046404540538788,
0.22514240443706512,
-0.22891034185886383,
-0.11906162649393082,
-0.07008872926235199,
0.33260029554367065,
-0.15451309084892273,
-0.3084033131599426,
-0.6897510290145874,
0.042494744062423706,
0.47594019770622253,
-0.769974946975708,
0.237053170800... | |
and need to be exported
StringWriter sw = new StringWriter();
//I don't believe any of this syntax is right, but if they have Excel export to excel and if not export to csv "|" delimeted
for(int i=0; i<List.Count;i++)
{
sw.WriteLine(List[i].ID+ "|" + List[i].Date + "|" + List[i].Desc... | [
0.10452374815940857,
-0.06413029879331589,
0.8196896910667419,
-0.29355448484420776,
0.0008398807258345187,
0.09366565942764282,
0.18801401555538177,
-0.5677160024642944,
-0.013476239517331123,
-0.6137433648109436,
-0.5261263251304626,
0.2650034427642822,
-0.4681358337402344,
0.24354559183... | |
Response.Write(sw);
Response.End();
}
```
I don't quite understand the whole "export an HTML table named Table that is dynamically binded to ViewData.Model" so I'll just ignore that and focus on your *Export(List<data> list)* method. Btw, you never really mentioned what was going wrong and where.
I see you ... | [
0.07189810276031494,
-0.03502284362912178,
0.4993670880794525,
-0.276231974363327,
-0.5714438557624817,
-0.01439026277512312,
0.23842225968837738,
-0.14228418469429016,
-0.4123689830303192,
-0.6636687517166138,
-0.0723235085606575,
0.47246378660202026,
-0.49915552139282227,
0.0646978691220... | |
based on your code.
```
public void Export(List<DataType> list)
{
StringWriter sw = new StringWriter();
//First line for column names
sw.WriteLine("\"ID\",\"Date\",\"Description\"");
foreach(DataType item in list)
{
sw.WriteLine(string.format("\"{0}\",\"{1}\",\"{2}\"",
... | [
0.08400629460811615,
-0.01751459576189518,
0.896703839302063,
-0.271573007106781,
0.19431598484516144,
0.19161735475063324,
0.1952076107263565,
-0.3342896103858948,
-0.05110440030694008,
-0.6261913776397705,
-0.1347222924232483,
0.4351951479911804,
-0.2852425277233124,
0.15319453179836273,... | |
item.Date,
item.Description));
}
Response.AddHeader("Content-Disposition", "attachment; filename=test.csv");
Response.ContentType = "text/csv";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
Response.Write(sw);
Response.End();
}
``` | [
-0.1445412039756775,
-0.14567014575004578,
0.7364600896835327,
-0.24020010232925415,
-0.0486682765185833,
0.07772846519947052,
0.2948482036590576,
-0.2607761025428772,
-0.26886966824531555,
-0.5746543407440186,
-0.8704617023468018,
0.28310632705688477,
-0.3938468396663666,
0.46013349294662... | |
Anyone have any experience evaluating BlazeDS and GraniteDS? I'm curious about which is better at integrating with Spring/Hibernate.
If you are just looking for simple RPC and messaging, I would go with Blaze. The implementations are more mature and better proven, especially with respect to messaging. The messaging in ... | [
0.3984861671924591,
-0.17290952801704407,
-0.1037367507815361,
0.17830541729927063,
-0.789417028427124,
-0.17444394528865814,
0.5195528268814087,
-0.35497385263442993,
-0.01794140785932541,
-0.45802825689315796,
0.048491187393665314,
0.33625876903533936,
-0.07726487517356873,
-0.2516623735... | |
code. It doesn't offer any additional support for things Hibernate-related.
Granite DS is growing rapidly in terms of features. It competes more with LCDS than Blaze DS. It includes the ability to parse Hibernate object graphs and deal with lazy proxies in a clean fashion. They also have a tool called "Tide" that crea... | [
0.4580858051776886,
-0.08074982464313507,
0.06209709867835045,
0.20523017644882202,
-0.6446868777275085,
0.0009325668215751648,
0.8810089230537415,
-0.052278533577919006,
-0.2508583962917328,
-0.5705982446670532,
0.12186029553413391,
0.2917090058326721,
0.02482551336288452,
-0.060826390981... | |
if you want to).
I worked with Granite about a year ago and had some problems getting it properly parse object graphs; the Flash Player would throw some nasty low-level exceptions. My guess is that the documentation and implementation have matured since so that these are no longer issues. However, I'm still a bit hesi... | [
0.341420441865921,
0.2268163561820984,
0.20820873975753784,
-0.024649983271956444,
-0.21994169056415558,
-0.20379289984703064,
0.3171467185020447,
0.01293178927153349,
-0.19611702859401703,
-0.7084761261940002,
0.24180205166339874,
0.6955993175506592,
-0.11833269894123077,
-0.0359207093715... | |
We're doing a great deal of floating-point to integer number conversions in our project. Basically, something like this
```
for(int i = 0; i < HUGE_NUMBER; i++)
int_array[i] = float_array[i];
```
The default C function which performs the conversion turns out to be quite time consuming.
Is there any work around... | [
0.23043571412563324,
0.2716139256954193,
0.09988680481910706,
0.0007086822879500687,
-0.045829519629478455,
0.20154064893722534,
0.1259886920452118,
-0.4336838722229004,
-0.06256259977817535,
-0.5219837427139282,
0.16429093480110168,
0.4937651753425598,
-0.1979244202375412,
0.1743242740631... | |
to integers is shockingly expensive on an x86 processor. deft\_code's solution is correct, though he gives no citation or explanation.
Here is the source of the trick, with some explanation and also versions specific to whether you want to round up, down, or toward zero: [Know your FPU](http://www.stereopsis.com/sree/... | [
0.49457088112831116,
0.00025673711206763983,
0.31935399770736694,
0.20580948889255524,
0.05541196092963219,
-0.2852334678173065,
0.07571558654308319,
-0.18973764777183533,
-0.3473672568798065,
0.0017375838942825794,
0.02627851627767086,
0.6939119100570679,
-0.41934123635292053,
0.049423448... | |
When retrieving objects from an NSMutableArray in cocoa-touch is the below code ok? Should I be allocating([alloc]) new Page objects each time or is just pointing to it alright? Do I need to do anything to the Page \*pageObj after, such as set it to nil?
```
const char *sql = "insert into Page(Book_ID, Page_Num, Page_... | [
-0.2110561579465866,
0.2696406841278076,
0.6313502788543701,
-0.30065804719924927,
-0.1560281366109848,
0.09213805198669434,
0.47542643547058105,
-0.411885529756546,
-0.317447692155838,
-0.5665895342826843,
-0.18952572345733643,
0.545835018157959,
-0.22384698688983917,
0.09278329461812973,... | |
NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
}
}
Page *pageObj = [[self pagesArray] objectAtIndex:i];
if(pageObj.isNew) {
sqlite3_bind_int(addStmt, 1, self.book_ID);
sqlite3_bind_int(addStmt, 2, pageObj.page_Number);
sqlite3_bind_tex... | [
-0.35138803720474243,
-0.07942354679107666,
0.55919349193573,
-0.44932201504707336,
-0.08443583548069,
0.0797731801867485,
0.758398711681366,
-0.6594197750091553,
-0.05921678990125656,
-0.45617082715034485,
-0.41030243039131165,
0.7356887459754944,
-0.5735185742378235,
-0.33797022700309753... | |
'%s'", sqlite3_errmsg(database));
}
NSLog(@"Inserted Page: %i into DB. Page text: %@", pageObj.page_Number, pageObj.page_Text);
}
//Reset the add statement.
sqlite3_reset(addStmt);
}
```
Thanks. I also understand this should probably be in a transaction but I didn't qu... | [
0.14085990190505981,
0.3115088641643524,
0.6105042099952698,
-0.3032732605934143,
-0.2349236011505127,
-0.0225627850741148,
0.3026491105556488,
-0.3393968641757965,
-0.18087466061115265,
-0.6326281428337097,
-0.2390187382698059,
0.5138446688652039,
-0.33052903413772583,
0.09425321966409683... | |
you want to refer to an existing object in the array. You would want to retain it if you were going to keep the reference outside of that method, but since you're only using it temporarily it's fine not to.
The actual pointer variable will be destroyed and recreated every trip to the loop, so there's no need to set it... | [
0.41241535544395447,
-0.06479445099830627,
0.3632044792175293,
-0.07406256347894669,
0.04383983835577965,
-0.033033158630132675,
0.0944608673453331,
0.10312952101230621,
-0.3875378966331482,
-0.33114272356033325,
-0.002353769727051258,
0.24376443028450012,
-0.3798551559448242,
0.7360371351... | |
object may be released elsewhere). If you didn't set it to nil in that case, the pointer would refer to an invalid memory location after the object is dealloced, usually causing a crash.
One bug I can see though, you're skipping the last element in your array in your for loop by subtracting 1 from the count. | [
0.18151192367076874,
-0.17532280087471008,
0.17453353106975555,
0.14864902198314667,
0.06156432256102562,
-0.17603300511837006,
0.34189748764038086,
-0.17248481512069702,
-0.5680020451545715,
-0.38147690892219543,
-0.04632236063480377,
0.30392903089523315,
-0.31247782707214355,
0.423079848... | |
I have a ListView that I am databinding to a collection of objects something like this:
```
int total;
List<Client> clientList =
clientData.GetClients(criteria, pageNum, pageSize, out total);
uxClientList.DataSource = clientList;
uxClientList.DataBind();
```
Where the pageNum, pageSize and total parameters faci... | [
0.2411750853061676,
-0.054143231362104416,
0.6279361248016357,
-0.005034353118389845,
-0.45955991744995117,
-0.16244500875473022,
0.13782955706119537,
-0.37127262353897095,
-0.416342169046402,
-0.5293862819671631,
-0.14699867367744446,
0.5162200927734375,
-0.19019660353660583,
0.0866431370... | |
each time, from which it should calculate pagination, so it sees the single page of results returned as the total available records and gets rendered as if there is only one page of results available. In other words, the above scenario works fine with DataPager if we switch to a non-paging version of GetClients:
```
L... | [
-0.19168928265571594,
-0.2932842969894409,
0.6414528489112854,
0.20815643668174744,
-0.05463218316435814,
-0.09055129438638687,
0.08532898128032684,
-0.13810019195079803,
-0.4920310378074646,
-0.6994059085845947,
-0.2967967391014099,
0.4399198293685913,
-0.18178293108940125,
0.089413799345... | |
of the total available records so it could still automatically create pagination output, but only require one page at a time to do so.
I haven't found an easy way to do this and I haven't turned up anything in searches. Admittedly I don't currently posses a deep understanding of the implementation of DataPager, so hop... | [
0.03879525512456894,
0.016411663964390755,
0.17599725723266602,
0.30617842078208923,
-0.13554395735263824,
-0.19141152501106262,
0.33297958970069885,
0.08985115587711334,
-0.43062418699264526,
-0.4534507691860199,
0.0981990173459053,
0.38509517908096313,
-0.1310143917798996,
-0.04537019506... | |
I need to develop a process that will detect if the users computer has certain programs installed and if so, what version. I believe I will need a list with the registry location and keys to look for and feed it to the program which is not a problem. Is there a better way to accomplish this?
My first thought was to ch... | [
0.4438413083553314,
0.29806259274482727,
0.2100662738084793,
0.31027767062187195,
0.4336967170238495,
-0.08504961431026459,
0.20662592351436615,
0.09630618244409561,
-0.12660998106002808,
-0.6340108513832092,
0.14704570174217224,
0.42222052812576294,
-0.06450888514518738,
0.139370903372764... | |
should be written to HKCU\Software, machine-specific settings to HKLM\Software. Under these keys, structure `[software vendor name]\[application name]` (e.g. `HKLM\Software\Microsoft\Internet Explorer`) may be the most common, but that's just a convention, not a law of nature.
Many (most?) applications also add their ... | [
0.18259082734584808,
0.5838437080383301,
0.5421167016029358,
-0.041441209614276886,
0.18377788364887238,
-0.23179081082344055,
-0.0842931866645813,
-0.01240692287683487,
-0.17072443664073944,
-0.567084014415741,
-0.5587222576141357,
0.4309547543525696,
-0.29413777589797974,
0.0631766766309... | |
the filesystem to see if the application still exists where its registry entries say it is.
Edit:
If you're a member of the group Administrators, you can check the `HKEY_USERS` hive - each user's HKCU actually resides there (you'll need to know the user SID, or go through all of them).
Note: As @Brian Ensink says, "... | [
0.5969129204750061,
0.03754235804080963,
0.0957307294011116,
0.30492299795150757,
0.13302744925022125,
-0.37828969955444336,
0.13876506686210632,
0.09050551056861877,
-0.5671131610870361,
-0.5300114750862122,
-0.18388250470161438,
0.5500461459159851,
-0.28120261430740356,
0.026202203705906... | |
and *not* to leave any traces on the computer. We may also have to scan the disks, and network disks, and anything the user downloads, and world-accessible Windows shares in the Internet (yes, such things exist legitimately - `\\live.sysinternals.com\tools` comes to mind). In this direction, there's no real limit of wh... | [
0.6714075803756714,
0.2151133269071579,
0.1135094091296196,
0.21713751554489136,
0.5331557989120483,
-0.4234265685081482,
0.2638399004936218,
0.2624890208244324,
-0.2878650426864624,
-0.41111910343170166,
-0.38837429881095886,
0.6814798712730408,
-0.049516111612319946,
0.0378519669175148,
... | |
I've wrapped Perl's [Net::SSH::Expect](http://search.cpan.org/perldoc?Net::SSH::Expect) with a small module to reduce the boilerplate code needed to write a new configuration script for use with our HP [iLO](http://en.wikipedia.org/wiki/HP_Integrated_Lights-Out) cards. While on one hand I want this wrapper to be as lea... | [
0.2854957580566406,
0.10227134823799133,
0.8868725299835205,
-0.43749067187309265,
0.018155869096517563,
0.01891721598803997,
-0.1352878361940384,
-0.3014301061630249,
-0.18103568255901337,
-0.6355565786361694,
-0.1740534007549286,
0.2234196662902832,
-0.2207939326763153,
-0.05845684558153... | |
a Net::SSH::Expect object
croak "Not logged in!\n" unless ($self->{ssh});
$self->{ssh}->send($cmd);
if ($self->{ssh}->waitfor($response, $self->{CMD_TIMEOUT}, '-re')) {
return {
before => $self->{ssh}->before(),
match => $self->{ssh}->match(),
after => $self->{ss... | [
0.03850136324763298,
-0.6079028248786926,
0.37379443645477295,
-0.05657677724957466,
0.004369324538856745,
-0.080049067735672,
0.5516491532325745,
-0.1505710929632187,
-0.003095637308433652,
-0.7562848329544067,
-0.21529695391654968,
0.326509565114975,
-0.30828216671943665,
0.2131254523992... | |
did not match /$response/:\n\n",
$self->{ssh}->before()),
"\n";
return undef;
}
}
```
I have two related queries. First, how should I deal with responses that don't match the expected response? I guess what I'm doing now is satisfactory -- by returning `undef` I signal something br... | [
0.1998937577009201,
0.33029574155807495,
0.28431642055511475,
-0.11821489781141281,
-0.07738395780324936,
0.011148855090141296,
0.5135741233825684,
-0.032536156475543976,
-0.0520402267575264,
-0.3209017515182495,
-0.14734019339084625,
0.45171046257019043,
-0.22792832553386688,
0.1653204709... | |
the calling code decide whether or not to ignore it/quit/print a warning, but it doesn't (well, in 5.8). Perhaps I should return some other object (`iLO::response`, or something) that carries an error message and the contents of `$ilo->before()` (which is just Net::SSH::Expect's `before()`)? But if I do that -- and hav... | [
0.057942602783441544,
-0.07485902309417725,
0.1752859205007553,
-0.18301193416118622,
-0.20126402378082275,
-0.08333928883075714,
0.5014019012451172,
-0.20934651792049408,
0.23460839688777924,
-0.5242094397544861,
-0.14363758265972137,
0.6202228665351868,
-0.2797478437423706,
-0.0986319780... | |
Perl my code in other languages emits the same familiar smell: I'm never sure how or what to return from a method. What can you tell me?
If you're familiar with exceptions from languages like Java, then think of `die` as `throw` and `eval` as `try` and `catch`. Instead of returning `undef`, you could do something like ... | [
0.21236981451511383,
-0.059791333973407745,
0.44190508127212524,
-0.17682917416095734,
-0.361451655626297,
0.1276925504207611,
0.19497466087341309,
-0.37914347648620605,
-0.033483099192380905,
-0.2913382053375244,
0.16697846353054047,
0.20978623628616333,
-0.30897772312164307,
0.0575803481... | |
"ERROR: '$cmd' response did not match /$response/:\n\n"
. $self->{ssh}->before();
```
Then, in your calling code:
```
eval {
$ilo->command("set oemhp_server_name=$system_name", 'status=0');
};
if ( my $error = $@ ) {
# handle $error here
}
```
Just like exceptions in other languages, this allows you to... | [
-0.14967544376850128,
0.07130520045757294,
0.23412774503231049,
-0.11506959050893784,
0.07976788282394409,
-0.039212387055158615,
0.33852559328079224,
-0.3636336326599121,
-0.42902806401252747,
-0.43569043278694153,
-0.3869238495826721,
0.5279031991958618,
-0.2813969850540161,
0.0808894485... | |
an object, which your exception handler can interrogate for useful information and error messages. I like to use [Exception::Class](http://search.cpan.org/~drolsky/Exception-Class-1.23/lib/Exception/Class.pm) for this purpose. The [Error](http://search.cpan.org/~uarun/Error-0.15/Error.pm) module provides some syntactic... | [
-0.23086689412593842,
0.05121622979640961,
-0.2565985918045044,
0.1802939772605896,
-0.1608639508485794,
-0.04891497269272804,
0.5132103562355042,
-0.11822695285081863,
-0.22163188457489014,
-0.30784279108047485,
-0.27672967314720154,
-0.051921337842941284,
-0.3080577850341797,
0.048995666... | |
I am C# developer. I really love the curly brace because I came from C, C++ and Java background. However, I also like the other programming languages of the .NET Family such as VB.NET. Switching back and forth between C# and VB.NET is not really that big of deal if you have been programming for a while in .NET. That is... | [
0.7512169480323792,
0.42808353900909424,
-0.2511298358440399,
-0.22950293123722076,
-0.3222035765647888,
-0.2672699987888336,
0.19871658086776733,
0.4771086275577545,
-0.09117859601974487,
-0.5178765058517456,
0.05591367930173874,
0.507590115070343,
-0.0026259906589984894,
0.03008983284235... | |
curious , what other developer has to say about it!
I wouldn't be suprised if "With" or a similar feature is added to C# eventually along with other heretofore popular exclusively VB features. There was a lot of talk in the C# 4.0 preview presentations recently at PDC and elsewhere of the increased "focus on language p... | [
0.5399031043052673,
0.07378403842449188,
-0.02481483481824398,
-0.23332951962947845,
-0.45110151171684265,
-0.2792113125324249,
0.14993713796138763,
0.4547915458679199,
-0.24558062851428986,
-0.30142897367477417,
-0.030814407393336296,
0.8008454442024231,
-0.16928020119667053,
0.1338747441... | |
The mysql manual says that SET NAMES 'x' is equivalent to
```
SET character_set_client = x;
SET character_set_results=x;
SET character_set_connection=x;
```
According to my config file for SERVER variables, I have all three of these set to utf8.
However, if I actually do a SHOW VARIABLES %character\_set%, it sh... | [
0.08487210422754288,
0.2013404816389084,
0.6883164048194885,
-0.13604535162448883,
-0.2289850115776062,
-0.08821765333414078,
0.15712390840053558,
0.028030987828969955,
-0.18737202882766724,
-0.7136526107788086,
-0.028026262298226357,
0.6048603057861328,
-0.5454968214035034,
0.158908143639... | |
Do you always lean towards thinking of db schema when starting or planning a new project it or do you go the other way and start designing UI then moving down the stack?
Or do you have a different way of developing?
Not really an agile/waterfall/specs/stories question just a way of getting a handle on which way peopl... | [
0.6872247457504272,
0.07163690775632858,
-0.05054433271288872,
-0.0029965487774461508,
-0.3286055326461792,
-0.03970405459403992,
0.24261461198329926,
-0.035006552934646606,
-0.13021162152290344,
-0.7030249238014221,
0.43349677324295044,
0.7214236855506897,
0.3087192475795746,
-0.301131546... | |
screen will look like and then try to develop a data model from that. Instead of going directly to a database I find that this works a lot better as with my UI I can see the need for properties (or fields in a db) that I wouldn't have thought of otherwise. From there I then develop the model and bounce back and forth t... | [
0.39807048439979553,
-0.026878001168370247,
0.6139657497406006,
0.04241691902279854,
-0.1452672928571701,
0.04929111525416374,
-0.10364927351474762,
0.03553622215986252,
-0.047831274569034576,
-1.0838673114776611,
0.18826043605804443,
0.49555298686027527,
-0.0754731222987175,
0.06875243037... | |
How can I change the Text for a CheckBox without a postback?
```
<asp:CheckBox ID="CheckBox1" runat="server" Text="Open" />
```
I would like to toggle the Text to read "Open" or "Closed" when the CheckBox is clicked on the client.
```
function changeCheckboxText(checkbox)
{
if (checkbox.checked)
checkbox.next... | [
-0.016262607648968697,
0.07148658484220505,
0.5843662619590759,
-0.2149684727191925,
0.13728591799736023,
0.01130453497171402,
0.27817949652671814,
-0.11676337569952011,
-0.1321500986814499,
-1.01703941822052,
-0.2587989568710327,
0.4573717415332794,
-0.43482857942581177,
-0.05122584104537... | |
I understand the reflection API (in c#) but I am not sure in what situation would I use it. What are some patterns - anti-patterns for using reflection?
The only place I've used the Reflection stuff in C# was in factory patterns, where I'm creating objects (in my case, network listeners) based on configuration file inf... | [
1.0187673568725586,
0.2718721330165863,
-0.06520572304725647,
-0.20325595140457153,
-0.39080750942230225,
0.1668379008769989,
0.20730920135974884,
0.038586050271987915,
-0.19270311295986176,
-0.5388844013214111,
0.49140211939811707,
0.5067513585090637,
-0.36408281326293945,
-0.027545053511... | |
Despite having very little Linux experience, I'm too enticed by VPS (and too sick of cPanel/shared hosting crap) to not give it a try.
I'm a smart kid and pick up things pretty quick. I took a class in Linux and know basic commands, how to pipe commands, some scripting and shell stuff -- all of which I've nearly forg... | [
0.15496611595153809,
0.17599427700042725,
0.31308767199516296,
0.0010154878254979849,
0.05266091600060463,
-0.25320735573768616,
-0.10450754314661026,
0.47777923941612244,
-0.30111587047576904,
-0.5817806124687195,
-0.00011888940207427368,
0.8000118136405945,
-0.10916915535926819,
0.163612... | |
use and administration here, especially in terms of installing LAMP + memcache and having it up and running by the end of today.
Linode or Slicehost? Any inherent differences between the two? Linode seems cheaper.
Finally, so as not to leave the referral field blank for whichever host I choose, please provide you're ... | [
0.43031948804855347,
0.03511638566851616,
0.8452485799789429,
-0.020988015457987785,
-0.17956037819385529,
-0.18577910959720612,
-0.2320016473531723,
0.22389978170394897,
-0.14166371524333954,
-0.7289355993270874,
-0.1791980266571045,
0.4101219177246094,
-0.1852790266275406,
0.082725100219... | |
and haven't encountered any problems since initial setup.
Haven't used Slicehost but frankly after the simplicity of Linode setup, wouldn't need to switch/try anything else. | [
0.4093300402164459,
-0.08054691553115845,
0.28419703245162964,
-0.06420782208442688,
0.11961811035871506,
0.011548240669071674,
0.1582155078649521,
0.13500240445137024,
-0.297844260931015,
-0.7579185962677002,
0.02136090025305748,
0.6202887892723083,
0.10901087522506714,
-0.172097668051719... | |
I am trying to figure out how C and C++ store large objects on the stack. Usually, the stack is the size of an integer, so I don't understand how larger objects are stored there. Do they simply take up multiple stack "slots"?
The stack is a piece of memory. The stack pointer points to the top. Values can be pushed on t... | [
-0.004132736008614302,
0.08571570366621017,
0.36101144552230835,
0.13193778693675995,
0.19829589128494263,
0.1783008724451065,
-0.3636447489261627,
-0.16648752987384796,
-0.38479799032211304,
-0.4216597378253937,
-0.0009152009151875973,
0.31450751423835754,
-0.03397061675786972,
0.15541967... | |
stack this moves the stack pointer up:
```
03: par2 byte2
02: par2 byte1
01: par1
```
Now the function is called and the return addres is put on the stack:
```
05: ret byte2
04: ret byte1
03: par2 byte2
02: par2 byte1
01: par1
```
OK, within the function we have 2 local variables; one of 2 bytes and one of 4. For... | [
-0.37473878264427185,
0.3153934180736542,
0.7324874997138977,
-0.3680305778980255,
-0.17122043669223785,
0.40746381878852844,
0.19233956933021545,
-0.46017569303512573,
-0.4400183856487274,
-0.26921090483665466,
-0.027654113247990608,
0.7059774994850159,
-0.23641911149024963,
-0.1289631575... | |
ret byte2
04: ret byte1
03: par2 byte2
02: par2 byte1
01: par1
```
As you see, you can put anything on the stack as long as you have space left. And else you will get the phenomena that gives this site its name. | [
0.31307172775268555,
0.3843402862548828,
0.20605900883674622,
-0.2820202708244324,
-0.14681397378444672,
-0.1408904641866684,
0.2585361897945404,
-0.033389318734407425,
-0.4975367486476898,
-0.5452501773834229,
-0.1937570720911026,
0.3806588053703308,
-0.09609908610582352,
0.03389106318354... | |
Assume infile is a variable holding the name of an input file, and similarly outfile for output file. If infile ends in **.js**, I'd like to replace with **.min.js** and that's easy enough (I think).
**outfile = re.sub(r'\b.js$', '.min.js', infile)**
But my question is if infile ends in **.min.js**, then I do not wan... | [
0.10262632369995117,
-0.20748429000377655,
0.24111223220825195,
-0.16798344254493713,
-0.01464478112757206,
0.07335329055786133,
0.19512251019477844,
-0.04079955443739891,
0.09627129137516022,
-0.5393768548965454,
-0.24832592904567719,
0.5843508839607239,
-0.39973098039627075,
-0.275519162... | |
want to do a negative lookbehind assertion. For instance,
```
outfile = re.sub(r"(?<!\.min)\.js$", ".min.js", infile)
```
You can find more about this here: <http://docs.python.org/library/re.html#regular-expression-syntax> | [
0.3444899916648865,
0.01154580432921648,
0.0033933762460947037,
-0.30540767312049866,
-0.04517694562673569,
0.005887151695787907,
0.4671925902366638,
-0.0630578100681305,
-0.23794488608837128,
-0.1525822877883911,
-0.22716642916202545,
0.8340707421302795,
-0.4078240394592285,
-0.0743421316... | |
What is the best way of referencing a dynamic delegate. I'd like to do the following with method names returned from a configuration database.
```
AddressOf "MethodName"
```
Via Reflection (specifically [Type.GetMethod](http://msdn.microsoft.com/en-us/library/system.type.getmethod.aspx)). | [
-0.017349213361740112,
-0.20872488617897034,
0.12952382862567902,
0.3834339380264282,
0.29641807079315186,
-0.1883782595396042,
-0.05954296514391899,
-0.1150272861123085,
-0.24035677313804626,
-0.5797255039215088,
0.06358301639556885,
0.3138917088508606,
-0.10671098530292511,
0.24290409684... | |
For the most part my organization is happy with WSS 3.0 (no upgrading to MOSS) with one exception, there is really just one form we'd like to put up somehow. It's fairly big form (basically change requests for IT services, on paper it's easily 2 full 8.5 by 11 pages). We thought about Custom ASP.NET coding as a separat... | [
0.6333219408988953,
-0.2217099368572235,
0.27383750677108765,
0.33876845240592957,
-0.08035255968570709,
-0.15584103763103485,
-0.03904902935028076,
-0.03115764632821083,
-0.1281101554632187,
-0.5476475954055786,
0.22837361693382263,
0.43451401591300964,
0.00026171363424509764,
-0.24546365... | |
as a standalone HTML/ASP.Net page and include it as a page viewer webpart, or roll your own WebPart for it. The latter is somewhat more complicated if you don't already know SharePoint development, although tools like [STSDEV](http://www.codeplex.com/stsdev) can take away a lot of the pain. | [
0.4002739489078522,
-0.14323662221431732,
0.4131643772125244,
0.1912684440612793,
-0.21921038627624512,
-0.17064596712589264,
0.2616920471191406,
-0.38861024379730225,
-0.4564915597438812,
-0.6540437340736389,
-0.41265901923179626,
0.26247647404670715,
-0.08592824637889862,
-0.192387044429... | |
I'd like to split strings like these
```
'foofo21'
'bar432'
'foobar12345'
```
into
```
['foofo', '21']
['bar', '432']
['foobar', '12345']
```
Does somebody know an easy and simple way to do this in python?
I would approach this by using `re.match` in the following way:
```
import re
match = re.match(r"([a-z]+)([... | [
0.2661453187465668,
0.20901747047901154,
0.2930871248245239,
-0.40589115023612976,
-0.10122529417276382,
0.0752459466457367,
-0.024154100567102432,
-0.7263733744621277,
-0.21643011271953583,
-0.1758527010679245,
-0.3016778528690338,
0.8143439888954163,
-0.7314017415046692,
-0.1763911992311... | |
Can anyone recommend an open source Syslog Daemon for Windows (specifically Windows 2008 64bit).
Thanks
[Kiwi Syslog](http://www.kiwisyslog.com/kiwi-syslog-server-overview/), or [Star Syslog daemon lite](http://www.thestarsoftware.com/syslogdaemonlite.html) - free, but not OSS.
or [Syslog for Windows](http://syslog-w... | [
-0.03441564738750458,
-0.032353777438402176,
0.46348077058792114,
0.3160625398159027,
-0.1703120619058609,
-0.44851723313331604,
0.4674680233001709,
0.17884434759616852,
-0.17109490931034088,
-0.39889758825302124,
-0.4948738217353821,
0.5403498411178589,
-0.18001875281333923,
-0.1737963706... | |
I have a data structure that represents C# code like this:
```
class Namespace:
string Name;
List<Class> Classes;
class Class:
string Name;
List<Property> Properties;
List<Method> Methods;
List<Method> Constructors;
List<Field> Fields;
List<Class> InnerClasses;
Class Parent;
Li... | [
0.2703278958797455,
0.20427851378917694,
0.11732921749353409,
0.08437047153711319,
-0.10586100816726685,
-0.01058256346732378,
0.429706335067749,
-0.43042540550231934,
-0.25995880365371704,
-0.6700315475463867,
-0.015420188196003437,
0.30803054571151733,
-0.2926522493362427,
0.065293967723... | |
example, there's a rule that runs when a class only implements interfaces in the same assembly.
My original naïve implementation iterates over each rule and then each rule traverses the tree looking for its specific pattern. Of course, this takes quite a lot of time, even with a small amount of source code.
I suppose... | [
0.5881412029266357,
-0.01680009253323078,
-0.20320795476436615,
0.37568825483322144,
-0.15143679082393646,
0.16255313158035278,
0.3300236761569977,
-0.17298176884651184,
-0.36198192834854126,
-0.6768195629119873,
0.4555797278881073,
0.6456166505813599,
-0.4842856526374817,
-0.1070724278688... | |
3000, I would guess assume another member of the 3000. Say rule 12 checks 'a class implements an interface'. Rule 85 might be
'a class only implements interfaces in the same assembly'. If rule 12 fails, no need to run rule 85 at all.
This approach (alpha-beta pruning) would either need you to restructure your algorith... | [
0.4169749915599823,
0.2856593132019043,
-0.15233394503593445,
0.059277404099702835,
-0.20185181498527527,
0.01620381698012352,
0.49618208408355713,
-0.38208383321762085,
-0.3553483784198761,
-0.5723649263381958,
0.1795431226491928,
0.33589184284210205,
-0.43364062905311584,
-0.020389607176... | |
give an example of maybe 2 more rules? I am currently thinking your algorithm is 0(n\*n) (following copied from a big 0 notation post)
O(n\*log(n)): an algorithm that does some sort of divide and conquer strategy. Hurts for large n. Typical example: merge sort
O(n\*n): a nested loop of some sort. Hurts even with smal... | [
0.0768820270895958,
-0.1065223217010498,
-0.08460038155317307,
0.032817188650369644,
-0.09748178720474243,
-0.11378597468137741,
0.19894185662269592,
-0.16771674156188965,
-0.4913841485977173,
-0.7519710063934326,
0.07559342682361603,
0.22346238791942596,
-0.5720171928405762,
0.04436535388... | |
Is there a way to distinguish between sets of [EC2](http://aws.amazon.com/ec2/) instances?
My use case is that I have a bunch of web tier machines and a bunch of search tier machines; currently the only way to track what each instance is doing is in a roll-your-own asset directory, like LDAP or a database.
Ideally, I... | [
0.5729809403419495,
-0.14712661504745483,
-0.0418706014752388,
0.31123822927474976,
0.013840924017131329,
-0.14204196631908417,
0.14569547772407532,
-0.07407493889331818,
-0.3339305818080902,
-0.5861524939537048,
0.07064653187990189,
0.5379272103309631,
-0.0748603492975235,
-0.096794046461... | |
EC2 now supports "tags" for categorising instances.
<http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?Using_Tags.html>
---
I've always used security groups for categorising. I don't see anything wrong with using them!
Groups not only allow categorising, they also allow different firewall rules. ... | [
-0.06437984108924866,
-0.21332183480262756,
0.4248783588409424,
0.026226909831166267,
-0.0576244592666626,
-0.4128170311450958,
0.20453356206417084,
-0.5311816930770874,
-0.3008825182914734,
-0.3441774547100067,
-0.09833824634552002,
0.5467870235443115,
-0.23696336150169373,
-0.14556494355... | |
How do map providers (such as Google or Yahoo! Maps) suggest directions?
I mean, they probably have real-world data in some form, certainly including distances but also perhaps things like driving speeds, presence of sidewalks, train schedules, etc. But suppose the data were in a simpler format, say a very large direc... | [
0.03256816416978836,
-0.16157253086566925,
0.7601372003555298,
0.548980712890625,
0.05689283832907677,
-0.05071275681257248,
0.010459420271217823,
0.04343267157673836,
-0.11175476759672165,
-0.8395031690597534,
0.10710880160331726,
-0.03219766169786453,
-0.14707118272781372,
-0.05069646984... | |
is enormous. Luckily, heuristic algorithms like A\* will probably work. However, our data is very structured, and perhaps some kind of tiered approach might work? (For example, store precomputed directions between certain "key" points far apart, as well as some local directions. Then directions for two far-away points ... | [
-0.3604528307914734,
-0.14622652530670166,
0.7288870215415955,
0.26106026768684387,
0.3114573061466217,
-0.03829900175333023,
0.06711668521165848,
0.04207870364189148,
-0.2062598466873169,
-0.7023048996925354,
-0.3565182685852051,
0.029607096686959267,
-0.09946813434362411,
0.0128924371674... | |
Louis Lepine") takes longer and is farther than using an intermediate point as in [X-Y-Z](http://maps.google.com/maps?f=d&saddr=Place+Jacques+Bonsergent,+75010+Paris&daddr=Square+Emile+Chautemps,+75003+Paris+to:Place+Louis+Lepine,+75004+Paris&hl=en&geocode=&mra=ls&dirflg=w&sll=48.869359,2.357833&sspn=0.006888,0.014827&... | [
-0.28506243228912354,
-0.08809290081262589,
0.4765259921550751,
-0.023254381492733955,
0.037267524749040604,
0.21334828436374664,
0.6940321326255798,
0.08246222138404846,
-0.38326042890548706,
-0.8700600266456604,
-0.10208673775196075,
-0.0358160100877285,
-0.03195828199386597,
-0.03988091... | |
someone who spent 18 months working at a mapping company, which included working on the routing algorithm... yes, [Dijkstra's](http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) does work, with a couple of modifications:
* Instead of doing [Dijkstra's](http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) once from s... | [
0.059003207832574844,
-0.2601052224636078,
0.5891633033752441,
0.2586993873119354,
-0.026297520846128464,
0.029765192419290543,
0.36351311206817627,
-0.31596869230270386,
-0.11184216290712357,
-1.276174783706665,
-0.021492309868335724,
0.19866177439689636,
0.0008947112364694476,
-0.0040803... | |
explore only smaller sections of the more detailed layers, expanding as necessary. Obviously this description leaves out a lot of detail, but you get the idea.
With modifications along those lines, you can do even cross-country routing in a very reasonable timeframe. | [
0.25280168652534485,
-0.02788633480668068,
0.2837095856666565,
0.3450494408607483,
0.37575995922088623,
-0.43728455901145935,
0.40629568696022034,
-0.013526249676942825,
-0.34049487113952637,
-0.8095154166221619,
0.0829785019159317,
-0.020177451893687248,
0.07870695739984512,
-0.1470637172... | |
I'm trying to figure out if it's possible to slow down the server when it's sending multipart/xmixed-replace responses. I want my client to try to rate limit a motion jpeg stream. I've found a lot of documentation about what the **server** sends in an HTTP response but nothing about what the **client** sends.
What doe... | [
0.444486141204834,
-0.02499806322157383,
0.440890371799469,
0.33226287364959717,
-0.32278338074684143,
-0.03304893523454666,
0.04098888859152794,
0.010693778283894062,
-0.4779764413833618,
-0.3706880807876587,
0.13160161674022675,
0.4394512176513672,
-0.43056973814964294,
0.331456661224365... | |
within the same message body. So from a server perspective (in terms of the rate at which content is sent) it is not really different from sending a single big chunk of data.
So, I am wondering if you can the Range header to only request a specific range - one "part" at a time.
Start counting bytes from the end of th... | [
0.5332585573196411,
-0.35862112045288086,
0.6754826903343201,
0.33635538816452026,
-0.2768830955028534,
-0.12432906776666641,
0.12325155735015869,
-0.18011923134326935,
-0.25954470038414,
-0.45110607147216797,
-0.1241433322429657,
0.5261443853378296,
-0.06840500235557556,
0.119584262371063... | |
chunk. Again, read the response, when you reach the end of the part, add the current response bytes to the previous, close the connection and repeat ad nauseam...
Haven't tried it, but sounds like it would work provided the server supported range headers and provided you were able to do some patching on the client sid... | [
0.3961232304573059,
-0.032346583902835846,
0.19931340217590332,
0.05401751771569252,
-0.4215126037597656,
-0.11365111917257309,
0.33567461371421814,
0.07428541034460068,
0.005143878515809774,
-0.20551836490631104,
0.021203627809882164,
0.4381921887397766,
-0.05614085868000984,
0.1925304085... | |
I just created a project so my Solution Explorer looks like this:
[](https://i.stack.imgur.com/FXcbd.jpg)
(source: [kalleload.net](http://www.kalleload.net/uploads/gwdgdm/yszoerpnieed.jpg))
But I want to add another project which is related to this project but it... | [
0.19274236261844635,
-0.12166484445333481,
0.5535597801208496,
-0.0882696732878685,
-0.07841025292873383,
0.05601639673113823,
0.24900074303150177,
-0.0547875314950943,
-0.6074825525283813,
-0.5869245529174805,
-0.0949038416147232,
0.37213724851608276,
-0.13185185194015503,
-0.073334351181... | |
We have a modem terminal application written in VB6. It works great for what we need it to do, but there is a new requirement to initiate a VPN connection when dialing a particular provider. I've looked over some related posts and it looks like this may be possible using the RAS API. Can anyone suggest resources/advice... | [
0.3214842975139618,
0.045519307255744934,
0.42407235503196716,
0.10829423367977142,
0.02153281308710575,
-0.3009363114833832,
0.17644451558589935,
0.2638666033744812,
-0.23113152384757996,
-0.712218165397644,
0.024637848138809204,
0.819975733757019,
-0.15227189660072327,
0.1335377693176269... | |
VPN connection.
```
USAGE:
rasdial entryname [username [password|*]] [/DOMAIN:domain]
[/PHONE:phonenumber] [/CALLBACK:callbacknumber]
[/PHONEBOOK:phonebookfile] [/PREFIXSUFFIX]
rasdial [entryname] /DISCONNECT
rasdial
```
Not industrial strength, but good to u... | [
-0.38543379306793213,
0.04062895104289055,
0.5762600302696228,
-0.1470443457365036,
-0.3316349983215332,
-0.15728354454040527,
0.12324091792106628,
-0.01306634210050106,
-0.354247123003006,
-0.562566876411438,
-0.26899516582489014,
0.5231927037239075,
-0.2437889575958252,
0.274044930934906... | |
I've tried scrolling="no" and overflow:hidden; Nothing seems to make the vertical scrollbar go away in iframes on Safari/webkit. Anyone know?
Use overflow:hidden on the included body. | [
0.4382460415363312,
0.02863095887005329,
0.21886476874351501,
-0.0571221262216568,
0.14105020463466644,
0.20719605684280396,
0.43645915389060974,
0.3995159864425659,
-0.3018556237220764,
-0.4917491674423218,
0.12766329944133759,
0.35742637515068054,
0.08894792199134827,
-0.0156054571270942... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.