text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm drawing a flat disk using `gluDisk()` in my scene. `gluDisk()` draws the disk facing the positive Z axis but I want it to be facing some arbitrary normal I have.
Clearly I need to use `glRotate()` to get the disk facing properly but what should be the rotation? I remember this can be calculated using Quaternions... | [
-0.08170274645090103,
-0.14593349397182465,
0.46065160632133484,
-0.13372981548309326,
-0.4516433775424957,
0.34888267517089844,
-0.2255694568157196,
-0.11687490344047546,
-0.18832091987133026,
-0.8860296010971069,
-0.01141570694744587,
0.6499477028846741,
-0.1766204833984375,
0.1647065877... | |
derived from their **dot-product**. This value is |A|.|B|.cos(theta), but as the two normal vectors should be normalised it will give cos(theta), so just take the inverse cosine to get the rotation amount.
The resulting vector and angle are the required parameters for `glRotate()` - there's no need to calculate the ac... | [
-0.06612102687358856,
-0.14771653711795807,
0.5859954357147217,
-0.40419453382492065,
-0.3441457748413086,
0.10207438468933105,
-0.13732361793518066,
-0.4581911563873291,
0.1792372465133667,
-0.26077115535736084,
-0.10536310821771622,
0.6086495518684387,
-0.09562277793884277,
0.06232652813... | |
Duplicate of [prepend to a file one liner shell?](https://stackoverflow.com/questions/54365/prepend-to-a-file-one-liner-shell) .
I trying to put my paste to the very first line without opening an editor similarly as but for the reverse direction
```
echo Masi >> file
```
**How can you put data to the first line in ... | [
0.16343671083450317,
0.27684226632118225,
0.25814327597618103,
0.025189470499753952,
-0.01215822622179985,
0.3715595304965973,
-0.023245248943567276,
0.010698899626731873,
-0.3514290452003479,
-0.5014553070068359,
0.03399877995252609,
0.27746281027793884,
-0.5745022892951965,
0.26862910389... | |
no. | [
0.004939547274261713,
0.05477665737271309,
0.16101162135601044,
0.1264842003583908,
-0.10722602158784866,
0.192876935005188,
0.01848738268017769,
0.016446733847260475,
-0.01824323832988739,
-0.24334874749183655,
-0.1792154461145401,
0.23913046717643738,
-0.0428880974650383,
0.3750167191028... | |
I have a controller named "AccountController" and action called "ResetPassword". From the html markup I can do something like:
```
<%= Html.ActionLink("LinkText", "ResetPassword", "AccountController") %>
```
and it will output the correct url. Is there a way to do this programmatically? I am trying to get the url a... | [
0.0009217781480401754,
-0.14907421171665192,
0.6026204824447632,
0.08902598172426224,
-0.20569945871829987,
-0.08048307150602341,
0.24173970520496368,
-0.12270916998386383,
-0.4072287380695343,
-0.7145203351974487,
0.12179341912269592,
0.6199023127555847,
-0.33055734634399414,
0.2130667567... | |
from the controller (to pass in to my class method)
Check out [Url Form Action Without ViewContext](https://stackoverflow.com/questions/363234/url-form-action-without-viewcontext) . | [
-0.25410977005958557,
-0.31360501050949097,
0.4478779435157776,
0.11907290667295456,
0.09742297977209091,
-0.2898666560649872,
0.16935355961322784,
-0.13473723828792572,
-0.3371363580226898,
-0.2495109885931015,
-0.5586828589439392,
0.4253588020801544,
-0.1917790323495865,
-0.0381486974656... | |
Brian's premise in his argument to the question ["Are side effects a good thing?"](https://stackoverflow.com/questions/763835/are-side-effects-a-good-thing) is interesting:
> computers are von-Neumann machines that are designed to work well with effects (rather than being designed to work well with lambdas)
I am conf... | [
0.3768095076084137,
0.5454216599464417,
-0.12990263104438782,
-0.1877012997865677,
-0.05990396440029144,
-0.025879066437482834,
0.10551199316978455,
-0.0781189501285553,
-0.3010714054107666,
0.07455319911241531,
-0.0014550375053659081,
0.42195814847946167,
-0.4066707193851471,
0.0655048489... | |
What is the real message?
In what sense, the parts of the premise [1] and [2] are right? What are the hidden premises in the reply? Can someone justify the original premise? How do the von-Neumann machines and Lambdas really work?
I'm not entirely sure what you're asking, but as I read it, you're asking what he means ... | [
0.48194465041160583,
0.04127685725688934,
-0.04190189018845558,
0.3975397050380707,
-0.18758748471736908,
0.1060943529009819,
0.08751143515110016,
0.22039099037647247,
-0.07129848748445511,
-0.09898718446493149,
-0.2811610698699951,
0.5263245701789856,
-0.5065649747848511,
0.10386173427104... | |
instructions manipulating and accessing a store (our RAM). That is, everything is implicitly done through side effects. Data is read from some area in RAM, processed a bit, and written back to some (other, perhaps) area in RAM.
Without side effects, the CPU would be limited to manipulating whatever garbage data happene... | [
0.17561481893062592,
0.09976061433553696,
-0.0034361002035439014,
0.34066343307495117,
0.112345851957798,
0.12686192989349365,
0.39034953713417053,
-0.09440398216247559,
-0.04617610201239586,
-0.219514861702919,
0.015592018142342567,
0.4620175361633301,
-0.4310879409313202,
-0.141099005937... | |
a machine would be based around functional principles, of functions taking one or more arguments, and returning a new value, never modifying existing ones. (And no, I'm not sure how that would work in hardware... :))
Does that answer your question? | [
0.13978798687458038,
0.31431901454925537,
-0.18768075108528137,
0.39624708890914917,
0.11218800395727158,
0.557989239692688,
0.06946102529764175,
-0.08868476003408432,
0.08457770943641663,
-0.4196750223636627,
0.13351726531982422,
0.44245925545692444,
-0.37437790632247925,
0.04629348218441... | |
Isn't a three state object immedately capable of holding more information and handling larger values? I know that processors currently use massive nets of XOR gates and that would need to be reworked.
Since we are at 64 bit (we can represent 2^63 possible states) computing the equivalent [ternary](http://en.wikipedia... | [
-0.00052136235171929,
-0.10854000598192215,
0.29439347982406616,
0.23650848865509033,
-0.10723662376403809,
0.28992143273353577,
0.3039191961288452,
-0.11102110892534256,
-0.2970377206802368,
-0.6838595867156982,
-0.010536342859268188,
0.08208981901407242,
0.013022090308368206,
0.337781965... | |
much harder to build components that use more than two states/levels/whatever. For example, the transistors used in logic are either closed and don't conduct at all, or wide open. Having them half open would require much more precision and use extra power. Nevertheless, sometimes more states are used for packing more d... | [
0.2663029134273529,
0.03918548300862312,
0.011850468814373016,
0.14861948788166046,
-0.13636106252670288,
-0.19356361031532288,
0.27995970845222473,
-0.25623825192451477,
-0.22934173047542572,
-0.49553579092025757,
-0.2543610632419586,
0.18490701913833618,
-0.2478240728378296,
0.3772952854... | |
Instead you go directly to four or a higher power of two.
These are practical reasons why it is not done, but mathematically it is perfectly possible to build a computer on ternary logic. | [
0.04673260822892189,
0.025786718353629112,
0.019094282761216164,
0.396428644657135,
-0.29185205698013306,
0.27774524688720703,
0.2244575172662735,
-0.3743723928928375,
-0.3478439450263977,
-0.3630458116531372,
-0.17916958034038544,
0.45600414276123047,
-0.04011791571974754,
0.1386326253414... | |
I am connecting to a 3rd party server. I know right now they allow 8 connections from the same remote user. However i dont know if they will raise or lower the connection limit. So i want my app to dynamically find out. How can i do this?
I'm using C#, MSVS 2008
-----------------------
I started a bounty for anyone w... | [
0.40999382734298706,
0.10938214510679245,
0.46060889959335327,
0.3454955220222473,
0.12021858245134354,
-0.002877014223486185,
0.5867314338684082,
0.3678402602672577,
-0.4046669602394104,
-0.6604122519493103,
0.26990148425102234,
0.49377092719078064,
-0.03977993503212929,
-0.02415482513606... | |
to do this and why someone allows 8 connections.
> Defined in 1999 (RFC 2616) “clients
> that use persistent connections should
> limit the number of simultaneous
> connections that they maintain to a
> given server. A single-user client
> SHOULD NOT maintain more than 2
> connections with any server or proxy.
>... | [
-0.222317174077034,
-0.025183359161019325,
0.6059821248054504,
0.057187922298908234,
-0.06812505424022675,
-0.12661689519882202,
0.26708272099494934,
-0.312560498714447,
-0.8091071844100952,
-0.5989759564399719,
-0.020246202126145363,
0.4577648937702179,
-0.5367348790168762,
0.137645602226... | |
AJAX or AJAX-like requests to
> update a Web page the http limits are
> discussed more and more.
Like the RFC says, I was only able to get 2 open connections to web servers.
But here's the code:
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading;
namesp... | [
0.03486267849802971,
-0.3598693013191223,
0.5427495837211609,
0.14959575235843658,
-0.19127605855464935,
0.009170212782919407,
0.17296521365642548,
-0.22526989877223969,
-0.22436681389808655,
-0.7324203848838806,
-0.02109670266509056,
0.4901772141456604,
-0.20600010454654694,
0.28145912289... | |
}
}
public class RequestThread
{
public AutoResetEvent AsyncWaitHandle { get; private set; }
public RequestCounter RequestCounter;
public String Url;
public HttpWebRequest Request;
public HttpWebResponse Response;
public RequestThread(AutoResetEvent r, Strin... | [
-0.08844832330942154,
-0.11192331463098526,
0.5220615863800049,
-0.0874561294913292,
-0.03919031098484993,
0.29004114866256714,
0.42007365822792053,
-0.31235742568969727,
0.02797262743115425,
-0.32708269357681274,
-0.5959932208061218,
0.8766494989395142,
-0.12845546007156372,
0.38395687937... | |
Url = u;
AsyncWaitHandle = r;
RequestCounter = rc;
}
public void Close()
{
if (Response != null)
Response.Close(); | [
-0.13074453175067902,
-0.1868792176246643,
0.8299428820610046,
-0.3678781986236572,
0.053040582686662674,
0.1998825967311859,
0.3801283836364746,
-0.41225650906562805,
0.03017057292163372,
-0.046954236924648285,
-0.633549153804779,
0.4942723512649536,
-0.2776094675064087,
0.652623057365417... | |
if (Request != null)
Request.Abort();
}
}
public class ConnectionTest
{
static void Main()
{
string url = "http://www.google.com/";
int max = GetMaxConnections(25, url); | [
-0.0035105550196021795,
-0.35482460260391235,
0.6231869459152222,
0.11273550242185593,
0.3154985010623932,
-0.07591389119625092,
0.4338032007217407,
0.2135402113199234,
-0.13755843043327332,
-0.5369626879692078,
-0.6168496608734131,
0.5837820172309875,
-0.5234993100166321,
0.55024212598800... | |
Console.WriteLine(String.Format("{0} Max Connections to {1}",max,url));
Console.ReadLine();
}
private static int GetMaxConnections(int maxThreads, string url)
{
RequestCounter requestCounter = new RequestCounter();
List<RequestThread> threadState = new List<... | [
-0.11877363920211792,
-0.5278897881507874,
0.9390996694564819,
0.021697770804166794,
0.45517808198928833,
0.2067451775074005,
0.17613370716571808,
-0.2540351450443268,
0.047230079770088196,
-0.7554534673690796,
-0.404763787984848,
0.5201467275619507,
-0.19144532084465027,
0.448245316743850... | |
= 0; i < maxThreads; i++)
threadState.Add(new RequestThread(new AutoResetEvent(false), url, requestCounter));
List<Thread> threads = new List<Thread>();
foreach (RequestThread state in threadState)
{
Thread t = new Thread(StartRequest); | [
-0.09979815781116486,
-0.3586723804473877,
0.49295711517333984,
-0.6135052442550659,
0.2465522736310959,
0.17714349925518036,
0.38713034987449646,
-0.25673702359199524,
-0.11841781437397003,
-0.5886807441711426,
-0.41433247923851013,
0.4002269208431244,
-0.33657601475715637,
0.683798491954... | |
t.Start(state);
threads.Add(t);
}
WaitHandle[] handles = (from state in threadState select state.AsyncWaitHandle).ToArray();
WaitHandle.WaitAll(handles, 5000); // waits seconds
foreach (Thread t in threads) | [
0.2492067515850067,
-0.5119136571884155,
0.4513251781463623,
-0.18769431114196777,
0.3244984745979309,
0.49503692984580994,
0.45049378275871277,
-0.2931790351867676,
-0.4931653141975403,
-0.5214176177978516,
-0.1505116969347,
0.2576184570789337,
-0.09131699055433273,
0.6297600269317627,
... | |
t.Abort();
foreach(RequestThread rs in threadState)
rs.Close();
return requestCounter.Counter;
}
public static void StartRequest(object rt)
{
RequestThread state = (RequestThread) rt; | [
-0.024111103266477585,
-0.26145169138908386,
0.436760812997818,
-0.4479343295097351,
0.07487054169178009,
0.1363402158021927,
0.6183677315711975,
-0.45102453231811523,
-0.14050371944904327,
-0.5145422220230103,
-0.5711416602134705,
0.4783284068107605,
-0.4766095280647278,
0.647920787334442... | |
try
{
state.Request = (HttpWebRequest)WebRequest.Create(state.Url);
state.Request.ReadWriteTimeout = 4000; //Waits 4 seconds
state.Response = (HttpWebResponse)state.Request.GetResponse();
if (state.Response.StatusDescription.Equals("OK", Strin... | [
0.000075062460382469,
-0.30998629331588745,
0.5364835262298584,
0.009752720594406128,
0.4146425724029541,
0.23522037267684937,
0.9592624306678772,
-0.6166985630989075,
-0.28606468439102173,
-0.5665977597236633,
-0.23940882086753845,
0.4124871492385864,
-0.04516202583909035,
0.2434717714786... | |
state.RequestCounter.Increment();
//Do not close, or you will free a connection. Close Later
//response.Close();
}
catch (WebException e)
{ | [
0.006187509745359421,
-0.45357874035835266,
0.5084060430526733,
0.0030636428855359554,
0.2790871262550354,
0.032172802835702896,
0.4910655617713928,
-0.1563434600830078,
-0.2918988764286041,
-0.5133405327796936,
-0.3419438898563385,
0.19283437728881836,
-0.41620129346847534,
0.513675391674... | |
//Console.WriteLine("Message:{0}", e.Message);
state.Close();
}
catch (ThreadAbortException e)
{
//Console.WriteLine("Thread Aborted");
state.Close(); | [
-0.13219012320041656,
-0.24074769020080566,
0.3835979104042053,
-0.4429002106189728,
0.40474310517311096,
0.1798526495695114,
0.3864622712135315,
-0.03207961469888687,
0.12706170976161957,
-0.30513995885849,
-0.2953362762928009,
0.2795187830924988,
-0.4169315993785858,
0.47690603137016296,... | |
}
catch(Exception e)
{
//Console.WriteLine("Real Exception");
state.Close();
}
finally | [
0.08467433601617813,
-0.21141153573989868,
0.25964152812957764,
-0.11012980341911316,
0.3979550004005432,
-0.11958574503660202,
0.31450679898262024,
-0.19051605463027954,
-0.005090473685413599,
-0.3154715597629547,
-0.2446705400943756,
0.5407881736755371,
-0.20464204251766205,
0.0985104441... | |
{
state.AsyncWaitHandle.Set();
}
}
}
}
``` | [
0.32509762048721313,
0.12352519482374191,
0.08329673111438751,
-0.15533989667892456,
0.267178475856781,
-0.2910395562648773,
0.5173100233078003,
-0.08534268289804459,
-0.11162811517715454,
-0.40336185693740845,
-0.2853703796863556,
0.5963995456695557,
-0.42515823245048523,
0.54673779010772... | |
I have this webservice which is sucking in data about exchange rates, my problem with it is it takes alot of time to load. So i want to get the data loaded async but when i call the GetRatesASync() method it says
> "Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has t... | [
0.14874465763568878,
0.04365941882133484,
0.5575700402259827,
0.03354858607053757,
-0.15292996168136597,
-0.2703224718570709,
0.3875754773616791,
-0.16127747297286987,
-0.15512290596961975,
-0.5626965761184692,
0.03320338577032089,
0.6885327696800232,
-0.2569495737552643,
0.425856739282608... | |
the GetRatesASync() method in protected override void OnPreRender(EventArgs e).
So how do I got about getting this bloody data ASync with jquery after the page is loaded.
And is there a way to make this getting data thing faster
Using jquery, how about: 1) wait for the page to load in the browser; 2) call a javascript... | [
0.40215757489204407,
-0.3304682672023773,
0.5901660919189453,
0.1495264619588852,
-0.14131854474544525,
-0.13628226518630981,
0.3108101189136505,
-0.017119290307164192,
-0.1914387196302414,
-0.6924843788146973,
-0.18466487526893616,
0.7534900307655334,
-0.21092744171619415,
-0.010860630311... | |
$.get("/Currency/GetExchangeRates",
null, GetExchangeRatesCompleted, "json");
}
function GetExchangeRatesCompleted(result)
{
// TODO: Hide *loading* animation.
// TODO: Display result on page.
}
```
Controller action (C#):
```
public class CurrencyController : Controller
{
public JsonResult GetEx... | [
0.07148069143295288,
-0.4362889528274536,
0.7955632209777832,
0.1244974359869957,
0.15068846940994263,
0.1692315638065338,
0.006938544567674398,
-0.0494987815618515,
-0.5383503437042236,
-0.6007093787193298,
-0.1345367133617401,
0.5399503707885742,
-0.32909348607063293,
0.0998566597700119,... | |
from the slow webservice, and then refreshing that xml file when it's older than some specified time interval? | [
0.4021364152431488,
-0.15791310369968414,
0.34718406200408936,
0.1781885027885437,
0.32018983364105225,
-0.25705769658088684,
-0.22985084354877472,
-0.00965448934584856,
-0.2647744119167328,
-0.39263081550598145,
0.08296918123960495,
0.2132912576198578,
0.12274976819753647,
-0.069284856319... | |
**Is there any available C++ (or maybe C) function/class/library with only purpose to sanitize a string that might contain HTML?**
I find a lot of source code for sanitizing in C# or other languages more used in web application but nothing in C++.
I'll try to implement my own function if I don't find any available b... | [
0.24680589139461517,
0.18577629327774048,
0.13465553522109985,
-0.04245876148343086,
-0.409677654504776,
0.10337411612272263,
0.3916075825691223,
-0.157434344291687,
-0.16835497319698334,
-0.7902809381484985,
0.09996911138296127,
0.4236671030521393,
-0.3260246515274048,
0.04458195716142654... | |
That javascript run in a loaded html page that is automatically rendered (via Chromium) in a texture that I display via a library (Navi).
So, the javascript function I use will simply take the given text, put P tag around the text and inject it in a div like this :
```
text_display.innerHTML += text_to_add;
```
I n... | [
0.3808442950248718,
0.26123249530792236,
0.4201698303222656,
-0.3679267466068268,
-0.17869895696640015,
-0.03594079986214638,
-0.10238413512706757,
-0.22319258749485016,
-0.164627343416214,
-0.6838396787643433,
-0.03605904057621956,
0.2396998554468155,
-0.3845619559288025,
0.09099534898996... | |
I know that NTFS supports encryption but otherwise is closed source. Likewise, I am aware of add-ins such as truecrypt but I am interested in encryption being built-in vs being bolted on.
Keep in mind that encryption is often not done at the filesystem level. It's done at the block level, where sectors are actually rea... | [
0.4050604999065399,
0.04595164954662323,
-0.010318745858967304,
-0.017243048176169395,
-0.03666844591498375,
-0.43113741278648376,
0.007446812000125647,
0.20145142078399658,
-0.38770776987075806,
-0.7097520232200623,
-0.14819426834583282,
0.7526339292526245,
-0.22442634403705597,
0.0304376... | |
I am trying to move to zsh from Bash.
I put my .bashrc directly to my .zshrc, and it caused a lot of errors when I try to use Bash again.
**How can you export your .bashrc to .zshrc?**
While lhunath's answer pushed me in the right direction, zsh does not seem to source `.profile` automatically. Lot's of good info on ... | [
0.04746672138571739,
0.24891415238380432,
0.37281718850135803,
-0.33109721541404724,
0.01639464497566223,
-0.25689518451690674,
0.17347361147403717,
-0.2206369936466217,
0.16216346621513367,
-0.7772598266601562,
-0.1231594979763031,
0.733749270439148,
-0.31654858589172363,
0.31991493701934... | |
command. With single argument set up zsh options to emulate the specified shell as much as possible. | [
-0.20317023992538452,
-0.10176880657672882,
0.0398971289396286,
-0.017220569774508476,
-0.14827069640159607,
0.07320348918437958,
0.03272279351949692,
-0.036275580525398254,
0.10229891538619995,
-0.5079306960105896,
-0.4618196487426758,
0.7309392094612122,
-0.16529954969882965,
0.036633282... | |
Why is :memory: in sqlite so slow?
----------------------------------
I've been trying to see if there are any performance improvements gained by using in-memory sqlite vs. disk based sqlite. Basically I'd like to trade startup time and memory to get extremely rapid queries which do *not* hit disk during the course of... | [
0.13500386476516724,
0.06763149797916412,
0.17507410049438477,
0.10305704921483994,
-0.14143489301204681,
-0.01998130977153778,
0.01844935119152069,
-0.10917223989963531,
-0.31023749709129333,
-0.6924474835395813,
0.21370349824428558,
0.4556570053100586,
-0.2801305651664734,
0.114253051578... | |
approx 300k. I expected the memory based version to be considerably faster, but as mentioned I'm only getting 1.5X speedups.
I experimented with several other sizes of dbs and query sets; the advantage of :memory: *does* seem to go up as the number of rows in the db increases. I'm not sure why the advantage is so sma... | [
-0.0322805754840374,
-0.07634788006544113,
0.3335050940513611,
0.17288608849048615,
-0.2544158399105072,
0.23674216866493225,
0.2742578983306885,
-0.30736270546913147,
-0.30962473154067993,
-0.7106121182441711,
0.07372353971004486,
0.5155022740364075,
-0.027823153883218765,
0.0931391194462... | |
OS level such that the previous results are accessible somehow, corrupting the benchmark
* there is some kind of hidden disk access going on that I'm not seeing (I haven't tried lsof yet, but I did turn off the PRAGMAs for journaling)
Am I doing something wrong here? Any thoughts on why :memory: isn't producing nearly... | [
-0.26545506715774536,
0.10867001861333847,
0.3165617883205414,
-0.06209056079387665,
-0.0373925045132637,
-0.14884509146213531,
0.24651382863521576,
0.008155378513038158,
-0.5457256436347961,
-0.6659309267997742,
-0.22690477967262268,
0.8555466532707214,
-0.19487057626247406,
-0.0098916683... | |
c.execute('PRAGMA temp_store=MEMORY;')
c.execute('PRAGMA journal_mode=MEMORY;')
# Make a demo table
c.execute('create table if not exists demo (id1 int, id2 int, val real);')
c.execute('create index id1_index on demo (id1);')
c.execute('create index id2_index on demo (id2);')
for row in mat:
... | [
-0.16372135281562805,
-0.19194120168685913,
0.36362728476524353,
0.01152871549129486,
0.0729711502790451,
0.25346288084983826,
0.18698231875896454,
-0.5822116732597351,
-0.32012423872947693,
-0.7232127785682678,
-0.36487671732902527,
0.8103870153427124,
-0.2215237319469452,
-0.054298121482... | |
Build some fake data with 3 columns: int, int, float
nn = 1000000 #numrows
cmax = 700 #num uniques in 1st col
gmax = 5000 #num uniques in 2nd col
mat = np.zeros((nn,3),dtype='object')
mat[:,0] = np.random.randint(0,cmax,nn)
mat[:,1] = np.random.randint(0,gmax,nn)
mat[:,2] = np.random.uniform(0,1,nn)
#2) Load i... | [
0.14695900678634644,
0.17208458483219147,
0.3766777813434601,
0.19057974219322205,
-0.0827397033572197,
0.25961393117904663,
0.554751992225647,
-0.34601661562919617,
0.1137690544128418,
-0.5933927297592163,
0.1372242569923401,
0.5152347087860107,
-0.1219526156783104,
-0.06651461869478226,
... | |
np.sort(np.random.permutation(np.arange(cmax))[0:qsize]) #ensure uniqueness of ids queried
id2a = np.sort(np.random.permutation(np.arange(gmax))[0:qsize])
id1s = ','.join([str(xx) for xx in id1a])
id2s = ','.join([str(xx) for xx in id2a])
query = 'select * from demo where id1 in (%s) AND id2 in (%s);' %... | [
-0.37026628851890564,
-0.01618470624089241,
0.08921176195144653,
0.22480233013629913,
-0.08663292229175568,
0.30622607469558716,
0.15504126250743866,
-0.6177442669868469,
-0.43501773476600647,
-0.8345237970352173,
-0.3053307831287384,
0.7462016344070435,
-0.014305063523352146,
-0.005070445... | |
disk takes about 1.5X as long as memory for a fairly wide range of query sizes.
```
[ramanujan:~]$python -OO sqlite_memory_vs_disk_clean.py
disk | memory | qsize
-----------------------
9.0332 | 6.8100 | 12630
9.0905 | 6.6953 | 5894
9.0078 | 6.8384 | 17798
9.1179 | 6.7673 | 60850
9.0629 | 6.8355 | 94854
8.9688 | 6.... | [
-0.48290684819221497,
0.2956971824169159,
0.3354420065879822,
0.2145911306142807,
-0.015805421397089958,
0.3169068396091461,
0.20719073712825775,
-0.06374701112508774,
-0.621807873249054,
-0.3992561995983124,
-0.009368089027702808,
0.8304223418235779,
-0.00151156191714108,
0.09309463948011... | |
there is a way to make disk access *relatively slower.* \*\*
In other words, the benchmark is adequately measuring the realistic performance of memory, but not the realistic performance of disk (e.g. because the cache\_size pragma is too big or because I'm not doing writes). I'll mess around with those parameters and... | [
0.1909877210855484,
0.32277917861938477,
0.06755419820547104,
0.15838462114334106,
-0.051297545433044434,
-0.06089181825518608,
0.3117755949497223,
-0.10573035478591919,
-0.15993425250053406,
-0.7274450659751892,
0.06261275708675385,
0.8942664861679077,
0.159338116645813,
0.170985355973243... | |
fact that SQLite has a page cache. According to the [Documentation](http://www.sqlite.org/compile.html), the default page cache is 2000 1K pages or about 2Mb. Since this is about 75% to 90% of your data, it isn't surprising that the two number are very similar. My guess is that in addition to the SQLite page cache, the... | [
0.2592957317829132,
0.22201788425445557,
0.30693960189819336,
0.20388101041316986,
0.11457926034927368,
0.07788228988647461,
0.19821500778198242,
0.15044210851192474,
-0.48653391003608704,
-0.5607442259788513,
0.3103349506855011,
0.340128093957901,
-0.06450974941253662,
0.05333202704787254... | |
I was browsing for an open source kernel when I ran across [SANOS](http://www.jbox.dk/sanos/index.htm) which feels like something worth keeping alive as open source. To bring it up to modern standards, the following enhancements need to occur:
* Support for Multiple CPUs/Cores
* Add IPv6 (currently only supports IPv4)... | [
0.4028387665748596,
0.1502470225095749,
-0.005071875639259815,
0.08357936888933182,
-0.3444780707359314,
-0.06264663487672806,
0.32760360836982727,
0.19861820340156555,
-0.2065223604440689,
-0.8845990300178528,
0.18092189729213715,
0.20545680820941925,
-0.1817643791437149,
0.22730903327465... | |
is it better than either the kernel used in BSD and/or Linux?
4. Is there merit in porting Ruby to this platform?
I'll keep it short and simple. I don't want to rain on your parade but, commercially, I think maintaining SANOS is a waste of time.
The landscape is littered with the corpses of FOSS projects that were a g... | [
0.7166343927383423,
0.21383440494537354,
-0.24679937958717346,
0.11245080083608627,
-0.3731866180896759,
-0.03767712041735649,
0.3011513352394104,
0.20575229823589325,
0.08848012238740921,
-0.4918764531612396,
-0.03062381036579609,
0.5430403351783752,
-0.12835095822811127,
-0.0915019959211... | |
clear. Linux is so far ahead in terms of development effort that those other projects would take decades of effort just to catch up. I'm not talking about technical merit here (although that may be the case as well) but penetration into the mindsets of business. And business is, unfortunately, where the money comes fro... | [
0.5995882153511047,
0.2954120934009552,
0.10891622304916382,
0.17343564331531525,
0.13301332294940948,
-0.2533770203590393,
-0.06242413818836212,
0.522266685962677,
-0.3647293448448181,
-0.32330790162086487,
0.16715171933174133,
0.746014416217804,
-0.07570701092481613,
0.06217046454548836,... | |
will be happy to tell you, frequently and without much prompting, that I've been wrong before -:)
*1. Does anyone here have experiences they would like to share using SANOS?*
No, I'd never actually heard of it until this question popped up on SO (which should go a little towards justifying my statements that it ... | [
0.7866035103797913,
0.18603990972042084,
0.11132997274398804,
0.14368416368961334,
-0.018252482637763023,
-0.23185713589191437,
0.1996280699968338,
0.48454609513282776,
-0.08613242208957672,
-0.8184685707092285,
-0.025042403489351273,
0.2145146280527115,
0.4289056062698364,
-0.158811390399... | |
it around some more, you need to get the size of that cadre up.
*3. In what ways is it better than either the kernel used in BSD and/or Linux?*
No idea. I have zero interest in this project since I'm more concerned with running a business and spending time with the family than donating my time for free to a proj... | [
0.5894800424575806,
-0.04272257909178734,
0.0822841078042984,
0.10722210258245468,
-0.37426871061325073,
-0.006723381578922272,
0.32485124468803406,
0.1784750521183014,
-0.17544253170490265,
-0.5737659931182861,
0.04558989033102989,
0.5084121823310852,
0.07363879680633545,
0.14825028181076... | |
as an exercise in porting, probably not. The Ruby crowd are not going to swarm across to SANOS just because you make it available. They have to earn a living as well. | [
1.1333129405975342,
0.07770512253046036,
-0.2906162738800049,
0.2763421833515167,
-0.06473026424646378,
0.3640449643135071,
0.3774454891681671,
0.540367841720581,
-0.3631706237792969,
-0.18812189996242523,
0.11811040341854095,
0.2250133752822876,
-0.004986529238522053,
0.21948741376399994,... | |
I'm working on setting this up on Mac OS X Leopard.
I'm having a devil of a time getting PHP5 working as fastcgi under lighttpd. I've verified that I've compiled php with fastcgi enabled. I've tried configuring lighttpd as I've seen in various documentation.
The core bit that I'm not understanding is if php-cgi is s... | [
0.18997716903686523,
-0.0317826010286808,
0.4109016954898834,
-0.3196568191051483,
-0.2375480979681015,
-0.1337645798921585,
0.25366052985191345,
0.19235338270664215,
-0.41573935747146606,
-0.6566213965415955,
-0.01350675243884325,
0.5645090937614441,
-0.5181412100791931,
-0.01447781361639... | |
"socket" => "/var/run/php-fastcgi.socket",
"bin-path" => "/usr/local/php/bin/php-cgi"
)
)
)
```
When I check /var/run/ no php-fastcgi.socket has been created.
I was tearing my hair out with the same problem.
Ive setup lighty and php so many times | [
0.6018221974372864,
0.09675572067499161,
0.3737545907497406,
-0.1277298480272293,
-0.1273946315050125,
0.08062095940113068,
0.311865895986557,
-0.14832353591918945,
-0.1813013106584549,
-0.4834069311618805,
0.03710681572556496,
0.5067238807678223,
-0.11286430060863495,
0.23349273204803467,... | |
on linux, but I struggled to get the php fastcgi-socket working under OSX.
In the end I started the fast cgi server manually, using
php-cgi -b 127.0.0.1:5555
Then specified a tcp port in lighty config...
fastcgi.server = ( ".php" =>( "localhost" =>("host" => "127.0.0.1","port" => 5555 )))
Probably not ideal, but it... | [
-0.12389116734266281,
-0.27436989545822144,
0.45128145813941956,
0.04037678986787796,
-0.11523481458425522,
-0.2730652093887329,
0.16947388648986816,
0.22746329009532928,
-0.24494272470474243,
-0.5742791295051575,
-0.030846888199448586,
0.6079094409942627,
-0.4045025408267975,
0.1491409391... | |
I need to send email in delbian linux. How to send? I run my server on 256 MB linux box and I heard postfix and sendmail is overkill.
Recently I came across the ssmtp, that seems to be an executable, needs to be executed as a process and called through python using os modules.
alternatively, python already provides s... | [
0.3983690142631531,
-0.18830996751785278,
0.29725030064582825,
-0.14875027537345886,
-0.5527912378311157,
-0.4129077196121216,
0.5157315135002136,
0.05460527911782265,
-0.05499313771724701,
-0.9134654402732849,
-0.034937333315610886,
0.44285598397254944,
-0.668848991394043,
0.0196916013956... | |
that accepts the same options, arguments, and inputs as the full-blown sendmail (though most of the options do nothing); but behind the scenes, instead of processing the email itself, it sends the message to an SMTP server. This is for systems that need to have a `sendmail` program present, perhaps because they don't u... | [
-0.07065663486719131,
-0.14189933240413666,
0.29123106598854065,
-0.041503552347421646,
-0.3240211308002472,
-0.26543688774108887,
0.12106688320636749,
0.02901441790163517,
-0.02964663878083229,
-0.38784271478652954,
-0.07557976990938187,
0.21147112548351288,
-0.24570567905902863,
-0.09028... | |
a little while, I'm not sure about the current status)
However, in Python the situation is reversed: you have a builtin library that makes it easy to use SMTP directly, whereas using `sendmail` requires you to invoke the `subprocess` module which is somewhat clunky and also very dependent on things that are not part ... | [
0.1651059240102768,
-0.2062922865152359,
0.09142483025789261,
-0.10032925009727478,
-0.22575584053993225,
-0.5040550231933594,
0.46399039030075073,
0.38334983587265015,
-0.17785204946994781,
-0.5104376673698425,
-0.0837738886475563,
0.3159531354904175,
-0.6063358187675476,
0.14102357625961... | |
If have a field in my database with crlf's how do I preserve
that in HTML??
Is there a standard way of doing this??
Malcolm
EDIT: I am actually doing an MVC app if that hepls.
I think the best way to do that is to replace the `\r\n` sequence with `<br />` tags, using whatever scripting language your database-backed ... | [
0.5960319638252258,
0.22117222845554352,
0.2804664671421051,
-0.14854799211025238,
-0.07940121740102768,
-0.004584819544106722,
0.43871498107910156,
0.04796536639332771,
-0.10826145857572556,
-0.5968716144561768,
-0.2428818643093109,
0.44676482677459717,
-0.15952055156230927,
-0.0722500011... | |
I have been reading up on on steno for a while. I have seen tools that help aid in embedding messages in .mp3's and png's etc. I am familiar that they do this by replacing the least important bit. In images, these LIB are colors that the human eye can't see; thus not needed. In audio files frequencies not audible to th... | [
0.5251243710517883,
0.12587778270244598,
0.06728830933570862,
0.22586943209171295,
-0.18673370778560638,
-0.17833377420902252,
0.1269799768924713,
0.2532868981361389,
-0.1445542573928833,
-0.8568645119667053,
-0.13017307221889496,
0.7368830442428589,
-0.19357694685459137,
0.027741001918911... | |
go changing the LSB of random words in a PNG, nor in an mp3. Once you can read and write back those format, analyze the data, figure out where the LIBs (where importance is the perception of the user, not the least significant bit of the architecture) of the given data are, and embed your information in there. There is... | [
0.4459255039691925,
-0.12455348670482635,
0.050384946167469025,
0.33344539999961853,
0.1378973126411438,
-0.011989480815827847,
-0.02908349595963955,
0.1819341480731964,
-0.22330304980278015,
-0.6166245341300964,
-0.12966856360435486,
0.6877318620681763,
-0.1414099931716919,
-0.02526962757... | |
I have a local server where I do all my testing and work. Once I am done, I simply upload the db schema along with the relevant code. However the problem arises when I make some changes to the schema. I have to manually type the "alter table" query on my live server.
Is there a way to get the incremental changes that... | [
0.38457271456718445,
0.22938565909862518,
0.5998356938362122,
-0.15592630207538605,
-0.1592818796634674,
-0.061953477561473846,
0.5120099186897278,
-0.23171661794185638,
-0.06244785338640213,
-0.7817890644073486,
0.0746055468916893,
0.5720794796943665,
-0.2075871229171753,
0.13526202738285... | |
alter table etc).
Thank you very much.
[MySQL Workbench](http://dev.mysql.com/downloads/gui-tools/5.0.html) lets you export ALTER scripts (File -> Export -> Forward Engineer SQL ALTER Script). You'll have first to import your existing database and apply your modifications to it. The commercial version lets you reverse... | [
0.2953435182571411,
0.1611659973859787,
0.42691200971603394,
-0.03781646490097046,
-0.22229108214378357,
-0.1345682442188263,
0.23397338390350342,
-0.32217201590538025,
-0.0644707977771759,
-0.7427372336387634,
0.1800004243850708,
0.6111199259757996,
-0.5409402251243591,
0.1416252702474594... | |
Is it possible to "alias" all commands to append --color? Or instead have it automatically activated for every program that supports it?
How would the shell know automatically which programs support the --color option? You'd have to give it a list, and as long as you're going to do that you might as well just give it a... | [
0.23489026725292206,
-0.058135826140642166,
0.010556565597653389,
-0.15968504548072815,
0.4497435390949249,
-0.16816993057727814,
0.20171095430850983,
0.11577494442462921,
-0.15262220799922943,
-0.40635979175567627,
-0.10664943605661392,
1.118704080581665,
-0.33819326758384705,
-0.14708267... | |
I have two tables :
```
teachers (teacher_id,teacher_name)
courses (teacher_id,course_id)
```
And I need to display names of the teachers, teaching maximum number of courses :
mysql> select teachers.teacher\_name,tmp1.teacher\_id,tmp1.cnt from (select max(tm
p.cnt) as tmpMax from (select teacher\_id,count(teacher... | [
0.00007571025344077498,
-0.016095129773020744,
0.4803837239742279,
0.14544659852981567,
-0.013733669184148312,
0.5508407950401306,
-0.2647245228290558,
-0.28377577662467957,
-0.38515177369117737,
-0.5993094444274902,
-0.2994592487812042,
0.3687095642089844,
-0.02490360476076603,
0.15594626... | |
group by t.teacher_id
having count(*) =
(
select max(courses_per_teacher) from
(
select teacher_id, count(*) as courses_per_teacher
from teachers t inner join courses c on t.teacher_id = c.teacher_id
group by teacher_id
)
)
)
```
Logic in pseudo... | [
-0.07601385563611984,
-0.03786884993314743,
0.0291847325861454,
-0.03335671126842499,
-0.07614347338676453,
0.09710891544818878,
0.08508944511413574,
-0.6034829020500183,
-0.053324297070503235,
-0.21711060404777527,
-0.37554603815078735,
0.3275802433490753,
-0.2298571616411209,
0.032402984... | |
Find the teacher names whose IDs are in -->
* The group of teachers whose number of courses is -->
* Equal to the maximum number of -->
* The list of numbers of courses per teacher
Hope that helps. | [
0.16736529767513275,
0.17279843986034393,
0.11962362378835678,
0.4170149564743042,
0.1028125211596489,
0.1777224987745285,
0.22682151198387146,
0.19673846662044525,
-0.00927672442048788,
-0.6721317768096924,
-0.1981058418750763,
0.17197513580322266,
0.25810274481773376,
-0.0495725348591804... | |
I create software using PHP. I'm going to sell this software so I need to protect my source code so that nobody can view it. How can I protect my PHP code so that the software still functions the same?
I also need to bind the software to a particular, authorized PC. It should not run on any other PC. How can I do that... | [
0.7416428923606873,
0.5151373147964478,
0.275346040725708,
0.24199873208999634,
0.1156180202960968,
-0.06401215493679047,
0.24967192113399506,
0.1372092068195343,
-0.05071723833680153,
-0.45078954100608826,
0.36555376648902893,
0.26464492082595825,
-0.10872133076190948,
0.21495306491851807... | |
you should find something useful here:
About:
1. [Wikipedia article: PHP Accelerator](http://en.wikipedia.org/wiki/PHP_accelerator)
2. [Comparison of APC, Zend, xCache, & the Zend Framework](http://blog.digitalstruct.com/2007/12/23/php-accelerators-apc-vs-zend-vs-xcache-with-zend-framework)
Software:
1. [Safeyar](h... | [
0.4191880226135254,
0.21829402446746826,
0.45151716470718384,
-0.032614052295684814,
-0.1773199737071991,
-0.15892979502677917,
-0.06677186489105225,
-0.47217997908592224,
-0.2645253539085388,
-0.4839010238647461,
-0.14631082117557526,
0.6262356638908386,
-0.4618434011936188,
-0.0453655570... | |
Design an OO parking lot. What classes and functions will it have. It should say, full, empty and also be able to find spot for Valet parking. The lot has 3 different types of parking: regular, handicapped and compact.
Thanks!
Here is a quick start to get the gears turning...
ParkingLot is a class.
ParkingSpace is a... | [
0.14262494444847107,
0.04002992808818817,
0.44004741311073303,
0.44835007190704346,
0.3451281785964966,
0.26419588923454285,
-0.4274948835372925,
0.25538790225982666,
-0.05011210963129997,
-0.8870514631271362,
-0.33271166682243347,
0.26128673553466797,
0.3216255307197571,
-0.10069917142391... | |
array of vacant ParkingSpaces in order of distance from its Entrance.
ParkingLotSign can be told to display "full", or "empty", or "blank/normal/partially occupied" by calling .Full(), .Empty() or .Normal()
Parker is a class.
Parker can Park().
Parker can Unpark().
Valet is a subclass of Parker that can call Parki... | [
-0.0827317014336586,
-0.2890416979789734,
0.2657114565372467,
0.25102007389068604,
0.28392359614372253,
0.24335242807865143,
-0.033005643635988235,
0.0014557301765307784,
-0.37985286116600037,
-0.4666990637779236,
-0.4140588045120239,
0.3088501989841461,
-0.09837628901004791,
0.29188346862... | |
or ParkingLotSign.Empty() or ParkingLotSign.Normal().
HandicappedParker could be a subclass of Parker and CompactParker a subclass of Parker and RegularParker a subclass of Parker. (might be overkill, actually.)
In this solution, it is possible that Parker should be renamed to be Car. | [
0.07133708894252777,
-0.30895572900772095,
-0.1150820404291153,
0.413399875164032,
0.14313314855098724,
0.09318721294403076,
-0.20993675291538239,
0.3606245815753937,
-0.09440580755472183,
-0.10148660093545914,
-0.14218227565288544,
0.5330676436424255,
-0.06103428825736046,
0.1457882225513... | |
I have particular division in my web page. i want to print that div only when click "print" in my web page. i have some javascript code. But that is not well formatted.
Is there any javascript to print particular division from my web page?
Thanks in advance
* Gnaniyar Zubair
You can specify CSS stylesheets [with th... | [
0.254486083984375,
0.21833840012550354,
0.0731060728430748,
-0.04803815856575966,
-0.26327618956565857,
-0.0780872330069542,
0.2048317790031433,
-0.3577301502227783,
-0.27634862065315247,
-0.61825031042099,
-0.3100942373275757,
0.14300255477428436,
-0.6378936767578125,
0.3024066686630249,
... | |
My hosted scripts have been moved and no longer work.
> The specified CGI application
> misbehaved by not returning a complete
> set of HTTP headers.
I notice that someone at my host company has modified my scripts so that where I used to have
```
use lib 'd:/myorig/LIB';
```
I now have
```
use lib '//newhost/L... | [
0.39551278948783875,
0.31067225337028503,
0.35355380177497864,
0.042364489287137985,
-0.18709750473499298,
-0.00881408154964447,
0.7011251449584961,
0.03151670843362808,
-0.09403109550476074,
-0.731566846370697,
-0.02270602621138096,
0.45510968565940857,
-0.1277429312467575,
0.344873666763... | |
these scripts, unchanged from the previous host mind, are throwing lots of syntax errors. "Since we cannot debug your scripts for you we suggest you contact the original programmer and ask them for help". `<grinds teeth>`
**Partial Resolution:** The hosting company finally realised they hadn't set permissions correctl... | [
0.4328966438770294,
0.3581407070159912,
0.2675175964832306,
0.18533934652805328,
0.12421538680791855,
-0.22995992004871368,
0.6303372979164124,
0.02620011940598488,
-0.22089892625808716,
-0.7608375549316406,
-0.07661071419715881,
0.4766713082790375,
-0.007578779011964798,
0.330539733171463... | |
than one for your application to function. | [
0.11353187263011932,
-0.0576617605984211,
-0.12744729220867157,
0.30117520689964294,
-0.1729966402053833,
-0.1474553793668747,
-0.3047231435775757,
-0.1021849662065506,
-0.1888236105442047,
-0.7050926089286804,
0.18772976100444794,
0.49828529357910156,
-0.14586524665355682,
-0.078607417643... | |
i want to check if the Session contains some key/value data, in my global.asax. I'm not sure when the earliest possible time (and method name) is, to check this.
thanks :)
I always believed `Application_AcquireRequestState` was the first event in Global.asax that could access the current session. It's definitely not `... | [
-0.30901190638542175,
-0.08406813442707062,
0.5575659275054932,
0.06171352043747902,
0.25519508123397827,
-0.4946889877319336,
0.27694353461265564,
0.29152125120162964,
-0.1564008891582489,
-0.6945464015007019,
0.055387336760759354,
0.41268011927604675,
0.0018277858616784215,
0.21330086886... | |
Is there a way to generate the DBML file from entity classes instead from database tables? This would be very useful for prototyping, where one just creates a logical model and lets the auto-generated tool create the DBML file. With DBML file, one can use SqlMetal to generate Linq to SQL classes and be done with it. So... | [
0.28450894355773926,
-0.03563161939382553,
0.24842645227909088,
0.21613135933876038,
0.08935128152370453,
0.054614096879959106,
0.04166297987103462,
-0.41408708691596985,
-0.06581389904022217,
-0.4698924720287323,
-0.032032135874032974,
0.5329998731613159,
-0.21972142159938812,
0.177241027... | |
the [SqlMetal tool](http://msdn.microsoft.com/en-us/library/bb386987.aspx) or [Damiens t4 scripts](http://damieng.com/blog/2009/01/19/linq-to-sql-templates-updated-now-on-codeplex) to create Linq to SQL classes
5.Code against auto-generated data-context and auto-generated database (using DataContext.CreateDatabase() t... | [
0.05179091915488243,
0.17996379733085632,
0.5354166626930237,
0.04796607047319412,
-0.4076728820800781,
-0.15880469977855682,
0.15782290697097778,
-0.28190702199935913,
-0.046402011066675186,
-0.3796333968639374,
0.10063902288675308,
0.32425597310066223,
-0.12810753285884857,
0.12276327610... | |
Most programmers will have had the experience of debugging/fixing someone else's code. Sometimes that "someone else's code" is so obfuscated it's bad enough trying to understand what it's doing.
What's the worst (most obfuscated) code you've had to debug/fix?
If you didn't throw it away and recode it from scratch, w... | [
0.08630327880382538,
0.02619556151330471,
-0.2697755694389343,
0.00846141017973423,
0.03059161640703678,
0.030842427164316177,
0.3340858221054077,
-0.23463618755340576,
-0.20938648283481598,
-0.2978532612323761,
-0.24642491340637207,
0.6351733207702637,
-0.4407375156879425,
-0.056215170770... | |
if (...) {
while (...) {
if (...) {
```
* cut-and-paste oriented programming
* no exceptions, all exceptions are catched and "handled" using printStackTrace()
* no unit tests
* no documentation
I was tempted to throw away and recode... but, after 3 days of hard debugging,
I've added **the magic if... | [
0.07670164108276367,
0.08969438076019287,
0.24833902716636658,
-0.057754479348659515,
0.3819681406021118,
-0.053827255964279175,
0.3497731387615204,
-0.30591586232185364,
-0.05444292351603508,
-0.39924314618110657,
-0.1187843307852745,
0.5175315737724304,
-0.16699062287807465,
-0.027981203... | |
As an extension to this question [Are `const_iterators` faster?](https://stackoverflow.com/questions/755347/are-constiterators-faster), I have another question on `const_iterators`. How to remove constness of a `const_iterator`?
Though iterators are generalised form of pointers but still `const_iterator` and `iterator... | [
-0.4004332423210144,
-0.027963915839791298,
0.2691606283187866,
0.09387464821338654,
0.03093021735548973,
0.11747384816408157,
-0.12930665910243988,
-0.376034677028656,
-0.357257217168808,
-0.5076087713241577,
0.0741361677646637,
0.6375982165336609,
-0.4051009714603424,
-0.1442534327507019... | |
associative, or unordered associative container (including all of the Standard Library containers), you can call the range-erase member function with an empty range:
```
template <typename Container, typename ConstIterator>
typename Container::iterator remove_constness(Container& c, ConstIterator it)
{
return c.er... | [
0.14063741266727448,
0.20461539924144745,
0.26779797673225403,
-0.17471879720687866,
0.1049388125538826,
0.15805703401565552,
0.17045465111732483,
-0.298531174659729,
-0.009463007561862469,
-0.3087863028049469,
-0.2922971248626709,
0.7498557567596436,
-0.3931507468223572,
0.221060588955879... | |
I want to retrieve these info for a mysql table using c#
1) Complete column definitions including name, size and data type, and extra info like null/not null, unsigned,auto increament, default values, if data type is enum, the accepted values
2) All constraints - Primary/Foreign/Check/Unique
3) All indexes
I can g... | [
-0.017379745841026306,
0.2814922332763672,
0.33753523230552673,
0.3498786389827728,
0.010362593457102776,
0.038010161370038986,
0.10848938673734665,
-0.1845530867576599,
0.02807925082743168,
-0.5420159697532654,
-0.05478111281991005,
0.5556583404541016,
-0.2949376404285431,
0.1610973626375... | |
CHARACTER_MAXIMUM_LENGTH
, CHARACTER_OCTET_LENGTH
, NUMERIC_PRECISION
, NUMERIC_SCALE AS SCALE
, COLUMN_DEFAULT
, IS_NULLABLE
FROM INFORMATION_SCHEMA.COLUMNS
```
Take a look at [the information schema tables](http://dev.mysql.com/doc/refman/5.0/en/information-schema.html) to get ... | [
-0.1255009025335312,
0.10168489068746567,
0.4519519805908203,
0.1856006681919098,
0.02285420149564743,
0.027626490220427513,
-0.06486911326646805,
0.03209850192070007,
-0.2979915142059326,
-0.8633085489273071,
-0.08045438677072525,
0.561820387840271,
0.15348467230796814,
0.1063263788819313... | |
I have a question about dependencies in CCNET. I have several projects, each of them are dependant on another project (a control library as it is referred to internally). When the control library project is changed, and triggers a recompile, how do I get the other dependent projects to be rebuilt?
By using [project tri... | [
0.6146818995475769,
-0.27640753984451294,
0.009823722764849663,
0.020819315686821938,
0.20021505653858185,
-0.12548832595348358,
-0.06237814575433731,
-0.2419106513261795,
-0.33927851915359497,
-0.6027100086212158,
0.2478768229484558,
0.5003252029418945,
-0.17830482125282288,
0.26229080557... | |
I'm working on a image viewer that has a draggable scrollbar. When the user drags the scrollbar, some of the text on the webpage becomes selected. I've tried
```
window.getSelection().removeAllRanges();
```
but that doesn't seem to work in IE7/8. Also tried the
```
document.getSelection().removeAllRanges();
```
w... | [
0.11865046620368958,
-0.1532781422138214,
0.5707699060440063,
-0.1898139864206314,
0.03160315752029419,
-0.15149036049842834,
0.23375780880451202,
-0.22672270238399506,
-0.07762730866670609,
-0.8035887479782104,
-0.06256401538848877,
0.767704427242279,
-0.3157120943069458,
0.08911436051130... | |
window.getSelection().removeAllRanges();
more code...
}
}
```
Try returning false on the functions you use, especially for the "mousedown" event. Also returning false on document.onselectstart and document.ondragstart would help. | [
-0.10733166337013245,
-0.1371074914932251,
0.33023983240127563,
-0.12613070011138916,
0.1017182245850563,
-0.3322697579860687,
0.5415579080581665,
-0.09530100226402283,
-0.12159175425767899,
-0.8147708177566528,
-0.32664626836776733,
0.762108564376831,
-0.2737031579017639,
0.12184884399175... | |
In other words does this work as expected?
```
int32 i = INT_MAX-1;
int64 j = i * i;
```
or do I need to cast the i to 64 bit first?
You need to cast at least one of the operands to the multiply. At the point the multiply is being done, the system doesn't know you're planning to assign to an int64.
(Unless int64 is... | [
0.014680019579827785,
0.20328080654144287,
0.03824552893638611,
-0.26550665497779846,
0.14453323185443878,
-0.030253896489739418,
0.296144038438797,
-0.3956453800201416,
-0.06437535583972931,
-0.4840599298477173,
-0.08409951627254486,
0.5327333211898804,
-0.23343129456043243,
-0.0076450398... | |
I am trying to obtain the url from the innerHTML of a web page using javascript.
This is what I'm doing:
```
var goog = newTabBrowser.contentDocument.getElementsByTagName("pre")[0].innerHTML;
alert(goog.responseData.results[0].url);
```
BUT it wont work :S
I outputted goog (using alert) and copied that into my ... | [
0.013845566660165787,
0.2669362723827362,
0.6303008198738098,
-0.04368484020233154,
0.026307765394449234,
0.24993102252483368,
0.37191253900527954,
-0.20259389281272888,
-0.041511498391628265,
-0.7311300039291382,
-0.4729028344154358,
0.6614651679992676,
-0.28195664286613464,
-0.0895510837... | |
- \u003cb\u003eStack Overflow\u003c/b\u003e","titleNoFormatting":"Blog - Stack Overflow","content":"Apr 12, 2009 \u003cb\u003e...\u003c/b\u003e Apparently some users who really should know better are confused about the way \u003cb\u003eStack Overflow\u003c/b\u003e works. I take this as a sweeping indictment of \u003cb... | [
-0.3980875611305237,
0.47999244928359985,
0.570457935333252,
0.14861631393432617,
0.2689753472805023,
-0.15161268413066864,
0.5331595540046692,
-0.05289261043071747,
-0.3263661861419678,
-0.3700774312019348,
-0.17325842380523682,
0.7390596866607666,
-0.1827583760023117,
0.1666552871465683,... | |
library (depending on how secure the JSON data is) to convert it from a string into a JavaScript object.
For example, (using the [json2.js](http://www.json.org/js.html) JSON library):
```
var googString = newTabBrowser.contentDocument.getElementsByTagName("pre")[0].innerHTML;
var goog = JSON.parse(googString);
// Th... | [
-0.008943785913288593,
-0.33423104882240295,
0.34678390622138977,
-0.032816555351018906,
-0.12639252841472626,
0.00346183474175632,
0.25136101245880127,
-0.17599327862262726,
-0.308401495218277,
-0.584226667881012,
-0.4354717433452606,
0.4894288182258606,
-0.3970275819301605,
-0.0950003117... | |
I'm building a website that fetches text from another page and insert it into the database.
The problem is that all the special characters are saved in the database using the HTML encoding so then I need to convert the output using:
`<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />`
I mean,... | [
0.01952895149588585,
0.2928225100040436,
0.45158347487449646,
-0.13859349489212036,
-0.28381896018981934,
0.13777519762516022,
0.3629925549030304,
-0.17406359314918518,
0.03063511848449707,
-0.7255248427391052,
0.012394066900014877,
0.4739392101764679,
-0.20086048543453217,
0.0711472555994... | |
space in the database and also I need to later convert the output using content-type so:
How can I just convert or set the charset before is saved or just let MySQL convert it??
In case you need to know here's how I connect to the database:
```
function dbConnect() {
$conn = new mysqli(DB_SERVER, DB_USER, ... | [
0.2953559458255768,
0.1201571524143219,
0.34237241744995117,
-0.04539444297552109,
-0.0343167781829834,
0.251547247171402,
0.3782455623149872,
-0.3820894658565521,
-0.03927814960479736,
-0.807624101638794,
-0.10585281252861023,
0.4909955859184265,
-0.2773047089576721,
-0.04894415661692619,... | |
html_entity_decode("ñ", ENT_COMPAT, "UTF-8"); ?>
ñ
```
Please note that "HTML" isn't a character encoding in the usual sense, so isn't understood by libraries such as `iconv`, nor by MySQL itself.
I'd also recommend (per example above) having the whole application use UTF-8. Single character encodings such as... | [
-0.08814088255167007,
0.1363673210144043,
0.6441622972488403,
-0.1404656022787094,
-0.24870739877223969,
-0.2737797200679779,
0.25452402234077454,
0.06432011723518372,
-0.20549046993255615,
-0.789417028427124,
-0.4562222957611084,
0.2631695866584778,
-0.4634954631328583,
0.0610167682170867... | |
Someone here recently [brought up](https://stackoverflow.com/questions/755347/are-constiterators-faster/755371#755371) the article from Scott Meyers that says:
* Prefer `iterators` over `const_iterators` ([pdf link](http://www.aristeia.com/Papers/CUJ%5FJune%5F2001.pdf)).
Someone else was commenting that the article ... | [
0.24440261721611023,
0.15851260721683502,
-0.2358340322971344,
-0.0286607313901186,
-0.06636551767587662,
-0.22611582279205322,
0.12025540322065353,
-0.25915762782096863,
-0.062149062752723694,
-0.16530264914035797,
0.029164934530854225,
0.6926233768463135,
0.016599979251623154,
0.11766644... | |
am I missing something?
I totally agree with you.
I think the answer is simple:
Use const\_iterators where const values are the right thing to use, and vice versa.
Seems to me that those who are against const\_iterators must be against const in general... | [
0.06732391566038132,
0.3441748023033142,
0.0006310631870292127,
0.03719571977853775,
0.08287116885185242,
-0.1937319040298462,
0.051473069936037064,
0.03523437678813934,
0.026186013594269753,
0.053454991430044174,
0.09368979185819626,
0.5855138301849365,
-0.3976823389530182,
0.068209372460... | |
Firebug is an excellent tool to to show a screen media CSS for some HTML element, but is there a way to look at the print media CSS too? Or is there any other tool to see the print media CSS?
I would have never expected this to work, but it does. Install -both- the 1.5 beta of Firebug and Web Developer. When you choose... | [
0.459086149930954,
0.039330627769231796,
0.21638813614845276,
-0.039901066571474075,
-0.30702829360961914,
-0.38951829075813293,
-0.018197832629084587,
-0.059699222445487976,
0.164638951420784,
-0.7775188088417053,
-0.12667138874530792,
0.8033624291419983,
-0.2452511191368103,
-0.341161131... | |
I have a window with these values:
```
WindowState="Maximized"
AllowsTransparency="True"
Opacity="0.5"
WindowStyle="None"
```
This window is coming on top of other window (as a pop-up) with content on it on a specific location.
I have a new requirement. This window have to show a rectangle area from the window belo... | [
0.2613866329193115,
0.14442695677280426,
0.5716826915740967,
0.07087334245443344,
-0.11477222293615341,
-0.1223330870270729,
0.4902627170085907,
-0.08150959759950638,
-0.04307010769844055,
-0.8219918608665466,
0.001217908225953579,
0.5053642392158508,
-0.2178197205066681,
0.301978856325149... | |
Use CreateRectRgn twice, once for the window bounding rectangle and once for the hole.
2. Use CombineRgn with RGN\_AND as the 4th parameter to get a region with an hole in it
3. Call SetWindowRgn to apply the region to the window
4. Don't forget to delete all the regions except for the one you passed to SetWindowRgn | [
0.007707343436777592,
-0.33762213587760925,
0.601836085319519,
-0.2823732793331146,
0.05995621532201767,
-0.15725892782211304,
0.27246934175491333,
-0.17977969348430634,
-0.15867473185062408,
-0.8970975875854492,
-0.2217887043952942,
0.3552253544330597,
-0.4550897181034088,
0.2068712264299... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.