text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
continue # a factor is not present
# Do we want to try another number, or was a solution found?
if try_another_number == True:
continue
else:
output = 1
for number, copies in | [
0.22449147701263428,
-0.12583346664905548,
0.5213643908500671,
0.11432301253080368,
0.4712604880332947,
0.05615578964352608,
0.4236588776111603,
-0.21490854024887085,
-0.3423757553100586,
-0.28047606348991394,
-0.10716155916452408,
0.45341747999191284,
-0.39611488580703735,
-0.026201948523... | |
factors_below_y.items():
remaining = factors[number] - copies
if remaining > 0:
factors[number] = remaining
else:
del factors[number] | [
-0.22740481793880463,
-0.2553879916667938,
0.5407121181488037,
0.14450670778751373,
0.06131911277770996,
0.4196092486381531,
-0.12108319252729416,
-0.3652268648147583,
-0.745238184928894,
-0.6438579559326172,
-0.20648466050624847,
0.40398797392845154,
-0.278815895318985,
0.4342138171195984... | |
output *= number ** copies
return (output, factors)
return None # failed
# Find prime factors. You can use any formula you want for this.
# I am using elliptic curve factorization from http://sourceforge.net/projects/pyecm
import pyecm, collections, copy
getFactors_cache = {}
def getFactors(n):
... | [
-0.07873741537332535,
0.11175403743982315,
0.13106071949005127,
-0.10541186481714249,
-0.022272989153862,
0.1832188069820404,
0.40092968940734863,
-0.5657610297203064,
-0.23591706156730652,
-0.47465965151786804,
-0.012946585193276405,
0.6717079281806946,
-0.520061194896698,
0.1669774800539... | |
except KeyError:
pass
output = collections.defaultdict(int)
for factor in pyecm.factors(n, False, True, 10, 1):
output[factor] += 1
# cache result
getFactors_cache[n] = output
return copy.copy(output)
```
**Answer to first question**
You say you want compression of numbers, but... | [
0.02405441179871559,
0.02636365033686161,
0.28343889117240906,
0.05663139745593071,
0.10516143590211868,
0.12536528706550598,
0.09561404585838318,
-0.5198232531547546,
-0.42880430817604065,
-0.48312851786613464,
-0.22639791667461395,
0.5176447033882141,
-0.39081427454948425,
-0.07251393795... | |
you elaborate more?
Here is a mathematical explanation as to why current answers to the first part of your problem will never solve your second problem. It has nothing to do with the knapsack problem.

This is Shannon'... | [
0.004798622336238623,
-0.2303365021944046,
-0.23232991993427277,
0.13254308700561523,
-0.21438030898571014,
0.10193949192762375,
0.13030000030994415,
-0.30471402406692505,
-0.20208212733268738,
-0.5473294258117676,
0.009914720430970192,
0.4527096748352051,
-0.4621206223964691,
0.2744316160... | |
appear. Therefore the probability of each element is 1/4294967296.
When we plug it into Shannon's algorithm, it will tell us what the minimum number of bits are required to represent the stream.
```
import math
def entropy():
num = 2**32
probability = 1./num
return -(num) * probability * math.log(probab... | [
0.043798722326755524,
-0.23588229715824127,
0.4118395745754242,
-0.06082191318273544,
-0.026401305571198463,
0.25423890352249146,
0.18685661256313324,
-0.1402290016412735,
0.15926791727542877,
-0.8516756296157837,
-0.11781792342662811,
0.5481631755828857,
-0.5437256693840027,
0.22142726182... | |
decrease the probability of others. You should explain the stream in more detail.
**Answer to second question**
The right way to do this is to use base64, when communicating with HTTP. Apparently Java does not have this in the standard library, but I found a link to a free implementation:
<http://iharder.sourceforge... | [
0.036066748201847076,
-0.009369723498821259,
0.05273309722542763,
-0.1711006760597229,
-0.24832898378372192,
-0.10764821618795395,
0.5336152911186218,
0.005319754593074322,
-0.09740811586380005,
-0.7080593109130859,
0.24163047969341278,
0.5019705295562744,
-0.40012094378471375,
-0.05067218... | |
return mapping[0]
while num != 0:
output = mapping[num % 64] + output
num /= 64
return output
```
If you have control over your web server and web client, and can parse the entire HTTP requests without problem, you can upgrade to base85. According to wikipedia, [url encoding allows for up to... | [
-0.004635138437151909,
0.03792339563369751,
0.3700145483016968,
-0.27425703406333923,
-0.27009546756744385,
0.21017181873321533,
0.10534346848726273,
-0.30418911576271057,
-0.0366545096039772,
-0.5732059478759766,
-0.0849476009607315,
0.44317930936813354,
0.03299475461244583,
-0.2663952410... | |
= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~!*'();:@&=+$,/?%#[]"
output = ""
base = len(mapping)
# special case for 0
if num == 0:
return mapping[0]
while num != 0:
output = mapping[num % base] + output
num /= base
return output
```
And here ... | [
-0.41964191198349,
-0.2647975981235504,
0.27400586009025574,
-0.4289221465587616,
-0.17241206765174866,
0.18515177071094513,
0.19452974200248718,
-0.31952816247940063,
-0.12264692038297653,
-0.34548771381378174,
-0.23111267387866974,
0.4773643910884857,
-0.07283216714859009,
-0.00922202598... | |
place = 0
# check each digit from the lowest place
for digit in reversed(string):
# find the number the mapping of symbol to number, then multiply by base^place
output += mapping.find(digit) * (base ** place)
place += 1
return output
```
Here is a graph of Shannon's algorithm in d... | [
-0.35270872712135315,
0.14436817169189453,
0.01494673639535904,
-0.3064338266849518,
0.14090530574321747,
0.13726811110973358,
0.12423444539308548,
-0.4861888587474823,
-0.16280367970466614,
-0.38639241456985474,
-0.2368612140417099,
0.06626904010772705,
-0.23309972882270813,
0.06090038269... | |
~11 symbols are required to represent a long. At base85, it becomes ~10 symbols. | [
0.05801507085561752,
0.2697897255420685,
0.4129416346549988,
-0.4248499572277069,
-0.01846310868859291,
0.23436683416366577,
0.2349482774734497,
-0.3919662535190582,
-0.07190090417861938,
-0.2955617904663086,
-0.2652020752429962,
0.24023441970348358,
0.16987018287181854,
-0.007815976627171... | |
I'm working on an Adobe AIR project that use the Ruby on Rails as RESTful web service as the back end.
I have found a lot of examples that show how can I send the data to operated by Rails. but I stuck at date object, which will be very useful if I can send Actionscript's date object to Rails via XML or whatever and R... | [
0.5188474655151367,
-0.03946223855018616,
0.0764203816652298,
0.21923291683197021,
-0.0749126449227333,
-0.08431423455476761,
0.08695072680711746,
0.3519616723060608,
0.08886714279651642,
-0.6165733337402344,
0.19286227226257324,
0.11230490356683731,
-0.43153005838394165,
0.160275563597679... | |
translate to and from the Rails W3C date format. | [
0.0307626910507679,
-0.004609495401382446,
-0.0628744438290596,
0.18517626821994781,
0.1716262847185135,
-0.13839925825595856,
-0.012815584428608418,
0.33478257060050964,
-0.050435781478881836,
-0.7366213202476501,
-0.3485528230667114,
0.0809432715177536,
-0.14777667820453644,
-0.133601546... | |
How do I convert a 32x16 pixel image to a picture SMS message?
I already have the code needed to send normal text SMS, but am looking for help with sending picture SMS.
Check out [Converting image files to OTA file format](http://www.codeproject.com/KB/graphics/ota_converter.aspx). The code is in C#. | [
0.24702873826026917,
0.13830526173114777,
0.4782535433769226,
-0.1533716768026352,
-0.17117862403392792,
0.21369384229183197,
0.23840440809726715,
-0.15017972886562347,
-0.021678326651453972,
-0.7681090235710144,
-0.028786050155758858,
0.6753009557723999,
-0.4726700782775879,
-0.1841906607... | |
I'm using Jquery to submit the value of a `<textarea>` through AJAX to a PHP script. This value may contain punctuation characters `(!,?,#,@)` as well as single and double quotes, and other non-alphanumeric characters. Does Jquery take care of encoding all this stuff or do I need to do it myself? How can I be certain t... | [
0.272090882062912,
0.3061866760253906,
0.5222321152687073,
0.12399353086948395,
-0.5235500335693359,
-0.008448482491075993,
-0.0343516543507576,
0.11865396052598953,
0.15522989630699158,
-0.5941166281700134,
-0.018990006297826767,
0.36455264687538147,
-0.04186315834522247,
-0.1505583226680... | |
I am just learning how to use Terracotta after discovering it about a month ago. It is a very cool technology.
Basically what I am trying to do:
My root (System of Record) is a ConcurrentHashMap.
The main Instrumented Class is a "JavaBean" with 30 or so fields that I want to exist in the HashMap.
There will be abou... | [
0.29278552532196045,
0.0996675193309784,
0.06483347713947296,
0.17117466032505035,
-0.10767814517021179,
-0.19184693694114685,
0.270817369222641,
0.5329819917678833,
-0.44085240364074707,
-0.7373607754707336,
0.38644763827323914,
0.12206388264894485,
0.04112645238637924,
0.420769065618515,... | |
experience than me with TC have any tips? Performance is key.
Any examples other similar applications?
You might find that batching several changes under one lock scope will perform better. Each synchronized block/method forms a write transaction (assuming you use a write lock) that must be sent to the server (and pos... | [
0.49321967363357544,
-0.23028992116451263,
0.3544826805591583,
0.3242337107658386,
-0.148030623793602,
-0.2924896776676178,
-0.1282036155462265,
-0.2944547235965729,
-0.39656490087509155,
-0.6215661764144897,
0.3906390070915222,
0.5024136304855347,
-0.08522646129131317,
0.21693257987499237... | |
that are actually using an object. So if you can partition which nodes usually touch specific objects that reduces the number of changes that have to be sent around the cluster, which improves performance.
unnutz's suggestions about using CHM or CSM are good ones. CHM allows greater concurrency (as each internal segme... | [
0.1224624365568161,
0.00017304431821685284,
0.34053102135658264,
0.3086879849433899,
0.0243851225823164,
-0.04805105924606323,
0.05917475372552872,
0.08896542340517044,
-0.733547031879425,
-0.7862266302108765,
-0.09319844841957092,
0.11294800788164139,
-0.2164216786623001,
0.31031468510627... | |
soon for CSM will make the lock mgmt cost much lower.
Generally we find a good strategy is:
1. Build a performance test (should be multi-threaded and multi-node and similar to your app (or your actual app!)
2. Tune objects - look at your clustered object graph in the dev-console to find objects that don't need to be ... | [
0.24018490314483643,
-0.3268057703971863,
0.6715964674949646,
0.28739604353904724,
0.33274728059768677,
-0.5541632175445557,
0.08601173758506775,
-0.19709472358226776,
-0.03552592918276787,
-0.8687719702720642,
-0.0798957347869873,
0.4290757477283478,
-0.10244864225387573,
-0.2057120054960... | |
locks - use the lock profiler in the dev-console to find hot locks or locks that are too narrow or too wide. The clustered stats recorder can help look at transaction size as well.
4. Tune GC and DGC - tune JVM garbage collection, then tune Terracotta distributed GC by turning on changing the frequency of young gen gc.... | [
0.5930507779121399,
-0.14214923977851868,
0.7605572938919067,
0.5328643918037415,
0.20718982815742493,
-0.3574342429637909,
-0.10814116895198822,
-0.4099556505680084,
-0.12127156555652618,
-0.5133951902389526,
0.1355118602514267,
0.8481461405754089,
0.03275337070226669,
0.17244631052017212... | |
and answer there. | [
0.18525941669940948,
0.22178710997104645,
0.0628957599401474,
0.1919991374015808,
-0.2868395447731018,
0.14133088290691376,
-0.08137858659029007,
0.0216508936136961,
-0.10016092658042908,
-0.048388704657554626,
-0.17830005288124084,
0.10036434233188629,
-0.06668847799301147,
0.092692971229... | |
i need an example of the shortest path of directed graph cycle bye one node (it should reach to all nodes of graph from anode will be the input) please if there is an example i need it in c++ or algorithm thanks very much.........
```
SELECT *
FROM pmmessages
WHERE sentto = '$username'
OR sentto = 'everyone'
``... | [
0.21562200784683228,
0.04659106954932213,
0.5812789797782898,
0.39377444982528687,
0.15423916280269623,
0.14274033904075623,
0.027103709056973457,
-0.22285613417625427,
-0.6188926696777344,
-0.6155574321746826,
-0.24472558498382568,
0.38138172030448914,
-0.4991087317466736,
0.0463472157716... | |
*
FROM pmessages
WHERE status='unread'
AND
(sentto='$username'
OR sentto='everyone' )
``` | [
0.147266685962677,
0.06309136748313904,
0.13996566832065582,
0.27888983488082886,
0.38454869389533997,
-0.20171622931957245,
0.09394119679927826,
0.2522583603858948,
-0.2549382448196411,
-0.30309268832206726,
-0.43560177087783813,
0.39759719371795654,
-0.158433735370636,
0.2513180375099182... | |
Are boolean expressions in SQL WHERE clauses [short-circuit evaluated](http://en.wikipedia.org/wiki/Short-circuit_evaluation)?
For example:
```
SELECT *
FROM Table t
WHERE @key IS NULL OR (@key IS NOT NULL AND @key = t.Key)
```
If `@key IS NULL` evaluates to `true`, is `@key IS NOT NULL AND @key = t.Key` evaluat... | [
-0.29361966252326965,
0.04671512916684151,
0.10479921102523804,
-0.08055148273706436,
-0.4407728612422943,
-0.27548375725746155,
0.37025636434555054,
-0.3054426908493042,
-0.11677604168653488,
0.046821124851703644,
-0.47412779927253723,
0.5024645924568176,
-0.39116957783699036,
-0.42221814... | |
left to right. However, it is
> **implementation-dependent** whether expressions are actually evaluated left to right, particularly when operands or operators might
> cause conditions to be raised **or if the results of the expressions
> can be determined without completely evaluating all parts of the
> expression.** | [
-0.2424122393131256,
-0.14623625576496124,
0.02503814920783043,
0.0958094373345375,
-0.13817960023880005,
0.002382876118645072,
0.20998169481754303,
-0.26577141880989075,
-0.08843384683132172,
-0.6009472012519836,
-0.274557888507843,
0.598202109336853,
-0.2717796862125397,
-0.4062244296073... | |
I am designing a class where some methods won't cause any harm if they are exposed as public. But they can be private as well, since they will be used only from the same class in my project.
Making them public has the following advantages:
1. Unit Testable without the need of accessors.
2. Flexibility.
Making them p... | [
0.41164514422416687,
-0.03656065836548805,
-0.662464439868927,
0.37712860107421875,
-0.20852616429328918,
-0.4300486147403717,
0.7133449912071228,
0.01399471890181303,
0.05420053377747536,
-0.5401591062545776,
-0.4004731774330139,
0.4489518702030182,
-0.4006040692329407,
-0.226880595088005... | |
Method fits in the overall "Persona" of the class, make it public. More technically, try not to break the abstraction. I would have given an example, but I do not know the context of your work and so examples might be irrelevant.
If you do not need it, there is no need to make a Method public.
For testing, +1 to Joh... | [
0.4246659576892853,
-0.007007993757724762,
-0.16367585957050323,
0.34030041098594666,
-0.21076151728630066,
-0.5439043641090393,
0.4089552164077759,
-0.13066793978214264,
-0.021277179941534996,
-0.3770686089992523,
0.2995869517326355,
0.1992930769920349,
-0.27063730359077454,
0.03962528333... | |
I usually try to do TDD with not much analysis (no diagrams) before start coding. Usually I find myself spliting a class into other classes to separate concerns. I wonder if a deeper analysis would prevent that. I think that much of OO analysis can't predict some of those cases. What do you think?
"Usually I find mysel... | [
0.6452078819274902,
-0.18317218124866486,
-0.7090840339660645,
0.2691427171230316,
-0.08927617967128754,
0.03443840146064758,
0.06414324045181274,
-0.01149552222341299,
-0.14838959276676178,
-0.6588106751441956,
0.009647195227444172,
0.3896648585796356,
-0.23294414579868317,
-0.07550777494... | |
classes better which
I do not get in A&D.
However, I have found prior analysis as much helpful. It's like laying out foundations with analysis and then you get detailed design while coding.
Certain things just need to be looked from a bigger perspective. | [
0.3465014100074768,
-0.0852944552898407,
-0.3220837116241455,
0.35314634442329407,
-0.19636106491088867,
-0.10043513774871826,
0.3946986496448517,
0.16035114228725433,
0.09496673941612244,
-0.6723842024803162,
0.19072814285755157,
0.7638731002807617,
0.5671733617782593,
-0.0962515100836753... | |
*The problem is*: Given a number of programming libraries with similar or equal scope (e.g. XML parser, regex, markup, ...); are there tools, with which one can run performance tests on these libraries and compare (and generate reports), even though the libraries may be written in different programming languages (such ... | [
0.4257443845272064,
0.16145694255828857,
-0.34114038944244385,
0.3600100874900818,
-0.2548271417617798,
-0.08783334493637085,
0.33118656277656555,
-0.07731979340314865,
-0.23029451072216034,
-0.5049338340759277,
-0.11902741342782974,
0.45645126700401306,
0.11301390081644058,
-0.01951313391... | |
analysis would prevent that. I think that much of OO analysis can't predict some of those cases."
I have similar experience in this regard. TDD does help you to design classes better which
I do not get in A&D.
However, I have found prior analysis as much helpful. It's like laying out foundations with analysis and th... | [
0.37073686718940735,
0.002426796592772007,
-0.3601823151111603,
0.17421020567417145,
-0.16435952484607697,
-0.14867976307868958,
0.11148957908153534,
-0.08017732203006744,
0.12162484973669052,
-0.6398779153823853,
0.21891635656356812,
0.692225456237793,
0.3581565320491791,
-0.0589059218764... | |
In my app, I have a simple ASCII file which stores some config info and other small info which it uses and changes. I want to copy that file to the iPhone with the app.
1) Please tell me where I should put this file (config.txt) in xcode. Should I put it under Resources ?
2) How will I access it in the iPhone ? Can... | [
0.30476072430610657,
0.2657574415206909,
0.583915650844574,
0.16042323410511017,
0.4685339033603668,
-0.02301507070660591,
0.34818682074546814,
0.05350983142852783,
-0.17621472477912903,
-0.9853305220603943,
-0.08106080442667007,
0.5458428263664246,
-0.1814907193183899,
-0.2055588811635971... | |
change them.
The documentation is [here](http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html).
The settings are stored as a plist file, so you can store `NSDictionary` instances, `NSArray` instances, etc.
If you want to pre-populate your `NSUserDef... | [
0.08601026237010956,
-0.02721143141388893,
0.7093186378479004,
-0.04584107920527458,
0.4243098795413971,
0.18654140830039978,
0.22251714766025543,
-0.002493665087968111,
-0.4911355972290039,
-0.9355841279029846,
-0.30483871698379517,
0.5014212727546692,
-0.26971951127052307,
0.012140462175... | |
```
class foo
{
public:
void say_type_name()
{
std::cout << typeid(this).name() << std::endl;
}
};
int main()
{
foo f;;
f.say_type_name();
}
```
Above code prints *P3foo* on my ubuntu machine with g++. I am not getting why it is printing *P3foo* instead of just *foo*. If I change the code like
```
... | [
0.043808285146951675,
0.3975246548652649,
0.5183756947517395,
-0.5236227512359619,
0.043005771934986115,
0.21658238768577576,
0.25966107845306396,
-0.11362046003341675,
-0.14370572566986084,
-0.47344735264778137,
-0.2303343117237091,
0.5557966232299805,
-0.795707643032074,
-0.0201674010604... | |
GCC just gives you the internal, mangled name.
Enter that mangled name into the program `c++filt` to get the unmangled name:
```
$ c++filt -t P3foo
foo*
``` | [
0.05820900574326515,
0.29139256477355957,
0.36674603819847107,
-0.10188469290733337,
0.2383236438035965,
-0.17184637486934662,
-0.01354975439608097,
0.19595690071582794,
-0.18663425743579865,
0.0010547651909291744,
-0.2102815955877304,
0.796694278717041,
-0.5004498958587646,
0.274082630872... | |
What is the easiest way to save a couple of variables in an iPhone application in a long-term memory?
I have an application that works with different sqlite databases and I want after exiting from an application to save last active database name in order to open last database when user enters an application again.
It... | [
0.18730713427066803,
0.16406674683094025,
0.1394776701927185,
0.37793830037117004,
0.3605375289916992,
0.1621190309524536,
0.4135018289089203,
0.06568500399589539,
-0.2939617931842804,
-0.6570419073104858,
0.28033044934272766,
0.7937832474708557,
-0.09245078265666962,
-0.16146202385425568,... | |
like this. | [
0.02352605015039444,
-0.006145574152469635,
-0.07252716273069382,
0.06287942081689835,
-0.2829819917678833,
-0.28907257318496704,
0.2071572244167328,
-0.04029332101345062,
-0.22385174036026,
-0.34440088272094727,
0.09706991910934448,
0.022461915388703346,
-0.31550878286361694,
0.1175429522... | |
> If the area pointed to was moved, a
> free(ptr) is done.
Can you please explain the above line about `realloc()`? This line is from a man page for calloc, malloc, realloc and free.
I think this explains it better:
> If sufficient space does not exist to
> expand the current block in its
> current location, a new... | [
-0.06921739876270294,
-0.0756036639213562,
0.5357334017753601,
0.08027570694684982,
0.04750661924481392,
-0.006728636100888252,
0.15220193564891815,
-0.22317609190940857,
-0.24079501628875732,
-0.7560890913009644,
-0.4652608036994934,
0.4121688902378082,
-0.21389725804328918,
0.15887567400... | |
new
> block.
Reference taken from [realloc in C](http://www.java-samples.com/showtutorial.php?tutorialid=589) | [
-0.00962748657912016,
-0.1086113452911377,
0.15144623816013336,
-0.17830097675323486,
0.11299384385347366,
0.06439337879419327,
0.13330230116844177,
-0.28607964515686035,
-0.3891392648220062,
-0.4994399845600128,
-0.527274489402771,
-0.07768264412879944,
-0.336870938539505,
0.0360382758080... | |
I have a site using CF8 and Fusebox 5. Anytime I need to add a new feature to the site, I usually have to add a new fuse to circuit.xml.cfm for either the controller, model, or view, or all. To enable these new features/pages, I go to the following url:
```
?fusebox.load=true&fusebox.parse=true&fusebox.password=passwo... | [
0.7800723314285278,
0.2927228510379791,
0.3663046360015869,
0.017696455121040344,
0.12347565591335297,
-0.568722128868103,
0.192726269364357,
-0.11260464787483215,
-0.11532558500766754,
-0.9314619898796082,
0.1404847353696823,
0.4325801134109497,
-0.3667426109313965,
0.076267771422863,
0... | |
they're regenerated on the fly when they are needed for the first time, but I have some pages that return errors when they are accessed. The error says directory not found, but they are there, each time this comes up it's because the parse file does not exist.
Here's an example of one error with the stack trace:
```
... | [
0.12371821701526642,
0.2551448345184326,
0.31061840057373047,
0.14085479080677032,
0.05559711530804634,
-0.10904461145401001,
0.909426212310791,
0.3076934814453125,
-0.6697880625724792,
-0.7044037580490112,
-0.13500624895095825,
0.46781641244888306,
-0.27156782150268555,
0.2976018488407135... | |
the parsed directory itself is missing.
Stack Trace:
coldfusion.runtime.CustomException: Parsed File or Directory not found.
at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:124)
at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:2644)
at cffusebox52ecfm1214986498.runPage(C:\example.com... | [
-0.7084576487541199,
0.37538501620292664,
0.3234052360057831,
-0.1829247921705246,
-0.04807382449507713,
0.28632184863090515,
0.6169193387031555,
-0.36511123180389404,
-0.29001855850219727,
-0.5026659965515137,
-0.4501558542251587,
0.39602723717689514,
-0.8002128601074219,
-0.0215074773877... | |
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:74)
at coldfusion.runtime.AppEventInvoker.onR... | [
-0.2712768316268921,
-0.02165537141263485,
0.5550364255905151,
-0.2474265694618225,
-0.01824033074080944,
0.23102232813835144,
0.46637046337127686,
-0.3133309781551361,
-0.29532182216644287,
-0.8448262810707092,
-0.47223442792892456,
0.345291405916214,
-0.7449318766593933,
-0.1204288154840... | |
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunReques... | [
-0.24671827256679535,
0.19360587000846863,
0.4151892364025116,
-0.25125470757484436,
0.2888132333755493,
0.12062814086675644,
0.6096930503845215,
-0.2869850695133209,
-0.2263486236333847,
-0.8817224502563477,
-0.30617040395736694,
0.4139746129512787,
-0.608369767665863,
-0.2283871471881866... | |
the proper way to reload the circuits without generating these errors. I'm the third developer to get involved on this site, so the previous two may have had different styles of configuring each instance of circuit.xml.cfm. These files are used to determine the application flow of what includes are needed, additional s... | [
0.6121299266815186,
-0.16907693445682526,
0.4305197596549988,
0.09223977476358414,
0.1372840404510498,
-0.3590300977230072,
-0.06980786472558975,
-0.478911429643631,
-0.276535302400589,
-0.7435011267662048,
0.032760508358478546,
0.5201250910758972,
-0.20171527564525604,
-0.1452684104442596... | |
/>
<do action="vdashboard.index" />
<do action="layout.footer" />
</fuseaction>
<fuseaction name="profile">
<set name="request.title" value="Your Profile" />
<do action="layout.header" />
<!-- form submitted to the same page -->
<if condition="isDefined('attribu... | [
0.4412883520126343,
-0.3713076412677765,
0.256599098443985,
-0.04416767880320549,
-0.0003951050457544625,
0.15631558001041412,
0.05260014533996582,
-0.8738762736320496,
-0.19453275203704834,
-0.6913056969642639,
-0.16061174869537354,
0.31710124015808105,
-0.22582803666591644,
-0.3163050711... | |
<do action="mdashboard.updateprofile" />
<do action="vdashboard.profile" />
</true>
<false>
<do action="mdashboard.profile" />
<do action="vdashboard.profile" />
</false> | [
0.1393164098262787,
-0.6182398796081543,
0.11726436018943787,
-0.4819355905056,
-0.032788749784231186,
0.19103491306304932,
0.2289854735136032,
-0.6191595792770386,
-0.5461087226867676,
-0.4821276068687439,
-0.018069399520754814,
0.49535638093948364,
-0.4295135736465454,
-0.180485829710960... | |
</if>
<do action="layout.footer" />
</fuseaction>
</circuit>
<!-- model/circuit.xml.cfm -->
<circuit access="internal">
<fuseaction name="index">
<include template="sqlIndex" />
</fuseaction>
<fuseaction name="profile">
<include template="sqlProfile" />
</fuseaction>
... | [
0.17585162818431854,
-0.22176294028759003,
0.3592144250869751,
-0.13655351102352142,
0.00586158549413085,
0.01615089923143387,
-0.09154219925403595,
-0.8963632583618164,
-0.08274319767951965,
-0.6933124661445618,
-0.05157195404171944,
0.2355857938528061,
-0.43554407358169556,
-0.3075465261... | |
<fuseaction name="profile">
<include template="dspProfile" />
</fuseaction>
</circuit>
```
Here's the mixture of Fusebox and ColdFusion method:
```
<!-- controller/circuit.xml.cfm -->
<circuit access="public">
<fuseaction name="index">
<set name="request.title" value="Account overview" />
... | [
0.3010140061378479,
-0.1876271665096283,
0.45252618193626404,
-0.12640510499477386,
-0.04809752106666565,
-0.34116417169570923,
-0.11535442620515823,
-0.8617405295372009,
0.01628303714096546,
-0.5573640465736389,
-0.011686704121530056,
0.248859241604805,
-0.3579540550708771,
-0.14769293367... | |
<do action="layout.header" />
<include template="ctrlProfile" />
<do action="layout.footer" />
</fuseaction>
</circuit>
<!-- model/circuit.xml.cfm -->
<circuit access="internal">
</circuit>
<!-- view/circuit.xml.cfm -->
<circuit access="internal">
</circuit>
<!-- controller/ctrlProfile.cfm -->
<c... | [
0.3144545257091522,
0.006333399098366499,
0.4511374831199646,
-0.2638565003871918,
0.06841975450515747,
0.04120733216404915,
0.1614363044500351,
-0.5857542157173157,
-0.43939873576164246,
-0.6769689321517944,
-0.07882126420736313,
0.5348584055900574,
-0.23498417437076569,
0.009929861873388... | |
say, the Fusebox method only, but I have not been able to find a common trend in this error. The error handler we have in place emails me each time a page receives an error, so I'm thinking that I could automatically call my 2nd url and redirect them back to the page that generated the error when this specific error oc... | [
0.6127456426620483,
0.16696663200855255,
0.17635932564735413,
0.09334627538919449,
-0.096786268055439,
-0.34080928564071655,
0.646589994430542,
0.1144077479839325,
-0.16686175763607025,
-0.6356368064880371,
0.16568103432655334,
0.3575614392757416,
-0.3802443742752075,
0.12606261670589447,
... | |
recognize new fuses without clearing my parse files? CF itself isn't difficult to code, but I'm still relatively new to it, so I could be going about this backwards. Thanks!
NOTE: New **fuses** do not need a fusebox reload - only new **fuseactions** require one.
I'm not entirely certain if the errors you're getting ar... | [
0.8055886030197144,
0.33616378903388977,
0.2664131224155426,
-0.10855697095394135,
-0.030368562787771225,
-0.5667426586151123,
0.21822574734687805,
-0.577782392501831,
-0.11175544559955597,
-0.9317665696144104,
0.13520964980125427,
0.492992639541626,
-0.36486268043518066,
-0.23171147704124... | |
using `fusebox.parseall=true` and `fusebox.loadclean=true`
* Copy all files from there into your Live webroot.
* Perform a fusebox `fusebox.load=true` on the Live site - nothing else (except password).
(Note: if necessary, before step 3 set your site to offline/maintenance mode, and then after step 4 put it back onl... | [
0.5036190748214722,
0.07064203917980194,
0.029050948098301888,
-0.11204440891742706,
0.30286696553230286,
-0.7931585907936096,
0.598553478717804,
-0.18740011751651764,
0.037892818450927734,
-0.8108032941818237,
-0.466021329164505,
0.5444092154502869,
-0.5085763335227966,
-0.090023316442966... | |
I have this following IEnumerable LINQ query:
```
var query = from p in Enumerable.Range(2, 1000000)
let sumofPowers = from ch in p.ToString()
let sumOfPowers = Math.Pow(Convert.ToDouble(ch.ToString()), 5)
select sumOfPowers
where p == sumofPowers.Sum()
select p;
```
It finds the ... | [
-0.24536676704883575,
0.01782880537211895,
0.4798540472984314,
0.03524686396121979,
-0.4023332893848419,
0.267040878534317,
0.03392192721366882,
-0.5984058976173401,
-0.39244216680526733,
-0.37945324182510376,
-0.13934221863746643,
0.5718919038772583,
0.09319449961185455,
0.039827872067689... | |
is nitpick, but the range annoys me.
I have basically guessed that it has found the correct result at 1,000,000, so I let it stop there. In this scenario, the number was sufficient.
But it is just a hardcoded "random" number.
If you look at the code, you find that as soon as where `p == sumofPowers.Sum()` is true, **y... | [
0.24637366831302643,
-0.23679611086845398,
0.05962010473012924,
0.023893369361758232,
-0.23176686465740204,
-0.13408063352108002,
0.48862698674201965,
-0.2206423133611679,
-0.1584540605545044,
-0.2396705448627472,
0.023683488368988037,
0.3591495752334595,
-0.1328061819076538,
0.09970800578... | |
LINQ does deferred calculation, this will go until you reach the point where p == sumofPowers.Sum(), and then return the first element. Just wrap the entire query in (...).First(); to return the first value.
Also, while you're at it, there is no need to convert to a string then to a double - you can convert directly f... | [
-0.013520090840756893,
-0.20630870759487152,
0.6842451691627502,
-0.17116425931453705,
0.005698355846107006,
-0.16613908112049103,
-0.07015950977802277,
-0.45137524604797363,
0.04242964833974838,
0.022444603964686394,
-0.07182801514863968,
0.5578780174255371,
-0.09834811836481094,
-0.28402... | |
What do you think? Is this correct or are there memory leaks?
Source:
```
#include <QList.h>
#include <boost/shared_ptr.hpp>
#include <iostream>
class A {
private:
int m_data;
public:
A(int value=0) { m_data = value; }
~A() { std::cout << "destroying A(" << m_data << ")" << std::endl; }
operator int(... | [
-0.03613326698541641,
0.18795064091682434,
0.39200764894485474,
-0.19294904172420502,
0.25517719984054565,
0.08423208445310593,
0.5047988891601562,
-0.5490864515304565,
-0.1841435432434082,
-0.4542984664440155,
-0.305980920791626,
0.6174919009208679,
-0.5059701204299927,
0.1585663855075836... | |
you could use it to guess which of two queries might be faster, but unless one of them is obviously badly written then even that is going to be very hard.
You should also be aware that if you're using sub-queries, even running EXPLAIN can be slow (almost as slow as the query itself in some cases).
As far as I'm aware... | [
0.14409136772155762,
-0.22707901895046234,
-0.2032576948404312,
0.5525984764099121,
0.002793531399220228,
-0.03257370740175247,
0.31856265664100647,
0.06904914975166321,
0.005887574050575495,
-0.6117128133773804,
0.34003180265426636,
0.31153231859207153,
-0.07263334840536118,
0.07578162103... | |
I've recently moved to Java, but I've had some problems with variable aliasing. I've searched everywhere, but I can't seem to find the proper way to copy the contents of one object to another object without just referencing to the same object. Does anyone have any suggestions?
Edit: What if it is an int that I am havi... | [
0.3019924461841583,
0.04409680888056755,
0.2397778332233429,
0.029249660670757294,
0.18014487624168396,
-0.24167850613594055,
0.1722162961959839,
-0.028214633464813232,
-0.2891468107700348,
-0.7045309543609619,
-0.05738511309027672,
0.5084629654884338,
-0.23182089626789093,
0.3159613907337... | |
is to use [copy constructors](http://www.javapractices.com/topic/TopicAction.do?Id=12), which according to [this page](http://www.javapractices.com/topic/TopicAction.do?Id=71) are safer. | [
0.28986856341362,
0.006304605398327112,
0.19672271609306335,
0.08961399644613266,
0.459391713142395,
-0.5606731176376343,
0.056489937007427216,
-0.2068655788898468,
-0.2784269154071808,
-0.2683584690093994,
-0.31346946954727173,
0.6930578947067261,
-0.13394074141979218,
-0.336379736661911,... | |
Ive never heard of this before, and I have been coding in PHP for quite some time. I actually feel kind of stupid asking this question but, what is a PHP Framework? How can it help me? and how do I use one?
A framework in general is a **collection of classes and functions that let you accomplish your goal faster** in d... | [
0.48228058218955994,
0.061440255492925644,
-0.18013744056224823,
0.3956196904182434,
-0.2053513079881668,
-0.31133851408958435,
0.19026486575603485,
0.01616438291966915,
-0.0033188604284077883,
-0.6417012214660645,
0.36563706398010254,
0.39647966623306274,
-0.11914646625518799,
0.003057236... | |
rebuilding that functionality yourself.
To start using a framework, you download the framework itself. In the case of Zend, I download it, unpack it to lib/, and I'm good to go. From there, you just read the documentation on that particular framework to learn how to actually utilize the tools they provide. What functi... | [
0.43025991320610046,
0.12849131226539612,
-0.1154240071773529,
-0.09047646075487137,
-0.045522838830947876,
0.13102437555789948,
0.2337314635515213,
-0.02709108404815197,
-0.10468514263629913,
-0.9624649882316589,
-0.330053448677063,
0.6916382312774658,
0.29091787338256836,
0.0258796699345... | |
I'm deploying a web site and I need to run large TSQL scripts contained in a single file in a production server where I don't have full access to SQL Server console and I can't connect remotely. The scripts is a mixed of table, stored procedures and views creations. All I can do is to run 1 group of TSQL sentences, lik... | [
0.043638311326503754,
0.19032415747642517,
0.05153779685497284,
0.006572351790964603,
-0.3507194519042969,
-0.05959432199597359,
0.4019218385219574,
-0.0879649668931961,
-0.030159231275320053,
-0.884323000907898,
-0.14585000276565552,
0.25023210048675537,
-0.309155136346817,
-0.09049812704... | |
a tool I will be very fast doing the task, but I don't know any tool such that.
Do you know any tool that I can use?
I think it must be something like a control, with an editor where I will paste or load the scripts to run, and it will be able to parse and run them in sequence, like the Microsoft SQL Server Manageme... | [
0.4133724570274353,
-0.2826504409313202,
-0.06397062540054321,
0.4061890244483948,
0.04427130147814751,
-0.23419925570487976,
0.07061988860368729,
0.1280491203069687,
-0.025985781103372574,
-0.7295907735824585,
0.3631124198436737,
0.7595787048339844,
-0.17674921452999115,
-0.14337491989135... | |
Here's the problem.
I ,for example,have a string "2500".Its converted from byte array into string.I have to convert it to decimal(int).
This is what I should get:
```
string : "2500"
byte[] : {0x25, 0x00}
UInt16 : 0x0025 //note its reversed
int : 43 //decimal of 0x0025
```
How do I do that?
I think ojblass ... | [
-0.018261488527059555,
0.30659037828445435,
0.3001737892627716,
-0.08981513231992722,
0.02226182073354721,
-0.0819307267665863,
-0.09393972903490067,
-0.043832533061504364,
-0.3661881685256958,
-0.5707622766494751,
0.23630034923553467,
0.21920087933540344,
0.09831077605485916,
0.6340107321... | |
updating a row in the table but would be useless for any analysis tasks.
I would suggest improving your column names a bit. Calling a column "DateTime" is confusing and could cause you some trouble in writing queries if you aren't careful.
Anyway... the queries you are looking for range from simple to quite complex ... | [
-0.1436743289232254,
-0.02214084379374981,
0.6772547364234924,
-0.21142898499965668,
-0.09940952062606812,
0.09009496867656708,
0.22585755586624146,
-0.15708360075950623,
-0.29273298382759094,
-0.727250337600708,
-0.0029424126259982586,
0.516079306602478,
-0.28506770730018616,
-0.080624356... | |
AvgTime from Table
where ApplicaitonName = @ApplicationName and
[DateTime] >= DATEADD(minute, -1, getdate())
```
You'll end up wanting to write stored procedures for most of these. Some of the queries you talk about will require some grouping and such too... I recommend you get a book on TSQL if you go this rou... | [
0.21023471653461456,
0.08030615746974945,
0.5141149163246155,
0.08391132205724716,
-0.2741836607456207,
-0.12099260091781616,
0.2650724947452545,
-0.24920563399791718,
-0.36306896805763245,
-0.5339657664299011,
0.25378552079200745,
0.6881982684135437,
-0.2553859055042267,
-0.01842816360294... | |
be minor syntax mistakes).
```
var ctx = new MyDataContext();
var q = (from item in ctx.Table
where item.ApplicationName == "MyApplication"
select item.TimeInMs).Average();
var ctx = new MyDataContext();
var q = (from item in ctx.Table
where item.ApplicationName == "MyApplication" &&
... | [
-0.3157952129840851,
-0.08361735939979553,
0.6446372270584106,
-0.12341651320457458,
0.2920926511287689,
0.24697846174240112,
0.2349931001663208,
-0.27748262882232666,
-0.1573246270418167,
-0.7744027376174927,
-0.33934926986694336,
0.588297963142395,
-0.22528627514839172,
0.072771437466144... | |
results.
**Update:**
In answer to follow-up question from comments:
I can't think of a good way to handle it via storing the desired time intervals in another table that doesn't get massivly difficult (cursors and dynamically constructed TSQL via the Execture command).
A simpler query that gets the results you want... | [
0.01883973740041256,
-0.37038058042526245,
0.8676910400390625,
-0.04844799265265465,
-0.04516405612230301,
-0.11523176729679108,
0.08023225516080856,
-0.2173887938261032,
-0.44153961539268494,
-0.8280794024467468,
-0.27619469165802,
0.19137583673000336,
-0.13846510648727417,
0.191236257553... | |
as TimePeriod from Table
where ApplicaitonName = @ApplicationName and
[DateTime] >= DATEADD(minute, -2, getdate())
-- //repeat union as many times as needed for each time period
``` | [
0.44874346256256104,
-0.1601744145154953,
0.6266945600509644,
-0.0317915678024292,
0.49722376465797424,
0.11127199232578278,
0.1368030607700348,
-0.1889253407716751,
-0.26125168800354004,
-0.5305473804473877,
-0.1254088282585144,
0.056918758898973465,
-0.004333542659878731,
0.4634914398193... | |
I'm receiving suddenly this error on a Win2003 Server Web Application:
Microsoft VBScript runtime error '800a0006'
Overflow: 'Appname'
A bunch of updates where performed on this server but I have rolled them back all.
The page is old ASP code and if i run file monitor utility it will show the BUFFER OVERFLOW when ... | [
-0.038381412625312805,
0.2984198033809662,
0.4170758128166199,
-0.10033953934907913,
0.0037117749452590942,
0.021470988169312477,
0.3125404715538025,
0.2159920334815979,
-0.28029417991638184,
-0.7155022621154785,
0.0647253543138504,
0.48578909039497375,
-0.38304170966148376,
0.225838214159... | |
I have a Django application that I would like to deploy to the desktop. I have read a little on this and see that one way is to use [freeze](http://cx-freeze.sourceforge.net/). I have used this with varying success in the past for Python applications, but am not convinced it is the best approach for a Django applicatio... | [
0.6406835317611694,
0.35330480337142944,
-0.10546522587537766,
-0.11827407777309418,
-0.10867398977279663,
-0.3631751835346222,
0.09524742513895035,
0.10389070957899094,
-0.3466940224170685,
-0.5276697278022766,
0.5273934602737427,
0.3735012114048004,
-0.43292832374572754,
0.00582945253700... | |
running as a local daemon. It was launched by Twisted and wrapped by py2app for Mac and py2exe for Windows. There was both a browser as well as an Air front-end hitting it. It worked pretty well for the most part but I didn't get to deploy it out in the wild because the larger project got postponed. It's been a while a... | [
0.4397379457950592,
-0.2292814403772354,
0.3651953637599945,
0.01936049945652485,
-0.3953225612640381,
-0.04292896017432213,
0.38285863399505615,
0.23829041421413422,
-0.23337651789188385,
-0.5492948293685913,
0.0700688436627388,
0.2929858863353729,
-0.33498862385749817,
0.1572124809026718... | |
to load to get low-level system data. That took a while to get working across both platforms. If you can, try to avoid C extensions.
* You'll definitely need an installer. Most likely the app will end up running in the background, so you'll need to mark it as a Windows service, Unix daemon, or Mac launchd application.
... | [
0.6075512766838074,
0.12739646434783936,
0.19260922074317932,
0.04754491150379181,
-0.1406642496585846,
-0.21520499885082245,
0.2958836555480957,
0.372747540473938,
-0.5277835726737976,
-0.6964734792709351,
-0.3436395525932312,
0.5753827095031738,
-0.3105224370956421,
0.08532054722309113,
... | |
taken and save it to a config file. You then load the config file inside your settings.py and whatever front-end you're going to deploy. That's the shared port. Or you could just pick a random number and hope no other service on the desktop steps on your toes :-)
* If your front-end and back-end are separate apps then ... | [
0.582329511642456,
0.007543100975453854,
0.1147087961435318,
0.019001159816980362,
-0.017757650464773178,
-0.22776255011558533,
-0.1948956847190857,
0.09711193293333054,
-0.3863404393196106,
-0.5560147166252136,
0.11457494646310806,
0.6292396783828735,
-0.3034360408782959,
-0.1269125938415... | |
send notifications to the user, you'll want to integrate with something like Growl or get Python for Windows extensions so you can bring up toaster pop-up notifications.
* You'll probably want to stick with SQLite for database in which case you'll want to make sure you use semaphores to tackle multiple requests vying f... | [
0.6296630501747131,
0.09665730595588684,
0.12224408239126205,
0.048045814037323,
-0.313611775636673,
0.032847557216882706,
0.4870572090148926,
0.16525676846504211,
-0.5173155069351196,
-0.8233047723770142,
-0.2797654867172241,
0.5805670619010925,
-0.45953571796417236,
-0.021327855065464973... | |
a given time so it won't be as much of an issue.
* You'll also want some sort of access to local system logging facilities since the app will be running in the background and make sure you trap all your exceptions and route it into the syslog. A big hassle was debugging Windows service startup issues. It would have bee... | [
0.6276898980140686,
0.09686138480901718,
0.22349151968955994,
0.15045703947544098,
-0.1087801530957222,
-0.24942795932292938,
0.6114092469215393,
0.08672674000263214,
-0.5879507064819336,
-0.6176814436912537,
-0.12580521404743195,
0.5003392696380615,
-0.061281967908144,
-0.2014020085334777... | |
at startup.
* Test actual deployment especially across a variety of firewalls. Some of the desktop firewalls get pretty aggressive about blocking access to network services that accept incoming requests.
That's all I can think of. Hope it helps. | [
0.4030081629753113,
0.28342166543006897,
0.183043971657753,
0.11934132128953934,
0.13541728258132935,
0.023991459980607033,
0.5745893120765686,
0.2847808003425598,
-0.22334788739681244,
-0.7155149579048157,
-0.13068534433841705,
0.48634397983551025,
0.1499592810869217,
-0.21373239159584045... | |
Let's say I instantiate an object in Javascript like this:
```
var myObj = new someObject();
```
Now, is it possible to obtain the var object's name as string `'myObj'` from within one of the class methods?
---
### Additional details (edited):
The reason why I would like to get the name of the variable holding re... | [
0.029277155175805092,
0.07182995975017548,
0.2593461573123932,
-0.16066542267799377,
-0.2178051620721817,
-0.09505637735128403,
0.005894915666431189,
0.25712981820106506,
-0.08396238833665848,
-0.4670442044734955,
-0.1501915454864502,
0.596815288066864,
-0.296282023191452,
0.02248750813305... | |
way of doing this?
---
You are right, sorry for the mixup in terminology.
The reason why I would like to get the name of the variable holding reference to the object is that my new myObj would create a new clickable DIV on the page that would need to call a function myObj.someFunction(). As I insert the new DIV I ne... | [
0.27265605330467224,
0.07315420359373093,
0.299223393201828,
0.24429918825626373,
-0.005971335805952549,
-0.08216607570648193,
0.20968832075595856,
0.1490798145532608,
-0.19118939340114594,
-0.4055776298046112,
0.0390484444797039,
0.4313634932041168,
-0.19366353750228882,
0.175263211131095... | |
multiple variables. If you don't really care about that, and all you want is to find the name of one of the global variables that refers to that object, you could do the following hack:
```
function myClass() {
this.myName = function () {
// search through the global object for a name that resolves to this obj... | [
-0.03062150999903679,
-0.1283278465270996,
0.2896102964878082,
0.09025895595550537,
0.14725668728351593,
0.0033084361348301172,
0.2579059600830078,
0.2701520323753357,
-0.47789689898490906,
-0.5575429797172546,
0.17723563313484192,
0.6256237030029297,
-0.48360762000083923,
0.47079262137413... | |
be referred to as this at the top level, in a
// property on our prototype, so we can refer to it in our object's methods
myClass.prototype.global = this
// create a global variable referring to an object
var myVar = new myClass()
myVar.myName() // returns "myVar"
```
Note that this is an ugly hack, and should not be... | [
0.08782505989074707,
0.0962599366903305,
0.2868078351020813,
-0.13274480402469635,
-0.0868268683552742,
-0.1588045060634613,
0.3537307381629944,
0.15113946795463562,
-0.2870890498161316,
-0.8441137671470642,
0.0508689247071743,
0.3503762185573578,
-0.32861319184303284,
0.6309733390808105,
... | |
something, you should pass the name in to the constructor when you create it.
**edit**: To respond to your clarification, if you need to be able to refer to something from an event handler, you shouldn't be referring to it by name, but instead add a function that refers to the object directly. Here's a quick example t... | [
0.5664116144180298,
-0.35132795572280884,
0.16520608961582184,
-0.11918601393699646,
0.20113225281238556,
-0.3323800563812256,
0.21782286465168,
-0.004080410115420818,
-0.4808761179447174,
-0.6439376473426819,
-0.2645496726036072,
0.43849897384643555,
-0.29881325364112854,
0.15951856970787... | |
= document.createElement("div")
var contents = document.createTextNode("Click me!")
// This is the crucial part. We don't construct an onclick handler by creating a
// string, but instead we pass in a function that does what we want. In order to
// refer to the object, we can't use this directly (since that wi... | [
-0.04260489344596863,
-0.35956650972366333,
0.31295812129974365,
-0.09876325726509094,
0.22472497820854187,
-0.14914695918560028,
0.1345900297164917,
-0.043500468134880066,
-0.07302948832511902,
-0.5970397591590881,
-0.20183637738227844,
0.5333094000816345,
-0.46256223320961,
0.14955416321... | |
obj.clickme()
}
})(this)
newDiv.appendChild(contents)
document.getElementById("frobnozzle").appendChild(newDiv)
}
window.onload = function () {
var myVar = new myConstructor()
}
``` | [
-0.3053286075592041,
0.10793816298246384,
0.7035850882530212,
-0.3179015517234802,
0.3604726493358612,
0.014768466353416443,
0.5171672701835632,
-0.18724636733531952,
-0.29960888624191284,
-0.9020037651062012,
-0.4459645748138428,
0.5914934873580933,
-0.28552958369255066,
0.429310113191604... | |
(I'm sure this is a FAQ, but also hard to google)
Why does Python use abs(x) instead of x.abs?
As far as I see everything abs() does besides calling `x.__abs__` could just as well be implemented in object.abs()
Is it historical, because there hasn't always been a root class?
The official answer from Guido van Rossum... | [
0.23323647677898407,
-0.0648137778043747,
-0.039790473878383636,
-0.15048427879810333,
-0.04746173322200775,
-0.13061325252056122,
0.30004647374153137,
-0.2524016201496124,
-0.5155566930770874,
-0.1502819061279297,
-0.32342618703842163,
0.3931232690811157,
-0.4329291582107544,
-0.113020524... | |
The .net framework 4 is apparently going to include a BigInteger class. However, I can't seem to find out whether or not it will be immutable. I also can't seem to decide whether or not that would be a good thing.
Immutability has a ton of benefits, especially for something as "value-like" as a big-int. On the other h... | [
0.05995569005608559,
-0.2834954261779785,
0.2887400984764099,
0.10308881849050522,
-0.200913205742836,
-0.30683815479278564,
0.2406119406223297,
-0.12848220765590668,
-0.02830209955573082,
-0.48600342869758606,
-0.23786988854408264,
0.7264207005500793,
-0.4899705946445465,
-0.1507009267807... | |
library class (think String).
Does anyone know if it will be immutable? Do you think it should be immutable?
I believe it will be immutable (I gather they are basically bringing the DLR implementation, which is immutable, into the core).
Yes, it should be immutable. It should behave like other numeric value types suc... | [
0.22526775300502777,
-0.3532479405403137,
-0.20217689871788025,
0.3484760522842407,
0.02470487542450428,
-0.24847626686096191,
0.04202580824494362,
0.09939827024936676,
-0.11780388653278351,
-0.5486358404159546,
0.01100072544068098,
0.5723924040794373,
-0.417963445186615,
0.408414244651794... | |
Sorry, I'm sure this is simple but I'm tired and can't figure it out.
I have an array of elements, each element is in fact a particle which is a data structure (a struct in c) containing, among other things the particles current position (int x,y,z). I want to compare the elements x position not just the element itsel... | [
0.0817512720823288,
0.09157256036996841,
0.2895337641239166,
-0.13763971626758575,
-0.15954773128032684,
0.11153392493724823,
0.11675476282835007,
-0.49739518761634827,
-0.08540269732475281,
-0.6177619695663452,
0.11044837534427643,
-0.12569265067577362,
-0.30142465233802795,
0.42773243784... | |
j = i - 1;
while (j >= 0 && particles[j].position.x > value) {
particles[j+1] = particles[j];
j = j - 1;
}
particles[j+1] = particles[i];
}
```
If someone could point out my mistake that would be great!
Adam
Your 2nd line acts to store a temporary copy of the ith element, because the whil... | [
0.037700772285461426,
0.2285410761833191,
-0.03290417417883873,
-0.18114469945430756,
-0.09595444798469543,
0.3321891725063324,
0.845237672328949,
-0.2996070981025696,
-0.250824898481369,
-0.3982965052127838,
-0.41786858439445496,
-0.24041830003261566,
-0.26105934381484985,
0.2298503816127... | |
and it should work (changes commented):
```
for (i = 1; i<length; i++) {
value = particles[i]; // store particles[i] rather than it's x coordinate
j = i - 1;
while (j >= 0 && particles[j].position.x > value.position.x) { // changed
particles[j+1] = particles[j];
j = j - 1;
}
particl... | [
0.2713070809841156,
-0.0856170579791069,
0.5276187062263489,
-0.07060488313436508,
0.15585286915302277,
0.05088495835661888,
0.3367745578289032,
-0.4448970854282379,
-0.1534942388534546,
-0.49725061655044556,
-0.2670796811580658,
0.38814806938171387,
-0.3752376437187195,
0.0467744953930377... | |
My asp.net web pages are on IIS web server and it communicates with WCF services(sitting on windows 2008 app server) using basic HTTP binding.
The performance of my wcf services doesnt seem to be that good and I want to improve the same.Also, I need to balance on scalability as my site will be having a very high traffi... | [
0.12418224662542343,
-0.0711890235543251,
0.6354761123657227,
-0.16194909811019897,
-0.5333889722824097,
-0.0008899997919797897,
0.3680204749107361,
-0.26697367429733276,
-0.1549226939678192,
-0.932812511920929,
0.04796196520328522,
0.3723401725292206,
-0.390396386384964,
0.099458917975425... | |
has hooks for WCF, allowing you to mark operations on your service contract as [`ProtoBehavior`](http://code.google.com/p/protobuf-net/source/browse/trunk/protobuf-net/ServiceModel/ProtoBehaviorAttribute.cs). This then swaps the regular `DataContractSerializer` to use protobuf-net serialization. However, there are some... | [
0.2647039294242859,
-0.25256726145744324,
0.2618088126182556,
-0.16473238170146942,
-0.035722386091947556,
-0.007756850216537714,
0.05450402945280075,
-0.1725165992975235,
-0.3713058531284332,
-0.6967604160308838,
-0.14389324188232422,
0.4106244742870331,
-0.41340795159339905,
-0.053134746... | |
size; you can get an idea of protobuf-net's sizes [here](http://code.google.com/p/protobuf-net/wiki/Performance).
Alternatively, I'm also working on a bespoke RPC stack. The [current build](http://code.google.com/p/protobuf-net/downloads/list) has a working stack over http, but I also plan to enable it on raw TCP/IP w... | [
0.4389245808124542,
-0.006677467841655016,
0.36781030893325806,
-0.27853795886039734,
-0.2776893079280853,
0.06044017896056175,
-0.042250439524650574,
-0.16884230077266693,
-0.5367006063461304,
-0.7294592261314392,
-0.15346659719944,
0.4490226209163666,
0.05883026868104935,
0.0757687762379... | |
I have some PHP code that generates dynamic tables of data on the fly. By clicking various links you "refine" the tables of data. What I'd like is each of these links to retain the current GET information and add to it. IE:
```
$allPreviousVars = ???; // Could be 20+ vars
echo "<a href='".$allPreviousVars."&newVar=2'>... | [
0.4562585949897766,
0.017712248489260674,
0.4381448030471802,
0.11930026113986969,
-0.19478783011436462,
-0.10071799904108047,
0.3620470464229584,
-0.17621064186096191,
-0.35273614525794983,
-0.5585151314735413,
0.1494056135416031,
0.7005769610404968,
-0.18863272666931152,
-0.0659128203988... | |
variable in htmlspecialchars() before you output it. Otherwise someone could type a URL with `">` in it, and it would break your link. | [
-0.04418342560529709,
-0.38246992230415344,
0.4204570949077606,
0.040841855108737946,
-0.29627031087875366,
-0.27572283148765564,
0.4245091676712036,
0.17198868095874786,
-0.0645446926355362,
-0.4720067083835602,
-0.1788857877254486,
0.26116710901260376,
-0.3941219747066498,
0.213816285133... | |
I want to match /foo, but not /foo/ (where foo can be any string) or /
I tried a lot of things along these lines:
```
sub match :Path :Regex('^[a-z]+$')
sub match :Regex('^[a-z]+$')
sub match :Path :Args(1)
```
But I cannot achieve what I need.
I don't believe the problem is with my regex, but because I want to ha... | [
0.08084827661514282,
0.3475729525089264,
0.39401426911354065,
-0.3391674757003784,
-0.0945904329419136,
0.17598854005336761,
0.01955772005021572,
-0.3825678527355194,
-0.07523662596940994,
-0.5220339298248291,
0.05402572453022003,
0.7706597447395325,
-0.5500034689903259,
0.0628705918788909... | |
elements after the regex that the regex itself doesn't match will get eaten as arguments to the action.
(People who are telling you things about your regexp and saying 'I don't know Catalyst but' are missing the point here that $ in a regexp matcher can match just before a '/', and not always at the end of the URL, i... | [
0.11543779820203781,
-0.1628856509923935,
0.32159462571144104,
-0.20719614624977112,
-0.09176183491945267,
-0.07503291964530945,
0.17845042049884796,
-0.3899918496608734,
0.09916962683200836,
-0.46031802892684937,
-0.12633740901947021,
0.5337181091308594,
-0.37704822421073914,
-0.041424144... | |
:Args(0)
```
demonstrates that `/foo` and `/foo/` both match, (but this is a step closer: `/match/xyz` doesn't). Catalyst treats '/' specially in paths, so I'm not sure if you can do better than this. | [
0.42502498626708984,
0.4533824324607849,
0.15887215733528137,
-0.39374610781669617,
-0.38483190536499023,
-0.2918105721473694,
0.29672423005104065,
-0.42214488983154297,
0.14401808381080627,
-0.46119850873947144,
0.23534812033176422,
0.49360746145248413,
-0.6087509393692017,
0.145965352654... | |
I've a .net WCF windows service running on an app server which keeps monitoring a folder for xml files.
How do I make this service run only at a particular time (01.00 hours) everyday ?
Thanks.
Is your service a real service or just a WCF application which monitors the XML folder?
In case your WCF service is just a n... | [
0.6424321532249451,
-0.03293498978018761,
0.583920955657959,
0.18465308845043182,
-0.18495474755764008,
-0.4243479371070862,
0.3419225513935089,
0.004693510942161083,
-0.2940433919429779,
-0.9592477679252625,
0.005849082488566637,
0.5728114247322083,
-0.34242013096809387,
0.157734602689743... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.