text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
PHP syntax](http://php.mirror.camelnetwork.com/manual/en/control-structures.alternative-syntax.php) for this one. But don't try to hard to make it perfect the first time, really.)
myPage.php
```
<?php
require('myPageLogic.php');
require('myPageView.php');
?>
```
*Don't bother about performance issues for now*. Thi... | [
0.12863387167453766,
0.15347662568092346,
0.5295054912567139,
0.029548468068242073,
-0.1063978299498558,
-0.1497994214296341,
0.5953919291496277,
-0.1520015448331833,
-0.08487793058156967,
-0.7197818756103516,
0.037266697734594345,
0.7348203659057617,
-0.36365100741386414,
-0.3534773886203... | |
learn from the beginning. You can perfectly code a project like that, as a rookie, it's fine. | [
0.6797161102294922,
0.05006024241447449,
-0.35522571206092834,
0.34184443950653076,
0.1872299164533615,
-0.41066092252731323,
0.24597734212875366,
0.13256806135177612,
0.15117330849170685,
-0.7615101933479309,
0.09840601682662964,
0.7642483711242676,
0.4377686083316803,
-0.2799206674098968... | |
Folks, we all know that IP blacklisting doesn't work - spammers can come in through a proxy, plus, legitimate users might get affected... That said, blacklisting seems to me to be an efficient mechanism to stop a persistent attacker, given that the actual list of IP's is determined dynamically, based on application's f... | [
0.5591356158256531,
0.2661930322647095,
0.2649935483932495,
0.37032365798950195,
-0.07126464694738388,
-0.6210700273513794,
0.21867552399635315,
0.1617574393749237,
-0.4922463595867157,
-0.17086222767829895,
-0.05349589139223099,
0.2770765721797943,
-0.13508032262325287,
0.2733211219310760... | |
you know if there are any tools that do it:
* In a web application, developer has a hook to report an "offense". An offense can be minor (invalid password) and it would take dozens of such offenses to get blacklisted; or it can be major, and a couple of such offenses in a 24-hour period kicks you out.
* Some form of ... | [
0.24010394513607025,
0.15150703489780426,
0.09216171503067017,
0.23298394680023193,
-0.14920875430107117,
-0.4289899170398712,
0.8020675182342529,
-0.16641537845134735,
-0.6142088174819946,
-0.4565112590789795,
-0.15349803864955902,
0.35188060998916626,
0.0404212512075901,
0.03226319327950... | |
be awesome if the solution worked in PHP, but I'd love to hear your thoughts about the approach in general, for any language/platform**
are you on a \*nix machine? this sort of thing is probably better left to the OS level, using something like [iptables](http://en.wikipedia.org/wiki/Iptables)
edit:
in response to th... | [
0.06797502189874649,
-0.2930881381034851,
0.3093806207180023,
0.4548303484916687,
-0.20529060065746307,
-0.5361754298210144,
0.22945009171962738,
-0.0755435898900032,
-0.39876988530158997,
-0.7051535248756409,
0.06392614543437958,
0.7969911694526672,
-0.11599233001470566,
-0.13318707048892... | |
blocking take place).
i would suggest the iptables method if you have full control of the box, and would prefer to let your firewall handle throttling (advantages are, you don't need to build this logic into your web app, and it can save resources as requests are dropped before they hit your webserver)
otherwise, if ... | [
0.1340753734111786,
-0.1850612908601761,
0.174590602517128,
0.19569270312786102,
-0.30003079771995544,
-0.20731237530708313,
0.3181929588317871,
-0.25281858444213867,
-0.11673825234174728,
-0.4279710054397583,
-0.12956196069717407,
0.1956251859664917,
-0.6049607396125793,
0.180565938353538... | |
My web page sits in a DIV that is 960px wide, I center this DIV in the middle of the page by using the code:
```
html,body{background: url(images/INF_pageBg.gif) center top repeat-y #777777;text-align:center;}
#container{background-color:#ffffff;width:960px;text-align:left;margin:0 auto 0 auto;}
```
I need the back... | [
0.3312555253505707,
0.22147780656814575,
0.8348234295845032,
0.030837208032608032,
-0.19348134100437164,
-0.07525579631328583,
0.239857017993927,
0.16361553966999054,
-0.09742502868175507,
-1.0293402671813965,
-0.07382306456565857,
0.5542654395103455,
-0.06800442934036255,
0.08122575283050... | |
use script to dynamically change stye.backgroundPosition property. Another trick is to put expression to the CSS class definition. | [
0.026460884138941765,
-0.4151480495929718,
-0.11026432365179062,
0.18067064881324768,
-0.1384945511817932,
-0.07423997670412064,
0.17268238961696625,
0.10301308333873749,
-0.11613303422927856,
-0.7308679819107056,
-0.029622038826346397,
0.5506469011306763,
-0.2513677775859833,
-0.335253149... | |
Here is what I have:
```
context "Create ingredient from string" do
context "1 cups butter" do
setup do
@ingredient = Ingredient.create(:ingredient_string => "1 cups butter")
end
should "return unit" do
assert_equal @ingredient.unit, 'cups'
end | [
0.28055551648139954,
0.1339118629693985,
0.5680497884750366,
-0.12177661061286926,
-0.15051451325416565,
-0.1980178952217102,
-0.0047120400704443455,
-0.9861938953399658,
0.27078816294670105,
-0.6766219139099121,
0.10360061377286911,
0.39348965883255005,
-0.11347634345293045,
0.03388246521... | |
should "return amount" do
assert_equal @ingredient.amount, 1.0
end
should "return name" do
assert_equal @ingredient.name, 'butter'
end
end
context "1 (18.25 ounce) package devil's food cake mix with pudding" do
setup do | [
0.3335503041744232,
0.17123843729496002,
0.4644721448421478,
-0.02591622620820999,
-0.20293942093849182,
0.07013247162103653,
0.48946890234947205,
-0.41295111179351807,
0.07630087435245514,
-0.26392725110054016,
-0.1203005239367485,
0.24482998251914978,
0.12310691177845001,
-0.051043856889... | |
@ingredient = Ingredient.create(:ingredient_string => "1 (18.25 ounce) package devil's food cake mix with pudding")
end
should "return unit" do
assert_equal @ingredient.unit, '(18.25 ounce) package'
end
should "return amount" do
assert_equal @ingredient.amou... | [
0.32482224702835083,
0.02640012465417385,
0.5285759568214417,
-0.07664003223180771,
-0.29823026061058044,
0.3414241671562195,
0.5355272889137268,
-0.534925103187561,
0.08544134348630905,
-0.4877639412879944,
0.035289425402879715,
0.1850898414850235,
0.13230444490909576,
0.19272390007972717... | |
end
should "return name" do
assert_equal @ingredient.name, 'devil\'s food cake mix with pudding'
end
end
end
```
Clearly there is a lot of duplication there. Any thoughts on how to remove it, if only at the very least the context and the string?
Here's a solution to your specif... | [
0.070730060338974,
0.10937698930501938,
0.2842221260070801,
-0.021570974960923195,
-0.0953594222664833,
-0.07360128313302994,
0.4401496350765228,
-0.15404774248600006,
0.16535836458206177,
-0.49568137526512146,
0.020374929532408714,
0.3236605226993561,
-0.22681325674057007,
0.0697253271937... | |
in a class method accepting all varying parts as arguments like this:
```
def self.should_get_unit_amount_and_name_from_string(unit, amount, name, string_to_analyze)
context string_to_analyze do
setup do
@ingredient = Ingredient.create(:ingredient_string => string_to_analyze)
end
should "return un... | [
-0.035362035036087036,
-0.16174888610839844,
0.039567410945892334,
0.09519476443529129,
-0.11524886637926102,
0.09018023312091827,
0.15529565513134003,
-0.5915752053260803,
0.16828525066375732,
-0.39851951599121094,
-0.1387680619955063,
0.4110954999923706,
-0.09793654084205627,
0.259023576... | |
end
end
end
```
Now you can call all these encapsulated tests with one liners (5-liners here for readability ;-)
```
context "Create ingredient from string" do
should_get_unit_amount_and_name_from_string(
'cups',
1.0,
'butter',
"1 cups butter")
should_get_unit_amount_and_na... | [
0.20907753705978394,
0.40024277567863464,
0.6775508522987366,
0.12139803916215897,
0.06435348093509674,
-0.012975610792636871,
0.464111328125,
-0.5317987203598022,
0.38854366540908813,
-0.45579054951667786,
0.038301046937704086,
0.31641915440559387,
0.1666838824748993,
0.22352264821529388,... | |
cake mix with pudding")
end
```
In some cases, you may want to accept a block which could serve as your Shoulda setup. | [
0.6109523773193359,
0.06807176768779755,
0.40446504950523376,
0.06125573441386223,
-0.10004151612520218,
-0.24577882885932922,
0.4506905674934387,
-0.1136697381734848,
-0.15103952586650848,
-0.4174500107765198,
-0.19365118443965912,
0.13521957397460938,
-0.0275922492146492,
0.0447829291224... | |
What's the best way to maintain a multiple databases across several platforms (Windows, Linux, Mac OS X and Solaris) and keep them in sync with one another? I've tried several different programs and nothing seems to work!
I think you should ask yourself why you have to go through the hassle of maintaining multiple data... | [
0.39103081822395325,
0.11342769861221313,
-0.039863221347332,
0.6120061278343201,
0.3992144763469696,
0.04626406729221344,
-0.0024595085997134447,
0.3046952784061432,
-0.45791664719581604,
-0.6639149785041809,
0.13244226574897766,
0.6011614203453064,
-0.36270084977149963,
0.041157580912113... | |
anyway? | [
0.31685301661491394,
0.09081513434648514,
0.019633078947663307,
0.04744638875126839,
-0.02153724804520607,
-0.10469625145196915,
0.08717852830886841,
0.17223861813545227,
-0.20638898015022278,
0.0907522439956665,
0.1903388649225235,
0.016358379274606705,
0.09688179939985275,
-0.15223635733... | |
[The Pragmatic Programmer](https://rads.stackoverflow.com/amzn/click/com/020161622X) advocates the use of code generators.
Do you create code generators on your projects? If yes, what do you use them for?
Code generators if used widely without correct argumentation make code less understandable and decrease maintainabi... | [
0.38570624589920044,
0.14402227103710175,
-0.10874500125646591,
0.40661826729774475,
-0.4544597268104553,
-0.14660102128982544,
0.19249393045902252,
-0.6063581705093384,
-0.07087136805057526,
-0.04885198548436165,
0.06637202948331833,
0.5168818831443787,
-0.3208385407924652,
0.074511691927... | |
I'm trying to wrap my head around asp.net. I have a background as a long time php developer, but I'm now facing the task of learning asp.net and I'm having some trouble with it. It might very well be because I'm trying to force the framework into something it is not intended for - so I'd like to learn how to do it "the... | [
0.18311868607997894,
0.11576361209154129,
0.2511976957321167,
0.14891739189624786,
0.02585015445947647,
-0.2220170646905899,
0.2098935842514038,
0.0606655552983284,
-0.1352808177471161,
-0.811405599117279,
0.13455696403980255,
0.3914351463317871,
-0.3264889121055603,
0.004187109414488077,
... | |
next PostBack. But many times I'm facing the problem that I don't know which controls to add in page\_init as it is dependent on values from at previous PostBack.
A simple scenario could be a form with a dropdown control added in the designer. The dropdown is set to AutoPostBack. When the PostBack occur I need to rend... | [
-0.00849507562816143,
-0.0356283038854599,
0.7488974928855896,
-0.05398814007639885,
-0.087371326982975,
0.05643026903271675,
0.43462854623794556,
-0.24638928472995758,
-0.11642219126224518,
-0.9578160047531128,
-0.13213159143924713,
0.5873726606369019,
-0.12096412479877472,
0.018620440736... | |
with the other points made here "If you can get out of creating controls dynamically, then do so..." (by @[Jesper Blad Jenson aka](https://stackoverflow.com/users/11559/jesper-blad-jensen-aka-deldy)) but here is a trick I worked out with dynamically created controls in the past.
The problem becomes chicken and the egg... | [
-0.12131048738956451,
-0.04672641679644585,
0.1990063339471817,
0.2294023633003235,
0.2062007486820221,
0.09689033776521683,
-0.1761847734451294,
-0.32847291231155396,
-0.5045928955078125,
-0.44859156012535095,
-0.15588068962097168,
0.5258633494377136,
-0.40347498655319214,
0.1774751543998... | |
- Control.SaveViewState Method").
In SaveViewState store the control you wish to create:
```
protected override object SaveViewState()
{
object[] myState = new object[2];
myState[0] = base.SaveViewState();
myState[1] = controlPickerDropDown.SelectedValue;
return myState
}
```
When the framework cal... | [
0.10600416362285614,
-0.19945749640464783,
0.7543137073516846,
0.03976135700941086,
0.20251798629760742,
-0.16087454557418823,
0.2841311991214752,
-0.38579171895980835,
-0.0012784425634890795,
-0.30398252606391907,
-0.2335406392812729,
0.7031950950622559,
-0.5000970959663391,
0.12349427491... | |
everything works correctly.
base.LoadViewState(myState[0]);
}
```
I've used this successfully to create ASP.Net pages where a DataSet was serialised to the ViewState to store changes to an entire grid of data allowing the user to make multiple edits with PostBacks and finally commit all their changes in a single ... | [
0.49705401062965393,
-0.15497682988643646,
0.5078567862510681,
-0.08637647330760956,
0.04643712565302849,
-0.10076451301574707,
0.2721688151359558,
-0.11296152323484421,
-0.20256198942661285,
-0.7564889192581177,
-0.0033870944753289223,
0.6392878890037537,
-0.28231993317604065,
-0.02581340... | |
Visual Studio Test can check for expected exceptions using the ExpectedException attribute. You can pass in an exception like this:
```
[TestMethod]
[ExpectedException(typeof(CriticalException))]
public void GetOrganisation_MultipleOrganisations_ThrowsException()
```
You can also check for the message contained with... | [
0.2430373728275299,
-0.01356519665569067,
-0.024098066613078117,
-0.04550693556666374,
-0.21207740902900696,
-0.1525988131761551,
0.5352855324745178,
-0.4079303443431854,
0.19181974232196808,
-0.525334894657135,
-0.3295646607875824,
0.8356295228004456,
-0.34463274478912354,
-0.452542334794... | |
or array creation expression of an
> attribute
Does anybody know how to test for an exception that has a message from a resource file?
---
One option I have considered is using custom exception classes, but based on often heard advice such as:
> "Do create and throw custom exceptions
> if you have an error condit... | [
0.2842501103878021,
0.04546532779932022,
-0.10737431794404984,
0.058887895196676254,
-0.17321625351905823,
-0.23034696280956268,
0.6290007829666138,
-0.14313362538814545,
-0.4277842044830322,
-0.44360974431037903,
0.0432795025408268,
0.5909726619720459,
-0.26115652918815613,
-0.02034322731... | |
mode anyway) and I don't think creating an exception for each test case is the right thing to do. Any opinions?
*Just* an opinion, but I would say the error text:
* is part of the test, in which case getting it from the resource would be 'wrong' (otherwise you could end up with a consistantly mangled resource), so jus... | [
0.34669238328933716,
-0.16753645241260529,
0.17718501389026642,
0.33709028363227844,
-0.002040357328951359,
-0.24537628889083862,
0.7717978954315186,
0.20233210921287537,
0.04336204007267952,
-0.4834272563457489,
-0.2573782503604889,
0.8038433194160461,
-0.20409704744815826,
-0.29996395111... | |
run with a locale.
As for multiple exceptions, I'm from C++ land, where creating loads and loads of exceptions (to the point of one per 'throw' statement!) in big heirachies is acceptable (if not common), but .Net's metadata system probably doesn't like that, hence that advice. | [
0.8058883547782898,
-0.20077697932720184,
-0.015196818858385086,
-0.017779109999537468,
0.07198372483253479,
-0.5975281596183777,
0.46803396940231323,
0.40358051657676697,
-0.08907674998044968,
-0.17938219010829926,
-0.15251775085926056,
0.08462975174188614,
-0.3371688723564148,
0.04683842... | |
What is a good, secure, method to do backups, for programmers who do research & development at home and cannot afford to lose any work?
Conditions:
1. The backups must ALWAYS be within reasonably easy reach.
2. Internet connection cannot be guaranteed to be always available.
3. The solution must be either FREE or pri... | [
0.32851555943489075,
-0.04359649121761322,
0.08365184813737869,
0.36349934339523315,
0.33136704564094543,
-0.23141255974769592,
0.10465230792760849,
0.008311486802995205,
-0.35349664092063904,
-0.07756520807743073,
-0.4042889475822449,
0.5473368763923645,
-0.09062691032886505,
-0.140337362... | |
files on other disks.
* [mybackware](http://deekayen.net/mybackware): These scripts were
developed to create SQL dump files
for basic disaster recovery of small
MySQL installations.
* [Bacula](http://www.bacula.org/en/) is [...] to manage
backup, recovery, and verification
of computer data across a network of
computers... | [
0.5549408197402954,
-0.3392195403575897,
0.05840180441737175,
0.09474609792232513,
-0.1540079563856125,
0.06448066234588623,
-0.15176838636398315,
-0.16713057458400726,
-0.6057682037353516,
-0.22998780012130737,
-0.20073480904102325,
0.4117366075515747,
-0.39855265617370605,
-0.15931268036... | |
and remote systems.
* [rbme](http://schapiro.org/schlomo/projects/rbme.php): Using rsync for backups
[...] you get perpetual incremental
backups that appear as full backups
(for each day) and thus allow easy
restore or further copying to tape
etc.
* [Duplicity](http://www.nongnu.org/duplicity/) backs directories by
pro... | [
0.2971353530883789,
-0.39948976039886475,
0.26957249641418457,
0.30921658873558044,
0.1463247537612915,
-0.2791847586631775,
0.41409578919410706,
-0.07423612475395203,
-0.6963370442390442,
-0.2779439091682434,
-0.32992106676101685,
0.7320130467414856,
-0.299132764339447,
0.1635349094867706... | |
such as [Git](http://git.or.cz/)(/[Easy Git](http://www.gnome.org/~newren/eg/)), [Bazaar](http://bazaar-vcs.org/), [Mercurial](http://www.selenic.com/mercurial/wiki/) answers the need to have the backup available locally.
Use free online storage space as a remote backup, e.g.: compress your work/backup directory and ... | [
0.14705224335193634,
-0.15784165263175964,
0.44426852464675903,
0.34762489795684814,
0.277141809463501,
0.07877551764249802,
0.11792422086000443,
0.05609334260225296,
-0.4737955331802368,
-0.3554001748561859,
-0.48036593198776245,
0.5705974102020264,
-0.09353692084550858,
-0.01569932699203... | |
How do we decide on the best implementation of `hashCode()` method for a collection (assuming that equals method has been overridden correctly) ?
The best implementation? That is a hard question because it depends on the usage pattern.
A for nearly all cases reasonable good implementation was proposed in *Josh Bloch*'... | [
-0.03343094885349274,
0.019898777827620506,
0.0033391236793249846,
0.002594068879261613,
-0.17953133583068848,
-0.034157030284404755,
0.3074885606765747,
-0.33472615480422974,
0.04283062741160393,
-0.5505805015563965,
0.01973019912838936,
0.40130615234375,
-0.3080785274505615,
-0.257844328... | |
`c` by:
* If the field f is a `boolean`:
calculate `(f ? 0 : 1)`;
* If the field f is a `byte`, `char`, `short` or `int`: calculate `(int)f`;
* If the field f is a `long`: calculate `(int)(f ^ (f >>> 32))`;
* If the field f is a `float`: calculate `Float.floatToIntBits(f)`;
* If the field f is a `double`: calcu... | [
0.2613392472267151,
0.13596007227897644,
0.17297494411468506,
-0.2620590329170227,
0.27975666522979736,
0.017966337502002716,
-0.011228561401367188,
-0.3587668240070343,
-0.24539941549301147,
0.20717479288578033,
-0.5494846105575562,
0.49122291803359985,
-0.4013216495513916,
0.104648545384... | |
element and calculate the hash value in a *recursive fashion* and combine the values as described next.
3. Combine the hash value `c` with `result`:
```
result = 37 * result + c
```
4. Return `result`
This should result in a proper distribution of hash values for most use situations. | [
-0.05687222257256508,
-0.014178542420268059,
0.41725677251815796,
-0.18734703958034515,
0.21408109366893768,
-0.12723451852798462,
0.13561122119426727,
-0.760651171207428,
0.15863396227359772,
-0.3862203061580658,
-0.163936048746109,
0.49817296862602234,
-0.32925963401794434,
-0.1390385925... | |
A client using our system has requested that we store the SSNs/SINs of the end users in our database. Currently, we store minimal information about users (name, email address, and optionally, country), so I'm not overly concerned about a security breach - however, I have a suspicion there could be legal issues about st... | [
0.6725538969039917,
0.21565788984298706,
0.10245101153850555,
0.2418370246887207,
0.15846283733844757,
-0.10685999691486359,
0.5077897310256958,
0.21057449281215668,
-0.439304381608963,
-0.3886752724647522,
0.1636587381362915,
0.07182399928569794,
0.14437279105186462,
0.05041034519672394,
... | |
definitely shouldn't be used as a general identifier, or similar.
So, are there any potential legal issues about this sort of thing? Do you have any recommendations?
The baseline recommendation would be to:
* Inform the user that you are storing their SSN before they use your site/application. **Since the request app... | [
0.7196469902992249,
0.001470770686864853,
0.23539970815181732,
0.44861194491386414,
0.30283552408218384,
-0.6153316497802734,
-0.06428243964910507,
0.2407379001379013,
-0.2990526258945465,
-0.409771591424942,
-0.10951022803783417,
0.073672816157341,
-0.054016776382923126,
0.095444306731224... | |
other personal information of course)
* Have them check a checkbox stating that they understand that you really are storing their SSNs
but the most important part would probably be:
* Hire a lawyer well-versed with legal matters over the web | [
0.3116847574710846,
0.4876005947589874,
0.3059394657611847,
0.42902082204818726,
0.33075156807899475,
-0.12038660794496536,
0.18165159225463867,
-0.02515232376754284,
-0.4056413471698761,
-0.3190300464630127,
0.1222885400056839,
0.45218974351882935,
0.314700722694397,
-0.2250993251800537,
... | |
I've seen the following code many times:
```
try
{
... // some code
}
catch (Exception ex)
{
... // Do something
throw new CustomException(ex);
// or
// throw;
// or
// throw ex;
}
```
Can you please explain the purpose of re-throwing an exception? Is it following a pattern/best practic... | [
0.5314258933067322,
-0.0054278867319226265,
0.024175681173801422,
-0.12636470794677734,
-0.06783904135227203,
-0.2855837345123291,
0.47148969769477844,
-0.23035338521003723,
-0.3670441806316376,
-0.5529885292053223,
-0.09855376929044724,
0.7316731810569763,
-0.4569922685623169,
-0.04136169... | |
caught exception is good for abstraction. e.g., your library uses a third-party library that throws an exception that the clients of your library shouldn't know about. In that case, you wrap it into an exception type more native to your library, and throw that instead. | [
0.1645335853099823,
-0.34907612204551697,
-0.3517470955848694,
0.4903019964694977,
-0.11213190853595734,
-0.4360852837562561,
-0.13441501557826996,
0.09733164310455322,
-0.2925735116004944,
-0.4363352060317993,
-0.03807215020060539,
0.07912655919790268,
-0.4073265492916107,
0.0986488237977... | |
Is there some way to hide the browser toolbar / statusbar etc in current window via javascript? I know I can do it in a popup with `window.open()` but I need to do it this way. Is it possible at all?
As per the previous answer, this isn't possible to my knowledge and is best avoided anyway. Even if a solution can be fo... | [
0.4648278057575226,
0.10366425663232803,
0.249252051115036,
0.012983622960746288,
0.0432531014084816,
-0.2944742739200592,
0.6920782327651978,
0.07111106812953949,
-0.34498754143714905,
-0.6072633266448975,
-0.060322217643260956,
0.6318445801734924,
-0.24720782041549683,
-0.026774927973747... | |
that you're looking for and consequently you're best off forgetting about it altogether. Let the user decide how they want their window configured. | [
0.4698813855648041,
-0.06824872642755508,
0.35203850269317627,
0.18782833218574524,
0.3206300735473633,
-0.3314829170703888,
-0.07413285970687866,
0.2309093177318573,
-0.26252415776252747,
-0.6588382720947266,
-0.5963416695594788,
0.6048021912574768,
-0.13133837282657623,
0.020431557670235... | |
How do I add a "last" class on the last `<li>` within a Views-generated list?
You could use the **last-child** pseudo-class on the li element to achieve this
```
<html>
<head>
<style type="text/css">
ul li:last-child
{
font-weight:bold
}
</style>
</head>
<body>
<ul>
<li>IE</li>
<li>Firefox</li>
<li>Safari</li>
</ul>
<... | [
0.028556261211633682,
0.03644370660185814,
0.3865128755569458,
-0.06864793598651886,
-0.062284938991069794,
0.1702481061220169,
-0.09412374347448349,
-0.09358028322458267,
0.016020437702536583,
-0.9222363829612732,
-0.0829523429274559,
0.3403153121471405,
-0.1055312529206276,
-0.0757876485... | |
Basically I am trying to restart a service from a php web page.
Here is the code:
```
<?php
exec ('/usr/bin/sudo /etc/init.d/portmap restart');
?>
```
But, in `/var/log/httpd/error_log`, I get
> unable to change to sudoers gid: Operation not permitted
and in /var/log/messages, I get
> Sep 22 15:01:56 ri kernel:... | [
0.049343571066856384,
-0.03116612881422043,
0.49074819684028625,
0.08247100561857224,
0.028794433921575546,
0.11044243723154068,
0.46592530608177185,
0.062043435871601105,
-0.3844721019268036,
-0.3628068268299103,
-0.21745949983596802,
0.7222422957420349,
-0.23384419083595276,
0.2031685560... | |
tcontext=system\_u:object\_r:shadow\_t tclass=file
>
> Sep 22 15:01:56 ri kernel: audit(1222063316.568:780): avc: denied { read } for pid=4851 comm="sudo" name="shadow" dev=dm-0 ino=379669 scontext=root:system\_r:httpd\_sys\_script\_t tcontext=system\_u:object\_r:shadow\_t tclass=file
>
> Sep 22 15:01:56 ri ker... | [
-0.25475767254829407,
-0.05461272597312927,
0.6245145201683044,
0.29838359355926514,
-0.053849704563617706,
0.3886864483356476,
0.4378644824028015,
-0.41826602816581726,
-0.3711835443973541,
-0.3508903980255127,
0.10804463177919388,
0.6773416996002197,
-0.1660415232181549,
0.41378396749496... | |
>
>
> WWW ALL=(ALL) NOPASSWD:ALL
Can you please help me ? Am I doing something wrong ?
Thanks for your help,
tiBoun
The problem is not with sudo at the moment, but with [SELinux](http://en.wikipedia.org/wiki/Selinux), which is (reasonably) set to deny the HTTPD from gaining root privileges.
You will need to eit... | [
0.3340616226196289,
-0.07904571294784546,
0.17261405289173126,
0.0302699226886034,
-0.4891830086708069,
-0.5341917276382446,
0.30706751346588135,
-0.23262418806552887,
-0.00809427723288536,
-0.7140763401985168,
-0.10781119763851166,
0.5882366299629211,
-0.12041410803794861,
0.0834740400314... | |
I am developing a C++ class library containing domain model classes, and I would like to add support for instantiating these classes from various persistence mechanisms, i.e. databases and file. The user of the class library should be given an interface(?) against which to program a class that can transfer the data fro... | [
0.20694905519485474,
-0.01969960890710354,
0.0012439717538654804,
0.1384994387626648,
-0.05597660318017006,
-0.002681742887943983,
-0.12459717690944672,
0.027978943660855293,
-0.2323702722787857,
-0.5819087624549866,
0.00702298991382122,
0.692529022693634,
-0.4459610879421234,
0.1482171118... | |
This would still have to use introspection to get out the class metadata, but you would still have this issue with any persistence layer.
Alternatively you could do something similar but use the metadata to drive a code generator that fills in the 'Getters' and 'Setters' for the persistence layer.
Any persistence lay... | [
0.20855070650577545,
-0.1327821910381317,
-0.09829328209161758,
0.4829798638820648,
-0.17412108182907104,
-0.2156597375869751,
0.18175368010997772,
-0.11047188192605972,
-0.2322477251291275,
-0.5351986885070801,
0.034694161266088486,
0.8098976612091064,
-0.42474186420440674,
0.252669095993... | |
you are providing a set of domain classes with the hooks for a persistence framework that third parties can plug their data access mechanism into.
I think that once you provide access to class metadata and callbacks the perisistence mechanism is relatively straightforward. Look at the metadata components of any conven... | [
0.5031073689460754,
0.012678262777626514,
0.1272163689136505,
0.33314383029937744,
0.01875861920416355,
-0.3629235327243805,
0.15553058683872223,
-0.11914403736591339,
-0.19358378648757935,
-0.5070486664772034,
-0.15928414463996887,
0.7648365497589111,
-0.22956018149852753,
-0.016754878684... | |
C++ library with the type of pluggable persistence mechanism you're describing, but I did something in Python that could have had this type of facility added. The particular implementation used facilities in Python with no direct C++ equivalent, although the basic principle could probably be adapted to work with C++.
... | [
-0.14607775211334229,
-0.18305030465126038,
0.16859634220600128,
-0.0239254217594862,
-0.24108903110027313,
-0.33144277334213257,
0.3010842800140381,
-0.1914348006248474,
-0.27746012806892395,
-0.11868229508399963,
0.06501036137342453,
0.7061988711357117,
-0.7977616190910339,
-0.0309587102... | |
attribute being queried matched anything in its dictionary. Where this happened, the call was redirected to get or set an item in the data cache.
The cache had metadata of its own. It was aware of relationships between entities within its data model, and knew which attribute names to intercept to access data. The way ... | [
-0.18586894869804382,
-0.09083595871925354,
0.17110902070999146,
0.39231738448143005,
-0.40006402134895325,
0.12443074584007263,
0.08713186532258987,
-0.14692838490009308,
0.013843617402017117,
-0.1196305975317955,
0.26302194595336914,
0.7101964354515076,
-0.18309150636196136,
0.1330909579... | |
XML file.
Making something like this work in C++ would be a bit more fiddly, and it may not be possible to make the object cache access as transparent as it was with this system. You would probably be best with an explicit protocol that loads and flushes the object's state to the cache. The code to this would be quite... | [
0.18714451789855957,
0.10481984913349152,
0.30576297640800476,
0.28270143270492554,
-0.3037974238395691,
-0.5457096099853516,
-0.04334040731191635,
-0.2331477254629135,
-0.06392814964056015,
-0.6492645740509033,
-0.16250057518482208,
0.3750689923763275,
-0.33588603138923645,
0.094792090356... | |
this is probably more trouble than it's worth. | [
0.2840162217617035,
0.34074071049690247,
0.15354886651039124,
0.0028989403508603573,
0.14196567237377167,
-0.0821443647146225,
0.1256152242422104,
0.04116830602288246,
-0.013773496262729168,
-0.0944618359208107,
0.16374821960926056,
0.22374741733074188,
0.17844511568546295,
0.1183147579431... | |
Is there a runtime performance penalty when using interfaces (abstract base classes) in C++?
Short Answer: No.
Long Answer:
It is not the base class or the number of ancestors a class has in its hierarchy that affects it speed. The only thing is the cost of a method call.
A non virtual method call has a cost (but can... | [
-0.10655819624662399,
-0.01375260017812252,
0.08783471584320068,
0.45769819617271423,
-0.23118580877780914,
0.20699870586395264,
0.10458620637655258,
-0.3604353964328766,
-0.0369405671954155,
-0.7036533951759338,
0.23298202455043793,
0.447796106338501,
-0.04756590351462364,
-0.136706605553... | |
virtual by definition there is this cost.
Unless you are writing some hyper speed sensitive application this should not be a problem. The extra clarity that you will recieve from using an interface usually makes up for any perceived speed decrease. | [
-0.03478173539042473,
-0.008929395116865635,
0.5603654384613037,
0.59828120470047,
-0.037706632167100906,
-0.02145414613187313,
0.4026552438735962,
0.6123349666595459,
-0.33489319682121277,
-0.8793357014656067,
-0.11763441562652588,
0.7849575281143188,
0.14832505583763123,
0.18905442953109... | |
How can I make sure that a certain OLEDB driver is installed when I start my application? I use ADO from Delphi and would like to display a descriptive error message if the driver is missing. The error that's returned from ADO isn't always that user-friendly.
There are probably a nice little function that returns all ... | [
0.33994290232658386,
0.17839837074279785,
0.3457620441913605,
0.18985705077648163,
-0.1820995807647705,
-0.23994579911231995,
0.1380338817834854,
0.09507517516613007,
0.2072402387857437,
-0.8502535820007324,
0.16482307016849518,
0.6986414194107056,
-0.3739224076271057,
0.2327432632446289,
... | |
key (the GUID value) and use that in a registry search in your application.
```
function OleDBExists : boolean;
var
reg : TRegistry;
begin
Result := false;
// See if Advantage OLE DB Provider is on this PC
reg := TRegistry.Create;
try
reg.RootKey := HKEY_LOCAL_MACHINE;
Result := reg.OpenKeyReadOnly... | [
-0.2245093137025833,
0.12910938262939453,
0.5221269130706787,
-0.11723347753286362,
0.3133205771446228,
0.07793798297643661,
0.3332861661911011,
-0.150544211268425,
0.03683057427406311,
-0.5087956786155701,
-0.40227729082107544,
0.9024375081062317,
-0.3033428192138672,
0.42572492361068726,... | |
I want to create a c# application with multiple windows that are all transparent with some text on.
The tricky part is making these forms sit on top of the desktop but under the desktop icons. Is this possible?
Just making the window transparent is very straight forward:
```
this.BackColor = Color.Fuchsia;
this.Trans... | [
0.22232019901275635,
0.041576094925403595,
0.5596146583557129,
-0.11235662549734116,
-0.016755202785134315,
-0.08767582476139069,
0.4144865572452545,
-0.2552037537097931,
-0.12979823350906372,
-0.7167274355888367,
-0.08788304030895233,
0.5783975124359131,
-0.4928409159183502,
0.21242265403... | |
message.Result = (IntPtr)HTTRANSPARENT;
}
else
{
base.WndProc( ref message );
}
}
``` | [
0.09323791414499283,
-0.09069371968507767,
0.42670828104019165,
-0.4063728153705597,
0.055696502327919006,
-0.02920497953891754,
0.43196502327919006,
-0.1596461832523346,
-0.15843525528907776,
-0.4197154939174652,
-0.4528186619281769,
0.4804585576057434,
-0.3892040550708771,
0.241688415408... | |
The only experience I have so far with a touchscreen interface was one where everything was custom drawn, and I get the feeling it's not the most efficient way of doing it (even the most basic layout change is hell to make). I know plenty of GUI toolkits intended at keyboard & mouse interfaces, but can you advise somet... | [
0.3177938759326935,
0.14336401224136353,
0.3858245015144348,
0.044495053589344025,
-0.1390669345855713,
-0.04977717995643616,
-0.09211286902427673,
0.02580748312175274,
-0.19273684918880463,
-0.8953603506088257,
0.15363869071006775,
0.5767893195152283,
-0.23380175232887268,
0.0332369878888... | |
use with the touchscreen.
.NET 3.0 required. | [
-0.02192305587232113,
-0.041541486978530884,
0.2986874282360077,
0.25210487842559814,
0.15589401125907898,
-0.41089609265327454,
0.3384140729904175,
0.007712842896580696,
-0.009996565990149975,
-0.9762691855430603,
-0.5201860666275024,
0.6232486367225647,
-0.03210807591676712,
-0.415858507... | |
I'm getting a random unreproducible Error when initializing a JSplitPane in with JDK 1.5.0\_08. Note that this does not occur every time, but about 80% of the time:
```
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.KeyStroke
at java.util.TreeMap.compare(TreeMap.java:1093)
at java.uti... | [
0.25124290585517883,
0.3598007559776306,
-0.05690866336226463,
-0.18154093623161316,
-0.01928570680320263,
-0.04034961014986038,
0.7186321020126343,
-0.0883297398686409,
-0.31949180364608765,
-0.9468267560005188,
0.013962648808956146,
0.4236868917942047,
-0.48907244205474854,
0.00957897957... | |
was only fixed in JDK 6.
See <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434148> | [
-0.28739458322525024,
0.07886958122253418,
0.3001205027103424,
-0.1376088410615921,
0.1836540400981903,
-0.06422561407089233,
0.12385273724794388,
0.36623767018318176,
-0.6734170317649841,
-0.5791097283363342,
-0.28197258710861206,
0.5685285329818726,
-0.819618821144104,
0.0148653164505958... | |
If I need to choose a collation mode to work with, how do I know what collations are available?
```
select distinct COLLATION_NAME from INFORMATION_SCHEMA.COLUMNS order by 1
``` | [
-0.20357315242290497,
0.6086639761924744,
0.5551456212997437,
0.014582566916942596,
0.03732174262404442,
0.07160782814025879,
0.09543631225824356,
-0.24941284954547882,
-0.022736160084605217,
-0.6237872242927551,
-0.19297219812870026,
0.4426010549068451,
-0.3047928810119629,
-0.03389181569... | |
We help our clients to manage and publish their media online - images, video, audio, whatever. They always ask my boss whether they can stop users from copying their media, and he asks me, and I always tell him the same thing: no. If the users can view the media, then a sufficiently determined user will always be able ... | [
0.9311004281044006,
0.21013015508651733,
0.5893480777740479,
0.4236477315425873,
0.4398285448551178,
-0.16118104755878448,
-0.14744780957698822,
0.07421939820051193,
-0.338885098695755,
-0.27984189987182617,
0.025164544582366943,
0.7238699197769165,
0.07858508825302124,
-0.0134431002661585... | |
legitimate viewing of the media?
And if there isn't, how do I convince my boss?
I believe you have misinterpreted your boss's question. Perhaps he doesn't even know the right question to ask, so I'll give you the Q&A that **should** have occurred.
Boss: Can we stop every determined user from copying our clients' medi... | [
0.8561562299728394,
0.04355325177311897,
0.141826331615448,
0.4829062819480896,
0.24661113321781158,
-0.12703438103199005,
0.09787045419216156,
-0.131623312830925,
-0.24913720786571503,
-0.18640966713428497,
0.06018480286002159,
1.0164028406143188,
-0.2896668314933777,
0.06547348946332932,... | |
inconvenient to our legitimate users?
You: Yes, this is challenging, but tractable.
Boss: Is it economically feasible to implement such a protection system?
You: That depends on the details of our contracts with media providers. If some providers are unwilling to license desirable content to us because of our unwill... | [
0.3856695294380188,
0.08302401006221771,
-0.008730076253414154,
0.5002977252006531,
0.35457900166511536,
-0.16967378556728363,
-0.06352274864912033,
0.020204972475767136,
-0.18370157480239868,
-0.14987727999687195,
0.0036773537285625935,
0.8196471929550171,
-0.20384114980697632,
0.02398340... | |
When I enter an object into the DB with Linq-to-SQL can I get the id that I just inserted without making another db call? I am assuming this is pretty easy, I just don't know how.
After you commit your object into the db the object receives a value in its ID field.
So:
```
myObject.Field1 = "value";
// Db is the dat... | [
0.07124762237071991,
0.14913980662822723,
0.4224467873573303,
-0.0756416991353035,
-0.14009268581867218,
-0.14385543763637543,
0.35771945118904114,
-0.4189469516277313,
0.1484626978635788,
-0.6206404566764832,
-0.1322278380393982,
0.6186997294425964,
-0.16864825785160065,
0.207967862486839... | |
A heap is a list where the following applies:
```
l[i] <= l[2*i] && l[i] <= [2*i+1]
```
for `0 <= i < len(list)`
I'm looking for in-place sorting.
Well you are half way through a Heap Sort already, by having your data in a heap. You just need to implement the second part of the heap sort algorithm. This should be f... | [
-0.25870394706726074,
-0.187946617603302,
-0.20878006517887115,
-0.06917524337768555,
-0.5551897287368774,
-0.07167302817106247,
0.4329772889614105,
-0.25343698263168335,
-0.2827345132827759,
-0.8778959512710571,
-0.12302416563034058,
-0.10289491713047028,
-0.34863030910491943,
-0.17440888... | |
What are the cases where you'd use a modal popup ?
Does it interrupt the user's flow, if it all of a sudden opens up in his face ?
Would you avoid modal popups in general ? or when should one be careful of using them ?
**Edit:**
To be a bit more specific, the situation here is this :
I have a menu on the right, (V... | [
0.15308508276939392,
-0.12858439981937408,
0.5563976168632507,
-0.021875953301787376,
-0.24410806596279144,
0.05129776895046234,
0.23201759159564972,
0.18202552199363708,
-0.350312739610672,
-0.7143457531929016,
-0.2958463430404663,
0.4950072467327118,
-0.16095110774040222,
-0.235697507858... | |
popup forcing them to select.
(the selection step is mandatory.)
From [Wikipedia](http://en.wikipedia.org/wiki/Modal_window):
Frequent uses of modal windows include:
* drawing attention to vital pieces of information. This use has been criticised as ineffective.
* blocking the application flow until information requ... | [
0.024473771452903748,
-0.10741497576236725,
0.5033966302871704,
0.05142631009221077,
-0.007441311608999968,
-0.0777147114276886,
0.3601963520050049,
0.2367774248123169,
-0.49719128012657166,
-0.4037065804004669,
-0.7178059220314026,
0.3574875593185425,
-0.5839916467666626,
0.15543158352375... | |
modal dialogs, but it is also criticised by usability experts as being ineffective for its intended use (protection against errors in destructive actions) and for which better alternatives exist. | [
0.06098930910229683,
0.011170688085258007,
0.4419223964214325,
0.1861049234867096,
-0.16825151443481445,
-0.36366525292396545,
0.6660209894180298,
0.07655066251754761,
0.15644145011901855,
-0.38211116194725037,
-0.5504400134086609,
0.6756790280342102,
-0.6372991800308228,
-0.32562899589538... | |
What is the best way of dynamically writing LINQ queries and Lambda expressions?
I am thinking of applications where the end user can design business logic rules, which then must be executed.
I am sorry if this is a newbie question, but it would be great to get best practices out of experience.
I cannot recommend hi... | [
-0.021855207160115242,
-0.08583705127239227,
-0.31230613589286804,
0.1148826852440834,
-0.27758967876434326,
0.1265835165977478,
0.045055512338876724,
-0.1396155208349228,
-0.4058508574962616,
-0.36962902545928955,
-0.01221164409071207,
0.4193936288356781,
-0.37103888392448425,
-0.30762434... | |
I am interested to learn: what are the most common technical causes (from the perspective of operating system programming) of an operating system crash (not limited to Windows crashes)? I'm looking for an answer not like "too many apps open", but what specifically happens when too many apps are open that causes the cra... | [
0.33138054609298706,
0.6486430168151855,
0.13248778879642487,
0.20656202733516693,
0.022419489920139313,
-0.301017701625824,
0.264631062746048,
0.44653037190437317,
-0.28449687361717224,
-0.4663783013820648,
-0.29135775566101074,
0.7374753355979919,
-0.20953847467899323,
-0.053188677877187... | |
I want to perform cascade delete for some tables in my database, but I'm interested in what happens in case there's a failure when deleting something. Will everything rollback?
In general¹, yes, cascade deletes are done in the same transaction (or subtransaction) as your original delete. You should read the documentati... | [
-0.06696747243404388,
-0.058451246470212936,
0.16609841585159302,
0.28159835934638977,
-0.11623117327690125,
-0.15730853378772736,
0.23688769340515137,
-0.14724895358085632,
-0.22792811691761017,
-0.3412446677684784,
0.002590540563687682,
0.26295480132102966,
-0.2395525723695755,
0.0473372... | |
At work we use [WiX](http://en.wikipedia.org/wiki/WiX) for building installation packages. We want that installation of product X would result in uninstall of the previous version of that product on that machine.
I've read on several places on the Internet about a major upgrade but couldn't get it to work.
Can anyone ... | [
0.4219212234020233,
0.09089618176221848,
0.389771968126297,
-0.15904028713703156,
0.03755300119519234,
-0.19664253294467926,
0.3840750753879547,
-0.13565485179424286,
-0.03156989440321922,
-0.7504298686981201,
-0.35712361335754395,
0.7117461562156677,
-0.20047535002231598,
0.15397876501083... | |
localised error message, and also prevents upgrading an already existing identical version (i.e. only lower versions are upgraded):
```
<MajorUpgrade
AllowDowngrades="no" DowngradeErrorMessage="!(loc.NewerVersionInstalled)"
AllowSameVersionUpgrades="no"
/>
``` | [
-0.3444414436817169,
-0.1830747425556183,
0.6162280440330505,
-0.15808257460594177,
0.32402920722961426,
-0.24282503128051758,
0.8814568519592285,
0.2545248866081238,
-0.24691124260425568,
-0.6465902328491211,
-0.581972062587738,
0.6966156363487244,
-0.0598188191652298,
0.26658740639686584... | |
I got this síngleton cache object and it exposes an IEnumerable property which just returns a private IEnumerable variable.
I have a static method on my singleton object that updates this member variable (that exists on the single 'Instance' instance of this cache object).
Let's say some thread is currently iterating... | [
0.2811560332775116,
0.2646097242832184,
0.1697629988193512,
0.043657463043928146,
-0.024252457544207573,
-0.10213421285152435,
0.48151400685310364,
0.24902142584323883,
-0.29056739807128906,
-0.8078804612159729,
0.09064548462629318,
0.3802475333213806,
-0.18250709772109985,
0.6260221004486... | |
be picked up by the GC but my problem is - i'm not 100% sure what happens once i set the new reference? Would the other thread suddenly be iterating over the new object or the old one it got passed through the IEnumerable interface? If it had been a normal reference i'd say 'no'. The calling thread would be operating o... | [
0.1438305824995041,
-0.07309545576572418,
0.27448326349258423,
0.04834238439798355,
0.017815912142395973,
-0.2710616886615753,
0.25097936391830444,
-0.07622030377388,
0.10789704322814941,
-0.6040195226669312,
-0.1416424959897995,
0.35168132185935974,
-0.4350624084472656,
0.3436582982540130... | |
private static readonly object lockObject = new object();
private static bool isUpdating;
private IEnumerable<Sektion> sektioner;
static SektionCache()
{
UpdateCache();
}
public IEnumerable<Sektion> Sektioner
{
get { return sektioner; }
}
public static void Update... | [
0.11301962286233902,
-0.4427587389945984,
0.26108139753341675,
-0.0064521185122430325,
0.06541921198368073,
0.048753269016742706,
0.4502030909061432,
0.02625209279358387,
-0.10315512120723724,
-0.5984230041503906,
-0.7310985922813416,
0.6088548898696899,
-0.5738961100578308,
0.040471456944... | |
// SNIP
}
}
```
The thread which is currently enumerating sektioner will continue to enumerate it even when you update the reference within the singleton. There is nothing special about objects which implement IEnumerable.
You should perhaps add the [volatile](https://learn.microsoft.com/en-us/dotnet/csharp/langu... | [
0.3287893235683441,
0.059990908950567245,
0.2961251437664032,
0.04943283647298813,
0.07221896946430206,
-0.4093904495239258,
0.2506549060344696,
0.23189353942871094,
-0.07329334318637848,
-0.6791789531707764,
-0.3177030086517334,
0.40964147448539734,
-0.13980846107006073,
0.081927962601184... | |
What would be better practice when giving a function the original variable to work with:
```
unsigned long x = 4;
void func1(unsigned long& val) {
val = 5;
}
func1(x);
```
or:
```
void func2(unsigned long* val) {
*val = 5;
}
func2(&x);
```
IOW: Is there any reason to pick one over another?
... | [
0.05239420011639595,
-0.14408834278583527,
0.05415123701095581,
-0.16189879179000854,
-0.06562042981386185,
-0.12869049608707428,
0.0843951627612114,
-0.2603035569190979,
-0.2448103427886963,
-0.38862526416778564,
-0.04176343232393265,
0.7619225382804871,
-0.37417784333229065,
-0.196203202... | |
I've set up DAV in apache2, which works great. The thing is, all read/write operations are done with the apache user's credentials. Instead I want to use the HTTP authenticated user's credentials. If I authenticate as "john", all read and write operations should use the system user john's credentials (from /etc/passwd)... | [
0.482837438583374,
0.2302454710006714,
0.5666353702545166,
-0.07638975232839584,
0.16886724531650543,
-0.44578030705451965,
0.6092717051506042,
-0.12575207650661469,
-0.2199699729681015,
-0.6212288737297058,
-0.08742822706699371,
0.5051406621932983,
-0.04170803353190422,
0.0054967040196061... | |
<Location "/">
DAV On
AuthType Basic
AuthName "WebDAV Restricted"
AuthUserFile /etc/apache2/extra/webdav-passwords
require valid-user | [
-0.025081267580389977,
0.28303012251853943,
0.5784516334533691,
0.0310609582811594,
-0.06942538172006607,
-0.1313171237707138,
0.2844781279563904,
-0.2485334724187851,
0.13209080696105957,
-0.26209014654159546,
-0.5751111507415771,
0.36676475405693054,
-0.09376177936792374,
0.0357037335634... | |
Options +Indexes
</Location>
DAVLockDB /var/lib/dav/lockdb
ErrorLog /var/log/apache2/webdav-error.log
TransferLog /var/log/apache2/webdav-access.log
</VirtualHost>
```
We have been using davenport (<http://davenport.sourceforge.net/>) for years to provide access to Windows/samba shares ... | [
0.20858706533908844,
-0.0669926106929779,
0.11778566241264343,
0.1675378978252411,
0.022307753562927246,
-0.03908964619040489,
-0.06431304663419724,
-0.25240156054496765,
-0.7129729986190796,
-0.6208587884902954,
0.21452315151691437,
0.2988627552986145,
-0.12410177290439606,
0.172122925519... | |
When a getter returns a property, such as returning a `List` of other related objects, should that list and it's objects be immutable to prevent code outside of the class, changing the state of those objects, without the main parent object knowing?
For example if a `Contact` object, has a `getDetails` getter, which re... | [
0.06857564300298691,
-0.37165185809135437,
0.06576889008283615,
0.20664368569850922,
-0.011107277125120163,
-0.30502718687057495,
0.473905473947525,
-0.19416767358779907,
-0.09983811527490616,
-0.48189231753349304,
-0.45315900444984436,
0.7423348426818848,
-0.40769484639167786,
0.068049810... | |
calling code and return easily mutable objects, or go the hard way and make a immutable class for each mutable class?
It's a matter of whether you should be "defensive" in your code. If you're the (sole) user of your class and you trust yourself then by all means no need for immutability. However, if this code needs to... | [
0.2922079563140869,
0.041188210248947144,
-0.18289871513843536,
0.1132253110408783,
-0.25700825452804565,
-0.19774048030376434,
0.6253480315208435,
-0.0887538343667984,
0.06961516290903091,
-0.3763074576854706,
-0.12535272538661957,
1.0275167226791382,
-0.3492094576358795,
0.27101659774780... | |
mutation should not occur via mutable objects received via getters. | [
-0.08220402896404266,
-0.23871001601219177,
-0.16764554381370544,
0.08474674820899963,
-0.06277435272932053,
-0.07741104066371918,
0.5846332311630249,
0.29415735602378845,
-0.2287067472934723,
-0.8938182592391968,
-0.5350335240364075,
-0.2291768193244934,
-0.515347957611084,
0.580662965774... | |
Previously I have asked to strip text from a field and convert it to an int, this works successfully. But now, I would like to do an INNER JOIN on this new value.
So I have this:
```
SELECT CONVERT(int, SUBSTRING(accountingTab.id, PATINDEX('%[0-9]%', accountingTab.id), 999))
AS 'memId', userDetails.title, userDetai... | [
-0.23891615867614746,
0.34124287962913513,
0.704298734664917,
-0.18744271993637085,
-0.17762491106987,
0.36623868346214294,
0.08467459678649902,
-0.16358652710914612,
0.08831220120191574,
-0.6373819708824158,
0.02487594075500965,
0.6669008731842041,
-0.10742122679948807,
-0.075605243444442... | |
I've created an `IHttpHandler` in .NET C# which returns pieces of html to a classic asp page.
The classic asp page communicates with the `IHttpHandler` through basic http requests using `ServerXMLHTTP` in vbscript or Ajax Calls in JavaScript.
Now, I need a way to share a variable which I have in vbscript but not in j... | [
0.19113433361053467,
0.024260759353637695,
0.4240491986274719,
-0.07257835566997528,
-0.6155093908309937,
-0.1130753830075264,
0.12910768389701843,
-0.09284660965204239,
-0.07496019452810287,
-0.821373462677002,
0.06989509612321854,
0.3237948417663574,
-0.3694162666797638,
0.08214996010065... | |
idea that I could maybe cache the variable in the .NET application and use the cached version for javascript calls. But for this to work I would need a way to uniquely identify the "client" in .NET...
I tried to add `System.Web.SessionState.IRequiresSessionState` to my HttpHandler and use the SessionId but this didn't... | [
0.40993690490722656,
-0.15446116030216217,
0.19662700593471527,
0.08917120844125748,
-0.19326704740524292,
0.15913404524326324,
0.4638970196247101,
-0.10349446535110474,
-0.20229189097881317,
-0.5800922513008118,
0.5390207171440125,
0.7566761374473572,
-0.32277628779411316,
0.1858554780483... | |
your asp pages.
Then you can use Javascript to query this variable to send across to the Asp.Net handler through your ajax calls. | [
0.33740290999412537,
-0.2693888247013092,
0.16744621098041534,
0.16197015345096588,
-0.26446881890296936,
0.024110015481710434,
0.1857418417930603,
0.19069649279117584,
-0.22951506078243256,
-0.7358621954917908,
-0.22851085662841797,
0.370389848947525,
-0.2607846260070801,
-0.1553418934345... | |
I am working with some CSS that is poorly written to say the least. I am not a design/CSS expert, but I at least understand the **C** in CSS. While the builtin CSS support inside of VS-2008 is far improved over previous versions, it still doesn't quite do what I am looking for.
I was wondering if anyone know of a good... | [
0.4398393929004669,
0.22112777829170227,
0.06294805556535721,
0.15433306992053986,
-0.3988736569881439,
-0.11664402484893799,
0.1527683138847351,
0.31397467851638794,
-0.0939590334892273,
-0.6329187750816345,
0.3515481650829315,
0.6255524158477783,
0.1152484342455864,
0.16087698936462402,
... | |
like font-style, color, etc...
* Plugin to VS-2008 would be awesome!
* Examine markup files and make some suggestions on improving the current use of classes and styles.
The [Dust-Me Selectors Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/5392) can scan a website and tell you what CSS is used and wh... | [
0.5881998538970947,
0.05926905944943428,
0.26743051409721375,
0.110427126288414,
-0.009256631135940552,
-0.446516752243042,
0.18248558044433594,
-0.15089580416679382,
-0.3913491666316986,
-0.672465443611145,
-0.03610463812947273,
0.4813488721847534,
-0.19878481328487396,
0.0086577078327536... | |
First of all, this question regards MySQL 3.23.58, so be advised.
I have 2 tables with the following definition:
```
Table A: id INT (primary), customer_id INT, offlineid INT
Table B: id INT (primary), name VARCHAR(255)
```
Now, table A contains in the range of 65k+ records, while table B contains ~40 records. In ... | [
-0.18370187282562256,
0.1825796514749527,
0.679688572883606,
-0.08144264668226242,
-0.1112654060125351,
0.3681234121322632,
-0.007977152243256569,
-0.295533150434494,
-0.2095610797405243,
-0.5549455881118774,
0.020381508395075798,
0.3738434314727783,
-0.0848717913031578,
0.3641980886459350... | |
b.name, COUNT(*) AS orders, COUNT(DISTINCT(a.kundeid)) AS leads
FROM katalogbestilling_katalog a, medie b
WHERE a.offlineid = b.id
GROUP BY b.name
```
Now, each id in medie is associated with a different name, meaning you could group by id as well as name. A bit of testing back and forth settled me on this (*query ti... | [
-0.14944063127040863,
-0.055920932441949844,
0.4093632996082306,
-0.16132941842079163,
-0.29306134581565857,
0.26274269819259644,
0.47654250264167786,
-0.7537755370140076,
-0.1798270046710968,
-0.3775860369205475,
-0.14595602452754974,
0.19519288837909698,
-0.25706860423088074,
0.268988519... | |
am at a loss for what to do. The EXPLAIN query shows me the query is using fileshort (the original query also used temp tables). All suggestions are welcome!
You could try making sure there are covering indexes defined on each table. A covering index is just an index where each column requested in the select or used in... | [
0.07456992566585541,
-0.0018034940585494041,
0.4622291326522827,
0.20198020339012146,
0.010014655068516731,
-0.30188724398612976,
-0.03440147265791893,
-0.3259063959121704,
-0.06966923177242279,
-0.5913277864456177,
0.009918841533362865,
0.3183091878890991,
-0.32475119829177856,
0.23174647... | |
with great success in Oracle and MS SqlServer.
Looking at your query, you could try:
one index for medie.id, medie.name
one index for katalogbestilling\_katalog.offlineid, katalogbestilling\_katalog.kundeid
The columns should be defined in these orders for the index. That makes a difference whether the index can ... | [
0.14101295173168182,
-0.09546274691820145,
0.22499896585941315,
0.10153763741254807,
-0.12304165214300156,
0.21153438091278076,
0.18388821184635162,
-0.3518145978450775,
-0.24124541878700256,
-0.31935498118400574,
-0.24157558381557465,
0.2527298927307129,
-0.4625478684902191,
0.19886343181... | |
It's very painful to add multiple tickets to Trac or to have it as your own todo list. That causes people to use their own task management tools so tasks are then spread all around.
Is there any plugin or macro that would quicken the process of adding a ticket?
If you're using Eclipse: [Mylyn](http://www.eclipse.org/m... | [
0.44448816776275635,
-0.4518134593963623,
0.4824548363685608,
0.5580337643623352,
-0.03886976093053818,
-0.2509031593799591,
-0.369340181350708,
-0.13926289975643158,
-0.160558819770813,
-0.9067617058753967,
0.4539177119731903,
0.6295771598815918,
-0.0857260599732399,
0.014360473491251469,... | |
I need to parse a xml file which is practically an image of a really big tree structure, so I'm using the XmlReader class to populate the tree 'on the fly'. Each node is passed just the xml chunk it expects from its parent via the ReadSubtree() function. This has the advantage of not having to worry about when a node h... | [
0.3517594039440155,
-0.000014015409760759212,
0.3193889260292053,
-0.06125786900520325,
-0.0653073862195015,
-0.13701671361923218,
0.058506350964307785,
0.1709163784980774,
-0.1256154477596283,
-0.7985506653785706,
0.01825621724128723,
0.17314860224723816,
-0.16192913055419922,
0.233558088... | |
objects are created with every ReadSubtree call, and no caching for reusable objects is made (that I'd seen).
Maybe ReadSubtree() was not thought to be massively used, or maybe I'm just worrying for nothing and I just need to call GC.Collect() after parsing the file...
Hope someone can shed some light on this.
Thank... | [
0.33163517713546753,
0.09730411320924759,
0.3337854743003845,
0.5155389904975891,
-0.37201881408691406,
-0.2380959689617157,
0.7006836533546448,
0.041706543415784836,
-0.07068721950054169,
-0.6568967700004578,
-0.27729111909866333,
0.38383832573890686,
-0.22121411561965942,
0.2763434350490... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.