text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
}
}
}
```
This works, the property is setup, can be bound, etc. The issue comes when I bind TO the propery from WPF, using a TwoWay bind. The TwoWay part never actually happens, WPF never calls the set of this property. I have set my binding up like this:
```
<TextBox Text="{Binding Path=Name, Mode=TwoWay, Updat... | [
-0.04428182542324066,
0.0008246912038885057,
0.7323151230812073,
-0.08374101668596268,
0.18338733911514282,
-0.5944719314575195,
0.35107266902923584,
-0.295376181602478,
0.0535685196518898,
-0.870827853679657,
-0.18915167450904846,
0.68471360206604,
-0.33354005217552185,
0.1243701949715614... | |
obviously doesn't unless I implement INotifyPropertyChanged).
What am I doing wrong here? This should be a really simple thing to do, but it's causing me no end of headaches.
This is expected behavior. The CLR property is merely a wrapper around the underlying `DependencyProperty`. WPF often optimizes by calling `GetV... | [
0.32443830370903015,
0.00016539885837119073,
0.6726245880126953,
0.09448718279600143,
0.18428538739681244,
-0.6326258778572083,
0.23708942532539368,
-0.127683624625206,
-0.07528021931648254,
-0.522754430770874,
-0.11587494611740112,
1.0060153007507324,
-0.2461489588022232,
0.09077145159244... | |
What are the most memory consuming reasons in SQL SERVER 2005?
The [SQL Rocks](http://sqlnerd.blogspot.com/) article [Memory Use in SQL Server](http://sqlnerd.blogspot.com/2006/07/memory-use-in-sql-server.html) will probably answer your question.
I think this is one of the important parts:
> SQL Server's caching beha... | [
-0.09925354272127151,
0.5763564109802246,
0.28644442558288574,
-0.053911224007606506,
-0.3804318308830261,
-0.19046033918857574,
0.004315720405429602,
0.016974464058876038,
-0.23281602561473846,
-0.11356174945831299,
0.035028886049985886,
0.5702248811721802,
-0.17493711411952972,
0.4199427... | |
Every time SQL Server
> needs to read a page from disk it
> caches the page in memory so that the
> slow disk operation will be
> unnecessary SQL Server should need
> that page again.
SQL Server is just memory hungry. The more memory you give it, the more it will use. SQL Server should probably always be run on i... | [
0.166395366191864,
0.1325441598892212,
0.28247570991516113,
0.18820828199386597,
-0.22533752024173737,
-0.43588361144065857,
0.1925441473722458,
0.3255641758441925,
-0.3383597135543823,
-0.4785955846309662,
0.13068543374538422,
0.5537403225898743,
-0.5042759776115417,
0.5421125888824463,
... | |
For example,
```
int myResult= (new UnmanagedResourceUsingMemorySuckingPig()).GetThingsDone(id);
```
There is no using block, no obvious way to use a using block, no obvious way to call Dispose(). And of course UnmanagedResourceUsingMemorySuckingPig does implement IDisposable.
If the finalizer of that class calls `D... | [
0.37974825501441956,
0.060464389622211456,
0.13479971885681152,
-0.03911176696419716,
0.1784757524728775,
-0.6348239183425903,
0.16188375651836395,
-0.2682492434978485,
-0.21677114069461823,
-0.7485166192054749,
-0.3100460171699524,
0.5817674398422241,
-0.3608386218547821,
0.37324655055999... | |
will call `Dispose()` when the object is removed." This is not the case at all. Yes, a good, defensive coder writing a component will assume that `Dispose()` won't be called explicitly and does so in the finalizer. However, a good, defensive coder USING a component must assume that the finalizer does NOT call `Dispose(... | [
0.17754101753234863,
0.032674677670001984,
0.06578672677278519,
-0.042070094496011734,
-0.038955166935920715,
-0.27191269397735596,
0.5085644125938416,
-0.38921022415161133,
0.04804227501153946,
-0.29817071557044983,
-0.4555758833885193,
0.9291512370109558,
-0.27600395679473877,
0.06829628... | |
Is there an easy way to export and then import users/permissions from one Sql Server 2005 instance to another?
Use the management console to generate a script for your users and thier associated permissions. Same can be done for the server logins in the security folder.
Select your user:
Select DB and expand security\... | [
-0.12480879575014114,
0.08068957924842834,
0.1313750445842743,
0.021852925419807434,
-0.3013156056404114,
-0.2081371396780014,
0.2248115837574005,
-0.17047008872032166,
0.05770035833120346,
-0.7649676203727722,
0.03147055581212044,
0.5089334845542908,
-0.23857830464839935,
0.31175503134727... | |
Do you have a favorite site or homegrown page in your toolbox to help you during development of your Javascript?
Something to help you:
* validate
* run
* debug, inspect
* unit test
Looking for somewhere to paste my JS into, click a Run button, and have it evaluate the statements. This might be for simple snippets f... | [
0.6230571866035461,
-0.03978043049573898,
0.401100754737854,
0.25604337453842163,
-0.10527873039245605,
-0.24698719382286072,
0.5349007844924927,
-0.13862872123718262,
-0.006855514831840992,
-0.5443302989006042,
-0.031798798590898514,
0.3098796606063843,
0.15627753734588623,
-0.15612302720... | |
to the code snippet, and comments from other users. DOM and Console methods don't work.
* jsbin with [`// noprotect`](http://jsbin.com/blog/protection#comment-1590869196) at the beginning of the code, to enable debugging in the browser console
Non-answers: Codepen (can't debug due to its autorun on edit creating a new... | [
0.30187615752220154,
0.011819402687251568,
0.2974995970726013,
0.12776294350624084,
-0.30405083298683167,
-0.2799138128757477,
0.44828078150749207,
-0.02011483907699585,
-0.18071307241916656,
-0.47870731353759766,
-0.20782947540283203,
0.4984709918498993,
-0.15865889191627502,
0.0941686928... | |
I have domain.com and domain.org as aliases pointing to the same vhost. How can I use .htaccess to redirect all domain.com requests to domain.org?
You could use [mod\_rewrite](http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html) to do this.
```
RewriteEngine on
RewriteCond %{HTTP_HOST} !^example\.org$
RewriteRule ^ ... | [
0.4917086362838745,
0.2521127462387085,
0.6270490884780884,
-0.21436290442943573,
0.04790106788277626,
-0.2358279973268509,
0.2556597888469696,
-0.12212128192186356,
-0.1362607181072235,
-0.6966312527656555,
0.3122420907020569,
0.5855293869972229,
-0.41566747426986694,
0.8426052927970886,
... | |
So we all know that all classes implicitly extend Object. How about interfaces? Is there an implicit super-interface? I say there is. The following code compiles:
```
java.io.Serializable s1 = null;
java.io.Serializable s2 = null;
s1.equals(s2);
```
The `equals` method is not declared in Serializable, but in Object... | [
-0.200704887509346,
0.12110176682472229,
0.32453805208206177,
0.061769936233758926,
-0.12533441185951233,
-0.02806968428194523,
0.43360692262649536,
-0.06549492478370667,
-0.10729540884494781,
-0.7521188259124756,
0.23274853825569153,
0.5683989524841309,
-0.4238736927509308,
0.173894688487... | |
Object is a class, not
> an interface, there must be some
> implicit interface that is being
> extended.
No. Citing the [Java Language Specification](http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.4.4):
> If an interface has no direct
> superinterfaces, then **the interface
> implicitly decla... | [
-0.35577479004859924,
0.1979348361492157,
0.23876024782657623,
0.0567014180123806,
-0.35787734389305115,
0.056667059659957886,
0.3681994080543518,
-0.3315810263156891,
-0.16398055851459503,
-0.6118146181106567,
-0.130528524518013,
0.11263761669397354,
-0.5631835460662842,
0.193951085209846... | |
declared by the interface. It is a compile-time error if the interface explicitly
> declares such a method m in the case
> where m is declared to be final in
> Object.
The difference between this and your "implicit super interface" is that `Object` has a number of final and protected methods, and you couldn't have... | [
-0.10897412151098251,
-0.3022034466266632,
0.28492870926856995,
0.21698994934558868,
-0.08691910654306412,
-0.04888505861163139,
0.5709733366966248,
-0.3023982048034668,
-0.16482946276664734,
-0.40652358531951904,
-0.22346621751785278,
0.3758683502674103,
-0.4879376292228699,
0.15988272428... | |
I'm using jQuery 1.3.2.
I'm having trouble getting a correct "height" in Internet Explorer 6. Height values are correct in all other browsers.
I am also using [wresize jQuery plugin](http://noteslog.com/post/how-to-fix-the-resize-event-in-ie/).
Each time the browser loads, I fire a method that resizes divs, iframes ... | [
0.14901499450206757,
0.07797744870185852,
0.806718647480011,
-0.30937981605529785,
-0.12145289778709412,
0.13276620209217072,
0.4326690137386322,
-0.2034439593553543,
-0.11841081827878952,
-0.9447981119155884,
-0.05486182123422623,
0.533903956413269,
-0.023512734100222588,
0.04568741470575... | |
== null)
pagerH = 0;
if (groupHeight != null)
groupH = groupHeight + pagerH;
iframeH = $('body').height();
h = (iframeH - (tableH + pagerH + groupH));
$('#' + gridId + "Panel").css("height", (h + "px"));
$("#" + gridId + "_DXMainTable").parent().css("height", (h + "px"));
```
This code is for setting the h... | [
0.060046274214982986,
-0.0005683330819010735,
0.5996810793876648,
-0.1520204097032547,
-0.19980908930301666,
0.13955937325954437,
0.3227458894252777,
-0.38531970977783203,
-0.2808248996734619,
-0.9127057790756226,
-0.011228981427848339,
0.5302816033363342,
-0.11461419612169266,
0.003831400... | |
facing is more likely to be a css rendering difference. Because of floating problems, padding, and margin rendering differences between browsers.
try to get **$("body").innerHeight()** and **$("body").outerHeight()** and compare them in different browsers, you'll get some common results. In worst case you might need ... | [
0.00186900922562927,
-0.04807035252451897,
0.5045024752616882,
0.062287140637636185,
-0.31475356221199036,
0.3887491226196289,
0.32625287771224976,
-0.3872462213039398,
-0.25892549753189087,
-0.99532151222229,
0.3043690025806427,
0.6426598429679871,
0.013960428535938263,
-0.300087690353393... | |
I'd like to convert this SimpleFormController to use the annotation support introduced in Spring MVC 2.5
**Java**
```
public class PriceIncreaseFormController extends SimpleFormController {
ProductManager productManager = new ProductManager();
@Override
public ModelAndView onSubmit(Object command)
... | [
0.3267965614795685,
-0.4038258492946625,
1.0034266710281372,
-0.17581109702587128,
-0.1420779675245285,
0.005834030453115702,
0.2354579120874405,
-0.877083420753479,
0.18851850926876068,
-0.7228865027427673,
0.007051105611026287,
0.9155815243721008,
-0.13985088467597961,
0.3287608623504638... | |
throws ServletException {
PriceIncrease priceIncrease = new PriceIncrease();
priceIncrease.setPercentage(20);
return priceIncrease;
}
}
```
**Spring Config**
```
<!-- Include basic annotation support -->
<context:annotation-config/>
<!-- Comma-separated list of packages to searc... | [
-0.0008403868414461613,
-0.41185262799263,
0.33232614398002625,
0.2646219730377197,
-0.37803032994270325,
0.25695207715034485,
-0.28006553649902344,
-0.5930836796760559,
-0.05394186079502106,
-0.4103408455848694,
-0.19137144088745117,
0.534638524055481,
-0.049745429307222366,
0.16817681491... | |
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
<bean name="/priceincrease.htm" class="springapp.web.PriceIncreaseFormController">
<property name="sessionForm" value="true"/>
<property name="commandName" value="priceIncrease"/>
<property name="commandClass" value="sp... | [
0.23687604069709778,
-0.041367415338754654,
0.2672906816005707,
-0.14360471069812775,
-0.02571766823530197,
0.07293973118066788,
-0.19790352880954742,
-0.47434768080711365,
0.026928698644042015,
-0.4371740221977234,
-0.09624812752008438,
0.8729644417762756,
0.13134914636611938,
0.219166263... | |
not exactly as is will depend a bit on your configuration (view resolver, etc). I should also note that there are about eight billion valid ways to write this thing. See the Spring documentation, [13.11.4 "Supported handler method arguments and return types"](http://static.springframework.org/spring/docs/2.5.x/referenc... | [
0.4288676977157593,
-0.31546464562416077,
0.522749125957489,
0.12677434086799622,
-0.09786082804203033,
-0.05805838480591774,
0.42655977606773376,
-0.6017207503318787,
-0.3374158442020416,
-0.17963512241840363,
0.19930952787399292,
0.8458772897720337,
-0.14625924825668335,
0.33057057857513... | |
to be called onSubmit
@RequestMapping(method = RequestMethod.POST)
public String onSubmit(@ModelAttribute("priceIncrease") PriceIncrease priceIncrease, BindingResult result, SessionStatus status {
new PriceIncreaseValidator().validate(priceIncrease, result);
if (result.hasErrors()) {
... | [
0.1977338194847107,
-0.5061150789260864,
0.9291623830795288,
-0.014436538331210613,
0.04678868502378464,
0.20046238601207733,
-0.020327072590589523,
-0.712044358253479,
-0.03456534445285797,
-0.40847280621528625,
-0.23873546719551086,
0.5842470526695251,
-0.2387065291404724,
0.525288105010... | |
status.setComplete();
return "redirect:hello.htm";
}
}
// note: this method does not have to be called setupForm
@RequestMapping(method = RequestMethod.GET)
public String setupForm(Model model) {
PriceIncrease priceIncrease = new PriceIncrease();
priceIncrease.se... | [
-0.005197300110012293,
-0.7069493532180786,
0.7044131755828857,
-0.015830298885703087,
0.044669538736343384,
0.06886088848114014,
-0.12493933737277985,
-0.5470061898231506,
-0.00015105993952602148,
-0.6158778071403503,
-0.3000490367412567,
0.7962347865104675,
-0.18144461512565613,
0.278916... | |
return "priceincrease";
}
}
``` | [
0.02451740950345993,
-0.11623901128768921,
0.014549349434673786,
-0.16966700553894043,
0.15842996537685394,
0.03349867835640907,
-0.21451793611049652,
0.20055262744426727,
0.368828684091568,
-0.30519211292266846,
-0.21540944278240204,
1.054640293121338,
-0.2679016590118408,
0.4077651500701... | |
I have an extremely hard time figurering out how classes needs to communicate with eachother. In a current project I am doing, many classes have become so deeprooted that I have begun to make Singletons and static fields to get around(from what I get this is a bad idea).
Its hard to express my problem and its like oth... | [
0.027864592149853706,
-0.052195556461811066,
-0.07700946927070618,
0.08026916533708572,
-0.3160403072834015,
-0.0942346379160881,
0.1595403105020523,
0.28073179721832275,
-0.155404195189476,
-0.8578792214393616,
0.0785016193985939,
0.3115239143371582,
-0.2154257446527481,
0.284707158803939... | |
in everybranch. Do I really have to make it in starter and then pass it down in all the branches?
Not sure if this makes sense to anybody :)
Its a problem that is reacurring in every project.
There's just too little information here. For example, I am not even sure if `MapPanel` and `InfoPanel` should be the way they ... | [
0.5001435875892639,
0.11527832597494125,
0.32166585326194763,
0.21815061569213867,
-0.20267151296138763,
0.17233052849769592,
0.03911791741847992,
0.12422603368759155,
-0.2932332456111908,
-0.638973593711853,
0.03394370898604393,
0.45601433515548706,
0.23805682361125946,
0.1556442230939865... | |
I recently migrated my web services from Axis to CXF (2.1). It appears that while Axis needed the "axis.socketSecureFactory" set, CXF grabs the default. How do I set the default SocketFactory in Java to my own implementation (such as a property)?
What I am **not** looking to do is to set the default SocketFactory prop... | [
0.23987813293933868,
0.10821688920259476,
0.4537399411201477,
-0.28679847717285156,
-0.27799689769744873,
-0.04611030966043472,
0.569763720035553,
-0.20694990456104279,
-0.03975505754351616,
-0.9788531064987183,
-0.12900814414024353,
0.5328215956687927,
-0.4317350387573242,
0.3210422992706... | |
After [The C Programming Language](http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)) by Brian Kernighan and Dennis Ritchie, some of the books most favoured by beginners turn out to be ones best avoided, such as [anything by Herb Schildt](https://stackoverflow.com/questions/391091/should-i-not-use-a-herb-s... | [
0.24658894538879395,
0.48110952973365784,
-0.23977120220661163,
-0.28697386384010315,
-0.01757991313934326,
-0.33855199813842773,
0.30612361431121826,
-0.15536972880363464,
-0.12413624674081802,
-0.18934263288974762,
-0.21369679272174835,
0.7218107581138611,
-0.08083423972129822,
-0.116261... | |
C Programming: Deep C Secrets](https://rads.stackoverflow.com/amzn/click/com/0131774298) | [
-0.13233186304569244,
0.07464097440242767,
-0.18372131884098053,
0.04228374734520912,
0.32816991209983826,
-0.221562460064888,
0.23025991022586823,
-0.019698893651366234,
-0.3389776051044464,
0.3128398060798645,
-0.29414430260658264,
0.659523069858551,
-0.08165178447961807,
0.0549567155539... | |
I am building a search with the keywords cached in a table. Before a user-inputted keyword is looked up in the table, it is normalized. For example, some punctuation like '-' is removed and the casing is standardized. The normalized keyword is then used to find fetch the search results.
I am currently handling the no... | [
0.0774386003613472,
-0.35542234778404236,
0.35101258754730225,
0.10925807058811188,
0.21218273043632507,
-0.14912128448486328,
-0.05734453722834587,
-0.09040256589651108,
-0.10042548179626465,
-0.9264606833457947,
-0.11754193902015686,
0.5779412984848022,
-0.30968451499938965,
0.2731799185... | |
Whatever < ActiveRecord::Base
named_scope :search, lambda {|*keywords|
{:conditions => {:keyword => normalize_keywords(keywords)}}}
def self.normalize_keywords(keywords)
# Work your magic here
end
end
```
Using named scopes will allow you to chain with other scopes, and is really the way to go using ... | [
0.4283197820186615,
-0.3752498924732208,
0.23785831034183502,
-0.12200886011123657,
-0.27335527539253235,
-0.6130574345588684,
0.6707697510719299,
-0.2716638445854187,
-0.10846982896327972,
-0.5259270668029785,
0.1814073622226715,
0.8043627738952637,
-0.4562995731830597,
-0.212015300989151... | |
I'm doing some automation work and can make my way around a site & post to HTML forms okay, but now I'm up against a new challenge, **Ajax** forms.
Since there's no source to read, I'm left wondering if it's possible to fill in an Ajax form progamatically, in C#. I'm currently using a non-visible axWebBrowser.
Thanks... | [
0.007915443740785122,
0.12651512026786804,
0.4072624742984772,
0.045974813401699066,
-0.4879259169101715,
-0.044790081679821014,
0.5577918291091919,
-0.0800778791308403,
-0.15777568519115448,
-0.8999078869819641,
-0.11867811530828476,
0.4379916787147522,
-0.2147253006696701,
-0.08092789351... | |
for a technology that allows Javascript to make HTTP requests to a server which usually implements some handlers that produce specialized, light-weight content for the Javascript caller (comonly encoded as JSON).
Therefore in order to simulate AJAX calls, all you have to do is inspect your target application (the web ... | [
0.4491268992424011,
0.02005801536142826,
-0.03437115624547005,
0.11671379953622818,
-0.3085038661956787,
-0.3591732382774353,
0.12898069620132446,
-0.23371469974517822,
-0.22584645450115204,
-0.6460598111152649,
-0.09768088161945343,
0.40262526273727417,
-0.2608189880847931,
-0.22253358364... | |
pages and what those pages respond. It does a pretty good job at inspecting AJAX calls too.
Here's a very simple example of how to do a web request:
```
HttpWebRequest wReq = (HttpWebRequest)WebRequest.Create("http://www.mysite.com");
using (HttpWebResponse resp = (HttpWebResponse)wReq.GetResponse())
{
// NOTE: A... | [
0.14783598482608795,
-0.04508109390735626,
0.7314710021018982,
0.08671358227729797,
-0.4721084237098694,
-0.2638300657272339,
0.32372474670410156,
-0.34581825137138367,
-0.05152781307697296,
-0.8942442536354065,
-0.46140554547309875,
0.35430023074150085,
-0.2263336032629013,
0.165549114346... | |
}
}
```
A POST is also a request, but with a different method. See [this page](http://msdn.microsoft.com/en-us/library/d4cek6cc.aspx) for an example of how to do a very simple post.
**EDIT** - Details on Inspecting the page behavior with Firebug
What I mean by inspecting the page you're trying to replicate is t... | [
0.3097335994243622,
0.22620822489261627,
0.33985409140586853,
-0.12562063336372375,
-0.1206425130367279,
-0.22654186189174652,
0.3154948651790619,
0.15940572321414948,
-0.06004582345485687,
-0.8087414503097534,
-0.08606108278036118,
0.5274615287780762,
-0.5120331645011902,
0.33285880088806... | |
"Console" will list communications between the page and the server that take place after the page has loaded. Those communications that take place after the page has loaded are essentially the AJAX calls that you'll want to replicate (Note: Network monitoring has to be enbled in Firebug for this to work)
Check out [Mi... | [
0.3479633033275604,
0.003673993283882737,
0.47771960496902466,
-0.0022723085712641478,
0.059876810759305954,
-0.3031858503818512,
0.383790522813797,
-0.15686321258544922,
0.1718464195728302,
-0.5494239330291748,
-0.03818022087216377,
0.791938066482544,
-0.45172667503356934,
-0.036733005195... | |
more than an HTTP Request. It's an HTTP Request that the Javacript makes "behind the scenes", or out-of-band, to the web server. To replicate this, it is really no different than replicating a normal GET or a normal POST like I showed above. And this is where Firebug comes in to play. Using it you can view the requests... | [
0.2528080940246582,
-0.41863471269607544,
0.15670400857925415,
0.1900506168603897,
-0.09349142014980316,
-0.4025786221027374,
0.03161845728754997,
-0.10054253786802292,
-0.2733267843723297,
-0.6053352952003479,
0.1892368048429489,
0.7920176386833191,
-0.1453319638967514,
-0.041233465075492... | |
does, only do it from C# instead.
Gregg, I hope this clarifies my answer a little bit but beyond this I suggest playing with Firebug and maybe learning more about how the HTTP protocol works and how AJAX works as a technology. | [
0.5436935424804688,
0.08211922645568848,
0.023431023582816124,
0.33132410049438477,
-0.2108445167541504,
-0.4284793436527252,
0.05326191335916519,
0.31321877241134644,
-0.1201934814453125,
-0.5276563763618469,
0.2197619080543518,
0.4465462863445282,
-0.004940276965498924,
-0.06522039324045... | |
With the type Integer you can do this:
```
int lowest = Integer.MIN_VALUE;
```
What can I do if I use generics?
```
K lowest = <...>;
```
I need this in order to implement something similar to a PriorityQueue.
I have access to a node I want to remove from the queue, but it is not the min.
```
1. I need to make i... | [
-0.11765173822641373,
-0.18428538739681244,
0.18819163739681244,
0.0028820671141147614,
-0.1154254749417305,
0.17199109494686127,
0.29088979959487915,
-0.11535203456878662,
-0.11493336409330368,
-0.5685548186302185,
0.1663210391998291,
0.4305867850780487,
-0.448727011680603,
0.459438264369... | |
sense...
Given that you don't know what K is at that point, (i.e. You're implementing it generically... duh!) you can't specify a min/max bound for it.
in a case where K could be a int, long, string OR object, you couldn't sensibly guess to use
Integer.MIN\_VALUE, "" OR NULL.
I guess what you're looking for is a K.... | [
0.07203929126262665,
0.09186794608831406,
0.03508161008358002,
0.025940803810954094,
-0.109126016497612,
0.0837319865822792,
0.19856221973896027,
0.0033398058731108904,
-0.038396142423152924,
-0.6318352222442627,
0.14300936460494995,
0.36351853609085083,
-0.30604901909828186,
0.42503952980... | |
Let say I have a file that contains a serialized object by BinaryFomatter. Now I want to be able to serialize another object and APPEND this on that existing file.
How can I do it?
First, if what you really need is to store an array of object - put them in a container and serialize the container, as said earlier.
Now... | [
0.6775683760643005,
-0.1200634241104126,
-0.1863946169614792,
0.2726099491119385,
0.034068647772073746,
-0.09767191112041473,
-0.045931968837976456,
0.19210787117481232,
-0.054398782551288605,
-0.7857822179794312,
0.2619366943836212,
0.8261501789093018,
-0.3624286651611328,
0.1753596961498... | |
write a small header in the beginning (or end) of the file that describes the content of the file (#'objects, and sizes).
2. Write a C# code to detect the beginning and end of each serialized object yourself. I'm not entirely sure it's possible. [Here](http://primates.ximian.com/~lluis/dist/binary_serialization_format.... | [
0.26515114307403564,
0.08348259329795837,
0.04943591728806496,
0.36261439323425293,
-0.059107549488544464,
-0.3570197522640228,
0.03804631158709526,
0.39300310611724854,
-0.34294572472572327,
-0.4389592707157135,
-0.05161954089999199,
0.32235389947891235,
-0.2515644133090973,
0.08852666616... | |
I am using FCKEditor within a Django app served by Apache/mod-wsgi. I don't want to install php just for FCKEditor andI see FCKEditor offers image uploading and image browsing through Python. I just haven't found good instructions on how to set this all up.
So currently Django is running through a wsgi interface using... | [
0.04288492351770401,
0.15583689510822296,
0.6413507461547852,
-0.26496973633766174,
-0.4449723958969116,
-0.1922546923160553,
0.31595468521118164,
-0.35826146602630615,
-0.2659169137477875,
-0.6293550729751587,
0.0006280970992520452,
0.37588658928871155,
-0.4463866651058197,
-0.02852847427... | |
Run the connector"
if environ['SCRIPT_NAME'].endswith("connector.py"):
conn = FCKeditorConnector(environ)
elif environ['SCRIPT_NAME'].endswith("upload.py"):
conn = FCKeditorQuickUpload(environ)
else:
start_response ("200 Ok", [('Content-Type','text/html')])
yield "Unknown pag... | [
0.04039259999990463,
-0.43129387497901917,
0.7325476408004761,
0.09101185947656631,
0.34077775478363037,
0.0023423428647220135,
0.009726552292704582,
-0.3217698335647583,
-0.07219903916120529,
-0.6930719614028931,
-0.33396413922309875,
0.573898196220398,
-0.35727834701538086,
-0.1806027293... | |
= conn.doResponse()
# Start WSGI response:
start_response ("200 Ok", conn.headers)
# Send response text
yield data
except:
start_response("500 Internal Server Error",[("Content-type","text/html")])
file = StringIO()
cgitb.Hook(file = file).handle()
yield f... | [
0.02046278677880764,
0.13270145654678345,
0.6288534998893738,
-0.468599796295166,
-0.03463844954967499,
-0.1588951051235199,
0.2987910807132721,
-0.4704284071922302,
-0.27944129705429077,
-0.4417192041873932,
-0.2652248740196228,
0.8063498139381409,
-0.2079000622034073,
-0.2414300292730331... | |
serve the fckeditor parts correctly or make apache serve both django and fckeditor correctly on a single domain.
Edit: Ultimately I was unhappy with this solution also so I made a [Django app](http://bitbucket.org/megaman821/django-fckconnector/) that takes care of the file uploads and browsing.
This is the solution I... | [
-0.030729137361049652,
0.0212410781532526,
0.5041137337684631,
0.08383236080408096,
-0.2717563807964325,
-0.3012700080871582,
0.3509191870689392,
-0.7176021337509155,
-0.03088904730975628,
-0.3849654197692871,
-0.2184380739927292,
0.42824363708496094,
-0.621098518371582,
-0.333561599254608... | |
FCKeditorQuickUpload
conn = FCKeditorQuickUpload(environ)
else:
from connector import FCKeditorConnector
conn = FCKeditorConnector(environ)
try:
data = conn.doResponse()
start_response('200 Ok', conn.headers)
return | [
-0.08699414134025574,
-0.6210812330245972,
0.5176116824150085,
0.1535676270723343,
0.18617033958435059,
-0.12977859377861023,
0.009981231763958931,
-0.5350494980812073,
-0.25688767433166504,
-0.5113964080810547,
-0.27835339307785034,
0.49305328726768494,
-0.5303136706352234,
-0.18462708592... | |
data
except:
start_response("500 Internal Server Error",[("Content-type","text/html")])
return "There was an error"
else:
sys.path.append('/path_to_your_django_site/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'your_django_site.settings'
import django.core.handle... | [
-0.2815084457397461,
0.21003840863704681,
0.29099518060684204,
-0.010935366153717041,
0.25296106934547424,
-0.09563107788562775,
0.07699915766716003,
-0.23758061230182648,
-0.317396879196167,
-0.37717801332473755,
-0.3480755388736725,
0.4415176212787628,
-0.29454731941223145,
-0.1957167536... | |
Is it possible to pass functions with arguments to another function in Python?
Say for something like:
```
def perform(function):
return function()
```
But the functions to be passed will have arguments like:
```
action1()
action2(p)
action3(p,r)
```
Do you mean this?
```
def perform(fun, *args):
fun(*ar... | [
0.11908336728811264,
-0.1791670173406601,
0.14744938910007477,
-0.32443445920944214,
-0.08354147523641586,
0.06477745622396469,
0.18189886212348938,
-0.05176897719502449,
-0.350057452917099,
-0.03461805731058121,
-0.40305885672569275,
0.4072624444961548,
-0.6160663366317749,
-0.37424576282... | |
I have been investigating OAuth to share resources in my site to other sites.
But, hole of OAuth specification was reported several days ago.
<http://oauth.net/advisories/2009-1>
Many sites decided to stop OAuth until fixed version is released.
Currently, can we have any alternative to OAuth?
I want an open-standa... | [
0.3541427254676819,
0.37779515981674194,
0.5531980991363525,
0.16253609955310822,
0.11014015227556229,
-0.2802056670188904,
0.15096676349639893,
0.316802978515625,
-0.11213996261358261,
-0.531581699848175,
-0.13805466890335083,
0.30470600724220276,
-0.27198049426078796,
0.08958198875188828... | |
Is it ok to use `<li>` tags without parent tags?
i.e.
```
<li> some copy
```
or must it be..
```
<ul> (substitute your favorite list type)
<li> some copy
</ul>
```
Links on the subject:
* [Spec](http://www.w3.org/TR/html401/struct/lists.html#h-10.2)
* [XHTML](http://www.w3schools.com/XHTML/xhtml_html.asp)
... | [
0.0020304997451603413,
0.2682487964630127,
0.6575912237167358,
-0.24944888055324554,
0.20549799501895905,
-0.3455681800842285,
0.19690509140491486,
-0.20490232110023499,
-0.14695829153060913,
-0.3015894889831543,
-0.6881867051124573,
0.4522659480571747,
-0.32907047867774963,
-0.14302071928... | |
explanation of correct XHTML](http://www.w3schools.com/XHTML/xhtml_html.asp) (and honestly, good HTML should conform to these as well. No reason not to.) | [
0.1456383913755417,
0.36480069160461426,
0.264444500207901,
0.25963568687438965,
-0.21305140852928162,
-0.4872809648513794,
0.3425992727279663,
-0.10966138541698456,
0.011509736068546772,
-0.25960680842399597,
-0.14539985358715057,
0.35719627141952515,
-0.05024471506476402,
-0.350715875625... | |
What's the best way to create a singleton in C? A concurrent solution would be nice.
I am aware that C isn't the first language you would use for a singleton.
First, C is not suitable for OO programming. You'd be fighting all the way if you do. Secondly, singletons are just static variables with some encapsulation. So... | [
-0.052557311952114105,
-0.052917685359716415,
-0.26567381620407104,
0.26614078879356384,
-0.2227509468793869,
0.1953396052122116,
0.11679638922214508,
0.1093304380774498,
-0.3110732138156891,
-0.5613322854042053,
0.19650930166244507,
0.6569226980209351,
-0.5560904145240784,
0.2517060637474... | |
return &instance;
}
```
or a smarter macro:
```
#define SINGLETON(t, inst, init) t* Singleton_##t() { \
static t inst = init; \
return &inst; \ | [
-0.11093583703041077,
-0.36504384875297546,
-0.08784816414117813,
-0.14003118872642517,
0.17370334267616272,
0.06660040467977524,
0.10335669666528702,
0.1332152634859085,
-0.040105532854795456,
-0.7731757760047913,
-0.4611724615097046,
0.8929550051689148,
-0.5632584095001221,
-0.1206871196... | |
}
#include <stdio.h>
/* actual definition */
SINGLETON(float, finst, 4.2);
int main() {
printf("%f\n", *(Singleton_float()));
return 0;
}
```
And finally, remember, that singletons are mostly abused. It is difficult to get them right, especially under multi-threaded environments... | [
0.23251108825206757,
-0.12839946150779724,
-0.02032766491174698,
-0.11266089975833893,
0.3230312764644623,
-0.19985851645469666,
0.3653491139411926,
-0.06287124007940292,
-0.12538816034793854,
-0.4884568154811859,
-0.33397433161735535,
0.8475522398948669,
-0.3136977553367615,
0.05148507654... | |
OK I have a ComboBox, the dataProvider is an array of objects with label properties that give the ComboBox the list of options.
Is there a way I can have a variable like mySelectedItem, and bind the ComboBox's selectedItem to it so that if it changes, the ComboBox's selectedItem will change to whatever it is?
I hope ... | [
0.16350451111793518,
-0.18627651035785675,
0.3938874304294586,
0.04578917846083641,
0.1543528139591217,
-0.029763085767626762,
0.08727141469717026,
-0.23412887752056122,
-0.12878413498401642,
-0.7430903315544128,
-0.06221732869744301,
0.452006995677948,
-0.32371747493743896,
0.199733600020... | |
i've got the following routeMaps setup for my website. Running and debugging locally works perfectly. I can publish the website to my server (www) but only the root page works (<http://www.domain.com>). As soon as I specify a controller (<http://www.domain.com/Project>) it stops working...
What am i doing wrong?
**Gl... | [
-0.14024531841278076,
-0.11287809163331985,
0.7569435834884644,
0.010526090860366821,
-0.06893745064735413,
-0.07091645896434784,
0.5894208550453186,
-0.30366623401641846,
-0.401517778635025,
-0.9827772974967957,
-0.0876489132642746,
0.2735411524772644,
-0.5918372273445129,
0.2130311578512... | |
' (3) Parameter defaults
routes.MapRoute("ProjectsByCategory", "Project/Category/{id}", _
New With {.controller = "Project", .action = "ListByCategory", .id = ""}, _
New With {.id = "^[0-9]+"})
routes.MapRoute( _
"Default", _
"{controller}/{action}/{id}"... | [
-0.1953374445438385,
0.020421069115400314,
0.7115930914878845,
-0.16474294662475586,
-0.3460242450237274,
0.2736760377883911,
0.15919700264930725,
-0.500495970249176,
-0.29527145624160767,
-0.8842832446098328,
-0.12196885049343109,
0.25893357396125793,
-0.47268882393836975,
-0.040362533181... | |
.action = "Index", .id = ""} _
)
End Sub
Sub Application_Start()
Common.LoadEntitySpacesFactory()
RegisterRoutes(RouteTable.Routes)
End Sub
End Class
```
Are you deploying to an IIS6 server? If so there are some steps you need to take [detailed here](http://haacked.com/archive/2008/11/26/asp.net-mvc-on-i... | [
-0.01589025929570198,
-0.04864376038312912,
0.4675101935863495,
-0.11530175060033798,
0.26932796835899353,
-0.22046801447868347,
0.6401293873786926,
-0.08555421233177185,
-0.463455468416214,
-0.5781193375587463,
-0.2950607240200043,
0.2713302671909332,
-0.29018864035606384,
0.3942987322807... | |
<http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&displaylang=en>
The IE6/7/8 XP SP3 images made available for testing from Microsoft are set to expire tomorrow(!) April 30. I'm a little concerned that Microsoft has not posted new images up yet since I use these fairly ofte... | [
0.46067896485328674,
0.18322719633579254,
0.9677672386169434,
0.05276548117399216,
-0.1438945084810257,
-0.5688803195953369,
0.5563516616821289,
0.23071333765983582,
-0.26741907000541687,
-0.47163549065589905,
-0.4051254689693451,
0.596160888671875,
0.10649548470973969,
0.24589185416698456... | |
sure an image refresh happens?
Otherwise, does anyone have a good suggestion on how to test IE6/7 on the same machine that doesn't involve these free images?
I'm using a fairly old image that expired a while ago. It tends to run for a while and then giving a message about being expired, and then again in about an hour... | [
0.522298276424408,
0.05352769047021866,
0.27227386832237244,
0.2438274621963501,
0.04295982047915459,
-0.34543877840042114,
0.5091195702552795,
0.6547195315361023,
-0.3385404050350189,
-0.47241199016571045,
0.3723147213459015,
0.6254563331604004,
-0.0887364074587822,
0.1319408416748047,
... | |
Over the years I have seen many errors on corrupted Access \*.MDB files.
I do not use Access as frontend, just as backend to store data Tables.
I already use the best practices: normalization, close the database connection ASAP, etc.
I was wondering if somebody knew which the best commercial tool to recover data... | [
0.3226091265678406,
0.41398701071739197,
0.0656057670712471,
0.18550211191177368,
-0.029485555365681648,
0.0028133271262049675,
0.1929384469985962,
0.4019203782081604,
-0.30361250042915344,
-0.5071496367454529,
0.24147970974445343,
0.7022935152053833,
0.06391799449920654,
0.365169733762741... | |
on a concurrent user & network environment, but there is nothing I can do right now.
Since I started professional Access development in 1996, I have only once had a corrupted MDB that required anything other than the built-in compact/repair tools. In that case, I used [Peter Miller's PKSolutions](http://pksolutions.com... | [
-0.18258652091026306,
0.540466845035553,
0.11180377751588821,
-0.1081213429570198,
0.008431407622992992,
-0.07196355611085892,
0.3954913914203644,
0.2740796208381653,
-0.30097612738609314,
-0.38021403551101685,
0.019134940579533577,
0.6514845490455627,
-0.3060712516307831,
0.24875093996524... | |
I have File1
```
A,B,C
```
and File2
```
D,E,F
```
I am trying to have
```
AD, AE, AF, BD, BE, BF, CD, CE, CF
```
unsuccessfully by
```
echo {`cat File1`}{`cat File2`}
```
giving
```
{A,B,C}{D,E,F}
```
**How can you solve the problem by Zsh/AWK?**
Since I started professional Access development in 1996... | [
-0.07663051784038544,
0.4484805464744568,
0.18408460915088654,
-0.09516383707523346,
0.007024630904197693,
-0.015610306523740292,
0.15856140851974487,
0.18692098557949066,
-0.08967840671539307,
-0.6631794571876526,
-0.07242581993341446,
0.6696237921714783,
-0.2997109889984131,
0.4898718893... | |
I am trying to write a Perl script to connect to me YouTube account but it doesnt seem to work. Basically I just want to connect to my account but apparently it is not working. I don't even have an idea on how I could debug this! Maybe it is something related to https protocol?
Please enlighten me! Thanks in advance.
... | [
0.5769017934799194,
0.06854555010795593,
0.6786165237426758,
0.02631189487874508,
-0.17666907608509064,
-0.3796517252922058,
0.8196424245834351,
-0.11469865590333939,
-0.03151115030050278,
-0.9673649072647095,
-0.16611739993095398,
0.696012556552887,
-0.47012296319007874,
0.157591089606285... | |
$res = $ua->request(GET "https://www.google.com/accounts/ServiceLogin?service=youtube&hl=en_US&passive=true<mpl=sso&uilel=3&continue=http%3A//www.youtube.com/signup%3Fhl%3Den_US%26warned%3D%26nomobiletemp%3D1%26next%3D/index");
die("ERROR1: GET http://www.youtube.com/login\n") unless ($res->is_success);
# Now we log... | [
0.25746703147888184,
0.06187138706445694,
1.150164246559143,
-0.08998869359493256,
0.06900704652070999,
0.09613923728466034,
0.7857760190963745,
-0.4989396035671234,
-0.40222737193107605,
-0.5763913989067078,
-0.6186465620994568,
0.8151811957359314,
-0.05572132766246796,
0.2541467249393463... | |
=> "/index",
username => $login,
password => $pass,
action_login => "Log+In"
]
);
# YouTube redirects (302) to a new page | [
0.25911420583724976,
-0.2678147852420807,
0.7795606851577759,
-0.052626706659793854,
0.12638823688030243,
0.10474719107151031,
0.4445352256298065,
0.0037024226039648056,
-0.22012746334075928,
-0.6780907511711121,
-0.06273908168077469,
0.42282357811927795,
-0.5421985983848572,
0.10812358558... | |
when login is success
# and returns OK (200) if the login failed.
#die("ERROR: Login Failed\n") unless ($res->is_redirect());
print $res->content;
```
---
what i am doing is learning the web features of perl, so i dont want to use any library except wwwlib or mechanize to get the job done.
how can i just connect to... | [
0.2526705265045166,
-0.001203315332531929,
0.583118736743927,
0.23027527332305908,
0.01993686519563198,
-0.48036742210388184,
0.6352791786193848,
-0.04162375628948212,
-0.39645916223526,
-0.8081673979759216,
-0.08085624873638153,
0.849860429763794,
0.09082088619470596,
-0.17475658655166626... | |
the shortcut `$ua->request(GET/POST)` method since I always ended up needing more flexibility that only the use of [`HTTP::Request`](http://search.cpan.org/perldoc/HTTP::Request) and [`HTTP::Response`](http://search.cpan.org/perldoc/HTTP::Response) allowed. I always felt the code was cleaner that way too.
Why is your ... | [
0.38329657912254333,
-0.10007183998823166,
0.31708627939224243,
0.02651515044271946,
-0.44030460715293884,
-0.27221623063087463,
0.4513751268386841,
-0.14339487254619598,
-0.20411407947540283,
-0.5891960859298706,
-0.2367933988571167,
0.5568300485610962,
-0.36131736636161804,
0.15872386097... | |
just looking to learn [`libwww`](http://search.cpan.org/dist/libwww-perl/) I'd suggest using a different site as a target as I'm sure YouTube has all sort of anti-scripting hardening. | [
0.8344139456748962,
-0.059424709528684616,
0.14495006203651428,
-0.1477249264717102,
-0.26825687289237976,
-0.36674827337265015,
0.25580447912216187,
0.6159658432006836,
-0.23092377185821533,
-0.26413315534591675,
0.036118801683187485,
0.35309112071990967,
-0.09912082552909851,
0.068447716... | |
Bellow is simplified version of the code I have:
```
public interface IControl<T>
{
T Value { get; }
}
public class BoolControl : IControl<bool>
{
public bool Value
{
get { return true; }
}
}
public class StringControl : IControl<string>
{
public string Value
{
get { return ""... | [
0.1479603350162506,
-0.4288986325263977,
0.5188388824462891,
0.19475582242012024,
-0.17236149311065674,
0.12724941968917847,
0.3945741355419159,
-0.6956244111061096,
-0.1312056928873062,
-0.20769049227237701,
-0.0642111673951149,
0.47165051102638245,
-0.27343010902404785,
0.240266770124435... | |
(controlType)
{
case "Bool":
return new BoolControl();
case "String":
return new StringControl();
}
return null;
}
}
```
The problem is in GetControl method of ControlFactory class. | [
-0.41380083560943604,
-0.07410828769207001,
0.37030693888664246,
0.040852900594472885,
0.2582924962043762,
-0.008934464305639267,
0.31448283791542053,
-0.24296218156814575,
0.01953365094959736,
-0.37486276030540466,
-0.38620230555534363,
0.4361664354801178,
-0.5796985626220703,
0.371901839... | |
Because it returns IControl and I have only IControl<T> that is a generic interface. I cannot provide T because in Bool case it's going to bool and in String case it's going to be string.
Any idea what I need to do to make it work?
Just derive `IControl<T>` from `IControl`.
```
public interface IControl<T> : IControl... | [
-0.020489012822508812,
-0.2673693895339966,
0.4645470082759857,
0.028894299641251564,
-0.0575740709900856,
0.048830706626176834,
0.4500194787979126,
-0.16634289920330048,
-0.15902182459831238,
-0.7064555883407593,
-0.11404077708721161,
0.6886837482452393,
-0.5437365770339966,
0.12752297520... | |
return new BoolControl(); // Will not compile.
}
else if (typeof(T) == typeof(String))
{
return new StringControl(); // Will not compile.
}
else
{
return null;
}
}
```
Now you have the problem that the new controls cannot be implicitly casted to `IControl<T>` and you would ... | [
-0.05713167414069176,
-0.17715805768966675,
0.6514179110527039,
-0.09286365658044815,
0.2441888451576233,
0.08754102140665054,
0.24172312021255493,
-0.4744874835014343,
-0.2859373986721039,
-0.5116785168647766,
-0.22117485105991364,
0.7597425580024719,
-0.5116710066795349,
0.08950059860944... | |
return new (IControl<T>)BoolControl();
}
else if (typeof(T) == typeof(String))
{
return (IControl<T>)new StringControl();
}
else
{
return null;
}
}
```
**UPDATE**
Changed the cast from `as IControl<T>` to `(IControl<T>)`. This is prefered because it will cause an exception... | [
0.030329160392284393,
-0.3374882638454437,
0.41322675347328186,
-0.47085827589035034,
-0.0084357475861907,
0.06886143237352371,
0.45760998129844666,
-0.37065157294273376,
-0.051183439791202545,
-0.4341523051261902,
-0.40784958004951477,
0.6560351252555847,
-0.5881549715995789,
0.0911845639... | |
Background: I've got a bunch of strings that I'm getting from a database, and I want to return them. Traditionally, it would be something like this:
```
public List<string> GetStuff(string connectionString)
{
List<string> categoryList = new List<string>();
using (SqlConnection sqlConnection = new SqlConnection... | [
0.17201994359493256,
-0.15946656465530396,
0.44026312232017517,
-0.1315440535545349,
0.24160853028297424,
0.12646904587745667,
0.033395275473594666,
-0.01842513307929039,
-0.4512709081172943,
-0.3802788555622101,
-0.40256786346435547,
0.3745253384113312,
-0.335941880941391,
0.1259381175041... | |
sqlConnection.Open();
SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
while (sqlDataReader.Read())
{
categoryList.Add(sqlDataReader["myImportantColumn"].ToString());
}
}
}
return categoryList;
}
```
But then I figure the consume... | [
0.059480153024196625,
-0.1644420176744461,
0.7372695803642273,
-0.20107556879520416,
-0.09385093301534653,
0.08437305688858032,
0.01236042007803917,
-0.14045991003513336,
0.0011608472559601068,
-0.1997508406639099,
0.012333018705248833,
0.8567869067192078,
-0.22504599392414093,
0.218302264... | |
going to want to iterate through the items and doesn't care about much else, and I'd like to not box myself in to a List, per se, so if I return an IEnumerable everything is good/flexible. So I was thinking I could use a "yield return" type design to handle this...something like this:
```
public IEnumerable<string> Ge... | [
0.07860046625137329,
-0.2682456374168396,
0.5944072008132935,
-0.08995220810174942,
0.44380441308021545,
-0.3154408633708954,
-0.0625634640455246,
-0.07022718340158463,
-0.17113462090492249,
-0.711158812046051,
-0.39299771189689636,
0.656682014465332,
-0.406644344329834,
0.0837691575288772... | |
{
sqlCommand.CommandType = CommandType.StoredProcedure;
sqlConnection.Open();
SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
while (sqlDataReader.Read())
{
yield return sqlDataReader["myImportantColumn"].ToString();
} | [
-0.11687304079532623,
-0.03462515026330948,
0.4908776879310608,
-0.15877707302570343,
0.27600327134132385,
0.0587540902197361,
0.3487607538700104,
-0.2686946392059326,
0.023257169872522354,
-0.34060347080230713,
-0.1751789003610611,
0.6749750375747681,
-0.22692354023456573,
0.2196878045797... | |
}
}
}
```
But now that I'm reading a bit more about yield (on sites like this...msdn didn't seem to mention this), it's apparently a lazy evaluator, that keeps the state of the populator around, in anticipation of someone asking for the next value, and then only running it until it returns the next value.
This s... | [
0.1895071417093277,
0.18668842315673828,
0.33153611421585083,
-0.24964947998523712,
0.14866991341114044,
-0.23282837867736816,
0.06818196922540665,
0.30813056230545044,
0.05753650516271591,
-0.555903971195221,
0.0045160092413425446,
0.5529460906982422,
-0.0349162295460701,
0.30378079414367... | |
and then gets stuck in a loop...as far as I can see my DB connection is going to stay open forever.
Sounds like asking for trouble in some cases if the iterator doesn't finish...am I missing something?
It's a balancing act: do you want to force all the data into memory immediately so you can free up the connection, or... | [
0.3774555027484894,
-0.15912187099456787,
0.338269978761673,
0.3702499270439148,
0.14951865375041962,
-0.21958540380001068,
0.40259990096092224,
0.11768389493227005,
-0.3525473475456238,
-0.0951862633228302,
0.16647973656654358,
0.24489744007587433,
-0.3477463722229004,
0.38143134117126465... | |
to do. If you write the code using an iterator block, the caller can *very* easily turned that streaming form into a fully-buffered form:
```
List<string> stuff = new List<string>(GetStuff(connectionString));
```
If, on the other hand, you do the buffering yourself, there's no way the caller can go back to a streami... | [
0.4253441095352173,
-0.08237577229738235,
0.32315197587013245,
-0.008446337655186653,
0.14293426275253296,
-0.16589723527431488,
0.3202759325504303,
-0.38207149505615234,
-0.29702216386795044,
-0.7338081002235413,
-0.14707385003566742,
0.6061633229255676,
-0.4200516939163208,
-0.1158013045... | |
make the appropriate decision, and you have good reason to believe that they'll never really want to stream the data (e.g. it's never going to return much anyway) then go for the list approach. Either way, document it - it could very well affect how the return value is used.
Another option for dealing with large amoun... | [
0.35063472390174866,
-0.5800216794013977,
0.0036897799000144005,
0.4124479591846466,
-0.10907027125358582,
-0.19138720631599426,
-0.12797509133815765,
-0.05973244085907936,
-0.37422841787338257,
-0.4839939773082733,
-0.14268408715724945,
0.6165019869804382,
-0.04087647423148155,
-0.0220185... | |
In IE and FF, i can attach an event handler to onBeforeUnload, and by passing a string to a property of the event, the user will see a dialog asking him whether he wants to continue with the "unloading" (either closing the window or navigating away).
Safari and Chrome don't support onBeforeUnload, and onUnload seems t... | [
0.2985382080078125,
-0.2306068241596222,
0.3338497281074524,
0.025453530251979828,
-0.01662108115851879,
-0.35235148668289185,
0.161579892039299,
0.13556426763534546,
-0.1275021880865097,
-0.6793883442878723,
-0.15978431701660156,
0.5063201785087585,
-0.4884081482887268,
0.0831960439682006... | |
in its place when they come back.
However, I am hosting other sites inside IFrames, and sometimes these decide to get rid of me and take over the browser, which is what I'm trying to avoid.
Thanks!
This works perfectly for me in both Chrome and Safari:
```
<html><body><p>Test</p>
<script>window.onbeforeunload = funct... | [
0.39810484647750854,
0.06813611835241318,
0.6271744966506958,
-0.133398175239563,
0.04550556838512421,
-0.24454542994499207,
0.4332929849624634,
-0.008340024389326572,
-0.08369772881269455,
-0.8140771985054016,
-0.08215703815221786,
0.4526382088661194,
-0.03261490538716316,
-0.077485345304... | |
Most mail clients that support SSL/TLS only require the user to say whether or not SSL should be enabled. The user doesn't have to know anything about Explicit & Implicit SSL and the differences between them.
So, how does the mail client determine which type of SSL to use? Is it based on default port numbers? Does it ... | [
0.18548989295959473,
-0.016078634187579155,
0.3955732583999634,
0.0032582443673163652,
0.008678397163748741,
-0.23701485991477966,
0.02251916565001011,
0.11801822483539581,
-0.29328808188438416,
-0.705592930316925,
-0.31695881485939026,
0.4811175465583801,
-0.4552820920944214,
-0.089158274... | |
numbers are a great hint, but there could also be a check box in some UI that forces it even when the standard (unprotected) port number is used.
There are IANA registered port numbers for secure mail, but some ISPs may use other ports.
* IMAP/SSL: 993
* POP3/SSL: 995
SMTP/SSL is often offered on port 465, but this ... | [
0.24409927427768707,
-0.011008410714566708,
0.5684574246406555,
0.11160832643508911,
-0.07128074020147324,
0.037896085530519485,
0.315296471118927,
0.08720041066408157,
-0.42115187644958496,
-0.5313462615013123,
-0.4602793753147125,
0.060235753655433655,
-0.1504707634449005,
0.078961007297... | |
command, the server will list its capabilities, which might include support for the STARTTLS command. | [
0.0847485363483429,
-0.33542153239250183,
0.32163310050964355,
0.1154581680893898,
0.1796581894159317,
-0.6158742308616638,
-0.06354326754808426,
0.24425537884235382,
0.060312263667583466,
-0.4741126298904419,
-0.369129478931427,
0.2754806876182556,
0.03503439575433731,
0.05739555507898331... | |
I have in the past successfully managed to copy/edit/paste rewrite rules on an apache server over which I had limited control.
Now however I am experimenting with an Apache server which I can restart and configure to my heart's content but I cannot get even a basic rewrite example to work and that is after I have read... | [
0.3122815489768982,
0.37912091612815857,
0.017525993287563324,
-0.022062215954065323,
-0.18007898330688477,
-0.14711475372314453,
0.8097273111343384,
0.005297783762216568,
-0.1473626047372818,
-0.8063042163848877,
0.15352694690227509,
0.5469374656677246,
-0.20937591791152954,
0.19097517430... | |
thing from httpd.conf but the rewrite stuff.
Let's see what other information I can add:
```
chilcott:/etc/apache2/conf.d# uname -a
Linux chilcott 2.6.26-1-486 #1 Sat Jan 10 17:46:23 UTC 2009 i686 GNU/Linux
chilcott:/etc/apache2/conf.d# apache2ctl -V
Server version: Apache/2.2.9 (Debian)
Server built: Jan 20 200... | [
-0.18483282625675201,
-0.019566690549254417,
0.7251158356666565,
-0.24070732295513153,
-0.018749065697193146,
-0.2205790877342224,
0.470462828874588,
-0.4773186147212982,
-0.2377982884645462,
-0.553787350654602,
-0.16623879969120026,
0.34221309423446655,
-0.21352924406528473,
0.19900266826... | |
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT=""
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/apache2/accept... | [
0.21036483347415924,
0.22697432339191437,
0.7373107671737671,
-0.19455267488956451,
0.09667455404996872,
-0.2169797569513321,
0.5091562867164612,
-0.6673824787139893,
-0.1146949902176857,
-0.6020521521568298,
-0.223562553524971,
0.648776113986969,
-0.24469754099845886,
0.06266413629055023,... | |
Several of the Apple-provided apps have informational/help text in their settings. For example, the Keyboard settings screen includes, under the *“.” shortcut* toggle, the help text "Double tapping the space bar will...".
I know I can do this in my app by adding a group footer, but is it possible to do this in the set... | [
0.14316537976264954,
-0.1859472543001175,
0.551836371421814,
0.10192276537418365,
0.18356317281723022,
0.3393321931362152,
0.2671506106853485,
-0.20065030455589294,
-0.20646528899669647,
-0.6556748151779175,
-0.0005687251687049866,
0.4962427616119385,
-0.17284005880355835,
-0.5541297793388... | |
Given the following HTML fragment:
```
<form id="aspnetForm" onsubmit="alert('On Submit Run!'); return true;">
```
I need to remove/clear the handler for the onsubmit event and register my own using jQuery or any other flavor of JavaScript usage.
To do this without any libraries:
```
document.getElementById("aspnet... | [
0.3343668580055237,
-0.07606872916221619,
0.208312526345253,
-0.07307619601488113,
-0.15449368953704834,
-0.2467774748802185,
0.5614563226699829,
-0.4050772190093994,
0.015283589251339436,
-0.5129497051239014,
-0.32609790563583374,
0.2819930911064148,
-0.4513692557811737,
0.165125653147697... | |
I want to make a long list short by hiding some elements in long sub-lists without adding extra processing on the server side. The problem is that the markup that comes from the server is not controlled by me and is not designed in a way to make my job easy. here is the code
```
<ul id="long-list">
<li class="item">... | [
0.09903343766927719,
-0.1066678836941719,
0.2445916384458542,
-0.12282954901456833,
-0.17779895663261414,
0.2025769054889679,
-0.10395809262990952,
-0.2262720912694931,
-0.2214018553495407,
-0.4194530248641968,
-0.20895437896251678,
0.3352079689502716,
-0.41144442558288574,
0.2758461534976... | |
sibling to the items. Now, I want to have a jQuery code that shows only 3 items after each header and hide the rest to make the list shorter and more usable.
Here is my try which is **not** working:
```
$('#long-list li.header ~ li.item:gt(3)').hide();
$('#long-list li.header ~ li.item:lt(3)').show();
$('#long... | [
-0.45269545912742615,
-0.3404824435710907,
0.39306381344795227,
0.04602944850921631,
-0.26692336797714233,
0.14233621954917908,
0.46854040026664734,
-0.015509899705648422,
-0.3749390244483948,
-0.3862893283367157,
0.030080782249569893,
0.5172600150108337,
-0.3243703842163086,
0.18176816403... | |
that have hidden items, saying x items are hidden and bind an onclick event to toggle hidden items.
```
if ($('#list li.header')[0]) {
var i = -1000;
$("#list > li").each(function(){
if ($(this).hasClass("header")) {
(i>3) && ($(this).before( "<li class='more'>" + (i-3) + " more... | [
0.0666837990283966,
-0.06698597222566605,
0.5834234952926636,
-0.2971600592136383,
0.33504948019981384,
-0.13082334399223328,
0.43554458022117615,
-0.5413768887519836,
-0.22737102210521698,
-0.842028021812439,
-0.4991789758205414,
0.6242621541023254,
-0.39373162388801575,
0.336652457714080... | |
}
else {
i = i+1;
}
$(this).toggle(i<=3);
});
}
```
It's basically based on what svinto said above. I still look for a better performance. Anyhow, right now I'm happy with the results.
Initiating i with -1000 ensures that we'll not hide items at the top of the list that do... | [
0.17620712518692017,
0.05065006762742996,
0.4713716208934784,
-0.09940420091152191,
0.13398377597332,
-0.19718675315380096,
0.3234763443470001,
-0.43596944212913513,
-0.1730429232120514,
-0.8201553225517273,
-0.026497166603803635,
0.6197196245193481,
-0.32479068636894226,
0.355911940336227... | |
the i to zero and start counting. | [
0.22598600387573242,
0.08144688606262207,
0.4543279707431793,
-0.009531199932098389,
-0.011396483518183231,
0.020996125414967537,
0.17023488879203796,
0.18982598185539246,
0.05480320379137993,
-0.6459912061691284,
0.3190569579601288,
0.5014498233795166,
0.28104010224342346,
0.3391418755054... | |
I'm generating regular expressions dynamically by running through some xml structure and building up the statement as I shoot through its node types. I'm using this regular expression as part of a Layout type that I defined. I then parse through a text file that has an Id in the beginning of each line. This id points m... | [
0.27067697048187256,
-0.05121152848005295,
0.3728315830230713,
0.10181800276041031,
-0.12589803338050842,
0.313664972782135,
0.1950431913137436,
-0.07353492826223373,
-0.18454551696777344,
-0.5100616216659546,
0.08019129931926727,
0.35231390595436096,
-0.40192490816116333,
-0.1206413805484... | |
up a bit, but to no avail. What is baffling is that these expressions aren't that complex. I am by no means a RegEx guru, but I know a *decent* amount about them to get things going well.
Here is the code that generates the expressions...
```
StringBuilder sb = new StringBuilder();
//get layout id and memberkey in th... | [
0.3397758901119232,
0.00893237441778183,
0.6985573768615723,
-0.30113738775253296,
-0.1353742778301239,
0.3026990592479706,
0.5093885064125061,
-0.7326579689979553,
-0.18104188144207,
-0.5017068386077881,
-0.0543963797390461,
0.4868880808353424,
-0.31643152236938477,
0.11229563504457474,
... | |
break;
case PrimitiveType.DATE:
sb.Append(@"([0-9]{2}/[0-9]{2}/[0-9]{4})");
break;
case PrimitiveType.FLOAT:
sb.Append(@"([-+]?[0-9]*\.?[0-9]+)");
break;
case PrimitiveType.INTEGER:
sb.Append(@"([0-9]+)"); | [
-0.11964281648397446,
-0.09791731089353561,
0.13932380080223083,
-0.37460020184516907,
0.36911264061927795,
0.19406384229660034,
0.5010232329368591,
-0.49007099866867065,
-0.030609119683504105,
-0.2497415989637375,
-0.5122870206832886,
0.12853717803955078,
-0.461985319852829,
0.13991051912... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.