text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
There is small system, where a database table as queue on MSSQL 2005. Several applications are writing to this table, and one application is reading and processing in a FIFO manner.
I have to make it a little bit more advanced to be able to create a distributed system, where several processing application can run. The... | [
-0.2931782901287079,
-0.15147751569747925,
0.4282069206237793,
0.07085893303155899,
0.018715329468250275,
-0.01140179205685854,
-0.12379667162895203,
0.06672516465187073,
-0.5317636132240295,
-0.4399806559085846,
0.2772427201271057,
0.32417652010917664,
-0.5950207710266113,
0.0666685625910... | |
update the table with it's idetifyer, and then asks for the updated records.
So something like this:
```
start transaction
update top(10) queue set processing = 'myid' where processing is null
select * from processing where processing = 'myid'
end transaction
```
After processing, it sets the processing column of t... | [
-0.09300054609775543,
-0.22775068879127502,
0.5391190052032471,
-0.17376312613487244,
-0.058117564767599106,
-0.07412169873714447,
-0.17514966428279877,
-0.18455861508846283,
-0.5061432123184204,
-0.7515061497688293,
-0.022887419909238815,
0.42032480239868164,
-0.5254725217819214,
-0.02514... | |
to the whole table. So the second application cannot access it, until the first application does not release the transaction. How big can be the selection (top x) in order to not lock the whole table, only create row locks?
This will work, but you'll probably find you'll run into blocking or deadlocks where multiple pr... | [
0.05542751029133797,
0.014762314967811108,
0.42856717109680176,
0.11862866580486298,
0.061053257435560226,
-0.14855267107486725,
-0.14001882076263428,
-0.29591721296310425,
-0.5744179487228394,
-0.4082808494567871,
-0.007922979071736336,
0.31333810091018677,
-0.43622884154319763,
0.3090518... | |
I want to scale an image in C# with quality level as good as Photoshop does. Is there any C# image processing library available to do this thing?
Here's a nicely commented Image Manipulation helper class that you can look at and use. I wrote it as an example of how to perform certain image manipulation tasks in C#. You... | [
0.3135915696620941,
-0.04383036494255066,
0.5793015956878662,
0.15089872479438782,
-0.1696590930223465,
0.2642005681991577,
-0.22052201628684998,
-0.16735641658306122,
-0.2525496482849121,
-0.8346022367477417,
0.2993464171886444,
0.7150245308876038,
0.146563321352005,
0.006285203620791435,... | |
and the ability to save a JPEG.
/// </summary>
public static class ImageUtilities
{
/// <summary>
/// A quick lookup for getting image encoders
/// </summary>
private static Dictionary<string, ImageCodecInfo> encoders = null;
/// <summary>
/// A lock to p... | [
0.0696214959025383,
-0.10569927096366882,
0.263319194316864,
0.3284972310066223,
-0.15280722081661224,
0.07698744535446167,
-0.35589632391929626,
0.0032251428347080946,
-0.16597966849803925,
-0.7341134548187256,
-0.2516980767250061,
0.5523813366889954,
-0.46556374430656433,
-0.144053801894... | |
/// </summary>
private static object encodersLock = new object();
/// <summary>
/// A quick lookup for getting image encoders
/// </summary>
public static Dictionary<string, ImageCodecInfo> Encoders
{
//get accessor that creates the dictionary on demand | [
0.07611396908760071,
-0.02779538556933403,
0.5506951808929443,
0.035791706293821335,
-0.03594774380326271,
0.34294945001602173,
-0.14191775023937225,
-0.08513444662094116,
-0.1300143450498581,
-0.8146454691886902,
-0.22235940396785736,
0.5888689756393433,
-0.5111005902290344,
-0.0593614913... | |
get
{
//if the quick lookup isn't initialised, initialise it
if (encoders == null)
{
//protect against concurrency issues | [
-0.22902533411979675,
-0.20728294551372528,
-0.15760940313339233,
0.0514628030359745,
0.18516620993614197,
0.014483792707324028,
0.3975732624530792,
-0.19802244007587433,
-0.15145716071128845,
-0.3970069885253906,
-0.5199958086013794,
0.2412218600511551,
-0.4220292866230011,
-0.24147166311... | |
lock (encodersLock)
{
//check again, we might not have been the first person to acquire the lock (see the double checked lock pattern) | [
0.07334253191947937,
-0.08241058140993118,
0.2170412838459015,
0.24437132477760315,
0.5862476229667664,
-0.1317056119441986,
0.3098756968975067,
-0.32601284980773926,
-0.2009231150150299,
-0.045451581478118896,
-0.20681729912757874,
0.316994845867157,
-0.4309951663017273,
0.021360930055379... | |
if (encoders == null)
{
encoders = new Dictionary<string, ImageCodecInfo>();
//get all the codecs | [
-0.01085470151156187,
-0.031619634479284286,
0.43607550859451294,
-0.243665412068367,
0.08434820175170898,
0.0935974046587944,
0.009419322945177555,
-0.31621384620666504,
0.12825797498226166,
-0.77631676197052,
-0.26339298486709595,
0.48578941822052,
-0.3981282413005829,
-0.145487949252128... | |
foreach (ImageCodecInfo codec in ImageCodecInfo.GetImageEncoders())
{
//add each codec to the quick lookup | [
-0.169967919588089,
0.04360615834593773,
0.2722404897212982,
-0.11144362390041351,
0.14315302670001984,
0.13495682179927826,
0.07607973366975784,
-0.2678113281726837,
-0.06575208157300949,
-0.9204162955284119,
-0.1368323415517807,
0.41996264457702637,
-0.259890079498291,
-0.328911185264587... | |
encoders.Add(codec.MimeType.ToLower(), codec);
}
} | [
-0.09672187268733978,
0.17837737500667572,
-0.09731251746416092,
-0.13711479306221008,
0.4357154667377472,
0.2302021086215973,
0.1416628658771515,
-0.30025410652160645,
-0.03191864863038063,
-0.49409371614456177,
-0.3323395252227783,
0.45578745007514954,
-0.5493501424789429,
0.123213604092... | |
}
}
//return the lookup
return encoders;
}
}
/// <summary>
/// Resize the image to the specified width and height. | [
0.1512170284986496,
-0.04933344945311546,
0.47122207283973694,
-0.08164753764867783,
0.10343791544437408,
0.3027363717556,
-0.09732108563184738,
-0.2530767023563385,
-0.07869673520326614,
-0.6080453991889954,
-0.3325185477733612,
0.6101053953170776,
-0.008462135680019855,
-0.20270724594593... | |
/// </summary>
/// <param name="image">The image to resize.</param>
/// <param name="width">The width to resize to.</param>
/// <param name="height">The height to resize to.</param>
/// <returns>The resized image.</returns>
public static System.Drawing.Bitmap ResizeImage(System.D... | [
0.041823435574769974,
-0.4004789888858795,
0.7848426699638367,
0.09647490829229355,
-0.2736407220363617,
0.6225288510322571,
-0.22589775919914246,
-0.8052815794944763,
-0.4939131736755371,
-0.5154979825019836,
-0.20230509340763092,
0.08445459604263306,
-0.07592780888080597,
-0.004408742301... | |
Bitmap result = new Bitmap(width, height);
//set the resolutions the same to avoid cropping due to resolution differences
result.SetResolution(image.HorizontalResolution, image.VerticalResolution);
//use a graphics object to draw the resized image into the bitmap
using (... | [
-0.0418209470808506,
-0.5090050101280212,
1.031614065170288,
0.10652857273817062,
-0.07427909225225449,
0.3286140263080597,
-0.001378131564706564,
-0.6378515362739563,
-0.29014426469802856,
-0.7426860928535461,
-0.29154863953590393,
0.4746711254119873,
-0.13521386682987213,
-0.027789821848... | |
{
//set the resize quality modes to high quality
graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphics.SmoothingMode = Sys... | [
-0.40082088112831116,
-0.31560218334198,
0.569766640663147,
0.07964590191841125,
0.04194291681051254,
0.43413734436035156,
0.16943751275539398,
-0.29911401867866516,
-0.1415686309337616,
-0.8020979762077332,
-0.3344252109527588,
0.7873173952102661,
-0.23483231663703918,
-0.1244810819625854... | |
target bitmap
graphics.DrawImage(image, 0, 0, result.Width, result.Height);
}
//return the resulting bitmap
return result;
}
/// <summary>
/// Saves an image as a jpeg image, with the given quality | [
0.25069254636764526,
-0.266701340675354,
0.43087121844291687,
0.07776530086994171,
-0.2974663972854614,
0.26968079805374146,
-0.1758243590593338,
-0.1427341252565384,
0.055305708199739456,
-0.7431879043579102,
-0.36410149931907654,
0.4073859751224518,
-0.17539921402931213,
-0.1367828398942... | |
/// </summary>
/// <param name="path">Path to which the image would be saved.</param>
/// <param name="quality">An integer from 0 to 100, with 100 being the
/// highest quality</param>
/// <exception cref="ArgumentOutOfRangeException">
/// An invalid value was entered for ima... | [
0.1304997354745865,
-0.04127238690853119,
0.4765559732913971,
0.3666372299194336,
-0.21251916885375977,
0.554766058921814,
0.043158430606126785,
-0.7164677381515503,
-0.22168302536010742,
-0.39721864461898804,
0.02676963433623314,
0.28386354446411133,
-0.019828470423817635,
-0.063539579510... | |
public static void SaveJpeg(string path, Image image, int quality)
{
//ensure the quality is within the correct range
if ((quality < 0) || (quality > 100))
{
//create the error message | [
0.18182142078876495,
-0.05145232379436493,
0.03650902956724167,
-0.0818127989768982,
0.33251267671585083,
0.1523493379354477,
0.42707839608192444,
0.14984069764614105,
0.19730322062969208,
-0.6759219765663147,
-0.33055564761161804,
0.6655005216598511,
-0.42592117190361023,
0.05017688870429... | |
string error = string.Format("Jpeg image quality must be between 0 and 100, with 100 being the highest quality. A value of {0} was specified.", quality);
//throw a helpful exception
throw new ArgumentOutOfRangeException(error);
}
//create an encoder parameter fo... | [
-0.0723564624786377,
0.1275589019060135,
0.14545007050037384,
0.07914309948682785,
-0.11207728087902069,
0.14055335521697998,
-0.004814452026039362,
-0.34499621391296387,
0.09085537493228912,
-0.28542861342430115,
-0.1315189152956009,
0.5536943078041077,
-0.31797805428504944,
0.02728264220... | |
EncoderParameter qualityParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, quality);
//get the jpeg codec
ImageCodecInfo jpegCodec = GetEncoderInfo("image/jpeg");
//create a collection of all parameters that we will pass to the encoder
EncoderParameters... | [
0.3708406984806061,
-0.024715090170502663,
0.8428353667259216,
0.08959364145994186,
-0.09008044004440308,
0.32421913743019104,
-0.12202522158622742,
-0.9524731040000916,
-0.09856622666120529,
-0.5582947731018066,
0.09476868808269501,
0.07938383519649506,
-0.4979056417942047,
-0.12365388870... | |
codec
encoderParams.Param[0] = qualityParam;
//save the image using the codec and the parameters
image.Save(path, jpegCodec, encoderParams);
}
/// <summary>
/// Returns the image codec with the given mime type
/// </summary> | [
0.2610984742641449,
-0.057104986160993576,
0.2885381877422333,
0.021782804280519485,
0.044516973197460175,
0.4917084276676178,
0.08300158381462097,
-0.41270706057548523,
-0.038428131490945816,
-0.7374231815338135,
-0.27512145042419434,
0.3655504286289215,
-0.3047666847705841,
-0.0066582136... | |
public static ImageCodecInfo GetEncoderInfo(string mimeType)
{
//do a case insensitive search for the mime type
string lookupKey = mimeType.ToLower();
//the codec to return, default to null
ImageCodecInfo foundCodec = null;
//if we have the encoder, ... | [
-0.02167610079050064,
-0.15322963893413544,
0.41485658288002014,
-0.1981559842824936,
0.3082161545753479,
0.06311152875423431,
0.22578120231628418,
-0.0058897375129163265,
0.07743099331855774,
-0.6314038634300232,
-0.20488905906677246,
0.5650415420532227,
-0.641930878162384,
0.043386947363... | |
it to return
if (Encoders.ContainsKey(lookupKey))
{
//pull the codec from the lookup
foundCodec = Encoders[lookupKey];
}
return foundCodec;
} | [
-0.443045973777771,
-0.047658637166023254,
0.1736794263124466,
-0.25585731863975525,
0.4742763042449951,
-0.004396840929985046,
0.06862431764602661,
-0.08489163219928741,
0.24010242521762848,
-0.38774192333221436,
-0.4494044780731201,
0.3887346684932709,
-0.3108890950679779,
0.124767303466... | |
}
}
```
---
Update
======
A few people have been asking in the comments for samples of how to consume the ImageUtilities class, so here you go.
```
//resize the image to the specified height and width
using (var resized = ImageUtilities.ResizeImage(image, 50, 100))
{
//save the resized image as a jpeg with a q... | [
0.30677908658981323,
-0.0871540755033493,
0.41981756687164307,
-0.06470757722854614,
0.2100456804037094,
-0.0142587311565876,
-0.053886204957962036,
-0.35252252221107483,
0.03487350046634674,
-0.762677788734436,
-0.2441672533750534,
0.7797882556915283,
-0.04697694629430771,
-0.089060775935... | |
I'm having difficulty parsing some JSON data returned from my server using jQuery.ajax()
To perform the AJAX I'm using:
```
$.ajax({
url: myUrl,
cache: false,
dataType: "json",
success: function(data){
...
},
error: function(e, xhr){
...
}
});
```
And if I return an array of items then it wo... | [
-0.35451826453208923,
0.25352948904037476,
0.1582036167383194,
0.09076139330863953,
-0.5000599026679993,
-0.04953562840819359,
0.2606215476989746,
-0.05516057461500168,
-0.11226358264684677,
-0.7433040142059326,
-0.22241222858428955,
0.7133491039276123,
-0.06163341552019119,
-0.07909521460... | |
xhr contains 'parsererror'. I've tried wrapping the JSON in parenthesis on the server before sending it down the wire, but it makes no difference. Yet if I paste the content into a string in Javascript and then use the eval() function, it evaluates it perfectly.
Any ideas what I'm doing wrong?
Anthony
Is your server ... | [
0.13590078055858612,
0.3687014579772949,
0.2509843111038208,
0.028271509334445,
-0.1876632124185562,
0.12733878195285797,
0.29795822501182556,
-0.07065169513225555,
-0.12354110181331635,
-0.16779093444347382,
-0.0848936140537262,
0.4614582061767578,
-0.3063213527202606,
-0.1763493865728378... | |
How can i, in a bash script, execute a command when the user stops the script (with ctrl - c)?
Currently, i have this:
```
afplay file.mp3
while true:
do osascript -e "set volume 10"
end
```
But i would like it to execute `killall afplay` when the user is finished with it, regardless if it is command-c or another ... | [
0.4663617014884949,
0.28067803382873535,
0.34304702281951904,
-0.35255947709083557,
0.14879752695560455,
-0.3141172528266907,
0.3438740074634552,
-0.4285167157649994,
-0.26597219705581665,
-0.29375559091567993,
-0.030367400497198105,
1.1337615251541138,
-0.3675873875617981,
-0.088896185159... | |
> **Possible Duplicate:**
>
> [How to convert UNIX timestamp to DateTime and vice versa?](https://stackoverflow.com/questions/249760/how-to-convert-unix-timestamp-to-datetime-and-vice-versa)
I've got the following class:
```
[DataContractAttribute]
public class TestClass
{
[DataMemberAttribute]
public DateTime... | [
0.3212765157222748,
-0.057204801589250565,
0.6414139866828918,
-0.20443689823150635,
0.21252822875976562,
-0.14248153567314148,
0.039737384766340256,
-0.26585009694099426,
-0.032154880464076996,
-0.6218274831771851,
0.012783924117684364,
0.6337288022041321,
-0.022408796474337578,
0.1452249... | |
public (changing it to private causes an exception in the serialization process)
Finishing what you posted, AND making it private seemed to work fine for me.
```
[DataContract]
public class TestClass
{
private static readonly DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
[Ignor... | [
0.5119442939758301,
-0.3071402311325073,
0.4951133131980896,
-0.183003768324852,
0.11817839741706848,
0.14654934406280518,
0.340641587972641,
-0.01693468913435936,
-0.13716739416122437,
-0.43515339493751526,
-0.14064864814281464,
0.5474476218223572,
-0.2697991728782654,
0.07376721501350403... | |
unixEpoch.AddSeconds(Convert.ToInt32(value)); }
}
}
``` | [
-0.118879035115242,
-0.11313968151807785,
0.22871240973472595,
-0.017076551914215088,
0.022890474647283554,
-0.12376830726861954,
0.01761009357869625,
0.302455872297287,
-0.17948342859745026,
-0.6205965876579285,
-0.05117327719926834,
0.8349285125732422,
-0.31677359342575073,
0.17745439708... | |
How can I customise the Site Actions menu to remove or rename 'standard' menu items? Where are the site actions menu items defined?
The site actions menu is defined in the Siteaction.xml in Template\layouts\editingMenu under the 12 hive. The following link shows how to manually remove items.
[Customize Site Actions Me... | [
0.13490286469459534,
-0.1338973194360733,
0.4048101007938385,
-0.20133887231349945,
0.18557856976985931,
0.11079727858304977,
0.41621342301368713,
-0.2652031481266022,
-0.5353362560272217,
-0.5707743167877197,
0.11578493565320969,
0.49276843667030334,
-0.24534030258655548,
-0.0070441109128... | |
I am writing a Jython script to sort a list of URLs.
I have a list that looks like this:
<http://www.domain.com/folder1/folder2/|,1>
<http://www.domain.com/folder1/|,1>
<http://www.domain.com/folder1/folder2/folder3/|,1>
<http://www.domain.com/folder1/|,1>
<http://www.domain.com/folder1/folder2/|,1>
<h... | [
0.38178831338882446,
0.3250376582145691,
0.6085444688796997,
0.124691903591156,
-0.4534248411655426,
-0.15840640664100647,
0.21770267188549042,
0.008773612789809704,
-0.07663237303495407,
-0.8929545879364014,
0.028170490637421608,
0.22946324944496155,
0.25216567516326904,
-0.03080686181783... | |
sort function:
```
urls.sort(lambda a, b: cmp(len(a), len(b)))
```
For performance, some might prefer the decorate-sort-undecorate pattern:
```
urllengths= [(len(url), url) for url in urls]
urllengths.sort()
urls= [url for (l, url) in urllengths]
```
Or as a one-liner:
```
urls= zip(*sorted((len(url), url) for u... | [
-0.32477664947509766,
-0.1404636949300766,
0.5464767217636108,
-0.02067280001938343,
-0.14040128886699677,
0.12170617282390594,
0.1536925584077835,
0.04742351919412613,
-0.30312156677246094,
-0.4248528778553009,
-0.5224650502204895,
0.10201451927423477,
-0.24440650641918182,
0.266021192073... | |
There is this example code, but then it starts talking about millisecond / nanosecond problems.
The same question is on MSDN, *[Seconds since the Unix epoch in C#](https://learn.microsoft.com/archive/blogs/brada/seconds-since-the-unix-epoch-in-c)*.
This is what I've got so far:
```
public Double CreatedEpoch
{
get... | [
0.20975442230701447,
-0.21054989099502563,
0.5460276007652283,
-0.028309231624007225,
0.3043228089809418,
0.25704455375671387,
-0.32530003786087036,
0.05936627835035324,
-0.7778582572937012,
-0.5263017416000366,
-0.11519830673933029,
0.51268070936203,
-0.15559573471546173,
0.47457247972488... | |
UnixTimeStampToDateTime( double unixTimeStamp )
{
// Unix timestamp is seconds past epoch
DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
dateTime = dateTime.AddSeconds( unixTimeStamp ).ToLocalTime();
return dateTime;
}
```
Or, for Java (which is different because the times... | [
-0.15316523611545563,
-0.23573347926139832,
0.6423004865646362,
-0.2859741747379303,
0.28299829363822937,
0.09280487149953842,
0.18861661851406097,
0.08381945639848709,
-0.13800601661205292,
-0.5432103872299194,
-0.1545536071062088,
0.5070086121559143,
-0.143408864736557,
0.323771983385086... | |
I have a really simple search form with the following
* Label ("Search")
* Textbox (fixed width)
* Submit button
* "Advanced" link
Label, textbox and submit are all on one horizontal line and centered.
Now I would like my advanced link to be under the submit button.
Any ideas?
If I understand the question you want:
... | [
-0.07539443671703339,
0.23760077357292175,
0.7030855417251587,
0.05449419096112251,
-0.09054823964834213,
-0.003934643231332302,
0.0008896151557564735,
-0.25103962421417236,
-0.0010951568838208914,
-0.7096546292304993,
0.039114709943532944,
0.33501529693603516,
-0.11934614926576614,
0.0903... | |
Advanced
```
You'll have to add some more elements in to do that:
```
<div style="width: 300px; margin: auto; text-align: center;">
Search [xxxxxxxxxxxxxxx] [Submit]
<div style="text-align: right">Advanced</div>
</div>
``` | [
-0.7730270624160767,
-0.03694457933306694,
0.8268981575965881,
-0.08992712199687958,
-0.0444282591342926,
0.026668477803468704,
-0.2531467080116272,
-0.5629815459251404,
0.14839281141757965,
-0.6840512752532959,
-0.1800626963376999,
0.4307122826576233,
0.20812267065048218,
-0.2543786168098... | |
I'm at a client doing some quick fixes to their access application. It was a while I had a go with access, but I'm recovering quickly. However, I've discovered an interesting problem:
For some reports, I get a "Record is deleted" error. I've checked the reports, and it seems like there's a problem with one table. When... | [
0.09810353815555573,
0.30089500546455383,
0.35231709480285645,
0.19667334854602814,
0.2252665013074875,
0.18869034945964813,
0.19742777943611145,
0.3644614815711975,
-0.7237736582756042,
-0.6076955795288086,
0.11516927927732468,
0.26373422145843506,
-0.022434862330555916,
0.443858742713928... | |
a corruption in the db? How can I remove this record for good?
**Edit:** It's a MS2000-version
**Solution:** Simply compress/repair did not work. I converted the database to the 2003 file format instead, which did the trick. I've marked the first answer suggesting compress/repair, since it pointed me in the right dir... | [
0.14435486495494843,
0.35442793369293213,
0.13887745141983032,
0.26016905903816223,
0.00598573824390769,
0.007276083342730999,
0.3513026833534241,
0.07561032474040985,
-0.3250564932823181,
-0.6691539287567139,
0.21236515045166016,
0.7374886870384216,
-0.24057497084140778,
0.325054228305816... | |
separate tools - one for compact, one for repair - but they were accessed from a similar location. If they are separate on the version the client has, you need to run both.
This should be a non-destructive operation, but it would be best to test this on a copy of the MDB file (apologies for stating the obvious). | [
0.3495556712150574,
0.0031402623280882835,
0.03541608154773712,
-0.03358830511569977,
0.07346528023481369,
-0.1779595911502838,
-0.003933481872081757,
-0.43204882740974426,
-0.23561103641986847,
-0.5833864808082581,
0.032127365469932556,
0.7957970499992371,
-0.0964193269610405,
-0.13394019... | |
I'm currently using the ActiveRecord-based session store for my Rails app and I have a background process which clears out inactive sessions every 30 minutes.
I'd like to switch to Rails' new cookie-based session store but how do I set the expiry time of the session to 30 minutes, as opposed to the default 'at end of ... | [
0.3604254722595215,
-0.04334766045212746,
0.16374872624874115,
-0.06046561151742935,
0.16699056327342987,
-0.29731521010398865,
0.790338397026062,
0.062111638486385345,
-0.41647931933403015,
-0.5213962197303772,
-0.05106683820486069,
0.5859392285346985,
-0.0724058598279953,
0.0092787770554... | |
of:
```
config.action_controller.session = {
:key => 'whatever',
:secret => 'nottellingyou',
:expire_after => 30.minutes
}
```
Check out [lib/action\_controller/session/cookie\_store.rb#114](http://github.com/rails/rails/blob/2-3-stable/actionpack/lib/action_controller/session/cookie_store.rb#L1... | [
-0.23918159306049347,
-0.4959239959716797,
0.2835075259208679,
-0.22977246344089508,
0.0876547172665596,
-0.07474503666162491,
0.620893120765686,
-0.2598716914653778,
-0.6837999224662781,
-0.3918403089046478,
-0.367482453584671,
0.6468772292137146,
-0.26626864075660706,
0.02966749481856823... | |
I am wondering how to use NUnit correctly. First, I created a separate test project that uses my main project as reference. But in that case, I am not able to test private methods. My guess was that I need to include my test code into my main code?! - That doesn't seem to be the correct way to do it. (I dislike the ide... | [
0.4850209355354309,
-0.07749290019273758,
-0.3226514756679535,
0.36459818482398987,
-0.5111910700798035,
0.028306465595960617,
0.3759872019290924,
-0.04195917025208473,
0.18330444395542145,
-0.4348757863044739,
0.09096496552228928,
0.3036431074142456,
0.12897659838199615,
0.045847672969102... | |
correct from the client's point of view.
So, NUnit does not provide any mechanism for testing non-public members. | [
0.34940123558044434,
-0.07602830976247787,
-0.1447032243013382,
0.2429792732000351,
-0.14704972505569458,
-0.5025538802146912,
0.5922223925590515,
-0.05790218338370323,
-0.03858458623290062,
-0.10927706956863403,
-0.030729874968528748,
0.42336979508399963,
0.0010982012609019876,
-0.1908623... | |
I'd like to have a page in php that normally displays information based on the GET request sent to it. However, I'd like for it to also be able to process certain POST requests. So, how can I tell if any data was sent by POST so I can act on it?
Use `$_SERVER['REQUEST_METHOD']` to determine whether your page was access... | [
0.4116017818450928,
-0.07821282744407654,
0.1602877974510193,
0.32511478662490845,
-0.24201859533786774,
-0.22142450511455536,
0.013497751206159592,
-0.07253506034612656,
-0.22581550478935242,
-0.6149810552597046,
0.25364914536476135,
0.2743934392929077,
0.05037450045347214,
0.207228228449... | |
I'm currently looking into options for creating a client API for a RESTfull application. Up until now we have had WCF services to allow all application to connect to the Business Layer and we're growing dissatisfied with it.
We already have most of the infrastructure in place for the web (html and json requests) but w... | [
0.5026527643203735,
-0.06937839835882187,
0.5492548942565918,
-0.1186080053448677,
-0.13236410915851593,
-0.1787978708744049,
0.04734340310096741,
-0.21527503430843353,
-0.15256236493587494,
-0.8263400793075562,
0.0007877210737206042,
0.4187602698802948,
-0.33848318457603455,
0.24032871425... | |
and use it to check javascript urls.
I would like to know what others have used, what worked and what didn't.
A good rest client API is a set of wrappers around curl, wget, or your language specific HTTP libraries. You might need some extra methods or functions to deal with the specifics of your application as well (i... | [
0.4104157090187073,
-0.02308567985892296,
0.3924309313297272,
0.03877904638648033,
0.06723620742559433,
-0.15461227297782898,
-0.0787397027015686,
0.06197882071137428,
-0.004515987355262041,
-0.5773820877075195,
-0.051228463649749756,
0.5926096439361572,
-0.19009184837341309,
-0.2442145347... | |
The `java.net.InetAddress.GetByName(String host)` method can only return `A` records so to lookup other record types I need to be able to send DNS queries using the `dnsjava` library.
However that normally relies on being able to parse `/etc/resolv.conf` or similar to find the DNS server addresses and that doesn't wor... | [
0.1471724808216095,
0.012067043222486973,
0.24173638224601746,
-0.1546114683151245,
-0.1119784489274025,
-0.14175322651863098,
0.4044337868690491,
-0.14264540374279022,
-0.22608329355716705,
-0.9218244552612305,
-0.12525634467601776,
0.721345841884613,
-0.25301775336265564,
0.2549338638782... | |
- can't you just do the DNS accesses using raw sockets (either TCP or UDP)? After a quick look at the dnsjava doco it seems to provide low level DNS support to assist with this.
The other possible direction is, starting with dnsjava, to remove the dependence on `/etc/resolv.conf`. I would think about using getprop in ... | [
0.379083514213562,
-0.30848264694213867,
0.354535847902298,
0.20083175599575043,
0.06834635883569717,
-0.3316936492919922,
0.024012751877307892,
0.022035177797079086,
-0.26364144682884216,
-0.6264805197715759,
-0.49254265427589417,
0.7259096503257751,
-0.22458462417125702,
0.08667921274900... | |
in once the JVM is going. Surely creating a file that dnsjava can use directly should be doable.
---
Edit - android.net
------------------
It looks like `android.net.ConnectivityManager` will deliver you an array of NetworkInfo's using `getAllNetworkInfo()`. Then use `android.net.NetworkUtils.runDhcp()` to get a **D... | [
0.3807722330093384,
-0.2594771385192871,
0.6267695426940918,
0.09557235240936279,
-0.14083366096019745,
-0.44153064489364624,
0.1117701604962349,
0.03415517508983612,
-0.1711662858724594,
-1.0948365926742554,
-0.2396150529384613,
0.5609416365623474,
0.0003472325624898076,
0.279686033725738... | |
How can I restart(recycle) IIS Application Pool from C# (.net 2)?
Appreciate if you post sample code?
If you're on **IIS7** then this will do it if it is stopped. I assume you can adjust for restarting without having to be shown.
```
// Gets the application pool collection from the server.
[ModuleServiceMethod(PassTh... | [
0.08486723154783249,
-0.14112961292266846,
0.36153095960617065,
-0.11816910654306412,
0.09871596843004227,
-0.13364270329475403,
0.3374061584472656,
-0.5804286599159241,
-0.49969592690467834,
-0.6678443551063538,
-0.1032007709145546,
0.6056843400001526,
-0.311487078666687,
0.04107026010751... | |
PropertyBag applicationPoolBag = new PropertyBag();
applicationPoolBag[ServerManagerDemoGlobals.ApplicationPoolArray] = applicationPool;
arrayOfApplicationBags.Add(applicationPoolBag);
// If the applicationPool is stopped, restart it.
if (applicationPool.State == ObjectState.Stopped)
... | [
-0.3441731333732605,
-0.356875479221344,
0.8099941611289978,
-0.07353924959897995,
0.17164871096611023,
0.11556065082550049,
0.3801085948944092,
-0.21100954711437225,
-0.5818662047386169,
-0.5262080430984497,
-0.27476072311401367,
0.5039976239204407,
-0.42822059988975525,
0.249151647090911... | |
serverManager.CommitChanges();
return arrayOfApplicationBags;
}
```
If you're on **IIS6** I'm not so sure, but you could try getting the web.config and editing the modified date or something. Once an edit is made to the web.config then the application will restart. | [
0.29878684878349304,
-0.2496301233768463,
0.42817819118499756,
-0.04185580089688301,
0.050530415028333664,
-0.4575502276420593,
0.3817025125026703,
0.23103268444538116,
-0.3074004650115967,
-0.8539924621582031,
0.04629218578338623,
0.6204968690872192,
-0.18846330046653748,
0.25163909792900... | |
I have written a web app in PHP which makes use of Ajax requests (made using YUI.util.Connect.asyncRequest).
Most of the time, this works fine. The request is sent with an **X-Requested-With** value of **XMLHttpRequest**. My PHP controller code uses apache\_request\_headers() to check whether an incoming request is Aj... | [
0.016241395846009254,
0.16004085540771484,
0.3527885675430298,
0.013761747628450394,
-0.3731776475906372,
-0.18926073610782623,
0.1727120578289032,
-0.03075655922293663,
-0.032406702637672424,
-0.7994354367256165,
0.11212296038866043,
0.45478713512420654,
-0.13441920280456543,
0.0802779495... | |
as follows (note the lack of X-
```
'Host' => string 'peterh.labs.example.com' (length=26)
'User-Agent' => string 'Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3' (length=105)
'Accept' => string 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'... | [
-0.08322971314191818,
0.44307878613471985,
0.5611114501953125,
-0.025644538924098015,
0.05672850087285042,
0.0676250010728836,
0.5476943850517273,
-0.45348191261291504,
-0.17997553944587708,
-0.5701361298561096,
-0.514475405216217,
0.5343620777130127,
-0.44515126943588257,
0.27033305168151... | |
text/html,application/xhtml+xml,application/xml;q=0.9,**;q=0.8
Accept-Language en-gb,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
X-Requested-With XMLHttpRequest
Referer http://peterh.labs.example.com/qmail/
Cookie ... | [
0.337411493062973,
0.26227903366088867,
0.5434151291847229,
0.05171116814017296,
0.2617088854312897,
-0.09268850088119507,
0.6143556237220764,
-0.09328345209360123,
0.06476851552724838,
-0.5421144366264343,
-0.3029823899269104,
0.7285323739051819,
-0.2542407214641571,
0.030306046828627586,... | |
sent by a client (and it doesn't matter how is the client) will arrive to the $*SERVER array.
The key of that header will be with HTTP* prefix, all letters capital and dash is converted to underscore (\_)
in your case you can find your necessary value in:
$\_SERVER['HTTP\_X\_REQUESTED\_WITH'] = 'XMLHttpRequest' | [
-0.005861076060682535,
-0.2868310213088989,
0.8193727135658264,
0.15499573945999146,
-0.2098071426153183,
0.015122093260288239,
-0.010326395742595196,
-0.07356037944555283,
-0.017466427758336067,
-0.596824586391449,
-0.3886999189853668,
0.12096161395311356,
-0.1550542563199997,
0.202376767... | |
In the below code snippet can i replace char \* to const char \* and remove the strdup() function call and directly take the optarg value set by getopt()? I am advised to use const char \* to skip the strdup function usage. Appreciate the help in advance.
```
/* Code Snippet */
char *dir = NULL;
char *bld = NULL;
int... | [
0.14517317712306976,
-0.2752388119697571,
0.580269992351532,
-0.3278125524520874,
0.19810490310192108,
0.41366997361183167,
0.0674867108464241,
-0.2817942202091217,
-0.2112732231616974,
-0.532157301902771,
-0.3424665331840515,
0.6872609257698059,
-0.4185886085033417,
0.02472078427672386,
... | |
case 'b': //Build parameter
bld = strdup( optarg );
if (bld == NULL) { /*Error*/ }
...other code...
}
}
```
I really don't understand the need for doing so.
Edit: Thanks for the answers. It was really helpful. I modified the code to const char \* and skipped the strdup call.
Thanks,
Liju
You could try and... | [
0.37582749128341675,
-0.27429530024528503,
0.22188055515289307,
-0.2833136022090912,
-0.10753387212753296,
0.14764082431793213,
0.2591312527656555,
-0.7035748362541199,
-0.02692897990345955,
-0.7975959777832031,
0.0592130608856678,
0.6018460988998413,
-0.5608917474746704,
-0.39394065737724... | |
{ new LineSegment(new Point(10, 20), true), new LineSegment(new Point(20, 20), true) }, true));
ScaleTransform transform = new ScaleTransform(2, 2);
PathGeometry geometryTransformed = Geometry.Combine(geometry, geometry, GeometryCombineMode.Intersect, transform);
``` | [
-0.0005684702191501856,
-0.6668257117271423,
0.8754280209541321,
0.03784047067165375,
0.08765573799610138,
0.2808171510696411,
0.247794046998024,
-0.6215846538543701,
-0.10125664621591568,
-1.0276790857315063,
-0.1764705926179886,
0.4808121919631958,
-0.04941931366920471,
0.242220073938369... | |
I am trying to read a custom (non-standard) CSS property, set in a stylesheet (not the inline style attribute) and get its value. Take this CSS for example:
```
#someElement {
foo: 'bar';
}
```
I have managed to get its value with the currentStyle property in IE7:
```
var element = document.getElementById('someEl... | [
0.3369235098361969,
0.08738984912633896,
0.40317481756210327,
-0.3230630159378052,
-0.03376760706305504,
-0.24662695825099945,
0.42056894302368164,
-0.15648669004440308,
-0.1107412725687027,
-0.7321383953094482,
-0.16901171207427979,
0.47808197140693665,
-0.3950468599796295,
-0.13378283381... | |
the correct syntax. A better property name would be "-myNameSpace-foo" or something.)*
Firefox does not carry over tags, attributes or CSS styles it does not understand from the code to the DOM. That is by design. Javascript only has access to the DOM, not the code. So no, there is no way to access a property from java... | [
0.20002298057079315,
0.42613929510116577,
0.4751506745815277,
-0.22664658725261688,
-0.043488502502441406,
-0.3993591070175171,
0.47464874386787415,
-0.01357465423643589,
-0.06405245512723923,
-0.6872236132621765,
-0.22378458082675934,
0.5771926045417786,
-0.2595124840736389,
-0.0049788798... | |
Can someone define what exactly 'POCO' means? I am encountering the term more and more often, and I'm wondering if it is only about plain classes or it means something more?
"Plain Old C# Object"
Just a normal class, no attributes describing infrastructure concerns or other responsibilities that your domain objects sh... | [
0.12284447997808456,
0.16823941469192505,
-0.042429521679878235,
0.5277554392814636,
0.16149282455444336,
-0.35728719830513,
-0.23865747451782227,
0.418507844209671,
-0.3552042841911316,
-0.21312668919563293,
-0.45030316710472107,
0.3914561867713928,
-0.10944658517837524,
0.094042725861072... | |
special types for their properties.
See below for an example of each.
Example of a POCO:
```
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
```
Example of something that isn’t a POCO:
```
public class PersonComponent : System.ComponentModel.Component
{
[Designer... | [
-0.16770049929618835,
-0.36035236716270447,
0.011996956542134285,
0.09353214502334595,
0.120109423995018,
0.07977847009897232,
0.011788208968937397,
-0.0836576372385025,
-0.34027722477912903,
-0.6114950776100159,
-0.35879266262054443,
0.4055999219417572,
-0.08555736392736435,
0.41755789518... | |
but one is *not* just a plain old object anymore. | [
0.08621232211589813,
0.15826241672039032,
-0.30805569887161255,
0.17235726118087769,
-0.21183793246746063,
0.043721262365579605,
0.04291537031531334,
0.11774123460054398,
-0.30369120836257935,
-0.5846294164657593,
-0.1707039624452591,
-0.015928160399198532,
-0.11862220615148544,
0.36471164... | |
I have been hearing a lot about Ruby and possibly even Javascript being "true" object oriented languages as opposed to C++ and C# which are class oriented (or template based) languages. What is meant by true OO and what are the advantages of this over the class/template approach?
It's a subjective term used to promote ... | [
0.3985690176486969,
0.1015125960111618,
-0.19315528869628906,
0.1934392899274826,
-0.1972668170928955,
-0.21437382698059082,
0.17118503153324127,
0.359672874212265,
-0.28841838240623474,
-0.32528194785118103,
-0.32458779215812683,
0.5388842225074768,
-0.23129689693450928,
-0.12696555256843... | |
Ruby treats everything as an object, so you could write `1.to_s`, instead of something like `str(1)` or `String.valueOf(1)`. This is because Ruby makes no distinction between value and reference variables. In Javascript there are no classes and you just create extensible objects that could be cloned for reuse, this sty... | [
0.359714537858963,
0.08685147017240524,
-0.193145751953125,
0.08437836170196533,
-0.5440508127212524,
-0.28614604473114014,
0.4702511131763458,
0.10732130706310272,
-0.2222393900156021,
-0.3380606472492218,
-0.004314891062676907,
0.27581721544265747,
-0.7520200610160828,
0.0584936216473579... | |
to whether the language puts more emphasis on objects as opposed to other language elements like functions, templates, etc. [Wikipedia's article on SmallTalk](http://en.wikipedia.org/wiki/Smalltalk) calls it a 'pure' object oriented language, and the description applies to Ruby as well:
> Smalltalk is a 'pure' OO lang... | [
0.019019490107893944,
0.2341122031211853,
-0.13608087599277496,
-0.0667228177189827,
-0.04601221904158592,
0.10940779745578766,
0.16062624752521515,
-0.024912433698773384,
-0.0845409408211708,
-0.1763913333415985,
-0.38924679160118103,
0.35715988278388977,
-0.5664656758308411,
-0.367263674... | |
them are invoked by
> sending messages. A programmer can
> change the classes that implement
> primitive values, so that new behavior
> can be defined for their
> instances--for example, to implement
> new control structures--or even so
> that their existing behavior will be
> changed. This fact is summarised i... | [
0.0940941646695137,
0.0897713378071785,
0.09611716866493225,
0.09254181385040283,
-0.21263183653354645,
-0.075759157538414,
0.4959743320941925,
-0.017895439639687538,
-0.3844452202320099,
-0.43925297260284424,
-0.39678147435188293,
0.6063820123672485,
-0.6387264728546143,
-0.10104622691869... | |
I have a small project that require a storage (I choose SQLite) and I got good result with the [ADO DLL for .Net for Sqlite](http://sqlite.phxsoftware.com/).
After the Install, I noticed that it contain a SQLLinq.dll. Before investigating too much effort, and because I haven't see any good example on the web, I would ... | [
0.3242121934890747,
0.12095325440168381,
0.32483145594596863,
0.0825263038277626,
-0.0322522334754467,
-0.23430109024047852,
-0.05880248546600342,
0.2381385713815689,
-0.23890064656734467,
-0.5639461278915405,
0.3623141944408417,
0.3669385015964508,
-0.1383037120103836,
0.34911277890205383... | |
be a great opportunity to try,
I've recently discovered [DBLinq](http://code.google.com/p/dblinq2007/), which supports SQLite among other DB: | [
0.23073093593120575,
-0.02771066315472126,
0.3864729106426239,
0.09766355156898499,
-0.2726375162601471,
-0.2511478662490845,
0.06640036404132843,
0.24627497792243958,
-0.10816063731908798,
-0.5249056816101074,
0.03167357295751572,
0.35979995131492615,
-0.16157053411006927,
-0.059529814869... | |
I have the following legacy code:
```
public class MyLegacyClass
{
private static final String jndiName = "java:comp/env/jdbc/LegacyDataSource"
public static SomeLegacyClass doSomeLegacyStuff(SomeOtherLegacyClass legacyObj)
{
// do stuff using jndiName
}
}
```
This class is working in a J2EE-... | [
0.28664466738700867,
-0.16260766983032227,
0.0526125468313694,
-0.1398172378540039,
0.1752976030111313,
-0.2460540533065796,
0.33831262588500977,
-0.22936701774597168,
-0.06907990574836731,
-0.70852130651474,
0.052757199853658676,
0.5882044434547424,
0.013134709559381008,
-0.00187805248424... | |
that the public API of your original question remains unchanged.)
```
public class MyLegacyClass {
private static Strategy strategy = new JNDIStrategy();
public static SomeLegacyClass doSomeLegacyStuff(SomeOtherLegacyClass legacyObj) {
// legacy logic
SomeLegacyClass result = strategy.doSomeStuff(legacyO... | [
0.29025837779045105,
-0.39402449131011963,
0.43497398495674133,
-0.16731491684913635,
0.4003330171108246,
-0.0015447657788172364,
0.29056158661842346,
-0.48347973823547363,
-0.09945516288280487,
-0.7598050236701965,
-0.4672635793685913,
0.8238707184791565,
-0.054439302533864975,
0.04314511... | |
}
}
```
...and JUnit test. I'm not a big fan of having to do this setup/teardown maintenance, but that's an unfortunate side effect of having an API based on static methods (or Singletons for that matter). What I *do* like about this test is it does not use JNDI - that's good because (a) it'll run fast, and (b) the u... | [
0.28905752301216125,
0.07335551083087921,
-0.09271254390478134,
0.11348425596952438,
0.10350820422172546,
-0.3093207776546478,
0.397879421710968,
-0.10290947556495667,
0.28363925218582153,
-0.6533955931663513,
-0.14917245507240295,
0.9032741189002991,
-0.2640696167945862,
0.025723759084939... | |
MockStrategy mockStrategy = new MockStrategy();
protected void setUp() throws Exception {
MyLegacyClass.setStrategy(mockStrategy);
}
protected void tearDown() throws Exception {
// TODO, reset original strategy on MyLegacyClass...
}
public void testDoSomeLegacyStuff() {
MyLegacyClass.doSomeLega... | [
0.1950211077928543,
-0.03472088649868965,
0.20033927261829376,
0.025548744946718216,
0.03102710470557213,
0.3133750557899475,
0.5898820757865906,
-0.28567200899124146,
0.12376493215560913,
-0.6773867607116699,
-0.008466179482638836,
0.6918373703956604,
-0.185089111328125,
0.077115654945373... | |
// to help create mocks
}
}
}
``` | [
0.21817024052143097,
0.46333613991737366,
-0.10452624410390854,
-0.021157287061214447,
-0.12205906212329865,
-0.18023918569087982,
0.37609314918518066,
0.36529743671417236,
-0.03904647007584572,
-0.5002421140670776,
-0.1652088165283203,
0.37209051847457886,
-0.25915127992630005,
0.24454024... | |
I am updating a VBA program (excel). At startup the program checks if it can find a directory which is on the office file server using:
```
FileSystemObject.FolderExists("\\servername\path")
```
If this is not found the program switches to offline mode and saves its output to the local hard disk (for later transfer)... | [
0.45331117510795593,
0.12850463390350342,
0.8057184815406799,
-0.2452486902475357,
0.19669109582901,
-0.17751087248325348,
0.10484638810157776,
-0.14115913212299347,
-0.07558272033929825,
-0.8998197317123413,
-0.2592281401157379,
0.7634254097938538,
-0.16215571761131287,
0.1724397838115692... | |
(i.e. we are connected to some other LAN).
My Question(s):
1. is there a quicker/better way to check for the existence of a network path using VBA?
2. is there a way to have the user cancel the search done by FolderExists() when (s)he knows it cannot succeed because they're not in the office. I.e. is there some way t... | [
0.24848422408103943,
-0.06812267005443573,
0.35969918966293335,
0.3176630735397339,
0.455471009016037,
-0.32496440410614014,
0.21648399531841278,
-0.13596543669700623,
-0.41268953680992126,
-0.5452240705490112,
-0.21800090372562408,
0.4038768410682678,
-0.37858879566192627,
0.0124544370919... | |
in the first place.
**If you're on a domain:**
Check the LOGONSERVER environmental variable.
If there are two '\' symbols before the server name, it's connected to active directory and so you should do your check.
Otherwise, it isn't logged into the office network, so you can bypass the check.
**If you aren't on a ... | [
0.1845117211341858,
0.1002008393406868,
0.27296364307403564,
0.19458043575286865,
0.010846883989870548,
-0.1541413813829422,
0.27834057807922363,
0.09392557293176651,
-0.5807892680168152,
-0.9031016826629639,
-0.07706255465745926,
0.12668809294700623,
-0.36969834566116333,
0.09968703240156... | |
Forums](http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/9a509391-f4e2-4ea7-827a-3370aa203bfb/) both have some code samples for that, | [
0.15118981897830963,
0.06454131752252579,
0.13886843621730804,
0.28412511944770813,
-0.23849517107009888,
-0.11018676310777664,
0.24595072865486145,
0.11864843219518661,
-0.5849015116691589,
-0.49348846077919006,
0.16817894577980042,
0.40147918462753296,
0.05114163085818291,
-0.00660754647... | |
Is there a good way to determine if a person has a popup blocker enabled? I need to maintain a web application that unfortunately has tons of popups throughout it and I need to check if the user has popup blockers enabled.
The only way I've found to do this is to open a window from javascript, check to see if it's ope... | [
0.439213365316391,
0.20260414481163025,
0.15479107201099396,
0.028059525415301323,
-0.1841752529144287,
-0.2528180480003357,
0.5025397539138794,
0.3358015716075897,
-0.26916277408599854,
-0.7697344422340393,
-0.08696229755878448,
0.2511496841907501,
-0.311326801776886,
0.19345638155937195,... | |
away.
Are there any other non-obtrusive methods for accomplishing this?
Read [Detect a popup blocker using Javascript](http://www.visitor-stats.com/articles/detect-popup-blocker.php):
Basically you check if the 'window.open' method returns a handle to a newly-opened window.
Looks like this:
```
var mine = window.op... | [
0.031701359897851944,
0.08016961067914963,
0.4078066647052765,
-0.14560814201831818,
0.2582090198993683,
-0.08636967837810516,
0.22860246896743774,
0.06287980079650879,
-0.20122943818569183,
-0.45111674070358276,
-0.37518733739852905,
0.44202613830566406,
-0.4333604574203491,
0.14078032970... | |
I have a page with many forms on it. could be 1..200. None of these forms have buttons and they are built programatically. I am using jquery to submit all the forms that are checked.
```
function FakeName()
{
$("input:checked").parent("form").submit();
}
```
My forms look like:
```
... | [
0.5052192211151123,
0.22669020295143127,
0.7895752191543579,
-0.2934660315513611,
-0.07875986397266388,
0.11580140888690948,
0.2773609161376953,
-0.3526161313056946,
0.14436742663383484,
-0.9290693402290344,
0.06323011219501495,
0.2194981724023819,
-0.04983917623758316,
-0.0693266019225120... | |
<input type="hidden" name="FakeNum" value="<%= FakeNum%>"/>
<input type="hidden" name="FakeId" value="<%=FakeIdr%>"/>
<input type="hidden" name="FakeAmt" value="<%=FakeAmount%>"/>
<input type="hidden" name="FakeTrans" value="FakeTrans"/>
</form>
```
Note: ac... | [
0.2845723032951355,
-0.17430010437965393,
0.2362385243177414,
-0.41152727603912354,
0.05742443725466728,
0.23390202224254608,
0.5958483815193176,
-0.33701711893081665,
-0.3203985095024109,
-0.3165680468082428,
-0.17473256587982178,
0.6318484544754028,
-0.3538958728313446,
-0.26272407174110... | |
handle my own posting in processRow.
OnSubmit never gets called and therefore ProcessRow never gets called.
Obviously all the names of the functions and variables have been changed to protect their identity :D
How can I get a function in each form to fire when I call submit programmatically.
The `onsubmit` handler ... | [
0.44693416357040405,
0.011580247431993484,
0.2613721489906311,
0.015600180253386497,
-0.43757808208465576,
-0.141091987490654,
0.31951576471328735,
-0.16031751036643982,
-0.23013481497764587,
-0.47474271059036255,
0.050972312688827515,
0.5228837728500366,
-0.2628059983253479,
0.28792786598... | |
call.
You're allowed to have inputs outside of forms. One school of thought is that a `<form>` shouldn't be a `<form>` if it's not intended to be submitted to the server via HTML. | [
0.3733965754508972,
-0.09623721241950989,
0.3492347002029419,
0.0023643302265554667,
0.025966115295886993,
-0.2554249167442322,
-0.05265102908015251,
-0.08943179994821548,
0.006763961631804705,
-0.4105157256126404,
-0.26582202315330505,
0.4433126151561737,
-0.318006694316864,
-0.0424273312... | |
We have a git project which has quite a big history.
Specifically, early in the project there were quite a lot of binary resource files in the project, these have now been removed as they're effectively external resources.
However, the size of our repository is >200MB (the total checkout is currently ~20MB) due to ha... | [
0.31282225251197815,
0.16755130887031555,
0.03824394568800926,
0.21944400668144226,
0.19700628519058228,
-0.3575107157230377,
0.33939218521118164,
0.1783776879310608,
-0.24176838994026184,
-0.6968597769737244,
0.08136643469333649,
0.17942528426647186,
-0.11462824046611786,
0.48923382163047... | |
\ /
+-----+---+---+
```
1. Repository created
2. Large set of binary files added
3. Large set of binary files removed
4. New intended 'start' of repository
So effectively we want to lose the project history before a certain point. At this point there is only one branch, so there's no compli... | [
0.30061134696006775,
-0.013241940177977085,
0.07282504439353943,
0.19572120904922485,
0.1076899915933609,
0.03955146297812462,
0.16422738134860992,
-0.014949742704629898,
-0.26220354437828064,
-0.3049105405807495,
-0.310992568731308,
0.3342877924442291,
-0.2687968313694,
0.5460762977600098... | |
this possible, or are we doomed to have a bloated repository forever?
You can remove the binary bloat and keep the rest of your history. Git allows you to reorder and 'squash' prior commits, so you can combine just the commits that add and remove your big binary files. If the adds were all done in one commit and the re... | [
0.47292378544807434,
0.28300967812538147,
-0.0969102755188942,
0.21142807602882385,
0.14412647485733032,
0.003159814514219761,
0.28780272603034973,
0.04015626758337021,
-0.3595903813838959,
-0.6630094647407532,
-0.06537291407585144,
0.3221700191497803,
-0.22232948243618011,
0.3295657634735... | |
and note their SHA1s, say `2bcdef` and `3cdef3`.
Then to edit the repo's history, use `rebase -i` command with its interactive option, starting with the parent of the commit where you added your binaries. It will launch your $EDITOR and you'll see a list of commits starting with `2bcdef`:
```
$ git rebase -i 2bcdef^ ... | [
-0.09679411351680756,
-0.26307743787765503,
0.5140318274497986,
-0.1622801572084427,
-0.24329815804958344,
0.14111872017383575,
0.045757535845041275,
-0.21723271906375885,
-0.42497920989990234,
-0.583527147769928,
-0.2758202850818634,
0.49960362911224365,
-0.374458909034729,
-0.03226762264... | |
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
pick 2bcdef Add binary files and other edits
pick xxxxxx Another change
.
.
pick 3cdef3 Remove binary files; link to them as external resources
.
.
```
Insert `squash 3cdef3` as the second line and remove the line which says `pick 3cdef3` from t... | [
-0.09327195584774017,
-0.22586962580680847,
0.2914027273654938,
-0.13818898797035217,
-0.17507436871528625,
-0.04355323314666748,
0.18419088423252106,
-0.26656442880630493,
-0.41543132066726685,
-0.8474006056785583,
-0.21198533475399017,
0.5463051795959473,
-0.3954802453517914,
0.072479315... | |
it will reapply all of the subsequent commits in order, when you tell it to complete:
```
$ git rebase --continue
```
This will take a minute or two.
You now have a repo that no longer has the binaries coming or going. But they will still take up space because, by default, Git keeps changes around for 30 days bef... | [
0.39559218287467957,
0.012205162085592747,
0.7184925675392151,
-0.055759403854608536,
0.054435644298791885,
-0.1727524995803833,
0.2601454555988312,
-0.13033391535282135,
-0.4634799659252167,
-0.7283123135566711,
-0.46199244260787964,
0.4944680333137512,
-0.395121306180954,
0.2451974749565... | |
# lists all the blobs(files) that will be garbage-collected
$ git prune
$ git gc
```
Now you've removed the bloat but kept the rest of your history. | [
0.5436221361160278,
0.3663102090358734,
0.2358538955450058,
-0.06253252178430557,
0.028077539056539536,
-0.2660788595676422,
0.10886281728744507,
0.44855713844299316,
-0.42941734194755554,
-0.4131968021392822,
-0.2529844641685486,
0.33569279313087463,
-0.5264664888381958,
0.473049700260162... | |
I have problem in some JavaScript that I am writing where the Switch statement does not seem to be working as expected.
```
switch (msg.ResultType) {
case 0:
$('#txtConsole').val("Some Val 0");
break;
case 1:
$('#txtConsole').val("Some Val 1");
break;
case 2:
$('#txtConsole').text("Some Val 2... | [
0.04792003706097603,
0.045220475643873215,
0.28053298592567444,
-0.16867585480213165,
0.22573542594909668,
-0.18640397489070892,
0.5981122255325317,
-0.05310768634080887,
-0.1849471479654312,
-0.35485923290252686,
-0.4875597357749939,
0.7394822239875793,
-0.3248194754123688,
0.045533426105... | |
sure that a switch uses === for comparison in Actionscript and since JS and AS both follow the ECMAScript standard, I guess the same applies to JS. My guess is that the value is not actually a Number, but perhaps a String.
You could try to use parseInt(msg.ResultType) in the switch or use strings in the cases. | [
0.24799638986587524,
-0.16866084933280945,
0.1031482070684433,
0.019808802753686905,
-0.10929195582866669,
-0.24644097685813904,
0.008894234895706177,
-0.11319644004106522,
-0.1643923819065094,
-0.39343294501304626,
0.020108388736844063,
0.4660136103630066,
-0.2753170430660248,
-0.30075940... | |
What's the best way to parse fragments of HTML in C#?
For context, I've inherited an application that uses a great deal of composite controls, which is fine, but a good deal of the controls are rendered using a long sequence of literal controls, which is fairly terrifying. I'm trying to get the application into unit t... | [
0.29530149698257446,
0.29764842987060547,
-0.18043844401836395,
0.40344998240470886,
-0.18863920867443085,
-0.03725201264023781,
0.10298726707696915,
-0.02652568742632866,
-0.19367742538452148,
-0.5834699869155884,
-0.01063883863389492,
0.405975878238678,
-0.1860508769750595,
-0.1793549507... | |
A VBScript cannot edit the registry by default on Vista. How do I get elevation (even if the user has to do something when they run the script) so that the script can edit the registry?
The error is:
```
---------------------------
Windows Script Host
---------------------------
Script: blah blah blah.vbs
Line: 6
C... | [
0.04530824348330498,
0.23689274489879608,
0.75660640001297,
-0.17119649052619934,
-0.040426380932331085,
-0.3690027594566345,
0.536826491355896,
-0.2523704171180725,
-0.26470673084259033,
-0.6426886320114136,
-0.1734931766986847,
0.5782124996185303,
-0.3464118242263794,
0.16258969902992249... | |
do. | [
0.5471833348274231,
0.23601074516773224,
0.2636502981185913,
0.40719860792160034,
0.4796382486820221,
-0.4674076437950134,
-0.05121469125151634,
-0.11323505640029907,
0.4448205828666687,
-0.6628522872924805,
-0.4668425917625427,
0.2762487828731537,
-0.018516361713409424,
0.1640074402093887... | |
With the Ajax Control Toolkit, one can easily drag and drop all types of great extender onto controls, but they register a boatload of JavaScript to do it.
1. How do I control this?
2. If the `ScriptManager` is in the `MasterPage`, is there anyway to control the loading of a script on one page that isn't in another?
... | [
0.20278112590312958,
-0.22582049667835236,
0.23868216574192047,
0.15592075884342194,
-0.2896989583969116,
-0.6354005932807922,
0.03495383635163307,
-0.3215194046497345,
-0.06831929087638855,
-0.5623859763145447,
0.003917754627764225,
0.6217724084854126,
-0.356914758682251,
-0.3135297596454... | |
constants) which can be abused.
Keep in mind:
* Requires Website project for no-code, hands-off model generation (needs the BuildProvider).
**Linq To SQL**
Pros:
* Syntactic sugar in the IDE
* MS supported
* View the SQL to be executed in the IDE
* Allows different levels of fiddling in the model, from auto-genera... | [
0.08075876533985138,
-0.01119296159595251,
0.500686764717102,
0.3308897018432617,
-0.07437294721603394,
0.10108015686273575,
0.13593976199626923,
-0.30317574739456177,
-0.2233598530292511,
-0.3743034601211548,
0.08130568265914917,
0.7268633842468262,
-0.313899964094162,
0.16414140164852142... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.