text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
1
3 4 2
4 5 1
5 10 0
200028 308731 0
```
Anyone care to give a shot at the SQL? I would also like it to be as efficient | [
0.20767296850681305,
0.5349926948547363,
0.13664549589157104,
-0.05447622016072273,
-0.09070781618356705,
-0.37773871421813965,
0.13149569928646088,
0.1946595162153244,
0.06142212077975273,
-0.3465738296508789,
0.11543822288513184,
0.5677309632301331,
-0.21032871305942535,
-0.0187103059142... | |
as possible.
This is most of the way there, possible improvement would be joining up adjacent ranges of the same priority. It's full of cool trickery.
```
select Start, cast(null as int) as Finish, cast(null as int) as Priority
into #processed
from #ranges
union
select Finish, NULL, NULL
from #ranges
update p ... | [
-0.07414612919092178,
-0.4182400405406952,
0.4948636591434479,
0.2910812795162201,
0.3153374493122101,
0.23628239333629608,
-0.0059876698069274426,
-0.46961885690689087,
-0.1844506561756134,
-0.783207893371582,
-0.2911752760410309,
0.6518895030021667,
-0.12581250071525574,
-0.1106682792305... | |
select max(r.Priority)
from #ranges r
where
(
(r.Start <= p.Start and r.Finish > p.Start) or
(r.Start >= p.Start and r.Start < p.Finish)
)
)
from #processed p
delete from #processed
where Priority is null
select * from #processed
``` | [
0.20738737285137177,
-0.6686698198318481,
0.3640606105327606,
0.1073315441608429,
0.40699484944343567,
0.44211524724960327,
-0.04499814286828041,
-0.5762310028076172,
-0.3983144760131836,
-0.17493578791618347,
-0.3012932240962982,
0.45988672971725464,
-0.17787960171699524,
0.04564781486988... | |
I've worked my way through a number of interesting routing problems - turning a request URL into a hash, etc., but just out of curiosity, is there a way to tell the routing system that you want anything that comes under a certain url subpath to be served literally - without going through a controller?
For instance, i... | [
0.6394035816192627,
0.026923563331365585,
0.137553408741951,
0.0000811357531347312,
-0.04748227447271347,
-0.08381902426481247,
0.29654890298843384,
0.039003707468509674,
-0.2766578197479248,
-0.49237245321273804,
-0.035089366137981415,
0.2937416136264801,
-0.2508019208908081,
0.1584024727... | |
(for example: /public/images/) then you shouldn't have any problems with MIME types unless your web server is configured wrongly.
According to your examples, you want the images dir in the root of the app. I don't think there is a way though Rails to make those images visible, but if you really wanted to you could use... | [
0.5355637669563293,
-0.029157450422644615,
0.1274065226316452,
0.18739435076713562,
-0.19778913259506226,
-0.014786465093493462,
0.52879798412323,
0.1617903858423233,
-0.2437875121831894,
-0.6569890975952148,
0.05060875788331032,
0.7100915908813477,
-0.4672403037548065,
-0.1437176913022995... | |
On a Linux box, I need to display the average CPU utilisation per hour for the last week. Is that information logged somewhere? Or do I need to write a script that wakes up every 15 minutes to copy */proc/loadavg* to a logfile?
EDIT: I'm not allowed to use any tools other than those that come with Linux.
As far as I k... | [
0.49351292848587036,
0.09614584594964981,
0.23214691877365112,
-0.024301448836922646,
-0.03523935377597809,
-0.06794758141040802,
0.27183815836906433,
0.3472401797771454,
-0.48762333393096924,
-0.5458731055259705,
0.02026931755244732,
0.7353944182395935,
-0.35205644369125366,
-0.0538179986... | |
graphs of it to boot... they might be overkill for your situation though. | [
0.33666884899139404,
-0.011437786743044853,
0.3568703532218933,
0.459791362285614,
-0.06382039189338684,
-0.20571614801883698,
0.22387459874153137,
0.2395164966583252,
-0.45408812165260315,
-0.5412225723266602,
0.8372244238853455,
0.2516135573387146,
-0.2493232935667038,
-0.060405697673559... | |
When coding new javascript heavy websites, which order or web browser do you code for?
I can see these possible orders, but I am not sure which I like best:
1. Code for one first and get it working well, then start testing with other and fix errors as I go.
* This will allow for the most rapid development (with Fire... | [
0.7728998064994812,
0.08521059155464172,
0.06567522138357162,
0.05037678778171539,
-0.37819385528564453,
-0.2979857921600342,
0.32024475932121277,
-0.0799994021654129,
0.0663623958826065,
-0.9882573485374451,
-0.017532305791974068,
0.7293888330459595,
-0.35239458084106445,
-0.4848248958587... | |
before moving on.
* This seems like it will actually take more time, so maybe do several features in Firefox then move to IE to patch them up.
What do you all do?
**Edit 1:** To respond to a couple of answers here.:
@JQuery usage: For some reason I was not expecting this kind of a response, however, now that this se... | [
0.8445411920547485,
0.15451714396476746,
0.31495627760887146,
0.17478808760643005,
-0.03226086124777794,
-0.10698594152927399,
0.18427890539169312,
-0.1137431263923645,
-0.31010758876800537,
-0.8623177409172058,
-0.00028720457339659333,
0.6084803938865662,
0.13976985216140747,
-0.273085445... | |
code seems to require that I use document.whatever() instead of any JQuery or Prototype functions that I could find. Specifically, when dynamically importing changing CSS, I have to use some similar to:
```
var cssid = document.all ? 'rules' : 'cssRules'; //found this to take care of IE and Firefox
document.styleShee... | [
0.4729386270046234,
0.03057437390089035,
0.03579145669937134,
0.07613272219896317,
-0.1338491141796112,
0.04061400145292282,
0.195226788520813,
-0.104570172727108,
-0.23800727725028992,
-0.7327421307563782,
-0.18019655346870422,
0.5131289958953857,
-0.3247656226158142,
0.12482257187366486,... | |
As the webapp is supposed to build other webapps, part of the criteria is that anything it builds look and work functionally the same in whatever browsers I support (right now I'm thinking Firefox and IE7/8 atm, maybe more later on). So as this is a more interesting (and much more complicated) problem; are there any si... | [
0.5614858269691467,
0.148466557264328,
0.3193773031234741,
0.08395755290985107,
-0.05234534293413162,
-0.14767761528491974,
0.21571040153503418,
0.0898059830069542,
-0.2891729176044464,
-0.738641083240509,
-0.06581005454063416,
0.5372655987739563,
-0.2122620940208435,
0.12656216323375702,
... | |
actions based on that, but I would like to avoid it as much as possible.
Thanks for your input so far! I will keep this open for the rest of the day to see what others may have to say, and will accept an answer sometime tonight.
This is sort of a trick question. In my opinion you need to work in this order:
**1: Conf... | [
0.7149946689605713,
-0.019985081627964973,
0.21581295132637024,
0.0948241725564003,
-0.34727784991264343,
-0.4171423017978668,
0.6146118640899658,
-0.16198644042015076,
-0.29470542073249817,
-0.6485826969146729,
0.11433525383472443,
0.6961959600448608,
-0.04099706560373306,
-0.509906411170... | |
a good example) so long as it's well made and standards compliant. It also makes it easier to tweak your site to work in specific browsers because the way that the popular browsers deviate from standards compliance is well known.
**2: Support the Most Used Browsers *(For Your Site)***
Note carefully the distinction b... | [
0.31877273321151733,
0.016418516635894775,
0.40150564908981323,
-0.13058888912200928,
-0.2367221862077713,
-0.21825246512889862,
0.24743163585662842,
0.3655349910259247,
-0.48272326588630676,
-0.9019420742988586,
-0.4235777258872986,
0.4268752336502075,
-0.27688029408454895,
-0.09967650473... | |
visitors can turn these numbers upside down. On sites that cater to a more technically savvy crowd it's common for firefox to be the dominant browser with IE in the distinct minority.
**3: Support Other Browsers as Needed**
You need to be very explicit about the fact that browser compatibility is an operating cost f... | [
0.3367004990577698,
0.1562776267528534,
0.4338907301425934,
-0.153510183095932,
-0.37170255184173584,
-0.25638166069984436,
0.3481447398662567,
0.33967912197113037,
-0.40108776092529297,
-0.6287037134170532,
-0.42237645387649536,
0.3541260063648224,
-0.3484044075012207,
-0.1343452781438827... | |
business concern to support everything under the Sun, including IE5. It's ok to make a conscious decision to not fully support every browser if you think the cost/benefit ratio is too high to justify it. Indeed, many of the most popular sites on the internet do not work well in older and niche browsers. Though you shou... | [
0.7557909488677979,
0.5421348810195923,
0.14529864490032196,
-0.0046920739114284515,
-0.13350000977516174,
-0.39133313298225403,
0.4016672670841217,
0.3042495846748352,
-0.267135351896286,
-0.38546767830848694,
-0.07861854881048203,
0.48838791251182556,
-0.14638249576091766,
0.033204473555... | |
sports.jsp:
```
<?xml version="1.0" encoding="UTF-8"?>
<%@ page contentType="text/xml;charset=ISO-8859-1" %>
<% response.setHeader("Content-Disposition", "attachment; filename=\"playlist.xml\""); %>
<playlist version="1" xmlns = "http://xspf.org/ns/0/">
<title>My Band Rocks Your Socks</title>
<trackList>
<%!... | [
0.3677838444709778,
0.2585146725177765,
0.3815399408340454,
-0.006044741254299879,
-0.34902873635292053,
-0.23592722415924072,
0.44876646995544434,
-0.26025110483169556,
-0.3670385479927063,
-0.4909120500087738,
-0.23779606819152832,
0.8185723423957825,
-0.35857632756233215,
-0.08048561960... | |
String total=sports[i];
String[] sa=total.split("[,]");
// String[] sub=new String();
out.print("<track>");
for (int j=0;j<sa.length;j++)
{
// out.println(sa[j]); | [
0.2245151549577713,
-0.4926503598690033,
0.20534329116344452,
-0.4728606045246124,
-0.21910570561885834,
0.3417815864086151,
0.37948983907699585,
-0.39698678255081177,
-0.4140351116657257,
-0.22536081075668335,
-0.2653694748878479,
0.3913179039955139,
-0.33946749567985535,
-0.0386854894459... | |
// out.println("sa["+j+"]="+sa[j]);
if( j == 0)
{
out.print("<location>" + sa[0] +"</location>");
}
else if (j == 1) | [
-0.2096804678440094,
-0.05675419047474861,
0.23745188117027283,
-0.700236976146698,
0.12374997138977051,
0.3474130630493164,
0.3571029305458069,
-0.19728180766105652,
-0.2265274077653885,
-0.5382658243179321,
-0.4733830392360687,
0.10684575885534286,
-0.19126135110855103,
0.002219608984887... | |
{
out.print("<image>" + sa[1] +"</image>");
}
else if( j==2)
{
out.print("<title>" + sa[2] +"</title>"); | [
-0.2883910834789276,
0.07649488747119904,
0.3692370355129242,
-0.479971319437027,
0.07691124081611633,
0.2363346964120865,
0.30937808752059937,
-0.37208008766174316,
-0.042770497500896454,
-0.49541494250297546,
-0.5165095329284668,
0.35874029994010925,
-0.4228161573410034,
0.02077985741198... | |
}
}// end of inner for loop()
out.print("</track>");
//out.println();
}// end of outer for()
}
//else out.println ("<b>none<b>");
%>
</trackList>
</playlist>
```
This code is generating an xml file, but it is prompting me to | [
0.21751466393470764,
-0.03222033753991127,
0.2291676551103592,
-0.3586605489253998,
0.35373377799987793,
-0.20310445129871368,
0.2542332410812378,
-0.4841129183769226,
-0.3709401488304138,
-0.27054837346076965,
-0.06963063776493073,
0.8111050724983215,
-0.41201984882354736,
-0.035709749907... | |
mention the location where to save it.I want to create and store xml file at a particular location without any prompting and each time for the next input values the current xml file should be overwritten.
You're asking for a feature that no browser wants to provide, due to security risks. You don't want a browser to be... | [
0.5179849863052368,
0.32911720871925354,
0.0886497050523758,
0.24153496325016022,
0.2882934808731079,
-0.06574833393096924,
-0.0522785522043705,
0.2998597025871277,
-0.05910838022828102,
-0.6211351156234741,
-0.030967973172664642,
0.2590393126010895,
-0.0794888287782669,
0.1483536511659622... | |
If you don't want to purchase an official certificate, you can use a self-signed certificate to sign your JAR files. If you do this, the user will get a prompt when they encounter your application about the certificate. However, once the Applet/Web Start application is running, you have free reign to write locally.
No... | [
0.5778889060020447,
0.3964950144290924,
0.5391251444816589,
-0.010121376253664494,
0.011641884222626686,
-0.279041588306427,
0.543211042881012,
-0.3321421146392822,
-0.06469666212797165,
-0.5852494239807129,
-0.18564154207706451,
0.372886061668396,
0.05351657420396805,
0.15059894323349,
... | |
What is the difference between an Interop and a RCW (Runtime Callable Wrapper)?
Is it just terminology?
They are connected with each other. Interop is the overall term for using native dll's within .NET. A RCW is a wrapper which is needed to use one specific component/class/object in .NET. | [
0.516711413860321,
-0.45257076621055603,
-0.06684062629938126,
0.3463539183139801,
-0.021102631464600563,
-0.2748661935329437,
-0.2777058482170105,
-0.09254956990480423,
-0.35630184412002563,
-0.411248117685318,
-0.4763103723526001,
0.19488681852817535,
-0.41306719183921814,
0.124702438712... | |
I'm trying to apply the same animation to multiple TargetControlID's -- for example, in a modal dialog, I would like to have a cancel button *and* a little "x" graphic in the upper right, either of which closes the dialog.
Seems pretty inelegant to write two identical animations, one for each of these targets. I'd lik... | [
0.44336998462677,
-0.33375948667526245,
0.21207928657531738,
0.3136056661605835,
-0.27481749653816223,
0.2430317997932434,
-0.1652947962284088,
0.1902018040418625,
-0.2732011377811432,
-0.8390940427780151,
-0.0717221200466156,
0.42055490612983704,
-0.4412699043750763,
0.09299690276384354,
... | |
.NET. | [
0.2756120562553406,
-0.16707046329975128,
-0.019950304180383682,
0.49380818009376526,
-0.027175677940249443,
-0.6294379234313965,
0.2273435741662979,
0.18276455998420715,
-0.17283624410629272,
-0.8522846102714539,
0.07603701204061508,
0.335147887468338,
-0.19808076322078705,
0.500799298286... | |
Currently it seems that I can only use effects in their most basic form when using the Dialog widget. For example, the following will use the drop effect for both showing and hiding the dialog box:
```
$('#dialog').dialog({show:'drop', hide:'drop'});
```
However, the default for the drop method always drops to the l... | [
0.2660817801952362,
-0.0720767080783844,
0.6743801832199097,
-0.1715063452720642,
-0.055898573249578476,
-0.07454249262809753,
0.21001091599464417,
-0.23165464401245117,
-0.20235662162303925,
-0.48893263936042786,
0.12572433054447174,
0.4535413086414337,
-0.33967578411102295,
-0.0988332703... | |
version 1.5.3 and 1.6rc\*. It'll probably require a change to the API before the functionality above can be supported. Steerpike has found a [version](http://labs.cloudream.name/jquery/dialog/dialog.html) that probably should be in the mainline. If anyone knows otherwise, do correct me.
This is currently not Possible w... | [
0.35778260231018066,
-0.017775816842913628,
0.6177220344543457,
-0.1256457269191742,
0.1892247051000595,
-0.2745717763900757,
0.46648773550987244,
0.18639236688613892,
-0.1486414521932602,
-0.44343215227127075,
-0.3353631794452667,
0.28737831115722656,
-0.4080795347690582,
-0.1184016093611... | |
Is there a way to make items right aligned, say with the page or with some other item in a report, using reporting services 2008 ? Right now, I'm sort of emulating this behaviour by
shifting items to the right manually so that they look right aligned, however, when there's an item with a dynamic width (e.g. a tablix wi... | [
0.19816097617149353,
-0.06843093037605286,
0.4748084545135498,
0.19479010999202728,
-0.24619734287261963,
-0.3067935109138489,
0.198336660861969,
-0.30560100078582764,
-0.3548882305622101,
-0.5078989863395691,
-0.05490811541676521,
0.802160918712616,
-0.08273089677095413,
-0.10450096428394... | |
way to do it.
You can employ some tricks to get the visual effects closer or perfect (textboxes work perfectly, tablix's are tougher and depend on a number of their settings):
- Place the right edge where you want it and drag the left edge to the maximum size you want to cater for, set the text align property to r... | [
0.2534993290901184,
-0.31216415762901306,
0.5633199214935303,
0.3416063189506531,
-0.057782337069511414,
-0.09865846484899521,
0.21993133425712585,
-0.2727762758731842,
-0.2044629007577896,
-0.7291737198829651,
0.1030266210436821,
0.7790989279747009,
-0.2282581478357315,
-0.491775035858154... | |
growth handled and no export issues.
- Another trick is to place your elements in a rectangle which can help constrain it.
These options will work fine with dynamically generated RDL's, or setting in BIDS or Report Builder, as should all options, as it is the RDL which is the limiting factor not the tool/method wh... | [
-0.13127651810646057,
-0.2821500897407532,
0.3539797365665436,
0.41239073872566223,
0.13279689848423004,
-0.316327840089798,
-0.25462138652801514,
-0.29750335216522217,
-0.5550033450126648,
-0.5073495507240295,
0.06044306233525276,
0.3786812126636505,
-0.11890079826116562,
-0.0986422449350... | |
I have a class.
```
Public Class Foo
Private _Name As String
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
Private _Age As String | [
0.03836603835225105,
0.2381274402141571,
0.26660624146461487,
-0.11949935555458069,
0.04504087194800377,
-0.15033696591854095,
0.10479091852903366,
-0.1363275945186615,
0.1171543300151825,
-0.40484508872032166,
-0.13738484680652618,
0.4882814288139343,
0.011203795671463013,
0.6129583716392... | |
Public Property Age() As String
Get
Return _Age
End Get
Set(ByVal value As String)
_Age = value
End Set
End Property
Private _ContactNumber As String
Public Property ContactNumber() As String
Get | [
0.08569950610399246,
0.023827044293284416,
0.5960673689842224,
-0.23554639518260956,
0.2843293249607086,
-0.24703094363212585,
-0.13372373580932617,
-0.25338757038116455,
-0.08087312430143356,
-0.2510244846343994,
-0.5919660925865173,
0.7032260298728943,
0.13638971745967865,
0.539010226726... | |
Return _ContactNumber
End Get
Set(ByVal value As String)
_ContactNumber = value
End Set
End Property
End Class
```
I want to loop through the properties of the above class.
eg;
```
Public Sub DisplayAll(ByVal Someobject As Foo)
For Each _Property As something In Someobjec... | [
-0.0175071619451046,
0.09263544529676437,
0.7725912928581238,
-0.36066123843193054,
0.283123254776001,
-0.32271870970726013,
0.2986656129360199,
-0.35488763451576233,
0.1302202194929123,
-0.4185110032558441,
-0.1486988067626953,
0.6916844248771667,
-0.20531703531742096,
0.24355144798755646... | |
Sub
```
Use Reflection:
```
Type type = obj.GetType();
PropertyInfo[] properties = type.GetProperties();
foreach (PropertyInfo property in properties)
{
Console.WriteLine("Name: " + property.Name + ", Value: " + property.GetValue(obj, null));
}
```
for Excel - what tools/reference item must be added to gain ac... | [
-0.19577598571777344,
0.18314246833324432,
0.7236651182174683,
-0.1850012093782425,
0.03886030614376068,
-0.1507420837879181,
0.31224697828292847,
-0.6433045268058777,
-0.11692781746387482,
-0.5960157513618469,
-0.5005767345428467,
0.5102095007896423,
-0.3314104378223419,
0.299920767545700... | |
I have a asp:BoundColumn with DateTime? data (i'll call it column X) in the asp:GridView. I loop through all the rows in the grid, and cast the .Text property to column X to DateTime (i need this to do some checking and change the cell background color if needed).
I have 2 options:
1. wrap the cast in try/catch ... h... | [
0.24833351373672485,
-0.051886677742004395,
0.7241314649581909,
-0.04521142691373825,
0.017815684899687767,
0.016416195780038834,
0.13140170276165009,
-0.24072511494159698,
-0.17245709896087646,
-0.8370763659477234,
0.15634234249591827,
0.5242782235145569,
-0.19040542840957642,
-0.18373581... | |
i take, and why?
Thank you.
**p.s. 1 up-vote for all explanations, accepted answer for TryParse**
**Edit2: even though i used TryParse, I've unchecked the accepted answer to keep the discussion going.**
**My "good data"/"bad data" ratio is about 2/1 - this means lots of bad input**
I'll re-accept the answer in a ... | [
0.16600438952445984,
-0.11872562021017075,
0.5139443874359131,
0.17030112445354462,
-0.09866314381361008,
0.2202736884355545,
0.06009497120976448,
-0.10462974011898041,
-0.11553967744112015,
-0.517454981803894,
-0.11529217660427094,
0.2884010076522827,
-0.1538744419813156,
-0.0838086754083... | |
Are there any [static code analysis](http://en.wikipedia.org/wiki/Static_code_analysis) tools for [stored procedures](http://en.wikipedia.org/wiki/Stored_procedure) written particularly in [PL/SQL](http://en.wikipedia.org/wiki/PL_SQL) and [T-SQL](http://en.wikipedia.org/wiki/Transact-SQL)?
For T-SQL, Microsoft has the ... | [
0.35469484329223633,
-0.45453372597694397,
0.15483765304088593,
0.3313796818256378,
-0.2670259475708008,
-0.2554723918437958,
0.10959961265325546,
-0.1689627319574356,
-0.40153923630714417,
-0.3694043755531311,
-0.284237265586853,
0.524662435054779,
-0.3935445249080658,
-0.2531773447990417... | |
**I need to be able to trigger a event whenever an object is added to a `Queue<Delegate>`.**
I created a new class that extends `Queue`:
```
public delegate void ChangedEventHandler(object sender, EventArgs e);
public class QueueWithChange<Delegate> : Queue<Delegate>
{
public event ChangedEventHandler Changed;
... | [
0.18811500072479248,
-0.3832479417324066,
0.5932620763778687,
-0.03308999910950661,
0.3162325322628021,
0.22829914093017578,
0.0661308541893959,
-0.08801209926605225,
-0.4959369897842407,
-0.36892926692962646,
-0.13906580209732056,
0.46451127529144287,
-0.3217942416667938,
0.24843509495258... | |
another class, like such:
```
QueueWithChange<TimerDelegate> eventQueue = new QueueWithChange<TimerDelegate>();
//
eventQueue.Changed += new ChangedEventHandler(delegate(object s, EventArgs ex) {
//This event is not being triggered, so this code is unreachable atm...and that is my problem
if (eventQueue.Cou... | [
-0.030331484973430634,
-0.6113274097442627,
0.3942258656024933,
0.005385597236454487,
0.29189369082450867,
-0.08360763639211655,
0.346409410238266,
-0.27503490447998047,
-0.5165587067604065,
-0.378059446811676,
-0.11844751983880997,
0.8383023142814636,
-0.3478981554508209,
0.25121614336967... | |
override void Enqueue(object obj)
{
base.Enqueue(obj);
OnChanged(EventArgs.Empty);
}
```
However, if you mean the generic `Queue<T>` class, then note that there is no suitable virtual method to override. You might do better to **encapsulate** the queue with your own class:
(\*\* important edit: removed base-... | [
-0.10146624594926834,
-0.4046356976032257,
0.5170459151268005,
-0.041795216500759125,
0.3372175097465515,
0.19130122661590576,
0.05072861537337303,
0.005461347289383411,
-0.3893126845359802,
-0.45556142926216125,
-0.3011130392551422,
0.5027022957801819,
-0.47880932688713074,
0.537232398986... | |
item)
{
queue.Enqueue(item);
OnChanged();
}
public int Count { get { return queue.Count; } }
public virtual T Dequeue()
{
T item = queue.Dequeue();
OnChanged();
return item;
}
}
```
However, looking at your code, it seems possible that you are u... | [
0.1344149261713028,
-0.5144087672233582,
0.4629707932472229,
-0.024265602231025696,
0.1861758828163147,
0.37132540345191956,
0.29340696334838867,
-0.0630883052945137,
-0.5559688806533813,
-0.5465880036354065,
-0.18978123366832733,
0.5331563353538513,
-0.43583038449287415,
0.458562880754470... | |
multiple threads here. If that is the case, consider a [threaded queue](https://stackoverflow.com/questions/530211/creating-a-blocking-queuet-in-net) instead. | [
0.04345591366291046,
-0.3521636724472046,
0.0246825460344553,
0.037062868475914,
-0.01747903786599636,
0.02674957737326622,
0.14480866491794586,
0.26496538519859314,
-0.8266390562057495,
-0.4658759832382202,
0.007768920622766018,
-0.03506496176123619,
-0.4805876314640045,
0.410022705793380... | |
Inspired by the question [Difference in initalizing and zeroing an array in c/c++ ?](https://stackoverflow.com/questions/453432/difference-in-initalizing-and-zeroing-an-array-in-c-c), I decided to actually examine the assembly of, in my case, an optimized release build for Windows Mobile Professional (ARM processor, fr... | [
-0.23632307350635529,
0.07570641487836838,
0.28238871693611145,
-0.1943201869726181,
0.0674234926700592,
0.06472234427928925,
-0.08399655669927597,
-0.4865747392177582,
-0.26309439539909363,
-0.4456450045108795,
-0.030778666958212852,
0.44087687134742737,
-0.31472039222717285,
-0.127106592... | |
] // b[9] (last element of b)
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ] // b[0] = sp + 12 (stack pointer + 12 bytes)
[ ] // padding byte to reach DWORD boundary
[ ] // padding byte to reach DWORD boundary
[ ] // a[9] (last element of a)
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ] // a[0] = sp (stack pointer, at bottom)
```
The gen... | [
-0.39777594804763794,
0.1060379147529602,
0.6747962832450867,
-0.3579733967781067,
-0.09885130077600479,
0.2428981363773346,
0.2864397168159485,
-0.7277768850326538,
-0.41869163513183594,
-0.4508615732192993,
-0.2144079953432083,
0.33726567029953003,
-0.29674476385116577,
-0.21163158118724... | |
// 3rd arg to memset: 9 bytes, note that sizeof(a) = 10
03: mov r1, #0 // 2nd arg to memset: 0-initializer
04: add r0, sp, #1 // 1st arg to memset: &a[1] = a + 1, since only 9 bytes will be set
05: strb r3, [sp] // a[0] = r3 = 0, sets the first element of a
06: bl memset // continue in mem... | [
-0.401912659406662,
0.20404228568077087,
0.9070495963096619,
-0.5409024357795715,
-0.02821364253759384,
0.49086233973503113,
0.4432821571826935,
-0.6869804859161377,
-0.3239748775959015,
-0.169454425573349,
-0.5682093501091003,
0.5331357717514038,
-0.071929432451725,
-0.31126266717910767,
... | |
b[10];
; memset(b, 0, sizeof(b));
07: mov r2, #0xA // 3rd arg to memset: 10 bytes, sizeof(b)
08: mov r1, #0 // 2nd arg to memset: 0-initializer
09: add r0, sp, #0xC // 1st arg to memset: sp + 12 bytes (the 10 elements
// of a + 2 padding bytes for alignment) = &b[0]
10: bl ... | [
-0.21888287365436554,
0.272383451461792,
0.7226359248161316,
-0.3485763370990753,
-0.02285074256360531,
0.6166675090789795,
0.4270457327365875,
-0.7662479281425476,
-0.23127125203609467,
-0.32168570160865784,
-0.38717493414878845,
0.5491828322410583,
-0.23664072155952454,
-0.41493675112724... | |
// continue in memset
```
Now, there are two things that confuses me:
1. What's the point of lines 02 and 05? Why not just give &a[0] and 10 bytes to memset?
2. Why isn't the padding bytes of a 0-initialized? Is that only for padding in structs?
Edit: I was too curious to not test the struct case:
```
struct Padde... | [
-0.17076388001441956,
0.16615897417068481,
0.4752318561077118,
-0.0905308648943901,
-0.22632502019405365,
0.19252893328666687,
0.3761366307735443,
-0.13586491346359253,
-0.24519868195056915,
-0.4570743441581726,
-0.29808732867240906,
0.27069762349128723,
-0.16296416521072388,
-0.1563748419... | |
#4]
; Padded p2;
; memset(&p2, 0, sizeof(p2));
05: mov r3, #0
06: str r3, [sp]
07: andcs r4, r0, #0xFF
08: str r3, [sp, #4]
```
Here we see in line 04 that a padding indeed occur, since `str` (as opposed to `strb`) is used. Right?
The reason for lines 2 and 5 is because you specified a 0 in the array initiali... | [
-0.1521066576242447,
0.060917265713214874,
0.5969791412353516,
-0.15032094717025757,
-0.1489870399236679,
0.3059329390525818,
0.2859724164009094,
-0.3179935812950134,
-0.18277153372764587,
-0.22093108296394348,
-0.2067278027534485,
0.40362784266471863,
-0.07037273049354553,
-0.070052497088... | |
only used to align memory accesses -- the data shouldn't be used under normal circumstances, so memsetting it is wasteful.
Edit: For the record, I may be wrong about the strw assumption above. 99% of my ARM experience is reversing code generated by GCC/LLVM on the iPhone, so my assumption may not carry over to MSVC. | [
-0.059308260679244995,
0.09048731625080109,
0.4004228115081787,
0.19575165212154388,
0.17391012609004974,
-0.20905877649784088,
0.26120007038116455,
-0.18172617256641388,
-0.45717090368270874,
-0.3365127742290497,
-0.03850093111395836,
0.6441627144813538,
0.033018264919519424,
-0.295513182... | |
I'm looking for a python browser widget (along the lines of pyQT4's [QTextBrowser](http://doc.trolltech.com/3.3/qtextbrowser.html) class or [wxpython's HTML module](http://www.wxpython.org/docs/api/wx.html-module.html)) that has events for interaction with the DOM. For example, if I highlight an h1 node, the widget cla... | [
0.08901837468147278,
-0.03605368733406067,
0.2992974519729614,
-0.18114139139652252,
-0.21836479008197784,
-0.019031783565878868,
0.2595524191856384,
-0.12314165383577347,
-0.233195498585701,
-0.43291792273521423,
-0.18459540605545044,
0.4559580981731415,
-0.23000741004943848,
0.1540195047... | |
able to find it. Thanks in advance!
It may not be ideal for your purposes, but you might want to take a look at the Python bindings to KHTML that are part of PyKDE. One place to start looking is the KHTMLPart class:
<http://api.kde.org/pykde-4.2-api/khtml/KHTMLPart.html>
Since the API for this class is based on the s... | [
0.1300913542509079,
-0.1994234174489975,
0.21674945950508118,
0.610805094242096,
0.16391165554523468,
-0.15180787444114685,
0.10482490807771683,
-0.024685312062501907,
-0.2823523283004761,
-0.6817949414253235,
0.00720907561480999,
0.4436802864074707,
-0.10471892356872559,
0.032960876822471... | |
of the document.
More information can be found here:
<http://api.kde.org/pykde-4.2-api/khtml/index.html> | [
0.22201097011566162,
0.22547221183776855,
0.43530333042144775,
0.12987613677978516,
-0.15363839268684387,
-0.04332933574914932,
-0.03207254037261009,
-0.12948660552501678,
-0.36527153849601746,
-0.11321152746677399,
-0.36289480328559875,
-0.2175583392381668,
-0.285897433757782,
0.263198435... | |
Suppose I have two classes:
```
public class Student
{
public int Id {get; set;}
public string Name {get; set;}
public IList<Course> Courses{ get; set;}
}
public class StudentDTO
{
public int Id {get; set;}
public string Name {get; set;}
public IList<CourseDTO> Courses{ get; set;}
}
```
I wo... | [
0.31268930435180664,
0.051390014588832855,
0.2381562888622284,
0.08679395914077759,
0.06196519359946251,
0.0960971787571907,
-0.027555175125598907,
-0.20089243352413177,
0.21424509584903717,
-0.7032514810562134,
-0.3324394226074219,
0.31796231865882874,
-0.2836933135986328,
0.1736919283866... | |
I suspect you might just have to write and maintain code:
```
Student foo = new Student {
Id = 1,
Name = "a",
Courses = {
new Course { Key = 2},
new Course { Key = 3},
}
};
StudentDTO | [
0.40285590291023254,
0.1387716680765152,
0.44548943638801575,
0.020882457494735718,
0.4774528741836548,
-0.18633872270584106,
-0.014452574774622917,
0.17330271005630493,
-0.037417951971292496,
-0.4530331492424011,
-0.3438590466976166,
0.45318567752838135,
-0.01891724392771721,
0.4431889653... | |
dto = new StudentDTO {
Id = foo.Id,
Name = foo.Name,
};
foreach (var course in foo.Courses) {
dto.Courses.Add(new CourseDTO {
Key = course.Key
});
}
```
---
edit; only applies to **shallow** copies - not lists
Reflection is an option, but slow. In 3.5 you can ... | [
0.30352574586868286,
-0.20858506858348846,
0.43265044689178467,
-0.13969993591308594,
0.060334138572216034,
0.08013061434030533,
0.035057805478572845,
-0.10045328736305237,
0.06038902699947357,
-0.6225014328956604,
-0.19999031722545624,
0.5210855007171631,
-0.17149034142494202,
-0.06442184... | |
`Expression`. Jon Skeet has a pre-rolled sample of this in [MiscUtil](http://www.yoda.arachsys.com/csharp/miscutil/) - just use as:
```
Student source = ...
StudentDTO item = PropertyCopy<StudentDTO>.CopyFrom(student);
```
Because this uses a compiled `Expression` it will vastly out-perform reflection.
If you don't... | [
0.04581007361412048,
-0.03927244618535042,
0.5024537444114685,
0.18657243251800537,
-0.12260833382606506,
-0.012739306315779686,
0.32816803455352783,
-0.6157316565513611,
0.058455437421798706,
-0.6654154658317566,
-0.6249816417694092,
0.6855739951133728,
-0.0655762329697609,
-0.18742203712... | |
Is there a standard c# class that defines a notional Left, Right, Top and Bottom?
Should I just use my own?
```
enum controlAlignment
{
left = 1,
top,
right,
bottom,
none = 0
}
```
Perhaps System.Windows.Forms.AnchorStyles or System.Windows.Forms.DockStyles could do the job. | [
0.209695965051651,
0.05217934772372246,
0.49845054745674133,
-0.07167518883943558,
0.34358489513397217,
-0.039974112063646317,
-0.260647714138031,
-0.11255801469087601,
-0.1036175936460495,
-0.3338507115840912,
-0.06466665863990784,
0.6226806640625,
-0.0727609321475029,
-0.0759922415018081... | |
Is there any way to measure code coverage with DUnit? Or are there any free tools accomplishing that? What do you use for that? What code coverage do you usually go for?
Jim McKeeth: Thanks for the detailed answer. I am talking about unit testing in the sense of a TDD approach, not only about unit tests after a failur... | [
0.5536825656890869,
0.028081627562642097,
-0.47704455256462097,
0.2430432289838791,
-0.36792269349098206,
-0.21463599801063538,
0.15437784790992737,
-0.28546342253685,
-0.03502190113067627,
-0.5895082354545593,
0.07068993896245956,
0.3847004175186157,
0.1828627735376358,
0.0804690644145011... | |
line coverage but I'm planning to add class and method coverage too.
It generates html reports with a summary as well as marked up source showing you what lines are covered (green), which were not (red) and the rest of the lines that didn't have any code generated for them.
**Update:**
As of version 0.3 of [Delphi Co... | [
-0.1576354056596756,
-0.4794048070907593,
0.5647249817848206,
-0.02298523113131523,
-0.16667625308036804,
-0.022232355549931526,
0.050483353435993195,
-0.0787825733423233,
-0.022227203473448753,
-0.6967403888702393,
-0.048004548996686935,
0.29469603300094604,
-0.22738878428936005,
-0.31943... | |
BPLs | [
-0.10867531597614288,
0.14657992124557495,
0.6049992442131042,
0.11771763861179352,
0.01042121835052967,
-0.27073514461517334,
0.08486545085906982,
0.12982402741909027,
-0.4604533016681671,
-0.1387411653995514,
-0.52125483751297,
-0.053885042667388916,
0.08394262939691544,
0.17999020218849... | |
Part of our system provides a web service through apache tomcat, the service is referenced in the server-config.wsdd file. Unfortunately nobody can remember how it got in there.
The apache set up has changed, and I need to update the system for the new configuration. What magic keywords can I google for to help me work... | [
0.5007365942001343,
-0.021039534360170364,
0.5609629154205322,
0.25499674677848816,
0.037764277309179306,
-0.08564791828393936,
0.2697434425354004,
0.12816785275936127,
-0.06532254070043564,
-0.6375607252120972,
0.18964840471744537,
0.08907876163721085,
-0.14392121136188507,
0.382427781820... | |
belongs. | [
0.4488452970981598,
0.07006246596574783,
0.6073299646377563,
0.3037163317203522,
0.1913972944021225,
-0.27855682373046875,
0.10399284213781357,
-0.1931394785642624,
-0.14645712077617645,
-0.3142353892326355,
-0.18257352709770203,
-0.3712139129638672,
-0.0844816267490387,
0.3689294755458832... | |
I have unit tests set up for my iPhone project built using the [Google Toolkit for Mac](http://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting) framework on top of OCUnit. I have a dependent project called "Unit Tests" that builds and runs the tests as needed.
But then it all stopped working, for no re... | [
0.46735623478889465,
0.279476135969162,
0.09601093083620071,
0.11842863261699677,
0.1599067896604538,
0.2434644103050232,
0.22513547539710999,
0.1710054725408554,
0.2441766858100891,
-0.3906840682029724,
-0.012894623912870884,
0.45815667510032654,
0.08353173732757568,
0.21250493824481964,
... | |
"finishes" launching.
If I modify the shell script that runs the "Unit Tests" executable and take out the `-RegisterForSystemEvents` argument, the executable exists immediately (it runs no tests) and gives me the following message:
> Terminating since there is no system event server.
>
> (Run the EventPump or pas... | [
0.3893575072288513,
-0.08498725295066833,
0.4438907504081726,
-0.012814330868422985,
0.18464230000972748,
-0.10187101364135742,
0.361626535654068,
-0.11094930768013,
-0.21935173869132996,
-0.3592848479747772,
-0.4805312752723694,
0.5100910663604736,
0.09635405242443085,
0.35546931624412537... | |
it working again. However, Google doesn't provide links to anything relevant to the current situation, and nothing in the dev docs is helpful.
Any ideas?
We fixed this issue as of this morning. Top of tree GTM should not hang anymore. It has to do with the delegate being switched before it had a chance to get the appl... | [
0.18764621019363403,
-0.3110347390174866,
0.5544027090072632,
0.21705572307109833,
-0.04524765536189079,
-0.47164639830589294,
0.43207553029060364,
-0.005282982252538204,
-0.7072324752807617,
-0.5040915012359619,
-0.09661060571670532,
0.34610217809677124,
-0.10839966684579849,
0.1793164759... | |
I need to know whether Microsoft Word, Excel, Outlook, Project, etc are installed in a Windows Forms .net 2.0 C# application.
The first attempt was by simply trying to create the application objects and catching any exception, but this is too time consuming.
Is there any faster way to detect this? Like checking r... | [
0.5359039902687073,
0.2128700166940689,
0.37611523270606995,
0.0595807321369648,
0.08511281758546829,
-0.19447606801986694,
0.26727789640426636,
-0.01698799431324005,
0.2180740237236023,
-0.707511305809021,
0.21406374871730804,
0.6107556223869324,
-0.2660406827926636,
0.2641107439994812,
... | |
for example, puts its install location at `HKLM\SOFTWARE\Microsoft\Office\12.0\Word\InstallRoot`.
This doesn't help you if you're planning on using the interop components, but it *does* tell you, with reasonable certainty, whether the various things are installed. | [
0.4172937870025635,
0.028018059208989143,
0.1466665416955948,
0.011168979108333588,
0.5232006907463074,
-0.3838292062282562,
0.17155365645885468,
0.2861228287220001,
-0.11753593385219574,
-0.8008009791374207,
-0.3453681766986847,
0.46507737040519714,
-0.11951662600040436,
-0.14643423259258... | |
I am pretty new to the whole JavaScript thing. I have a gridview that I want the user to be able to hover over the whole row (believe its the whole TR) and be able to click anywhere and that would be able to select that row. I need the server-side code to be able to know which row was clicked.
I don't really know wher... | [
0.5781424045562744,
-0.24689947068691254,
0.4414184093475342,
-0.17659825086593628,
-0.024063702672719955,
-0.08682607114315033,
-0.1170274168252945,
0.0568719245493412,
-0.016267815604805946,
-0.6515195965766907,
0.2041352093219757,
0.47296908497810364,
-0.27955305576324463,
-0.0873530209... | |
up the ability to click anywhere on that row and fire server-side code to know which row was clicked.
Was reading this article <http://www.dotnetcurry.com/ShowArticle.aspx?ID=109> on firing server-side code from client-side but don't know how to figure out what row it would have come from.
This should do the trick, ju... | [
0.05276050046086311,
-0.2809106409549713,
0.8942887187004089,
-0.038442570716142654,
0.01156017929315567,
0.08642786741256714,
0.1638076901435852,
-0.4070621728897095,
-0.4186936914920807,
-0.6884731650352478,
-0.00147738226223737,
0.6263889670372009,
-0.3868626356124878,
-0.07084502279758... | |
e.Row.Attributes["onmouseout"] = "this.style.background = '#FFFFFF';";
e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.Gridview1, "Select$" + e.Row.RowIndex);
}
}
```
The click will be detected server-side by the GridView click event. | [
-0.050556961447000504,
-0.12209200859069824,
0.7714157700538635,
-0.35579314827919006,
0.16629236936569214,
-0.24824032187461853,
0.3771720826625824,
-0.08157095313072205,
-0.22202232480049133,
-0.7228049039840698,
-0.3716980814933777,
0.7275112271308899,
-0.4934287667274475,
0.32421162724... | |
As far as I know, most recursive functions can be rewritten using loops. Some may be harder than others, but most of them can be rewritten.
Under which conditions does it become impossible to rewrite a recursive function using a loop (if such conditions exist)?
When you use a function recursively, the compiler takes c... | [
0.059763938188552856,
0.020871877670288086,
-0.21348629891872406,
0.21402275562286377,
0.005148593336343765,
-0.07309495657682419,
0.6013302206993103,
-0.06042229011654854,
-0.3828828036785126,
-0.3972378373146057,
-0.07021209597587585,
0.6924402713775635,
-0.4088667631149292,
-0.193032875... | |
done with recursion and that cannot be done with **a loop and a stack**. | [
-0.1685529351234436,
0.07936489582061768,
-0.030575837939977646,
-0.09191610664129257,
-0.235759437084198,
-0.31020742654800415,
0.5287826061248779,
-0.12736298143863678,
-0.2054881453514099,
-0.46121177077293396,
-0.5111929774284363,
0.26763999462127686,
-0.322145938873291,
0.042045164853... | |
What is the best (easiest) way to take a screenshot of an running application with C++ under Windows?
You have to get the device context of the window ([`GetWindowDC()`](http://msdn.microsoft.com/en-us/library/dd144947(VS.85).aspx)) and copy image ([`BitBlt()`](http://msdn.microsoft.com/en-us/library/dd183370(VS.85).as... | [
0.07033854722976685,
-0.016145016998052597,
0.58393394947052,
0.286503404378891,
0.15446773171424866,
0.03545684739947319,
0.022154251113533974,
-0.15818069875240326,
-0.13109682500362396,
-0.782878041267395,
-0.1299159824848175,
0.4043286144733429,
-0.07494451850652695,
-0.121482573449611... | |
I get "database table is locked" error in my sqlite3 db. My script is single threaded, no other app is using the program (i did have it open once in "SQLite Database Browser.exe"). I copied the file, del the original (success) and renamed the copy so i know no process is locking it yet when i run my script everything i... | [
0.17102278769016266,
0.38247841596603394,
0.45465826988220215,
0.0008906104485504329,
0.16675163805484772,
-0.07998276501893997,
0.6774604320526123,
-0.03814607486128807,
-0.4732815623283386,
-0.5263323783874512,
-0.051147595047950745,
0.5819880962371826,
-0.37169578671455383,
0.4289068281... | |
up and cleaning it, it magically started working again.
-edit2-
Someone else posted so i might as well update. I think the problem was i was trying to do a statement with a command/cursor in use.
I have run into this problem before also. It occurs often when you have a cursor and connection open and then your program... | [
0.05955403670668602,
0.2549103796482086,
0.1879725456237793,
0.027022240683436394,
-0.13337299227714539,
-0.3692184090614319,
0.6553300619125366,
-0.22004160284996033,
-0.37502729892730713,
-0.5072094798088074,
-0.29495227336883545,
0.5539783239364624,
-0.37323859333992004,
0.3458990156650... | |
db_filename with the name of the SQLite database."""
connection = sqlite.connect(db_filename)
connection.commit()
connection.close()
``` | [
-0.059116020798683167,
0.3070543110370636,
0.4417888820171356,
-0.05575072392821312,
-0.08240567892789841,
-0.17728932201862335,
0.04612217843532562,
-0.15341390669345856,
0.08092473447322845,
-0.4255288541316986,
-0.20315177738666534,
0.23096847534179688,
-0.4788268804550171,
0.5811691284... | |
How can I enable the functionality to sync my custom list with Outlook 2007 todo or calendar list? I assume it's possible with custom lists too, but I cannot find any documentation on it.
To my knowledge this is not possible. If you need to sync a todo list, create a task list. Then you can delete all the columns that ... | [
0.17260538041591644,
-0.1474798619747162,
0.42451271414756775,
0.32274875044822693,
-0.29085177183151245,
0.18528121709823608,
0.04383515566587448,
0.09633062779903412,
-0.20705503225326538,
-0.4592060148715973,
0.49939537048339844,
0.8478087782859802,
-0.28316569328308105,
-0.001651221653... | |
I have created a custom icon bar in Android using the XML layout creator, using a RadioGroup within a LinearLayout (XML included below). Each RadioButton within the RadioGroup has a custom drawable (with checked and unchecked states) as its `android:button` attribute.
The Linear layout is itself within a `RelativeLay... | [
0.1615561842918396,
0.19204038381576538,
0.8705711960792542,
-0.3657287657260895,
0.0005493916687555611,
0.375934362411499,
0.13935048878192902,
-0.4914713501930237,
0.09724266082048416,
-0.6760200262069702,
0.01690492033958435,
0.7037392258644104,
-0.368647962808609,
-0.011756446212530136... | |
RadioButton image widths are visible. Setting the `layout\_width` of the `RelativeLayout` to `fill\_parent` rectifies this and causes the full button to appear.
However this means that the button group consumes click events across the entire width of the screen.
How can I make the entire button appear, and have only ... | [
-0.03387296944856644,
0.0937458947300911,
0.5295608639717102,
-0.5175191760063171,
-0.06531960517168045,
-0.20553945004940033,
0.3964344263076782,
-0.4927368760108948,
0.04134634882211685,
-0.4023783206939697,
-0.1818893849849701,
0.7847728133201599,
-0.4688858687877655,
-0.085864447057247... | |
<RadioButton android:id="@+id/RB01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR01"/>
<RadioButton android:id="@+id/RB02" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR02"/>
<RadioButton... | [
-0.08716236054897308,
-0.06970512121915817,
0.7159176468849182,
-0.5026054978370667,
-0.0919460654258728,
0.16520562767982483,
-0.006993691902607679,
-0.5219307541847229,
-0.1533382534980774,
-0.6063640117645264,
-0.0927993431687355,
0.6827565431594849,
-0.14150184392929077,
0.079515114426... | |
it would have to be the Layout's width. The dimensions are "hardcoded" but they'll scale with the size of your screen.
So the xml could look like:
```
android:layout_width="55dp"
```
The official documentation for dps is [here](http://developer.android.com/guide/topics/resources/available-resources.html#dimension) | [
0.37315651774406433,
-0.34219616651535034,
0.8049253821372986,
-0.057394031435251236,
0.04998491704463959,
0.11076430976390839,
-0.461685448884964,
-0.3186236321926117,
-0.37015509605407715,
-0.7429003119468689,
-0.15200941264629364,
0.2961197793483734,
0.19689226150512695,
0.0281851980835... | |
Is it somehow possible to use the XmlSerializer to deserialize its data into an existing instance of a class rather than into a new one?
This would be helpful in two cases:
1. Easily merge two XML files into one object instance.
2. Let object constructer itself be the one who is loading its data from the XML file.
I... | [
0.18198911845684052,
-0.2660101652145386,
-0.11627954989671707,
0.3861684501171112,
-0.16647574305534363,
-0.26702967286109924,
0.1180371418595314,
-0.23685166239738464,
-0.10087850689888,
-0.6116120219230652,
0.037591028958559036,
0.4918726980686188,
-0.3202727735042572,
0.224084049463272... | |
operations anyway, you could take in the destination object, do the deserialization normally into a new object, then do something similar to cloning by copying over one by one only the properties holding non-default values.
It shouldn't be that complex to implement this, and it would look to consumers from the rest o... | [
0.3660256862640381,
-0.14382770657539368,
0.02492811158299446,
0.3089074492454529,
0.36946171522140503,
0.07634367793798447,
-0.20939627289772034,
-0.10982590168714523,
-0.2693711519241333,
-0.3765277564525604,
-0.03006737120449543,
0.5761774778366089,
-0.3167833685874939,
0.11889360845088... | |
I'm working on a site which the client has had translated into Croatian and Slovenian. In keeping with our existing URL patterns we have generated URL re-writing rules that mimic the layout of the application which has lead to having many non-ascii charachters in the URLs.
Examples š ž č
Some links are triggered from... | [
0.3065589964389801,
0.4440514147281647,
0.27434512972831726,
-0.2773802876472473,
-0.21380597352981567,
0.034609101712703705,
0.47345325350761414,
0.02412211149930954,
0.015546347014605999,
-0.5256901979446411,
-0.4445103108882904,
0.19567006826400757,
-0.1984407901763916,
0.13249336183071... | |
= %c4%8d
```
I'm guessing this is something to do with IIS and the way it handles Response.Redirect and AddHeader("Location ...
Does anyone know of a way of forcing IIS to not URL encode these chars or is my best bet to replace these with non-diacritic chars?
Thanks
Ask yourself if you *really* want them non-url e... | [
0.028804078698158264,
0.2555822730064392,
0.2720809280872345,
-0.10142650455236435,
-0.04228757321834564,
0.09682247787714005,
0.43043047189712524,
0.15971270203590393,
0.01203112956136465,
-0.5282592177391052,
-0.42733174562454224,
0.3451685309410095,
-0.25430816411972046,
0.2204035222530... | |
feature. Is it to make the urls look nice? If so, using a regular z instead of ž will do just fine. Do you use the urls for user input? If so, url-encode everything before parsing it to link output, and url-decode it before using the input. But don't use ž and other local letters in urls...
As a side note, in Sweden w... | [
0.5910316109657288,
-0.02780635841190815,
0.5770189762115479,
0.13316939771175385,
-0.10181957483291626,
-0.4024220108985901,
0.42059993743896484,
0.5433023571968079,
-0.5076762437820435,
-0.5134283304214478,
-0.15670379996299744,
0.46562039852142334,
-0.022060096263885498,
-0.170981630682... | |
to understand what words we're aiming at just because the ring in å is missing in the url. The text will still show correctly on the page, right? ;) | [
0.2941415309906006,
0.3477058708667755,
0.3642452359199524,
0.20475664734840393,
0.09346207231283188,
0.009443477727472782,
0.6531326770782471,
0.16058120131492615,
0.12179289758205414,
-0.089851513504982,
-0.2914584279060364,
0.5891465544700623,
0.044471871107816696,
-0.23342281579971313,... | |
Is there any tool (preferably freeware) that can analyze Pascal/Delphi syntax and automatically remove unused vars?
In my case, I'm working with a very large Delphi code base, and the compiler hints report over one thousand cases of "Variable 'x' is declared but never used".
I would take hours to remove them by hand,... | [
0.3426486849784851,
0.25643032789230347,
-0.5070496201515198,
-0.07157561182975769,
-0.07198071479797363,
-0.08756586164236069,
0.31181061267852783,
0.1587783545255661,
-0.3563004732131958,
-0.3870438039302826,
-0.17054632306098938,
0.6660972833633423,
-0.022061694413423538,
-0.22180370986... | |
with legacy code. Unfortunately I don't know of any existing tool (I should add freeware tool here, static analyis tools should of course be able to do it easily, but I don't know of any free static code analysis tool) that is capable doing that.
But I guess you could easily write such a tool in a few minutes. A small... | [
0.2416624277830124,
-0.15699762105941772,
0.06686396896839142,
0.4258973002433777,
0.18467582762241364,
-0.2954125702381134,
0.11446644365787506,
-0.08336370438337326,
-0.10597245395183563,
-0.8239210247993469,
0.02707464061677456,
0.6232248544692993,
0.1277107447385788,
0.0047598117962479... | |
are looking for and each such line has the same structure, so parsing should be relatively easy. It can then extract the file name and the line number, open the file and remove the variable declaration. This can be a bit tricky in case of multiple variable declarations in one line but I think it is doable.
I don't kno... | [
0.16227976977825165,
-0.12871935963630676,
0.15397918224334717,
0.1736336052417755,
0.10999498516321182,
-0.10204378515481949,
0.24285028874874115,
0.10782952606678009,
-0.055557671934366226,
-0.5892230272293091,
-0.09545479714870453,
0.669882595539093,
-0.2580831050872803,
-0.071612276136... | |
can't see any problems here. For the parsing part:
```
function ParseHint (const HintText : String; out HintInfo : THintInfo) : Boolean;
var
I, J : Integer;
HintName : String;
begin
Result := False;
for I := 1 to Length (HintText) do
begin
if (HintText [I] = '(') then
begin
J := I + 1;
... | [
-0.22302721440792084,
-0.47744670510292053,
0.7168517708778381,
-0.6276017427444458,
0.1794290393590927,
0.09434692561626434,
0.5258448719978333,
-0.3601779043674469,
0.12013654410839081,
-0.6921699643135071,
-0.20992660522460938,
0.39386534690856934,
-0.12910331785678864,
-0.0475443676114... | |
HintInfo.SourceFile := MidStr (HintText, 12, I-12);
HintName := MidStr (HintText, J+3, 5);
if (HintName <> 'H2164') then Exit (False);
end;
if (HintText [I] = '''') then
begin
J := I + 1;
while (HintText [J] <> '''') do Inc (J);
HintInfo.VarName := MidStr (HintText, I+1, J-(I+1... | [
-0.4228290319442749,
-0.16743870079517365,
0.5564345717430115,
-0.34427931904792786,
0.21431538462638855,
-0.1435583084821701,
0.6197108626365662,
-0.0032037748023867607,
0.47177305817604065,
-0.8184711337089539,
-0.4014802575111389,
0.4931361675262451,
-0.12866204977035522,
-0.25771045684... | |
easy, so the only remaing part is removing the variable from its line of declaration. We can simply search for occurences of HintInfo.VarName in the line and check if the character before and after the occurence are no letters but only ' ', ',' or ':'. If this is the case we can just remove it. This covers all these ca... | [
-0.17035125195980072,
0.048714157193899155,
0.30111056566238403,
-0.19570623338222504,
0.04040132462978363,
-0.1090240627527237,
0.37179863452911377,
-0.06031682342290878,
0.047181665897369385,
-0.5941550135612488,
-0.12696489691734314,
0.6500656008720398,
-0.14775927364826202,
0.252898007... | |
from delphi source files using the compiler-generated hints. | [
0.08623815327882767,
-0.24327215552330017,
-0.12252849340438843,
-0.04390512779355049,
0.04643118754029274,
-0.03812339901924133,
-0.06294962018728256,
0.15426166355609894,
0.14589981734752655,
-0.5871224403381348,
-0.8076717257499695,
0.2986556887626648,
-0.19162486493587494,
-0.371542483... | |
I've been thinking a lot about making an editor core functionality wise compatible to vim, similar to yzis.
The biggest questions are what buffer type to use.
Requirement are:
* possibility to implement fast syntax highlighting, regex on top of it.
* possibility to implement multiple syntax highlightings in a single... | [
-0.10076762735843658,
-0.05499128997325897,
0.4707000255584717,
0.0967072919011116,
-0.3552559018135071,
0.11216767877340317,
0.1574459820985794,
-0.30341893434524536,
0.007195176091045141,
-1.087849497795105,
-0.09267111867666245,
0.6028810739517212,
-0.2631690204143524,
-0.24415238201618... | |
at longer runs. Also the emacs syntax highlighting engine is very slow.(dunno why, maybe not really related to the buffer type)
So the questions:
1. what buffer type would be best for a fast programming editor?
2. what's a fast/complete regex engine? (maybe this includes the next point). TextMate uses oniguruma, is t... | [
-0.11650663614273071,
-0.05157158896327019,
0.10853075236082077,
0.27684107422828674,
-0.20590715110301971,
-0.038329366594552994,
0.048475779592990875,
-0.1644197404384613,
-0.015180233865976334,
-0.43048542737960815,
0.0629424974322319,
0.7442685961723328,
-0.29854434728622437,
-0.266320... | |
Therefore I would not recommend a mind set where everything is to be buffered in RAM.
I would recommend setting up a search tree of slices representing the file, where a single slice may be:
1. A reference to a range of bytes in the actual file on disk, or
2. A reference to an edited "page".
When you open a file you... | [
0.34185099601745605,
0.04387553781270981,
0.21278591454029083,
-0.1537531614303589,
-0.03241996467113495,
0.24478700757026672,
0.014314101077616215,
-0.3122396767139435,
-0.40270113945007324,
-0.8935443162918091,
-0.6007298827171326,
0.31838491559028625,
-0.18099361658096313,
0.13380578160... | |
4 KiB, around the edit point. The tree is spliced at that point. In the example, the edit point is at 5 MiB:
```
size_t const PAGE_SIZE = 4*1024;
slices[0].size = 5*1024*1024;
slices[5*1024*1024].size = PAGE_SIZE;
slices[5*1024*1024].buffer = create_buffer(file, 5*1024*1024, PAGE_SIZE);
slices[5*1024*1024 + PAGE_SIZE]... | [
-0.22373473644256592,
0.16446949541568756,
0.4814054071903229,
-0.01764688454568386,
-0.010591709986329079,
0.3038010597229004,
0.2714310586452484,
-0.269675612449646,
-0.133331760764122,
-0.8785808086395264,
-0.554530143737793,
0.15812323987483978,
-0.0835086777806282,
0.06544394791126251... | |
moving more than 4 KiB of data ahead of you.
This is a simplified description to give the general idea without getting into too many gritty details. A real implementation would most likely need to be more sophisticated, e.g. allow for a variable amount of data in a page to cope with pages that overflow, and merge toge... | [
0.10849282890558243,
-0.39067214727401733,
0.2083270251750946,
0.16311240196228027,
-0.04108380526304245,
0.09922687709331512,
0.09702460467815399,
-0.3589656352996826,
-0.47782447934150696,
-0.672241747379303,
-0.05054885521531105,
0.02204775996506214,
-0.08096754550933838,
-0.09660594910... | |
is that when you start inserting somewhere you should make sure that you are working with a slice that isn't too big.
For regex, I don't think the performance is much of a problem as long as the whole editor doesn't hang while running it. Try [Boost.Regex](http://www.boost.org/doc/libs/1_38_0/libs/regex/doc/html/index... | [
0.08411556482315063,
-0.37398892641067505,
0.2679689824581146,
-0.2814538776874542,
-0.10451186448335648,
-0.12034732103347778,
-0.14867104589939117,
0.05178430676460266,
-0.17366981506347656,
-0.70748370885849,
-0.31027308106422424,
0.6610398292541504,
-0.279668390750885,
-0.5657201409339... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.