text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I am looking for a way to edit data and have values dynamically calculated (i.e. totals, averages, etc.) My application is a web based gradebook system for teachers and one of the big challenges is allowing them to enter/update grades. The most natural solution for this type of data is a table or spreadsheet grid and m... | [
0.2622752785682678,
0.04380105435848236,
0.036073848605155945,
0.5245895981788635,
0.0177607461810112,
0.004914331249892712,
0.16906210780143738,
0.35458794236183167,
-0.26825565099716187,
-0.604409396648407,
0.2612079381942749,
0.196079283952713,
0.008229134604334831,
-0.08250594139099121... | |
% and possibly their letter grade. It doesn't have to feed these calculations back to the server (they are just for show) but the cell changes do have to be saved (via AJAX).
I know this should probably be a FAQ and I found these two answers ([1](https://stackoverflow.com/questions/271276/what-is-the-easiest-way-to-di... | [
-0.010992074385285378,
0.2637149393558502,
0.36270445585250854,
-0.09298872947692871,
-0.16068050265312195,
0.0750814899802208,
0.0695376843214035,
-0.34955450892448425,
0.004625423811376095,
-0.5638226866722107,
0.057321637868881226,
0.20721474289894104,
-0.06989950686693192,
-0.090128861... | |
must be open source.
Any hints? Right now I'm looking at [TableKit](http://www.millstream.com.au/view/code/tablekit) & [Rico LiveGrid](http://openrico.org/) but I'm not sure they can do the row & column calculations that I need.
After searching for something lightweight and easy to use I have given up and am writing m... | [
0.6610879898071289,
0.30202290415763855,
0.252003937959671,
-0.08082722127437592,
0.03097010776400566,
-0.03495924919843674,
0.09579112380743027,
0.15449658036231995,
-0.162488654255867,
-0.684105634689331,
0.11388792842626572,
0.23693490028381348,
-0.11724700778722763,
0.00473550660535693... | |
I'm trying to build my own custom django form widgets (putting them in widgets.py of my project directory). What should the value "value\_from\_datadict()" return? Is it returning a string or the actual expected value of the field?
I'm building my own version of a split date/time widget using JQuery objects, what shou... | [
0.4706307649612427,
-0.1062418520450592,
0.3989708125591278,
-0.09088614583015442,
-0.10610344260931015,
-0.23822960257530212,
-0.04805546626448631,
0.06041507050395012,
-0.33291906118392944,
-0.2738904058933258,
0.09094812721014023,
0.43436399102211,
-0.15460114181041718,
-0.0628065988421... | |
able to build a DatePicker widget by just providing a `render` method:
```
DATE_FORMAT = '%m/%d/%y'
class DatePickerWidget(widgets.Widget):
def render(self, name, value, attrs=None):
if value is None:
vstr = ''
elif hasattr(value, 'strftime'):
vstr = datetime_safe.new_datet... | [
-0.14751309156417847,
-0.32534945011138916,
0.6417682766914368,
-0.04481004923582077,
0.13771434128284454,
-0.18843314051628113,
0.30440089106559753,
-0.03873784840106964,
0.016045240685343742,
-0.6882306337356567,
-0.19931462407112122,
0.5404286980628967,
-0.11426212638616562,
-0.15034441... | |
id = "id_%s" % name
args = [
"<input type=\"text\" value=\"%s\" name=\"%s\" id=\"%s\" />" % \
(vstr, name, id),
"<script type=\"text/javascript\">$(\"#%s\").datepicker({dateFormat:'mm/dd/y'});</script>" % id
]
return mark_safe("\n".join(args))
``` | [
-0.0018814837094396353,
-0.06585107743740082,
0.7421895861625671,
-0.20463421940803528,
0.42938339710235596,
-0.004173581954091787,
0.11416417360305786,
-0.29136568307876587,
-0.1107093021273613,
-0.650097668170929,
-0.16599631309509277,
0.12657171487808228,
-0.08037689328193665,
0.3307178... | |
I want to run a console application that will output a file.
I user the following code:
```
Process barProcess = Process.Start("bar.exe", @"C:\foo.txt");
```
When this runs the console window appears. I want to hide the console window so it is not seen by the user.
Is this possible? Is using Process.Start the best... | [
0.24795155227184296,
0.25799527764320374,
0.6695483326911926,
-0.5261930227279663,
0.333097904920578,
0.13032208383083344,
0.3121975362300873,
-0.18830402195453644,
0.06219124794006348,
-0.7651922106742859,
-0.3515649139881134,
0.5104499459266663,
-0.35344409942626953,
0.43863096833229065,... | |
ProcessStartInfo psi = new ProcessStartInfo(@"bar.exe");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.RedirectStandardInput = true;
psi.CreateNoWindow = true;
p.StartInfo = psi;
p.Start();
```
This will st... | [
0.007565091829746962,
0.015237784013152122,
0.7393197417259216,
-0.11528521031141281,
0.36986684799194336,
-0.008568094111979008,
0.24646660685539246,
-0.30993974208831787,
-0.03417004644870758,
-0.6672767400741577,
-0.36541661620140076,
0.5420129895210266,
-0.12253891676664352,
0.35714244... | |
I have a Python-based app that can accept a few commands in a simple read-eval-print-loop. I'm using `raw_input('> ')` to get the input. On Unix-based systems, I also `import readline` to make things behave a little better. All this is working fine.
The problem is that there are asynchronous events coming in, and I'd ... | [
0.1663406491279602,
-0.009062154218554497,
0.09374381601810455,
-0.0391436330974102,
-0.24342402815818787,
0.11158900707960129,
0.20826256275177002,
0.22877287864685059,
-0.15671652555465698,
-0.7248862385749817,
-0.010466373525559902,
0.6887557506561279,
-0.3044969141483307,
0.05191585049... | |
text-in-progress after printing something.
This seems like it must be a solved problem. What's the proper way to do this?
Also note that some of my users are Windows-based.
TIA
Edit: The accepted answer works under Unixy platforms (when the readline module is available), but if anyone knows how to make this work un... | [
0.2983476519584656,
0.04270216077566147,
0.39176005125045776,
0.011864964850246906,
0.08823768049478531,
-0.11011330783367157,
0.3315018117427826,
0.16389256715774536,
-0.08669586479663849,
-0.583193302154541,
-0.07613588869571686,
0.7109684944152832,
-0.324239581823349,
-0.032062988728284... | |
print(PROMPT, readline.get_line_buffer(), sep='', end='')
def cli():
while True:
cli = str(raw_input(PROMPT))
if __name__ == '__main__':
threading.Thread(target=cli).start()
threading.Timer(2, interrupt).start()
```
I don't think that stdin is thread-safe, so you can end up losing characters to ... | [
0.08664479106664658,
0.07306624203920364,
0.5916528701782227,
-0.29644301533699036,
0.3125841021537781,
0.07923518866300583,
0.3542650640010834,
0.045151907950639725,
-0.24949440360069275,
-0.5752151608467102,
-0.0814482718706131,
0.5518273115158081,
-0.2614611089229584,
0.1846052408218383... | |
got multiple interrupting threads of execution, this can still end up looking gross. | [
1.064345121383667,
0.1028764471411705,
0.29325658082962036,
0.24960410594940186,
-0.20618018507957458,
-0.1555650234222412,
0.40410110354423523,
0.4203822910785675,
-0.5039236545562744,
-0.6300082206726074,
0.3526247441768646,
0.03944794088602066,
-0.1852949857711792,
0.3768252432346344,
... | |
I currently have a download site for my school that is based in .net. We offer anything from antivirus, autocad, spss, office, and a number of large applications for students to download. It's currently setup to handle them in 1 of 2 ways; anything over 800 megs is directly accessable through a seperate website while u... | [
0.4972202777862549,
0.08067957311868668,
0.2162286788225174,
0.31038373708724976,
-0.05357832461595535,
-0.060739852488040924,
0.11870027333498001,
0.30387139320373535,
-0.12155445665121078,
-0.6959024667739868,
-0.11862015724182129,
0.22673682868480682,
0.28659141063690186,
0.208430677652... | |
site just can't handle it, and the smaller files will often fail. Is there a better approach to this?
edit - I just wanted to update on how I finally solved this: I ended up adding my download directory as a virtual directory in iis and specified custom http handler. The handler grabbed the file name from the request ... | [
0.5773134231567383,
0.02618052437901497,
0.34960663318634033,
-0.05547623336315155,
-0.21066069602966309,
-0.11128457635641098,
0.5315161943435669,
0.28340864181518555,
-0.3590312600135803,
-0.6342862844467163,
0.18637125194072723,
0.3186091184616089,
-0.19728918373584747,
0.34887817502021... | |
in size.
I have two recommendations:
* Increase the buffer size so that there are less iterations
AND/OR
* Do not call IsClientConnected on each iteration.
The reason is that according to [Microsoft Guidelines](http://technet.microsoft.com/en-us/library/bb727078.aspx#EMAA):
*Response.IsClientConnected has some c... | [
-0.02980075776576996,
-0.3000665605068207,
0.4589405655860901,
0.3224855661392212,
0.10228285193443298,
-0.24502868950366974,
0.23957619071006775,
0.09329083561897278,
-0.6050425171852112,
-0.5462714433670044,
-0.11251910030841827,
-0.007943712174892426,
-0.2769811153411865,
0.121952116489... | |
In [this](https://stackoverflow.com/questions/428859/what-goes-in-your-domain-model-objects-and-what-goes-in-your-services) question someone [replies](https://stackoverflow.com/questions/428859/what-goes-in-your-domain-model-objects-and-what-goes-in-your-services#428902) "You never let the domain object implementations... | [
0.04600434750318527,
-0.017950892448425293,
0.5676588416099548,
0.1693708896636963,
0.0468323715031147,
-0.3693099319934845,
0.39928221702575684,
-0.10937241464853287,
-0.28643420338630676,
-0.6933988332748413,
-0.26231756806373596,
0.46803364157676697,
-0.41479867696762085,
0.312538594007... | |
public Bitmap Image {get; set;}
public Guid ThumbPrintId {get; set;}
public bool FindThumbPrintMatch() {
// Would you call the service from here?
ThumbPrintId = _thumbPrintService.FindMatch(this.Image);
return ! ThumbPrintId.CompareTo(Guid.Empty);
}
}
public class RoboCopUserImageServ... | [
0.10207018256187439,
-0.3051406443119049,
0.5054978728294373,
-0.15267787873744965,
0.2484496533870697,
0.22850120067596436,
0.5125251412391663,
-0.22882892191410065,
-0.06690207868814468,
-0.6731213927268982,
-0.2232937067747116,
0.798160970211029,
-0.38603660464286804,
0.0386439859867095... | |
userImage.ThumbPrintId = _thumbPrintService.FindMatch(userImage.Image);
return !userImage.ThumbPrintId.CompareTo(Guid.Empty);
}
}
```
What is avoided or gained by not letting domain objects call services themselves?
**EDIT:** Are there any good online articles that discuss this specific topi... | [
0.006244885269552469,
0.08219891041517258,
0.5218876600265503,
0.10464192181825638,
-0.19943277537822723,
-0.3105146884918213,
0.30597010254859924,
-0.25527381896972656,
-0.34126827120780945,
-0.4061945676803589,
-0.21164754033088684,
0.7421562075614929,
-0.33281150460243225,
-0.1071298718... | |
at odds with the OO tenet](https://stackoverflow.com/questions/169450/arent-information-expert-tell-dont-ask-at-odds-with-single-responsibility-pri) of [Tell, Don't Ask](http://c2.com/cgi/wiki?TellDontAsk). My feeling on the subject has oscillated, and I have settled on the following conditions when logic should go int... | [
0.22697876393795013,
0.06109759211540222,
0.47426173090934753,
0.08101073652505875,
-0.07516085356473923,
-0.171673983335495,
-0.12149230390787125,
-0.6032125353813171,
-0.10568089783191681,
-0.34397053718566895,
-0.014073667116463184,
0.731574296951294,
-0.12239161133766174,
0.13687434792... | |
using a getter](http://moffdub.wordpress.com/2008/12/10/getters-and-setters-a-people-problem/), think twice.
In your situation, I'd opt against putting the call to the service inside the entity object, mainly because the service doesn't seem like it is related to your domain, but more related to persistence. Domain ob... | [
0.04167751595377922,
-0.10757572948932648,
0.11366105079650879,
0.14536216855049133,
-0.009093529544770718,
-0.22606445848941803,
0.32401975989341736,
-0.17549866437911987,
-0.4916200339794159,
-0.65806645154953,
-0.06205020844936371,
0.5234161615371704,
-0.4947153925895691,
0.188599929213... | |
acceptable to have domainObject.moveToNextState() (assuming this code "makes sense" in your ubiquitous language) call the service that talks to your server because the workflow server manages a part of the domain model.
I'll add that DDD is very interested with following the language of the domain. Do you hear domain ... | [
0.27582231163978577,
0.04375266283750534,
0.4061843454837799,
0.07524869590997696,
-0.2780188024044037,
-0.3197105824947357,
0.4244328439235687,
0.1949469894170761,
-0.09173596650362015,
-0.8067336082458496,
-0.1959437131881714,
0.4646279811859131,
-0.2848994731903076,
0.31945914030075073,... | |
about this issue a lot because it is central to design):
* In the Evans DDD book, an Account
entity has methods like
credit(Amount), debit(Amount), transferTo(Account, Amount) and
accrue(), but a FundsTransferService has a transfer(Account, Account, Amount) method. The transferTo method doesn't call any service, but m... | [
0.1467110812664032,
-0.04820454120635986,
0.2128443568944931,
0.27394068241119385,
0.21834564208984375,
-0.19201867282390594,
-0.12582331895828247,
-0.11748664826154709,
-0.1412097066640854,
-0.2570936381816864,
0.09231241792440414,
0.656849205493927,
0.07082358747720718,
0.090344667434692... | |
UserImage, significant domain logic that can fit in the object itself might be scarce because it isn't, as far as I can tell, an Aggregate. Aggregates, I think, present more of an opportunity to house domain logic. The Account example is likely an Aggregate. | [
-0.2461419552564621,
0.15089668333530426,
0.1854778677225113,
0.36690810322761536,
-0.06575695425271988,
0.18156270682811737,
0.13165873289108276,
0.3597671687602997,
-0.2987631857395172,
-0.6272643208503723,
0.02069750428199768,
0.5348653197288513,
-0.1627376824617386,
0.09011553972959518... | |
I have an .exe I want to start when the Win2k3 server boots. Does .exe needs to be setup as a custom service. If so, what is the process to setup the custom service?
I assume you don't really mean at boot time (you would have to write a driver service for that) but rather at user mode system start up.
If your process... | [
0.3624282777309418,
-0.10255967825651169,
0.2482103556394577,
0.0030157887376844883,
-0.21840399503707886,
-0.28622737526893616,
0.21042229235172272,
-0.05809298902750015,
-0.09672030806541443,
-0.7579334378242493,
-0.014472701586782932,
0.565199613571167,
-0.2995331883430481,
0.1003461927... | |
shutdown, warned of system events such as power events or shutdown, etc. then you should probably look to convert it to a Win32 service.
If you do need to convert to a service then start reading [here](http://msdn.microsoft.com/en-us/library/ms685141(VS.85).aspx) and then continue with something like [Richter's](http... | [
0.15746775269508362,
0.09510312229394913,
0.24394819140434265,
0.039619483053684235,
0.07524556666612625,
-0.46073469519615173,
0.4669341444969177,
-0.14402687549591064,
-0.201088085770607,
-0.45575422048568726,
-0.4670742452144623,
0.6623417139053345,
-0.30419689416885376,
0.1351383030414... | |
There seem to be many excellent web frameworks for Python. Has anyone used any of these (Pylons, Web2Py, Django) with IronPython?
Django [has been run on IronPython](http://unbracketed.org/2008/mar/16/pycon-2008-django-now-plays-dark-side/) before, but as a proof-of-concept. I know the IronPython team are interested in... | [
0.14507579803466797,
0.4370926022529602,
0.009768564254045486,
-0.14409847557544708,
-0.3773643374443054,
-0.23441250622272491,
0.27920001745224,
0.0745348334312439,
-0.18232376873493195,
-0.31918126344680786,
0.07935244590044022,
0.5548296570777893,
-0.19960139691829681,
-0.09329417347908... | |
I've models for `Books`, `Chapters` and `Pages`. They are all written by a `User`:
```
from django.db import models
class Book(models.Model)
author = models.ForeignKey('auth.User')
class Chapter(models.Model)
author = models.ForeignKey('auth.User')
book = models.ForeignKey(Book)
class Page(models.Model)... | [
0.47526514530181885,
0.5101508498191833,
0.3967829644680023,
0.056584347039461136,
0.19551147520542145,
0.07973684370517731,
0.17214550077915192,
-0.1555691808462143,
0.07814497500658035,
-0.6782799959182739,
0.18087352812290192,
0.4258090853691101,
-0.22897738218307495,
0.0582742132246494... | |
look at a `Page` - not only will the new `Pages` need to have their `author` field updated but they will also need to point to the new `Chapter` objects!
Does Django support an out of the box way of doing this? What would a generic algorithm for duplicating a model look like?
Cheers,
John
---
Update:
The classes ... | [
-0.12024480849504471,
0.23023518919944763,
0.24933749437332153,
0.026610566303133965,
-0.2913398742675781,
-0.15070337057113647,
0.3132345378398895,
-0.22988325357437134,
-0.5360854864120483,
-0.4378356337547302,
-0.1252281367778778,
0.31452903151512146,
-0.4448164999485016,
0.025942085310... | |
ForeignKey
def duplicate(obj, value, field):
"""
Duplicate all related objects of `obj` setting
`field` to `value`. If one of the duplicate
objects has an FK to another duplicate object
update that as well. Return the duplicate copy
of `obj`.
"""
collected_objs = CollectedObjects()
... | [
-0.27758318185806274,
0.03796831890940666,
0.24780337512493134,
0.04124099388718605,
0.19586262106895447,
0.07220630347728729,
0.26705440878868103,
0.09449665993452072,
-0.5040169358253479,
-0.370384156703949,
-0.24998071789741516,
0.304938405752182,
-0.6276237368583679,
0.2861537635326385... | |
for model in reversed(related_models):
# Find all FKs on `model` that point to a `related_model`.
fks = []
for f in model._meta.fields:
if isinstance(f, ForeignKey) and f.rel.to in related_models:
fks.append(f)
# Replace each `sub_obj` with a duplicate. | [
-0.37646299600601196,
-0.10715111345052719,
0.5679483413696289,
-0.10132444649934769,
-0.12714169919490814,
0.4359084367752075,
-0.055079229176044464,
-0.28022533655166626,
-0.374984472990036,
-0.4311356246471405,
-0.05032339692115784,
0.1730910986661911,
-0.6432818174362183,
0.44358623027... | |
sub_obj = collected_objs[model]
for pk_val, obj in sub_obj.iteritems():
for fk in fks:
fk_value = getattr(obj, "%s_id" % fk.name)
# If this FK has been duplicated then point to the duplicate.
if fk_value in collected_objs[fk.rel.to]: | [
-0.17195437848567963,
-0.15638424456119537,
0.47546258568763733,
0.15515784919261932,
-0.2513226568698883,
0.4536440968513489,
0.19224600493907928,
-0.20660655200481415,
-0.6998437643051147,
-0.26352012157440186,
-0.11780593544244766,
-0.18371547758579254,
-0.30862900614738464,
0.199101492... | |
dupe_obj = collected_objs[fk.rel.to][fk_value]
setattr(obj, fk.name, dupe_obj)
# Duplicate the object and save it.
obj.id = None
setattr(obj, field, value)
obj.save() | [
-0.1246899738907814,
-0.17883475124835968,
0.2288452684879303,
0.13603398203849792,
0.04649361968040466,
0.4454585909843445,
0.6344619989395142,
-0.07517986744642258,
-0.4714624881744385,
-0.3490099608898163,
-0.1227184608578682,
0.06168392300605774,
-0.6799672842025757,
0.1443032324314117... | |
if root_obj is None:
root_obj = obj
return root_obj
```
**For django >= 2** there should be some minimal changes. so the output will be like this:
```
def duplicate(obj, value=None, field=None, duplicate_order=None):
"""
Duplicate all related objects of obj setting
field to value. If ... | [
-0.11906807869672775,
0.39333823323249817,
0.37525272369384766,
-0.3255372941493988,
0.0023001679219305515,
0.02420627325773239,
0.25758346915245056,
0.19130240380764008,
-0.5728559494018555,
-0.5421184301376343,
0.07523975521326065,
0.281288206577301,
-0.5596689581871033,
0.20049406588077... | |
well. Return the duplicate copy
of obj.
duplicate_order is a list of models which specify how
the duplicate objects are saved. For complex objects
this can matter. Check to save if objects are being
saved correctly and if not just pass in related objects
in the order that they should be saved.
... | [
0.2697891294956207,
0.22963473200798035,
0.21076872944831848,
-0.10525749623775482,
0.2826331853866577,
0.067619688808918,
0.21663640439510345,
-0.3994849920272827,
-0.4263555705547333,
-0.5257478356361389,
0.120497927069664,
0.30952781438827515,
-0.35167863965034485,
0.34718817472457886,
... | |
collector.sort()
related_models = collector.data.keys()
data_snapshot = {}
for key in collector.data.keys():
data_snapshot.update(
{key: dict(zip([item.pk for item in collector.data[key]], [item for item in collector.data[key]]))})
root_obj = None
# Sometimes it's good enough ju... | [
-0.20700772106647491,
-0.24557048082351685,
0.3243803083896637,
0.3635174632072449,
0.2655099332332611,
0.3055451214313507,
0.11209233105182648,
-0.16874726116657257,
-0.8306863903999329,
-0.8267335891723633,
-0.02173805981874466,
0.3326551616191864,
-0.3551153540611267,
0.6283289790153503... | |
# Find all FKs on model that point to a related_model.
fks = []
for f in model._meta.fields:
if isinstance(f, ForeignKey) and f.remote_field.related_model in related_models:
fks.append(f)
# Replace each `sub_obj` with a duplicate.
if model not in collector.dat... | [
-0.33514896035194397,
-0.05935873091220856,
0.3736227750778198,
0.1352037638425827,
-0.17131160199642181,
0.44304898381233215,
0.13587333261966705,
-0.211635023355484,
-0.554726779460907,
-0.5035697221755981,
0.14648251235485077,
-0.07905851304531097,
-0.5974735021591187,
0.654037356376648... | |
continue
sub_objects = collector.data[model]
for obj in sub_objects:
for fk in fks:
fk_value = getattr(obj, "%s_id" % fk.name)
# If this FK has been duplicated then point to the duplicate. | [
-0.024784300476312637,
-0.0719156488776207,
0.49769434332847595,
-0.15748010575771332,
0.11618387699127197,
0.2851382791996002,
0.5760653018951416,
-0.038513053208589554,
-0.6180557012557983,
-0.392483651638031,
-0.1362711489200592,
-0.10524668544530869,
-0.3188001811504364,
0.584638535976... | |
fk_rel_to = data_snapshot[fk.remote_field.related_model]
if fk_value in fk_rel_to:
dupe_obj = fk_rel_to[fk_value]
setattr(obj, fk.name, dupe_obj)
# Duplicate the object and save it. | [
-0.3439244031906128,
0.03099762834608555,
0.42672252655029297,
-0.024115057662129402,
0.04118635877966881,
0.4292285442352295,
0.5128170251846313,
-0.09397617727518082,
-0.33879387378692627,
-0.24397650361061096,
-0.1270190328359604,
0.012819470837712288,
-0.41869860887527466,
0.3955188691... | |
obj.id = None
if field is not None:
setattr(obj, field, value)
obj.save()
if root_obj is None:
root_obj = obj
return root_obj
``` | [
-0.42559680342674255,
0.20442816615104675,
0.27927589416503906,
-0.38693565130233765,
0.2618928551673889,
0.4149807095527649,
0.5503669381141663,
0.03382043167948723,
-0.2745228111743927,
-0.6434171199798584,
-0.4477194845676422,
0.43565070629119873,
-0.30151474475860596,
0.061694674193859... | |
Very direct question, i need to know if its possible and maybe where to start reading about that. Im a programmer with zero experience in windows servers and a client is asking if we can deliver in their windows boxes(and no they wont let us use any kind of virtualization in them).
Thanks guys, i know its not 100% pro... | [
0.36266934871673584,
-0.014983105473220348,
0.09972809255123138,
0.422245055437088,
0.0042201499454677105,
-0.30036142468452454,
0.44205179810523987,
0.2568533420562744,
0.3495728075504303,
-0.7303280830383301,
0.10603294521570206,
0.8553311228752136,
0.11408386379480362,
-0.24044245481491... | |
I looked in [Stevens](http://www.google.com/search?q=advanced+programming+in+the+unix+environment&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a), and in the [Posix Programmer's Guide](https://rads.stackoverflow.com/amzn/click/com/0937175730), and the best I can find is
> An array of strings ca... | [
0.19770915806293488,
0.11595895886421204,
0.6453896164894104,
-0.013392546214163303,
0.3420862853527069,
-0.24100361764431,
0.09132970869541168,
-0.4950709342956543,
-0.24888163805007935,
-0.39079365134239197,
-0.24287773668766022,
0.2753596901893616,
-0.14816424250602722,
0.08777966350317... | |
the 'static initialization' of *environ* precedes all the other static initialization code. Am I overthinking this?
Update
======
On *my* platform (AMD Opteron, Redhat 4, GCC 3.2.3), setting **LD\_DEBUG** shows that *environ* gets set *before* my static initializers are called. This is a nice thing to know; thanks, @... | [
0.4617139399051666,
-0.12877614796161652,
0.3289271593093872,
0.14767296612262726,
0.07401220500469208,
-0.3067152202129364,
0.27755263447761536,
-0.1511349380016327,
-0.08880537003278732,
-0.6059637069702148,
-0.20551060140132904,
0.5749359726905823,
-0.2949627637863159,
-0.17370837926864... | |
are called, bonus points!
I think you can run your program with LD\_DEBUG set to see the exact order:
```
LD_DEBUG=all <myprogram>
```
**EDIT:**
If you look at the source code of the runtime linker (glibc 2.7), specifically in files:
* sysdeps/unix/sysv/linux/init-first.c
* sysdeps/i386/init-first.c
* csu/libc-sta... | [
0.15456163883209229,
-0.15302695333957672,
0.5789995193481445,
0.007392433006316423,
0.1252461075782776,
-0.13050617277622223,
-0.21349716186523438,
-0.1721462905406952,
-0.35815826058387756,
-0.690981388092041,
-0.3255552053451538,
0.25324538350105286,
-0.15641333162784576,
-0.09757344424... | |
beginning of the process initialization. This backed by the linker code, which does the same, should give you sufficient peace of mind :-)
**EDIT 2:** Also worth mentioning is that environ is set early enough that even the runtime linker can query it to determine whether or not to output verbosely (LD\_DEBUG). | [
0.02044692635536194,
-0.3185915946960449,
0.5873733162879944,
-0.06816176325082779,
0.019959501922130585,
-0.5618797540664673,
0.12220395356416702,
0.053638704121112823,
-0.08685335516929626,
-0.8960878849029541,
-0.44575145840644836,
0.36682847142219543,
0.06795928627252579,
0.05791323632... | |
I'm setting up a simple page that just displays the contents of an XML file and allows the user to filter by keyword.
I'm a serious .NET newb, but I've got an XmlDataSource set up:
```
<asp:XmlDataSource ID="RSSFeedDataSource" runat="server" DataFile="test.xml"
XPath="/rss/channel/item[contains(title,"theKey... | [
0.36274453997612,
0.03692909702658653,
0.35616108775138855,
-0.12272714078426361,
-0.01536624040454626,
-0.17778976261615753,
0.07692534476518631,
-0.2860308289527893,
-0.060746293514966965,
-0.6035457253456116,
0.08952955901622772,
0.44754382967948914,
-0.2911466658115387,
0.0462068207561... | |
this?
Here is a widget you can use that will accomplish what you are looking for:
```
$(function() {
// add new widget called indexFirstColumn
$.tablesorter.addWidget({
// give the widget a id
id: "indexFirstColumn",
// format is called when the on init and when a sorting has finished
... | [
0.054618895053863525,
0.028512034565210342,
0.7775357365608215,
-0.03546546772122383,
0.2203165739774704,
-0.27340462803840637,
-0.056771039962768555,
-0.16702236235141754,
-0.27018246054649353,
-0.6259888410568237,
-0.0497778095304966,
0.3906559944152832,
-0.3819548487663269,
0.1043643876... | |
// loop all tr elements and set the value for the first column
for(var i=0; i < table.tBodies[0].rows.length; i++) {
$("tbody tr:eq(" + i + ") td:first",table).html(i+1);
} | [
-0.1107800155878067,
-0.39149048924446106,
0.6333478093147278,
-0.13335606455802917,
0.10859744995832443,
0.4784967005252838,
0.22298042476177216,
-0.6138996481895447,
-0.10538738965988159,
-0.3286868631839752,
-0.13079574704170227,
0.5922610759735107,
-0.5986831188201904,
-0.0132684269919... | |
}
});
$("table").tablesorter({
widgets: ['zebra','indexFirstColumn']
});
});
``` | [
-0.07921957224607468,
-0.024705225601792336,
0.3373687267303467,
-0.11976217478513718,
0.432468980550766,
-0.021440939977765083,
0.03811014071106911,
-0.17535363137722015,
-0.23988457024097443,
-0.5812592506408691,
-0.1982288360595703,
0.6349260807037354,
-0.5908228754997253,
0.21675489842... | |
I am facing an application designed to import huge amounts of data into a Microsoft SQL Server 2000 database. The application seems to take an awful long time to complete and I suspect the application design is flawed. Someone asked me to dig into the application to find and fix serious bottlenecks, if any. I would lik... | [
0.2899113595485687,
0.2897478938102722,
-0.21999216079711914,
0.19116181135177612,
0.46505019068717957,
-0.16320447623729706,
0.07955750077962875,
0.16429418325424194,
-0.0746660828590393,
-0.4553617537021637,
0.30979490280151367,
0.4213724434375763,
0.015185532160103321,
0.149314001202583... | |
some outside inspiration as well. Can any of you point me to some good resources on checklists for good database schema design and good database application design?
I plan on developing checklists for the following main topics:
1. Database hardware - First thing is to establish proof that the server hardware is appro... | [
0.5688121318817139,
0.4155442416667938,
0.4506198763847351,
0.23374727368354797,
-0.07769442349672318,
-0.03968231379985809,
-0.24269570410251617,
-0.23807191848754883,
-0.12943102419376373,
-0.7080680727958679,
0.15257753431797028,
0.5494523644447327,
-0.046012986451387405,
0.010450121946... | |
background-color:#FF9900;
}
```
Regarding the menu, it is quite common to implement [navigation using unordered lists](http://mirificampress.com/permalink/the_amazing_li). | [
-0.12983117997646332,
-0.03538430109620094,
0.5540484189987183,
-0.0502251572906971,
0.18019764125347137,
-0.04616124555468559,
0.1023138090968132,
0.25426626205444336,
-0.40495291352272034,
-0.5178576707839966,
-0.35871008038520813,
0.5116948485374451,
-0.22696362435817719,
0.093316137790... | |
I'm debugging an out-of-memory exception. When I get the exception, the "virtual bytes" performance counter indicates plenty of addressable space. The problem, however, is that the addressable space is badly fragmented, and the "Largest free region" (returned from !address in WinDbg) is too small.
To measure the memor... | [
-0.08747341483831406,
0.26139000058174133,
0.09738431125879288,
0.174277201294899,
0.06626448035240173,
-0.21321600675582886,
0.25423240661621094,
-0.013127006590366364,
-0.20775261521339417,
-0.612392008304596,
-0.1543085277080536,
0.3601902425289154,
0.14468123018741608,
0.35253039002418... | |
virtual address (which can be obtained from `GetSystemInfo`), you can then use the size of the returned page range to determine the base address of the next page range for which to call `VirtualQueryEx`.
By walking through the address space with repeated calls to `VirtualQueryEx` like this you can determine the larges... | [
-0.02681521512567997,
-0.12934555113315582,
0.6699298620223999,
0.2760968506336212,
0.08209391683340073,
0.1060435026884079,
0.08097682893276215,
0.22094079852104187,
-0.147059828042984,
-1.0026251077651978,
-0.0731467753648758,
0.4610271751880646,
-0.14530228078365326,
0.3811277151107788,... | |
I have a need for methods in several classes that must always follow a specific pre and post pattern.
public void method(X x, Y y ) {
// \*\*\*\*\*\*\*\*\*\*\*\*Repeating Part begin \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/
AFrameworkClass aFrameworkClass = new AFrameworkClass (this.memberVariable,"SomeString");
tr... | [
-0.2210015505552292,
-0.039507459849119186,
0.5805544853210449,
-0.12048058956861496,
0.016173122450709343,
0.1975158452987671,
0.08511102944612503,
-0.5526446104049683,
-0.12405889481306076,
-0.47288885712623596,
-0.030415616929531097,
0.4247349500656128,
-0.3557795584201813,
0.3492220044... | |
code will vary according to the business logic
}
```
// \*\*\*\*\*\*\*\*\*\*\*\*Repeating Part begin \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/
```
aFrameworkClass.doPostProcessing();
```
}
finally {
aFrameworkClass.doCleanup();
}
// \*\*\*\*\*\*\*\*\*\*\*\*Repeating Part End \*\*\*\*\*\*\*\*\*\*\*\*\... | [
0.005372561048716307,
-0.23916029930114746,
0.5791148543357849,
0.20195555686950684,
0.18028929829597473,
0.3147032856941223,
0.37270817160606384,
-0.47799527645111084,
-0.14262139797210693,
-0.40987688302993774,
-0.06126974895596504,
0.35640421509742737,
-0.11421193182468414,
-0.094063341... | |
and programmatically invoke the target method like so:
```
methodInvocation.invoke(); // returns Object
```
If you want to declare your aspects in XML you can read about how to do it here:
<http://static.springframework.org/spring/docs/2.5.x/reference/aop.html#aop-schema>
<http://static.springframework.org/spring/d... | [
0.18356953561306,
0.26736268401145935,
0.3736262023448944,
-0.059219975024461746,
-0.13300830125808716,
0.21914558112621307,
0.19738750159740448,
-0.2828253209590912,
-0.4578321874141693,
-0.4956016540527344,
0.12620387971401215,
0.7443578839302063,
0.12207096815109253,
-0.0773384198546409... | |
B to configure the aspect from project A, no rebuild of A is needed.
My feeling is that advice is more reusable when you define the behavior in a class and how that behavior is applied in XML. | [
0.23055380582809448,
0.023321859538555145,
-0.24681614339351654,
-0.02655000612139702,
-0.3457885980606079,
0.1241428554058075,
0.45234352350234985,
0.040868066251277924,
-0.05311910808086395,
-0.3701798617839813,
-0.04834657534956932,
0.5637410283088684,
-0.09831544011831284,
-0.145620733... | |
How can I find what's hanging all new installations on a Windows box?
While testing an installation script on Windows (XP Pro, if it matters) I've run into a situation wherein any and all attempts to install anything on the system hang waiting on who knows what. When the system is restarted, all queued up attempts at ... | [
0.6808992624282837,
0.15528465807437897,
0.3544454276561737,
-0.020170029252767563,
0.25991371273994446,
-0.25225263833999634,
0.4562046229839325,
0.07955756038427353,
-0.41229942440986633,
-0.46261799335479736,
-0.2799404561519623,
0.4306585490703583,
-0.08511687815189362,
0.0787878185510... | |
OS I've wedged? (Something in the registry, I suppose, but I'm a real greenhorn when it comes to Windows.) Most likely, something from a preceding install attempt went awry and is now blocking even though I saw no errors reported. Once I figure this out, I want to put in a check for this sort of thing, possibly at both... | [
0.08129828423261642,
-0.0013188092270866036,
0.442664235830307,
0.1922832429409027,
0.15711314976215363,
0.21709881722927094,
0.5732699632644653,
0.37000128626823425,
-0.3542439043521881,
-0.8471730947494507,
-0.16267414391040802,
0.7322695851325989,
0.0466173030436039,
0.21352607011795044... | |
now rather than reload (again). Procmon seems great but I haven't got SP2 installed, only SP1! -frown- So, other ideas are welcome.
I assume you've tried [logging the install](http://www.pctools.com/guides/registry/detail/1127/) to see where things go wrong?
Try rolling back to before things went wrong using "System R... | [
0.4025895297527313,
0.0008469465537928045,
0.6175207495689392,
0.1643531620502472,
0.13616971671581268,
-0.08461320400238037,
0.48622915148735046,
0.14799828827381134,
-0.5089679956436157,
-0.5715441107749939,
-0.008168552070856094,
0.9138320088386536,
-0.05532119795680046,
-0.150422975420... | |
more time to debug you can try and figure out what the problem is.
*P.S. I'm assuming you're asking this question from the point of view of someone developing an installer and not as a tech-support question... otherwise this question should probably be closed as not-programming-related ;)* | [
0.8347591161727905,
0.09491749107837677,
0.1999494582414627,
0.3415655791759491,
0.1174732968211174,
-0.14897355437278748,
0.16327282786369324,
0.1545628011226654,
-0.17786721885204315,
-0.44976115226745605,
-0.2193000167608261,
0.5240516662597656,
0.018411459401249886,
0.15123073756694794... | |
What are the valid instanceState's for the Amazon EC2 API? It doesn't seem to be defined in the current [API doc](http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ApiReference-SOAP-DescribeInstances.html). Google doesn't turn up much. So far I know about:
* 0: pending
* 16: running
* 32: shutting-down
* ... | [
-0.006035104393959045,
0.4322981536388397,
0.7376112341880798,
0.20467689633369446,
0.02079533040523529,
-0.04103105887770653,
0.6514577269554138,
-0.08825486898422241,
-0.28987035155296326,
-0.5164831280708313,
0.20150092244148254,
0.5186129212379456,
-0.2253749668598175,
0.40837496519088... | |
| shutting-down |
| 48 | terminated |
| 64 | stopping |
| 80 | stopped |
+--------+---------------+
```
And the documentation can be found within the Amazon Elastic Compute Cloud API reference under [InstanceStateType](http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html... | [
-0.10220618546009064,
0.15831056237220764,
0.5179423093795776,
-0.05278315022587776,
-0.04882563278079033,
-0.033791638910770416,
0.7955436110496521,
-0.10146127641201019,
-0.4281427264213562,
-0.6054641008377075,
-0.5287037491798401,
0.5894627571105957,
-0.397474080324173,
0.2651689052581... | |
I'm considering creating a screen reader for Android. My questions are as follows. One how much of the internals of Android are exposed through the Java API? I'm looking for things such as system wide notification when text is displayed, notification of a new application being launched, etc. I'd rather not have to modi... | [
0.24171391129493713,
0.17409619688987732,
0.12763535976409912,
-0.02257801592350006,
-0.1052137166261673,
0.24947336316108704,
0.043616488575935364,
-0.033761680126190186,
-0.13046792149543762,
-0.9517749547958374,
0.14661650359630585,
0.6141150593757629,
-0.4683774411678314,
-0.0972468629... | |
info
I'm aware that applications should not be designed to work on a specific phone. I picked the G1 because it's the most popular phone currently running Android that I know of. I am looking for lower end system specs that my program would have to fit in, it may run great on a netbook with Android installed but use... | [
0.24003593623638153,
0.06090763583779335,
0.5516104102134705,
0.16846580803394318,
-0.00024233122530858964,
0.09266028553247452,
-0.09431632608175278,
0.1288527399301529,
-0.12381624430418015,
-0.7287144064903259,
0.007385960314422846,
0.7603104710578918,
-0.44777390360832214,
-0.162422552... | |
not be exposed in Android. Otherwise one could grab contact info or whatever personal information gets displayed and harvest that for malicious purposes. So developers currently cannot create an Android app that speaks the text displayed by another application, nor capture the screen. This situation is different from M... | [
0.5524179339408875,
0.09042254090309143,
-0.11627066135406494,
0.21433934569358826,
0.0670122355222702,
-0.3559908866882324,
0.706368088722229,
0.1277816891670227,
-0.04389455169439316,
-0.6849353909492493,
-0.19749368727207184,
0.6830323338508606,
-0.32648903131484985,
-0.0389007963240146... | |
could create it, but it looks like only a direct arrangement with Google could provide the level of trust needed in view of the above security limitations. Since Google is actively working on improving the TTS and integrating it into Donut, it would seem a fairly simple extra step for them to create a basic Narrator-li... | [
0.4464820325374603,
0.11764182895421982,
0.3366434872150421,
0.20611295104026794,
0.1176125705242157,
0.13994872570037842,
0.39716196060180664,
0.24575869739055634,
0.041919369250535965,
-0.5020293593406677,
-0.15510112047195435,
0.6599622368812561,
0.06464588642120361,
-0.4452589750289917... | |
I'm a newbie when it comes to LINQ...
I have an IEnumerable generic list that contains answers with different versions (each with an FK to the question). From this list I need to get a dictionary of latest version answers only.
A very simplified class diagram:
Question
-ID
-question
- ...other properties
... | [
0.26700860261917114,
0.21216784417629242,
0.90013587474823,
-0.11202121526002884,
0.14932242035865784,
-0.16351081430912018,
0.19564864039421082,
-0.3717089295387268,
-0.14274954795837402,
-0.5512357950210571,
-0.0348287932574749,
0.3527277708053589,
0.011492915451526642,
0.490764796733856... | |
.Select(g => new AnswerDTO
{
Version = g.Last().Version, // g.Select(e => e.Version).Max(),
QuestionID = g.Key, | [
-0.02840135060250759,
-0.37236693501472473,
0.588225781917572,
0.09846936166286469,
0.3320576250553131,
0.19641876220703125,
0.08251365274190903,
-0.341251403093338,
-0.15251149237155914,
-0.7936431765556335,
-0.44947752356529236,
0.5145302414894104,
-0.3151004910469055,
0.1621904224157333... | |
ID = g.Last().ID,
Value = g.Last().Value
}).ToDictionary(c => c.QuestionID); | [
-0.12402194738388062,
-0.4397445619106293,
0.39243537187576294,
-0.14730440080165863,
0.4088558852672577,
0.2640236020088196,
0.1795361191034317,
-0.4020974636077881,
0.11383096873760223,
-0.1723308563232422,
-0.3899574875831604,
0.7194536328315735,
-0.5043901205062866,
0.21581262350082397... | |
}
```
While this works for the most part, you can quickly see that it needs some serious optimization (and is a little fragile in that it depends on the Answer record rows order instead of "Max" logic). What would be the best way to do this with LINQ, or is it best to just do multiple for each loops?
1. If I only ne... | [
0.28254157304763794,
0.032953258603811264,
0.20640608668327332,
-0.08487819135189056,
0.1430857628583908,
-0.18056230247020721,
0.12511830031871796,
-0.19237850606441498,
-0.26043495535850525,
-0.40364083647727966,
0.2315998673439026,
0.5812044143676758,
-0.5264177322387695,
-0.01320048887... | |
this again would only return the key/s and one property: Version).
2. Ultimately, in this particularly situation I would much prefer to just "filter" the original list and return the original answer items instead of involving the AnswerDTO.
Any pointers or help would be much appreciated!
How about something like....
... | [
0.028372500091791153,
-0.3941153883934021,
0.38359275460243225,
-0.10611424595117569,
0.1141803115606308,
-0.07655665278434753,
0.2819381058216095,
-0.41007083654403687,
-0.26536887884140015,
-0.45450320839881897,
-0.3946150243282318,
0.78730708360672,
-0.412005752325058,
0.141663059592247... | |
into grp
from g in grp
where g.Version == grp.Max(m => m.Version)
select new { id = g.QuestionID, q = g }).ToDictionary( o => o.id, o => o.q);
StringBuilder sb = new StringBuilder();
foreach (var elem in dict) | [
-0.3870983421802521,
-0.3245278596878052,
0.7696124315261841,
-0.36398348212242126,
0.21348311007022858,
0.5367118716239929,
0.399688720703125,
-0.599453330039978,
-0.11248131841421127,
-0.6054195761680603,
-0.5220369100570679,
0.2809467911720276,
-0.31305190920829773,
0.11707908660173416,... | |
{
sb.AppendLine(elem.Key.ToString() + "-" + elem.Value.Version.ToString());
}
MessageBox.Show(sb.ToString());
}
private List<Answer> GetAnswers()
{
List<Answer> result = new List<Answer>();
result.Add(new Answer() { ID = 1, QuestionID = 1, Version = 1 });
result.Add(ne... | [
-0.035513583570718765,
-0.14181192219257355,
0.5373284220695496,
-0.49147355556488037,
-0.018882259726524353,
0.1711982935667038,
0.6730478405952454,
-0.8066396713256836,
-0.42989015579223633,
-0.6296825408935547,
-0.6654804944992065,
0.26088806986808777,
-0.5537303686141968,
0.02301358431... | |
Version = 3 });
result.Add(new Answer() { ID = 4, QuestionID = 2, Version = 1 });
result.Add(new Answer() { ID = 5, QuestionID = 2, Version = 2 });
result.Add(new Answer() { ID = 6, QuestionID = 2, Version = 3 });
result.Add(new Answer() { ID = 7, QuestionID = 3, Version = 1 });
result.Add... | [
-0.028971083462238312,
-0.2510945796966553,
0.8566533327102661,
-0.34979569911956787,
0.038640499114990234,
0.3087009787559509,
0.12853367626667023,
-0.4072898328304291,
-0.44811323285102844,
-0.6257137656211853,
-0.4937695562839508,
0.28175094723701477,
-0.2891843616962433,
0.278512656688... | |
Answer() { ID = 9, QuestionID = 3, Version = 3 });
result.Add(new Answer() { ID = 10, QuestionID = 3, Version = 4 });
return result;
}
``` | [
-0.00638123182579875,
-0.08581530302762985,
0.5106149911880493,
-0.1453462541103363,
0.2001553773880005,
0.13155122101306915,
0.10424456000328064,
-0.3485395014286041,
-0.11488210409879684,
-0.44978582859039307,
-0.6374621391296387,
0.4907740354537964,
-0.30122026801109314,
0.1913830786943... | |
The Java documentation says:
> It is not possible for two invocations of synchronized methods on the
> same object to interleave.
What does this mean for a static method? Since a static method has no associated object, will the synchronized keyword lock on the class, instead of the object?
> Since a static method h... | [
-0.2032930999994278,
-0.14627288281917572,
-0.040666613727808,
0.08258303999900818,
-0.08209634572267532,
-0.20981790125370026,
0.37731292843818665,
-0.1381632536649704,
-0.2083909809589386,
-0.42724648118019104,
0.07983161509037018,
0.2780402898788452,
-0.7541671991348267,
0.1587903350591... | |
More times than I'd like to admit I've had people new to a project do a checkout only to find they are missing various resources, dll's, settings. I'd like to get in the proper habit of having my projects compilation be smooth as can be from a fresh checkout.
What are some tips or suggestions on how to structure my p... | [
0.6563697457313538,
0.1580488532781601,
-0.16937434673309326,
0.3355119526386261,
0.23089250922203064,
-0.12936802208423615,
-0.049784548580646515,
0.11215721070766449,
-0.5737834572792053,
-0.5862216353416443,
0.33962932229042053,
0.6070948243141174,
0.23831650614738464,
0.073574937880039... | |
in a Visual Studio environment, here are some things that you might find useful, YMMV of course and note that we use Subversion, but any VCS tool should do...
* Place all (or as many as possible) dependencies under version control and reference these in your projects. We use Subversion externals to manage this.
* Don'... | [
0.29573318362236023,
-0.04725145921111107,
0.312489777803421,
-0.031807467341423035,
-0.062842458486557,
-0.14943280816078186,
0.3002139925956726,
-0.0428362712264061,
-0.35846102237701416,
-0.7546147704124451,
-0.35519102215766907,
0.6647754907608032,
-0.5843660831451416,
-0.0847215279936... | |
by using RegEx and tokens to setup compilations per developer or build server, it also allows you to delete any existing App.config files on CI builds to ensure a pristine build every time. This also allows developers to muck around with configurations without having to disturb everyone else until they are ready, i.e. ... | [
0.6493069529533386,
-0.20260386168956757,
0.2925930619239807,
0.0855124220252037,
-0.1519981175661087,
-0.46556082367897034,
0.30972224473953247,
-0.11442829668521881,
-0.39354315400123596,
-0.7541003823280334,
-0.2714642286300659,
0.3245019018650055,
-0.5311594605445862,
0.431401193141937... | |
that you can add/commit to an svn:externals directory, which allows you to push libraries, etc out to project which reference them.
Final tip - After you have done a clean checkout and have a successful compilation, check to see if there are any modifications in your working copy, e.g. TortoiseSVN -> Check for modific... | [
0.4208970069885254,
-0.1969459056854248,
0.4000057876110077,
0.31654036045074463,
0.18485356867313385,
-0.11716415733098984,
0.006160108372569084,
-0.11308307200670242,
-0.5139325857162476,
-0.33523985743522644,
-0.19876419007778168,
0.5933563709259033,
0.04459654167294502,
0.0407264865934... | |
In Oracle, you can use the [XMLElement()](http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions230.htm#i1129193) function to create an element, as in:
```
XMLElement('name', 'John')
```
But how to create an element in a specific namespace? For instance, how to create the following element:
```
<m... | [
0.012093842960894108,
0.3001219630241394,
-0.007253845687955618,
0.08228467404842377,
0.0768493190407753,
-0.12024803459644318,
-0.33542898297309875,
-0.24762070178985596,
0.13101211190223694,
-0.18499727547168732,
-0.23288829624652863,
0.4394085109233856,
-0.1602977067232132,
-0.138525888... | |
Is anyone aware of any method (or external plugin) that would allow for nested editor tabs? It would be nice to be able to group related open files into their own "master" tabs, but I'm not sure if this is even possible. Any ideas?
This is totally non-obvious, and I discovered it by accident, but...
If you click on a ... | [
0.38693273067474365,
-0.06179748475551605,
0.5490846633911133,
0.2030092030763626,
-0.05092610418796539,
0.12536883354187012,
-0.1506224274635315,
0.14111633598804474,
-0.6442238688468933,
-0.4856675863265991,
-0.0503229983150959,
0.346416175365448,
-0.22815391421318054,
0.2504655718803406... | |
and down between the two panes to see different documents at the same time.
I think that's as close as you can get. | [
0.31518489122390747,
0.47295519709587097,
0.10754234343767166,
0.044051483273506165,
0.4622208774089813,
0.034103862941265106,
0.10107220709323883,
0.17329442501068115,
-0.46008172631263733,
-0.48948824405670166,
0.46629664301872253,
0.42367738485336304,
0.2488730251789093,
-0.176037758588... | |
I know how to get the System memory use using GlobalMemoryStatusEx, but that tells me the what the entire OS is using.
I really want my program to report how much memory it alone has allocated and is using.
Is there any way within my Delphi 2009 program to call either a Windows function or maybe some FastMM function... | [
-0.0479339100420475,
0.19270099699497223,
0.31872767210006714,
-0.026060324162244797,
0.054269686341285706,
-0.014648066833615303,
0.30737167596817017,
0.03006458282470703,
-0.3732517957687378,
-0.7604422569274902,
0.09187101572751999,
0.6479466557502747,
-0.1755809485912323,
-0.0125200133... | |
use, whereas GetProcessMemoryInfo.WorkingSetSize gave a very different result.
You can get useful memory usage information out of the Delphi runtime without using any direct Win32 calls:
```
unit X;
uses FastMM4; //include this or method will return 0.
....
function GetMemoryUsed: UInt64;
var
st: TMemoryManagerSt... | [
-0.07056356221437454,
-0.24394917488098145,
0.5361143350601196,
-0.11360031366348267,
0.07171089947223663,
-0.16762679815292358,
0.23298682272434235,
-0.4443907141685486,
-0.4892066717147827,
-0.5410841107368469,
-0.161026731133461,
0.5169473886489868,
-0.4048241078853607,
-0.0449601002037... | |
you deallocate memory, it goes down by the same amount right away. I use this before and after running each of my unit tests, so I can tell which test is leaking memory (for example). | [
0.27044302225112915,
-0.04565594717860222,
0.0676615759730339,
0.22398048639297485,
0.1926482617855072,
-0.007016039919108152,
-0.1514541059732437,
-0.4726610779762268,
-0.16628025472164154,
-0.5949011445045471,
0.17676779627799988,
0.6721180081367493,
0.21469296514987946,
-0.2656010389328... | |
I need to generate many internal client-side (within the company only) graphs from streams of data, and since the data itself is "secret", I can't use a service like Google-Graphs for generating the graphs. So I was wondering if anyone has some recomendations for a javascript graph library that doesn't require a server... | [
0.5035147666931152,
0.08230666816234589,
0.7840067148208618,
0.1505904346704483,
-0.1638476699590683,
-0.290484219789505,
0.2919967770576477,
0.15412537753582,
-0.5671681761741638,
-0.341249018907547,
-0.043959517031908035,
0.24450033903121948,
-0.1388363242149353,
0.007886813953518867,
... | |
I'm just trying to get MySQL to store time in GMT...
I've read the documentation here: <http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html>
It says to set: default-time-zone='timezone' in an option file.
However, I've googled for several different terms and cannot find possible values "timezone" is suppos... | [
0.41690313816070557,
-0.11309004575014114,
0.5277946591377258,
0.04576269909739494,
0.3631936311721802,
-0.05903623625636101,
-0.010849068872630596,
0.40551885962486267,
-0.1991962194442749,
-0.722111165523529,
-0.09651851654052734,
0.2532060444355011,
-0.031855884939432144,
0.270351976156... | |
install any timezone tables for your problem. After restarting the server, your server will operate in the UTC timezone and hence NOW() will give you the time in GMT.
By default, MySQL is set to your SYSTEM timezone ie. your server timezone is same as your system timezone. So you could also change your system time zo... | [
0.10500626266002655,
-0.11565550416707993,
0.7909765243530273,
0.28198960423469543,
0.2694931626319885,
-0.22842547297477722,
0.5464436411857605,
0.4609796702861786,
-0.4640340507030487,
-1.070261836051941,
-0.15471602976322174,
0.5160578489303589,
-0.3890390694141388,
0.1564548909664154,
... | |
I need to search a drive (C:, D: etc) for a partuicular file type (extension like .xml, .csv, .xls). How do I preform a recursive search to loop all directories and inner directories and return the full path of where the file(s) are? or where can I get information on this?
VB.NET or C#
Thanks
Edit ~ I am running in... | [
0.3226960003376007,
-0.08822091668844223,
0.32119429111480713,
0.36332592368125916,
0.03578038513660431,
-0.26154765486717224,
0.3736490309238434,
0.06593728810548782,
-0.17325176298618317,
-0.5902286767959595,
-0.17737674713134766,
0.6331307888031006,
-0.20603951811790466,
0.3333402872085... | |
file type for all the files found.
How about this? It avoids the exception often thrown by the in-built recursive search (i.e. you get access-denied to a single folder, and your whole search dies), and is lazily evaluated (i.e. it returns results as soon as it finds them, rather than buffering 2000 results). The lazy b... | [
0.09253992140293121,
-0.0898800864815712,
0.37187203764915466,
-0.1597331166267395,
0.012173851020634174,
-0.16146524250507355,
0.242593452334404,
-0.060595642775297165,
-0.21081866323947906,
-0.7472359538078308,
-0.13782644271850586,
0.417730450630188,
-0.43374383449554443,
0.336923897266... | |
in Search("c:\\", "*.xml")) {
Console.WriteLine(match);
}
}
static IEnumerable<string> Search(string root, string searchPattern) {
Queue<string> dirs = new Queue<string>();
dirs.Enqueue(root);
while (dirs.Count > 0) {
string dir = dirs.Dequeue();
... | [
-0.5736714601516724,
-0.24262699484825134,
0.6419326663017273,
-0.29032549262046814,
0.2120078057050705,
0.10324586182832718,
0.06753905117511749,
-0.15454035997390747,
0.07273570448160172,
-0.6091761589050293,
-0.3448365330696106,
0.432975172996521,
-0.4725132882595062,
0.3586134910583496... | |
string[] paths = null;
try {
paths = Directory.GetFiles(dir, searchPattern);
} catch { } // swallow
if (paths != null && paths.Length > 0) {
foreach (string file | [
0.3250286281108856,
-0.11062067002058029,
0.36972129344940186,
-0.5268294811248779,
0.54897141456604,
0.2595904767513275,
0.1580539047718048,
-0.24544858932495117,
-0.1254642754793167,
-0.28357407450675964,
0.00487238634377718,
0.4931514859199524,
-0.40486353635787964,
-0.03175041079521179... | |
in paths) {
yield return file;
}
}
// sub-directories
paths = null;
try { | [
-0.1853741705417633,
-0.32490766048431396,
0.26163503527641296,
0.010767552070319653,
0.1659156233072281,
-0.09064614772796631,
0.5843572616577148,
-0.3037495017051697,
-0.06253550946712494,
-0.46208655834198,
-0.34660232067108154,
0.24692551791667938,
-0.43780750036239624,
0.1243628263473... | |
paths = Directory.GetDirectories(dir);
} catch { } // swallow
if (paths != null && paths.Length > 0) {
foreach (string subDir in paths) {
dirs.Enqueue(subDir); | [
0.14005954563617706,
-0.19929106533527374,
0.20253798365592957,
-0.40084823966026306,
0.30241990089416504,
0.14476093649864197,
0.20616544783115387,
-0.32795923948287964,
0.11162511259317398,
-0.4067900776863098,
-0.058495473116636276,
0.38022175431251526,
-0.46198657155036926,
-0.02770645... | |
}
}
}
}
}
``` | [
-0.05286634340882301,
0.46233952045440674,
0.26861345767974854,
-0.21428057551383972,
0.3945882022380829,
-0.2074044644832611,
0.11799322813749313,
0.3477530777454376,
0.20242395997047424,
-0.5250234007835388,
-0.36778154969215393,
0.5970296263694763,
-0.3366963565349579,
0.345072776079177... | |
Lots of times in Java logs I'll get something like:
```
Caused by: java.sql.BatchUpdateException: failed batch
at org.hsqldb.jdbc.jdbcStatement.executeBatch(jdbcStatement.java:1102)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(jdbcPreparedStatement.java:514)
at org.hibernate.jdbc.BatchingBatcher.d... | [
0.058676738291978836,
0.16604527831077576,
0.2784777581691742,
-0.3749331533908844,
-0.25794893503189087,
0.04265379160642624,
0.5910233855247498,
-0.21520647406578064,
-0.6439536809921265,
-0.6103949546813965,
-0.11781276017427444,
0.03708767145872116,
-0.39005452394485474,
0.165664508938... | |
you'll have
```
com.something.XyzException
at ...
at ...
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
at ... <the other 113 lines are here>...
Caused by: <the above>.
```
The two stack traces 'meet' at AbstractBatcher.executeBatch, line 242, and then from then on the upward ca... | [
-0.045631974935531616,
-0.2624818980693817,
0.6613022685050964,
-0.2271987348794937,
0.2212972193956375,
-0.039255477488040924,
0.2720867693424225,
-0.21436630189418793,
-0.19227232038974762,
-0.7232233285903931,
-0.23245272040367126,
0.32452213764190674,
-0.3652428984642029,
-0.1247245892... | |
In a **WinForms** application, the level of a `treeview` is given by `node.level`
What is the corresponding command in **WPF**?
The direct answer to your question is that there is no level property in WPF.
There is no one to one relationship between the winforms controls and wpf control. Because the underlying arch... | [
-0.025519514456391335,
-0.3188305199146271,
0.5463280081748962,
0.4118817448616028,
0.04083527624607086,
-0.4055649936199188,
-0.17871634662151337,
-0.2875289022922516,
0.10705053806304932,
-0.6217314600944519,
-0.2863200604915619,
0.38672223687171936,
-0.1046387329697609,
0.17605544626712... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.