text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
In a C# Windows Forms application I want to detect if another instance of the application is already running.
If so, activate the main form of the running instance and exit this instance.
What is the best way to achieve this?
Scott Hanselman [answers](http://www.hanselman.com/blog/TheWeeklySourceCode31SingleInstanceWinFormsAndMicrosoftVisualBasicdll.aspx) on you question in details. | [
0.042324699461460114,
0.018574928864836693,
0.0665411576628685,
0.10191778838634491,
0.12360214442014694,
-0.3588576018810272,
0.414844274520874,
0.05086618289351463,
-0.197300523519516,
-0.5924546718597412,
-0.24605371057987213,
0.241889089345932,
-0.2000083029270172,
-0.01964498870074749... | |
In Microsoft SQL Server, is there a way to detect whether a database has had its isolation level set via the T-SQL command `ALTER DATABASE <database> SET READ_COMMITTED_SNAPSHOT ON;`?
I cannot find a simple way to detect this in either T-SQL or via the Management Studio's GUI.
```
SELECT is_read_committed_snapshot_on FROM sys.databases
WHERE name= 'YourDatabase'
```
Return value:
* **1**: `READ_COMMITTED_SNAPSHOT` option is **ON**. Read operations under the `READ COMMITTED` isolation level are based on snapshot scans and do not acquire locks.
* **0** (default): `READ_COMMITTED_SNAPSHOT` option is **OFF**. Read operations under the `READ COMMITTED` isolation level use [Shared (S) locks](https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms175519(v=sql.105)). | [
-0.20071245729923248,
-0.014240068383514881,
0.06464803963899612,
-0.17085392773151398,
0.10215955972671509,
-0.43045270442962646,
-0.06482797116041183,
-0.16304297745227814,
-0.2883467674255371,
-0.5786924958229065,
-0.40191853046417236,
0.5399708151817322,
-0.3807666599750519,
0.05526704... | |
Have any well-documented or open source projects targeted `iPhone`, `Blackberry`, and `Android` ? Are there other platforms which are better-suited to such an endeavor ?
Note that I am particularly asking about client-side software, not web apps, though any information about the difficulties of using web apps across multiple mobile platforms is also interesting.
The HTML5 standard has support for releasing stand-alone *HTML5* apps. Essentially a *HTML5* app is a bundle of *HTML5*, *JavaScript* and *CSS* files that will run stand-alone in the browser of the desktop or device. You can distribute them like any other program, including selling them on | [
0.7318515777587891,
0.20963266491889954,
0.1057761013507843,
0.15283025801181793,
-0.1378592848777771,
-0.17902272939682007,
0.03510904312133789,
0.08064340800046921,
-0.5858328342437744,
-0.5369688272476196,
-0.47027748823165894,
0.4324803054332733,
-0.15627948939800262,
-0.10678785294294... | |
the *iStore* for the **iPhone**.
The support for this is patchy at the moment but is likely to improve tremendously in the next year or two.
Google for *HTML5* apps for information and resources. A good introduction to HTML5 is the online book ["Dive Into HTML5" by Mark Pilgrim](http://fortuito.us/diveintohtml5/table-of-contents.html). This is a work in progress, but sufficiently complete to be useful. | [
0.16647884249687195,
-0.09380005300045013,
-0.11551100015640259,
0.22512279450893402,
0.06774912029504776,
-0.15505854785442352,
0.4083266258239746,
0.26093995571136475,
-0.5098989605903625,
-0.7965025305747986,
-0.4739554226398468,
0.31948208808898926,
0.08307518810033798,
-0.364812523126... | |
Is there a way of getting all required assemblies (excluding the .net framework) for a .net project into a folder ready to be packaged into an [nsis](http://nsis.sourceforge.net/Main_Page) as setup file?
I've tried writing a small console app that uses reflection to get a list of dlls but have got stuck with finding a foolproof way of determining if a dll is from the .net framework or not.
The answer could be a simple switch in Visual Studio to output all dependencies, or a standalone app that can do it, or a plugin for Nsis, or some information on reflection that I've missed.
In | [
0.6887302994728088,
-0.07166668772697449,
0.037276722490787506,
0.0827484205365181,
-0.1568668931722641,
-0.28543904423713684,
-0.03566679358482361,
-0.14554263651371002,
-0.2713766098022461,
-0.48699450492858887,
0.03634587675333023,
0.4728122651576996,
-0.23470135033130646,
-0.1739268600... | |
Visual Studio (2005 at least - what I'm using right now), each reference that you have associated to a project has a property called "Copy Local", this can be set to true/false. When true it will copy the dll's for you into the current configuration directory. | [
0.39513784646987915,
0.02427072823047638,
0.2891835868358612,
0.026498064398765564,
-0.22447480261325836,
-0.2822912931442261,
0.011804058216512203,
0.20414920151233673,
-0.10677574574947357,
-0.496418297290802,
-0.0014543692814186215,
0.7574774026870728,
-0.25502902269363403,
0.1282310336... | |
How can I build a loop in JavaScript?
**For loops**
```
for (i = startValue; i <= endValue; i++) {
// Before the loop: i is set to startValue
// After each iteration of the loop: i++ is executed
// The loop continues as long as i <= endValue is true
}
```
**For...in loops**
```
for (i in things) {
// If things is an array, i will usually contain the array keys *not advised*
// If things is an object, i will contain the member names
// Either | [
0.08225161582231522,
0.006099717691540718,
0.06809350848197937,
-0.09684817492961884,
-0.046754322946071625,
-0.09051022678613663,
0.6110324263572693,
-0.4897637665271759,
-0.1530619114637375,
-0.6689366698265076,
-0.12029432505369186,
0.1299448013305664,
-0.3589984178543091,
0.03959063813... | |
way, access values using: things[i]
}
```
It is bad practice to use `for...in` loops to itterate over arrays. It goes against the [ECMA 262](http://www.ecma-international.org/publications/standards/Ecma-262.htm) standard and can cause problems when non-standard attributes or methods are added to the Array object, e.g. by [Prototype](http://www.prototypejs.org/api/array).
*(Thanks to [Chase Seibert](https://stackoverflow.com/users/7679/chase-seibert) for pointing this out in the comments)*
**While loops**
```
while (myCondition) {
// The loop will continue until myCondition is false
}
``` | [
0.1626788228750229,
0.01643284782767296,
0.10135917365550995,
0.05939658731222153,
0.08150459080934525,
-0.2059076577425003,
0.4459822475910187,
-0.47262248396873474,
-0.4004281759262085,
-0.6171678900718689,
-0.13763059675693512,
0.20412024855613708,
-0.4470391869544983,
0.189209863543510... | |
I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose UI requires the use of a ComboBox control. Unfortunately, for devices with neither a hardware fullsize keyboard nor a touchscreen interface, there is no way to move (tab) from the ComboBox control to another control on the same form (say, specifying a product in the ComboBox and then moving to a text field to add a quantity).
I've tried creating an event handler for the ComboBox's KeyPress event and setting the focus to the next control manually whenever the user presses the Right or Left directional key | [
0.06696264445781708,
-0.27335819602012634,
0.31195956468582153,
-0.05871562287211418,
-0.08222993463277817,
-0.001939443638548255,
-0.014297365210950375,
-0.1602940559387207,
-0.023430483415722847,
-0.5974493622779846,
-0.06337035447359085,
0.6715465188026428,
-0.3255215585231781,
-0.15555... | |
but unfortunately the event handler does not capture those key presses.
Any ideas? I have a strong suspicion that this is being over-engineered and that there exists a better control more suited to what I need to do; I find it a bit inconceivable that tabbing out of a Combo Box control could be that difficult.
Thanks!
EDIT: Apparently I can capture the KeyDown and KeyUp events on the ComboBox, which allows me to set the focus or tab to the next control. Still over-engineered - still looking for ideas!
I believe directionals are only captured on `KeyDown` and `KeyUp`, not on `KeyPress`.
Alternatively to | [
0.24463364481925964,
-0.4010954797267914,
0.21550631523132324,
0.28235533833503723,
0.10510070621967316,
-0.02716590277850628,
0.25412872433662415,
0.060824498534202576,
-0.2888936996459961,
-0.5096402168273926,
0.045840319246053696,
0.7376706600189209,
-0.09843620657920837,
-0.31287491321... | |
using a ComboBox, you could use several RadioButtons if the numer of ListItems is static and relatively small. | [
0.44975534081459045,
-0.34618696570396423,
0.2840407192707062,
0.1726856678724289,
-0.15271486341953278,
-0.06525490432977676,
0.2284020483493805,
-0.6953188180923462,
-0.1374211460351944,
-0.29562637209892273,
-0.08283556997776031,
0.5834169387817383,
-0.5045967698097229,
-0.0482347123324... | |
We provide a web application with a frontend completely developed in Adobe Flash. When we chose Flash 6 years ago, we did so for its large number of features for user interaction, like dragging stuff, opening and closing menus, tree navigation elements, popup dialogs etc.
Today it's obvious that AJAX/JS offers roughly the same possibilities and because of the number of frameworks that are readily available, it's very feasible to implement them.
Is there a technical reason one should choose either technology over the other? By "technical", I mean performance, security, portability/compatibility and the like. I don't mean aspects such as the | [
0.3850478529930115,
0.360711932182312,
0.27594301104545593,
0.1478978544473648,
-0.08114244788885117,
-0.23381294310092926,
-0.1128930076956749,
0.20575781166553497,
0.051149412989616394,
-0.819607138633728,
-0.08671973645687103,
0.4464600384235382,
-0.08267880231142044,
-0.166242063045501... | |
very non-programmer way development is done in Flash or whether it makes sense to switch an app from one to the other.
As I just explained [in another question](https://stackoverflow.com/questions/52094/which-ria-technology-has-the-biggest-market-share), it seems to me that JS is way ahead in terms of market share and I'm wondering whether we are missing some important point if we stick to Flash.
* Correctly designed AJAX apps are more googleable than Flash
* Correctly designed AJAX apps are more easily deep linkable than Flash
* AJAX doesn't require a plugin (Flash is pretty ubiquitous, so it's not really a big deal)\*
* AJAX isn't controlled by a single company | [
0.371286541223526,
0.15809012949466705,
0.14428935945034027,
0.2026963233947754,
-0.17172829806804657,
-0.3226466178894043,
-0.031943224370479584,
0.2476569414138794,
-0.22150136530399323,
-0.4933030307292938,
-0.2862076163291931,
0.6609643697738647,
-0.12724603712558746,
-0.22208447754383... | |
the way Flash is
Edited to add:
\* Except for the iPhone, as Abdu points out. | [
0.1445876806974411,
0.06242681294679642,
-0.12900109589099884,
0.18218426406383514,
0.21881674230098724,
-0.3360719382762909,
0.05241319164633751,
0.3833719789981842,
-0.27771928906440735,
-0.2086990475654602,
-0.3591514527797699,
0.3352077901363373,
-0.36191433668136597,
-0.25643369555473... | |
How can I use the Prototype library and create unobtrusive javascript to inject the onmouseover and onmouseout events to each row, rather than putting the javascript in each table row tag?
An answer utilizing the Prototype library (instead of mootools, jQuery, etc) would be most helpful.
```
<table id="mytable">
<tbody>
<tr><td>Foo</td><td>Bar</td></tr>
<tr><td>Bork</td><td>Bork</td></tr>
</tbody>
</table>
<script type="text/javascript">
$$('#mytable tr').each(function(item) {
item.observe('mouseover', function() {
item.setStyle({ backgroundColor: '#ddd' });
});
item.observe('mouseout', function() { | [
0.041284721344709396,
-0.009271940216422081,
0.28290992975234985,
-0.03333144262433052,
0.016748296096920967,
0.33384788036346436,
0.1386512964963913,
-0.5878540873527527,
-0.1525939404964447,
-0.7167554497718811,
-0.09456820785999298,
0.2928953170776367,
-0.48985499143600464,
0.0092139048... | |
item.setStyle({backgroundColor: '#fff' });
});
});
</script>
``` | [
0.039767853915691376,
-0.3726291358470917,
0.5055851340293884,
-0.16369864344596863,
0.0443551167845726,
0.007881563156843185,
0.36855125427246094,
-0.2860262095928192,
-0.15101896226406097,
-0.6217226982116699,
-0.6540336012840271,
0.48417478799819946,
-0.4460192024707794,
0.0875368639826... | |
We are working with an oracle database in which the person that set it up is "long gone" and thus do not know the sysdba password, but need it. We have root access to the box (its on linux). Is there any way to recover or change the sys passwords?
Have you tried logging into Linux as your installed Oracle user then
```
sqlplus "/ as sysdba"
```
When you log in you'll be able to change your password.
```
alter user sys identified by <new password>;
```
Good luck :) | [
0.3258035182952881,
-0.01697516441345215,
-0.031085597351193428,
0.1695713847875595,
0.4035201668739319,
-0.17456485331058502,
0.12808072566986084,
0.13021165132522583,
-0.14405657351016998,
-0.48269587755203247,
-0.28487518429756165,
0.37294140458106995,
-0.19983993470668793,
0.0540129169... | |
Wrote the following in PowersHell as a quick iTunes demonstration:
```
$iTunes = New-Object -ComObject iTunes.Application
$LibrarySource = $iTunes.LibrarySource
foreach ($PList in $LibrarySource.Playlists)
{
write-host $PList.name
}
```
This works well and pulls back a list of playlist names.
However on trying to close iTunes a warning appears
> One or more applications are using the iTunes scripting interface. Are you sure you want to quit?
Obviously I can just ignore the message and press [Quit] or just wait the 20 seconds or so, but is there a clean way to tell iTunes that I've finished working with it?
```
Itunes 7.7.1, Windows XP
```
Here is one thing that I did on my | [
0.42824703454971313,
0.15295152366161346,
0.32511258125305176,
-0.0725909098982811,
0.29311805963516235,
-0.4558233916759491,
0.4490668773651123,
0.039929598569869995,
-0.3695072531700134,
-0.427104651927948,
0.025484241545200348,
1.0152904987335205,
-0.6680617928504944,
-0.164585009217262... | |
a Powershell script that adds podcasts to iTunes. I use Juice on a server to download all the podcasts that I listen to. The script uses .Net methods to release the COM objects. When I wrote my iTunes script I had read a couple of articles that stated you should release your COM objects using .NET.
```
[void][System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$LibrarySource)
[void][System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$iTunes)
```
I also run my scripts the majority of time from a shortcut, not from the powershell prompt.
Based on your comments, I did some testing and I determined that I would get the message when running against | [
0.22327759861946106,
0.23394380509853363,
0.3036859929561615,
0.09887156635522842,
0.0790005624294281,
-0.07796677201986313,
0.14863276481628418,
-0.07104693353176117,
-0.2156798392534256,
-0.7373568415641785,
-0.16817103326320648,
0.8380537629127502,
-0.359576940536499,
-0.123698152601718... | |
iTunes, if I ran my script in a way that leaves powershell running. iTunes seems to keep track of that. Running the script in a manner that exits it's process after running, eliminated the message.
One method of running your script from powershell, is to prefix your script with powershell.
```
powershell .\scriptname.ps1
```
The above command will launch your script and then exit the process that was used to run it, but still leaving you at the powershell prompt. | [
0.17480137944221497,
0.10526980459690094,
0.2297445833683014,
0.02952270209789276,
0.1292489916086197,
-0.2705521285533905,
0.3474825918674469,
0.4508515000343323,
-0.2849522531032562,
-0.8097580671310425,
-0.21847699582576752,
0.43546339869499207,
-0.17841558158397675,
0.0275267343968153,... | |
So, I know that try/catch does add some overhead and therefore isn't a good way of controlling process flow, but where does this overhead come from and what is its actual impact?
I'm not an expert in language implementations (so take this with a grain of salt), but I think one of the biggest costs is unwinding the stack and storing it for the stack trace. I suspect this happens only when the exception is thrown (but I don't know), and if so, this would be decently sized hidden cost every time an exception is thrown... so it's not like you | [
0.44197478890419006,
0.14280977845191956,
-0.22820700705051422,
0.1908753216266632,
0.14111721515655518,
-0.07578365504741669,
0.2605600655078888,
-0.017047718167304993,
-0.3217678666114807,
-0.4328617751598358,
0.23550666868686676,
0.32000696659088135,
-0.007063460070639849,
0.01952062174... | |
are just jumping from one place in the code to another, there is a lot going on.
I don't think it's a problem as long as you are using exceptions for EXCEPTIONAL behavior (so not your typical, expected path through the program). | [
0.7370691299438477,
-0.14215213060379028,
-0.42037931084632874,
0.41883841156959534,
0.18296308815479279,
-0.484722763299942,
0.4669935405254364,
0.22255124151706696,
-0.43840765953063965,
-0.26710909605026245,
0.13369663059711456,
0.3073318600654602,
-0.21878787875175476,
-0.4075504839420... | |
This question is kind of an add-on to this [question](https://stackoverflow.com/questions/44905/c-switch-statement-limitations-why)
In C#, a switch case cannot fall through to other cases, this causes a compilation error. In this case I am just adding some number to the month total for the selected month and each subsequent month thereafter. (simple example, not meant to be real)
```
switch (month)
{
case 0:
add something to month totals
case 1:
add something to month totals
case 2:
add something to month | [
0.24847838282585144,
-0.07411214709281921,
0.4563215374946594,
0.0171788539737463,
0.03899021074175835,
-0.11362668126821518,
-0.13706538081169128,
-0.02450762502849102,
-0.6777482628822327,
-0.30945584177970886,
-0.07566619664430618,
0.2855353057384491,
-0.05021931231021881,
0.14204572141... | |
totals
default:
break;
}
```
Is there a logical alternative to this in C# without having to write out a ton of if statements?
```
if (month <= 0)
add something to month
if (month <= 1)
add something to month
if (month <= 2)
add something to month
.... etc
```
Often times when you see the noise from a huge switch statement or many if statements that might fall into more than one block, you're trying to suppress a bad design.
Instead, what if you implemented the Specification pattern to see if something matched, and | [
0.37065809965133667,
-0.07552998512983322,
0.345996618270874,
0.10524707287549973,
-0.24447211623191833,
-0.2308221459388733,
-0.014109604991972446,
-0.2986074388027191,
-0.7334031462669373,
-0.1309661716222763,
0.1457088738679886,
0.12820567190647125,
-0.08137276023626328,
-0.062754936516... | |
then act on it?
```
foreach(MonthSpecification spec in this.MonthSpecifications)
{
if(spec.IsSatisfiedBy(month))
spec.Perform(month);
}
```
then you can just add up different specs that match what you're trying to do.
It's hard to tell what your domain is, so my example might be a little contrived. | [
0.35897397994995117,
-0.05696023628115654,
0.33310067653656006,
-0.08528978377580643,
0.10976624488830566,
0.14269785583019257,
0.023599829524755478,
-0.1966051161289215,
-0.2971470057964325,
-0.45611536502838135,
-0.18447384238243103,
0.5054677128791809,
-0.10332036018371582,
0.1846168637... | |
I have an application that reads a CSV file with piles of data rows. I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause `OutOfMemoryError`s. Each row translates into an object. Is there an easy way to find out the size of that object programmatically? Is there a reference that defines how large primitive types and object references are for a `VM`?
Right now, I have code that says read up to **32,000 rows**, but I'd also | [
0.6545901894569397,
0.4835633933544159,
0.3083394467830658,
0.04575425386428833,
-0.08576792478561401,
-0.03996219113469124,
0.12118187546730042,
-0.07873432338237762,
-0.3722045123577118,
-0.6570572853088379,
0.11229898780584335,
0.5002862215042114,
-0.22285495698451996,
0.343147665262222... | |
like to have code that says read as many rows as possible until I've used **32MB** of memory. Maybe that is a different question, but I'd still like to know.
You can use the [`java.lang.instrument` package](http://docs.oracle.com/javase/8/docs/api/java/lang/instrument/Instrumentation.html).
Compile and put this class in a JAR:
```
import java.lang.instrument.Instrumentation;
public class ObjectSizeFetcher {
private static Instrumentation instrumentation;
public static void premain(String args, Instrumentation inst) {
instrumentation = inst;
}
public static long getObjectSize(Object o) {
return instrumentation.getObjectSize(o);
}
}
```
Add | [
0.3200954794883728,
-0.05015189200639725,
0.48596787452697754,
0.01535908505320549,
0.1810438185930252,
0.47580447793006897,
-0.08017002791166306,
-0.6387019157409668,
-0.18629014492034912,
-0.4562242031097412,
0.15211687982082367,
0.4617026150226593,
-0.41836705803871155,
0.22818781435489... | |
the following to your `MANIFEST.MF`:
```
Premain-Class: ObjectSizeFetcher
```
Use the `getObjectSize()` method:
```
public class C {
private int x;
private int y;
public static void main(String [] args) {
System.out.println(ObjectSizeFetcher.getObjectSize(new C()));
}
}
```
Invoke with:
```
java -javaagent:ObjectSizeFetcherAgent.jar C
``` | [
-0.07264203578233719,
0.055814746767282486,
0.38671234250068665,
-0.33478978276252747,
0.2857455313205719,
-0.08131320774555206,
0.2204447239637375,
-0.2589583098888397,
-0.35351890325546265,
-0.5420664548873901,
-0.515091061592102,
0.5979492664337158,
-0.45324233174324036,
0.1724660247564... | |
What are the different ways (programmatically and otherwise) to determine what versions of .NET are running on a system?
Directly from the source:
*[How to determine which versions and service pack levels of the Microsoft .NET Framework are installed](http://support.microsoft.com/kb/318785)* | [
0.7133216857910156,
0.03899862989783287,
0.13112568855285645,
0.23870185017585754,
0.07014933228492737,
-0.1312023401260376,
0.2810377776622772,
0.09604889899492264,
0.008718201890587807,
-0.23445530235767365,
-0.3185741901397705,
0.26840272545814514,
-0.023547764867544174,
-0.099516898393... | |
I've been doing c# for a long time, and have never come across an easy way to just new up a hash.
I've recently become acquainted with the ruby syntax of hashes and wonder, does anyone know of a simple way to declare a hash as a literal, without doing all the add calls.
```
{ "whatever" => {i => 1}; "and then something else" => {j => 2}};
```
If you're using C# 3.0 (.NET 3.5) then you can use collection initializers. They're not quite as terse as in Ruby but still an improvement.
This example is based on the [MSDN Example](http://msdn.microsoft.com/en-us/library/bb531208.aspx)
```
var students = new | [
0.3902827501296997,
0.26427391171455383,
0.3650902211666107,
-0.28866592049598694,
-0.21479377150535583,
-0.28313422203063965,
0.18497484922409058,
-0.059004075825214386,
-0.3360275328159332,
-0.28634560108184814,
-0.07452558726072311,
0.539500892162323,
-0.10728918015956879,
0.10003919154... | |
Dictionary<int, StudentName>()
{
{ 111, new StudentName {FirstName="Sachin", LastName="Karnik", ID=211}},
{ 112, new StudentName {FirstName="Dina", LastName="Salimzianova", ID=317, }},
{ 113, new StudentName {FirstName="Andy", LastName="Ruth", ID=198, }}
};
``` | [
-0.10759488493204117,
0.061889536678791046,
0.35756799578666687,
-0.2906930446624756,
-0.06788136810064316,
0.6167508959770203,
0.4429633915424347,
0.13967333734035492,
0.02980518899857998,
-0.4363016188144684,
-0.24751298129558563,
0.479861319065094,
-0.25015589594841003,
0.32834249734878... | |
Can I return it as an object if I am doing a
```
Select OneItem from Table Where OtherItem = "blah"?
```
Is there a better way to do this?
I am building a constructor to return an object based on its name rather than its ID.
`query.UniqueResult<T>()` returns just one **T** | [
-0.15107618272304535,
0.20328810811042786,
0.13204172253608704,
0.19790875911712646,
-0.25466713309288025,
0.018372535705566406,
0.15044918656349182,
-0.2459913194179535,
-0.19097691774368286,
-0.5683780312538147,
0.010964736342430115,
0.358032763004303,
-0.07312798500061035,
0.20708446204... | |
I just started using GNU Emacs as my text editor and I am concerned about getting afflicted with "[Emacs Pinky](http://en.wikipedia.org/wiki/Emacs#Emacs_pinky)" by having to constantly press the control key with my pinky finger as is required when using Emacs. How can I avoid potentially getting this type of repetitive strain injury?
Making `caps lock` another control key is a good place to start. Invest in an ergonomic keyboard. Some emacs users even go as far as to get foot pedal things for control and meta... | [
0.10396510362625122,
0.2605572044849396,
0.23116981983184814,
0.1296021193265915,
0.04393282160162926,
0.302299827337265,
0.09464196860790253,
0.21417273581027985,
-0.3605416417121887,
-0.454123318195343,
0.3580527901649475,
0.7098404169082642,
-0.1870099902153015,
0.3072967529296875,
0.... | |
Although somewhat related to [this question](https://stackoverflow.com/questions/4409/is-the-desktop-app-dead), I have what I think is a different take on it.
Is a desktop app that has no connections to the "cloud" dead? I believe that some things are going to continue to be on the machine (operating systems obviously, browsers, some light-weight applications), but more and more things are moving to network-based applications (see Google Docs for office suites, GMail and other web-email clients for email, flickr for photo management, and more).
So other than the lightweight applications, is there anything that, in 5 to 10 years, will continue to be (either out of necessity | [
0.3167861998081207,
0.28399163484573364,
0.47838038206100464,
0.0821228101849556,
0.5623244643211365,
-0.14825661480426788,
0.03467822074890137,
0.4329036772251129,
-0.8474587202072144,
-0.6184797883033752,
-0.0729227364063263,
0.3563379943370819,
0.025807784870266914,
0.1554027944803238,
... | |
or just demand) remain on the desktop and off the cloud?
10 years or more ago this would have been, "Are non-internet applications dead?"
There's things the cloud does better than desktop applications, and in those places I'm sure non-cloud applications will become increasingly rare. But there's plenty of applications where you might not want to use the cloud, the benefits don't outweigh the costs, or the complexity just isn't worth it.
It's a new tool, and it's a better tool than desktop applications for many things. However, you don't throw away a hammer when you buy a screwdriver, you simply reserve it | [
0.8223717212677002,
0.11804567277431488,
0.19309577345848083,
0.1305912584066391,
0.11377747356891632,
0.1617475003004074,
0.0913139134645462,
0.0027744085527956486,
-0.4399970471858978,
-0.04409198835492134,
0.19691626727581024,
0.8761417865753174,
0.11286330223083496,
0.1686144918203354,... | |
for when a nail needs to be driven. | [
0.4337087869644165,
-0.016657695174217224,
0.018837634474039078,
-0.04309169203042984,
0.08288638293743134,
0.529446005821228,
-0.0003070159873459488,
-0.25114113092422485,
-0.25101277232170105,
-0.29152798652648926,
0.4228600561618805,
0.9640493392944336,
0.42675337195396423,
0.2089564353... | |
Anyone know this compiler feature? It seems GCC support that. How does it work? What is the potential gain? In which case it's good? Inner loops?
(this question is specific, not about optimization in general, thanks)
It works by placing extra code to count the number of times each codepath is taken. When you compile a second time the compiler uses the knowledge gained about execution of your program that it could only guess at before. There are a couple things PGO can work toward:
* Deciding which functions should be inlined or not depending on how often they are called.
* Deciding how | [
0.3311639726161957,
0.08436263352632523,
0.0736539214849472,
0.2733175456523895,
-0.07376860082149506,
-0.10904281586408615,
0.08946827799081802,
0.19262565672397614,
-0.3226391673088074,
-0.20417001843452454,
0.311694860458374,
0.7349916100502014,
-0.1631060093641281,
-0.2805129289627075,... | |
to place hints about which branch of an "if" statement should be predicted on based on the percentage of calls going one way or the other.
* Deciding how to optimize loops based on how many iterations get taken each time that loop is called.
You never really know how much these things can help until you test it. | [
0.6881203055381775,
-0.06913059204816818,
-0.25834935903549194,
0.3168869912624359,
0.01458694040775299,
0.2102208286523819,
0.4069993793964386,
-0.06775712221860886,
-0.006858730223029852,
-0.46567291021347046,
0.4536338746547699,
0.2998719811439514,
-0.055754851549863815,
-0.057235598564... | |
I'm trying to let an `<input type="text">` (henceforth referred to as “textbox”) fill a parent container by settings its `width` to `100%`. This works until I give the textbox a padding. This is then added to the content width and the input field overflows. Notice that in Firefox this only happens when rendering the content as standards compliant. In quirks mode, another box model seems to apply.
Here's a minimal code to reproduce the behaviour in all modern browsers.
```css
#x {
background: salmon;
padding: 1em;
}
#y, input {
background: red;
padding: 0 20px;
width: 100%;
}
```
```html
<div id="x">
<div | [
0.1512458771467209,
-0.010138584300875664,
0.37556082010269165,
-0.25097715854644775,
0.11372752487659454,
0.046307649463415146,
0.42677250504493713,
0.01480069663375616,
-0.29954642057418823,
-0.797254204750061,
-0.18992292881011963,
0.35350245237350464,
-0.3982592821121216,
-0.0028188850... | |
id="y">x</div>
<input type="text"/>
</div>
```
My question: **How do I get the textbox to fit the container?**
*Notice*: for the `<div id="y">`, this is straightforward: simply set `width: auto`. However, if I try to do this for the textbox, the effect is different and the textbox takes its default row count as width (even if I set `display: block` for the textbox).
EDIT: David's solution would of course work. However, I do not want to modify the HTML – I do especially not want to add dummy elements with no semantic functionality. This is a typical case of [divitis](http://en.wiktionary.org/wiki/Citations:divitis) that I want to avoid at | [
0.24417148530483246,
0.1296055018901825,
0.4549097716808319,
-0.17144647240638733,
-0.20835693180561066,
-0.05471700429916382,
0.2534087598323822,
-0.4099258780479431,
-0.15570178627967834,
-0.660751223564148,
-0.13514579832553864,
0.4396319091320038,
-0.35130977630615234,
0.16535133123397... | |
all cost. This can only be a last-resort hack.
With CSS3 you can use the box-sizing property on your inputs to standardise their box models.
Something like this would enable you to add padding and have 100% width:
```css
input[type="text"] {
-webkit-box-sizing: border-box; // Safari/Chrome, other WebKit
-moz-box-sizing: border-box; // Firefox, other Gecko
box-sizing: border-box; // Opera/IE 8+
}
```
Unfortunately this won't work for IE6/7 but the rest are fine ([Compatibility List](http://www.quirksmode.org/css/user-interface/)), so if you need to support these browsers your best bet would be Davids | [
0.3418179452419281,
-0.012747938744723797,
0.58310866355896,
-0.14880606532096863,
-0.06526504456996918,
-0.12856416404247284,
0.31809455156326294,
-0.3490127921104431,
-0.26952049136161804,
-0.8434345722198486,
-0.08884960412979126,
0.29677167534828186,
-0.4070778489112854,
-0.20231008529... | |
solution.
If you'd like to read more check out [this brilliant article by Chris Coyier](http://css-tricks.com/box-sizing/).
Hope this helps! | [
-0.06931799650192261,
-0.22447195649147034,
0.11549171060323715,
0.44732481241226196,
0.5280523300170898,
-0.20649375021457672,
0.4445457458496094,
-0.2487703412771225,
-0.33085721731185913,
-0.4217737019062042,
-0.06541332602500916,
0.02083081193268299,
-0.3433084785938263,
-0.61764544248... | |
I was wondering if anyone knew of any limitations to using Windows XP as a File and SQL server. I am asking because one of the applications we sell, requires the customer to setup a server for filesharing and as a SQL Server. We already allow them to use SQL Express, but we wanted to see if we can suggest Windows XP as a low cost alternative to Windows Server. The only potential problem that I could see if there were limits on the number of concurrent connections to either the files or the database. We are only thinking of | [
0.49522340297698975,
0.16413980722427368,
0.35449185967445374,
0.17298749089241028,
0.11204467713832855,
-0.11632722616195679,
-0.11393195390701294,
0.17157727479934692,
-0.3525364100933075,
-0.39508330821990967,
0.3124608099460602,
0.5112023949623108,
-0.12815700471401215,
0.2607658207416... | |
recommending this for smaller sized companies who would have 10-15 users.
There is a [limit of 10 inbound connections](http://support.microsoft.com/default.aspx?kbid=314882) on XP professional, and 5 on XP Home. So it would only be practicable for a very small company. | [
0.13527579605579376,
0.03843144699931145,
0.7555884122848511,
0.1132030338048935,
0.04447455331683159,
-0.06691871583461761,
0.4893856346607208,
-0.09792136400938034,
-0.13466189801692963,
-0.3064533770084381,
-0.21896058320999146,
0.4646744728088379,
-0.04738444834947586,
0.03145102784037... | |
Let's say you have a variable in a makefile fragment like the following:
```
MY_LIST=a b c d
```
How do I then reverse the order of that list? I need:
```
$(warning MY_LIST=${MY_LIST})
```
to show
```
MY_LIST=d c b a
```
Edit: the real problem is that
```
ld -r some_object.o ${MY_LIST}
```
produces an `a.out` with undefined symbols because the items in `MY_LIST` are actually archives, but in the wrong order. If the order of `MY_LIST` is reversed, it will link correctly (I think). If you know a smarter way to get the link order right, clue me in.
A solution in pure GNU make:
> default: all
>
>
> foo = please | [
0.19780118763446808,
0.013495037332177162,
0.10660044103860855,
-0.01352269109338522,
-0.05072696506977081,
-0.06127585843205452,
0.16282519698143005,
-0.17597602307796478,
-0.04356732591986656,
-0.47349679470062256,
0.0394047275185585,
0.5389755964279175,
-0.39407333731651306,
0.264112055... | |
reverse me
>
>
> reverse = $(if $(1),$(call
> reverse,$(wordlist 2,$(words
> $(1)),$(1)))) $(firstword $(1))
>
>
> all : @echo $(call reverse,$(foo))
Gives:
> $ make
>
>
> me reverse please | [
-0.5061429738998413,
0.2100423127412796,
0.541267991065979,
-0.605514407157898,
-0.10905489325523376,
0.7980457544326782,
0.5051984190940857,
-0.3002888262271881,
0.37724125385284424,
-0.2998957931995392,
-0.07850772142410278,
0.47950318455696106,
-0.40862518548965454,
0.15970629453659058,... | |
Has anyone encountered this oddity?
I'm checking for the existence of a number of directories in one of my unit tests. `is_dir` is reporting true (1) in spite of the folder not existing at the time it is called. The code looks like this (with a few extraneous intermediate vars to ease debugging):
```
foreach($userfolders as $uf) {
$uf = sprintf($uf, $user_id);
$uf = ltrim($uf,'/');
$path = trim($base . '/' . $uf);
$res = is_dir($path); //returns false except last time returns 1
$this->assertFalse($res, $path);
}
```
The machine running Ubuntu Linux | [
0.11321252584457397,
0.11673720926046371,
0.46640342473983765,
-0.24866770207881927,
0.09601269662380219,
-0.11095941066741943,
0.4511999785900116,
-0.03328251093626022,
0.05717988312244415,
-0.5097959637641907,
-0.16373322904109955,
0.6444152593612671,
-0.31745585799217224,
0.310028195381... | |
8.04 with PHP Version 5.2.4-2ubuntu5.3
Things I have checked:
```
- Paths are full paths
- The same thing happens on two separate machines (both running Ubuntu)
- I have stepped through line by line in a debugger
- Paths genuinely don't exist at the point where is_dir is called
- While the code is paused on this line, I can actually drop to a shell and run
```
the interactive PHP interpreter and get the correct result
- The paths are all WELL under 256 chars
- I can't imagine a permissions problem as the folder doesn't exist! The parent folder can't | [
0.07557553797960281,
-0.06094205006957054,
0.5806040167808533,
-0.10622569918632507,
-0.16378045082092285,
-0.24552397429943085,
0.7413883209228516,
-0.16831524670124054,
-0.04713428393006325,
-0.43736857175827026,
0.02965860441327095,
0.803601086139679,
-0.24796926975250244,
-0.0332040786... | |
be causing permissions problems as the other folders in the loop are correctly reported as missing.
Comments on the PHP docs point to the odd issue with `is_dir` but not this particular one.
I'm not posting this as a "please help me fix" but in the hope that somebody encountering the same thing can search here and *hopefully* an answer from somebody else who has seen this!
I don't think this would cause your problem, but $path does have the trailing slash, correct? | [
0.3283442258834839,
-0.1967824101448059,
-0.14454849064350128,
0.06599987298250198,
-0.19671833515167236,
-0.2531900107860565,
0.5314789414405823,
0.3515012562274933,
-0.27486157417297363,
-0.5789028406143188,
0.09365282207727432,
0.5224908590316772,
-0.33005908131599426,
0.204921633005142... | |
How do I discard changes in my working copy that are not in the index?
Another quicker way is:
```
git stash save --keep-index --include-untracked
```
You don't need to include `--include-untracked` if you don't want to be thorough about it.
After that, you can drop that stash with a `git stash drop` command if you like. | [
0.5535370111465454,
0.13125203549861908,
0.1505087912082672,
0.12411554902791977,
0.21320338547229767,
-0.33588331937789917,
0.06147080287337303,
-0.157439723610878,
-0.24539625644683838,
-0.3801679313182831,
-0.3109816014766693,
0.670859158039093,
-0.20399728417396545,
-0.2961154878139496... | |
I need to dynamically create a Video object in ActionScript 2 and add it to a movie clip. In AS3 I just do this:
```
var videoViewComp:UIComponent; // created elsewhere
videoView = new Video();
videoView.width = 400;
videoView.height = 400;
this.videoViewComp.addChild(videoView);
```
Unfortunately, I can't figure out how to accomplish this in AS2. Video isn't a child of MovieClip, so attachMovie() doesn't seem to be getting me anything. I don't see any equivalent to AS3's UIComponent.addChild() method either.
Is there any way to dynamically create a Video object in AS2 that actually shows up on the stage?
---
I potentially need multiple videos at a time though. | [
0.04634365811944008,
-0.2617857754230499,
0.7865908145904541,
-0.12847502529621124,
-0.3298470675945282,
-0.1504732221364975,
0.27540791034698486,
-0.49546685814857483,
-0.3099737763404846,
-0.6487318277359009,
-0.024982906877994537,
0.6561238169670105,
-0.16135653853416443,
-0.03198921680... | |
Is it possible to duplicate that video object?
I think I have another solution working. It's not optimal, but it fits with some of the things I have to do for other components so it's not too out of place in the project. Once I get it figured out I'll post what I did here.
Ok, I've got something working.
First, I created a new Library symbol and called it "VideoWrapper". I then added a single Video object to that with an ID of "video".
Now, any time I need to dynamically add a Video to my state I can use MovieClip.attachMovie() to add | [
0.7882146239280701,
-0.2676796317100525,
0.5888262391090393,
0.4161928594112396,
-0.11205746978521347,
-0.1429024636745453,
0.12430118024349213,
-0.009573058225214481,
-0.5050346255302429,
-0.6588892340660095,
0.3411002457141876,
0.41372933983802795,
-0.14624156057834625,
0.441641837358474... | |
a new copy of the Video object.
To make things easier I wrote a VideoWrapper class that exposes basic UI element handling (setPosition(), setSize(), etc). So when dealing with the Video in regular UI layout code I just use those methods so it looks just like all my other UI elements. When dealing with the video I just access the "video" member of the class.
My actual implementation is a bit more complicated, but that's the basics of how I got things working. I have a test app that's playing 2 videos, one from the local camera and one streaming from FMS, | [
0.4299785792827606,
-0.23972313106060028,
0.7797290682792664,
0.2509373426437378,
-0.24668337404727936,
-0.2894878089427948,
0.12738192081451416,
-0.38202786445617676,
-0.25514209270477295,
-0.655046284198761,
0.031705666333436966,
0.6725544929504395,
-0.20962423086166382,
0.06206262484192... | |
and it's working great. | [
0.5678634643554688,
0.3711504340171814,
0.09458890557289124,
-0.02703709341585636,
0.3116130828857422,
-0.0116178123280406,
0.18198378384113312,
0.3166116774082184,
0.1453591138124466,
-0.2787822484970093,
0.45664817094802856,
0.5117369890213013,
0.5021271705627441,
0.1067715734243393,
-... | |
I am using Windows, and I have two monitors.
Some applications will *always* start on my primary monitor, no matter where they were when I closed them.
Others will always start on the *secondary* monitor, no matter where they were when I closed them.
Is there a registry setting buried somewhere, which I can manipulate to control which monitor applications launch into by default?
@rp: I have Ultramon, and I agree that it is indispensable, to the point that Microsoft should buy it and incorporate it into their OS. But as you said, it doesn't let you control the default monitor a program launches | [
0.4374302327632904,
-0.20047183334827423,
0.4893836975097656,
0.08045709133148193,
0.2819928526878357,
-0.15262341499328613,
0.3096742033958435,
0.2776114344596863,
-0.2697311043739319,
-0.8188445568084717,
-0.0664115697145462,
0.7980655431747437,
-0.17677871882915497,
0.28712478280067444,... | |
into.
Correctly written Windows apps that want to save their location from run to run will save the results of [`GetWindowPlacement()`](http://msdn.microsoft.com/ru-ru/library/windows/desktop/ms633518%28v=vs.85%29.aspx) before shutting down, then use `SetWindowPlacement()` on startup to restore their position.
Frequently, apps will store the results of `GetWindowPlacement()` in the registry as a `REG_BINARY` for easy use.
The `WINDOWPLACEMENT`route has many advantages over other methods:
* Handles the case where the screen resolution changed since the last run: `SetWindowPlacement()` will automatically ensure that the window is not entirely offscreen
* Saves the state (minimized/maximized) but also saves the restored (normal) size and position
* Handles desktop metrics correctly, compensating for the taskbar position, | [
0.18870572745800018,
-0.1082262396812439,
0.6812741160392761,
-0.1801370233297348,
0.34458479285240173,
-0.028427934274077415,
0.5957481265068054,
-0.01255086250603199,
0.0215328186750412,
-1.0070880651474,
-0.6417336463928223,
0.6595520973205566,
-0.10035406798124313,
0.08783029019832611,... | |
etc. (i.e. uses "workspace coordinates" instead of "screen coordinates" -- techniques that rely on saving screen coordinates may suffer from the "walking windows" problem where a window will always appear a little lower each time if the user has a toolbar at the top of the screen).
Finally, programs that handle window restoration properly will take into account the `nCmdShow` parameter passed in from the shell. This parameter is set in the shortcut that launches the application (Normal, Minimized, Maximize):
```
if(nCmdShow != SW_SHOWNORMAL)
placement.showCmd = nCmdShow; //allow shortcut to override
```
For non-Win32 applications, it's important to be sure that the | [
-0.02032819204032421,
-0.10038597881793976,
0.6318408846855164,
-0.02507593482732773,
0.37079373002052307,
-0.16261160373687744,
0.2645239531993866,
-0.1939910650253296,
-0.40138429403305054,
-0.7148117423057556,
-0.32066795229911804,
0.810076117515564,
-0.24330197274684906,
0.055968318134... | |
method you're using to save/restore window position eventually uses the same underlying call, otherwise (like Java Swing's `setBounds()`/`getBounds()` problem) you'll end up writing a lot of extra code to re-implement functionality that's already there in the `WINDOWPLACEMENT` functions. | [
0.0020582491997629404,
-0.2027805894613266,
0.3954471945762634,
0.020207811146974564,
-0.14623022079467773,
-0.1199386715888977,
0.16246138513088226,
-0.3592400550842285,
-0.15480580925941467,
-0.6747481226921082,
-0.18964563310146332,
0.42309269309043884,
-0.25778627395629883,
-0.05783558... | |
I think this is specific to IE 6.0 but...
In JavaScript I add a `div` to the DOM. I assign an `id` attribute. When I later try to pick up the `div` by the `id` all I get is `null`.
Any suggestions?
Example:
```
var newDiv = document.createElement("DIV");
newDiv.setAttribute("ID", "obj_1000");
document.appendChild(newDiv);
alert("Added:" + newDiv.getAttribute("ID") + ":" + newDiv.id + ":" + document.getElementById("obj_1000") );
```
Alert prints `"::null"`
Seems to work fine in Firefox 2.0+
In addition to what the other answers suggest (that you need to actually insert the element into the DOM for it to be found via `getElementById()`), you also need to use a lower-case attribute name in order for | [
0.03535149618983269,
0.05224309489130974,
0.5587278008460999,
-0.4358295202255249,
0.07846886664628983,
-0.20855773985385895,
0.365872859954834,
-0.5782613754272461,
-0.008156818337738514,
-0.6397353410720825,
-0.45979413390159607,
0.8124739527702332,
-0.3925909996032715,
-0.03421363234519... | |
IE6 to recognize it as the `id`:
```
var newDiv = document.createElement("DIV");
newDiv.setAttribute("id", "obj_1000");
document.body.appendChild(newDiv);
alert("Added:"
+ newDiv.getAttribute("id")
+ ":" + newDiv.id + ":"
+ document.getElementById("obj_1000") );
```
...responds as expected:
```
Added:obj_1000:obj_1000:[object]
```
---
According to the [MSDN documentation](http://msdn.microsoft.com/en-us/library/ms536739(VS.85).aspx) for `setAttribute()`, up to IE8 there is an optional *third parameter* that controls whether or not it is case sensitive with regard to the attribute name. Guess what the default is... | [
-0.10448210686445236,
0.010223479941487312,
0.7134511470794678,
-0.2601790130138397,
0.011494830250740051,
-0.22878314554691315,
0.28447428345680237,
-0.20208658277988434,
0.03940071165561676,
-0.6725390553474426,
-0.5514461398124695,
0.6214519143104553,
-0.07751762121915817,
-0.1682397425... | |
I've had a Windows app in production for a while now, and have it set up to send us error reports when it throws exceptions. Most of these are fairly descriptive and help me find the problem very quickly (I use the MS Application Exception Block).
On a few occasions I have reports that are issues that I can't reproduce, and seem to only happen on a few client machines.
I don't have physical access to these client machines, what are some strategies I can use for debugging? Would it be better to build some tracing into the code, or | [
0.5020325779914856,
0.28895828127861023,
-0.023390430957078934,
0.2129235416650772,
0.07423494011163712,
-0.06577984243631363,
0.4621953070163727,
0.18238532543182373,
-0.37146976590156555,
-0.42659270763397217,
0.2961522042751312,
0.3364027142524719,
-0.2509126365184784,
-0.05780920013785... | |
are there some other alternatives?
Thank you.
Edit: I should have been more clear: The error reports that I get do have the stack trace, but since it's production code, it doesn't indicate the exact line that caused the exception, just the method in which it was thrown.
One option is to generate a (mini-)dump file as close to the point where the exception is thrown as possible. This [article](http://blogs.microsoft.co.il/blogs/sasha/archive/2008/05/28/programmatically-generating-a-dump-file.aspx) talks about how to do this from managed code.
You could then load the dump file into Visual Studio or WinDbg and examine it with the aid of [SOS](http://dotnetdebug.net/2006/03/20/loading-and-using-sos-from-within-visual-studio/) | [
0.3730478882789612,
-0.10125282406806946,
-0.25020185112953186,
0.09840615093708038,
-0.24660229682922363,
-0.2251550406217575,
0.14871037006378174,
-0.24668309092521667,
-0.2986840605735779,
-0.3050004541873932,
-0.17451585829257965,
0.3443518579006195,
-0.1981572061777115,
-0.22586357593... | |
I've noticed that Visual Studio 2008 is placing square brackets around column names in sql. Do the brackets offer any advantage? When I hand code T-SQL I've never bothered with them.
Example:
Visual Studio:
```
SELECT [column1], [column2] etc...
```
My own way:
```
SELECT column1, column2 etc...
```
The brackets are required if you use keywords or special chars in the column names or identifiers. You could name a column `[First Name]` (with a space) – but then you'd need to use brackets every time you referred to that column.
The newer tools add them everywhere just in case or for consistency. | [
0.37905353307724,
0.15916886925697327,
0.11328107863664627,
-0.07921389490365982,
-0.5094865560531616,
0.0014835712499916553,
-0.10671944916248322,
-0.4394747018814087,
-0.052565526217222214,
-0.35185500979423523,
0.22152221202850342,
0.7353171110153198,
-0.12296881526708603,
-0.0233778785... | |
Where I work, the design and development departments are totally separated, however we (the design department) are responsible for managing the CSS for our sites. Typically, new CSS needs to be released to the production server far more often than new website code. Because of this, we are deploying the CSS separately, and it lives outside source control.
However, lately, we've run into a few problems with new CSS not being synched for up site releases, and in general the process is a huge headache. I've been pushing to get the CSS under some kind of source control, but having trouble | [
0.9226845502853394,
0.6110020279884338,
-0.09231214225292206,
-0.17332974076271057,
0.04896402731537819,
-0.22670815885066986,
-0.07015428692102432,
0.15524880588054657,
-0.2297515720129013,
-0.48485204577445984,
-0.02084966003894806,
0.4060257077217102,
-0.018476538360118866,
0.2010482847... | |
finding a good deployment method that makes everyone happy. Our biggest problem is managing changes that affect current portions of the site, where the CSS changes need to go live before the site changes, but not break anything on the exisiting site.
I won't go into the finer details of the weird culture between designers and devs here, but I was wondering what experience others have had in managing large amounts of CSS (50+ files, thousands and thousands of lines) that needs to be constantly updated and released independent of site releases.
I'll advocate the use of source control here. Especially if | [
0.5179845690727234,
0.14450028538703918,
0.0028925505466759205,
0.23912890255451202,
0.07624316960573196,
-0.3270711600780487,
0.25364944338798523,
0.3129156529903412,
-0.31441840529441833,
-0.6819817423820496,
0.10878917574882507,
0.405331552028656,
-0.13381606340408325,
-0.02413957938551... | |
the development team uses branching to deal with structured releases. That way, whatever CSS is checked into the production branch is what should be deployed ... and if it is updated mid-stream, it's the responsibility of the person (designer?) that updates it to promote that code using whatever system your company uses to promote changes to production. | [
0.6061896085739136,
0.023341717198491096,
-0.12443514913320541,
0.16929100453853607,
0.16645227372646332,
-0.29179811477661133,
-0.09458474069833755,
0.22840377688407898,
-0.18998485803604126,
-0.2699207067489624,
-0.5067746639251709,
0.45538923144340515,
0.23098254203796387,
-0.1345053464... | |
TFS2008. I'd like to track task points on a Task work item, but there isn't anywhere (other than the description) to record this. I'd like to add a dropdown with 0, 1, 2, 3, 5, 8, etc, so these task points can be exported in reports.
Use the process template editor, available as part of the [Visual Studio Team System 2008 Team Foundation Server Power Tools](http://msdn.microsoft.com/en-ca/tfs2008/bb980963.aspx). | [
-0.18092456459999084,
-0.2638143002986908,
0.10995335131883621,
-0.09959457814693451,
-0.12544013559818268,
-0.0753868818283081,
0.22646170854568481,
-0.15395937860012054,
-0.439391553401947,
-0.7685766220092773,
-0.22349166870117188,
0.42669975757598877,
-0.17881658673286438,
-0.293599843... | |
So, I have 2 database instances, one is for development in general, another was copied from development for unit tests.
Something changed in the development database that I can't figure out, and I don't know how to see what is different.
When I try to delete from a particular table, with for example:
```
delete from myschema.mytable where id = 555
```
I get the following normal response from the unit test DB indicating no row was deleted:
> SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
However, the development database fails to delete at | [
0.05213990435004234,
0.21549876034259796,
0.06554506719112396,
0.038861073553562164,
-0.04183328151702881,
0.20364683866500854,
0.2490299791097641,
-0.28176194429397583,
-0.12893255054950714,
-0.6566091179847717,
0.059959325939416885,
0.4228390157222748,
-0.0850585326552391,
0.540017962455... | |
all with the following error:
> DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0440N No authorized routine named "=" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884
My best guess is there is some trigger or view that was added or changed that is causing the problem, but I have no idea how to go about finding the problem... has anyone had this problem or know how to figure out what the root of the problem is?
(note that this is a DB2 database)
Hmm, applying | [
0.07727977633476257,
0.15710557997226715,
0.33240383863449097,
0.016731401905417442,
0.07418300211429596,
0.12806816399097443,
0.5372997522354126,
-0.32691246271133423,
-0.2578830420970917,
-0.09022140502929688,
-0.086505226790905,
0.5642527937889099,
-0.569387674331665,
0.0965251326560974... | |
the great oracle to this question, I came up with:
<http://bytes.com/forum/thread830774.html>
It seems to suggest that another table has a foreign key pointing at the problematic one, when that FK on the other table is dropped, the delete should work again. (Presumably you can re-create the foreign key as well)
Does that help any? | [
-0.04405532404780388,
0.26158520579338074,
0.2955847978591919,
0.19790658354759216,
-0.2780827581882477,
0.07225710898637772,
0.06448732316493988,
0.32662439346313477,
-0.2692914605140686,
-0.18132618069648743,
0.36969664692878723,
0.17713706195354462,
-0.01231949869543314,
0.1573210358619... | |
I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema.
I can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for example) columns are editable. I know I can write an UPDATE statement or create some code to update it. But I'm looking for something more flexible that will let power users edit the XML directly.
Any ideas?
> Reiterating again: Please don't answer
> I can write an application. I know
> | [
0.38599300384521484,
0.19006982445716858,
0.22641195356845856,
0.08059565722942352,
-0.13858118653297424,
-0.12180125713348389,
0.03794337809085846,
-0.17481203377246857,
-0.2648564279079437,
-0.7869537472724915,
0.18952809274196625,
0.39176100492477417,
-0.36163952946662903,
0.22144311666... | |
that, And that is exactly what I'm
> trying to avoid.
This is an old question, but I needed to do this today. The best I can come up with is to write a query that generates SQL code that can be edited in the query editor - it's sort of lame but it saves you copy/pasting stuff.
Note: you may need to go into Tools > Options > Query Results > Results to Text and set the maximum number of characters displayed to a large enough number to fit your XML fields.
e.g.
```
select 'update [table name] set [xml field name] = | [
0.06501000374555588,
0.2520372271537781,
0.2901515066623688,
0.06247904896736145,
-0.11869051307439804,
0.024089142680168152,
-0.0028586196713149548,
-0.010967478156089783,
-0.1923503279685974,
-0.6390764117240906,
0.17851030826568604,
0.4877612590789795,
-0.2201038897037506,
-0.0689093694... | |
''' +
convert(varchar(max), [xml field name]) +
''' where [primary key name] = ' +
convert(varchar(max), [primary key name]) from [table name]
```
which produces a lot of queries that look like this (with some sample table/field names):
```
update thetable set thedata = '<root><name>Bob</name></root>' where thekey = 1
```
You then copy these queries from the results window back up to the query window, edit the xml strings, and then run the queries.
(Edit: changed 10 to max to avoid error) | [
0.018141455948352814,
-0.07562660425901413,
0.7886635065078735,
0.010715835727751255,
-0.06839088350534439,
0.172882080078125,
0.3042306900024414,
-0.20603489875793457,
-0.019897352904081345,
-0.651716947555542,
-0.24682874977588654,
0.7788757085800171,
-0.3631037771701813,
0.1286638379096... | |
I have a file that I want to include in Python but the included file is fairly long and it'd be much neater to be able to split them into several files but then I have to use several include statements.
Is there some way to group together several files and include them all at once?
1. Put files in one folder.
2. Add \_\_init\_\_.py file to the folder. Do necessary imports in \_\_init\_\_.py
3. Replace multiple imports by one:
import folder\_name
See [Python Package Management](http://docs.python.org/tut/node8.html#SECTION008400000000000000000) | [
0.48506903648376465,
0.0973581001162529,
-0.0394422747194767,
-0.13346314430236816,
-0.05083354562520981,
-0.03882346674799919,
0.05852404981851578,
-0.3450402319431305,
-0.4747982621192932,
-0.5650038719177246,
-0.12665702402591705,
0.38413017988204956,
-0.47892120480537415,
-0.1748602241... | |
In python, there are some special variables and filenames that are surrounded by double-underscores. For example, there is the
```
__file__
```
variable. I am only able to get them to show up correctly inside of a code block. What do I need to enter to get double underscores in regular text without having them interpreted as an emphasis?
\_\_file\_\_
Put a backslash before the first underscore.
Like this:
```
\__file__
``` | [
0.4708439111709595,
0.25264328718185425,
-0.17011338472366333,
-0.41609105467796326,
-0.22807499766349792,
-0.07736075669527054,
0.2510150074958801,
0.20552735030651093,
-0.25688278675079346,
-0.08150478452444077,
-0.2507060170173645,
0.589435338973999,
-0.5252928733825684,
-0.355205297470... | |
When I drag & drop a dll to the assembly folder on vista, I get the error "Access is denied: mydll.dll". How can I bypass the error message and add my dll to gac?
My guess would be that you have to do it as an administrator...try either disabling UAC, or using gacutil.exe to add your assembly. | [
0.4188460409641266,
-0.012299962341785431,
0.29312723875045776,
-0.06909021735191345,
0.020550338551402092,
-0.2864547669887543,
0.2941887080669403,
0.1302582174539566,
-0.22415925562381744,
-0.8171725273132324,
-0.0007064014789648354,
0.6173734068870544,
-0.4247300326824188,
0.72915494441... | |
I want to embed an .asp page on an html page. I cannot use an iframe. I tried:
```
<object width="100%" height="1500" type="text/html" data="url.asp">
alt : <a href="url.asp">url</a>
</object>"
```
works great in ff but not ie7. Any ideas? Is it possible to use the object tag to embed .asp pages for IE or does it only work in ff?
I've solved it in the past using Javascript and XMLHttp. It can get a bit hacky depending on the circumstances. In particular, you have to watch out for the inner page failing and how it affects/downgrades the outer one (hopefully you can keep it downgrading elegantly).
Search for | [
0.23004989326000214,
-0.00031397840939462185,
0.4869200885295868,
-0.05459403991699219,
-0.3128832280635834,
0.1896715611219406,
0.4183962643146515,
-0.2319095879793167,
-0.2498578578233719,
-0.975077211856842,
0.18414950370788574,
0.6081590056419373,
-0.17216506600379944,
-0.1161597222089... | |
XMLHttp (or check [this great tutorial](http://www.jibbering.com/2002/4/httprequest.html)) and request the "child" page from the outer one, rendering the HTML you need. Preferably you can get just the specific data you need and process it in Javascript. | [
-0.03584166243672371,
-0.13574835658073425,
0.2797975540161133,
0.1286112666130066,
-0.32723692059516907,
-0.1452953815460205,
-0.31342813372612,
0.02672390639781952,
0.027788033708930016,
-0.6160651445388794,
-0.5727034211158752,
0.1967487782239914,
-0.2671698331832886,
-0.036392554640769... | |
I have a table similar to this:
```
CREATE TABLE example (
id integer primary key,
name char(200),
parentid integer,
value integer);
```
I can use the parentid field to arrange data into a tree structure.
Now here's the bit I can't work out. Given a parentid, is it possible to write an SQL statement to add up all the value fields under that parentid and recurse down the branch of the tree ?
**UPDATE:** I'm using posgreSQL so the fancy MS-SQL features are not available to me. In any case, I'd like this to be treated as a generic SQL question.
BTW, | [
0.026865893974900246,
0.1822187751531601,
0.08210965991020203,
-0.06185764819383621,
-0.023550843819975853,
-0.07863117009401321,
-0.0000511504513269756,
-0.0010946784168481827,
-0.11634965986013412,
-0.5033971071243286,
0.06387409567832947,
0.28958603739738464,
-0.3137494921684265,
0.1532... | |
I'm very impressed to have 6 answers within 15 minutes of asking the question! Go stack overflow!
There are a few ways to do what you need in PostgreSQL.
* If you can install modules, look at the tablefunc contrib. It has a connectby() function that handles traversing trees. <http://www.postgresql.org/docs/8.3/interactive/tablefunc.html>
* Also check out the ltree contrib, which you could adapt your table to use: <http://www.postgresql.org/docs/8.3/interactive/ltree.html>
* Or you can traverse the tree yourself with a PL/PGSQL function.
Something like this:
```
create or replace function example_subtree (integer)
returns setof example as
'declare results record;
child record;
begin
select into | [
0.285908579826355,
0.023835856467485428,
0.2946932911872864,
0.12531158328056335,
-0.10396115481853485,
0.1465136557817459,
0.3003627359867096,
-0.25791534781455994,
-0.4323512017726898,
-0.6928927302360535,
-0.019772430881857872,
0.4891883432865143,
-0.19844111800193787,
0.087585315108299... | |
results * from example where parent_id = $1;
if found then
return next results;
for child in select id from example
where parent_id = $1
loop
for temp in select * from example_subtree(child.id)
loop
return next temp;
end loop; | [
-0.036628637462854385,
-0.26116958260536194,
0.11840076744556427,
-0.16067740321159363,
0.1591288298368454,
0.4522058963775635,
0.3217568099498749,
-0.32509249448776245,
-0.18222856521606445,
-0.6249240636825562,
-0.30731400847435,
0.08606790751218796,
-0.16231173276901245,
0.1633822023868... | |
end loop;
end if;
return null;
end;' language 'plpgsql';
select sum(value) as value_sum
from example_subtree(1234);
``` | [
-0.07819048315286636,
0.05396798625588417,
0.24911271035671234,
-0.36372485756874084,
0.18462476134300232,
0.03775766119360924,
0.5825669169425964,
-0.21823789179325104,
-0.20123353600502014,
-0.027355005964636803,
-0.5364103317260742,
0.27148160338401794,
-0.5671262741088867,
0.3178071379... | |
What are good ways of dealing with the issues surrounding plugin code that interacts with outside system?
To give a concrete and representative example, suppose I would like to use Subversion and Eclipse to develop plugins for WordPress. The main code body of WordPress is installed on the webserver, and the plugin code needs to be available in a subdirectory of that server.
I could see how you could simply checkout a copy of your code directly under the web directory on a development machine, but how would you also then integrate this with the IDE?
I am making the assumption here that | [
0.42563435435295105,
0.016962699592113495,
0.0259215347468853,
0.24863559007644653,
-0.16688737273216248,
-0.21672537922859192,
0.05996627360582352,
0.21835899353027344,
-0.03093588910996914,
-0.7269290685653687,
0.04522206634283066,
0.5112219452857971,
-0.34758996963500977,
-0.12667609751... | |
all the code for the plugin is located under a single directory.
Do most people just add the plugin as a project in an IDE and then place the working folder for the project wherever the 'main' software system wants it to be? Or do people use some kind of symlinks to their home directory?
There are a few ways to do what you need in PostgreSQL.
* If you can install modules, look at the tablefunc contrib. It has a connectby() function that handles traversing trees. <http://www.postgresql.org/docs/8.3/interactive/tablefunc.html>
* Also check out the ltree contrib, which you could adapt your table to use: <http://www.postgresql.org/docs/8.3/interactive/ltree.html>
* | [
0.3520330786705017,
0.011024883948266506,
0.24703550338745117,
0.18423698842525482,
-0.03849964588880539,
-0.10267867147922516,
0.09332747757434845,
-0.13120925426483154,
-0.5551703572273254,
-0.7529011964797974,
-0.2730410099029541,
0.2915348708629608,
-0.34404823184013367,
-0.05007438361... | |
Or you can traverse the tree yourself with a PL/PGSQL function.
Something like this:
```
create or replace function example_subtree (integer)
returns setof example as
'declare results record;
child record;
begin
select into results * from example where parent_id = $1;
if found then
return next results;
for child in select id from example
where parent_id = $1
loop
for | [
0.09241732209920883,
-0.13439740240573883,
0.015898283571004868,
-0.07635892927646637,
0.26108574867248535,
0.3126780688762665,
0.48010045289993286,
-0.2532099485397339,
-0.34920644760131836,
-0.5586434006690979,
-0.08830767869949341,
0.10067977756261826,
-0.2259661704301834,
0.25486382842... | |
temp in select * from example_subtree(child.id)
loop
return next temp;
end loop;
end loop;
end if;
return null;
end;' language 'plpgsql';
select sum(value) as value_sum
from example_subtree(1234);
``` | [
-0.011283466592431068,
0.017325595021247864,
0.26571133732795715,
-0.1704254150390625,
0.10957133024930954,
0.3662750720977783,
0.4459870159626007,
-0.42734211683273315,
-0.10020744800567627,
-0.4016793966293335,
-0.4140377640724182,
0.17477594316005707,
-0.4038977324962616,
0.109098315238... | |
I have a webapp that uses JNDI lookups to get a connection to the database.
The connection works fine and returns the query no problems. The issue us that the connection does not close properly and is stuck in the 'sleep' mode (according to mysql administrator). This means that they become unusable nad then I run out of connections.
Can someone give me a few pointers as to what I can do to make the connection return to the pool successfully.
```
public class DatabaseBean {
private static final Logger logger = Logger.getLogger(DatabaseBean.class);
private Connection conn;
private PreparedStatement prepStmt;
/**
* Zero argument constructor
* Setup generic databse | [
0.2706579267978668,
-0.032709602266550064,
0.2233608365058899,
0.024950161576271057,
0.16646762192249298,
-0.23614460229873657,
0.45796239376068115,
-0.22080640494823456,
-0.2216314673423767,
-0.766190230846405,
0.10778408497571945,
0.7043157815933228,
-0.2740878164768219,
0.51035606861114... | |
connection in here to avoid redundancy
* The connection details are in /META-INF/context.xml
*/
public DatabaseBean() {
try {
InitialContext initContext = new InitialContext();
DataSource ds = (DataSource) initContext.lookup("java:/comp/env/jdbc/mysite");
conn = ds.getConnection();
}
catch (SQLException SQLEx) {
logger.fatal("There was a problem with the database connection.");
logger.fatal(SQLEx);
logger.fatal(SQLEx.getCause()); | [
-0.52054363489151,
-0.15738941729068756,
0.212967649102211,
0.15966983139514923,
0.09286122024059296,
-0.07996504753828049,
0.2569091022014618,
-0.023893050849437714,
-0.17148357629776,
-0.43366411328315735,
-0.1509810984134674,
0.203670933842659,
-0.49329254031181335,
0.4712734520435333,
... | |
}
catch (NamingException nameEx) {
logger.fatal("There was a naming exception");
logger.fatal(nameEx);
logger.fatal(nameEx.getCause());
}
}
/**
* Execute a query. Do not use for statements (update delete insert etc).
*
* @return A ResultSet of the execute query. A set of size zero if no results were returned. It is never null.
* @see #executeUpdate() for running update, insert delete etc.
*/
public ResultSet executeQuery() {
ResultSet result = null;
try | [
0.09362427145242691,
-0.3266453742980957,
0.010297040455043316,
-0.056712180376052856,
-0.01116819866001606,
0.040732938796281815,
0.34579232335090637,
-0.231207475066185,
-0.18051347136497498,
-0.20238745212554932,
-0.0668739303946495,
0.33394116163253784,
-0.4983868896961212,
0.348764568... | |
{
result = prepStmt.executeQuery();
logger.debug(prepStmt.toString());
}
catch (SQLException SQLEx) {
logger.fatal("There was an error running a query");
logger.fatal(SQLEx);
}
return result;
}
```
*SNIP*
```
public void close() {
try {
prepStmt.close();
prepStmt = null;
conn.close(); | [
0.06897574663162231,
-0.11714320629835129,
0.27539676427841187,
-0.18884947896003723,
0.15503908693790436,
-0.006464285310357809,
0.5583676099777222,
-0.19925493001937866,
0.07612758129835129,
-0.06404217332601547,
-0.24442891776561737,
0.38717085123062134,
-0.47120463848114014,
0.32071506... | |
conn = null;
} catch (SQLException SQLEx) {
logger.warn("There was an error closing the database connection.");
}
}
}
```
This is inside a javabean that uses the database connection.
```
public LinkedList<ImportantNoticeBean> getImportantNotices() {
DatabaseBean noticesDBBean = new DatabaseBean();
LinkedList<ImportantNoticeBean> listOfNotices = new LinkedList<ImportantNoticeBean>();
try {
PreparedStatement preStmt = noticesDBBean.getConn().prepareStatement("SELECT pseudonym, message, date_to, date_from " +
"FROM importantnotices, users | [
-0.11379819363355637,
0.052829232066869736,
0.5177702903747559,
-0.30689355731010437,
0.22811895608901978,
-0.1529695987701416,
0.3316136300563812,
-0.15962836146354675,
-0.3267786204814911,
-0.6574534773826599,
-0.10981171578168869,
0.32948780059814453,
-0.392886757850647,
0.3420067131519... | |
" +
"WHERE importantnotices.username = users.username " +
"AND NOW() >= date_from AND NOW() <= date_to;");
noticesDBBean.setPrepStmt(preStmt);
ResultSet result = noticesDBBean.executeQuery();
while (result.next()) {
ImportantNoticeBean noticeBean = new ImportantNoticeBean(); | [
-0.20285193622112274,
-0.25194451212882996,
0.9778334498405457,
-0.533785879611969,
0.19521403312683105,
0.017980432137846947,
0.35886380076408386,
-0.36256101727485657,
-0.4295123517513275,
-0.5096491575241089,
-0.31075048446655273,
0.2689606845378876,
-0.30779632925987244,
0.374263644218... | |
noticeBean.setAuthor(result.getString("pseudonym"));
noticeBean.setMessage(result.getString("message"));
noticeBean.setDateTo(result.getDate("date_to"));
noticeBean.setDateFrom(result.getDate("date_from"));
listOfNotices.add(noticeBean);
}
result.close();
} catch (SQLException SQLEx) {
logger.error("There was an error in ImportantNoticesBean.getImportantNotices()");
logger.error(SQLEx);
} | [
0.06346548348665237,
-0.12346136569976807,
0.5486177206039429,
-0.3985564410686493,
0.26865339279174805,
-0.04938695207238197,
0.26664504408836365,
-0.2631256580352783,
-0.22997653484344482,
-0.20505587756633759,
-0.3802735507488251,
0.18346987664699554,
-0.46522217988967896,
0.16774694621... | |
finally {
noticesDBBean.close();
}
return listOfNotices;
}
<Context reloadable="true">
<Resource name="jdbc/mysite"
auth="Container"
type="javax.sql.DataSource"
username="user"
password="password"
driverClassName="com.mysql.jdbc.Driver" | [
-0.08388794958591461,
0.05449387803673744,
0.7141616940498352,
-0.2548094689846039,
-0.1159653589129448,
0.0025942481588572264,
0.011356945149600506,
-0.05363469943404198,
-0.28350669145584106,
-0.6193178296089172,
-0.10762081295251846,
0.34816399216651917,
-0.2792148292064667,
0.173495978... | |
url="jdbc:mysql://localhost:3306/mysite"
maxActive="10"
maxIdle="5"
maxWait="6000"
removeAbandoned="true"
logAbandoned="false"
removeAbandonedTimeout="20" | [
0.012197636067867279,
0.0376606285572052,
0.5443338751792908,
-0.004837162792682648,
0.2163126915693283,
0.26348671317100525,
0.5671787261962891,
0.09132679551839828,
-0.3886188268661499,
-0.5542005300521851,
-0.41364356875419617,
0.4359705150127411,
0.10610499233007431,
0.4607856869697571... | |
/>
</Context>
```
> The issue us that the connection does not close properly and is stuck in the 'sleep' mode
This was actually only half right.
The problem I ran into was actually that each app was defining a new connection to the database sever. So each time I closed all the connections App A would make a bunch of new connections as per it's WEB.xml config file and run happily. App B would do the same. The problem is that they are *independent pools* which try to grab up to the server defined limit. It is a kind of | [
0.37092453241348267,
-0.04061548411846161,
0.6581522226333618,
0.00643376586958766,
0.05823192000389099,
-0.005605494603514671,
0.2932144105434418,
-0.07937797904014587,
-0.5133583545684814,
-0.4269746243953705,
0.1291000097990036,
0.3376981317996979,
-0.5178712606430054,
0.135323449969291... | |
race condition I guess. So when App A has finished with the connections it sits waiting to to use them again until the timeout has passed while App B who needs the connection now is denied the resources even though App A has finished with the and should be back in the pool. Once the timeout has passed, the connection is freed up and B (or C etc) can get at it again.
e.g. if the limit is 10 (mySQL profile limit) and each app has been configured to use a max of 10 the there will be 20 attempts at | [
0.21225257217884064,
-0.26480239629745483,
0.289975643157959,
0.18309395015239716,
0.2366226464509964,
0.1682562530040741,
0.4542432725429535,
-0.15293027460575104,
-0.23975470662117004,
-0.5946754217147827,
0.2788885235786438,
0.6172313690185547,
-0.3343188762664795,
-0.30337950587272644,... | |
connections. Obviously this is a bad situation.
The solution is to RTFM and put the [connection details in the right place](http://tomcat.apache.org/tomcat-5.5-doc/config/context.html). This does make shared posting a pain but there are ways around it (such as linking to other xml files from the context).
Just to be explicit: I put the connection details in the WEB.xml for each app and the had a fight about it. | [
0.05209965258836746,
0.23478448390960693,
0.6962454319000244,
0.19851990044116974,
-0.06162744387984276,
-0.38212355971336365,
0.29349103569984436,
-0.041632916778326035,
-0.49764296412467957,
-0.7835054993629456,
-0.12995606660842896,
0.6726372838020325,
-0.2927286624908447,
0.00327045237... | |
I know that we shouldn't being using the registry to store Application Data anymore, but in updating a Legacy application (and wanting to do the fewest changes), what Registry Hives are non-administrators allowed to use?
Can I access all of `HKEY_CURRENT_USER` (the application currently access `HKEY_LOCAL_MACHINE`) without Administrator privileges?
In general, a non-administrator user has this access to the registry:
Read/Write to:
* `HKEY_CURRENT_USER`
Read Only:
* `HKEY_LOCAL_MACHINE`
* `HKEY_CLASSES_ROOT` (which is just a *link* to `HKEY_LOCAL_MACHINE\Software\Classes`)
It is possible to change some of these permissions on a key-by-key basis, but it's extremely rare. You should not have to worry about that.
For your purposes, your application should | [
0.32958027720451355,
0.3803609311580658,
0.22522976994514465,
0.31401005387306213,
0.3399333357810974,
-0.16729854047298431,
0.12205454707145691,
-0.04619637131690979,
-0.5158374905586243,
-0.5779047012329102,
-0.062129221856594086,
0.4871990978717804,
-0.12735354900360107,
0.3785442113876... | |
be writing settings and configuration to `HKEY_CURRENT_USER`. The canonical place is anywhere within `HKEY_CURRENT_USER\Software\YourCompany\YourProduct\`
You could potentially hold settings that are global (for all users) in `HKEY_LOCAL_MACHINE`. It is very rare to need to do this, and you should avoid it. The problem is that any user can "read" those, but only an administrator (or by extension, your setup/install program) can "set" them.
Other common source of trouble: your application should not write to anything in the `Program files` or the `Windows` directories. If you need to write to files, there are several options at hand; describing all of them would be | [
0.08796451985836029,
0.4059242904186249,
0.39076197147369385,
0.06653114408254623,
0.3410642147064209,
-0.2748975157737732,
0.4261283278465271,
0.23273597657680511,
-0.3436291515827179,
-0.9166960716247559,
-0.23411056399345398,
0.8928467035293579,
-0.3125947415828705,
-0.01728005893528461... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.