text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
for me?
---
The only cases where I can think of where this might cause problems are:
* threading
* exceptions
For threading that transformation affects when the writes happen (after the function call vs. in the function call), but I rather suspect any code that counts on that would get little sympathy when it break... | [
0.1871640980243683,
0.2328832745552063,
-0.01796039007604122,
-0.07826853543519974,
-0.24233506619930267,
-0.047096118330955505,
0.3833480775356293,
-0.06705990433692932,
-0.4903339147567749,
-0.48646536469459534,
0.17213809490203857,
0.5318706035614014,
-0.22639092803001404,
0.25612479448... | |
be supported use of the language.
---
Note: I understand the mechanics of why this error messages is generated. What I'm looking for is the rationale for why C# doesn't automatically implement the trivial workaround.
Just for info, C# 4.0 *will* have something *like* this sugar, but only when calling interop methods ... | [
0.33561116456985474,
0.19090858101844788,
-0.0074299476109445095,
0.14285512268543243,
-0.08730985969305038,
-0.41474711894989014,
0.31236356496810913,
0.29333168268203735,
-0.16003966331481934,
-0.31772875785827637,
0.009692711755633354,
0.6676750183105469,
-0.3449118137359619,
-0.1377897... | |
Are there any microscopic reasons at all (beyond superstition), to add an extra return after `</html>` in (X)HTML documents?
Is there any significant reason at all, not to stop this habit of mine? (To me, it looks a lot cleaner with the last line number being the same as the last bit of code, but I'm curious to know i... | [
0.6303858160972595,
0.19856791198253632,
0.24151138961315155,
0.09420689195394516,
-0.3641686737537384,
-0.09277905523777008,
0.6631062626838684,
0.4720863103866577,
-0.34923887252807617,
-0.3914380371570587,
-0.07602572441101074,
0.20887285470962524,
-0.3109554648399353,
0.130017742514610... | |
would throw an error if you didn't have an extra line break there, but I think that hasn't mattered for quite some time. | [
0.31280744075775146,
0.2028173953294754,
-0.09774654358625412,
-0.02912481687963009,
0.24233384430408478,
-0.0334874764084816,
0.41272392868995667,
0.46723672747612,
-0.15658994019031525,
-0.2553332448005676,
0.338372141122818,
0.2226477563381195,
0.2556036114692688,
-0.15751084685325623,
... | |
I want to separate a specific set of stored procedures into a seperate database … sort of like a library. However, when I run these procs from another database, they appear to call objects from within the library database.
Here is some source code which demonstrates the problem
```
use mylibdb
go
create proc gettabl... | [
0.07876943051815033,
-0.12305495142936707,
0.2540474534034729,
-0.19510161876678467,
0.10531885921955109,
0.04996511712670326,
0.24951481819152832,
-0.3590802550315857,
-0.24918006360530853,
-0.4600221514701843,
-0.020069222897291183,
0.5206961631774902,
-0.6072613596916199,
-0.07782681286... | |
sysobjects
where xtype='U';
```
Running that code will print out
> Table count : 0
>
>
> table count
>
>
>
>
> ---
>
>
> 71
>
>
> (1 row(s) affected)
Notice the proc queries the mylibdb.dbo.sysobjects table, not adventureworks.dbo.sysobjects.
Does anybody know how I can do this without dynamic sql?
I'... | [
-0.16706542670726776,
0.14551310241222382,
0.32228440046310425,
-0.38088497519493103,
-0.04315708950161934,
-0.11870254576206207,
0.31718289852142334,
0.045885633677244186,
-0.30118241906166077,
-0.6136854887008667,
-0.173307865858078,
0.5214242935180664,
-0.6997591853141785,
-0.2506510019... | |
sysobjects
where xtype='U';
print 'Table count : ' + cast( @cnt as nvarchar);
end
```
PS-This is just a 'For The Record' type answer. | [
-0.1323193460702896,
0.06540547311306,
0.2933335602283478,
-0.18903027474880219,
0.13732177019119263,
-0.1003442332148552,
0.19566187262535095,
-0.018606528639793396,
-0.17569462954998016,
-0.41456133127212524,
-0.4276696741580963,
0.41245195269584656,
-0.7174279093742371,
-0.1200172528624... | |
I'm currently beating my head against a wall trying to figure this out. But long story short, I'd like to convert a string between 2 UTF-8 '\u0002' to bold formating. This is for an IRC client that I'm working on so I've been running into these quite a bit. I've treid regex and found that matching on the rtf as ((\'02)... | [
0.09947903454303741,
0.17990699410438538,
0.46710893511772156,
-0.32492491602897644,
-0.1859082728624344,
0.0802401527762413,
0.14151690900325775,
0.06260773539543152,
-0.035786036401987076,
-0.8010708689689636,
0.10241881757974625,
0.5393982529640198,
-0.21603693068027496,
0.1872933804988... | |
filtered out of the post. But when looking at the char value its an int of 2.
Here's an attempt to paste the offending text:
> [02:34] test test
You could use either
```
rtb.Rtf = Regex.Replace(rtb.Rtf, @"\\'02\s*(.*?)\s*\\'02", @"\b $1 \b0");
```
or
```
rtb.Rtf = Regex.Replace(rtb.Rtf, @"\\'02\s*(.*?)\s*\\'02", ... | [
-0.10627762228250504,
0.11257222294807434,
0.4616365432739258,
-0.14230963587760925,
0.1581542044878006,
-0.0033924560993909836,
0.6053564548492432,
-0.03301910310983658,
-0.044055670499801636,
-0.6520273685455322,
-0.2933964431285858,
0.3970557451248169,
-0.42754849791526794,
0.2437885999... | |
I have a query string parameter value that contains an ampersand. For example, a valid value for the parameter may be:
```
a & b
```
When I generate the URL that contains the parameter, I'm using System.Web.HTTPUtility.UrlEncode() to make each element URL-friendly. It's (correctly) giving me a URL like:
<http://exa... | [
0.032610099762678146,
0.11165451258420944,
0.6092664003372192,
-0.1159680113196373,
-0.29290759563446045,
0.08504802733659744,
0.12989865243434906,
-0.45635172724723816,
-0.05207112431526184,
-0.3723841905593872,
0.026294758543372154,
0.4380434453487396,
-0.2726731598377228,
0.301320254802... | |
the query string.
What's the best way to work around this?
---
**UPDATE**: The problem hinges on [URLRewriter](http://urlrewriter.net/) (a third-party plugin) and not ASP.NET itself. I've changed the title to reflect this, but I'll leave the rest of the question text as-is until I find out more about the problem.
Sw... | [
0.10991599410772324,
0.25385981798171997,
0.4435173273086548,
-0.031130848452448845,
-0.21948638558387756,
-0.229965940117836,
0.5160525441169739,
0.2242847979068756,
-0.11406600475311279,
-0.5795364379882812,
-0.2489381730556488,
0.3347117006778717,
-0.09526784718036652,
0.468453854322433... | |
Which is your preference?
Let's say we have a generic Product table that has an ID, a name, and a foreign key reference to a category. Would you prefer to name your table like:
```
CREATE TABLE Products
(
ProductID int NOT NULL IDENTITY(1,1) PRIMARY KEY,
CategoryID int NOT NULL FOREIGN KEY REFERENCES Categori... | [
0.034622810781002045,
0.011205612681806087,
0.517180860042572,
-0.08679299801588058,
-0.09712662547826767,
0.26612722873687744,
-0.5000675320625305,
-0.3529098629951477,
-0.2713847756385803,
-0.4733212888240814,
-0.1693236529827118,
0.2777065336704254,
-0.46528294682502747,
0.1224014237523... | |
Name varchar(200) NOT NULL
)
```
From what I've seen, the convention in the .NET world is to be explicit -- the samples tend to use the first example, while the open source and RoR world favor the second. Personally I find the first easier to read and comprehend at first glance: `select p.ProductID, p.ProductName, c.... | [
-0.11123733967542648,
0.14052656292915344,
0.3099409341812134,
-0.25354301929473877,
-0.44674018025398254,
-0.06380948424339294,
0.09159791469573975,
-0.28058889508247375,
-0.15132425725460052,
-0.29692593216896057,
-0.3238638639450073,
0.5657484531402588,
-0.2746293842792511,
0.1714016646... | |
provided it's not a big deal, but how about when you are dealing with lots of data and tables? I would still find the first example to be better than the second, although possibly some combination of the two might be worth looking into (`<Table>ID` for the ID, but just `Name` for the name?). Obviously on an existing pr... | [
0.21991345286369324,
0.16254502534866333,
0.3523731827735901,
0.02495669387280941,
-0.18547572195529938,
-0.30700546503067017,
-0.24971377849578857,
-0.06482067704200745,
-0.34724777936935425,
-0.832353413105011,
-0.11571620404720306,
0.4595075845718384,
-0.13373799622058868,
-0.2379466444... | |
I am looking into using only a ddl to run my query, not a ddl and a Button\_Click function. I am yet to find what to do. How do I do this?
In your as(p/c)x:
```
<asp:DropDownList runat="server"
id="ddl"
OnSelectedIndexChanged="SelectionChanged"
AutoPostBack="true"... | [
0.33579209446907043,
-0.05540948733687401,
0.7557919025421143,
-0.033395811915397644,
0.06357882916927338,
-0.26621323823928833,
0.25523117184638977,
0.03239526227116585,
-0.4216240346431732,
-0.8835620284080505,
-0.0031352827791124582,
0.38716408610343933,
-0.12107454985380173,
0.27565839... | |
<asp:ListItem Text="Page 2" Value="/page2.aspx" />
</asp:DropDownList>
```
The "AutoPostBack" property tells ASP.NET to wire up a client-side (javascript) command that submits the form as soon as the drop down list changes, instead of waiting for a button click.
And in your codebehind, the event handler we reference... | [
0.07586810737848282,
-0.3074425458908081,
0.4134475290775299,
-0.20681405067443848,
0.018153131008148193,
-0.023796740919351578,
0.4130897521972656,
-0.5573586821556091,
-0.37069255113601685,
-0.4858284592628479,
-0.39568841457366943,
0.6234074831008911,
-0.39949145913124084,
-0.0357941836... | |
I know how to use Perl's Getopt::Long, but I'm not sure how I can configure it to accept *any* "--key=value" pair that hasn't been explicitly defined and stick it in a hash. In other words, I don't know ahead of time what options the user may want, so there's no way for me to define all of them, yet I want to be able t... | [
0.1550430953502655,
-0.16342100501060486,
0.23220928013324738,
0.11349695175886154,
0.26159197092056274,
-0.06460664421319962,
0.11323471367359161,
-0.07645953446626663,
-0.3323000371456146,
-0.5476492047309875,
-0.3713330030441284,
0.4653546214103699,
-0.35605332255363464,
0.0397677570581... | |
or supplied
with an invalid option value are passed through
in @ARGV instead of being flagged as errors.
This makes it possible to write wrapper scripts
that process only part of the user supplied
command line arguments, and pass the | [
0.23318980634212494,
-0.03161625191569328,
0.1762315332889557,
-0.038326870650053024,
0.13239996135234833,
0.03221935033798218,
0.3748819828033447,
0.06655463576316833,
-0.014597755856812,
-0.298941969871521,
-0.5247125029563904,
0.46084803342819214,
-0.27004286646842957,
-0.00584876863285... | |
remaining
options to some other program.
```
Once the regular options are parsed, you could use code such as that [provided by runrig](https://stackoverflow.com/questions/529868/using-perls-getoptlong-with-arbitrary-arguments/529914#529914) to parse the ad hoc options. | [
0.14373543858528137,
-0.17494037747383118,
0.20464900135993958,
0.23741622269153595,
0.1670321822166443,
-0.0678919106721878,
0.21674348413944244,
-0.024019356817007065,
-0.4773807227611542,
-0.33418741822242737,
-0.4665030837059021,
0.7404252290725708,
-0.3519938588142395,
-0.293354272842... | |
This question builds off of a previously asked question:
[Pass by reference multidimensional array with known size](https://stackoverflow.com/questions/529109/c-pass-by-reference-multidimensional-array-with-known-size)
I have been trying to figure out how to get my functions to play nicely with 2d array references. A ... | [
0.35791507363319397,
0.08081232756376266,
0.6697439551353455,
-0.2604851722717285,
-0.28626400232315063,
0.023874949663877487,
0.12638388574123383,
-0.821093738079071,
-0.12675312161445618,
-0.4124843180179596,
-0.10343466699123383,
0.3842735290527344,
-0.34218159317970276,
-0.075735248625... | |
{
bmparray[i] = (unsigned int *)malloc(width * sizeof(unsigned int));
}
for(int i = 0; i < height; i++)
for(int j = 0; j < width; j++)
{
bmparray[i][j] = 0;
}
return bmparray;
}
```
I don't know how I can re-write this function | [
0.17684921622276306,
-0.1411675214767456,
0.5112228989601135,
-0.5638534426689148,
-0.19351163506507874,
0.20920658111572266,
0.5256307721138,
-0.5687412023544312,
-0.23706704378128052,
-0.08295047283172607,
-0.00869766529649496,
0.8101644515991211,
-0.615980327129364,
-0.03703532740473747... | |
so that it will work where I pass bmparray in as an empty unsigned int \*\* by reference so that I could allocate the space for the array in one function, and set the values in another.
Use a class to wrap it, then pass objects by reference
```
class BMP_array
{
public:
BMP_array(int height, int width)
: buffe... | [
0.319381982088089,
-0.07798922061920166,
0.4579819440841675,
-0.3667406439781189,
-0.004076489247381687,
0.33848387002944946,
0.21883967518806458,
-0.5714807510375977,
-0.29574090242385864,
-0.35169747471809387,
-0.06293804943561554,
0.3821820318698883,
-0.40157991647720337,
0.038893233984... | |
{
buffer[i] = (unsigned int *)malloc(width * sizeof(unsigned int));
}
}
~BMP_array()
{
// TODO: free() each buffer
}
unsigned int ** data()
{
return buffer;
}
private:
// TODO: Hide or implement copy constructor and operator=
unsigned int ** buffer
};
``` | [
0.35392507910728455,
-0.12386516481637955,
0.27464160323143005,
-0.27180519700050354,
0.21940723061561584,
0.1666480451822281,
0.12025022506713867,
-0.5356038212776184,
-0.10444196313619614,
-0.40868207812309265,
-0.22690610587596893,
0.4843578636646271,
-0.5107094049453735,
0.018712656572... | |
I was making a website for a music band, and i was wondering the best way to play background music on the website without interrupting the flow of the music (even for a split second).
At the moment, i am considering using frames, but this is not supposed to be good practice. Please someone tell me how i can do this. ... | [
0.9977023601531982,
0.1816101223230362,
-0.04598142206668854,
0.22232693433761597,
0.15459056198596954,
-0.4817352592945099,
0.3763540983200073,
0.21395458281040192,
-0.18704332411289215,
-0.5262475609779358,
0.2685565650463104,
0.6864430904388428,
-0.20088036358356476,
0.04988472163677215... | |
incredibly annoying that is, and asking a group of software developers to help you out with that is going to be like asking a group of sheep the best way to make a lambskin coat.
If you really have to do it, frames would be the simplest way, so I'd do that. But you're not going to do it anyway, right? | [
0.7418200969696045,
0.1529581993818283,
-0.08937429636716843,
0.39381974935531616,
0.1931123584508896,
0.1595432460308075,
0.19656965136528015,
-0.008121601305902004,
-0.31893420219421387,
0.07516766339540482,
0.18183574080467224,
0.4131917655467987,
-0.003513267496600747,
-0.0610329285264... | |
I am using VS 2008 and trying to create a dataset for ms sql reporting services. I have two tables that I want to relate. One has a column with type of int, the other shortint. VS give me an error of
> Parent and Child columns don't have type-matching columns.
Is there any way to over ride this? In old sql reporting ... | [
0.3997705578804016,
-0.10531363636255264,
-0.11633756756782532,
0.16565456986427307,
-0.3100149929523468,
-0.0789695531129837,
0.3523671627044678,
-0.15315879881381989,
-0.18569621443748474,
-0.6489539742469788,
0.40695980191230774,
0.4164724349975586,
-0.268717497587204,
0.345419079065322... | |
the tables. There may be lots of reasons for this. Some tables in my systems are feeds from legacy systems. I do not have control over some of the systems. This has got to be a huge problem for any large company.
OK, on a second thought, not flagging whatever@email means that the previous element has to be a "non-word"... | [
0.2846834361553192,
0.12189073860645294,
0.3879445791244507,
0.11222006380558014,
0.05480394512414932,
-0.10830303281545639,
0.13560020923614502,
0.24919269979000092,
-0.5790237784385681,
-0.4068308472633362,
0.03569640964269638,
0.36053037643432617,
-0.481576532125473,
0.29125818610191345... | |
Here is the scenario:
IIS 6 and SQL Server 2005 on same machine:
I have just created a new application inside of my main website in IIS.
The root website has its own database. The application I just created under the root site has its own database, as well.
ASP.net pages in the root site connect to their database u... | [
0.08612635731697083,
0.2560690939426422,
0.06720835715532303,
-0.0586819089949131,
-0.013341146521270275,
-0.09933137893676758,
0.45337381958961487,
-0.16647833585739136,
-0.284090131521225,
-0.5259303450584412,
0.09171530604362488,
0.47631990909576416,
-0.38536393642425537,
0.336041331291... | |
like the root site's db is set up. When I try to run my new application I get this error:
Login failed for user ''. The user is not associated with a trusted SQL Server connection.
When I switch the new app's connection string to use the sql server sa account, it works. I do not want to use the SA account.
I cannot ... | [
0.10640399158000946,
0.04109060764312744,
0.12097333371639252,
0.15941956639289856,
-0.08680658042430878,
-0.16549691557884216,
0.8450310230255127,
0.038367025554180145,
-0.382111132144928,
-0.7488272190093994,
0.020903144031763077,
0.45715227723121643,
-0.43151530623435974,
0.408778250217... | |
of solutions:
[bytes.com/groups/net-asp/290050-setting-up-integrated-security-sql-server](http://bytes.com/groups/net-asp/290050-setting-up-integrated-security-sql-server) | [
-0.30353468656539917,
0.10189839452505112,
0.4658508002758026,
0.11129201203584671,
0.3817879557609558,
0.14857883751392365,
0.17968840897083282,
-0.26005569100379944,
-0.424775630235672,
-0.2697871923446655,
-0.5018353462219238,
0.35943204164505005,
-0.018713874742388725,
-0.1229057982563... | |
I'm looking at the `poll()` [**man page**](http://man7.org/linux/man-pages/man2/poll.2.html), and it tells me the behavior of `poll()` when positive and negative values are passed in for the timeout parameter. It doesn't doesn't tell me what happens if timeout is `0`. **Any ideas?**
Looking at the `epoll_wait()` [man ... | [
-0.02629401721060276,
-0.15607067942619324,
0.5641267895698547,
-0.17926645278930664,
0.04291682317852974,
0.1233954206109047,
0.15595263242721558,
-0.2832712233066559,
-0.26146823167800903,
-0.580066978931427,
-0.12936915457248688,
0.5741322636604309,
-0.03441371023654938,
0.1894871592521... | |
descriptor to become ready. If timeout is zero, then `poll()` will return without blocking. If the value of timeout is `-1`, the `poll` blocks indefinitely.
, as of `Mac OS X 10.5`;
> Maximum interval to wait for the poll to complete, in milliseconds. If this value is 0, `poll()` will return immediately. If this valu... | [
0.07574178278446198,
-0.1967560350894928,
0.7441688179969788,
-0.11298827826976776,
0.033434927463531494,
-0.11009855568408966,
0.5055946707725525,
-0.4537484049797058,
-0.06616482138633728,
-1.011322259902954,
-0.5767951011657715,
0.4309267997741699,
-0.17653407156467438,
0.46675139665603... | |
I'm looking to run some un-verified scripts (written in a yet-to-be-determined language, but needs to be Java-based, so JRuby, Groovy, Jython, BeanShell, etc are all candidates). I want these scripts to be able to do some things and restricted from doing other things.
Normally, I'd just go use Java's SecurityManager a... | [
0.6061244010925293,
0.1887080818414688,
-0.025787003338336945,
0.17541144788265228,
-0.19153054058551788,
-0.43928074836730957,
0.40459784865379333,
0.5048782825469971,
-0.21345067024230957,
-0.5156992673873901,
-0.14003214240074158,
0.3087654709815979,
-0.2997405529022217,
0.0024822689592... | |
API/library that I've providing. For example, I don't want to allow direct network access to open up a URLConnection to yahoo.com, but I am OK if it is done with MyURLConnection. That is - there is a set of methods/classes that I want to allow and then everything else I want to be off limits.
I don't believe this type... | [
0.47412291169166565,
0.29493701457977295,
0.2839678227901459,
-0.03756657987833023,
-0.14354687929153442,
-0.3910958766937256,
0.29790061712265015,
-0.07449160516262054,
-0.043094754219055176,
-0.6585164070129395,
0.09076061844825745,
0.5537674427032471,
-0.2472444772720337,
0.274834334850... | |
basic looping/branching). So even a "large" overhead that checks a security check on every reflection call is fine by me.
Suggestions?
Disclaimer: I am not an expert on Java Security APIs, so there may be a better way to do this.
I work for [Alfresco](http://www.alfresco.com), Java-based Open Source Enterprise CMS,... | [
0.5373544096946716,
-0.09251496940851212,
-0.05017784237861633,
0.04026062414050102,
-0.09457975625991821,
-0.35873943567276,
0.39065125584602356,
-0.28841206431388855,
-0.3837624490261078,
-0.24918486177921295,
0.2257622927427292,
0.774073600769043,
-0.41504374146461487,
-0.03858959674835... | |
which classes are available, and which are not. The overhead, according to our engineers, is on the order of 10%- not too bad.
In addition to this, and this may be relevant to you as well, on the Java side, we use Acegi (now Spring Security), and use AOP to give role-based control over which methods a certain user ca... | [
0.32065698504447937,
-0.1963735818862915,
-0.0046976408921182156,
0.19646179676055908,
0.2867552638053894,
0.00702291913330555,
0.21295614540576935,
-0.12028518319129944,
-0.24566061794757843,
-0.4598480761051178,
-0.1889086365699768,
0.5363212823867798,
-0.3341013193130493,
-0.13941371440... | |
authorization. So you could use the AOP techniques to further restrict which methods can be called, thus allowing to expose this in other scripting languages, such as Groovy, etc. We are in the process of adding those as well, having the confidence that our underlying Java APIs protect users from unauthorized access. | [
0.43268564343452454,
-0.06669897586107254,
-0.027429670095443726,
0.15522778034210205,
0.18987859785556793,
-0.5169917941093445,
0.1104082241654396,
-0.10766168683767319,
-0.10928430408239365,
-0.4166857600212097,
-0.15961907804012299,
0.47902175784111023,
-0.3057526648044586,
-0.269098490... | |
> **Possible Duplicate:**
>
> [String vs StringBuilder](https://stackoverflow.com/questions/73883/string-vs-stringbuilder)
I just revisited some of the books that I used to pick up VB.NET. I am not sure I've got this in my head, understand how/what StringBuilder is.
What is the guidance for using? Is it best to u... | [
0.15964679419994354,
0.02654699981212616,
-0.027303414419293404,
-0.05253530666232109,
-0.1614157110452652,
0.06221063807606697,
0.20802313089370728,
-0.20106269419193268,
-0.28298792243003845,
-0.6522922515869141,
0.2430809736251831,
0.5126222968101501,
-0.20833590626716614,
0.10459075868... | |
from x where y = {0}",1)`?
It's always struck me that declaring another variable and including a name space is not beneficial for small string concatenations, but I am not sure now.
Sorry, lot of documentation tells you what to use, just not what's best.
I've got an [article on this very topic](http://pobox.com/~ske... | [
0.415147066116333,
0.06395845115184784,
0.09900502115488052,
-0.09078860282897949,
-0.09798142313957214,
-0.22851622104644775,
0.19706454873085022,
0.21195292472839355,
-0.19584091007709503,
-0.5613855123519897,
-0.026199597865343094,
0.20130866765975952,
-0.23567688465118408,
0.3215336203... | |
up a string as you go using the += operator is potentially performance suicide.
* Definitely use the concatenation operator when you can (readably) specify everything which needs to be concatenated in one statement. (If you have an array of things to concatenate, consider calling String.Concat explicitly - or String.Jo... | [
0.20811469852924347,
-0.20378029346466064,
0.09308511018753052,
0.035641949623823166,
-0.16475044190883636,
-0.09408710151910782,
0.5705503821372986,
-0.2734297513961792,
-0.4498874843120575,
-0.6682507395744324,
-0.2803041338920593,
0.43749237060546875,
-0.23333042860031128,
-0.0770888701... | |
for something other than feeding the next iteration of concatenation, StringBuilder isn't going to help you. For instance, if you build up a full name from a first name and a last name, and then add a third piece of information (the nickname, maybe) to the end, you'll only benefit from using StringBuilder if you don't ... | [
0.2226303666830063,
-0.2378445714712143,
-0.05736715719103813,
0.3121236264705658,
-0.1939539909362793,
-0.03220350295305252,
0.3918050229549408,
0.1558820605278015,
-0.00028569993446581066,
-0.5228413343429565,
0.04026692360639572,
0.40831178426742554,
0.00009255717304768041,
0.0985487923... | |
matter which way you go. Which way is more efficient will depend on the number of concatenations the sizes of string involved, and what order they're concatenated in. If you really believe that piece of code to be a performance bottleneck, profile or benchmark it both ways. | [
0.5272802114486694,
-0.10739188641309738,
0.13023319840431213,
0.18358734250068665,
-0.10955432057380676,
0.03572840616106987,
0.5178624391555786,
-0.08974755555391312,
0.07454964518547058,
-0.6933913826942444,
0.0936378464102745,
0.5949931740760803,
0.023349307477474213,
-0.11882383376359... | |
I have four flags
```
Current = 0x1
Past = 0x2
Future = 0x4
All = 0x7
```
Say I receive the two flags Past and Future (`setFlags(PAST | FUTURE)`). How can I tell if `Past` is in it? Likewise how can I tell that `Current` is not in it? That way I don't have to test for every possible combination.
If you want a... | [
0.4233626425266266,
-0.038105662912130356,
0.2729036509990692,
0.07666564732789993,
0.0024142060428857803,
0.26497241854667664,
0.5061400532722473,
-0.4935529828071594,
-0.019738642498850822,
-0.4944290816783905,
0.04310935363173485,
0.5597968101501465,
-0.10524128377437592,
0.191737934947... | |
a value for multiple things.
To test for exclusion:
```
if ((value & mask) == 0) { }
``` | [
0.01665467955172062,
-0.0021024320740252733,
-0.16953851282596588,
-0.0784626454114914,
0.04840411990880966,
0.001885059173218906,
0.26386916637420654,
-0.38665637373924255,
-0.22566118836402893,
-0.17329543828964233,
-0.17683196067810059,
0.40821561217308044,
-0.4825783371925354,
0.145175... | |
I'm having some performance issues in a rails project (running on rails 2.0.5), for example in my user administration pages.
my user model has many relations (details, addresses, roles...) who get loaded with eager loading. That creates really huge SQL queries, for some cases, it takes almost a minute to load 30 users... | [
0.1570185124874115,
0.2576112151145935,
-0.020885182544589043,
0.04899126663804054,
-0.19102486968040466,
-0.06639038026332855,
0.22907933592796326,
0.11282433569431305,
-0.1723817139863968,
-0.6288943886756897,
0.4080335795879364,
0.3540308177471161,
-0.07210428267717361,
0.04583197459578... | |
for a faster rendering. It was extremely boring to maintain, as I had to update the database fields manually in the views scripts etc...
BUT it really had fantastic performances.... so I was wondering if anyone ever tried to implement something to take benefits of Mysql views in active record ?
I just did some basic ... | [
0.47684919834136963,
0.06659083813428879,
0.4649592936038971,
0.10276563465595245,
-0.15427592396736145,
0.0023816500324755907,
0.06509771198034286,
-0.12387653440237045,
-0.0673903301358223,
-0.6430647373199463,
0.23496490716934204,
0.6656220555305481,
-0.17571471631526947,
0.053156968206... | |
,
users.login ,
users.email ,
details.last_name ,
details.first_name ,
details.phone ,
details.fax | [
0.29410800337791443,
0.4561215937137604,
0.508098304271698,
0.19182270765304565,
0.3801690638065338,
0.2011273354291916,
0.23428618907928467,
0.28768160939216614,
-0.31145432591438293,
-0.5229911804199219,
-0.2950083911418915,
-0.0013428732054308057,
-0.22138431668281555,
0.261046946048736... | |
,
FROM `users` LEFT OUTER JOIN `details` ON details.user_id = users.id ;
```
Then a model:
```
class UsersV < ActiveRecord::Base
end
```
Tried a few things in my console:
```
u=UsersV.find(:first) # ok !
u=UsersV.find_by_last_name('smith') #=> ok !
us=UsersV.find_all_by_last_name('smith') #=> ok too !
```
lo... | [
0.017557242885231972,
0.12172180414199829,
0.5312368273735046,
0.119478739798069,
0.09424125403165817,
-0.10045710951089859,
0.19133388996124268,
0.008780542761087418,
-0.35237419605255127,
-0.7303361892700195,
-0.004931668285280466,
0.607213020324707,
-0.0042085545137524605,
0.37180379033... | |
view, assuming the data on which the complex query is based doesn't change often) is that you violate Rails' DRY'ness, to some extent (the addition of the UserV model for the view, which the purists will argue is a duplication of the User model.)
So the ideal solution would be to get the most out of the RDBMS for your... | [
0.06805304437875748,
0.23398084938526154,
0.0503041073679924,
0.14213630557060242,
-0.18837322294712067,
-0.12512926757335663,
0.47967350482940674,
-0.1136929914355278,
-0.12000599503517151,
-0.39362120628356934,
-0.04378565028309822,
0.6335146427154541,
-0.1357172727584839,
0.101591125130... | |
results don't have to be realtime-exact) and/or the tables involved get modified often.
* In MySQL see if you can optimize the query further so it would take milliseconds instead of seconds (**add appropriate indices, run ANALYZE**, etc.)
* If you have the option of using/trying out another RDBMS such as Postgres, by ... | [
-0.07534857094287872,
-0.07817608118057251,
0.14836519956588745,
0.0440547913312912,
-0.39396932721138,
-0.05928437039256096,
0.48784857988357544,
-0.04308348894119263,
0.1283094584941864,
-0.8278486728668213,
0.05292962118983269,
0.5590385794639587,
-0.21368110179901123,
0.051479116082191... | |
playing with Postgres make good use of PGAdminIII's graphical explain plan tool. | [
0.10849865525960922,
-0.22262005507946014,
0.39707455039024353,
0.21441812813282013,
0.20077669620513916,
-0.6700755953788757,
-0.21081256866455078,
0.0921601727604866,
0.08571001142263412,
-0.7798757553100586,
-0.005189568269997835,
0.4866863489151001,
-0.16982856392860413,
-0.26068267226... | |
As that web-standards geek I am, I dislike the default `<form runat="server">` that surrounds my entire webpages. I've seen many ASP.NET based webpages that don't have these, so it seems like it can be removed without taking away any functionality. How?
There will have to be a `<form runat="server">` if you wish to use... | [
0.5562418699264526,
0.244593545794487,
0.17960232496261597,
0.15260189771652222,
-0.15071654319763184,
-0.6101184487342834,
0.23232488334178925,
0.48077917098999023,
-0.32521551847457886,
-0.3394005596637726,
-0.07327593117952347,
0.43023785948753357,
-0.3116212487220764,
0.473908901214599... | |
perhaps it was the Master Page that had the `<form runat="server">`? | [
0.11626498401165009,
0.17052364349365234,
0.19923001527786255,
0.07486595958471298,
-0.13623040914535522,
-0.057196926325559616,
0.03533933684229851,
0.4417688250541687,
-0.43306902050971985,
-0.06852111965417862,
0.04661303386092186,
-0.037613023072481155,
-0.1023343876004219,
0.267750918... | |
For a homework assignment I was given a Card class that has enumerated types for the Rank and Suit. I am required to compare two poker hands (each hand is an `ArrayList` of 5 cards) and decide the winner.
The `isStraight()` function is really bothering me, because I have to start over the count after the Ace. For exam... | [
0.006082845851778984,
0.1363593488931656,
0.415240615606308,
-0.22664861381053925,
-0.021350493654608727,
0.02953852340579033,
0.05142828822135925,
-0.5214985013008118,
-0.28569474816322327,
-0.40725448727607727,
0.033839743584394455,
0.308650940656662,
-0.054930225014686584,
0.01874684914... | |
TEN(10), JACK(11), QUEEN(12), KING(13), ACE(14);
private final int points;
private Rank(int points)
{
this.points = points;
}
public int points()
{
return this.points;
}
}
public enum Suit
{
DIAMONDS, CLUBS, HEARTS, SPADES;
}
```
You do realize that by the rules of a... | [
0.004084864631295204,
0.04325742647051811,
0.31932029128074646,
-0.11558142304420471,
0.08979249000549316,
-0.13776229321956635,
-0.12987835705280304,
-0.43427741527557373,
-0.7258459329605103,
-0.1457449048757553,
-0.08715367317199707,
0.5008602738380432,
-0.11817757785320282,
0.141609117... | |
wrap. According to those rules (not yours) I've implemented something similar before. Basically you sort the array and walk it, making sure the current card is one higher than the previous. In the first iteration, if it is an ace, then you explicitly check for [A,2,3,4,5]. If it is you return true and if it isn't you c... | [
0.5833025574684143,
-0.16488787531852722,
0.15050871670246124,
0.13605092465877533,
-0.021849429234862328,
-0.3088265061378479,
-0.02617204748094082,
-0.6719986200332642,
-0.622381865978241,
-0.32072871923446655,
0.08840018510818481,
0.6617889404296875,
-0.09234853088855743,
-0.06623537838... | |
I'd like to be able to better access the database so I can execute queries (primarily because I don't understand/know the API for it, but I do know SQL). I don't want to remove everything Visual Studio has done because a lot is already built upon it, but how can I get an object that I can use to execute SQL queries.
T... | [
0.10124731808900833,
0.16209858655929565,
0.4258747398853302,
-0.19532547891139984,
-0.09822104126214981,
-0.2569412589073181,
0.0695856437087059,
-0.15390408039093018,
-0.34736672043800354,
-0.5376388430595398,
-0.019159628078341484,
0.5886870622634888,
-0.33757004141807556,
0.15483078360... | |
{
return command.ExecuteScalar() as string;
}
}
```
Don't forget to add:
```
using System.Data;
using System.Data.SqlClient;
``` | [
-0.09772307425737381,
0.011450408026576042,
0.3584897220134735,
-0.12553423643112183,
0.3555667996406555,
-0.2140084207057953,
0.29349520802497864,
-0.11383786797523499,
-0.10430160164833069,
-0.4867166578769684,
-0.2715498208999634,
0.6818345785140991,
-0.4733254909515381,
0.0042886580340... | |
I have several update methods in a javascript file, used for updating my ajax application, like so:
```
function updateByPk(layer, pk) {
url = "get_auction.php?cmd=GetAuctionData&pk="+pk+"&sid="+Math.random();
update(layer, url);
}
function updateByQuery(layer, query) {
url = "get_records.php?cmd=GetRecordSe... | [
0.1274682581424713,
-0.07264389842748642,
0.5628587007522583,
0.25632089376449585,
-0.3571286201477051,
-0.02554963529109955,
0.04639717563986778,
-0.09878570586442947,
-0.44319596886634827,
-0.7643508315086365,
0.07143761217594147,
0.3477328419685364,
-0.022147081792354584,
0.142824828624... | |
each.
if I get the question, then you're asking whether pagination, and similar, is better to be done through Javascript + AJAX, or to be done through a call to the server?
I'd personally say to just use a request to the server. AJAX is uneccesary in cases like this, other than for "bling" factor (yes, that is a techn... | [
0.2518017888069153,
0.16917891800403595,
0.4277418553829193,
0.24784547090530396,
-0.2400406152009964,
0.25134792923927307,
-0.046016108244657516,
-0.10536724328994751,
-0.20950742065906525,
-0.7210726141929626,
-0.20656718313694,
0.6049433350563049,
-0.18768778443336487,
-0.14960975944995... | |
Javascript there means that 1) you've got extra code to maintain. 2) you break the back button. If you only implement the AJAX method, then you have no way of accessing the data on other pages. And you've no easy way of linking to it (by copying the address bar) if you do.
I will personally only ever use AJAX for thin... | [
0.23131603002548218,
0.20374789834022522,
0.030935170128941536,
-0.024678021669387817,
-0.30414095520973206,
-0.5091094970703125,
0.24929159879684448,
0.20511731505393982,
-0.2356054037809372,
-0.7904649376869202,
-0.0723033994436264,
0.3977063298225403,
-0.3565942347049713,
-0.26725509762... | |
For my Programming 102 class we are asked to deliver C code that compiles and runs under Linux. I don't have enough spare space on my hard drive to install Linux alongside Windows, and so I use cygwin to compile my programs.
The most recent program I had to give in compiles and runs fine under cygwin. It compiles fine... | [
0.4240654408931732,
0.39269882440567017,
0.07761731743812561,
-0.1505594104528427,
-0.21333110332489014,
-0.003610247513279319,
0.15101376175880432,
0.050685763359069824,
-0.06123923882842064,
-0.30822017788887024,
-0.08553217351436615,
0.5859464406967163,
-0.1928315907716751,
0.0818664729... | |
have found via google haven't been conclusive. One thread I found said that the cause for the seg fault under Linux is a memory leak. Why would this not affect the cygwin version?
I would use the University's computers, but I can't use Subversion on them which would significantly hinder my efforts. (I'm new to coding ... | [
0.5194202661514282,
0.3676445484161377,
0.144586443901062,
0.09733163565397263,
-0.2094862461090088,
-0.38978511095046997,
0.29119160771369934,
0.38806602358818054,
0.01812267117202282,
-0.5013811588287354,
-0.14697831869125366,
0.5200474858283997,
-0.032201703637838364,
0.2490300983190536... | |
being able to write code that will run under Linux?
**Edit**
Thanks for the replies. I wasn't explicit enough in my original post: that there is a bug in my code was pretty much a given for me (I am quite new to programming, and really green when it comes to C, after all). My TA implied cygwin's GCC is a less reliabl... | [
0.430329829454422,
0.2004109025001526,
-0.047168537974357605,
0.2223546802997589,
-0.3152598738670349,
-0.18280398845672607,
0.3360687792301178,
0.4220621883869171,
-0.2426057606935501,
-0.4482797384262085,
-0.03914317861199379,
0.5849201679229736,
0.01712917722761631,
-0.15255333483219147... | |
vs. my code, I was wondering what the reason could be for the program to run under Windows and crash under Linux. The replies re: different memory managers and heap/stack layout under Windows/Linux were illustrating in that regard.
Would the conclusion that cygwin's GCC is just as 'good' as GNU/Linux', and it's the un... | [
0.3972734212875366,
0.2092093527317047,
0.2200462371110916,
0.2335689216852188,
-0.4066186845302582,
-0.24444745481014252,
0.20030759274959564,
0.11613145470619202,
-0.19537955522537231,
-0.6128208637237549,
-0.20138439536094666,
0.679766833782196,
0.07822473347187042,
0.3032197058200836,
... | |
what makes the program run under Windows and not under Linux, which was what I really wanted to know. Thanks to everyone else who contributed, they were all very interesting and informative replies.
When I've found the issue and fixed it I'll upload a zip file with all the source code of this non-working version, in c... | [
0.43343010544776917,
0.20840056240558624,
0.17364782094955444,
-0.004819178022444248,
0.1368996500968933,
-0.05266529694199562,
0.527971088886261,
0.26715272665023804,
-0.39313486218452454,
-0.6018844246864319,
-0.13580989837646484,
0.6413407921791077,
-0.41225332021713257,
0.0292840674519... | |
to return was being declared inside the function and so was being destroyed once the function executed. Problematic code is commented out on lines 22-24.
Feel free to ridicule my code.
```
/**
* Returns array of valid searches based on current coordinate
*/
void determine_searches(int row, int col, int last_row, int... | [
-0.04355524480342865,
-0.06909787654876709,
0.6878249645233154,
-0.05875510349869728,
0.09348447620868683,
0.23098814487457275,
0.38762161135673523,
-0.33186355233192444,
-0.00773286959156394,
-0.536990225315094,
-0.12934021651744843,
0.4630422592163086,
-0.4651191532611847,
0.162889391183... | |
{0, 1, 2, 3, 4, 5, 6, 7, -1};
int Library4[] = {0, 1, 2, -1};
int Library5[] = {0, 6, 7, -1};
int Library6[] = {0, 1, 2, 6, 7, -1};
int Library7[] = {0, 1, 2, 3, 4, -1};
int Library8[] = {0, 4, 5, 6, 7, -1};
int * Library[] = {
Library0, Library1, Library2,
Library3, Library4, ... | [
-0.1816948503255844,
-0.19775424897670746,
0.431212455034256,
0.1252862811088562,
0.43640658259391785,
0.7447153925895691,
0.1871931552886963,
-0.2541099190711975,
-0.3640316426753998,
-0.5626418590545654,
-0.5065100193023682,
0.18427209556102753,
-0.3626329302787781,
0.09690522402524948,
... | |
Library6, Library7, Library8,
};
// declare (and assign memory to) the array of valid search directions that will be returned
//int *active_search;
//active_search = (int *) malloc(SEARCH_DIRECTIONS * sizeof(int));
// determine which is the correct array of search directions based on the current c... | [
-0.30832138657569885,
-0.09453202784061432,
1.0164235830307007,
0.15339122712612152,
0.4492281973361969,
0.34543803334236145,
-0.0042125629261136055,
-0.38826197385787964,
-0.09078098088502884,
-0.5113661885261536,
-0.37371185421943665,
0.3303207457065582,
-0.3005749583244324,
0.0524173751... | |
active_search[i] = Library[0][i];
i++;
}
}
// top right corner
else if(row == 0 && col == last_col){
while(Library[1][i] != -1){
active_search[i] = Library[1][i];
i++;
} | [
-0.7380578517913818,
-0.3746800124645233,
0.758481502532959,
-0.226035013794899,
0.35439541935920715,
-0.05802742764353752,
0.2168186753988266,
-0.16896815598011017,
-0.19509735703468323,
-0.5626594424247742,
-0.5549860596656799,
0.5929430723190308,
-0.7257695198059082,
-0.2208816707134246... | |
}
// non-edge columns of first row
else if(row == 0 && (col != 0 || col != last_col)){
while(Library[2][i] != -1){
active_search[i] = Library[2][i];
i++;
}
}
// non-edge coordinates (no edge columns nor rows)
else if(row != 0 && row != last_row && col != 0 | [
-0.6011543273925781,
-0.19099624454975128,
0.7040199041366577,
-0.011728396639227867,
0.36401551961898804,
0.08911611139774323,
0.26806846261024475,
-0.29326581954956055,
-0.1932837814092636,
-0.6642113924026489,
-0.35179418325424194,
0.5754366517066956,
-0.3561183214187622,
-0.06023925915... | |
&& col != last_col){
while(Library[3][i] != -1){
active_search[i] = Library[3][i];
i++;
}
}
// bottom left corner
else if(row == last_row && col == 0){
while(Library[4][i] != -1){
active_search[i] = Library[4][i]; | [
-0.5311205387115479,
-0.26424160599708557,
0.8206432461738586,
-0.2305174171924591,
0.36190280318260193,
0.1258283108472824,
0.30097249150276184,
-0.34357601404190063,
-0.20015816390514374,
-0.2374459207057953,
-0.653009831905365,
0.6295293569564819,
-0.5604181885719299,
-0.091398306190967... | |
i++;
}
}
// bottom right corner
else if(row == last_row && col == last_col){
while(Library[5][i] != -1){
active_search[i] = Library[5][i];
i++;
}
}
// non-edge columns of last row
else if(row == last_row | [
-0.6493622064590454,
-0.2121429294347763,
0.7566801905632019,
-0.17148078978061676,
0.2085382640361786,
0.16142897307872772,
0.17714841663837433,
-0.40247514843940735,
-0.18250389397144318,
-0.5777360796928406,
-0.29089829325675964,
0.4270949065685272,
-0.285968542098999,
0.023433517664670... | |
&& (col != 0 || col != last_col)){
while(Library[6][i] != -1){
active_search[i] = Library[6][i];
i++;
}
}
// non-edge rows of first column
else if((row != 0 || row != last_row) && col == 0){
while(Library[7][i] != -1){ | [
-0.5030490159988403,
-0.2791210114955902,
0.9102692604064941,
-0.15852537751197815,
0.3074842095375061,
0.08290078490972519,
0.3547150790691376,
-0.4283522069454193,
-0.2231636941432953,
-0.30333465337753296,
-0.567438542842865,
0.6492412686347961,
-0.41944420337677,
0.00910660345107317,
... | |
active_search[i] = Library[7][i];
i++;
}
}
// non-edge rows of last column
else if((row != 0 || row != last_row) && col == last_col){
while(Library[8][i] != -1){
active_search[i] = Library[8][i];
i++;
}
} | [
-0.7637567520141602,
-0.4847770631313324,
0.9203104972839355,
-0.22720293700695038,
0.2297465056180954,
-0.017155084758996964,
0.3261469900608063,
-0.2669826149940491,
-0.347802072763443,
-0.5561290979385376,
-0.5229606032371521,
0.7679997086524963,
-0.7184446454048157,
-0.1607809215784073... | |
active_search[i] = -1;
}
```
Like others have said, you might want to post some of your code here, even if that's not the real point of your question. It might still be a good learning experience to have everyone here poke through your code and see if they can find what caused the segfault.
But yeah, the problem is t... | [
0.28763654828071594,
0.1736983358860016,
0.025011520832777023,
0.06819259375333786,
0.1560187041759491,
-0.35712483525276184,
0.27887216210365295,
0.13412359356880188,
-0.4200569689273834,
-0.5456664562225342,
-0.141451895236969,
0.665532112121582,
-0.29494351148605347,
0.09377329051494598... | |
some earlier point. Other times, it'll segfault because you hit a page that hasn't been allocated to your process at all. And that is really impossible to predict. It depends on where your memory was allocated, was it at the edge of a page, or in the middle? That's up to the OS and the memory manager, and which pages h... | [
0.043053992092609406,
0.1059393361210823,
0.27013567090034485,
0.14424952864646912,
-0.12377811968326569,
0.04551392421126366,
0.09029901027679443,
-0.19616009294986725,
-0.5245230793952942,
-0.808807373046875,
-0.058653417974710464,
0.3475271165370941,
-0.16682082414627075,
0.170907467603... | |
you access unallocated memory.
As for the TA's claim that cygwin is more "lax", that's rubbish, for one simple reason.
Neither compiler caught the bug! If the "native" GCC compiler had truly been less lax, it would have given you an error at compile-time. Segfaults are not generated by the compiler. There's not much t... | [
0.19543318450450897,
0.21749979257583618,
-0.033458590507507324,
0.25848162174224854,
-0.10322435945272446,
-0.561978280544281,
0.416065514087677,
0.031583644449710846,
-0.13760560750961304,
-0.17470216751098633,
-0.30811744928359985,
0.5489441752433777,
-0.038106780499219894,
0.1452115178... | |
I'm a noob to XPCOM development. In the course of writing XPCOM code in C++, I need to create addtional classes for use inside my XPCOM component. Do I need to create another XPCOM component for such classes? Can't I just add the new class in the header file?
No, not at all. XPCOM describes the external interface. "Int... | [
0.3397631347179413,
0.3613637685775757,
0.012825403362512589,
-0.038014404475688934,
-0.1684899479150772,
0.08948169648647308,
0.1614537388086319,
0.18616291880607605,
-0.1539677530527115,
-0.4060653746128082,
0.028684113174676895,
0.6977484226226807,
-0.12959599494934082,
0.17023845016956... | |
I would like to know the best way to delete records from a live database and refresh the page instantly. At the moment I am using ajax, with the following javascript method:
```
function deleterec(layer, pk) {
url = "get_records.php?cmd=deleterec&pk="+pk+"&sid="+Math.random();
update('Layer2', url);
}
```
if c... | [
0.10369468480348587,
0.02058265171945095,
0.43229731917381287,
0.03516753017902374,
-0.1634042114019394,
-0.17572855949401855,
0.2953345477581024,
-0.06566137820482254,
-0.3502962291240692,
-0.776556134223938,
-0.08097252994775772,
0.5297485589981079,
-0.15758667886257172,
0.27563250064849... | |
alert("Your browser is not supported?");
}
xmlHttp.onreadystatechange = function() {
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
document.getElementById(layer).innerHTML=xmlHttp.responseText;
} else if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading") {
... | [
0.2022128403186798,
-0.2101495862007141,
0.6692796945571899,
-0.09848805516958237,
0.12987039983272552,
-0.09574977308511734,
0.47120407223701477,
-0.2060677409172058,
-0.3116745352745056,
-0.6426365971565247,
-0.7057296633720398,
0.5409550666809082,
-0.6134071350097656,
0.0241236630827188... | |
record, and upate the page.
At the moment my ajax framework works by passing data to a javascript update method, which works fine for selecting different queries to display in different layers.
I want to add the functionality to delete, or alter the records in a certain way.
I am wondering if it is possible when cl... | [
0.368786484003067,
0.2032618373632431,
0.5090261101722717,
0.19300027191638947,
-0.19294944405555725,
-0.1325150579214096,
0.02919490821659565,
0.030314359813928604,
-0.4140017330646515,
-0.7653948664665222,
0.15040628612041473,
0.4830094575881958,
-0.35509374737739563,
0.168584406375885,
... | |
the php page(only in the layer) reload itself after executing a mysql query?
Or to make a new "alterstatus" method, which would pass delete or watch as a paramter, and have the php execute a query accordingly and then update the page?
edit: The links are generated like so. deleterec would be called from an additional... | [
-0.1865570992231369,
-0.02374362014234066,
0.8266887068748474,
0.05503080040216446,
-0.38967227935791016,
-0.057107213884592056,
0.5495423674583435,
-0.526592493057251,
-0.30186063051223755,
-0.40670424699783325,
-0.24334745109081268,
0.061103835701942444,
-0.3724861741065979,
0.1446834802... | |
href="#" onclick="deleteRec(\'Layer2\', \'' . $pk . '\')">'.$row['ARTICLE_NAME'].'</a></td>' . "\n";
echo '</tr>' . "\n";
```
}
edit: the update method can not be modified, as it is used by the updateByPk and updateBypg methods which need a layer.
Without digging too much into your code specifics, I don't know of... | [
0.20955175161361694,
0.0872492790222168,
0.5314842462539673,
-0.09020717442035675,
-0.2829535901546478,
-0.25467216968536377,
0.4118403494358063,
-0.19876855611801147,
-0.1428695172071457,
-0.6463249325752258,
-0.20495520532131195,
0.8182032108306885,
-0.27646273374557495,
0.20640747249126... | |
I would like to provide a WHERE condition on an inner query by specifying innertable.id = outertable.id. However, MySQL (5.0.45) reports "Unknown column 'outertable.id' in 'where clause'". Is this type of query possible?
The inner query is pivoting rows to columns using a GROUP BY. This could be entirely be performed ... | [
-0.1248064860701561,
-0.048042405396699905,
0.1603005826473236,
-0.18563108146190643,
0.12842202186584473,
0.06097591668367386,
0.09807956218719482,
-0.3000597059726715,
-0.049918416887521744,
-0.5699025392532349,
0.18813098967075348,
0.49348825216293335,
-0.3510187268257141,
0.02440218068... | |
is inefficient.
The actual SQL appears below:
```
select t.ticketid, u.userid, t.fullname, u.loginapi_userid, t.email, tp.subject, tp.contents, a.PhoneNumber, a.Location, a.Extension, a.BusinessUnit, a.Department
from swtickets t
inner join swticketposts tp on t.ticketid = tp.ticketid
inner join swusers u on t.useri... | [
-0.22806665301322937,
-0.11258240044116974,
0.6662961840629578,
0.06218741461634636,
0.059551630169153214,
0.3666580021381378,
0.12886174023151398,
-0.13224633038043976,
0.0054041300900280476,
-0.41407525539398193,
-0.21681001782417297,
0.4044245183467865,
-0.09394416958093643,
0.195315763... | |
t.ticketid
group by cfv.typeid
) as a on 1 = 1
where t.ticketid = 2458;
```
The answer to your question is no, it is not possible to reference correlation names as you are doing. The derived table is produced by your inner query before the outer query starts evaluating joins. So the correlation names like `t`, `tp... | [
-0.019759396091103554,
-0.2271224558353424,
0.6993139982223511,
0.2533216178417206,
-0.2951180338859558,
-0.0687517523765564,
-0.07718220353126526,
-0.22438259422779083,
0.02115985006093979,
-0.7769279479980469,
-0.02072228491306305,
0.14293581247329712,
-0.6455678939819336,
0.327323287725... | |
u.loginapi_userid, t.email,
tp.subject, tp.contents, a.PhoneNumber, a.Location, a.Extension,
a.BusinessUnit, a.Department
FROM swtickets t
INNER JOIN swticketposts tp ON (t.ticketid = tp.ticketid)
INNER JOIN swusers u ON (t.userid = u.userid)
LEFT OUTER JOIN (
SELECT cfv.typeid,
MIN(CASE cfv.customfieldid ... | [
-0.015115460380911827,
-0.21947266161441803,
0.8212825655937195,
0.08557820320129395,
0.1881878674030304,
0.6931585669517517,
0.20212043821811676,
-0.1796242594718933,
-0.016466323286294937,
-0.731005847454071,
-0.3770149350166321,
0.4126315116882324,
-0.18696549534797668,
0.27150011062622... | |
WHERE cfv.typeid = 2458
GROUP BY cfv.typeid
) AS a ON (a.typeid = t.ticketid)
WHERE t.ticketid = 2458;
``` | [
-0.15530231595039368,
-0.25677961111068726,
0.5812622904777527,
0.04468526691198349,
-0.07684734463691711,
0.15283963084220886,
0.08754920959472656,
-0.06005408987402916,
-0.052338048815727234,
-0.6405072212219238,
-0.2998102307319641,
0.06006244942545891,
-0.7703272700309753,
0.1963730901... | |
I have a large database of users (~200,000) that I'm transferring from a ASP.NET application to a Ruby on Rails application. I don't really want to ask every user to reset their password and so I'm trying to re-implement the C# password hashing function in Ruby.
The old function is this:
```
public string EncodePassw... | [
-0.003992646466940641,
0.10075780004262924,
0.36423248052597046,
-0.20915162563323975,
0.033099785447120667,
0.029312046244740486,
0.5491243004798889,
-0.396359920501709,
-0.03907332196831703,
-0.7827433943748474,
-0.049909912049770355,
0.2393597513437271,
-0.29761841893196106,
0.230413272... | |
bytes.Length);
HashAlgorithm algorithm = HashAlgorithm.Create("SHA1");
byte[] inArray = algorithm.ComputeHash(dst);
return Convert.ToBase64String(inArray);
}
```
An example hashed password and salt is (and the password used was "password"):
Hashed password: "weEWx4rhyPtd3kec7usysxf7kpk="
Salt: "1ptFx... | [
-0.36209964752197266,
0.3730504810810089,
0.16587336361408234,
-0.24942795932292938,
-0.07545674592256546,
0.07133836299180984,
0.44155800342559814,
-0.35498619079589844,
-0.19681957364082336,
-0.6057447791099548,
-0.09314638376235962,
0.48853543400764465,
-0.14293666183948517,
0.259303152... | |
bytes += c + "\x00" }
salty = Base64.decode64(salt)
concat = salty+bytes
sha1 = Digest::SHA1.digest(concat)
encoded = Base64.encode64(sha1).strip()
puts encoded
end
``` | [
-0.23161274194717407,
0.05722848325967789,
0.29828545451164246,
-0.2668675482273102,
-0.13767148554325104,
0.15426965057849884,
0.043986935168504715,
-0.18178151547908783,
-0.050684306770563126,
-0.6939907073974609,
-0.19871512055397034,
0.4112548828125,
-0.16387233138084412,
0.12262699753... | |
I'm trying to accomplish the following in ASP.Net:
1. Create a WPF Canvas control
2. Spin up a WPF Image control and a BitmapImage object
3. Set the BitmapImage source to a Uri for an image
4. Add the image to the canvas
5. When the image is downloaded render the canvas to a new bitmap
My code works correctly in WPF ... | [
0.5589685440063477,
-0.28481751680374146,
0.5421772599220276,
0.08067125082015991,
-0.28109225630760193,
-0.15108919143676758,
0.11976524442434311,
-0.4774291515350342,
-0.1539611518383026,
-1.0567572116851807,
0.03325299918651581,
0.7327873110771179,
-0.3076091408729553,
0.039703235030174... | |
event isn't raised, which hints that the image never starts downloading in the first place.
It's important to note that it works fine for most controls - ellipses, rectangles, ink presenters, and also the Image control so long as I use a stream source rather than a uri source.
So, what am I missing here? Why does the... | [
0.20744110643863678,
-0.4518435299396515,
0.5843718647956848,
0.3281978368759155,
-0.4987110495567322,
-0.17179113626480103,
-0.05158565938472748,
0.030032344162464142,
-0.19389113783836365,
-0.476292222738266,
0.02450673282146454,
0.46284112334251404,
0.07074833661317825,
0.01495729293674... | |
the content to bitmap files.
Thanks in advance for any advice..
Here's my code for the ASP.Net page:
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using ... | [
0.353322297334671,
-0.25942888855934143,
0.8617434501647949,
0.1432880461215973,
-0.15237250924110413,
0.2521280348300934,
0.23556645214557648,
-0.3327650725841522,
-0.4726715385913849,
-0.8829887509346008,
-0.297809362411499,
0.4818769693374634,
-0.25986379384994507,
0.1789635568857193,
... | |
t.Join();
}
[STAThread]
void DownloadAndSave()
{
c = new Canvas();
BitmapImage bitmap = new BitmapImage();
System.Windows.Controls.Image image = new System.Windows.Controls.Image();
bitmap.DownloadCompleted += new EventHandler(bitmap_DownloadCompleted);
bitmap.B... | [
-0.23493680357933044,
-0.6292364597320557,
0.9040691256523132,
0.029557742178440094,
-0.09009629487991333,
0.19033530354499817,
0.3357660472393036,
-0.33120524883270264,
-0.5553207993507385,
-0.721423327922821,
-0.6278989315032959,
0.5861055850982666,
-0.32824641466140747,
0.27664572000503... | |
image.Source = bitmap;
c.Children.Add(image);
c.UpdateLayout();
c.Measure(new Size(400, 300));
c.Arrange(new Rect(new Size(400, 300)));
}
void bitmap_DownloadCompleted(object sender, EventArgs e)
{
// this never fires!!
SaveImage(c);
}
void SaveIma... | [
0.13366124033927917,
-0.3846305012702942,
0.8611407279968262,
0.019213292747735977,
0.330229789018631,
0.08612480759620667,
0.17612965404987335,
-0.2653431296348572,
-0.2150650918483734,
-0.5867844820022583,
-0.5305221080780029,
0.7555860280990601,
-0.29528000950813293,
-0.0506676845252513... | |
RenderTargetBitmap bmp = new RenderTargetBitmap(400, 300, 96, 96, PixelFormats.Pbgra32);
bmp.Render(element);
BitmapEncoder encoder = new JpegBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bmp));
using (Stream stm = File.Create(Server.MapPath("~/file.jpg")))
encoder.S... | [
0.08408705145120621,
-0.21882307529449463,
0.8084794878959656,
-0.22912955284118652,
-0.40571480989456177,
0.27118614315986633,
0.2452998012304306,
-0.18428808450698853,
-0.2441963404417038,
-0.6696321964263916,
-0.16794796288013458,
0.7028368711471558,
-0.3949727714061737,
0.0284316614270... | |
in an almost identical situation was to download the bitmap resource synchronously and set it with the BitmapImage.StreamSource property. Note when using that technique that you can't close/dispose the stream until after you've rendered the RenderTargetBitmap. | [
-0.01241257879883051,
-0.38800516724586487,
0.21406476199626923,
0.07593676447868347,
-0.13106390833854675,
-0.1897856742143631,
0.2867257297039032,
-0.010299294255673885,
0.07261273264884949,
-0.782845139503479,
-0.23767946660518646,
0.673656165599823,
-0.09560876339673996,
0.165864080190... | |
I can't seem to compile ironruby in ruby 1.8.7. I always get this error:
*no such file to load -- windows/path*
Does this mean that ironruby is not compatible with ruby 1.8.7?
It looks like the gem windows-pr is required before the pathname2 stuff succeeds. I did a `gem install windows-pr` in my Ruby 1.8.7 install an... | [
0.18253213167190552,
0.30307599902153015,
0.2933700680732727,
-0.24013806879520416,
-0.08534436672925949,
-0.14075867831707,
0.8242255449295044,
-0.2927272319793701,
-0.13358691334724426,
-0.5812153220176697,
0.0852302685379982,
0.8756788372993469,
-0.10646334290504456,
0.09192882478237152... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.