text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I need to debug a web application that uses jQuery to do some fairly complex and messy [DOM](http://en.wikipedia.org/wiki/Document_Object_Model) manipulation. At one point, some of the events that were bound to particular elements, are not fired and simply stop working.
If I had a capability to edit the application so... | [
0.23294697701931,
0.3719676733016968,
0.13248755037784576,
0.048405688256025314,
0.1798165887594223,
-0.35109391808509827,
0.4361015260219574,
-0.3828241229057312,
0.09168054908514023,
-0.4214937090873718,
-0.29616743326187134,
0.6356480717658997,
-0.41426658630371094,
0.21984505653381348,... | |
manipulate the DOM. So far, though, I have not been able to figure out how to do event debugging with Firebug. Specifically, I just want to see a list of event handlers bound to a particular element at a given time (using Firebug JavaScript breakpoints to trace the changes). But either Firebug does not have the capabil... | [
0.3361722230911255,
-0.22682152688503265,
0.26094669103622437,
0.13131067156791687,
-0.13091938197612762,
-0.19317956268787384,
0.22400647401809692,
-0.23259270191192627,
-0.019752468913793564,
-0.27236685156822205,
0.1329154670238495,
0.8338967561721802,
-0.43096426129341125,
0.0267396681... | |
DOM node](https://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node/447106#447106).
In a nutshell, assuming at some point an event handler is attached to your element (eg): `$('#foo').click(function() { console.log('clicked!') });`
You inspect it like so:
* jQuery 1.3.x
```
var clickEvent... | [
-0.5156835913658142,
-0.22578178346157074,
0.7501433491706848,
-0.22912859916687012,
0.19337500631809235,
-0.13078860938549042,
0.2008565217256546,
-0.3240182101726532,
-0.3089171051979065,
-0.2653839886188507,
-0.4931569993495941,
0.7711406350135803,
-0.549216091632843,
0.2540925741195678... | |
Not exactly sure why this is happening, but upon click of a button I call a JQuery Ajax control, after that I do not want to continue submitting the form, but before the page gets still submitted.
```
<asp:ImageButton id="btnContinue" OnClick="btnContinue_Click" runat="server" OnClientClick="return false;" />
```
an... | [
-0.114232636988163,
-0.1441362053155899,
0.7740680575370789,
-0.10581351816654205,
-0.043961312621831894,
-0.2354147881269455,
0.20357076823711395,
-0.08831250667572021,
-0.07462157309055328,
-0.5851231813430786,
-0.20608611404895782,
0.7497920989990234,
-0.1989630162715912,
0.053488980978... | |
var currentCulture = "<%= GetCulture() %>";
var params = $.toJSON({pickupLocation: currentpickupLocation, pickupDate: currentpickupDate});
$.ajax({
type: "POST",
url: "LocationService.asmx/GetBlackoutDates",
data: params, | [
-0.04898371919989586,
-0.5851547122001648,
0.8063365817070007,
-0.03243502974510193,
0.26813220977783203,
0.2897937297821045,
-0.06927096843719482,
-0.039596885442733765,
-0.3847086727619171,
-0.14121563732624054,
-0.19335193932056427,
0.17562294006347656,
-0.22863493859767914,
0.206543147... | |
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(locations) {
return false;
}
});
});
```
You need to | [
0.026586342602968216,
0.06235380843281746,
0.45798349380493164,
-0.1799103021621704,
0.3280423581600189,
-0.30211398005485535,
0.46963396668434143,
-0.06855148822069168,
-0.0465945340692997,
-0.5707008242607117,
-0.8187112212181091,
0.5332242846488953,
-0.38258448243141174,
0.1405217498540... | |
have a return false in the click area like so:
```
$("#<%=btnContinue.ClientID%>").click(function() {
var currentpickupLocation = document.getElementById("<%=ddlPickupLocation.ClientID %>").value;
var currentpickupDate = document.getElementById("<%=txtPickupDate.ClientID %>").value;
var currentCulture = "... | [
0.28244125843048096,
-0.32265880703926086,
0.7590426802635193,
-0.1321454793214798,
0.1570451706647873,
0.22041872143745422,
0.26571592688560486,
-0.46043720841407776,
-0.3017802834510803,
-0.21502815186977386,
-0.19560417532920837,
0.5250447392463684,
-0.22353018820285797,
0.2632499039173... | |
data: params,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(locations) {
return false;
}
});
return false; //this tells the browser not to submit
});
``` | [
-0.02532292529940605,
0.0800785943865776,
0.37286725640296936,
-0.12742571532726288,
0.06053289398550987,
0.08486367017030716,
0.49529576301574707,
-0.33649885654449463,
-0.19782103598117828,
-0.3810654878616333,
-0.8818994164466858,
0.44775286316871643,
-0.45047637820243835,
0.14436466991... | |
I'm trying to add an element to an array only if it doesn't already exist in the array. I used to do this with the [Array.include](http://mootools.net/docs/Native/Array#Array:include) method of mootools, but now I'm using jquery.
Is there a method to do this in jquery?
<http://mootools.net/docs/Native/Array#Array:in... | [
0.3176916241645813,
-0.23996378481388092,
-0.13170072436332703,
0.18935507535934448,
0.36135783791542053,
-0.18239527940750122,
0.3116615116596222,
-0.05028741434216499,
-0.25091099739074707,
-0.94822758436203,
0.13929180800914764,
0.4756441116333008,
-0.14872053265571594,
0.07097548991441... | |
I've been using an OleDb connection to read excel files successfully for quite a while now, but I've run across a problem. I've got someone who is trying to upload an Excel spreadsheet with nothing in the first column and when I try to read the file, it doesn't recognize that column.
I'm currently using the following ... | [
0.20353391766548157,
0.1923801600933075,
0.49634167551994324,
0.055391825735569,
-0.2404414266347885,
0.0742567926645279,
0.3538135290145874,
-0.05152151733636856,
-0.32013946771621704,
-0.7949144840240479,
0.00379720376804471,
0.6005100607872009,
-0.4770778715610504,
-0.03314879909157753,... | |
xlsx workbooks from .NET. It is easier to use and faster than OleDB or the Excel COM object model. You can see the [live samples](http://www.spreadsheetgear.com/support/samples/) or try it for yourself with the [free trial](https://www.spreadsheetgear.com/downloads/register.aspx).
Disclaimer: I own SpreadsheetGear LLC... | [
0.4194260537624359,
0.1378658562898636,
0.3809260129928589,
0.037199728190898895,
-0.242456316947937,
-0.018869740888476372,
-0.08207926899194717,
-0.14029686152935028,
-0.07100558280944824,
-0.4004729688167572,
0.026590727269649506,
0.5106210708618164,
-0.4870316684246063,
-0.214465379714... | |
OleDb and SpreadsheetGear. SpreadsheetGear reads the 500K cells in 0.31 seconds compared to 0.63 seconds with OleDB - just over twice as fast. SpreadsheetGear actually creates and reads the workbook in less time than it takes to read the workbook with OleDB.
The code is below. You can try it yourself with the Spreadsh... | [
0.10945313423871994,
-0.00464625982567668,
0.39444512128829956,
-0.09620112925767899,
0.200829416513443,
-0.02723376639187336,
0.27648302912712097,
-0.4222300052642822,
-0.04495466500520706,
-0.7117622494697571,
0.12347791343927383,
0.6069214940071106,
-0.30575352907180786,
0.1073017641901... | |
// Warm up (get the code JITed).
BM(10, 10);
// Do it for real.
BM(50000, 10);
}
static void BM(int rows, int cols)
{
// Compare the performance of OleDB to SpreadsheetGear | [
0.07796455919742584,
-0.02716643176972866,
0.5754699110984802,
-0.19117917120456696,
0.025245603173971176,
0.049276743084192276,
0.16869664192199707,
-0.2424684762954712,
0.03197281435132027,
-0.45288076996803284,
-0.144993856549263,
0.5670925974845886,
-0.5334330797195435,
0.0516524463891... | |
for reading
// workbooks. We sum numbers just to have something to do.
//
// Run on Windows Vista 32 bit, Visual Studio 2008, Release Build,
// Run Without Debugger:
// Create time: 0.25 seconds | [
0.23204833269119263,
-0.09946800768375397,
0.1795855462551117,
0.21578848361968994,
-0.08747924864292145,
0.21557310223579407,
0.45895928144454956,
-0.1697024405002594,
-0.21709713339805603,
-0.6252726316452026,
0.054654043167829514,
0.4800603687763214,
0.1642724722623825,
-0.2160864174365... | |
// OleDb Time: 0.63 seconds
// SpreadsheetGear Time: 0.31 seconds
//
// SpreadsheetGear is more than twice as fast at reading. Furthermore,
// SpreadsheetGear can create the file and read it faster than OleDB
// can just read it. | [
-0.10088010132312775,
-0.1471802294254303,
0.5948845148086548,
-0.029239926487207413,
0.0079599404707551,
-0.013920992612838745,
0.3332742750644684,
-0.19283322989940643,
-0.007859200239181519,
-0.9417873620986938,
-0.09576694667339325,
0.5207614302635193,
0.18009240925312042,
-0.278214305... | |
string filename = @"C:\tmp\SpreadsheetGearOleDbBenchmark.xls";
Console.WriteLine("\nCreating {0} rows x {1} columns", rows, cols);
Stopwatch timer = Stopwatch.StartNew();
double createSum = CreateWorkbook(filename, rows, cols);
double createTime = timer.Elapsed.TotalSecon... | [
0.042417481541633606,
-0.29197970032691956,
0.5634768605232239,
-0.28835633397102356,
0.21966418623924255,
0.18229743838310242,
0.12820889055728912,
-0.3281211853027344,
-0.09959546476602554,
-0.3780979812145233,
-0.116853266954422,
0.2933482825756073,
-0.33483418822288513,
0.1976771503686... | |
timer = Stopwatch.StartNew();
double oleDbSum = ReadWithOleDB(filename);
double oleDbTime = timer.Elapsed.TotalSeconds;
Console.WriteLine("OleDb sum of {0} took {1} seconds.", oleDbSum, oleDbTime);
timer = Stopwatch.StartNew();
double spreadsheetGearSum = Read... | [
0.017209144309163094,
-0.3130752444267273,
0.5399995446205139,
-0.5417863130569458,
0.18655411899089813,
0.08360455930233002,
0.2721482813358307,
-0.34136876463890076,
-0.3176482021808624,
-0.47345516085624695,
-0.1476922482252121,
0.4887465238571167,
-0.25668206810951233,
0.25285369157791... | |
double spreadsheetGearTime = timer.Elapsed.TotalSeconds;
Console.WriteLine("SpreadsheetGear sum of {0} took {1} seconds.", spreadsheetGearSum, spreadsheetGearTime);
}
static double CreateWorkbook(string filename, int rows, int cols)
{
IWorkbook workbook = Factory.GetWork... | [
0.5121561288833618,
-0.19554103910923004,
0.4252772927284241,
-0.22916416823863983,
0.11610731482505798,
0.3391640782356262,
0.36438634991645813,
-0.525311291217804,
-0.36038121581077576,
-0.36023545265197754,
-0.04711956903338432,
0.3775915503501892,
-0.4078280031681061,
0.038087833672761... | |
values = (IValues)worksheet;
double sum = 0.0;
Random rand = new Random();
// Put labels in the first row.
foreach (IRange cell in worksheet.Cells[0, 0, 0, cols - 1])
cell.Value = "Cell-" + cell.Address; | [
-0.3336333930492401,
-0.09735812991857529,
0.12900155782699585,
-0.009773636236786842,
0.13686038553714752,
0.08242042362689972,
0.03079577349126339,
-0.44684815406799316,
-0.1811172217130661,
-0.3616830110549927,
-0.04374072700738907,
0.0367402508854866,
-0.35410642623901367,
0.3696333467... | |
// Using IRange and foreach be less code,
// but we'll do it the fast way.
for (int row = 1; row <= rows; row++)
{
for (int col = 0; col < cols; col++) | [
-0.4744392931461334,
-0.11786210536956787,
0.23463255167007446,
-0.06021474301815033,
0.27248334884643555,
-0.03485634922981262,
0.2987990379333496,
-0.1341225802898407,
-0.002188510727137327,
-0.5772916078567505,
-0.4705929160118103,
0.5551638603210449,
-0.4782046377658844,
-0.25315111875... | |
{
double number = rand.NextDouble();
sum += number;
values.SetNumber(row, col, number);
}
} | [
-0.11981305480003357,
-0.26826372742652893,
0.022347714751958847,
-0.1368376463651657,
0.07326073199510574,
0.2493448704481125,
0.2115756869316101,
-0.6510670781135559,
-0.226448193192482,
-0.4134509563446045,
-0.17159530520439148,
0.2984008193016052,
-0.24227525293827057,
0.08262066543102... | |
workbook.SaveAs(filename, FileFormat.Excel8);
return sum;
}
static double ReadWithSpreadsheetGear(string filename)
{
IWorkbook workbook = Factory.GetWorkbook(filename);
IWorksheet worksheet = workbook.Worksheets[0];
IValues values = (IValues)works... | [
0.30260229110717773,
0.01972338929772377,
0.506091833114624,
-0.3661953806877136,
0.355453759431839,
0.31543123722076416,
0.5450827479362488,
-0.3880767822265625,
-0.22033247351646423,
-0.5253578424453735,
-0.2880154550075531,
0.5590199828147888,
-0.484237402677536,
0.11361809074878693,
... | |
IRange usedRahge = worksheet.UsedRange;
int rowCount = usedRahge.RowCount;
int colCount = usedRahge.ColumnCount;
double sum = 0.0;
// We could use foreach (IRange cell in usedRange) for cleaner
// code, but this is faster. | [
-0.36420655250549316,
0.40497034788131714,
0.15333351492881775,
-0.14090272784233093,
0.14008457958698273,
0.06683856248855591,
0.5141633152961731,
-0.4053206741809845,
-0.06464773416519165,
-0.24554771184921265,
-0.3827787935733795,
0.2571464776992798,
-0.40741077065467834,
0.066859543323... | |
for (int row = 1; row <= rowCount; row++)
{
for (int col = 0; col < colCount; col++)
{
IValue value = values[row, col]; | [
-0.4655267596244812,
-0.2089279592037201,
1.0175588130950928,
-0.37351229786872864,
0.1840989887714386,
0.34756478667259216,
0.20370498299598694,
-0.3791676163673401,
-0.07117971777915955,
-0.36349210143089294,
-0.44676893949508667,
0.5800610184669495,
-0.4237464368343353,
0.00477662682533... | |
if (value != null && value.Type == SpreadsheetGear.Advanced.Cells.ValueType.Number)
sum += value.Number;
}
}
return sum;
} | [
-0.35753464698791504,
-0.19173289835453033,
0.22839732468128204,
-0.1956072598695755,
0.12673771381378174,
0.1180114597082138,
0.06154797598719597,
-0.5809421539306641,
0.029787303879857063,
-0.15308623015880585,
-0.38102486729621887,
0.11841444671154022,
-0.4150278866291046,
-0.0263165291... | |
static double ReadWithOleDB(string filename)
{
String connectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;"; | [
0.3417760133743286,
-0.22283197939395905,
0.5406507849693298,
-0.11673247069120407,
0.0748036578297615,
0.09387662261724472,
0.4484110176563263,
-0.23891578614711761,
-0.05297044664621353,
-0.2913096249103546,
-0.29787716269493103,
0.5504608750343323,
-0.6774140000343323,
0.116874366998672... | |
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
OleDbCommand selectCommand =new OleDbCommand("SELECT * FROM [Sheet1$]", connection);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
dataAdapter.SelectCommand = selectCommand... | [
-0.4589860439300537,
-0.4689505994319916,
0.7176098823547363,
-0.28379935026168823,
0.03825739398598671,
0.07618476450443268,
-0.03266076371073723,
-0.40650880336761475,
-0.20906494557857513,
-0.6881720423698425,
-0.3015326261520386,
0.3140017092227936,
-0.42205458879470825,
0.420953422784... | |
dataAdapter.Fill(dataSet);
connection.Close();
double sum = 0.0;
// We'll make some assumptions for brevity of the code.
DataTable dataTable = dataSet.Tables[0];
int cols = dataTable.Columns.Count;
foreach (DataRow row in dataTable.Rows) | [
-0.3920978307723999,
-0.2268519103527069,
0.5416507720947266,
-0.01594727300107479,
0.11750466376543045,
0.06834709644317627,
0.09494669735431671,
-0.294593870639801,
-0.18221573531627655,
-0.5425451993942261,
-0.19883818924427032,
0.26130935549736023,
-0.5615407824516296,
0.36495712399482... | |
{
for (int i = 0; i < cols; i++)
{
object val = row[i];
if (val is double) | [
-0.11782647669315338,
-0.15811608731746674,
0.4733702838420868,
-0.4586758315563202,
0.08463166654109955,
0.29922065138816833,
0.3609665632247925,
-0.38856610655784607,
-0.02674347534775734,
-0.4036715030670166,
-0.3555194139480591,
0.6487128734588623,
-0.40146857500076294,
0.0136399539187... | |
sum += (double)val;
}
}
return sum;
}
}
}
``` | [
-0.012489107437431812,
-0.129157155752182,
0.2891305387020111,
-0.40682244300842285,
-0.35239335894584656,
-0.039731841534376144,
0.40276485681533813,
-0.5298949480056763,
0.023985600098967552,
-0.13172437250614166,
-0.35647472739219666,
0.658401608467102,
-0.40965017676353455,
0.087440438... | |
When the user tabs into my `NumericUpDown` I would like all text to be selected. Is this possible?
```
private void NumericUpDown1_Enter(object sender, EventArgs e)
{
NumericUpDown1.Select(0, NumericUpDown1.Text.Length);
}
```
(Note that the Text property is hidden in Intellisense, but it's there) | [
-0.4053742289543152,
-0.2900300621986389,
0.38108837604522705,
-0.13848789036273956,
0.2972891926765442,
-0.1747211515903473,
0.24363161623477936,
-0.07494376599788666,
0.08306203782558441,
-0.801800012588501,
-0.3371260166168213,
0.7576847672462463,
-0.10915574431419373,
0.010547395795583... | |
I've scoured Google and found to large a variety of tools and answers. I want to disassemble a DLL into something at least readable, e.g. recognise Win32 API calls by their names etc. How do I go about this?
Check out [THIS](http://programmerstools.org/taxonomy/term/25). Any of them can work for you but IDA rocks... | [
0.36106184124946594,
0.38222354650497437,
-0.2554713785648346,
0.2731867730617523,
-0.11819978058338165,
-0.11951778084039688,
0.22583208978176117,
-0.04951721429824829,
0.12242340296506882,
-0.6341524720191956,
-0.051822081208229065,
0.35855501890182495,
-0.007622974459081888,
0.181658953... | |
I've found myself asking the question: should I make one repository for all the projects at this client? or should I make a separate repository for each?
Which do you normally decide?
Please list the advantages and disadvantages of either approach which lead to your decision.
EDIT: Please mark as duplicate for one ... | [
0.22897380590438843,
-0.0307344701141119,
-0.13426268100738525,
0.3313031494617462,
-0.015858864411711693,
-0.05444380268454552,
-0.19978010654449463,
-0.2975269556045532,
-0.5444402098655701,
-0.31496110558509827,
0.07208109647035599,
0.317734032869339,
-0.058466918766498566,
0.3916087746... | |
I was going through some reports that were supposed to be displaying 2/1/2009 - 2/28/2009, but instead was displaying 2/1/2009 - 3/1/2009. I have narrowed the bug down to this code, any suggestions?
```
Function GetMonthLastDate(ByVal sDateTime As DateTime)
Try
Dim strArrMonth() As String = {"", "31", "29"... | [
0.16915839910507202,
-0.4827756881713867,
0.9471428990364075,
-0.34012094140052795,
-0.0040818024426698685,
0.15867269039154053,
0.37292930483818054,
0.09570122510194778,
-0.2446753978729248,
-0.26151010394096375,
-0.09277618676424026,
0.6734902858734131,
-0.18648619949817657,
0.1751580387... | |
If sDateTime.Year Mod 400 = 0 Then Return sDateTime.AddDays(28)
If sDateTime.Year Mod 100 = 0 Then Return sDateTime.AddDays(27)
If sDateTime.Year Mod 4 = 0 Then Return sDateTime.AddDays(28)
End If
days = strArrMonth(sDateTime.Month)
Return Format(sDateTime.AddDays(days - ... | [
0.22765982151031494,
-0.033574942499399185,
0.9497162103652954,
-0.43810105323791504,
0.0293024480342865,
0.4880029857158661,
0.3443147540092468,
-0.25564080476760864,
-0.23935924470424652,
-0.3996939957141876,
-0.5508767366409302,
0.4272857904434204,
0.026139531284570694,
0.42798292636871... | |
End Try
End Function
```
This is some seriously convoluted code for what it's doing. You can accomplish the same thing like this:
```
Function GetMonthLastDate(ByVal sDateTime As DateTime)
Dim nextMonth As DateTime = sDateTime.AddMonths(1)
Return New DateTime(nextMonth.YearPart, nextMonth.MonthPart, 1).AddDays(-1... | [
0.1289520412683487,
-0.14689616858959198,
0.7271824479103088,
-0.1978902369737625,
0.2281462401151657,
-0.3145889341831207,
0.3216444253921509,
-0.07139390707015991,
0.19224132597446442,
-0.5262698531150818,
-0.19045047461986542,
0.45724213123321533,
0.02016877941787243,
0.1730692833662033... | |
Is it useful to write a standardised TDD [Test] method that would expose common memory issues ?
The set of tests could be easily, quickly applied to a method and would red-fail 'classic' .NET memory issues but would green-pass the classic solutions.
For example common memory issues could be : too much relocation by ... | [
0.09083343297243118,
-0.18825185298919678,
0.012354657053947449,
0.2719228267669678,
-0.059778545051813126,
-0.14668959379196167,
0.43949607014656067,
-0.2029089629650116,
-0.2817274034023285,
-0.37786799669265747,
-0.1997585892677307,
0.4612475037574768,
-0.2458963841199875,
0.14011535048... | |
that add up to something significant over time, … and others.
Perhaps the code could look something like this …
```
[Test]
public void Verify_MyMethodUnderTest_Is_Unlikely_To_Have_Common_Memory_Problem()
{
//-Setup
var ExpectationToleranceA = ...
var ExpectationToleranceB = ...
...
//-Execute
var MeasurementA = MyC... | [
0.35768240690231323,
0.047420602291822433,
0.28852495551109314,
0.007135470863431692,
0.3371889591217041,
0.008688884787261486,
0.4049054682254791,
-0.6687353849411011,
0.147712841629982,
-0.5546370148658752,
0.11571818590164185,
0.6493813395500183,
0.21094128489494324,
-0.0802701339125633... | |
A developer may then be pointed to review failing code and possibly fix the leak, change the tolerances or even remove the TDD memory pressure test.
does this idea have legs?
There is a related question here for C++ app, [Memory leak detection while running unit tests](https://stackoverflow.com/questions/169058/memor... | [
0.34951159358024597,
-0.009297031909227371,
0.10154525935649872,
0.168685182929039,
-0.09457676112651825,
-0.13842734694480896,
0.3309257924556732,
-0.18170493841171265,
-0.18253175914287567,
-0.4870516359806061,
-0.07055243849754333,
0.5657377243041992,
-0.004527985583990812,
-0.088533423... | |
memory issues
4) be able to quickly throw a quick standard test at a function to see whether it exhibits classic symptoms
5) be able to upgrade the Standard TDD .Net Memory Pressure Test applied in the unit test. This implies a refactor of the above code so that upgrades to the standard test will change upgrade the m... | [
0.11737353354692459,
0.23842231929302216,
0.39404481649398804,
0.2705812156200409,
-0.37331002950668335,
-0.28836876153945923,
0.5896804928779602,
-0.29854413866996765,
-0.12277369946241379,
-0.4370739459991455,
-0.26183003187179565,
0.878515899181366,
0.41528770327568054,
-0.2453955411911... | |
which will be not the case, when the garbage collector is involved.
Nevertheless you *can* use unit testing framework facilities for doing non-unit tests (functional tests, regression tests, stress tests, ...). But you need to be ***aware***, that you are not doing real unit tests. So don't use them in some automatic ... | [
0.5539059042930603,
0.11340194940567017,
-0.30187809467315674,
0.1776355654001236,
-0.2043766975402832,
-0.3992129862308502,
0.3691059350967407,
-0.25295570492744446,
-0.3325301706790924,
-0.41764888167381287,
-0.16044417023658752,
0.8120951652526855,
-0.29250937700271606,
0.02767502143979... | |
row to sense a growth in memory consumption more easily. Consider adding such tests in a separate overnight build (separate from real unit tests), because that may be time consuming. Invoke the tests on a separate machine, where you have full control (a open browser with some flash animation or a virus scanner during t... | [
0.14584840834140778,
-0.03729381784796715,
0.16162118315696716,
0.3362954258918762,
-0.01799446903169155,
0.34465405344963074,
0.1608741730451584,
-0.21152934432029724,
-0.17533360421657562,
-0.5368980169296265,
0.07797929644584656,
0.40987005829811096,
-0.2291034311056137,
0.0362087972462... | |
I'm reading a custom table cell in `tableView:cellForRowAtIndexPath:` from a nib file. This works great for my purposes, except it's quite slow.
Now, I know the right thing to do in the long term is to create the cell entirely in code, and to use a single view, and so on. But this is a prototype, and I don't want to p... | [
0.3093142807483673,
0.17537525296211243,
0.33688488602638245,
-0.007762976922094822,
0.09168697148561478,
-0.08790015429258347,
0.06652244180440903,
0.10269777476787567,
-0.19556491076946259,
-1.1176726818084717,
0.11734683066606522,
0.2918386161327362,
-0.25222083926200867,
0.124141059815... | |
nib.
Here's what I use to load the nib, which I call from `viewDidLoad:` (and `retain` after)
```
-(id)loadFromNamed:(NSString*)name {
NSArray *objectsInNib = [[NSBundle mainBundle] loadNibNamed:name
owner:self | [
-0.17876096069812775,
-0.08684710413217545,
-0.10641393065452576,
-0.12106329202651978,
0.05720125511288643,
-0.16876043379306793,
0.11226129531860352,
0.14285828173160553,
-0.25698408484458923,
-0.6378287076950073,
-0.027555258944630623,
0.5317971110343933,
-0.24513927102088928,
0.2560492... | |
options:nil];
assert( objectsInNib.count == 1 );
return [objectsInNib objectAtIndex:0];
}
```
All is good so far. But the question is: How do I copy this over and over? Is it even possible?
I tried `[_cachedObject copy]` and `[_cachedObject mutableCopy]` but `UITableViewCell` doesn't support either copy prot... | [
0.05895585939288139,
-0.1634172797203064,
0.5546894073486328,
0.10895604640245438,
0.2332153469324112,
-0.22747500240802765,
0.3333549499511719,
0.004738115705549717,
-0.26032087206840515,
-0.5404319763183594,
-0.07895734161138535,
0.7686567306518555,
-0.20156808197498322,
0.21757969260215... | |
I'm prepared to remove the nib entirely, but I'd rather get it going a little faster if there's a low-hanging fruit here.
Any ideas?
Use the cell cloning built into the table view. Apple knew generating a lot of table cells was slow. Check out the docs for this method:
```
- (UITableViewCell *)dequeueReusableCellWith... | [
0.2099764347076416,
0.13575249910354614,
-0.03934004157781601,
0.07472078502178192,
0.450590044260025,
0.052659954875707626,
-0.1310182511806488,
0.25384241342544556,
-0.19231674075126648,
-0.9094942808151245,
0.3028285801410675,
0.3674633204936981,
-0.3124174177646637,
0.22273294627666473... | |
this method and show you the right way. The fact your cell was loaded from a nib shouldn't matter at all.
---
Minor clarification: I dont think the above method clone cells for you. Instead it takes cell object that have scrolled off the screen and simply moves them to a new spot. So it's literally reusing a cell. So... | [
0.4732680320739746,
-0.05943191051483154,
0.19554930925369263,
0.26263296604156494,
0.04983646795153618,
-0.34725216031074524,
0.16034023463726044,
0.0011619692668318748,
0.021392926573753357,
-0.6712095141410828,
0.18958987295627594,
0.546577513217926,
-0.20716512203216553,
-0.03272118791... | |
Lets say I have a simple many-to-many table between tables "table1" and "table2" that consists from two int fields: "table1-id" and "table2-id". How should I index this linking table?
I used to just make a composite primary index (table1-id,table2-id), but I read that this index might not work if you change order of t... | [
-0.005715786945074797,
0.09850429743528366,
0.33196398615837097,
-0.013574318028986454,
-0.2905639708042145,
0.19739097356796265,
-0.45773956179618835,
-0.22448453307151794,
-0.3620668947696686,
-0.776701807975769,
0.4544174075126648,
0.4197985827922821,
-0.42362409830093384,
0.06576022505... | |
ON (tt.table_1 = t1.id)
JOIN table2 t2 ON (t2.id = tt.table_2)
WHERE t1.id = @id
```
then you need:
```
ALTER TABLE table_table ADD CONSTRAINT pk_table1_table2 (table_1, table_2)
```
In this case, `table1` will be leading in `NESTED LOOPS` and your index will be usable only when `table1` is indexed first.
If you ... | [
-0.28632107377052307,
0.08234338462352753,
0.651572048664093,
-0.05979635939002037,
-0.0968969538807869,
0.10639016330242157,
-0.3168887495994568,
-0.5436996221542358,
-0.5370814204216003,
-0.5234983563423157,
0.1176752820611,
0.4564695954322815,
-0.7320632338523865,
-0.2737034857273102,
... | |
everywhere where a plain index on the first column can be used. If you use independent indices, you won't be able to search efficiently for both values:
```
/* Check if relationship exists between two given values */
SELECT 1
FROM table_table
WHERE table_1 = @id1
AND table_2 = @id2
```
For a query like this, you'l... | [
-0.14278800785541534,
0.12447123974561691,
0.5525432825088501,
0.20608215034008026,
-0.13236477971076965,
0.0008645664784125984,
-0.05852044001221657,
-0.3406544327735901,
-0.3465856611728668,
-0.8895047307014465,
-0.04740748554468155,
0.40931934118270874,
-0.6000571846961975,
-0.041292812... | |
`table_1`, additional index will be used for searches based on value of `table_2`. | [
-0.517004132270813,
-0.01149603258818388,
0.48659467697143555,
0.26998481154441833,
0.014381575398147106,
-0.07034626603126526,
-0.13196444511413574,
-0.07671432197093964,
-0.3894177973270416,
-0.7306497097015381,
-0.1544097363948822,
0.06904342770576477,
-0.42695847153663635,
0.0178962387... | |
This has happened a couple of times to me know. If I add to many OperationContract's to a ServiceContract, the WCF Test Client app throws an exception:
"Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata."
In the details it continues:
Error: Cann... | [
0.3881378769874573,
0.03156139701604843,
0.6583995819091797,
-0.11360746622085571,
0.015146760269999504,
-0.18778972327709198,
1.0472298860549927,
-0.3946744203567505,
-0.18928326666355133,
-0.5372048616409302,
-0.23065416514873505,
0.6470452547073364,
-0.24422845244407654,
0.1419378072023... | |
List(Of JobSubTypeOfJobTypeDTO)
<OperationContract(), FaultContract(GetType(WcfService.Common.DefaultFaultContract))> _
Function GetActivityTypesForJobTypeList(ByVal jobTypeList As Dictionary(Of Integer, String)) As List(Of ActivityTypeOfJobTypeDTO)
```
It turned out that we were missing setters in the return types ... | [
0.048442721366882324,
-0.1127237007021904,
0.1688835173845291,
-0.16697169840335846,
0.05157451704144478,
0.11605487018823624,
0.3235015571117401,
-0.35151585936546326,
-0.05366480350494385,
-0.22009174525737762,
-0.02034594677388668,
0.8666185140609741,
-0.3579882085323334,
-0.10218135267... | |
How can I use `bash` syntax in Perl's `system()` command?
I have a command that is bash-specific, e.g. the following, which uses bash's process substitution:
```
diff <(ls -l) <(ls -al)
```
I would like to call it from Perl, using
```
system("diff <(ls -l) <(ls -al)")
```
but it gives me an error because it's... | [
0.24235357344150543,
0.16925759613513947,
0.4572761356830597,
-0.13882768154144287,
-0.46987584233283997,
-0.02744731679558754,
0.19490215182304382,
-0.28229981660842896,
-0.21430082619190216,
-0.3007013201713562,
-0.16457687318325043,
0.4933910071849823,
-0.2579084038734436,
-0.0785452648... | |
-al)" );
system(@args);
```
You may even define a subroutine if you plan on doing this often enough:
```
sub system_bash {
my @args = ( "bash", "-c", shift );
system(@args);
}
system_bash('echo $SHELL');
system_bash('diff <(ls -l) <(ls -al)');
``` | [
-0.004519069101661444,
0.10316713899374008,
0.555652916431427,
-0.4092826247215271,
0.30523496866226196,
0.07600477337837219,
0.3242787718772888,
-0.410889208316803,
-0.33443307876586914,
-0.4390319585800171,
-0.4165275990962982,
0.628836989402771,
-0.5578094124794006,
0.18100325763225555,... | |
All I want to do is to check whether an element exists in the vector or not, so I can deal with each case.
```
if ( item_present )
do_this();
else
do_that();
```
You can use [`std::find`](http://en.cppreference.com/w/cpp/algorithm/find) from `<algorithm>`:
```
#include <algorithm>
#include <vector>
vector<int>... | [
-0.31471094489097595,
-0.11409292370080948,
0.5635416507720947,
-0.09255314618349075,
0.17646905779838562,
0.22443512082099915,
0.003351280465722084,
-0.4716437757015228,
-0.2508527636528015,
-0.6911216974258423,
-0.1761055588722229,
0.47670555114746094,
-0.3781861662864685,
0.277400434017... | |
When making a simple [web request](https://stackoverflow.com/questions/340553/what-is-the-best-way-to-send-http-requests-from-windows-powershell) is there a way to tell the PowerShell environment to just use your Internet Explorer's proxy settings?
My proxy settings are controlled by a network policy(or script) and I ... | [
-0.05360379442572594,
0.19504037499427795,
0.8769665956497192,
0.05774492770433426,
0.14089366793632507,
-0.15989743173122406,
0.31616538763046265,
-0.17867907881736755,
-0.12415710091590881,
-0.7162994146347046,
-0.45703911781311035,
0.4760160446166992,
-0.16014675796031952,
-0.0745141059... | |
-assecurestring
$proxy = new-object System.Net.WebProxy
$proxy.Address = $webproxy
$account = new-object System.Net.NetworkCredential($user,[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pwd)), "")
$proxy.credentials = $account
$url = "http://stackoverflow.co... | [
-0.5452577471733093,
0.06268185377120972,
0.662755012512207,
0.0865284651517868,
0.10281285643577576,
0.04127363860607147,
0.40214040875434875,
-0.3751887083053589,
-0.36984512209892273,
-0.403632253408432,
-0.36302658915519714,
0.6431156396865845,
-0.3044310212135315,
0.11927971988916397,... | |
Seems like it should a really easy topic, all the examples everywhere are just a couple of lines however no decent explainations, and thus I keep running into the same error without a solution.
In short this part of the applicaion runs like so
1. Pulls images from db
2. Creates actual images files in a temp folder
3... | [
0.13903868198394775,
-0.11543077975511551,
0.5824174880981445,
0.09370776265859604,
-0.375946044921875,
0.0026413521263748407,
0.4746767282485962,
-0.10517968237400055,
-0.03954389691352844,
-0.8571914434432983,
-0.0066344826482236385,
0.5937272906303406,
-0.391448974609375,
0.023367514833... | |
to accomplish the delete the latest being:
```
foreach (string item in TempFilesList)
{
path = System.Web.HttpContext.Current.Application["baseWebDomainUrl"] + "/temp/" + item;
fileDel = new FileInfo(path);
fileDel.Delete();
}
```
and the try before that one was:
```
foreach (string ... | [
-0.02463412471115589,
-0.30865874886512756,
0.926658034324646,
-0.0013660998083651066,
-0.054200682789087296,
0.09053097665309906,
0.3418545424938202,
-0.3718332052230835,
-0.5429646968841553,
-0.7771342396736145,
-0.32012179493904114,
0.5375099182128906,
-0.3636927306652069,
0.21214459836... | |
the "real" path to the file. Pass that to File.Delete, and it should work (assuming file permissions etc. are correct)
So for example:
```
foreach (string item in TempFilesList)
{
path = System.Web.HttpContext.Current.Application["baseWebDomainUrl"] + "/temp/" + item;
path = Server.MapPath(path);
fileDel ... | [
-0.05498644709587097,
-0.33589836955070496,
0.7283790111541748,
-0.1021207645535469,
0.31747934222221375,
-0.030639858916401863,
0.31309792399406433,
-0.253273069858551,
-0.2763455808162689,
-0.7166522741317749,
-0.349465548992157,
0.5382678508758545,
-0.3605385720729828,
0.249609857797622... | |
Quick question here: is there any obvious benefit to use asynchronous communication with the NetworkStream class (generated by TcpClient), i.e. the BeginRead/BeginWrite methods rather than running a separate thread and using synchronous operations on that, i.e. Read/Write? My impression has been (it could easily be qui... | [
0.21667392551898956,
-0.09849850833415985,
0.2567833364009857,
0.05583037808537483,
0.08522956073284149,
-0.14528650045394897,
0.022715413942933083,
0.08037807792425156,
-0.3193626403808594,
-0.4485750198364258,
0.029278451576828957,
0.6643706560134888,
-0.14890031516551971,
0.138239875435... | |
confident this is the sort of thing (OS-level calls) that happens for file I/O at least, but if someone could please clarify the matter regarding network (TCP) communication, it would be most helpful. Basically, I would like to know whether there's any specific benefit to either method (besides the obvious one of being... | [
0.5175036787986755,
-0.19666385650634766,
0.21754543483257294,
0.2237410545349121,
0.061068929731845856,
-0.3136690855026245,
-0.10265760123729706,
-0.17517584562301636,
0.10613811016082764,
-0.3572448790073395,
0.24741396307945251,
0.7467100620269775,
-0.19378992915153503,
-0.030641190707... | |
instead use a callback on an appropriate I/O signal, the call back will then run on a thread from the pool. | [
0.35388875007629395,
-0.44239696860313416,
0.17287683486938477,
0.07744371145963669,
0.22451302409172058,
-0.0006951402756385505,
-0.15223883092403412,
-0.2132159173488617,
0.01826373301446438,
-0.36240434646606445,
-0.12099700421094894,
0.3476303517818451,
-0.29027414321899414,
0.36021545... | |
I think that when I add a view as a subview like such:
```
UIView* view = [[UIView alloc] init];
[self addSubview:view];
[view release];
```
that it's safe to release the view afterwards...is it the same for a CALayer object? If I create a CALayer using alloc/init, and do:
```
[self.layer addSublayer:layer];
```
... | [
0.24028320610523224,
-0.07595715671777725,
0.7222518920898438,
-0.2282298505306244,
-0.10914377868175507,
-0.1291903853416443,
0.10006659477949142,
-0.3174530565738678,
0.025022320449352264,
-0.48238080739974976,
-0.20757542550563812,
0.7664807438850403,
-0.22386671602725983,
0.15851220488... | |
exceptions tend to be very well documented. | [
0.47903144359588623,
0.15248171985149384,
-0.37973591685295105,
-0.015110708773136139,
0.30709055066108704,
-0.35368192195892334,
0.2935226261615753,
0.2902674078941345,
-0.28818318247795105,
-0.47626444697380066,
-0.22384682297706604,
-0.0062406971119344234,
-0.1869126558303833,
-0.132777... | |
I want to experiment with putting a form on a website. Then take the answers from the filled form and viewing those answers in Access to be linked directly into a db.
Any ideas? How do I create the form, ASP, html? I know connection using ODBC from ASP to Access can work - I need more info around the issue generally... | [
0.45953455567359924,
0.005526140332221985,
0.25072652101516724,
0.26502615213394165,
-0.3926452100276947,
0.06774206459522247,
0.13422459363937378,
-0.24415172636508942,
0.06696995347738266,
-0.9539373517036438,
0.08948172628879547,
0.3737342059612274,
-0.270447701215744,
0.030941046774387... | |
your language of choice.
Add the Access Database to the website in the App\_Data folder of the project, and depending on your specific needs, from here you can use a lot of the drag-drop items to build the page up.
A few notes.
1. Using the drag and drop items are great for rapidly putting up a site, but do not foll... | [
0.23383311927318573,
0.14549680054187775,
0.15393681824207306,
0.31421512365341187,
-0.14752386510372162,
-0.15132533013820648,
0.4555974006652832,
0.4546648859977722,
-0.12853913009166718,
-0.8630090355873108,
-0.11078871786594391,
0.6209697127342224,
-0.12111453711986542,
-0.098702870309... | |
Are there any libraries which exist for accessing audio (mp3 wmw) metadata using the .net compact framework?
Have you considered perhaps building your app in Flex ? You could make use of Flex's [XMLSocket](http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/XMLSocket.html) class to implement a low-laten... | [
0.4798473119735718,
-0.37801167368888855,
0.2872806489467621,
0.300898939371109,
0.0636095330119133,
-0.15579618513584137,
-0.17877623438835144,
-0.2046579122543335,
-0.43868324160575867,
-0.48350366950035095,
0.017007073387503624,
0.7614393830299377,
-0.16288676857948303,
-0.4147700667381... | |
right now I'm trying to get CAML down pat in SharePoint, where is the best place to start for this? The MSDN content doesn't impress me much as being somewhat cryptic, though the Wikipedia entry was rather good for starting out. Thoughts? Thanks!
EDIT: Everyone below has great links, but alas I can only pick one answe... | [
0.48723429441452026,
-0.09648478776216507,
0.33755919337272644,
0.3689382076263428,
-0.21559754014015198,
-0.39651426672935486,
0.14824427664279938,
0.34193113446235657,
-0.30439600348472595,
-0.6873691082000732,
0.20821546018123627,
0.5396246910095215,
0.03166903927922249,
-0.089129701256... | |
My Models:
OrderInfo is one-to-one with Print, which is a Many-to-One with Painting, which itself is a Many-to-One with Club.
```
class OrderInfo(models.Model):
print_ordered = models.OneToOneField(Print, blank=True)
class Print(models.Model):
painting = models.ForeignKey(Painting)
class Painting(models.Mod... | [
-0.053010571748018265,
-0.1354953497648239,
0.38706105947494507,
-0.16692735254764557,
0.07805956155061722,
0.23806190490722656,
-0.2045310139656067,
-0.23115704953670502,
-0.5442808866500854,
-0.6600651741027832,
0.003150054020807147,
0.6450427174568176,
-0.6545596718788147,
-0.2168097347... | |
<http://docs.djangoproject.com/en/dev/ref/models/options/#ordering>. It's not clear to me though from the documentation if the `modeling` Meta command allows ordering through foreign keys. (The `filter()` queryset function definitely does: <http://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by-fields>)
I... | [
0.06752552092075348,
0.026383336633443832,
0.18440771102905273,
-0.03294132277369499,
-0.1717655509710312,
0.08905864506959915,
-0.18402399122714996,
-0.04934515058994293,
-0.32260656356811523,
-0.7406986355781555,
0.14573635160923004,
0.5167391300201416,
-0.4795779883861542,
0.10553467273... | |
I'm building a C++ application, and I've got several utility objects that all of my classes need to use. These are things like the logging object, the global state object, the DAL object, etc...
Up until this point, I've been passing all of these objects around as references into my class constructors.
For example:
... | [
0.39603376388549805,
0.2973126173019409,
0.24043814837932587,
0.12071232497692108,
0.10949642211198807,
0.3679361343383789,
-0.15583020448684692,
-0.07977374643087387,
-0.09205608069896698,
-0.22658367455005646,
0.044453855603933334,
0.896844208240509,
-0.19691090285778046,
0.1763952970504... | |
const DAL & dal );
...
private:
const GlobalState & my_state;
const Log & my_logger;
const DAL & my_dal;
}
```
This gets tedious fast, because each time I add a utility object that all of my classes need to access, I have to go and change the constructors everywhere.
I've heard that the c... | [
-0.2416696697473526,
0.10253168642520905,
0.38608819246292114,
-0.11848635226488113,
-0.0769728273153305,
0.14205314218997955,
0.13406138122081757,
0.12031863629817963,
-0.02322324737906456,
-0.6845501065254211,
-0.17980925738811493,
0.3089042603969574,
-0.3414740562438965,
0.2403472214937... | |
pass that around (as a reference) to all of the objects that need to access it.
Is this the right way to handle this problem? Thanks!
**UPDATE:** Thank you to everyone for the feedback. After some additional research, I've decided to continue using Dependency Injection.
You could make use of the **Service Locator** p... | [
0.5403251647949219,
-0.16780458390712738,
0.37646791338920593,
-0.04423913732171059,
-0.016809551045298576,
-0.046884410083293915,
0.3652680814266205,
-0.24752195179462433,
-0.19899635016918182,
-0.6039851903915405,
0.13374513387680054,
0.7272576689720154,
-0.45308178663253784,
0.160672888... | |
its job, then these are explicitly passed to it. This makes the component simpler to understand, more likely to be correct, and easier to maintain.
If you regularly need to add components which need to be known throughout the system, then there may be something wrong with the design of the system (or the way new featu... | [
0.6462386250495911,
-0.001607667887583375,
0.11295691132545471,
0.23100441694259644,
0.10372376441955566,
-0.1522979587316513,
0.17689430713653564,
-0.13314439356327057,
-0.027538839727640152,
-0.5302468538284302,
-0.26381146907806396,
0.7074525356292725,
-0.18661679327487946,
-0.152766749... | |
How do I know what modules are distributed with Perl?
My first guess is that the core modules listed [here](http://perldoc.perl.org/index-modules-A.html) are always included, though I cannot find this stated explicitly. However, I have used modules outside this set (e.g. LWP) without having to install them on Mac OS X... | [
0.7412092089653015,
-0.16851244866847992,
0.4022754430770874,
-0.20789587497711182,
-0.09681481868028641,
-0.17239481210708618,
-0.21068909764289856,
-0.20892398059368134,
-0.7344273328781128,
-0.34965062141418457,
-0.38218939304351807,
0.4625476598739624,
-0.3328559696674347,
-0.046411838... | |
of the operating system.
TIA.
**Update:** The reason for the question is that I am developing on Mac OS X and Linux for deployment to different Linux and Solaris, and I don't have root on some of these systems, and in the case of Mac OS X I don't even have a compiler AFAIK. So what I want to know what modules I have ... | [
0.7484946846961975,
0.12109584361314774,
-0.12608250975608826,
0.19585034251213074,
0.3019742965698242,
-0.19735154509544373,
0.29440200328826904,
-0.08488959819078445,
-0.2678108513355255,
-0.5809862613677979,
-0.2545270323753357,
0.686479389667511,
-0.39141255617141724,
-0.03481892496347... | |
more sophisticated.
There used to be the idea of a "standard library", but it doesn't really exist in reality. [Module::CoreList](http://search.cpan.org/dist/Module-CoreList) tells you what is in the "standard library", but many vendors install additional modules and some even remove or update modules. Additionally, d... | [
0.6036554574966431,
-0.3255597651004791,
0.18132561445236206,
0.10877388715744019,
-0.13955627381801605,
-0.23302169144153595,
0.11242423206567764,
-0.04407505318522453,
-0.6185386776924133,
-0.37733668088912964,
-0.17612352967262268,
0.33565738797187805,
-0.2127039134502411,
0.09875932335... | |
your distributed Perl clean.
Good luck, | [
0.42851024866104126,
-0.23533274233341217,
0.5861444473266602,
0.20849688351154327,
-0.057189349085092545,
-0.2596589922904968,
0.06907884031534195,
0.7273669838905334,
-0.19538860023021698,
-0.7292928099632263,
0.15922518074512482,
0.3170587122440338,
0.02593492902815342,
0.24952711164951... | |
I've got a stored procedure (we'll call it A) that calls another stored procedure (we'll call this one B). B includes a SELECT that I do not want to send back to the caller of A.
Here is some really rough pseudocode, but it should get the idea across.
```
PROCEDURE A
CURSOR
CALL B -- I WANT TO SUPPRESS TH... | [
0.1583317518234253,
0.14100967347621918,
0.3215949833393097,
-0.13164976239204407,
0.10053586214780807,
0.03867050260305405,
-0.10283160954713821,
-0.14895810186862946,
-0.38452231884002686,
-0.3993085026741028,
0.04742875322699547,
0.48970404267311096,
-0.6633334755897522,
0.1518704891204... | |
and B does some things that I want and returns results that I don't care about. Once A is done, it returns its own set of results.
How do I suppress the results from B in A? I'm using SQL Server 2005. I would prefer not to make changes to B because it is working and more complex than I want to mess with.
You can try s... | [
0.21201981604099274,
0.1894417405128479,
0.24897266924381256,
-0.31278178095817566,
-0.12877975404262543,
-0.28950369358062744,
0.2500205934047699,
-0.2979118824005127,
-0.13690204918384552,
-0.3209982216358185,
0.19686783850193024,
0.6492902636528015,
-0.4903508424758911,
0.06332073360681... | |
I am able use UTF-8 characters just fine in my scripts.
As a matter of fact it is possible to [have names of variables and functions contain Unicode characters](http://www.script-tease.net/utfthis.php).
There is also the [mb\_string extension](http://us.php.net/mb_string) which deals with multi-byte strings, yet in c... | [
0.15667982399463654,
0.12302292883396149,
0.2942553758621216,
0.02183743380010128,
-0.33505645394325256,
-0.061952535063028336,
0.1682874709367752,
0.155888631939888,
-0.18734243512153625,
-0.6881839632987976,
0.00046428642235696316,
0.26092904806137085,
-0.20178404450416565,
-0.0158355645... | |
languages were designed with Unicode in mind from day 1, and completely changing your language to Unicode without breaking a lot of stuff is hard. Delphi only became Unicode compatible a year or two ago for example, while other languages like Java or C# were designed in Unicode from Day 1.
So when PHP grew and became ... | [
-0.049401868134737015,
0.18406149744987488,
0.18047946691513062,
-0.04376697912812233,
-0.21727338433265686,
0.13342636823654175,
0.4494541883468628,
0.5652912259101868,
-0.40025004744529724,
-0.5958729386329651,
0.10417447984218597,
0.3562840521335602,
-0.369188517332077,
-0.0685725882649... | |
has something to do with organic growth. Features do not simply exist by default, they have to be written by someone, and that simply did not happen for PHP yet.
Edit: Ok, I read the question wrong. The question is: How are strings stored internally? If I type in "Währung" or "Écriture", which Encoding is used to crea... | [
0.2479887455701828,
0.1629328578710556,
0.026137838140130043,
0.09197444468736649,
-0.21349844336509705,
-0.17088976502418518,
0.1421155482530594,
0.21805483102798462,
-0.2659643292427063,
-0.5373717546463013,
-0.07662993669509888,
0.1604577898979187,
-0.0849870964884758,
-0.00678167911246... | |
Java where everything is stored as Unicode, which means: There is no codepage anymore, and theoretically you cannot mess up. I recommend [Joel's article](http://www.joelonsoftware.com/articles/Unicode.html) about Unicode and Character Sets, but essentially it boils down to: How are strings stored internally, and the an... | [
-0.29284271597862244,
0.16749878227710724,
-0.39738449454307556,
-0.21692146360874176,
-0.1843920201063156,
-0.09825266152620316,
0.4752310514450073,
0.2493247091770172,
-0.3481789529323578,
-0.6443721652030945,
-0.14488904178142548,
0.07952596992254257,
-0.33698421716690063,
-0.1582809537... | |
In this article:
[<http://msdn.microsoft.com/en-us/library/ms171728(VS.80).aspx>](http://msdn.microsoft.com/en-us/library/ms171728(VS.80).aspx)
The author uses the following method to make thread-safe calls to a Windows Forms control:
```
private void SetText(string text)
{
// InvokeRequired required compares th... | [
0.22343990206718445,
-0.12300046533346176,
0.5786946415901184,
-0.060776710510253906,
0.19053876399993896,
-0.19387027621269226,
0.4098277986049652,
-0.3978220820426941,
-0.048724204301834106,
-0.4918915033340454,
-0.4369310736656189,
0.49588900804519653,
-0.5432220101356506,
0.17902691662... | |
else
{
this.textBox1.Text = text;
}
}
```
Is there a shorter way to accomplish the same thing?
**C# 3.0 and after:**
An extension method would generally be the way to go, since you're always going to want to perform an action on an [`ISynchronizeInvoke` interface](http://msdn.microsoft.com/en-us/libr... | [
0.08011133968830109,
-0.28736966848373413,
0.3657379448413849,
-0.06393299251794815,
0.11306119710206985,
0.016707977280020714,
0.37205609679222107,
-0.31211480498313904,
-0.4397227168083191,
-0.3755653500556946,
-0.44897833466529846,
0.6163373589515686,
-0.353834331035614,
-0.086867384612... | |
SynchronizedInvoke(this ISynchronizeInvoke sync, Action action)
{
// If the invoke is not required, then invoke here and get out.
if (!sync.InvokeRequired)
{
// Execute action.
action();
// Get out.
return;
}
// Marshal to the required context.
sync.Invoke(actio... | [
0.43368637561798096,
-0.37937596440315247,
0.42620494961738586,
-0.056188032031059265,
0.33798280358314514,
-0.14611072838306427,
0.38483327627182007,
-0.6225112080574036,
-0.2321367710828781,
-0.13548745214939117,
-0.22730140388011932,
0.6771580576896667,
-0.7056487798690796,
0.0026404997... | |
textBox1.Text = text);
}
```
Here, the closure is over the `text` parameter, that state is captured and passed as part of the [`Action` delegate](http://msdn.microsoft.com/en-us/library/system.action.aspx) passed to the extension method.
**Before C# 3.0:**
You don't have the luxury of lambda expressions, but you ca... | [
0.04111767187714577,
-0.2813015282154083,
0.4163242280483246,
-0.29192817211151123,
0.019637975841760635,
0.07659905403852463,
0.3602861762046814,
-0.20272500813007355,
-0.19031170010566711,
-0.2917464077472687,
-0.39416372776031494,
0.5856228470802307,
-0.6703641414642334,
-0.067618176341... | |
action();
// Get out.
return;
}
// Marshal to the required context.
sync.Invoke(action, new object[] { });
}
```
And then you call it with anonymous method syntax:
```
private void SetText(string text)
{
SynchronizedInvoke(textBox1, delegate() { textBox1.Text = text; });
}
``` | [
0.2890031337738037,
-0.38397732377052307,
0.3180365562438965,
-0.06305426359176636,
0.10240279138088226,
-0.001923070871271193,
0.3337787091732025,
-0.48413702845573425,
-0.39493563771247864,
-0.29440492391586304,
-0.41712844371795654,
0.607835054397583,
-0.7233867049217224,
-0.15605509281... | |
I need to serve a large file (500+ MB) for download from a location that is not accessible to the web server. I found the question [Serving large files with PHP](https://stackoverflow.com/questions/432713/serving-large-files-with-php), which is identical to my situation, but I'm using Perl instead of PHP.
I tried simp... | [
0.07329149544239044,
0.053591810166835785,
0.784163236618042,
-0.24244540929794312,
-0.12309145927429199,
0.10004730522632599,
0.28607818484306335,
-0.14621274173259735,
-0.3442041873931885,
-0.527546226978302,
-0.3368775248527527,
0.29066741466522217,
-0.3197709023952484,
0.37131303548812... | |
(@file) {
print $line;
}
untie @file;
close $fh;
exit;
```
Does Perl have an equivalent to PHP's `readfile()` function (as suggested with PHP) or is there a way to accomplish what I'm trying to do here?
If you just want to slurp input to output, this should do the trick.
```
use Carp ();
{ #Lexical For FileHan... | [
0.12733271718025208,
0.046753522008657455,
0.4117266535758972,
-0.16332228481769562,
-0.11858677864074707,
0.1709074079990387,
0.3571273684501648,
0.01618354767560959,
-0.16699673235416412,
-0.5244442224502563,
-0.08845779299736023,
0.49577879905700684,
-0.33666643500328064,
0.276160120964... | |
guess my answer would be "But it doesn't really need one".
I've used PHP's manual File IO controls and they're a pain, Perls are just so easy to use by comparison that shelling out for a one-size-fits-all function seems over-kill.
Also, you might want to look at `X-SendFile` support, and basically send a header to ... | [
0.1887534260749817,
-0.010430922731757164,
0.38508009910583496,
0.14998115599155426,
-0.1879541575908661,
-0.1570291966199875,
0.23023773729801178,
0.1815730482339859,
-0.2836590111255646,
-0.5201432704925537,
-0.027131574228405952,
0.4682900607585907,
0.10214903950691223,
-0.1498962044715... | |
loop, I tested the above code with a hard-drive and it does implicitly try store the whole thing in an invisible temporary variable and eat all your ram.
Alternative using blocks
------------------------
The following improved code reads the given file in blocks of 8192 chars, which is much more memory efficient, an... | [
0.4185570478439331,
0.2699263095855713,
0.02771163545548916,
-0.025103934109210968,
0.01245966088026762,
0.20765358209609985,
0.34968456625938416,
0.055821049958467484,
-0.3804634213447571,
-0.5402292609214783,
0.01330617256462574,
0.4397647976875305,
-0.30967599153518677,
0.20884068310260... | |
'<', '/dev/sda' ;
local $/ = \8192; # this tells IO to use 8192 char chunks.
print $_ while defined ( $_ = scalar <$fh> );
close $fh;
}
```
Applying jrockways suggestions
------------------------------
```
{
open my $fh , '<', '/dev/sda5' ;
print $_ while ( sysread $fh, $_ , 8192 );
cl... | [
-0.09124504029750824,
0.06326758861541748,
0.4745185077190399,
-0.33657336235046387,
-0.0921412780880928,
0.21184732019901276,
0.45001521706581116,
-0.043789900839328766,
-0.052822381258010864,
-0.7965700626373291,
-0.19363482296466827,
0.70069819688797,
0.04017779603600502,
0.065776258707... | |
I use SQL Server 2005 as a data store for a lot of data I do analytic work on. This is not a transactional database as I am not hitting it with updates or capturing real time data. I get a few gigs of data from my clients, load them into SQL Server and do a series of manipulations. I then grab bits of this data and pul... | [
0.2515135109424591,
0.3476425111293793,
0.16321730613708496,
-0.2874777615070343,
-0.06132223829627037,
-0.020293105393648148,
0.16526196897029877,
-0.09202095121145248,
-0.15657605230808258,
-0.23348571360111237,
0.32539546489715576,
0.6333878040313721,
-0.001184312510304153,
0.0858603939... | |
of a time with the logs in SQL Server getting big and I assume it takes some degree of overhead to create these. How can I configure SQL Server so that it runs with little or no logging? If things get corrupt I am happy to just start from the beginning. Any ideas how to make this all faster?
BTW, no need to tell me ho... | [
0.6312673687934875,
0.1456693559885025,
0.07623552531003952,
0.2844621241092682,
0.12319696694612503,
-0.4251117408275604,
0.273194819688797,
0.3436676263809204,
-0.34024983644485474,
-0.42291924357414246,
0.37324151396751404,
0.5329987406730652,
-0.15557342767715454,
0.365596204996109,
... | |
fit into memory in R.
Should I be using a more simple DB than Sql Server? Feel free to tell me I am killing an ant with a sledgehammer. But please recommend a more appropriate sized hammer. :)
> How can I configure SQL Server so that it runs with little or no logging? I
I don't believe you can.
However if you confi... | [
0.3267304003238678,
0.3596767783164978,
0.11166375130414963,
0.059988200664520264,
-0.3017513155937195,
-0.06456652283668518,
0.616969108581543,
-0.3727896809577942,
-0.3110279142856598,
-0.6243999004364014,
0.2740291953086853,
0.729499340057373,
-0.146097332239151,
0.2899942994117737,
-... | |
used to hold the state of transactions until they are fully written into the main database. | [
0.17345070838928223,
0.08598470687866211,
0.36633455753326416,
0.2055206447839737,
0.47293660044670105,
-0.1345681995153427,
-0.33393317461013794,
0.3011337220668793,
-0.28040292859077454,
-0.08228937536478043,
-0.16351689398288727,
0.19654813408851624,
0.1295371949672699,
0.34718832373619... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.