text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
virtual void PrintRandom()
{
Console.WriteLine("0");
}
}
public class Descendent : BaseClass
{
private Random randomValue;
public Descendent()
{
Console.WriteLine("Bonjour, Monde!"); | [
-0.12436773627996445,
-0.3320990204811096,
0.08205879479646683,
-0.005443264730274677,
0.2563647925853729,
0.16343991458415985,
0.5395936965942383,
0.13504810631275177,
-0.00933820754289627,
-0.23070092499256134,
-0.42425107955932617,
0.3726942241191864,
-0.3927847146987915,
0.438995093107... | |
randomValue = new Random();
}
public override void PrintRandom()
{
Console.WriteLine(randomValue.NextDouble().ToString());
}
public static void Main()
{
Descendent obj = new Descendent(); | [
-0.3740503489971161,
-0.6447601914405823,
0.5744046568870544,
-0.12910442054271698,
0.4625849425792694,
0.28285789489746094,
0.24469079077243805,
-0.17366625368595123,
-0.25012242794036865,
-0.5376387238502502,
-0.17753441631793976,
0.33103567361831665,
-0.3308850824832916,
0.5695253610610... | |
obj.PrintRandom();
Console.ReadLine();
}
}
}
```
This code breaks because when the object of Descendent is made, it calls the base class constructor and we have a virtual method call in Base Class constructor which in turn calls the Derived class's method and hence, it crashes since randomValu... | [
-0.4113198220729828,
-0.20973236858844757,
0.45370975136756897,
0.004768610931932926,
0.14111270010471344,
-0.04208318889141083,
0.3222944140434265,
-0.1506834328174591,
-0.2629252076148987,
-0.6243646740913391,
-0.11480939388275146,
0.347976952791214,
-0.5141616463661194,
0.45476180315017... | |
base class constructor
2. Update V - Table for this class
3. call the constructor code
My Question is that firstly whether I am right that as per OOP principles, virtualization shouldn't/doesn't work in the super class constructor and secondly if I am right, then why the behavior is different in all .NET languages (... | [
0.17112679779529572,
-0.1752939522266388,
0.1251736581325531,
-0.08556561917066574,
-0.1834268867969513,
-0.11350877583026886,
0.29802659153938293,
-0.08254722505807877,
-0.018328091129660606,
-0.5296998023986816,
-0.17120343446731567,
1.002231240272522,
-0.246615469455719,
0.0546787679195... | |
functions exist, so you get the lowest-level version of the virtual function defined at the time. This does not imply that virtualization cannot be used, you just won't get the subclass versions of virtual methods in the constructors of base classes (which is why it's not recommended).
Obviously, as you can see, manag... | [
-0.13529375195503235,
-0.41059547662734985,
0.0550825297832489,
0.3443482220172882,
-0.16129276156425476,
-0.27186885476112366,
0.4362469017505646,
0.20049260556697845,
-0.3123767673969269,
-0.6129049062728882,
-0.05463452637195587,
0.5761477947235107,
-0.22165480256080627,
0.2245200723409... | |
compile to the same IL). | [
-0.010547548532485962,
0.13898907601833344,
0.1581624150276184,
0.06768272817134857,
0.06270281970500946,
0.036986809223890305,
0.0601746030151844,
-0.42431867122650146,
-0.012837609276175499,
-0.7489532828330994,
-0.15660656988620758,
0.2587759494781494,
-0.5325887799263,
-0.2135692089796... | |
I have a DataGridView that I want to query using Linq (C# WinForm). I want to "count" rows where a certain criteria is met. For example,
```
variable1 = "count rows where ColumnBoxAge > 3 || < 5"
label1.Text = variable1
```
How to do this in C# WinForm using Linq?
I don't know if it could work but you can try this... | [
0.19140367209911346,
0.17426490783691406,
0.6708036661148071,
-0.14291663467884064,
0.04639509320259094,
-0.10540975630283356,
-0.10250816494226456,
-0.4945473074913025,
-0.06126470863819122,
-0.4957186281681061,
0.20973868668079376,
0.5588590502738953,
-0.10030152648687363,
0.264460533857... | |
What is the regular expression for a decimal with a precision of 2?
*Valid examples*:
```
123.12
2
56754
92929292929292.12
0.21
3.1
```
*Invalid examples:*
```
12.1232
2.23332
e666.76
```
The decimal point may be optional, and integers may also be included.
Valid regex tokens vary by implementation. A generic fo... | [
-0.22354364395141602,
0.00236521172337234,
0.36686936020851135,
-0.03608120232820511,
-0.04847440496087074,
0.19790862500667572,
0.04618657007813454,
-0.059450045228004456,
-0.18899306654930115,
0.18807770311832428,
-0.3035435676574707,
0.16743355989456177,
-0.03016044571995735,
-0.0777348... | |
(`.`), try the following:
```
^(\d+(\.\d{0,2})?|\.?\d{1,2})$
```
---
Added
-----
Wrapped the fractional portion in `()?` to make it optional. Be aware that this excludes forms such as `12.` Including that would be more like `^\d+\\.?\d{0,2}$`.
Added
-----
Use `^\d{1,6}(\.\d{1,2})?$` to stop repetition and give a... | [
0.06698059290647507,
0.03429463133215904,
0.22119227051734924,
-0.20774555206298828,
-0.16768808662891388,
0.09301843494176865,
-0.03121795877814293,
-0.33390703797340393,
-0.0672767385840416,
-0.11172188818454742,
-0.49782076478004456,
0.33828824758529663,
-0.19501565396785736,
-0.2250202... | |
I'm trying to figure out how to execute a custom query with Castle ActiveRecord.
I was able to run simple query that returns my entity, but what I really need is the query like that below (with custom field set):
*select count(1) as cnt, data from workstationevent where serverdatetime >= :minDate and serverdatetime ... | [
0.08233194053173065,
-0.07687439024448395,
0.8408902883529663,
-0.05930006504058838,
-0.16260676085948944,
-0.022078529000282288,
-0.0189293771982193,
-0.19172003865242004,
-0.4132506251335144,
-0.605212390422821,
0.16554884612560272,
0.2105157971382141,
-0.10640318691730499,
0.27538558840... | |
will depend on the query, but for more than one value will be `object[]`).
```
HqlBasedQuery query = new HqlBasedQuery(typeof(WorkStationEvent),
"select count(1) as cnt, data from workstationevent where
serverdatetime >= :minDate and serverdatetime < :maxDate
and userId = 1 group by data having count(1... | [
-0.15534822642803192,
-0.21730607748031616,
0.9368239045143127,
-0.21984604001045227,
0.02380586788058281,
0.1267053633928299,
0.172071635723114,
-0.621783435344696,
-0.2053675651550293,
-0.5756115913391113,
-0.3278413414955139,
0.23418879508972168,
-0.2767084836959839,
0.04222375527024269... | |
these results
}
```
You can create an anonymous type to hold the results in a more meaningful fashion. For example:
```
var results = from summary in
(ArrayList)ActiveRecordMediator.ExecuteQuery(query)
select new {
Count = (int)summary[0], Data = (string)summary[1]
};
```
Now results will con... | [
0.13264277577400208,
-0.3508661985397339,
0.6324601173400879,
0.23356753587722778,
-0.20793955028057098,
-0.1916315108537674,
-0.11035047471523285,
-0.09669765084981918,
-0.40084922313690186,
-0.6823293566703796,
-0.1274733692407608,
0.3675174117088318,
-0.38564926385879517,
0.197811484336... | |
aggregates or functions as you can with HQL. | [
0.10171672701835632,
0.0103115513920784,
0.40352436900138855,
0.15652039647102356,
0.061758946627378464,
-0.16194100677967072,
-0.2276051640510559,
-0.0668996274471283,
-0.2959102392196655,
-0.5811238884925842,
-0.20130936801433563,
0.09071997553110123,
-0.15315333008766174,
-0.10161694884... | |
I'm trying to build a multi-level dropdrown CSS menu for a website I'm doing on the umbraco content management system.
I need to build it to have the following structure:
```
<ul id="nav">
<li><a href="..">Page #1</a></li>
<li>
<a href="..">Page #2</a>
<ul>
<li><a href="..">Subpage #1</a></li>
... | [
0.04380928725004196,
0.20638051629066467,
0.538662314414978,
-0.01669974997639656,
-0.31820249557495117,
0.2485140562057495,
0.07055462151765823,
-0.45774492621421814,
-0.37269195914268494,
-0.6202579140663147,
-0.08760056644678116,
0.1698896288871765,
-0.3384876251220703,
-0.0833103656768... | |
this variable on how deep your menu should be -->
<xsl:variable name="maxLevelForMenu" select="4"/>
<xsl:template match="/">
<ul id="nav">
<xsl:call-template name="drawNodes">
<xsl:with-param
name="parent"
select="$currentPage/ancestor-or-self::node [@level=1]"
/>
</xsl:call-t... | [
-0.2319406419992447,
-0.38765183091163635,
0.42916300892829895,
-0.07910618185997009,
-0.01995106041431427,
0.2968156337738037,
-0.09675805270671844,
-0.420014351606369,
-0.11531137675046921,
-0.482282429933548,
-0.14129459857940674,
0.3763502538204193,
-0.14391931891441345,
0.062096260488... | |
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
<xsl:if test="count(./node [string(./data [@alias='umbracoNaviHide']) != '1' and @level <= $maxLevelForMenu]) > 0">
<xsl:call-template name="drawNodes">
<xsl:with-param name="... | [
-0.00531500019133091,
-0.34171751141548157,
0.5756186842918396,
-0.09558717906475067,
0.04173234477639198,
0.16978344321250916,
0.015174970962107182,
-0.6772418022155762,
-0.12613852322101593,
-0.4561469554901123,
-0.2615373134613037,
0.49940812587738037,
-0.3830651640892029,
-0.1561335772... | |
</xsl:if>
</li>
</xsl:for-each>
</xsl:if>
</xsl:template>
```
What I can't seem to figure out is how to check if the first level (here Page #1 and Page #2) has any children, and if they do add the extra `<ul>` to contain the `<li>` children.
Anyone out there to point me in the right direction?
First off... | [
-0.0015796615043655038,
-0.05101059377193451,
0.40188130736351013,
0.18269899487495422,
0.03321163356304169,
0.35218632221221924,
0.019731225445866585,
0.13279299437999725,
-0.12647020816802979,
-0.8265422582626343,
-0.08308322727680206,
0.5128834247589111,
0.06209079548716545,
-0.03151932... | |
match the document root --->
<xsl:template match="/root">
<div id="nav">
<xsl:call-template name="SubTree" />
</div>
</xsl:template>
<!-- this will be called by xsl:apply-templates -->
<xsl:template match="node">
<!-- the node is either protected, or the user is logged on (no need to check for IsProtected tw... | [
-0.2763775587081909,
-0.20905618369579315,
0.7845868468284607,
-0.0014977185055613518,
0.12364586442708969,
-0.1389978677034378,
-0.04749172925949097,
-0.5662082433700562,
0.2373919039964676,
-0.7545667290687561,
-0.10877544432878494,
0.4234975576400757,
-0.2138088494539261,
-0.20615188777... | |
<ul>
<xsl:apply-templates select="node[data[@alias='umbracoNaviHide'] != '1'][@level <= $maxLevelForMenu]">
<!-- ensure sorted output of the child nodes --->
<xsl:sort select="@sortOrder" data-type="number" />
</xsl:apply-templates>
</ul>
</xsl:if>
</xsl:template>
```
This is the ... | [
-0.2697240114212036,
-0.18252412974834442,
0.7291833162307739,
-0.19370780885219574,
0.14634430408477783,
0.16768977046012878,
-0.06228483468294144,
-0.4523847997188568,
-0.04379276931285858,
-0.728369951248169,
-0.13650186359882355,
0.44977930188179016,
-0.20766718685626984,
-0.1015963852... | |
nodeName="Page #2">
<data alias="umbracoNaviHide">0</data>
<node id="3" level="2" sortOrder="2" nodeName="Subpage #2.2">
<data alias="umbracoNaviHide">0</data>
</node>
<node id="4" level="2" sortOrder="1" nodeName="Subpage #2.1">
<data alias="umbracoNaviHide">0</data>
<node id="5" leve... | [
-0.20540766417980194,
0.1087287962436676,
0.5676266551017761,
-0.6252116560935974,
-0.04869154840707779,
-0.17128337919712067,
0.7103252410888672,
-0.4158817231655121,
0.10139787942171097,
-0.4430095851421356,
-0.4646971821784973,
0.7019035816192627,
-0.2905726730823517,
-0.000815612031146... | |
nodeName="Page #3">
<data alias="umbracoNaviHide">1</data>
</node>
</root>
```
This is the output:
```
<div id="nav">
<ul>
<li><a href="http://foo/">Page #1</a></li>
<li><a href="http://foo/">Page #2</a>
<ul>
<li><a href="http://foo/">Subpage #2.1</a>
<ul>
<li><a h... | [
-0.4573575556278229,
0.023733889684081078,
0.6721417307853699,
-0.5045183897018433,
-0.1541835069656372,
0.22497527301311493,
-0.010801497846841812,
-0.2909129559993744,
-0.1047951951622963,
-0.7852171063423157,
-0.4711916744709015,
0.3498729467391968,
-0.33704447746276855,
0.1044343411922... | |
</ul>
</li>
</ul>
</div>
``` | [
-0.22730526328086853,
0.09358056634664536,
0.32028159499168396,
-0.24185283482074738,
-0.3581790328025818,
0.15271246433258057,
-0.002062819432467222,
0.1181807667016983,
-0.18408001959323883,
-0.7650447487831116,
-0.5538100600242615,
0.4668022692203522,
-0.27343031764030457,
0.34187263250... | |
Been thinking, what's the difference between declaring a variable with [] or \* ? The way I see it:
```
char *str = new char[100];
char str2[] = "Hi world!";
```
.. should be the main difference, though Im unsure if you can do something like
```
char *str = "Hi all";
```
.. since the pointer should the reference ... | [
0.009680584073066711,
0.24298106133937836,
0.4152549207210541,
-0.42014962434768677,
-0.20192362368106842,
-0.1515946239233017,
0.6482400894165039,
0.05855594947934151,
-0.12042290717363358,
-0.3542017638683319,
-0.23097069561481476,
0.6884835362434387,
-0.3906036615371704,
0.3947587609291... | |
except in some special cases?
Ty
Let's look into it (for the following, note `char const` and `const char` are the same in C++):
String literals and char \*
---------------------------
`"hello"` is an array of 6 const characters: `char const[6]`. As every array, it can convert implicitly to a pointer to its first el... | [
-0.13430188596248627,
0.17176955938339233,
0.4216989278793335,
-0.11729713529348373,
-0.1379430741071701,
0.237900048494339,
0.2923629879951477,
-0.22722642123699188,
0.014242579229176044,
-0.506324827671051,
-0.20867674052715302,
0.5472763180732727,
-0.3144223988056183,
-0.071675971150398... | |
to a string literal. So what do we have for `char * s = "foo";` ?
`"foo"` -> `array-to-pointer` -> `char const*` -> `qualification-conversion` -> `char *`. A string literal is read-only, and won't be allocated on the stack. You can freely make a pointer point to them, and return that one from a function, *without* cra... | [
-0.03661172464489937,
0.04105864465236664,
0.17104321718215942,
-0.1438901573419571,
-0.11300098896026611,
-0.08246991038322449,
0.13429398834705353,
-0.07268528640270233,
0.0006941818865016103,
-0.4047725796699524,
-0.2612334191799164,
0.4276175796985626,
-0.4239591658115387,
0.0593640841... | |
copied to the character-array. And the array is created *on the stack*. You cannot validly return a pointer to it from a function.
Array Parameter types.
----------------------
How can you make your function accept an array as parameter? You just declare your parameter to be an array:
```
void accept_array(char foo[... | [
-0.30512189865112305,
-0.014167938381433487,
0.41240888833999634,
0.016501672565937042,
-0.25723743438720703,
0.18417774140834808,
0.0019461080664768815,
-0.4824284613132477,
-0.291038453578949,
-0.48745694756507874,
-0.1674688160419464,
0.5872060060501099,
-0.4866391718387604,
0.035083886... | |
dimension has size 10. *The first element of a multi-dimensional array is its first sub-array of the next dimension*! Now, let's transform it. It will be a pointer to its first element again. So, actually it will accept a pointer to an array of 10 chars: (remove the `[]` in head, and then just make a pointer to the typ... | [
-0.30869260430336,
-0.08654261380434036,
0.6379208564758301,
-0.16511090099811554,
-0.18440015614032745,
0.2714843153953552,
0.05015924200415611,
-0.24542583525180817,
-0.2433214634656906,
-0.7303615212440491,
-0.10023011267185211,
0.46321505308151245,
-0.44276416301727295,
-0.069054640829... | |
case for *any* n-dimensional array, including the special-case of `n = 1`;
Conclusion
----------
```
void upperCaseString(char *_str) {};
```
and
```
void upperCaseString(char _str[]) {};
```
are the same, as the first is just a pointer to char. But note if you want to pass a String-literal to that (say it do... | [
-0.20356698334217072,
0.08851179480552673,
0.1033242717385292,
-0.22482796013355255,
-0.050006844103336334,
0.02113696001470089,
0.16217273473739624,
0.02561778388917446,
-0.09820687770843506,
-0.35984593629837036,
-0.27170756459236145,
0.5630968809127808,
-0.31232625246047974,
0.015903525... | |
I'm starting up a personal project to develop some open source software. I want to use Scrum as the PM process on this (as I like the Product Backlog, prioritisation, and if I can get them, the burndowns) but it seems to me that I won't get the full value because I can't at the outset guarantee the amount of time mysel... | [
0.6641340851783752,
0.14365960657596588,
-0.13761161267757416,
0.024856626987457275,
-0.07108338177204132,
0.0062591033056378365,
0.4527892470359802,
-0.127706840634346,
-0.12619847059249878,
-0.16974464058876038,
0.3705899715423584,
0.3538494408130646,
0.3018631041049957,
-0.2554785311222... | |
of which will enable me to get the value of things like burndown charts and timeboxed iterations? Or am I just being too hopeful?
TIA.
Regs, Andrew
As this is a hobby project, are you actually concerned about deadlines? How much value would it in fact give you to know how much will be done after a Sprint?
If your an... | [
0.6055619120597839,
-0.4255126714706421,
-0.187808096408844,
0.48962217569351196,
-0.0841844379901886,
0.03899220749735832,
0.20869632065296173,
-0.0040714736096560955,
-0.2447081208229065,
-0.3701068162918091,
0.48491740226745605,
0.6083917021751404,
0.15155594050884247,
0.112205810844898... | |
What are good ways to handle user input concurrency?
As the answers to [this question](https://stackoverflow.com/questions/225625/locking-to-handle-concurrency-a-good-idea) already rule out database locking, how do you handle concurrent user inputs in general?
Is locking always a bad idea, even if it is not implement... | [
0.16956660151481628,
0.2706340551376343,
0.21395885944366455,
0.15113414824008942,
-0.0437595508992672,
-0.2513176202774048,
0.07285111397504807,
-0.14595238864421844,
-0.7890699505805969,
-0.234868586063385,
0.36357733607292175,
0.5530155301094055,
-0.43704187870025635,
-0.014884587377309... | |
data change is part of a lengthy operation with user interaction?
Let's say two or more users are editing the same file over a web interface. At some point one of the users hits the save button. What happes to the other users?
* Will they get notified and/or forced to reload? Or will the eventually overwrite the ch... | [
0.1858179271221161,
0.13937468826770782,
0.4977317750453949,
0.27022865414619446,
0.13847830891609192,
-0.21964558959007263,
0.1309831738471985,
-0.13618683815002441,
-0.4197705090045929,
-0.4698293209075928,
-0.040476299822330475,
0.37399765849113464,
-0.09856945276260376,
0.3081186413764... | |
and similar situations? Are there any other strategies?
Best strategy depends on what *should* happen from (business) process perspective - also important questions are what users would normally expect and what would surprise them least, and, of course, whether it is feasible to implement what they expect.
Your exampl... | [
0.1445549577474594,
0.013491185382008553,
0.546022355556488,
-0.20701967179775238,
-0.0123814158141613,
-0.037892866879701614,
0.03535786271095276,
-0.32938215136528015,
-0.34804025292396545,
-0.9555016160011292,
-0.06466029584407806,
0.6061301231384277,
-0.3378746211528778,
-0.11357999593... | |
typical for web applications, and indeed for normal desktop office programs, too, that newest changes that user makes only become available (to others) after saving them, which means that it is not a case of having colleague's typing appear on top of yours in the copy of file you are editing.
A classic version control... | [
-0.15689952671527863,
-0.022078493610024452,
0.6745253205299377,
-0.1419668197631836,
0.14713630080223083,
-0.19123919308185577,
0.15342898666858673,
0.28643596172332764,
-0.5771030187606812,
-0.7251195311546326,
-0.20393332839012146,
0.512377142906189,
-0.18644030392169952,
0.286004751920... | |
Since this is the case, a version control system would typically show him both versions (v1 and v2) on screen side by side, and let him mix them and save the resulting version (v3) to server.
For text files there exist a number of tools and systems both on Unix and Windows that try to automate the process so that if t... | [
0.07410240173339844,
-0.07012559473514557,
0.488511323928833,
-0.010429024696350098,
0.07598485797643661,
0.03527471795678139,
0.07733955979347229,
-0.12468822300434113,
-0.41291484236717224,
-0.4454287886619568,
-0.4192516803741455,
0.6000699996948242,
-0.411926805973053,
0.31435343623161... | |
to overwrite existing file with new version, that is important. Editing happens independently on each users workstation and does not touch the server until last point (saving).
---
Your example is, by the way, distinctly different from another situation such as booking airplane tickets or booking an appointment to a ... | [
0.1578848958015442,
-0.13203300535678864,
0.2217157930135727,
0.4878232777118683,
0.36945444345474243,
-0.48742854595184326,
-0.309112548828125,
-0.17979022860527039,
-0.4317842423915863,
-0.6844600439071655,
0.02274639718234539,
0.25013870000839233,
-0.18439967930316925,
0.038640618324279... | |
system shows free slots;
2. user asks for one of free slots
(s1);
3. system tells user whether the slot
is really still free, and if so,
reserves it to you.
4. user completes booking.
The "really still free" step is because information on webpage user views is typically not updated realtime, so between steps 1 and 2, ... | [
0.39570125937461853,
-0.23820990324020386,
0.6370697617530823,
0.36306530237197876,
0.5270974040031433,
-0.1540682166814804,
-0.1110081747174263,
-0.261661171913147,
-0.48042505979537964,
-0.4122215211391449,
-0.3432055413722992,
0.26530587673187256,
0.04980519786477089,
-0.088120818138122... | |
Is either:
```
<a href="#"><h1>text here</h1></a>
```
or
```
<h1><a href="#">text here</a></h1>
```
"correct". Is there any benefit of using the first one, it seems more logical to me. Perhaps from an SEO point?
```
<h1><a href="#">text here</a></h1>
```
is correct, as HTML does not allow a block element (`<h1>... | [
-0.06201974302530289,
0.3314605951309204,
0.1919519305229187,
0.30371707677841187,
-0.21141377091407776,
-0.2706111669540405,
0.009452905505895615,
-0.2810400128364563,
-0.21847251057624817,
-0.5599802136421204,
-0.6478149890899658,
0.2577283978462219,
-0.23744845390319824,
-0.080909810960... | |
I've just done a test with bitfields, and the results are surprising me.
```
class test1 {
public:
bool test_a:1;
bool test_b:1;
bool test_c:1;
bool test_d:1;
bool test_e:1;
bool test_f:1;
bool test_g:1;
bool test_h:1;
};
class test2 {
public:
int test_a:1;
int test_b:1;
i... | [
0.4658510386943817,
0.12010439485311508,
-0.14087694883346558,
-0.24473407864570618,
-0.28684788942337036,
-0.11179421097040176,
0.6214309930801392,
-0.24332459270954132,
0.11690313369035721,
-0.5384108424186707,
-0.35937678813934326,
0.4826802909374237,
-0.4212177097797394,
0.042624995112... | |
int test_a:1;
bool test_b:1;
int test_c:1;
bool test_d:1;
int test_e:1;
bool test_f:1;
int test_g:1;
bool test_h:1;
};
```
The results were:-
```
sizeof(test1) = 1 // This is what I'd expect. 8 bits in a byte
sizeof(test2) = 4 // Reasonable. Maybe padded out to the size of an int.
siz... | [
0.19148476421833038,
0.057759784162044525,
-0.16926148533821106,
-0.14574310183525085,
-0.11513422429561615,
0.055945660918951035,
0.3551922142505646,
-0.6886400580406189,
-0.137386754155159,
-0.3601214289665222,
0.020711610093712807,
0.5833046436309814,
-0.3917212188243866,
-0.26453077793... | |
integer size boundaries. Once a block has been used for a given type (integer bit-field, or boolean bit-field), the compiler does not allocate any further bit fields of a different type until the next boundary.
I doubt it is a bug. It probably has something to do with the underlying architecture of your system.
**edi... | [
0.17674954235553741,
0.11693601310253143,
0.27745911478996277,
0.06918393820524216,
-0.12831583619117737,
-0.032687120139598846,
-0.00823995191603899,
-0.3150081932544708,
-0.45458701252937317,
-0.4732063114643097,
0.03455578535795212,
0.16018493473529816,
-0.1951809823513031,
0.2127064317... | |
will depend on your processor. Some processors can align to 8-bit boundaries, while others can only align to 16-bit boundaries.
In your test3, each member is of a different type than the one before it, so the memory allocation will be 8 \* (the minimum logical block size on your system). In your case, the minimum bloc... | [
0.07993577420711517,
0.030417926609516144,
0.04567166417837143,
-0.07545793056488037,
0.025865724310278893,
0.32585498690605164,
0.283719927072525,
-0.45019274950027466,
-0.3368602395057678,
-0.6634019613265991,
0.14413504302501678,
0.20440354943275452,
-0.22967086732387543,
-0.14423780143... | |
I have a web application (.war) that contains some static files (e.g. MS word documents). When I try to download these files, JBoss automatically sets some HTTP-headers in the response. Is there a way to configure JBoss (version 3.2.7) to set these headers to specific values (or omit them)?
I'm especially interested i... | [
0.28387317061424255,
0.3430245518684387,
0.41794997453689575,
-0.11767608672380447,
-0.011328794993460178,
-0.12268602102994919,
0.6143054962158203,
-0.03987720608711243,
-0.28371936082839966,
-0.6383357048034668,
-0.28233206272125244,
0.439302533864975,
-0.22296106815338135,
0.32733130455... | |
customers to fiddle with their registry just to donwload a file.
Any suggestions are greatly appreciated.
[Here](http://www.jboss.org/community/docs/DOC-9578) is a description on the JBoss community wiki on how to disable the Cache-Control behaviour.
I wasn't aware of this IE6 feature until now. Does this also apply ... | [
0.5232268571853638,
0.15251091122627258,
0.2669350504875183,
-0.100753054022789,
0.3399656414985657,
-0.23129211366176605,
0.4499787390232086,
0.1674041748046875,
-0.30704814195632935,
-0.2657855451107025,
-0.1608557403087616,
0.5477529168128967,
-0.17903731763362885,
0.06954030692577362,
... | |
I have some issue with a Perl script. It modifies the content of a file, then reopen it to write it, and in the process some characters are lost. All words starting with '%' are deleted from the file. That's pretty annoying because the % expressions are variable placeholders for dialog boxes.
Do you have any idea why?... | [
0.28274160623550415,
0.10217061638832092,
0.24319691956043243,
-0.06501743942499161,
-0.004525709431618452,
0.030170150101184845,
0.1333303451538086,
0.22333784401416779,
0.13713887333869934,
-0.3365042507648468,
-0.19857434928417206,
0.2598729729652405,
-0.3147994875907898,
0.295527219772... | |
close F;
$content =~s{status=["'][\w ]*["']\s*}{}gi;
printf $content;
open F, ">$file" or die "cannot reopen $file\n";
printf | [
-0.007324233651161194,
0.03356767073273659,
0.6644636392593384,
-0.13818897306919098,
0.2933759093284607,
-0.053470660001039505,
0.23282332718372345,
-0.2076323926448822,
0.20874598622322083,
-0.6983259320259094,
-0.7850511074066162,
0.5909372568130493,
-0.2607508599758148,
0.1574095636606... | |
F $content;
close F or die "cannot close file $file\n";
```
You're using `printf` there and it thinks its first argument is a format string. See the [`printf` documentation](http://perldoc.perl.org/functions/printf.html) for details. When I run into this sort of problem, I al... | [
0.2673458158969879,
0.3288988471031189,
0.4164823293685913,
-0.25803840160369873,
0.013406516052782536,
-0.2083536833524704,
0.09138770401477814,
0.012826649472117424,
-0.2421143800020218,
-0.5581033825874329,
-0.5865302681922913,
0.6594014167785645,
-0.4903877377510071,
0.1101037040352821... | |
need to read in the entire file since your substitution does not cross lines. Instead of trying to read and write to the same filename all at once, use a temporary file:
```
open my($in), "<", $file or die "cannot open file $file\n";
open my($out), ">", "$file.bak" or die "cannot open file $file.bak\n";
while(... | [
-0.11120347678661346,
0.11432815343141556,
0.340992271900177,
-0.20147818326950073,
0.12743447721004486,
0.07699786126613617,
0.2995566427707672,
-0.17287775874137878,
-0.22398042678833008,
-0.5376202464103699,
-0.5388218760490417,
0.3938194513320923,
-0.5514578223228455,
0.237545281648635... | |
If I type the command:
```
mvn dependency:list
```
The [docs](http://maven.apache.org/plugins/maven-dependency-plugin/) suggest that I'll get a list of my project's dependencies. Instead though, I get this:
```
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] --------------------------------... | [
0.08699242025613785,
0.1307547241449356,
0.35469260811805725,
-0.1303381472826004,
0.36161190271377563,
-0.3797564208507538,
0.5857461094856262,
-0.0358542874455452,
-0.07018928974866867,
-0.6808477640151978,
-0.2865575850009918,
0.9975869059562683,
-0.23916196823120117,
-0.002771488856524... | |
file had been customized and did not list the central maven repository.
Oops. | [
0.22332213819026947,
0.14281511306762695,
-0.07222206145524979,
0.24452845752239227,
-0.2711697518825531,
0.07597637921571732,
-0.02349262870848179,
0.4049181640148163,
-0.4556368291378021,
-0.11830465495586395,
-0.10136213153600693,
0.03313618525862694,
0.05072484910488129,
0.350154519081... | |
How to (programmatically, without xml config) configure multiple loggers with Log4Net?
I need them to write to different files.
[This thread at the log4net Dashboard details an approach](http://mail-archives.apache.org/mod_mbox/logging-log4net-user/200602.mbox/%3CDDEB64C8619AC64DBC074208B046611C769745@kronos.neoworks.c... | [
0.0995740219950676,
0.0983923003077507,
0.320368230342865,
0.07994203269481659,
0.024111557751893997,
-0.13329198956489563,
0.576384425163269,
-0.6482953429222107,
-0.26841822266578674,
-0.6860817670822144,
-0.10707278549671173,
0.535484790802002,
-0.29586902260780334,
-0.02453804202377796... | |
l = (Logger)log.Logger;
l.AddAppender(appender);
}
// Create a new file appender
public static IAppender CreateFileAppender(string name, string fileName)
{
FileAppender appender = new
FileAppender();
appender.Name = name;
appender.File = fileName;
appender.AppendToFile = true;
Pattern... | [
-0.06306343525648117,
-0.1851094514131546,
0.7160083651542664,
-0.4902653396129608,
0.31731367111206055,
0.32885414361953735,
0.30278244614601135,
-0.45770063996315,
-0.25965800881385803,
-0.7835227847099304,
-0.2819167673587799,
0.3886179029941559,
-0.6614091396331787,
0.0617709681391716,... | |
add an appender reference you
// can then use the following calls:
SetLevel("Log4net.MainForm", "ALL");
AddAppender("Log4net.MainForm", CreateFileAppender("appenderName", "fileName.log"));
// repeat as desired
``` | [
0.4066081643104553,
-0.07400345057249069,
0.8216297626495361,
-0.10684144496917725,
0.14264968037605286,
-0.08849283307790756,
0.24894730746746063,
-0.29098156094551086,
-0.07157262414693832,
-0.5361712574958801,
-0.3548262119293213,
0.7076959013938904,
-0.48199930787086487,
0.186741143465... | |
I'm currently working on a pet project and need to do C++ development on Windows, Mac, Linux, and Solaris, and I've narrowed it down to Netbeans and Eclipse, so I was wonderig which is more solid as a C++ editor. I just need solid editing, good autocompletion for templated code ad external libraries, and project file m... | [
0.10791385918855667,
0.07764469087123871,
0.11456039547920227,
0.06563761085271835,
-0.3281692862510681,
-0.0531640499830246,
-0.019959647208452225,
0.0822833999991417,
-0.18807464838027954,
-0.671397864818573,
-0.06099328771233559,
0.6755810379981995,
-0.13109701871871948,
-0.108799606561... | |
side (design,creativity) of the brain more than the left side (logic, memory), so I just simply cannot use emacs or vim, my brain simply isn't compatible, I tried them many times too, even used emacs for a few months but it drove me crazy...
Thanks
I haven't used NetBeans, but Eclipse CDT (C Developer Tools, which inc... | [
0.001511401031166315,
-0.01155446469783783,
0.17380502820014954,
0.15348674356937408,
-0.2894431948661804,
0.001415807637386024,
0.1294322907924652,
0.0014221722958609462,
0.11232505738735199,
-0.7246492505073547,
0.18065597116947174,
0.8561981916427612,
-0.15589965879917145,
-0.3954153656... | |
step you through each level of macro application or show the final result even of very complex Boost Preprocessor macros
* A file and class outline view that updates dynamically to show where you are in a file. (Commercial IDE's I've used fail to do this.)
* Powerful, flexible Find/Replace and Find in Files features wi... | [
-0.14374586939811707,
-0.5110541582107544,
0.5573087334632874,
0.08842237293720245,
-0.020123515278100967,
-0.16616851091384888,
0.22051826119422913,
-0.2073591649532318,
-0.14655950665473938,
-0.6396695375442505,
0.045618973672389984,
0.6572480201721191,
0.004584555979818106,
-0.283378899... | |
tips that show the exact declaration of a variable or function, including any comments, instead of just where a variable or function is declared. (Again, commercial IDE's I've used fail to do this.)
* Support via plugins for Subversion, Doxygen, etc.
* Some refactoring support - rename, extract constant, extract functi... | [
0.44949355721473694,
-0.1843184232711792,
0.2801720201969147,
0.26933327317237854,
-0.15422944724559784,
-0.2993117868900299,
-0.010111731477081776,
-0.14731431007385254,
0.1303948163986206,
-0.2728893458843231,
0.10883498936891556,
0.8402175903320312,
-0.32288435101509094,
-0.403170794248... | |
great, and its memory usage is high. A few features (like the C/C++ Find in Files) don't work reliably or require reindexing (which is time consuming) for no apparent reason, but the latest version seems more reliable in this regard.
Can someone who's used NetBeans fill in how it compares? | [
0.07393462210893631,
-0.03303001821041107,
-0.03872649744153023,
0.2207174152135849,
0.15523672103881836,
-0.26589199900627136,
0.018090173602104187,
0.0364842526614666,
-0.21969306468963623,
-0.6150060892105103,
0.05440813675522804,
0.39209333062171936,
0.09336940944194794,
-0.11235706508... | |
I have to delete some rows from a data table. I've heard that it is not ok to change a collection while iterating through it. So instead of a for loop in which I check if a row meets the demands for deletion and then mark it as deleted, I should first iterate through the data table and add all of the rows in a list, th... | [
0.07497554272413254,
0.05400696396827698,
0.1382717788219452,
0.011344649828970432,
0.13989897072315216,
0.15815697610378265,
0.2588663101196289,
-0.19355635344982147,
-0.3806140720844269,
-0.5135431289672852,
-0.09242746233940125,
0.3924822211265564,
-0.3783801198005676,
0.489214420318603... | |
from a collection if you use a simple `for` loop.
Take a look at this example:
```
var l = new List<int>();
l.Add(0);
l.Add(1);
l.Add(2);
l.Add(3);
l.Add(4);
l.Add(5);
l.Add(6);
for (int i = 0; i < l.Count; i++) | [
0.30466988682746887,
-0.34179002046585083,
0.1606397032737732,
-0.44885921478271484,
0.09757693111896515,
0.09948580712080002,
0.20765173435211182,
-0.5170910954475403,
-0.18486428260803223,
-0.548067569732666,
-0.6214178800582886,
0.33756306767463684,
-0.7058593034744263,
0.25807520747184... | |
{
if (l[i] % 2 == 0)
{
l.RemoveAt(i);
i--;
}
}
foreach (var i in l) | [
-0.2084181010723114,
-0.17934665083885193,
0.20139077305793762,
-0.8004204034805298,
0.3930416405200958,
0.29181548953056335,
0.21598508954048157,
-0.23610997200012207,
0.39610645174980164,
-0.41146716475486755,
-0.4212231934070587,
0.4440290331840515,
-0.4346522390842438,
0.04644075408577... | |
{
Console.WriteLine(i);
}
``` | [
-0.1969175934791565,
0.2404565066099167,
0.2972011864185333,
-0.19439931213855743,
0.47380533814430237,
-0.1762373149394989,
0.21981702744960785,
-0.004637684673070908,
0.27490147948265076,
-0.6805260181427002,
-0.2719660997390747,
0.6255735158920288,
-0.30261412262916565,
0.19933718442916... | |
What is the fastest way to find out whether two `ICollection<T>` collections contain precisely the same entries? Brute force is clear, I was wondering if there is a more elegant method.
We are using C# 2.0, so no extension methods if possible, please!
Edit: the answer would be interesting both for ordered and unorder... | [
0.20474956929683685,
-0.05100349709391594,
0.39131948351860046,
0.42770594358444214,
0.09649159759283066,
-0.014317519031465054,
-0.005408591590821743,
-0.29568907618522644,
-0.3579932153224945,
-0.6803287267684937,
-0.1466800421476364,
0.21003787219524384,
-0.25401541590690613,
0.17517690... | |
if all items are
> found."
```
[Tested]
public virtual bool ContainsAll<U>(SCG.IEnumerable<U> items) where U : T
{
HashBag<T> res = new HashBag<T>(itemequalityComparer);
foreach (T item in items)
if (res.ContainsCount(item) < ContainsCount(item))
res.Add(item);
else
return false;
return t... | [
-0.2113596647977829,
-0.21015481650829315,
0.5570082068443298,
0.10107578337192535,
0.18312180042266846,
0.09058429300785065,
0.4304516613483429,
-0.18338195979595184,
-0.32000038027763367,
-0.5984733700752258,
-0.4592800736427307,
0.43332982063293457,
-0.12119373679161072,
0.4756541848182... | |
Can anybody help me out to know the possible reasons for which Apple store can reject or raise objection to submit any iPhone application.
Here are possible reasons (unofficial, [from here](http://10base-t.com/unofficial-appstore-rejection-criteria/)):
* **Vibration**. It is not permitted to use continuous vibration i... | [
0.8515933752059937,
0.283008337020874,
0.4469889998435974,
0.11949421465396881,
0.06336941570043564,
-0.49372997879981995,
0.3462819755077362,
-0.03677457198500633,
-0.32095515727996826,
-0.277934730052948,
-0.010949049144983292,
0.7845916152000427,
-0.21973830461502075,
-0.127650633454322... | |
ten days while we unlinked that framework, recompiled, and then resubmitted.
* **Improper handling of editing in tableview cells**. Also obvious, but be aware that if you enable table cell editing, you’ll have to manually specify which cells should respond to editing controls and which should not. We had some random pr... | [
0.37275415658950806,
0.006289789453148842,
0.4264105558395386,
0.3159317970275879,
0.0733310803771019,
0.07356821000576019,
0.5027337074279785,
-0.1382388174533844,
-0.31228458881378174,
-0.711525022983551,
0.09533492475748062,
0.5614429116249084,
-0.036796972155570984,
-0.3401322662830353... | |
version. Also, use a different icon if you are creating ‘lite’ and ‘pro’ versions of your app (i.e., free and paid). Using the same icon for both sends your app straight to … you guessed it … the bin.
* **Copying existing functionality**. This one is much more subtle and insidious, and has probably affected the great p... | [
0.6555349230766296,
0.014891031198203564,
0.3398570716381073,
0.1323392242193222,
-0.007357646245509386,
-0.18034633994102478,
0.5768857002258301,
0.4054315984249115,
-0.5413283705711365,
-0.5475322604179382,
-0.34480300545692444,
0.4710460305213928,
-0.5033273100852966,
0.4035270214080810... | |
add new and/or useful functionality. Stay away from email clients as well.
* **Using appropriate keyboard type**. If your app asks for a phone number or other numeral-only input and you present a keyboard that also includes the possibility of entering standard alpha-numeric input … yep. (Thanks Jeremy1026)
* **Version ... | [
0.19420447945594788,
0.2615981996059418,
0.44808006286621094,
0.16492155194282532,
0.11261332035064697,
-0.10054183006286621,
0.5650766491889954,
0.46557357907295227,
-0.2222405970096588,
-0.6344846487045288,
-0.256869912147522,
0.5753950476646423,
-0.2119171917438507,
0.053349241614341736... | |
from scratch as version 1.0, it went through.
* **Network Reachability**. If your app requires any type of network access you need to make sure it works when that access isn't available. If it doesn't it will be rejected. Apple provides sample code to test this which you can use as-is in most cases: <https://developer.... | [
0.09159006923437119,
-0.07267493009567261,
0.3918572962284088,
0.022317450493574142,
-0.03316911682486534,
0.04903693497180939,
0.09793724119663239,
0.1383480578660965,
-0.345718115568161,
-0.5270826816558838,
0.15480826795101166,
0.6475431323051453,
-0.31636014580726624,
-0.10561390966176... | |
App Store](http://www.pcworld.com/article/159887/).
And a tip: Apple has a Mac app called *Application Loader* that you could install. Once you install it, it analyzes your app's zip file. It verifies all the certificates, icons, and other things are correct *before* submitting to Apple. Using the Application Loader m... | [
0.24399085342884064,
0.21840350329875946,
0.6134451627731323,
0.17292873561382294,
-0.2022855132818222,
-0.23239602148532867,
0.4184187352657318,
-0.32953155040740967,
-0.5936592221260071,
-0.07822731882333755,
-0.08105750381946564,
0.635468065738678,
-0.5331370234489441,
-0.32767933607101... | |
application were approved. | [
0.5002078413963318,
0.05291271209716797,
0.6124733090400696,
-0.08093971759080887,
0.2467404007911682,
0.21878962218761444,
-0.028583819046616554,
-0.6038004159927368,
-0.02676968090236187,
-0.4553182125091553,
0.05594124644994736,
0.2162916213274002,
0.25495874881744385,
0.117374248802661... | |
Is it possible to get Mercurial to show progress of long-running push or pull operation? Google tells me basically "no", but does somebody know better? I was expecting something like `hg pull -v`...
```
hg pull -v
```
-v / --verbose
is a global option that applies to all sub-functions.
If you want extra data:
`... | [
-0.12669137120246887,
-0.12190835922956467,
0.4095717668533325,
0.2762509882450104,
0.0028358185663819313,
-0.000613747222814709,
0.24804161489009857,
0.5679779648780823,
-0.14395840466022491,
-0.09738192707300186,
-0.4259544610977173,
0.36890271306037903,
-0.3964031934738159,
0.0371846035... | |
I want to float a div to the right at the top of my page. It contains a 50px square image, but currently it impacts on the layout of the top 50px on the page.
Currently its:
```
<div style="float: right;">
...
</div>
```
I tried z-index as I thought that would be the answer, but I couldn't get it going.
I know i... | [
0.29534846544265747,
0.13434025645256042,
0.9578757882118225,
-0.06092387065291405,
-0.3806135356426239,
0.1236678957939148,
-0.4811192750930786,
-0.09804929792881012,
0.054509419947862625,
-0.6943496465682983,
0.12772803008556366,
0.13054482638835907,
-0.10515391081571579,
0.3199228048324... | |
right: 0;
top: 0;
``` | [
-0.33171579241752625,
0.2585546374320984,
0.277396023273468,
-0.4009135365486145,
-0.06804069876670837,
0.1953987330198288,
-0.3513472080230713,
0.03662479296326637,
-0.0035689326468855143,
-0.3237030804157257,
-0.1329648643732071,
0.6129059195518494,
-0.006939930375665426,
0.1558891236782... | |
I want to check that two passwords are the same using Dojo.
Here is the HTML I have:
> `<form id="form" action="." dojoType="dijit.form.Form" /`>
>
>
> `<p`>Password: `<input type="password"
>
> name="password1"
>
> id="password1"
>
> dojoType="dijit.form.ValidationTextBox"
>
> required="true"
>
... | [
-0.04819401726126671,
0.02684442140161991,
0.4988730549812317,
-0.07635970413684845,
-0.11059980094432831,
-0.04006895050406456,
0.2797495126724243,
-0.5397555232048035,
0.3456895053386688,
-0.6994221806526184,
-0.04170443117618561,
0.5441877841949463,
-0.1519966572523117,
-0.2231846004724... | |
`</form`>
Here is the JavaScript I have so far:
> `var onSave = function() {
>
> if(dijit.byId('form').validate()) { alert('Good form'); }
>
> else { alert('Bad form'); }
>
> }`
Thanks for your help. I could do this in pure JavaScript, but I'm trying to find the Dojo way of doing it.
This will get you a ... | [
-0.03519789129495621,
-0.05922206863760948,
0.5783514976501465,
-0.1242121160030365,
-0.21110349893569946,
-0.04997147247195244,
0.46784910559654236,
-0.4521699845790863,
0.277275949716568,
-0.7793405055999756,
-0.18881060183048248,
0.34541797637939453,
-0.29826879501342773,
0.169434756040... | |
when it's submitted, and cancels submittion if they don't all validate. I though the invalid ones would get their error message, but they don't. That's left as an exercise for the reader ;-)
the validation function:
```
function confirmPassword(value, constraints)
{
var isValid = false;
if(constraints && con... | [
0.1077958419919014,
-0.09507178515195847,
0.766617476940155,
-0.02363828383386135,
0.32249918580055237,
-0.18624278903007507,
0.4693736135959625,
-0.6735745668411255,
0.12921257317066193,
-0.3658575117588043,
-0.17826566100120544,
0.2668350040912628,
-0.12310510873794556,
-0.06547489017248... | |
== %s ?", value, otherValue);
isValid = (value == otherValue);
}
}
return isValid;
}
function onsubmit()
{
var p1 = dijit.byId('password1').value;
var p2 = dijit.byId('password2').value;
return p1 == p2;
}
```
and the input objects:
```
<p>Password: <input type="password"
... | [
-0.1867808699607849,
-0.10452277213335037,
0.599498450756073,
-0.03183792158961296,
0.17009598016738892,
0.238345205783844,
0.31223025918006897,
-0.48200350999832153,
0.12912362813949585,
-0.4001277685165405,
-0.4879830479621887,
0.4539693593978882,
-0.20240694284439087,
0.0738644376397132... | |
id="password2"
dojoType="dijit.form.ValidationTextBox"
required="true"
constraints="{'other': 'password1'}"
validator=confirmPassword
intermediateChanges=false
invalidMessage="This password doesn't match your first password" /></p>
``` | [
-0.25110551714897156,
-0.07115963846445084,
0.3428213596343994,
-0.049457963556051254,
0.1994883269071579,
-0.16033168137073517,
0.3744994103908539,
-0.6420530676841736,
0.076046422123909,
-0.26581940054893494,
-0.1438658982515335,
0.5503354072570801,
-0.11714237183332443,
-0.1978453248739... | |
In firefox when you add an onclick event handler to a method an event object is automatically passed to that method. This allows, among other things, the ability to detect which specific element was clicked. For example
```
document.body.onclick = handleClick;
function handleClick(e)
{
// this works if FireFox
... | [
0.11423005908727646,
-0.12619642913341522,
0.30766820907592773,
-0.2625824809074402,
0.024438196793198586,
-0.5313487648963928,
0.18729469180107117,
-0.35764849185943604,
-0.037230487912893295,
-0.6344208717346191,
-0.26173773407936096,
0.7805498242378235,
-0.6804590225219727,
-0.206801936... | |
undefined use the global "event" variable
e = e || event;
var target = e.srcElement || e.target;
alert(target.className);
}
```
And here is a jQuery solution
```
$(document.body).click(function(e) {
alert($(this).attr("class"));
});
``` | [
-0.06413605809211731,
-0.2540312111377716,
0.4627803862094879,
-0.2531958818435669,
0.08109671622514725,
0.07051196694374084,
0.17822453379631042,
-0.2132635861635208,
-0.16090385615825653,
-0.347054123878479,
-0.32637834548950195,
0.5837023258209229,
-0.49712204933166504,
0.11593563109636... | |
I've got a Django application that works nicely. I'm adding REST services. I'm looking for some additional input on my REST strategy.
Here are some examples of things I'm wringing my hands over.
* Right now, I'm using the Django-REST API with a pile of patches.
* I'm thinking of falling back to simply writing view f... | [
0.33172520995140076,
0.17061856389045715,
0.32118818163871765,
-0.19024072587490082,
-0.48852136731147766,
-0.3016049563884735,
0.20711468160152435,
-0.0029712773393839598,
-0.3758715093135834,
-0.7687345147132874,
0.04622593894600868,
0.6833311915397644,
-0.1535748988389969,
-0.1942055374... | |
writing view functions in Django that
> return JSON results.
* Explicit
* Portable to other frameworks
* Doesn't require patching Django | [
0.0551905483007431,
0.045007869601249695,
0.06315518915653229,
-0.056471142917871475,
-0.47990602254867554,
-0.33282309770584106,
0.3471197187900543,
-0.021684350445866585,
0.08280691504478455,
-0.6296744346618652,
0.0618315264582634,
0.6473292708396912,
-0.4781719744205475,
-0.48812684416... | |
As as part of my daily routine, I have the misfortune of administering an ancient, once "just internal" JSP web application that relies on the following authentication schema:
```
...
// Validate the user name and password.
if ((user != null) && (password != null) && (
(user.equals("brianmay") && password.equals(... | [
0.21058203279972076,
0.5180253386497498,
0.49685609340667725,
-0.34260591864585876,
0.24310606718063354,
-0.049193162471055984,
0.6292191743850708,
-0.20473848283290863,
-0.40413233637809753,
-0.2335091382265091,
-0.09220774471759796,
0.31489428877830505,
-0.21204322576522827,
0.3309932649... | |
of the system but anyway it does make a great example, does it not?
Despite that by policy this client enforces security by domain authentication among other things, therefore this issue isn't seen as a security risk, still, my idea is to at least obfuscate that plain text credentials using perhaps a simple MD5 or SHA... | [
0.4880429208278656,
0.22355684638023376,
0.16893546283245087,
0.2913042902946472,
-0.02164360135793686,
-0.39561641216278076,
0.4701148569583893,
0.4801519215106964,
-0.18478994071483612,
-0.29202741384506226,
0.054225921630859375,
0.5380897521972656,
-0.03959568217396736,
-0.0540248118340... | |
scheme you are thinking about but I assume the password is coming in from a request and you want to calculate the MD5 hash in a JSP that the request is being sent to. After that you can compare it to the pre-computed MD5 version. You could even be more secure if it isn't being done with https and use a [javascript MD5 ... | [
0.3070213496685028,
-0.13595208525657654,
0.3232240378856659,
-0.49541354179382324,
-0.3346158564090729,
-0.1732904016971588,
0.26804977655410767,
-0.7206308245658875,
-0.38643476366996765,
-0.6771906018257141,
0.11775856465101242,
0.47945454716682434,
-0.3816830813884735,
-0.0261090621352... | |
= base64Encoder.encode(messageDigest.digest());
// digestString now contains the md5 hashed password
}
catch (Exception e)
{
// do some type of logging here
}
``` | [
0.07744720578193665,
-0.1288294494152069,
0.04969533905386925,
-0.26551735401153564,
0.14045606553554535,
-0.28831812739372253,
0.2824847102165222,
-0.14398173987865448,
-0.27643656730651855,
-0.2766667306423187,
-0.15349537134170532,
0.42703092098236084,
-0.2929996848106384,
0.19829669594... | |
Please feel free to correct me if I am wrong at any point...
I am trying to read a [CSV](http://en.wikipedia.org/wiki/Comma-separated_values) (comma separated values) file using .NET file I/O classes. Now the problem is, this CSV file may contain some fields with soft carriage returns (i.e. solitary \r or \n markers r... | [
0.11925184726715088,
-0.07356027513742447,
0.38593387603759766,
0.13368815183639526,
-0.16537070274353027,
-0.14485463500022888,
0.3065142333507538,
0.11850544065237045,
-0.39909836649894714,
-0.49415937066078186,
-0.2847592532634735,
0.49668997526168823,
-0.33307281136512756,
0.3555472493... | |
BinaryReader class seems to be the only option left but the BinaryReader does not have a ReadLine() function hence the need to implement a ReadLine() on my own.
My current approach reads one character from the stream at a time and fills a StringBuilder until a \r\n is obtained (ignoring all other characters including... | [
-0.11960486322641373,
-0.17900025844573975,
0.27689874172210693,
-0.2192402184009552,
0.01195292454212904,
0.35266798734664917,
0.3256671130657196,
0.09756798297166824,
-0.014499865472316742,
-0.6210631728172302,
-0.002152988687157631,
0.4881715178489685,
-0.2596122920513153,
0.21139930188... | |
so it would be O(n) (where n is the length of the stream) so that's not a problem. To read a single character a BinaryReader is your best bet.
What I would do is make a class
```
public class LineReader : IDisposable
{
private Stream stream;
private BinaryReader reader;
public LineReader(Stream stream) {... | [
-0.14365984499454498,
-0.3746631443500519,
0.3015555441379547,
-0.1230604276061058,
0.07814229279756546,
0.38583970069885254,
0.193900465965271,
-0.20373506844043732,
0.2026994526386261,
-0.6101611256599426,
-0.23495528101921082,
0.6379502415657043,
-0.26591217517852783,
0.1900746524333953... | |
// an EndOfStreamException here would propogate to the caller
try
{
char newChar = reader.ReadChar();
if (lastChar == '\r' && newChar == '\n')
return result.ToString();
result.Append(lastChar); | [
-0.18547473847866058,
-0.3681839406490326,
0.631492018699646,
-0.5169874429702759,
0.39858508110046387,
0.15404188632965088,
0.6735866665840149,
-0.3705323338508606,
0.23133887350559235,
-0.25596311688423157,
-0.38221922516822815,
0.761982798576355,
-0.28299692273139954,
0.0267259385436773... | |
lastChar = newChar;
}
catch (EndOfStreamException)
{
result.Append(lastChar);
return result.ToString();
}
}
public void Dispose()
{
reader.Close();
}
}
```
Or something like that.
(WARNING: the code has not been tested and | [
0.09503941237926483,
-0.31905198097229004,
0.6940241456031799,
-0.4211462140083313,
0.30205848813056946,
-0.13346819579601288,
0.5775722861289978,
-0.31708234548568726,
-0.07060226798057556,
-0.4564160406589508,
-0.2819640040397644,
0.6311973929405212,
-0.230862557888031,
0.140073373913764... | |
is provided AS IS without warranty of any kind, expressed or implied. Should this program prove defective or destroy the planet, you assume the cost of all necessary servicing, repair or correction.) | [
0.3805137574672699,
0.2503601908683777,
0.3227103054523468,
0.1440793126821518,
0.717675507068634,
-0.013880748301744461,
-0.01705751195549965,
0.15230773389339447,
-0.11589851975440979,
-0.05463067442178726,
-0.7000135779380798,
0.5219035148620605,
-0.17116644978523254,
0.1459293514490127... | |
With a vector defined as `std::vector<std::string>`,
Wondering why the following is valid:
```
if ( vecMetaData[0] != "Some string" )
{
...
```
But not this:
```
switch ( vecMetaData[1] )
{
...
```
Visual studio complains :
```
error C2450: switch expression of type 'std::basic_string<_Elem,_Traits,_Ax>... | [
0.0060373335145413876,
-0.1964189112186432,
0.40730324387550354,
0.12957370281219482,
-0.0670175552368164,
0.05597415193915367,
0.2931426465511322,
-0.41491520404815674,
-0.2948637306690216,
-0.3748887777328491,
-0.29575660824775696,
0.6656204462051392,
-0.5438898205757141,
-0.047043118625... | |
]
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
```
switch() needs an integral type (like int, char, ...)
string is not an integral type, neither does string have an implicit conversion to an integral type, so it can't be used in a switch st... | [
0.09232810139656067,
-0.20003142952919006,
0.24122165143489838,
-0.1513241082429886,
0.1617964655160904,
-0.41437700390815735,
0.18121325969696045,
-0.43108516931533813,
0.12521220743656158,
-0.3606416583061218,
-0.22844825685024261,
0.5611607432365417,
-0.5162000060081482,
0.0483960211277... | |
I met strange issue during designing winform. I placed a few controls inside toolstripcontainer and now I cannot delete them. It's also impossible to delete whole Toolstripcontainer.
I'm using Visual Studio 2008 SP1 plus some extra patches.
Is it a bug in Visual Studio? Is there any workaround? Or I'm lacking of knowle... | [
0.163394033908844,
-0.06554610282182693,
0.40118172764778137,
0.2962751090526581,
-0.36813750863075256,
-0.03887089341878891,
0.49023234844207764,
-0.08652208000421524,
-0.06257269531488419,
-0.5568754076957703,
0.11785592883825302,
0.8728654980659485,
0.07304032891988754,
0.17928081750869... | |
I need to make a Control which shows only an outline, and I need to place it over a control that's showing a video. If I make my Control transparent, then the video is obscured, because transparent controls are painted by their parent control and the video isn't painted by the control; it's shown using DirectShow or an... | [
0.4889904260635376,
-0.12212784588336945,
0.33312222361564636,
0.33526572585105896,
0.18401211500167847,
0.10931580513715744,
-0.09880878776311874,
-0.05878348648548126,
-0.1291944980621338,
-0.6388648152351379,
0.31032228469848633,
0.07128086686134338,
-0.41797977685928345,
0.306917905807... | |
of four controls (or more if I want it dashed) but is it possible to do what I want using just one control?
---
rslite is right - although you don't even need to go so far as to use PInvoke like his example does - the Control.Region property is entirely sufficient.
You could try to make a Region with a hole inside an... | [
0.217029869556427,
-0.25173598527908325,
0.3685963749885559,
0.14337171614170074,
0.04653279110789299,
0.057028818875551224,
0.012586318887770176,
-0.5071104764938354,
-0.5775989890098572,
-0.6546752452850342,
0.17507962882518768,
0.4316047430038452,
-0.42107921838760376,
0.033052451908588... | |
need. | [
-0.11111244559288025,
0.3568730056285858,
-0.12111796438694,
0.21866324543952942,
-0.20474907755851746,
0.0006210501305758953,
-0.3928278386592865,
-0.2663509249687195,
0.08287559449672699,
-0.9067088961601257,
0.04478773847222328,
0.5442390441894531,
-0.3654240071773529,
0.601727247238159... | |
Is it a measure of anything that a developer or even manager can look at and get meaning from? I know at one time, it was all about the 7, 8, 9, and 10 PageRank. But is it still a valid measure of anything? If so, what can you learn from a PageRank?
Note that I'm assuming that you have other measurements that you can ... | [
0.1446610540151596,
0.11629179120063782,
0.4435514211654663,
0.3558863401412964,
-0.30335643887519836,
-0.1657509058713913,
0.07720638811588287,
0.09981133788824081,
-0.14172405004501343,
-0.6470242142677307,
0.09152553230524063,
0.12105376273393631,
-0.16743473708629608,
0.203716173768043... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.