text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm working on a Python library that interfaces with a web service API. Like many web services I've encountered, this one requests limiting the rate of requests. I would like to provide an optional parameter, `limit`, to the class instantiation that, if provided, will hold outgoing requests until the number of seconds ... | [
0.12137831747531891,
-0.2245936095714569,
0.18713884055614471,
0.05823010206222534,
0.20056279003620148,
-0.002124207792803645,
0.11152216792106628,
-0.1127111166715622,
-0.3692314922809601,
-0.29364335536956787,
-0.07645881175994873,
0.2251126766204834,
-0.21820248663425446,
0.31506365537... | |
all likelihood, the lock is the countdown timer itself.) If another request is made within this time frame, it must be queued until the countdown timer reaches zero and the lock is disengaged; at this point, the oldest request on the queue is sent, and the countdown timer is reset and the lock is re-engaged.
Is this a... | [
-0.040345773100852966,
-0.16449739038944244,
0.44420361518859863,
0.08287172019481659,
0.1715034693479538,
0.17205910384655,
0.14653947949409485,
-0.13383448123931885,
-0.3953344523906708,
-0.25811347365379333,
-0.13801705837249756,
0.508267343044281,
-0.2487524300813675,
0.399686425924301... | |
functionality within a library? I reason since, by default, the countdown is zero seconds, the library still allows developers to use the library and provide their own rate-limiting schemes. Given any developers using the service will need to rate-limit requests anyway, however, I figure that it would be a convenience ... | [
0.16867032647132874,
-0.19410952925682068,
0.2482575625181198,
0.25045979022979736,
0.13541705906391144,
0.05952409654855728,
0.25488391518592834,
-0.22890610992908478,
-0.4787091314792633,
-0.400192528963089,
-0.07772177457809448,
0.4524158835411072,
-0.11729246377944946,
0.01513444725424... | |
**source** and **dispatch**. These can be separate threads (or separate processes if that's easier).
The **Source** side creates and enqueues requests at whatever rate makes them happy.
The **Dispatch** side does this.
1. Get the request start time, *s*.
2. Dequeues a request, process the request through the remote ... | [
0.5126498937606812,
-0.26580682396888733,
0.4151478707790375,
0.22059530019760132,
0.05859341844916344,
-0.008607848547399044,
-0.06851763278245926,
-0.16968271136283875,
-0.3350701928138733,
-0.8758113980293274,
-0.10978850722312927,
0.652212381362915,
-0.004020498599857092,
0.03724425286... | |
some representation for each request that you can enqueue. Since the Python [Queue](https://docs.python.org/2/library/queue.html) will handle almost anything, you don't have to do much.
If you're using multi-processing, you'll have to [pickle](https://docs.python.org/2/library/pickle.html) your objects to put them in... | [
0.47355830669403076,
-0.21505047380924225,
0.01441157329827547,
0.04482995718717575,
-0.031281035393476486,
0.2091602385044098,
-0.11018432676792145,
-0.12783557176589966,
-0.26709628105163574,
-0.692568302154541,
0.16990059614181519,
0.22121085226535797,
-0.3365628123283386,
-0.0043889074... | |
> **Possible Duplicate:**
>
> [Use SVN Revision to label build in CCNET](https://stackoverflow.com/questions/1160/use-svn-revision-to-label-build-in-ccnet)
I'm working through the process of installing CruiseControl.net and converting an Msbuild script to work with it. I'd like our build number to reflect the Subve... | [
0.08598226308822632,
0.048620689660310745,
0.8361777067184448,
-0.1008363738656044,
0.21128273010253906,
-0.20620287954807281,
0.2653428018093109,
0.1255771815776825,
-0.3821603059768677,
-0.7448865175247192,
0.21691559255123138,
0.5885511636734009,
0.18597222864627838,
0.16973914206027985... | |
compiled results.
I found a duplicate question. [Use svn revision to label build in ccnet](https://stackoverflow.com/questions/1160/use-svn-revision-to-label-build-in-ccnet). This lead me to [svnRevisionLabeller](http://code.google.com/p/svnrevisionlabeller/) available on Google Code
This seems to be the best solution... | [
0.2326928973197937,
0.15651588141918182,
0.6871354579925537,
-0.06121443957090378,
-0.10186421871185303,
-0.19601044058799744,
0.2537964880466461,
-0.20781493186950684,
-0.3221127688884735,
-0.40242376923561096,
0.03907060995697975,
0.4900234639644623,
0.08566947281360626,
0.29490378499031... | |
I am new to Ruby on Rails, I have completed the [Blog Tutorial](http://guides.rubyonrails.org/getting_started_with_rails.html).
I am now trying to add an additional action to the controller, called 'start'.
```
def start
end
```
I have added a view page "app/views/posts/start.html.erb" containing nothing but simple... | [
0.1976528763771057,
0.13667336106300354,
0.396564245223999,
-0.2922076880931854,
-0.2865096628665924,
-0.13141858577728271,
0.3632183372974396,
-0.2854456901550293,
-0.3410397171974182,
-0.7161564826965332,
0.07439832389354706,
0.41343581676483154,
-0.35757941007614136,
0.01725891605019569... | |
/posts/start
def start
end
# GET /posts
# GET /posts.xml
def index
@posts = Post.find(:all)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @posts }
end
end
# GET /posts/1
# GET /posts/1.xml
def show
@post = Post.find(params[:id])
resp... | [
0.03464757278561592,
0.04390440881252289,
0.5818731188774109,
-0.09844321012496948,
-0.2598743438720703,
0.2841302156448364,
0.33567482233047485,
-0.7065439224243164,
-0.13624252378940582,
-0.6119428873062134,
-0.3715859651565552,
0.2152581661939621,
-0.2536502778530121,
-0.169446542859077... | |
end
end
end
```
Yes I have restarted the server and tried it with Mongrel and webrick.
Your routing isn't set up to allow that route. Assuming you're using the default scaffolding, put this line *before* the `map.resources :posts` line in config/routes.rb:
```
map.connect "posts/:action", :controller => 'posts', ... | [
0.023890003561973572,
-0.27020564675331116,
0.5948304533958435,
0.007236566860228777,
-0.0017448203871026635,
-0.2367820292711258,
0.1605321168899536,
-0.1204427033662796,
-0.29919445514678955,
-0.8136613368988037,
-0.0129838353022933,
0.3191360831260681,
-0.3685090243816376,
0.18017271161... | |
I was wondering if there's a way (even a manual one) to setup an ASP.NET MVC project with unit tests under Visual Web Developer Express 2008 SP1.
ASP.NET MVC 1.0 (Release version) comes bundled with templates for Visual Web Developer Express 2008. Not sure if SP1 is required or not, though. | [
0.31505724787712097,
-0.03214399889111519,
0.25118356943130493,
0.057497043162584305,
-0.25319793820381165,
-0.3251853883266449,
0.17405329644680023,
-0.09250367432832718,
-0.17412278056144714,
-0.21564817428588867,
-0.028543807566165924,
0.6197150349617004,
-0.08247476071119308,
-0.465871... | |
I'm having an issue with the 3.1 version of the logging application block...
With 3.5 framework my application works fine on my desktop... once it's deployed out to our qa box... the logging ceases to function. The web.config is identical in both scenarios. Any ideas? Permissions issue?
After a quick diagnosis... tur... | [
0.6408196687698364,
0.2640451192855835,
0.41667306423187256,
-0.03958979621529579,
0.06908529996871948,
-0.31865760684013367,
0.6112155914306641,
-0.06468671560287476,
-0.197012796998024,
-0.5285298824310303,
0.008009405806660652,
0.6142520904541016,
-0.43143951892852783,
0.235422983765602... | |
with permissions on our target machine we are deploying to. While our dev environment was "deployed" using the built in web server via visual studio, our integration environment was a 2003 server (hopefully your seeing where I'm going with this). Turns out to be a permissions issue with the default application pool set... | [
0.16141115128993988,
-0.1412818878889084,
0.33707231283187866,
0.1626397967338562,
0.19741296768188477,
-0.40776604413986206,
0.43083277344703674,
-0.3263154625892639,
-0.2972223162651062,
-0.5480854511260986,
-0.133523091673851,
0.6218187808990479,
-0.06217297539114952,
-0.225625559687614... | |
documentation of the EntLib for running under partial trust which is where you can find most of the information you need. | [
0.4177781045436859,
0.019535835832357407,
0.1994587779045105,
0.258017897605896,
0.14457164704799652,
-0.9323785901069641,
0.24744457006454468,
0.1697455495595932,
-0.014940247870981693,
-0.5753467082977295,
-0.07478594034910202,
0.17236153781414032,
0.21527129411697388,
0.0174631942063570... | |
Is there any way to access the `<compilation />` tag in a web.config file?
I want to check if the "*debug*" attribute is set to "*true*" in the file, but I can't seem to figure out how to do it. I've tried using the `WebConfigurationManager`, but that doesn't seem to allow me to get to the `<compilation />` section.
... | [
0.8555037975311279,
0.2677362859249115,
0.02947370521724224,
0.28720197081565857,
-0.03325941786170006,
-0.26268962025642395,
0.45222580432891846,
0.04228521138429642,
-0.12981747090816498,
-0.4467325508594513,
0.05159622058272362,
0.6462219953536987,
0.07491008192300797,
0.148774906992912... | |
already ways to get App Settings and Connection Strings.
I've also tried using the `WebConfigurationManager.GetSection()` method in a few ways:
```
WebConfigurationManager.GetSection("compilation")// Name of the tag in the file
WebConfigurationManager.GetSection("CompilationSection") // Name of the class that I'd ex... | [
0.5736978650093079,
0.05899124965071678,
0.46934211254119873,
0.20558813214302063,
0.19367580115795135,
0.05561316758394241,
0.0520898699760437,
-0.24228399991989136,
-0.7383871078491211,
-0.6250466704368591,
-0.01031713280826807,
0.570412814617157,
-0.25143417716026306,
0.2004525959491729... | |
ConfigurationManager.GetSection( "system.web/compilation" );
```
You can then check the `configSection.Debug` property.
**TIP:** if you need to know how to get a value from a config file, check the machine.config file in your `\Windows\Microsoft.net\Framework\<version>\CONFIG` folder. In there you can see how all th... | [
0.5911752581596375,
-0.30981242656707764,
0.2721896469593048,
0.14707878232002258,
0.2911224067211151,
-0.3502270579338074,
-0.12189459055662155,
-0.08221807330846786,
-0.3543059825897217,
-0.8634408116340637,
-0.05835336074233055,
0.7126443982124329,
-0.1721484512090683,
0.152074635028839... | |
We've got an ASP.Net 2.0 (VS2005) application that works fine locally, but sometimes loses session state when deployed on the remote server.
I suspect a possible issue with IIS recyling the application and thereby blowing away the users' session state. However, the server is remote not under our control... so we can'... | [
0.09588822722434998,
0.12552699446678162,
0.19343872368335724,
0.1175982654094696,
0.08617427200078964,
-0.33502545952796936,
0.6521618962287903,
0.07438258826732635,
-0.3047470450401306,
-0.5463554263114929,
-0.22265589237213135,
0.5524301528930664,
-0.21723686158657074,
0.273968547582626... | |
anything from the Session object but of course... those are famous last words, eh?)*
**How would you diagnose this programatically?**
I'm mostly trying to figure out how to diagnose the issue; if overzealous application recycling is the culprit it shouldn't be too hard to code around.
I'm sure this is a common issu... | [
0.08260762691497803,
0.12111073732376099,
-0.05299398675560951,
0.05052423104643822,
-0.20345613360404968,
-0.47114792466163635,
0.7644674181938171,
0.1500818282365799,
-0.7402333617210388,
-0.31182238459587097,
-0.1108749583363533,
0.49157923460006714,
-0.2946053445339203,
0.2613410651683... | |
I have the following structure: message (message table) may have multiple fields (fields table), and each field may have multiple subfields (stored in the same "fields" table with the only difference that fields dont have values in the "ParentField" column). Subfields may have subsubfields, etc., but this is not import... | [
0.10285449773073196,
0.26476314663887024,
0.3136405944824219,
-0.1865110546350479,
-0.522778332233429,
0.35550275444984436,
0.23377645015716553,
-0.4113480746746063,
-0.059672754257917404,
-0.3659394085407257,
0.14174586534500122,
0.3839648962020874,
-0.21148501336574554,
0.193374723196029... | |
fieldresul0_.ID as ID2_,
fieldresul0_.ID as ID5_1_,
fieldresul0_.Field_ID as Field2_5_1_,
fieldresul0_.Name as Name5_1_,
fieldresul0_.Value as Value5_1_,
fieldresul0_.MessagePosition as MessageP5_5_1_,
fieldresul0_.MessageResults_ID as MessageR6_5_1_,
... | [
-0.40798521041870117,
-0.1322488933801651,
0.11229806393384933,
-0.3544735014438629,
-0.06772585958242416,
0.6441380381584167,
0.16302914917469025,
0.020428607240319252,
-0.033082570880651474,
-0.40395596623420715,
-0.2578205168247223,
0.20243272185325623,
-0.21801282465457916,
0.146663397... | |
fieldresul1_.ID as ID5_0_,
fieldresul1_.Field_ID as Field2_5_0_,
fieldresul1_.Name as Name5_0_,
fieldresul1_.Value as Value5_0_,
fieldresul1_.MessagePosition as MessageP5_5_0_,
fieldresul1_.MessageResults_ID as MessageR6_5_0_,
fieldresul1_.ParentField_ID as Pa... | [
-0.4710160791873932,
-0.14627930521965027,
0.2003476321697235,
-0.4359586834907532,
-0.036420390009880066,
0.5180381536483765,
0.06756731867790222,
-0.11674696207046509,
0.02514180727303028,
-0.40206289291381836,
-0.2679821252822876,
0.20586515963077545,
-0.19108682870864868,
0.15916410088... | |
ON fieldresul0_.ParentField_ID=fieldresul1_.ID
WHERE fieldresul0_.MessageResults_ID=@p0
ORDER BY fieldresul0_.MessagePosition
```
Here is mapping file that ActiveRecord generates:
```
<?xml version="1.0" encoding="utf-16"?>
<hibernate-mapping auto-import="true" default-lazy="false" xmlns:xsd="http://www.w... | [
-0.3668428957462311,
0.020647943019866943,
0.7329437732696533,
-0.4380612373352051,
-0.32510146498680115,
0.07957468181848526,
0.15477532148361206,
-0.35746538639068604,
-0.08083947002887726,
-0.436928927898407,
-0.28899940848350525,
0.5176165699958801,
-0.20209264755249023,
-0.06668113917... | |
<param name="sequence">FieldResults_ID</param>
</generator>
</id>
<property name="FieldID" access="property" type="String">
<column name="Field_ID"/>
</property>
<property name="Name" access="property" type="String">
<column name="Name"/>
... | [
-0.17902101576328278,
0.09093299508094788,
0.008965561166405678,
-0.13930457830429077,
-0.06562338024377823,
0.42189088463783264,
-0.11770383268594742,
-0.8081042170524597,
-0.42309993505477905,
-0.25862953066825867,
-0.3747420310974121,
0.08070603758096695,
-0.12702099978923798,
0.2225102... | |
<property name="DisplayValue" access="property" type="String">
<column name="Value"/>
</property>
<property name="MessagePosition" access="property" type="Int32">
<column name="MessagePosition"/>
</property>
<many-to-one name="ParentMessage" access="prop... | [
-0.11305844783782959,
0.009813143871724606,
0.1799301654100418,
-0.046499062329530716,
0.11364077776670456,
0.2129981517791748,
0.03443275764584541,
-0.24314282834529877,
-0.21691936254501343,
-0.7033209204673767,
-0.2752719819545746,
0.4315843880176544,
-0.0700538158416748,
0.358838379383... | |
Data" column="ParentField_ID" />
<bag name="Children" access="property" table="FieldResults" lazy="false" cascade="all" order-by="Field_ID">
<key column="ParentField_ID" />
<one-to-many class="FieldResult, Data" />
</bag>
</class>
</hibernate-mapping>`
```
No... | [
0.014984267763793468,
0.028209464624524117,
0.7293724417686462,
0.19898143410682678,
0.29268884658813477,
-0.09326110780239105,
0.16067984700202942,
-0.40643975138664246,
-0.007068312726914883,
-0.7190878987312317,
-0.3528975546360016,
0.32534870505332947,
0.01635570451617241,
0.0094659365... | |
book, inbox,**
> **pictures...) ?**
>
> Generally no, this is
> considered a security risk and most
> manufacturers don't allow it. However,
> a very small minority do, so check out
> their developer's site.
So that'd be no. There's no direct way in MIDP libraries to access that data anyway. It may however be ... | [
0.49405789375305176,
-0.01949235610663891,
0.2824375331401825,
0.2621923089027405,
0.08139076828956604,
-0.44973939657211304,
0.27750566601753235,
-0.0604453943669796,
-0.23477031290531158,
-0.8809311985969543,
-0.4194042384624481,
0.4959823787212372,
0.03830110654234886,
-0.09408054500818... | |
Currently I am designing a new website and I want to plan it properly.
The main page consists of a Top Content (Header including logo etc) The body with the menu on the left and obviously the footer at the end of the page.
In the menu I have 50 pages and I want to change ONLY the body content of it.
It is not worth ... | [
0.5579848289489746,
-0.02193639427423477,
0.43973714113235474,
0.17198559641838074,
-0.1736733317375183,
-0.19104155898094177,
0.24316607415676117,
0.012656922452151775,
-0.3567987084388733,
-0.7110449075698853,
0.02008897438645363,
0.4488270878791809,
-0.06714990735054016,
-0.201007425785... | |
I'm just learning asp.net mvc and I'm trying to figure out how to move my controllers into a separate project. Typically when I have designed asp.net web apps before, I created one project for my models, another for my logic, and then there was the web.
Now that I'm learning asp.net mvc I was hoping to follow a simil... | [
0.27455198764801025,
-0.16241179406642914,
0.33237990736961365,
0.44257214665412903,
0.13606657087802887,
0.05295579507946968,
-0.3624702990055084,
0.014489603228867054,
-0.2084001898765564,
-0.7071071863174438,
0.307600736618042,
0.37625208497047424,
-0.26068609952926636,
0.00727841444313... | |
be "found". Also, I would like to know if this is advisable. Thanks!
First of all, it is certainly a good idea to put your model into a separate project. As you've discovered, this is trivial.
Regarding Controllers and Views, I don't see any obvious advantage to separating them for most basic projects, although you ma... | [
0.4232540428638458,
-0.17829495668411255,
0.20267465710639954,
0.5934133529663086,
0.09477484226226807,
-0.16239361464977264,
-0.3043898642063141,
0.08256006240844727,
-0.016963504254817963,
-0.6466735601425171,
0.15593567490577698,
0.702441394329071,
-0.2657754123210907,
0.254391282796859... | |
look at the source code for the DefaultControllerFactory to get an idea for how this is done. Subtyping this class and overriding the GetControllerType(string controllerName) method may be enough to accomplish what you're asking.
Once you've created your own custom ControllerFactory, you add the following line to Appl... | [
0.04793551564216614,
-0.030336784198880196,
0.4851587116718292,
0.10345781594514847,
0.08638840913772583,
-0.16185453534126282,
0.1295415759086609,
-0.21113744378089905,
-0.3397437632083893,
-0.7438840866088867,
-0.28707486391067505,
0.3331938087940216,
-0.38176989555358887,
0.236268132925... | |
but possibly good enough for simple cases. | [
-0.12716245651245117,
0.18893268704414368,
-0.147179514169693,
0.08553142100572586,
0.09049896895885468,
0.12447447329759598,
0.005684247240424156,
-0.018116364255547523,
-0.09207220375537872,
-0.09095016866922379,
0.21843355894088745,
0.3384120464324951,
0.06237788498401642,
-0.0736023932... | |
I'm using a UINavigationController and I'm having trouble releasing objects when I push a new view. I want to set an object on the new controller before pushing it. The way I'm currently doing this is:
```
OpenPageViewController *varOpenPageController = [[OpenPageViewController alloc] initWithNibName:@"OpenPageViewCon... | [
-0.21027474105358124,
-0.02525704726576805,
0.8364013433456421,
0.04065343737602234,
-0.2478950023651123,
-0.08781463652849197,
0.5156241655349731,
-0.1766580045223236,
-0.2345934510231018,
-1.0170036554336548,
-0.2114085704088211,
0.5867938995361328,
-0.30751287937164307,
0.33816316723823... | |
this by:
```
Page *pageObj = [[bookObj pagesArray] objectAtIndex:currentPage];
pageObj.page_Text = textView.text;
[[bookObj pagesArray] replaceObjectAtIndex:currentPage withObject:pageObj];
//[pageObj release];
```
The program crashes if I uncomment that last line as well. It will let me navigate forward but when I ... | [
-0.014440815895795822,
0.3481296896934509,
0.29505956172943115,
0.33834898471832275,
-0.10496962815523148,
-0.2763403058052063,
0.5486857891082764,
-0.22095654904842377,
-0.22721479833126068,
-0.6758501529693604,
0.08333682268857956,
0.6963184475898743,
-0.28647345304489136,
0.217496186494... | |
good idea to put your model into a separate project. As you've discovered, this is trivial.
Regarding Controllers and Views, I don't see any obvious advantage to separating them for most basic projects, although you may have a particular need to do so in a particular application.
If you do choose to do this, then you... | [
0.3110531270503998,
-0.14046578109264374,
0.27611657977104187,
0.5317634344100952,
0.0341438464820385,
-0.14767050743103027,
-0.2554774880409241,
-0.004084703978151083,
-0.13647869229316711,
-0.6327723264694214,
0.27569150924682617,
0.6443294882774353,
-0.32880595326423645,
0.1346098482608... | |
class and overriding the GetControllerType(string controllerName) method may be enough to accomplish what you're asking.
Once you've created your own custom ControllerFactory, you add the following line to Application\_Start in global.asax to tell the framework where to find it:
```
ControllerBuilder.Current.SetContr... | [
0.08272265642881393,
-0.12980224192142487,
0.4047524929046631,
0.06250414997339249,
0.05196082219481468,
-0.2610573470592499,
0.17571592330932617,
-0.22813722491264343,
-0.23800809681415558,
-0.6518020629882812,
-0.3169647753238678,
0.45221638679504395,
-0.29401662945747375,
0.231514409184... | |
Hullo all,
Wondering if there are any Java hackers who can clue me in at to why the following doesn't work:
```
public class Parent {
public Parent copy() {
Parent aCopy = new Parent();
...
return aCopy;
}
}
public class ChildN extends Parent {
...
}
public class Driver {
publi... | [
0.22289429605007172,
-0.09606985747814178,
0.3245232403278351,
-0.2677035927772522,
0.2566373944282532,
0.39667534828186035,
0.2129654884338379,
0.06961075216531754,
-0.14609698951244354,
-0.49372291564941406,
-0.23213857412338257,
0.5886293649673462,
-0.2769000828266144,
0.705159723758697... | |
...
ChildN copy = orig.getClass().cast(orig.copy());
}
}
```
The code is quite happy to compile, but decides to throw a ClassCastException at runtime D=
**Edit:** Whoah, really quick replies. Thanks guys! So it seems I cannot downcast using this method... is there any other way to do downcasting in Ja... | [
0.42035406827926636,
0.2456764429807663,
0.06246635690331459,
-0.04974757134914398,
0.15290232002735138,
-0.11013288050889969,
0.27071523666381836,
0.09923375397920609,
0.0201189536601305,
-0.7261456251144409,
0.07743501663208008,
0.7379502654075623,
-0.324982225894928,
0.2689231038093567,... | |
cleaner to call...
```
public class Foo implements Cloneable {
public Foo clone() {
try {
return (Foo) super.clone();
} catch (CloneNotSupportedException e) {
return null; // can never happen!
}
}
```
[EDIT: I've also seen other folks use
```
throw new AssertionError(... | [
0.4479154050350189,
-0.11365941166877747,
0.24408937990665436,
-0.13296693563461304,
0.1705073118209839,
-0.18667951226234436,
0.6049473881721497,
-0.025287725031375885,
0.10438398271799088,
-0.6348940134048462,
-0.16456124186515808,
0.47233012318611145,
-0.7433474063873291,
0.644302070140... | |
Which OpenVG implementations exists?
What are pros and cons of each of them?
I'm looking for is a highly stable, fast rendering implementations that is still being actively maintained and developed.
I've worked with OpenVG a little bit, and there aren't a lot of implementations out there. I happen to use [ShivaVG](h... | [
0.17503033578395844,
0.1986834853887558,
0.5778877139091492,
-0.16452790796756744,
-0.5398561954498291,
-0.15597793459892273,
0.33200111985206604,
0.12459322810173035,
-0.2590751647949219,
-0.4717312455177307,
-0.13501442968845367,
0.3411582410335541,
-0.4694807231426239,
0.095865324139595... | |
of them do anyways).
* [AmanithVG](http://www.amanith.org/project.html) - commercial; looks
pretty polished. I think there used
to be a free version, but I can't
seem to find it.
* [KompazzVG/AntigrainVG](http://kaarthik.wordpress.com/category/kompazzvg/) - an
implementation using AGG; looks
great, but the author hasn'... | [
0.37220498919487,
0.12952004373073578,
0.06776576489210129,
0.02277548797428608,
-0.287992924451828,
-0.10795047134160995,
0.37992459535598755,
0.08172889798879623,
-0.15211865305900574,
-0.3204425275325775,
-0.007680792827159166,
0.40703797340393066,
-0.20787109434604645,
-0.0510416440665... | |
ShivaVG is [here](http://sourceforge.net/projects/shivavg); you'd probably want to use the trunk version, not the numbered release because it's slightly more up-to-date.
Also the KompazzVG trunk might be [here](http://svn.assembla.com/svn/kompazz/kvg/). | [
-0.11079549044370651,
-0.037102360278367996,
0.3665892779827118,
0.14512325823307037,
-0.4386637210845947,
-0.498958557844162,
0.3287163972854614,
-0.13954612612724304,
-0.5115629434585571,
0.11967269331216812,
-0.4683716595172882,
0.17836026847362518,
0.07960076630115509,
-0.1781628429889... | |
Should Java Objects be reused as often as it can be reused ? Or should we reuse it only when they are "heavyweight", ie have OS resources associated with it ?
All old articles on the internet talk about object reuse and object pooling as much as possible, but I have read recent articles that say `new Object()` is high... | [
0.28689268231391907,
0.0491117499768734,
-0.13091810047626495,
0.030214397236704826,
-0.00437518022954464,
-0.4796121418476105,
0.34350019693374634,
-0.23608532547950745,
-0.43012964725494385,
-0.5804131031036377,
0.10807318985462189,
0.5814734101295471,
-0.3691847622394562,
-0.38945811986... | |
deciding for me, the only time I've hit heap limit with freshly allocated objects was after running a buggy recursive algorithm for a couple of seconds which generated 3 \* 27 \* 27... new objects as fast as it could.
Do what's best for readability and encapsulation. Sometimes reusing objects may be useful, but genera... | [
0.2273780256509781,
0.1623062640428543,
-0.054812099784612656,
-0.003303223056718707,
-0.42558595538139343,
0.20034293830394745,
0.31930553913116455,
-0.06780068576335907,
-0.4779512286186218,
-0.5723934769630432,
0.09442485868930817,
0.46293890476226807,
0.11499697715044022,
0.14548891782... | |
*edit: many thanks for all the answers. Here are the results after applying the optimisations so far:*
* *Switching to sorting the characters and run length encoding - new DB size 42M*
* *Dropping the indexes on the booleans - new DB size 33M*
*The really nice part is this hasn't required any changes in the iphone co... | [
0.024992801249027252,
0.4070782959461212,
0.4866803288459778,
-0.09883192926645279,
-0.2936629354953766,
0.28237345814704895,
0.5349976420402527,
-0.25570839643478394,
-0.11029374599456787,
-0.8149695992469788,
-0.14113856852054596,
0.698305606842041,
-0.17845967411994934,
-0.1802723407745... | |
-lh dictionary.db
-rw-r--r-- 1 frank staff 59M 8 Oct 23:08 dictionary.db
franks-macbook:DictionaryMaker frank$ wc -l dictionary.txt
453154 dictionary.txt
```
...an average of about 135 bytes per entry.
Here is my DB schema:
```
create table words (word text primary key, sowpods boolean, twl boolean, signatu... | [
-0.2972131073474884,
0.4305237829685211,
0.6814959049224854,
-0.23468871414661407,
-0.04429334029555321,
0.5130340456962585,
0.294139564037323,
-0.6623027920722961,
0.17954623699188232,
-0.782181441783905,
-0.15243792533874512,
0.41556787490844727,
-0.13489516079425812,
0.01005333848297596... | |
where signature = '10001021100002210101010000' order by word asc
select word from words where word like 'foo' order by word asc
select word from words where word = 'foo' and (sowpods='1' or twl='1')
```
One idea I have is to encode the letter frequencies more efficiently, e.g. binary encode them as a blob (perhaps wi... | [
0.3230219781398773,
0.16379569470882416,
0.08763246983289719,
-0.22161957621574402,
-0.4714584946632385,
0.18352222442626953,
0.31716182827949524,
-0.2791856825351715,
0.21445372700691223,
-0.926044762134552,
0.059144698083400726,
0.1699056774377823,
-0.29876819252967834,
0.097058229148387... | |
can see what is using the most space?
I'm not clear on all the use cases for the signature field but it seems like storing an alphabetized version of the word instead would be beneficial. | [
0.44907933473587036,
0.1726647913455963,
0.08802513033151627,
0.31204935908317566,
0.18651838600635529,
0.004850506316870451,
0.026899119839072227,
0.25723403692245483,
-0.32430577278137207,
-0.6518135666847229,
0.19308967888355255,
0.11078064143657684,
0.10541611164808273,
0.0660995319485... | |
so I have a 3rd party application that I have to interface with, this application needs the userID from my users table. the problem is that I store my userIDs as GUIDs and the 3rd party app only accepts an integer. so I figure, if there is a way to convert a GUID to an integer then be able to convert it back (as i get ... | [
0.17803402245044708,
0.19461506605148315,
0.2587926685810089,
0.2669713795185089,
-0.17277683317661285,
0.22092247009277344,
-0.022191274911165237,
0.10332544147968292,
-0.22768521308898926,
-0.7465717196464539,
0.3515626788139343,
0.6534616351127625,
-0.17434510588645935,
0.08359075337648... | |
"int thirdPartyId" field in your existing user table, or a new table. | [
-0.31180763244628906,
-0.3406212329864502,
0.36781367659568787,
-0.2048518806695938,
-0.2182110697031021,
-0.007408741395920515,
0.02391057088971138,
-0.12261377274990082,
-0.190255269408226,
-0.9799421429634094,
-0.32022222876548767,
0.22891321778297424,
-0.24629881978034973,
-0.085851617... | |
I have test database and a production database. When developing I of course work against that test database then when deploying I have to semi-manually update the production database (by running a batch-sql-script). This usually works fine but there's a chance for mistakes where the deployed database isn't the same as ... | [
0.4535181224346161,
0.4383825659751892,
0.1793166846036911,
0.013560106977820396,
0.26982641220092773,
0.003265195060521364,
-0.06762680411338806,
-0.23348698019981384,
-0.024205271154642105,
-0.738649308681488,
0.07594538480043411,
0.7140900492668152,
0.09714938700199127,
0.01547593530267... | |
databases can easily become a daunting task if you modify too many tables at once.
I realized that the best approach would be to forget about doing this synchronization manually, it's simply too time consuming and prone to errors, and started using a tool to automate the process.
I've been using the RedGate SQlCompar... | [
0.02626306563615799,
0.19309161603450775,
0.46027055382728577,
0.04788465425372124,
-0.028186727315187454,
-0.019890038296580315,
0.12038175016641617,
-0.32977771759033203,
-0.0780426636338234,
-0.8924373388290405,
0.2622358500957489,
0.5457065105438232,
-0.387893408536911,
0.2643212676048... | |
Is it a good idea to quote keys when using a hash in Perl?
I am working on an extremely large legacy Perl code base and trying to adopt a lot of the best practices suggested by Damian Conway in [Perl Best Practices](http://oreilly.com/catalog/9780596001735/). I know that best practices are *always* a touchy subject wi... | [
0.46401283144950867,
0.23635724186897278,
-0.12010283023118973,
-0.041144777089357376,
-0.36757785081863403,
-0.09185373038053513,
0.2884013056755066,
0.0025198315270245075,
-0.10952751338481903,
-0.30597931146621704,
0.05471666529774666,
0.4664630591869354,
0.044936567544937134,
-0.081764... | |
list of guidelines to follow as I work my way through this code base.
In the [Perl Best Practices book by Damian Conway](http://oreilly.com/catalog/9780596001735/), there is this example which shows how alignment helps legibility of a section of code, but it doesn't mention (anywhere in the book that I can find) anyth... | [
0.30732303857803345,
0.21949850022792816,
-0.09613201022148132,
-0.2579502463340759,
0.11097915470600128,
-0.054830100387334824,
0.27648472785949707,
-0.30999475717544556,
-0.07450183480978012,
-0.5524423718452454,
0.020974118262529373,
0.5349220633506775,
-0.17517638206481934,
-0.02433683... | |
= time - $birth_date;
$ident{ 'status' } = 'active';
```
When specifying constant string hash keys, you should always use (single) quotes. E.g., `$hash{'key'}` This is the best choice because it obviates the need to think about this issue and results in consistent formatting. If you leave off the quotes sometimes, you... | [
0.2907280921936035,
0.10020158439874649,
0.014079847373068333,
-0.10692817717790604,
0.12040016055107117,
-0.016810189932584763,
0.11979124695062637,
0.07629495859146118,
-0.2279994934797287,
-0.4349421560764313,
-0.19843901693820953,
0.21942420303821564,
0.0313851535320282,
0.313429057598... | |
not quoted other times" convention can get you into trouble:
```
$settings{unlink-devices} = 1; # I saved two characters!
```
That'll compile just fine under `use strict`, but won't quite do what you expect at runtime. Hash keys are strings. Strings should be quoted as appropriate for their content: single quotes fo... | [
0.6452279686927795,
0.08692731708288193,
0.45386049151420593,
0.03516276925802231,
-0.08974917232990265,
-0.17537283897399902,
0.25797849893569946,
-0.09323745965957642,
-0.125339075922966,
-0.34651902318000793,
-0.0990009531378746,
0.7134476900100708,
-0.3298801779747009,
-0.1530741155147... | |
We have a freemium product, which menas that some functionality is available if the monthly subscription has been paid; if not paid, then the free capabilities remain available.
Here is how I am thinking of processing it, but wanted to check:
1) When someone purchased their subscription, a recurring billing schedule ... | [
0.9012202620506287,
-0.006522655952721834,
0.5465556979179382,
0.3062373399734497,
0.1762334257364273,
-0.42799973487854004,
0.108356773853302,
-0.015495838597416878,
-0.1277354210615158,
-0.528298020362854,
0.1277436465024948,
0.6967378854751587,
0.050331875681877136,
0.0379708930850029,
... | |
Store the date of the last credit card successfully processed?
What language are you developing in? For C#, check this question.
[Any decent C# profilers out there?](https://stackoverflow.com/questions/10644/any-decent-c-profilers-out-there)
Here's one for C++
[Decent profiler for Windows?](https://stackoverflow.com... | [
0.3338828980922699,
0.07123153656721115,
0.1963665932416916,
0.31034621596336365,
0.09376877546310425,
-0.2035137563943863,
-0.04823610559105873,
0.10518286377191544,
-0.3360622823238373,
-0.637283205986023,
0.12872189283370972,
0.598605751991272,
-0.02720757946372032,
-0.20445312559604645... | |
Suppose I have some per-class data: (AandB.h)
```
class A
{
public:
static Persister* getPersister();
}
class B
{
public:
static Persister* getPersister();
}
```
... and lots and lots more classes. And I want to do something like:
```
persistenceSystem::registerPersistableType( A::getPersister() );
persisten... | [
-0.1692700982093811,
-0.07745543867349625,
0.30685243010520935,
-0.07394884526729584,
0.16345171630382538,
0.038305748254060745,
0.13940268754959106,
-0.02110913023352623,
-0.24878083169460297,
-0.6837943196296692,
-0.06445566564798355,
0.5741778016090393,
-0.41312307119369507,
0.130376413... | |
{
static AutoRegisterBase* head= NULL;
return head;
}
AutoRegisterBase* next;
};
template <typename T>
struct AutoRegister : public AutoRegisterBase
{
AutoRegister() { next = getHead(); getHead() = this; }
virtual void registerPersist()
{
persistenceSystem::registerPersistableType( ... | [
-0.13349847495555878,
0.02138236165046692,
0.6742463707923889,
-0.34351468086242676,
0.3389470875263214,
0.14045189321041107,
0.4165440499782562,
-0.215589702129364,
-0.2388235479593277,
-0.4077453911304474,
-0.4167849123477936,
1.0119056701660156,
-0.36648425459861755,
-0.1664073318243026... | |
)
{
p->registerPersist();
p = p->next;
}
...
}
```
to collect each piece of per-type data and register them all in a big list somewhere for devious later uses.
The problem with this approach is that requires me to add an AutoRegister object somewhere per type. (i.e. its not very automati... | [
0.22711104154586792,
-0.039643313735723495,
-0.03056338243186474,
0.1053394004702568,
0.03127323091030121,
-0.10450433194637299,
0.339635968208313,
-0.2155723124742508,
-0.16063737869262695,
-0.5985483527183533,
-0.16737587749958038,
0.6198365092277527,
-0.6706885695457458,
0.0261788219213... | |
class to get automatically registered in the list. If I could do this I would avoid having to have the user of the class (rather than the author) to remember to create a:
```
static AutoRegister< SomeClass<X1> > auto_X1;
static AutoRegister< SomeClass<X2> > auto_X2;
...
etc....
```
for each template class instantiat... | [
0.19262321293354034,
-0.4063757658004761,
0.01838417910039425,
0.01991661824285984,
-0.16929645836353302,
-0.13294090330600739,
0.29649055004119873,
-0.06991039216518402,
-0.04934338107705116,
-0.5589773654937744,
-0.06455376744270325,
0.6477026343345642,
-0.47250181436538696,
0.2198094725... | |
function:
```
template<typename D>
struct automatic_register {
private:
struct exec_register {
exec_register() {
persistenceSystem::registerPersistableType(
D::getPersister()
);
}
};
// will force instantiation of definition of static member
templ... | [
-0.22763244807720184,
-0.3209514617919922,
0.31088122725486755,
-0.20459161698818207,
0.046414896845817566,
-0.09094703197479248,
0.23737818002700806,
-0.3421681225299835,
0.04971693456172943,
-0.4278583228588104,
-0.5119545459747314,
0.5835545063018799,
-0.7089583277702332,
0.082770682871... | |
static ref_it<register_object> referrer;
};
template<typename D> typename automatic_register<D>::exec_register
automatic_register<D>::register_object;
```
Derive the class you want to be auto-registered from `automatic_register<YourClass>` . The register function will be called before main, when the declaration... | [
-0.20482787489891052,
-0.25502440333366394,
0.43739309906959534,
-0.34656083583831787,
-0.4060265123844147,
0.024813665077090263,
0.17057780921459198,
-0.18014289438724518,
-0.07944291085004807,
-0.1440209001302719,
-0.4869900345802307,
0.6599494218826294,
-0.4353271722793579,
-0.051966954... | |
int main() {
std::cout << " main ";
}
```
Yields this output (as expected):
```
doit main
``` | [
-0.3641276955604553,
-0.13964086771011353,
0.405314564704895,
-0.47045814990997314,
0.02757306769490242,
-0.02611527591943741,
0.2186216562986374,
0.17998145520687103,
-0.012931430712342262,
-0.1820400506258011,
-0.5660434365272522,
0.629001259803772,
-0.41550129652023315,
-0.0097093172371... | |
I have created a local report on a datasource that has a field named "RelativePath". When my WinForms app renders the report, it exports files to the location specified in the RelativePath field. In the report builder, I set Navigation|Hyperlink action|Jump to URL to "=Fields!RelativePath.Value" and set the report's En... | [
-0.15227265655994415,
-0.17949654161930084,
0.7925674915313721,
-0.11323004961013794,
-0.07054845243692398,
-0.02024044841527939,
0.6070597767829895,
0.005773634649813175,
0.07517126202583313,
-0.9255074858665466,
-0.019160816445946693,
0.8000036478042603,
-0.1972176730632782,
0.2150875329... | |
which i came to the conclusion that the reportviewer does not support hyperlinks with the relative path.
To solve this problem is by adding a custom code that retrieves the relative path then concantenate with the field values that you may wish to be part of the URL - atleast that works for me.
Shaddie | [
0.21504546701908112,
0.0671512559056282,
0.4300472140312195,
0.16543346643447876,
-0.22699110209941864,
-0.2608862817287445,
0.519693911075592,
0.1769578456878662,
-0.2355378270149231,
-0.2032933533191681,
0.027542032301425934,
0.7981739044189453,
-0.20332098007202148,
0.28304895758628845,... | |
We're working on a project here in Visual Studio 2008. We're using the built-in testing suite provided with it (the Microsoft.VisualStudio.TestTools.UnitTesting namespace). It turns out, that much to our chagrin, a great deal of complexity (and therefore errors) have wound up coded into our UI layer. While our unit tes... | [
0.5565884709358215,
0.2439984381198883,
0.14890339970588684,
0.3069423735141754,
-0.1362834870815277,
-0.15117284655570984,
0.04730638861656189,
-0.0537177175283432,
0.20826125144958496,
-0.6551071405410767,
0.1755923330783844,
0.4709200859069824,
0.026106400415301323,
0.042466942220926285... | |
testing frameworks like [nUnitForms](http://nunitforms.sourceforge.net/) with the Microsoft stuff? Are there any obvious bear traps I should be aware of with unit-testing forms?
You would need to refactor the UI so that UI does not need any unit testing. UI should contain minimum or no business logic. There are many pa... | [
0.6001904010772705,
0.15627571940422058,
-0.05060678347945213,
0.20247483253479004,
-0.5359737873077393,
-0.18254585564136505,
0.5351992249488831,
-0.46897029876708984,
-0.024104731157422066,
-0.49680736660957336,
0.24552804231643677,
0.6476531028747559,
-0.3079361617565155,
-0.09414739161... | |
that could be used to automate the UI testing. SilkTest comes to my mind. But I would not use them if possible. | [
0.31849852204322815,
0.07509686052799225,
0.20909319818019867,
0.2925838828086853,
0.03026142530143261,
-0.09621938318014145,
-0.13802571594715118,
-0.23349198698997498,
0.01183637510985136,
-0.7351992726325989,
0.27758851647377014,
0.4918487071990967,
0.1280810534954071,
0.053243812173604... | |
I'm currently using SMO and C# to traverse databases to create a tree of settings representing various aspects of the two databases, then comparing these trees to see where and how they are different.
The problem is, for 2 reasonably sized database, it takes almost 10mins to crawl them locally and collect table/column... | [
0.07970206439495087,
0.22543376684188843,
0.4919915199279785,
0.1386422961950302,
0.08839457482099533,
-0.016636785119771957,
0.29579958319664,
-0.0725264772772789,
-0.4514291286468506,
-1.1426949501037598,
0.20733293890953064,
0.36827990412712097,
0.006071293726563454,
-0.0238133165985345... | |
columns.
```
Microsoft.SqlServer.Management.Smo.Database db = db_in;
foreach (Table t in db.Tables)
{
if (t.IsSystemObject == false)
{
foreach (Column c in t.Columns)
{ | [
-0.3393251895904541,
0.20775116980075836,
0.4237803816795349,
-0.039256125688552856,
-0.12144174426794052,
0.3790948688983917,
0.21479599177837372,
-0.18685565888881683,
-0.0735437348484993,
-0.4416135549545288,
-0.3437899053096771,
0.11851398646831512,
-0.5251728296279907,
0.1198351010680... | |
}
}
}
```
Try to force SMO to read all the required fields at once, instead of querying on access.
See [this blog](http://davidhayden.com/blog/dave/archive/2006/03/29/2894.aspx) for more information
---
EDIT: Link is dead but I found [the page](http://web.archive.org/web/20100... | [
-0.3877110183238983,
0.1459188610315323,
0.5317943692207336,
-0.2579420208930969,
-0.0006044291658326983,
-0.02034369483590126,
0.3708570897579193,
-0.14805252850055695,
-0.37794461846351624,
-0.4412049651145935,
-0.34795114398002625,
0.36495307087898254,
-0.5092889666557312,
0.33457896113... | |
server.Databases["AdventureWorks"].StoredProcedures;
foreach (StoredProcedure sp in storedProcedures) {
if (!sp.IsSystemObject) {
// We only want user stored procedures
}
}
``` | [
-0.3523370623588562,
-0.10892404615879059,
0.38224759697914124,
0.16415880620479584,
0.22426746785640717,
-0.020326346158981323,
0.28521591424942017,
0.13532079756259918,
-0.439663827419281,
-0.6095622777938843,
-0.2107688933610916,
0.29879945516586304,
-0.2635557949542999,
-0.110830672085... | |
I am using shared hosting with IIS7 and support for PHP. I am trying to run a wordpress blog with "pretty urls" (removing index.php). The hosting provider doesn't want to install the URLRewrite module, so that option isn't available to me. I found a plugin for wordpress that will remove the index.php from permalink URL... | [
0.36860743165016174,
0.22902269661426544,
0.315660297870636,
0.0903097465634346,
-0.17816348373889923,
-0.2392680048942566,
0.3353341519832611,
0.23514634370803833,
-0.12148405611515045,
-0.6866074204444885,
0.15831440687179565,
0.48392120003700256,
-0.2379993200302124,
0.462616503238678,
... | |
PHP at the same time, so I'm thinking it would be possible to run the rewrite code through ASP.NET, but I'm not sure how to go about it.
Does anybody have any experience with this or any ideas about the best approach to take. If anything leads me in the right direction or if I figure it out myself, I will be more than... | [
0.41644689440727234,
-0.09848068654537201,
0.6190294623374939,
0.05625810846686363,
-0.2628463804721832,
-0.05269072577357292,
0.4981089234352112,
-0.00789378397166729,
-0.24514950811862946,
-0.8983688950538635,
0.35789257287979126,
0.4152301847934723,
0.05556071922183037,
0.23801757395267... | |
rewrite rules. In order to get my Wordpress install running without the index.php in the URL, all I had to do was add:
```
RewriteRule ^/sitemap.xml$ - [L]
RewriteRule ^/(?!index.php)(?!wp-)(.*)$ /index.php/$1
```
The first line allows requests for a sitemap.xml file. The second line handles removing index.php fro... | [
0.18602876365184784,
0.06566876918077469,
0.8612460494041443,
-0.09214965254068375,
-0.043023139238357544,
-0.0570908784866333,
0.5058338642120361,
-0.16740670800209045,
-0.12623438239097595,
-0.6730755567550659,
-0.025317812338471413,
0.4147578179836273,
-0.3893676996231079,
0.11523568630... | |
I got some legacy code that has this:
```
<?PHP
if(isset($_GET['pagina'])=="homepage") {
?>
HtmlCode1
<?php
} else {
?>
HtmlCode2
<?php
}
?>
```
I don't know exactly why but this seems to be working. The htmlcode1 is loaded when I have ?pagina=homepage and the htmlcode2 is loaded when the pagina var doesn't ... | [
-0.0371880829334259,
0.10021907091140747,
0.3650912642478943,
0.06163107976317406,
-0.3108745217323303,
0.11187472194433212,
0.3286688029766083,
-0.16708748042583466,
-0.2950078248977661,
-0.6260160803794861,
0.06967673450708389,
0.3102215528488159,
-0.3593336045742035,
0.12849877774715424... | |
to boolean true, but not **identical** to it (for that you need to use the "===" operator).
A quick example, why you're seeing this behavior:
[<http://codepad.org/aNh1ahu8>](http://codepad.org/aNh1ahu8)
And for more details about it from the documentation, see:
[<http://php.net/manual/en/language.operators.comp... | [
0.4137604534626007,
0.04229725897312164,
0.08271590620279312,
-0.09457196295261383,
-0.29369235038757324,
-0.3342936933040619,
0.7002873420715332,
-0.3814464807510376,
-0.03813670575618744,
-0.1965179443359375,
-0.13119642436504364,
0.643531858921051,
-0.28705787658691406,
0.05127494782209... | |
I'm trying to parse some JSON using the JSon.Net library. The documentation seems a little sparse and I'm confused as to how to accomplish what I need. Here is the format for the JSON I need to parse through.
```
{
"displayFieldName" : "OBJECT_NAME",
"fieldAliases" : {
"OBJECT_NAME" : "OBJECT_NAME",
... | [
0.10498178750276566,
0.27502933144569397,
0.12771637737751007,
-0.16532909870147705,
0.05237497389316559,
0.03000980243086815,
-0.03048386052250862,
0.008937827311456203,
-0.013868676498532295,
-0.7661377787590027,
0.05807238072156906,
0.5279362201690674,
-0.3797908127307892,
-0.0579006001... | |
1111
},
"objects" : [ {
"attributes" : {
"OBJECT_NAME" : "test name",
"OBJECT_TYPE" : "test type"
},
"position" : {
"x" : 5,
"y" | [
0.12464869022369385,
0.267581582069397,
0.09721285104751587,
0.19357845187187195,
0.11296147108078003,
0.4292314946651459,
-0.0986500009894371,
-0.13084952533245087,
-0.12674732506275177,
-0.4614552855491638,
0.10023590177297592,
0.041283294558525085,
-0.4246748685836792,
-0.18462118506431... | |
: 7
}
} ]
}
```
The only data I really need from this is the stuff in the objects array. Is it possible for me to parse through that with something like the JSonTextReader and just pull out the things I want, like OBJECT\_TYPE and the x and y position? I can't seem to get `JSonTextReader` to work the way ... | [
0.02624121494591236,
0.14799664914608002,
0.1866394430398941,
-0.004501698072999716,
0.016053147614002228,
-0.14584141969680786,
0.04753578454256058,
0.1037261113524437,
-0.24506442248821259,
-0.49518996477127075,
-0.11937098950147629,
0.7444587349891663,
-0.4473125636577606,
-0.0236769448... | |
example I find discusses serializing the JSON first, but I'm not sure how I would build an object for this structure. Particularly the objects array which would need to be something like a list of Pairs of attribute and position objects. I have no idea how I would code my object so JSon.Net would know how to serialize ... | [
0.2360617071390152,
0.06274716556072235,
-0.21410995721817017,
0.25178590416908264,
-0.2876476049423218,
-0.07352568209171295,
0.1445065289735794,
0.18873611092567444,
-0.35789647698402405,
-0.7280246615409851,
0.3262485861778259,
0.57146817445755,
-0.36142560839653015,
-0.0499476455152034... | |
fine with `JavaScriptSerializer` from `System.Web.Extensions.dll` (.NET 3.5 SP1):
```
using System.Collections.Generic;
using System.Web.Script.Serialization;
public class NameTypePair
{
public string OBJECT_NAME { get; set; }
public string OBJECT_TYPE { get; set; }
}
public enum PositionType { none, point }
p... | [
0.3300727605819702,
-0.24239426851272583,
0.47990915179252625,
-0.09058381617069244,
0.05970568209886551,
-0.1589706540107727,
0.4573845863342285,
-0.7082512974739075,
-0.22941754758358002,
-0.717196524143219,
-0.07114730030298233,
0.8091958165168762,
-0.46725985407829285,
0.11948753893375... | |
Foo() { objects = new List<SubObject>(); }
public string displayFieldName { get; set; }
public NameTypePair fieldAliases { get; set; }
public PositionType positionType { get; set; }
public Ref reference { get; set; }
public List<SubObject> objects { get; set; }
}
static class Program
{
const st... | [
0.012015070766210556,
0.13006184995174408,
0.7166722416877747,
-0.5061360597610474,
-0.014924028888344765,
0.256927490234375,
0.12395411729812622,
-0.29724496603012085,
-0.09221573173999786,
-0.2928815484046936,
-0.5205588340759277,
0.7109761238098145,
-0.39447012543678284,
0.1521847993135... | |
{
""id"" : 1111
},
""objects"" : [
{
""attributes"" : {
""OBJECT_NAME"" : ""test name"",
""OBJECT_TYPE"" : ""test type""
},
""position"" :
{
""x"" : 5,
""y"" : 7
} | [
0.03294244781136513,
0.2506329417228699,
-0.0651734322309494,
0.41226935386657715,
0.19139806926250458,
0.22122791409492493,
0.0996367484331131,
-0.1495831310749054,
0.1259659379720688,
-0.5230098366737366,
-0.14049388468265533,
0.24227146804332733,
0.02688111551105976,
0.13224630057811737... | |
}
]
}";
static void Main()
{
JavaScriptSerializer ser = new JavaScriptSerializer();
Foo foo = ser.Deserialize<Foo>(json);
}
}
```
**Edit:**
Json.NET works using the same JSON and classes.
```
Foo foo = JsonConvert.DeserializeObject<Foo>(json);
```
Link: [Serializing and Deserializi... | [
-0.03269366919994354,
-0.213608980178833,
0.47783219814300537,
-0.2905527353286743,
0.017041143029928207,
0.21405787765979767,
0.28906700015068054,
-0.48169004917144775,
-0.5925813317298889,
-0.6293967962265015,
-0.3763721287250519,
0.6061573028564453,
-0.5459031462669373,
0.34876456856727... | |
Arising out of [this](https://stackoverflow.com/questions/401467/how-to-reduce-the-size-of-an-sqlite3-database-for-iphone) question, I'm looking for an elegant (ruby) way to compute the word signature suggested in [this](https://stackoverflow.com/questions/401467/how-to-reduce-the-size-of-an-sqlite3-database-for-iphone... | [
-0.10741256922483444,
0.20247815549373627,
0.4829239249229431,
-0.1976960003376007,
0.027283580973744392,
0.3500064015388489,
0.31194227933883667,
-0.3875894546508789,
-0.3725767433643341,
-0.7259193062782288,
0.11858010292053223,
0.20333243906497955,
-0.14843381941318512,
-0.1287956684827... | |
much matter for my application. I'm looking to compute the signature so I can store it with each word in a large database of words (450K words), then query for words which have the same signature (i.e. all anagrams of a given word, that are actual english words). Hence the focus on space. The 'elegant' part is just to ... | [
0.32217466831207275,
0.18022601306438446,
0.2897852063179016,
-0.018118875101208687,
0.23409007489681244,
0.13720090687274933,
0.4742259383201599,
-0.10689689964056015,
-0.2882969081401825,
-0.6738324761390686,
-0.02989364229142666,
0.3593951165676117,
-0.18499445915222168,
0.0941257551312... | |
the word is lowercase, doesn't contain numbers, etc.
As requested, I'll try to explain the code. Please forgive me if I don't get all of the Ruby or reg ex terminology correct, but here goes.
I think the split/sort/join part is pretty straightforward. The interesting part for me starts at the call to gsub. This will... | [
0.08935399353504181,
0.13635671138763428,
0.5744916200637817,
-0.07237178087234497,
-0.0578705295920372,
0.07298028469085693,
0.29232311248779297,
0.09329555928707123,
0.1335342973470688,
-0.6837635636329651,
-0.30266517400741577,
0.4520215392112732,
-0.2514127194881439,
-0.002907271031290... | |
whatever character was found by the first part of the match. We want that character to be found a minimum of two more times for a total minimum number of occurrences of three. This is done using the quantifier "{2,}".
If a match is found, the matching substring is then passed to the next block of code as an argument t... | [
-0.11203360557556152,
-0.062131624668836594,
0.3341998755931854,
-0.1382543444633484,
-0.12986356019973755,
0.23507298529148102,
0.11876501888036728,
-0.4736071825027466,
0.25772035121917725,
-0.5658076405525208,
-0.08990904688835144,
0.5376917123794556,
-0.23525790870189667,
-0.0063945325... | |
the original matching substring. The whole process continues until nothing is left to match since it's a global substitution on the original string.
I apologize if that's confusing. As is often the case, it's easier for me to visualize the solution than to explain it clearly. | [
-0.17394433915615082,
-0.07739243656396866,
0.2679026424884796,
0.09731119871139526,
-0.06998705118894577,
0.07904652506113052,
0.31682440638542175,
-0.0030266200192272663,
-0.04060106724500656,
-0.4279027283191681,
-0.25229451060295105,
0.10379907488822937,
-0.6693394184112549,
0.41801071... | |
How can I tell whether a circle and a rectangle intersect in 2D Euclidean space? (i.e. classic 2D geometry)
There are only two cases when the circle intersects with the rectangle:
* Either the circle's centre lies inside the rectangle, or
* One of the edges of the rectangle has a point in the circle.
Note that this d... | [
0.11167556047439575,
-0.09937311708927155,
0.4351765513420105,
0.0630466416478157,
-0.025622813031077385,
-0.17202197015285492,
-0.10831480473279953,
-0.2975100874900818,
-0.23841117322444916,
-0.7294651865959167,
-0.1898108273744583,
0.22576013207435608,
0.04515957459807396,
0.10159008949... | |
circle can still intersect the polygon is if it lies completely inside the polygon.)
With that insight, something like the following will work, where the circle has centre `P` and radius `R`, and the rectangle has vertices `A`, `B`, `C`, `D` in that order (not complete code):
```py
def intersect(Circle(P, R), Rectang... | [
-0.22226117551326752,
-0.1033584251999855,
0.6312291026115417,
0.07878506928682327,
-0.16340622305870056,
0.2173118144273758,
0.006177831441164017,
-0.4459444284439087,
-0.1056540235877037,
-0.7636398077011108,
-0.1996019333600998,
0.12553450465202332,
-0.15808020532131195,
0.0666120424866... | |
intersectCircle(S, (C, D)) or
intersectCircle(S, (D, A)))
```
If you're writing any geometry you probably have the above functions in your library already. Otherwise, `pointInRectangle()` can be implemented in several ways; any of the general [point in polygon](http://en.wikipedia.org/wiki/Point_in_polygo... | [
-0.04420241340994835,
0.014769176952540874,
0.6003517508506775,
0.017098691314458847,
-0.6041799783706665,
0.4688974916934967,
-0.005908526945859194,
-0.2776963710784912,
-0.0428282767534256,
-1.0837953090667725,
0.05961431562900543,
0.16582997143268585,
-0.28279009461402893,
0.16499483585... | |
`P` to the line is close enough and between the endpoints, and check the endpoints otherwise.
The cool thing is that the *same* idea works not just for rectangles but for the intersection of a circle with any [simple polygon](http://en.wikipedia.org/wiki/Simple_polygon) — doesn't even have to be convex! | [
-0.023449860513210297,
-0.09493304789066315,
0.5254007577896118,
0.01144132949411869,
-0.26118361949920654,
0.07625113427639008,
0.1414148062467575,
-0.03980875760316849,
-0.5004667043685913,
-0.5174350142478943,
-0.15629595518112183,
0.1264989972114563,
-0.1849549561738968,
-0.13419750332... | |
I'm trying to capture the id of an element that will be randomly generated. I can successfully capture the value of my element id like this...
```
| storeAttribute | //div[1]@id | variableName |
```
Now my variable will be something like...
```
divElement-12345
```
I want to remove 'divElement-' so that the varia... | [
0.2238430231809616,
-0.18595243990421295,
0.22507834434509277,
0.10441615432500839,
0.07610400766134262,
-0.09106168895959854,
-0.04047213867306709,
-0.30282914638519287,
0.02693461813032627,
-0.5640626549720764,
-0.05805795639753342,
0.5537617206573486,
-0.1933538168668747,
0.032073706388... | |
for doing tests in both FireFox and IE.
Using the latest version of Selenium IDE (3/5/2009) I've had success with using storeEval which evaluates Javascript expressions, giving you access to javascript string functions.
XPath:
```
storeAttribute | //div[1]@id | divID
storeEv... | [
0.38531726598739624,
0.17152731120586395,
0.3118019700050354,
0.0046034809201955795,
0.0991477444767952,
-0.1274632215499878,
0.455290824174881,
-0.6208285689353943,
0.3062986731529236,
-0.6490864753723145,
0.1456538885831833,
0.676701545715332,
-0.2794032096862793,
-0.14739131927490234,
... | |
| number
type | //tr[@id='form-${number}']/td/form/fieldset/p[1]/input | Type this
```
CSS Selector:
```
storeAttribute | css=div[1]@id | divID
storeEval | '${divID}'.replace("divElement-", "") | [
-0.12913453578948975,
-0.0008740787161514163,
0.33145803213119507,
-0.012133823707699776,
0.12778323888778687,
0.10900808870792389,
0.0861772671341896,
-0.4258052408695221,
0.06172874569892883,
-0.5916776061058044,
-0.2784808874130249,
0.34862852096557617,
-0.4338313043117523,
0.2014609724... | |
| number
type | css=tr[id='form-${number}'] > td > form > fieldset > p[1] > input | Type this
``` | [
-0.11388986557722092,
0.04039699584245682,
0.2869425415992737,
-0.033192284405231476,
-0.12082139402627945,
-0.00976710394024849,
0.002806377364322543,
-0.38849958777427673,
0.02302936464548111,
-0.45293688774108887,
-0.3724915683269501,
0.10927677899599075,
-0.42933210730552673,
0.1350396... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.