text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm debugging some Python that takes, as input, a list of objects, each with some attributes.
I'd like to hard-code some test values -- let's say, a list of four objects whose "foo" attribute is set to some number.
Is there a more concise way than this?
```
x1.foo = 1
x2.foo = 2
x3.foo = 3
x4.foo = 4
myfunc([x1, x2,... | [
0.3472934067249298,
0.4492657780647278,
0.0037748534232378006,
-0.16185998916625977,
-0.256963849067688,
-0.21013598144054413,
0.23968589305877686,
0.10389038920402527,
-0.25706106424331665,
-0.42695578932762146,
-0.08980230987071991,
0.5706295371055603,
-0.48076701164245605,
-0.0323364399... | |
like Tetha's solution, but it's unnecessarily complex.
Here's something simpler:
```
>>> class MicroMock(object):
... def __init__(self, **kwargs):
... self.__dict__.update(kwargs)
...
>>> def print_foo(x):
... print x.foo
...
>>> print_foo(MicroMock(foo=3))
3
``` | [
-0.1240323856472969,
0.222086101770401,
0.3889988362789154,
-0.10059447586536407,
0.0837705209851265,
0.22696836292743683,
0.28888440132141113,
-0.45399072766304016,
-0.06469234079122543,
-0.595864474773407,
-0.07625330984592438,
0.6457487344741821,
-0.5286542177200317,
0.28292790055274963... | |
I build for more than two dozen targets from a source tree with usually three active branches with both production and debug builds. To date I've used a personal Makefile that defines the target which includes a common Makefile that defines the compile flags which then includes the Makefile from a specific source tree.... | [
0.9669838547706604,
0.32856571674346924,
0.061416689306497574,
-0.0037962740752846003,
-0.16684864461421967,
0.28811052441596985,
0.24063417315483093,
-0.26936963200569153,
0.050106585025787354,
-0.7223000526428223,
0.37687355279922485,
0.3317846357822418,
-0.127210333943367,
0.15351952612... | |
and dev/production and start the build.
This database would be a single place where I can document and keep track my current settings for all my development builds. A base set of stored flags would be overridden by more granular flags at version, target platform, then build quality levels.
As part of implementing som... | [
0.760998547077179,
0.23359614610671997,
0.10090305656194687,
0.12758545577526093,
0.047755464911460876,
-0.10931624472141266,
0.23248553276062012,
-0.31395378708839417,
0.01568078249692917,
-0.6618152856826782,
0.1403045654296875,
0.7639831900596619,
0.18091504275798798,
-0.027872743085026... | |
to handle this?
Two things:
\* I cannot modify the original project Makefiles.
\* Attempting to use something like automake would be cumbersome as the necessary number of
configure flags to enable a debugging level in an existing module of the code base would number in the hundreds.
IMHO, using a database for this i... | [
0.5930525660514832,
0.10504007339477539,
-0.1848660707473755,
0.11328955739736557,
0.17212387919425964,
-0.23020514845848083,
0.3552062511444092,
-0.2891489863395691,
-0.10853875428438187,
-0.4550705552101135,
0.30413782596588135,
0.6530980467796326,
-0.5355879068374634,
-0.000977301737293... | |
I had been interested in neural networks for a bit and thought about using one in python for a light project that compares various minimization techniques in a time domain (which is fastest).
Then I realized I didn't even know if a NN is good for minimization. What do you think?
Neural networks are classifiers. They s... | [
0.2131320685148239,
-0.25641798973083496,
-0.5285511016845703,
0.28923892974853516,
-0.019672660157084465,
-0.21254189312458038,
0.12461689114570618,
0.20249339938163757,
-0.31364893913269043,
-0.5049824118614197,
0.11552227288484573,
0.07668928802013397,
-0.1462947428226471,
0.31479650735... | |
I want to show data in a wpftoolkit datagrid where the data is a collection of
```
public class Thing
{
public string Foo { get; set; }
public string Bar { get; set; }
public List<Candidate> Candidates { get; set; }
}
public class Candidate
{
public string Name { get; set; }
public CandidateType ... | [
0.35085001587867737,
-0.16891036927700043,
0.4245584309101105,
0.10533101111650467,
0.13881126046180725,
0.14306358993053436,
0.10675732046365738,
-0.4553350806236267,
0.11468105763196945,
-1.0591275691986084,
-0.23845280706882477,
0.2211630791425705,
-0.23229862749576569,
0.15917043387889... | |
this
`Foo | Bar | Candidate 1 | Candidate 2 | ... | Candidate N`
Thus it seems I cannot create a DataTemplate for the candidates in xaml as the binding expression will change.
I add necessary columns in AutoGeneratedColumns event like so:
```
private void DataGrid_AutoGeneratedColumns(object sender, EventArgs e)
{
... | [
-0.33423322439193726,
-0.051176369190216064,
0.8447327613830566,
-0.11420675367116928,
-0.07583541423082352,
0.22781075537204742,
0.17453829944133759,
-0.6648666262626648,
-0.165560781955719,
-0.5791969299316406,
-0.28176820278167725,
0.4688200056552887,
-0.49676403403282166,
0.19721466302... | |
ctx.XamlTypeMapper = new XamlTypeMapper(new string[] { assName });
ctx.XamlTypeMapper.AddMappingProcessingInstruction("src", "WpfToolkitDataGridTester", assName);
ctx.XmlnsDictionary.Add("", "http://schemas.microsoft.com/winfx/2006/xaml/presentation");
ctx.XmlnsDictionary.Add("x", "http://schema... | [
-0.4457492232322693,
0.10599033534526825,
0.9049612879753113,
-0.3681045174598694,
-0.29411280155181885,
0.05157250538468361,
0.1920969933271408,
-0.6487302184104919,
-0.36771324276924133,
-0.46081307530403137,
-0.40413036942481995,
0.43640628457069397,
-0.3937537670135498,
0.1136057078838... | |
<DataTemplate.Resources>
<src:FooConverter x:Key='fooConverter' />
</DataTemplate.Resources> | [
-0.11810675263404846,
0.38949254155158997,
0.2008272260427475,
-0.29934442043304443,
0.06898561120033264,
0.08380917459726334,
-0.23084712028503418,
-0.011676914058625698,
-0.1496320366859436,
-0.249846950173378,
-0.20657849311828613,
0.6143788695335388,
-0.3490655720233917,
0.007638132665... | |
<TextBlock
Foreground='{Binding Candidates[" + i + @"].CandidateType,Converter={StaticResource fooConverter}}' | [
-0.16836786270141602,
0.09453564882278442,
0.6243821382522583,
-0.247375026345253,
-0.06361576169729233,
0.2697514593601227,
0.3403323292732239,
-0.1902572363615036,
0.1837744414806366,
-0.41718846559524536,
-0.4065519869327545,
0.2869381606578827,
-0.6442761421203613,
-0.07239631563425064... | |
Text='{Binding Candidates[" + i + @"].Name}' />
</DataTemplate>", ctx) as DataTemplate; | [
0.014381662011146545,
0.05715422332286835,
0.7171877026557922,
-0.06498762220144272,
0.07412108033895493,
0.05335948243737221,
-0.11077327281236649,
-0.47243833541870117,
0.13596804440021515,
-0.6357898116111755,
-0.6134589314460754,
0.1806717813014984,
-0.45893245935440063,
0.224135115742... | |
dg.Columns.Add(new DataGridTemplateColumn
{
Header = "Candidate " + (i + 1),
CellTemplate = template
});
}
}
```
This however fails with the following exception:
The tag 'FooConverter' does not exist in XML namespace 'clr-namespace:WpfToolkitDataGridTester;assembly=WpfToolk... | [
-0.21671339869499207,
-0.03632530942559242,
0.5078651905059814,
-0.2807472050189972,
-0.054455988109111786,
0.05238837003707886,
0.057129018008708954,
-0.5264753699302673,
-0.14063800871372223,
-0.5014445781707764,
-0.29221421480178833,
0.43830713629722595,
-0.4174899458885193,
0.052947383... | |
Foreground="{Binding Candidates[0].CandidateType,Converter={StaticResource fooConverter}}"
Text="{Binding Candidates[0].Name}" />
</DataTemplate>
```
and the template column defined like so
```
<wpftk:DataGridTemplateColumn CellTemplate="{StaticResource candidateTemplate}" />
```
'works' but obviously does not... | [
-0.20255373418331146,
0.23381254076957703,
0.8130994439125061,
-0.4212989807128906,
-0.14595933258533478,
0.26685312390327454,
0.1983242779970169,
-0.9329379200935364,
0.14882980287075043,
-0.6412424445152283,
-0.43024539947509766,
0.5434414148330688,
-0.24462741613388062,
-0.0880171805620... | |
sb.Append("<TextBlock ");
sb.Append("Foreground='{Binding Candidates[" + i + "].CandidateType,Converter={StaticResource fooConverter}}' ");
sb.Append("Text='{Binding Candidates[" + i + @"].Name}' />");
sb.Append("</DataTemplate>");
var template = (DataTemplate)XamlReader.Parse(sb.ToString());
``` | [
0.06724748015403748,
0.16279566287994385,
0.5393778085708618,
-0.3883410096168518,
-0.046170126646757126,
0.09024383127689362,
0.5481484532356262,
-1.0680254697799683,
0.009786703623831272,
-0.8139240741729736,
-0.40141013264656067,
0.08052705973386765,
-0.8584048748016357,
0.1772832870483... | |
I have the following string which won't compile:
```
String formLookupPull = @"SELECT value1, '"+tableName+"', '"+columnName+"' FROM lkpLookups WHERE ""table"" = '" + tableName + "' and ""field"" = '" + columnName + "';";
```
The offending sections are :
```
""table"" =
```
and
```
""field"" =
```
The compil... | [
-0.021212494000792503,
0.36507222056388855,
0.5041958689689636,
-0.15887144207954407,
-0.07020703703165054,
-0.12563097476959229,
0.5293660759925842,
-0.13197343051433563,
0.1107504814863205,
-0.449176549911499,
-0.24174509942531586,
0.46814146637916565,
-0.4236942529678345,
0.251842468976... | |
front of the rest of your strings to make them all verbatim.
Which would make it look like:
```
String formLookupPull = @"SELECT value1, '"+tableName+ @"', '"+columnName+ @"' FROM lkpLookups WHERE ""table"" = '" + tableName + @"' and ""field"" = '" + columnName + @"';";
``` | [
-0.14144758880138397,
-0.025674760341644287,
0.7712045311927795,
-0.2718495726585388,
-0.2590937912464142,
0.03492901846766472,
0.23693493008613586,
0.14190523326396942,
-0.16879341006278992,
-0.19044746458530426,
-0.603337287902832,
0.4472937285900116,
-0.3857572674751282,
0.0483516752719... | |
I have a lot of jquery code and a little .js script that use prototype
The problem is when i try to call the $$ method in prototype i got the error : $$ is not define
So i like to know the long hand method to get the $$ work
```
$$('table.'+triggerClass).each(function(t){
```
is there a way to force that part of t... | [
0.31114503741264343,
0.05053388327360153,
-0.23080942034721375,
-0.16793787479400635,
-0.12177826464176178,
0.10664299875497818,
0.3311627507209778,
0.0028341698925942183,
-0.029308021068572998,
-0.7875211834907532,
0.46426263451576233,
0.49156153202056885,
-0.45107266306877136,
0.28741458... | |
(and put JQuery in no conflict mode):
```
JQuery('table.'+ triggerClass).each(function(t){})
```
But again, if you have not triggered no conflict mode there are no guarantees which library will serve `$()`.
\* I guess in theory, if you really want to leave the reservation, you could map $$() to JQuery() at the risk... | [
0.13642506301403046,
-0.2921631336212158,
0.16502347588539124,
0.1332230418920517,
0.008687726221978664,
-0.23221345245838165,
0.28699490427970886,
-0.14484280347824097,
-0.14854206144809723,
-0.5642328262329102,
-0.27815306186676025,
0.5635905861854553,
-0.22037914395332336,
0.12301821261... | |
The spreadsheet still displays, but with the warning message. The problem seems to occur because Excel 2007 is more picky about formats matching their extensions than earlier versions of Excel.
The problem was initially discovered by an ASP.Net program and produces in the Excel error "The file you are trying to open, ... | [
0.029238302260637283,
0.493283748626709,
0.5247861742973328,
-0.2198493480682373,
0.21549305319786072,
-0.3667367398738861,
0.4219108521938324,
-0.11160441488027573,
-0.1670813411474228,
-0.42062851786613464,
-0.11048030853271484,
0.4863087832927704,
-0.5517420768737793,
-0.050155572593212... | |
AutoEventWireup="true" CodeFile="Spreadsheet.aspx.cs" Inherits="Spreadsheet" %>
```
The code behind file looks like:
```
public partial class Spreadsheet : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "application/vnd.ms-excel";
Response.C... | [
0.3701358139514923,
-0.08000171929597855,
0.34533578157424927,
0.0840219035744667,
0.07023922353982925,
-0.17784281075000763,
0.26851311326026917,
-0.3485549986362457,
-0.36387231945991516,
-0.3779727518558502,
-0.31550920009613037,
0.9050820469856262,
-0.5769261121749878,
-0.1562201976776... | |
must be suppressed/fixed on the client's registry. | [
0.1490451991558075,
0.24774309992790222,
0.3157040476799011,
0.04397842288017273,
0.4610675573348999,
-0.42086440324783325,
0.01602337136864662,
0.0896662026643753,
-0.05339527502655983,
-0.23933114111423492,
-0.6476107835769653,
0.4860820770263672,
-0.09091131389141083,
0.2214569002389907... | |
in my list:
```
animals = [ ['dog', ['bite'] ],
['cat', ['bite', 'scratch'] ],
['bird', ['peck', 'bite'] ], ]
add('bird', 'peck')
add('bird', 'screech')
add('turtle', 'hide')
```
The add function should check that the animal and action haven't been added before adding them to the list. Is... | [
0.5220123529434204,
0.031896259635686874,
-0.1381155401468277,
-0.17151014506816864,
-0.0012207903200760484,
0.3762604594230652,
0.22890213131904602,
-0.6088153123855591,
-0.2562412619590759,
-0.41045141220092773,
-0.036381445825099945,
0.5209013223648071,
-0.6824279427528381,
-0.165523588... | |
"dog" in animals, you really want a dictionary here, otherwise the add function will scale abysmally as more animals are added:
```
animals = {'dog':set(['bite']),
'cat':set(['bite', 'scratch'])}
```
You can then "one-shot" the add function using setdefault:
```
animals.setdefault('dog', set()).add('bite... | [
0.2676341235637665,
0.1334909200668335,
-0.07618876546621323,
-0.28354722261428833,
0.1706974357366562,
0.3296632170677185,
0.15293243527412415,
-0.5472040176391602,
0.09030027687549591,
-0.5344328284263611,
-0.2557494342327118,
0.7670509815216064,
-0.7296546101570129,
-0.3473486602306366,... | |
I'd like to move my models to a separate directory, similar to the way it's done with Rails to cut down on code clutter. Is there any way to do this easily?
Thanks,
Collin
I assume you're using the basic webkit and not Django or something fancy. In that case just create a subdirectory called models. Put any python fil... | [
0.4938891530036926,
-0.2327582985162735,
0.4134444296360016,
0.3674159646034241,
0.04206172004342079,
0.05676139146089554,
-0.1853702962398529,
0.06824201345443726,
-0.39501243829727173,
-0.7618505358695984,
0.3200201690196991,
0.4796046316623688,
-0.14313040673732758,
0.013731674291193485... | |
I have a dataset being returned by a stored proc and one of the items in it can potentially be null. I'm trying to convert each row in the dataset to a strongly typed object but I can't seem to cast the null value properly.
I've created a mock up of my scenario as follows:
```
DataSet ds = new DataSet();
ds.Tables.Ad... | [
-0.14038214087486267,
0.009008276276290417,
0.22505880892276764,
-0.002221937756985426,
0.01970210298895836,
0.320248544216156,
0.38568180799484253,
-0.2812311053276062,
-0.06940405070781708,
-0.5358681678771973,
-0.30339086055755615,
0.2697833478450775,
-0.32676565647125244,
0.39070031046... | |
not valid.`
If I try to use a nullable type (decimal?) I get this error: `System.NotSupportedException: DataSet does not support System.Nullable<>.`
In the debugger I've done the following tests on the value in dataRow["Amount"]:
```
dataRow["Amount"] is decimal (false)
dataRow["Amount"] is decimal? (false)
dataRow[... | [
0.24484394490718842,
0.4162348508834839,
0.36802950501441956,
0.061272382736206055,
-0.07699167728424072,
-0.13558731973171234,
0.147472083568573,
-0.1739109456539154,
-0.19901423156261444,
-0.2800406515598297,
0.04985920339822769,
0.4388209581375122,
0.10271097719669342,
0.247775956988334... | |
I'm just beginning to work on iPhone apps. How do I know when I should be putting stuff in AppDelegate versus a custom class? Is there a rule or any type of analogy with another programming language like Python or PHP that uses an AppDelegate like pattern?
I normally avoid the design approach implied by Andrew's use of... | [
0.3726100027561188,
0.19825048744678497,
-0.06764766573905945,
0.2212747186422348,
0.2200382649898529,
-0.0370752178132534,
0.25879523158073425,
0.0675315260887146,
-0.46139970421791077,
-0.7320221066474915,
0.018634682521224022,
0.16831490397453308,
-0.12533476948738098,
0.078385293483734... | |
that gets notified when the object to which it is connected reaches certain events or states. In this case, the Application Delegate is an object which receives notifications when the UIApplication object reaches certain states. In many respects, it is a specialized one-to-one Observer pattern.
This means that the "ar... | [
0.21133998036384583,
0.05684947222471237,
0.42634308338165283,
0.19748052954673767,
0.05397095903754234,
-0.36421141028404236,
0.5299838781356812,
-0.18209686875343323,
-0.42212310433387756,
-0.6815686225891113,
-0.558197021484375,
0.12483453005552292,
-0.37650349736213684,
0.1140407994389... | |
includes:
* Document data -- you should have a document manager singleton (for multiple document applications) or a document singleton (for single document applications)
* Button/table/view controllers, view delegate methods or other view handling (except for construction of the top-level view in applicationDidFinishL... | [
-0.24805355072021484,
0.05158448591828346,
0.37586310505867004,
0.39423319697380066,
0.1988145262002945,
0.10050550848245621,
-0.13780328631401062,
-0.1921459287405014,
-0.5999722480773926,
-0.504135251045227,
-0.5118818283081055,
0.49829864501953125,
-0.21103781461715698,
0.07033807039260... | |
I have a .NET custom control that displays information in a culture dependant way. To improve performance I cache some information inside the control rather than generate it every time. I need to know if the culture has changed so that I can regenerate this internal info as appropriate.
Is there some event I have hoo... | [
0.5687196850776672,
-0.2404065728187561,
0.5203274488449097,
-0.039484500885009766,
-0.03782254457473755,
0.3237357437610626,
0.1882791519165039,
-0.06070944666862488,
-0.4067705571651459,
-0.598241925239563,
0.043007124215364456,
0.20940618216991425,
-0.2180764526128769,
0.144275322556495... | |
(e.Category == UserPreferenceCategory.Locale)
{
// .NET also caches culture settings, so clear them
CultureInfo.CurrentCulture.ClearCachedData();
// do some other stuff
}
};
```
Windows also broadcasts the [`WM_SETTINGSCHANGE` message](https://msdn.microsoft.com/en-us/library/windows/... | [
0.2894113063812256,
-0.14055824279785156,
0.6840754151344299,
-0.24448105692863464,
0.22525252401828766,
-0.18826422095298767,
0.4800974726676941,
-0.18510958552360535,
-0.10094770789146423,
-0.6009036302566528,
-0.31020110845565796,
0.35923242568969727,
-0.16933836042881012,
0.08750446885... | |
// .NET also caches culture settings, so clear them
CultureInfo.CurrentCulture.ClearCachedData();
// do some other stuff
}
base.WndProc(ref m);
}
```
Note that you probably also want to call [`CultureInfo.CurrentCulture.ClearCachedData()`](https://msdn.microsoft.com/en-us/library/system.glob... | [
0.5553284287452698,
0.019435159862041473,
0.4141192138195038,
0.11698498576879501,
0.09784980863332748,
-0.3265779912471771,
0.32917922735214233,
0.07236254960298538,
-0.37076035141944885,
-0.680770218372345,
-0.09438961744308472,
0.24082301557064056,
-0.1234915480017662,
0.505639255046844... | |
How can I count how many calls of a cmd file?
I'm struggling with something like this but it didn't work:
```
@IF NOT EXIST Calls.log echo. > Calls.log
@for %%i in (Calls.log) do set size=%%~zi
@IF %size% EQU 0 (
@ECHO 1 > Calls.log
) ELSE (
@set /p v=<Calls.log
@set /A v+=1
@echo %v% > Calls.log
)
```
If all you'... | [
0.3937971889972687,
0.16105665266513824,
0.3109560012817383,
-0.13743427395820618,
-0.27629172801971436,
0.2480466067790985,
0.2402825951576233,
-0.39293116331100464,
-0.39161309599876404,
-0.6158602237701416,
0.318050742149353,
0.5288092494010925,
-0.2807028591632843,
0.08893467485904694,... | |
quicker since the analysis of the count is moved elsewhere.
The counter file expands by one byte every time, so watch out if you're calling it a truly large number of times since the file will expand. But even, calling it once per second, a 1G file will accrue only after 30 years.
At the top of your script, just put:... | [
0.5236513614654541,
-0.28807350993156433,
0.7262677550315857,
-0.3046691119670868,
-0.07343501597642899,
0.07645919919013977,
0.22720105946063995,
-0.26918789744377136,
-0.32215404510498047,
-0.78240966796875,
-0.06483576446771622,
0.5110533237457275,
-0.20079369843006134,
-0.2270498424768... | |
character out without a CR/LF following it (like the UNIX "`echo -n`").
To get a count of the number of calls to date, you can use the file size environment variable modifier, as in the following script (I expect this will be done less often than running the script so it's better to put the grunt work here [in fact, i... | [
0.04344950616359711,
0.08708009123802185,
0.0440991073846817,
-0.49739670753479004,
0.0038959067314863205,
0.3741703927516937,
0.06533738970756531,
-0.3484979271888733,
-0.10349491983652115,
-0.33963045477867126,
-0.24322114884853363,
0.44907787442207336,
-0.2907637357711792,
0.12430664151... | |
goto :eof
:main
setlocal enableextensions enabledelayedexpansion
call :getsize countfile.txt
endlocal
```
To reset the count, use the following extremely complicated command (I'm thinking of patenting this):
```
del countfile.txt
```
One other thing I'd suggest - you don't need to prefix every command ... | [
0.24732528626918793,
-0.1978553682565689,
0.575505256652832,
-0.19340549409389496,
-0.18682387471199036,
-0.17233125865459442,
0.4704897701740265,
-0.11588239669799805,
-0.29925936460494995,
-0.2076292484998703,
-0.21859192848205566,
0.7490401268005371,
-0.43101730942726135,
-0.10489850491... | |
I'd like to have a World Clock on my PocketPC. Getting the Local Time is no problem, and getting the UTC Time is even less a Problem. But I seem unable to get a specific Time Zone? Say I want the current Time Zone for New York, not knowing if it's Daylight Saving Time or not (so I do not know if it's Eastern Time (GMT-... | [
0.5022137761116028,
-0.025528956204652786,
0.6189412474632263,
0.1631746143102646,
0.2607339918613434,
0.03840092197060585,
0.17984652519226074,
0.27816611528396606,
-0.2950074374675751,
-0.7610403299331665,
0.2624821066856384,
0.343438059091568,
-0.08543001860380173,
0.15494391322135925,
... | |
time zones for the next 10 years in order to get a proper conversion...
Edit: TimeZone exists, but is an abstract Class that I'd have to implement myself, which I'd like to avoid because it's error prone and requires some magic on the DST Turnaround dates.
The OpenNetCF library supports [TimeZones](http://blog.opennet... | [
0.16722653806209564,
-0.25409892201423645,
0.5854499936103821,
0.2676364779472351,
0.34935125708580017,
-0.23497706651687622,
0.25297436118125916,
-0.0029221312142908573,
-0.25978437066078186,
-0.8962234258651733,
-0.29266443848609924,
0.27716296911239624,
-0.2228476107120514,
0.1901336163... | |
For a project of mine, I am writing some STL containers from scratch (I have my reasons). Since I am mimicking the functionality and interfaces of the STL so closely I am doing my best to keep with the policy "if it has the same name as a standard construct, it will conform to the standard as much as possible."
So, of... | [
0.14827130734920502,
0.16028642654418945,
-0.263565331697464,
0.11526906490325928,
-0.014482608065009117,
-0.11609154939651489,
-0.327404648065567,
0.03351157531142235,
-0.30662691593170166,
-0.6727348566055298,
0.015659034252166748,
0.2679770588874817,
-0.3058754503726959,
0.1438336074352... | |
This makes sense since where you get memory from is more or less irrelevant to properly constructing an object in c++.
So there are two construction/deallocation functions which look like this for the default implementation (lifted straight from a book):
```
void construct(pointer p, const T& val) { new(p) T(val);... | [
0.24352429807186127,
0.01978817954659462,
0.08689258247613907,
-0.043911710381507874,
0.16529306769371033,
0.019353702664375305,
0.08529540151357651,
-0.6006602048873901,
-0.4127438962459564,
-0.6487618684768677,
-0.3582603633403778,
0.6811268925666809,
-0.16817009449005127,
0.255209416151... | |
and destructor syntax? can a "correct" allocator implement these in another way? Or am I guaranteed that all allocator implementations which conform to the standard will have there construct/destroy methods implemented in this way?
More to the point, is it safe to say that I can always use the `std::uninitialized_copy... | [
0.26982372999191284,
0.3682840168476105,
0.07150411605834961,
0.18297399580478668,
0.061362821608781815,
0.07053663581609726,
0.21273857355117798,
-0.07362321019172668,
-0.2603260576725006,
-0.4639362692832947,
-0.23401980102062225,
0.7185020446777344,
-0.15109547972679138,
-0.028399599716... | |
must happen in the construct/destroy functions | [
0.23353444039821625,
0.2689396142959595,
0.07400262355804443,
-0.04473097249865532,
0.2493468075990677,
-0.27052730321884155,
0.45164597034454346,
-0.2970873713493347,
0.2784907817840576,
-0.3456519544124603,
-0.5137466192245483,
0.42947620153427124,
-0.11839582026004791,
0.202221333980560... | |
I am getting a java.sql.SQLException: No suitable driver when I am trying to connect to a database with Java. I am on Mac OS 10.5 using the NetBeans IDE. It seems to be having trouble with the EmbeddedDriver, but I'm not sure what I am missing:
```
public class A
{
Connection conn = null;
publ... | [
-0.13252270221710205,
0.13364890217781067,
0.39614322781562805,
-0.12890887260437012,
-0.001934644067659974,
-0.29827994108200073,
0.5092573165893555,
0.2469324767589569,
-0.07167774438858032,
-0.8268110752105713,
-0.06462965905666351,
0.7108546495437622,
-0.3724079132080078,
0.42459422349... | |
try
{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
conn = DriverManager.getConnection(URL, username, password);
} | [
-0.12009580433368683,
-0.27406078577041626,
0.24243484437465668,
0.05702048912644386,
0.09146514534950256,
0.23551219701766968,
0.34502771496772766,
-0.06672903895378113,
0.40154463052749634,
-0.5233597159385681,
-0.2119559645652771,
0.7252071499824524,
-0.3638819754123688,
0.2047508955001... | |
catch (SQLException sqlException)
{
sqlException.printStackTrace();
invalidate();
}
catch (ClassNotFoundException classNotFound) | [
0.08458340913057327,
-0.2385554164648056,
0.08721467852592468,
-0.1519487500190735,
0.07363912463188171,
-0.08694473654031754,
0.11709345132112503,
-0.29137060046195984,
-0.12649841606616974,
-0.11862408369779587,
0.03645918890833855,
0.29248934984207153,
-0.43088656663894653,
-0.002225043... | |
{
classNotFound.printStackTrace();
invalidate();
}
}
}
```
"No suitable driver" usually means that the URL you've supplied to connect has incorrect syntax. What is | [
0.11455349624156952,
0.054409272968769073,
0.023377427831292152,
0.13016028702259064,
0.2391129434108734,
-0.303238183259964,
0.38729462027549744,
0.2419394552707672,
0.11364775896072388,
-0.49712055921554565,
-0.23313292860984802,
0.5558839440345764,
-0.4385760724544525,
0.399202853441238... | |
your URL?
The server version would have a host and port; I believe the embedded URL should be "jdbc:derby:flixnet", according to these docs: <http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html> | [
0.42701685428619385,
-0.36491355299949646,
0.4756385087966919,
0.02567831240594387,
0.03047492727637291,
-0.3797876536846161,
-0.1006394773721695,
0.28025758266448975,
0.25123533606529236,
-0.2994149923324585,
0.07580775022506714,
0.8299347758293152,
-0.1765342801809311,
0.0345323421061039... | |
Here is the script to create my tables:
```
CREATE TABLE clients (
client_i INT(11),
PRIMARY KEY (client_id)
);
CREATE TABLE projects (
project_id INT(11) UNSIGNED,
client_id INT(11) UNSIGNED,
PRIMARY KEY (project_id)
);
CREATE TABLE posts (
post_id INT(11) UNSIGNED,
project_id INT(11) UNSIGNED,
... | [
-0.02208453230559826,
0.3239286243915558,
0.30940937995910645,
-0.13945220410823822,
-0.22328825294971466,
0.18625508248806,
0.1667616218328476,
-0.1670953333377838,
-0.3178459703922272,
-0.7081227898597717,
-0.08801884204149246,
0.15474802255630493,
-0.3379260003566742,
0.3037919700145721... | |
projects that have the passed `client_id`.
This is not working right now because no posts are deleted.
You just need to specify that you want to delete the entries from the `posts` table:
```
DELETE posts
FROM posts
INNER JOIN projects ON projects.project_id = posts.project_id
WHERE projects.client_id = :client_id
`... | [
0.4088314175605774,
0.2822660803794861,
0.2587845027446747,
0.08385521173477173,
-0.027392901480197906,
-0.4374687373638153,
0.1130620464682579,
-0.2128104865550995,
-0.602128267288208,
-0.49712976813316345,
-0.10808572918176651,
0.18081322312355042,
-0.19093205034732819,
0.387204051017761... | |
Any website with a non-trivial amount of Javascript code is going to want to compress it for deployment. What's the best way to do this?
One way is to write a shell script that calls the minification programs and then calls appcfg.py when it's done. I'm not sure if appcfg.py itself has any support for hooks to trigger ... | [
0.44713494181632996,
-0.028758002445101738,
0.2889449894428253,
0.15318530797958374,
-0.16953133046627045,
-0.25902223587036133,
0.2022813856601715,
0.12225078046321869,
-0.25885528326034546,
-0.537751317024231,
-0.10142205655574799,
0.6796279549598694,
-0.43014824390411377,
-0.09113837033... | |
runtime is a little bit too much of a performance hit.
A shell script might look something like this:
```
rm root/js/js.js
cat root/js/*.js > root/js/js.js
java -jar ~/opt/yuicompressor-2.4.2.jar root/js/js.js -o root/static/js.js --line-break 4000
``` | [
-0.18012960255146027,
-0.29009902477264404,
0.3649340271949768,
-0.17218302190303802,
0.11017452925443649,
-0.03552659600973129,
0.5361671447753906,
-0.1405288130044937,
-0.06064561381936073,
-0.4854895770549774,
-0.2016007900238037,
0.7784396409988403,
-0.26110753417015076,
-0.25109204649... | |
What is the *worst* **real-world** macros/pre-processor abuse you've ever come across (please no contrived IOCCC answers \*haha\*)?
Please add a short snippet or story if it is really entertaining. The goal is to teach something instead of always telling people "never use macros".
---
p.s.: I've used macros before..... | [
0.24271179735660553,
0.1890920251607895,
-0.07205221801996231,
0.1245102509856224,
-0.16118702292442322,
-0.11212155967950821,
0.29907456040382385,
0.320718914270401,
-0.20280884206295013,
-0.5699967741966248,
0.2586385905742645,
0.770180344581604,
-0.07541198283433914,
-0.1223073154687881... | |
RETURN(result) return (result);}
int myfunction1(args) {
int x = 0;
// do something
RETURN(x)
int myfunction2(args) {
int y = 0;
// do something
RETURN(y)
int myfunction3(args) {
int z = 0;
// do something
RETURN(z)
```
Yes that's right, no closing braces in any of the functions... | [
0.15341399610042572,
0.002426225459203124,
0.3989705443382263,
-0.18734286725521088,
-0.12169019132852554,
0.08794410526752472,
0.5039907693862915,
-0.23791255056858063,
-0.15996891260147095,
-0.4239146411418915,
-0.1435408890247345,
0.366304874420166,
-0.3957125246524811,
0.16831304132938... | |
fanatical about saving as many bytes as possible because he had previously worked on systems with very limited memory. "It was for satellite. Only very few byte, so we use each byte over for many things." (bit fiddling, reusing machine instruction bytes for their numeric values) When I tried to find out what kinds of s... | [
0.40979331731796265,
-0.004900888539850712,
-0.20453667640686035,
0.21481895446777344,
0.025541385635733604,
-0.10445500910282135,
0.2305871844291687,
0.4156040847301483,
-0.5470197796821594,
-0.24948258697986603,
0.06716828793287277,
0.09979421645402908,
-0.18766000866889954,
-0.035498518... | |
this last one as "Compiler found error in code. This is punishment". | [
0.024861205369234085,
0.14329075813293457,
-0.21423225104808807,
0.001795501448214054,
-0.5223322510719299,
0.20228824019432068,
0.7429294586181641,
0.056071147322654724,
-0.16425250470638275,
-0.22230111062526703,
-0.20009954273700714,
0.18380160629749298,
-0.17190693318843842,
0.13670277... | |
I'm trying to get a better understanding of what place (if any) Macros have in *modern* C++ and Visual C++, also with reference to Windows programming libraries: What problem (if any) do Macros solve in these situations that cannot be solved without using them?
I remember reading about Google Chrome's use of WTL for M... | [
0.2792014181613922,
0.020049015060067177,
0.2583096921443939,
-0.09774021059274673,
0.2076062560081482,
0.04523675516247749,
-0.1300555020570755,
0.09510020166635513,
-0.4848071336746216,
-0.8199329376220703,
0.10483258217573166,
0.74057537317276,
-0.41841208934783936,
-0.17550987005233765... | |
MESSAGE_HANDLER_EX(WM_IME_COMPOSITION, OnImeComposition)
MSG_WM_KEYDOWN(OnKeyDown)
MSG_WM_LBUTTONDBLCLK(OnLButtonDblClk)
MSG_WM_LBUTTONDOWN(OnLButtonDown)
MSG_WM_LBUTTONUP(OnLButtonUp)
MSG_WM_MBUTTONDOWN(OnNonLButtonDown)
MSG_WM_MOUSEMOVE(OnMouseMove)
MSG_WM_MOUSELEAVE(OnMouseLeave)
MSG_WM_NCCALCSIZE(On... | [
-0.15634891390800476,
-0.26138046383857727,
0.46834439039230347,
-0.32686710357666016,
0.298108845949173,
0.09626102447509766,
0.29614898562431335,
0.07129879295825958,
-0.5061847567558289,
-0.8690950870513916,
-0.1054534837603569,
0.7835686802864075,
-0.6347561478614807,
-0.06640498340129... | |
Each MSG\_WM\_\* entry is a case statement that handles the given window message by translating its arguments from wParam and lParam into their original types and calling a helper function (which you then get to go implement) that takes those types as arguments (if appropriate—some window messages have 0 or 1 arguments... | [
-0.1505861133337021,
0.13288038969039917,
0.5465921759605408,
-0.07628820091485977,
0.07413913309574127,
0.3408060073852539,
-0.017730314284563065,
-0.037355706095695496,
-0.20387066900730133,
-0.5658971071243286,
-0.1977376490831375,
0.43371468782424927,
-0.47550109028816223,
0.0862054154... | |
defined or not. Macros that do flow control, or assume specific local variables are always defined, etc, make me quite unhappy. Especially when I have to debug them. | [
0.42732858657836914,
-0.05350085347890854,
0.024427801370620728,
0.23413796722888947,
0.02263614535331726,
0.016446569934487343,
0.018111439421772957,
0.35917791724205017,
-0.2049659788608551,
-0.5778930187225342,
-0.05037570372223854,
0.46482887864112854,
-0.24480301141738892,
0.107241585... | |
What if I want to run native Unix-like applications on Windows? What's the best application out there?
[Cygwin](http://cygwin.org/) is closest to what you are looking for, though not **exactly** like Wine.
> Cygwin is a Linux-like environment for Windows. It consists of two parts:
>
>
> 1. A DLL (cygwin1.dll) which ... | [
0.5123505592346191,
-0.05846136808395386,
0.12123103439807892,
-0.052973803132772446,
0.07987748086452484,
-0.361276239156723,
-0.034578874707221985,
0.11433303356170654,
0.16912448406219482,
-0.8561618328094482,
-0.016067370772361755,
0.6299936771392822,
-0.053427889943122864,
0.200641810... | |
So lets say there's a game that has a 'life bar' that consists of theoretical levels. As the user performs specific actions, depending on accuracy of their actions, the life bar grows at a corresponding speed. As it grows and goes into next levels, the criteria for desirable actions change and so the user now has to fi... | [
0.35146069526672363,
-0.07195092737674713,
0.19421476125717163,
0.3785647749900818,
0.3804148733615875,
0.18907615542411804,
0.3054763376712799,
-0.18335160613059998,
-0.43015605211257935,
-0.39657914638519287,
0.1343548744916916,
0.32875677943229675,
-0.11969304829835892,
0.21065303683280... | |
of any open-source games that may have similar logic.
Or perhaps if there's a name for this type of logic so I can try and find some algorithms that may help me set something like this up.
TIA
*-added*
As it seems there's probably no technical term for something like this, perhaps someone can suggest some pseudo ... | [
0.4912841022014618,
0.14004461467266083,
0.2528420686721802,
0.3274775743484497,
0.36199766397476196,
-0.2798733115196228,
-0.0008547535981051624,
0.06665556877851486,
-0.2589200735092163,
-0.3825146555900574,
0.24419552087783813,
0.606015145778656,
-0.09625127911567688,
0.0394381098449230... | |
from the action without modifier
Accuracy = [0..1] Where 0 is total miss on the action and 1 is a perfect hit.
Example: The score for a headshot
LevelModifier = [0..1] Where 0 means that in this level, it doesn't give any
scores and 1 means that the player receives the max bonus.
... | [
0.12418121099472046,
-0.31253504753112793,
0.44647732377052307,
0.16076968610286713,
-0.004321395419538021,
-0.18598783016204834,
0.5012391209602356,
-0.5301227569580078,
-0.3152494728565216,
-0.05172107741236687,
-0.2514526844024658,
0.5961599349975586,
0.13922253251075745,
-0.35176923871... | |
a difficulty modifier.
The higher the level, the more bonus you get.
ScoreDelta = (Score * Accuracy) * LevelModifier
ScoreBar += ScoreDelta
```
For the timer, you can lower their ScoreBar every second.
```
ScoreBar -= TimePenalty
```
For gameplay reasons, you can reset the timer whenever the pla... | [
-0.026297030970454216,
-0.2206518054008484,
0.37051573395729065,
0.2808438837528229,
0.024332236498594284,
0.10933678597211838,
0.43836984038352966,
-0.2605161666870117,
-0.4605969190597534,
-0.3827317953109741,
-0.28485578298568726,
0.5509418845176697,
0.234615758061409,
-0.13136689364910... | |
I'm looking for a iPhone-like "picker" control that I'm able to use on the web.
Accessibility is not a concern. JavaScript will be available on all clients and the web app will be run on an environment provided to the user. If the solution could gracefully degrade to a select box though, that would be great. Flash & S... | [
0.1849386841058731,
-0.1761380136013031,
0.2397959977388382,
0.29984134435653687,
0.16532357037067413,
0.047430139034986496,
-0.2313157469034195,
-0.01856105402112007,
-0.13006268441677094,
-0.3965704143047333,
0.2551494240760803,
0.5202317833900452,
-0.18022990226745605,
0.021726714447140... | |
answer I could just as well give it. Other people can still be looking for it (just like I did). I created this control to use it as a plugin with jQuery. See my blog:
<http://marinovdh.wordpress.com/2011/09/14/use-the-iphone-uipickerview-control-as-a-selectbox-on-your-website-with-jquery/> | [
-0.012801218777894974,
-0.3050365746021271,
0.46750786900520325,
0.19375132024288177,
-0.05115464702248573,
-0.014157187193632126,
-0.007003946229815483,
-0.16340455412864685,
-0.0910445973277092,
-0.1916881650686264,
0.01100519672036171,
0.23237477242946625,
-0.034287989139556885,
-0.1714... | |
**Question:**
* How is computer simulation, typically resource intensive?
For instance, [Simul8](http://www.simul8.com/products/what_is_simulation.htm): a Discrete Event Simulation package - why is this computationally intensive, what factors (calculations) contribute to this?
Discrete event simulation is an extremel... | [
0.23227038979530334,
-0.0016193595947697759,
-0.09340076148509979,
0.4045543074607849,
0.06886632740497589,
-0.031229041516780853,
-0.17210963368415833,
0.27662402391433716,
-0.38766390085220337,
-0.5912846326828003,
-0.07970898598432541,
0.3136667311191559,
0.044633228331804276,
0.1591508... | |
you are trying to simulate a distributed system, which many somewhat independent agents with their own simpler control logic, which together implement a very complex dynamic. In the case of computing systems, the combined working set of the simulator is at least as large as the architectural, microarchitectural, and me... | [
0.010379806160926819,
-0.1500568985939026,
-0.04462689161300659,
0.44300147891044617,
0.12917856872081757,
0.23227280378341675,
0.4088614284992218,
-0.02530854381620884,
-0.5268124938011169,
-0.780425488948822,
-0.01960873231291771,
0.29734233021736145,
-0.39385077357292175,
0.135626748204... | |
can affect performance by one to two orders of magnitude. This pattern is unavoidable, as running each component independently for multiple timesteps and only merging the results periodically is problematic, and more so the more complex and coupled your system is.
Additionally, you often want to keep all kinds of stat... | [
0.09235271066427231,
-0.01247724611312151,
0.21835826337337494,
0.46469706296920776,
0.13375245034694672,
0.02133076824247837,
0.4793207347393036,
-0.15813516080379486,
-0.3988209366798401,
-0.6727786064147949,
0.11055555194616318,
0.3617842197418213,
-0.2785479426383972,
0.125100150704383... | |
even substantially *different* than the host machine on which the simulation runs, and if you have any significant amount of instrumentation.
One last thing: discrete event simulation often involves placing items in queues and finding which queue in which to place a request based on chasing a bunch of pointers. These ... | [
0.2630973160266876,
-0.17292334139347076,
-0.1524602472782135,
0.5559585690498352,
-0.09265275299549103,
-0.19925911724567413,
0.20730037987232208,
0.10072215646505356,
-0.5906572937965393,
-0.6280332207679749,
0.08946704864501953,
0.17868059873580933,
-0.26063859462738037,
0.1282108575105... | |
I'm making a program that takes a snapshot of the screen, and saves it to a folder as a Bitmap picture. I seem to be running into a problem though, the picture just overwrites itself.
Can anyone tell me how I can make it so when it saves, the number will be one higher than the last? For example: Save 1: Screenshot0001... | [
0.865068793296814,
-0.14082179963588715,
0.36200353503227234,
0.10443545877933502,
0.11114496737718582,
0.15969794988632202,
0.19948191940784454,
-0.2137843817472458,
-0.48462456464767456,
-0.6925192475318909,
0.44842836260795593,
0.5594939589500427,
-0.15657828748226166,
0.069891944527626... | |
multi-user problems and you'll still have to handle situations where an image already exists.
2. Don't use a incrementing number, but write a datetime in the filename.
FileName := 'Screenshot\_'+FormatDateTime('yyyymmdd-hhnnss-zzz.bmp',now());
3. Do something like the code below to find the latest number. I think this ... | [
0.11305984109640121,
-0.09986814856529236,
0.7853814363479614,
0.04795262590050697,
0.1447269171476364,
-0.22663035988807678,
0.3334895372390747,
-0.11134777218103409,
-0.6370375752449036,
-0.7247110605239868,
-0.17440159618854523,
0.49115249514579773,
-0.4195920526981354,
0.19878982007503... | |
I'm working with an existing SQL 2005 database that was not implemented with FK relationships between tables. I tried to add the relationships with a database diagram and my application immediately blew up trying to edit or insert any data that is tied to the new FK.
```
dbo.person [person_id | firstname | lastname | ... | [
-0.3151826560497284,
0.3458833396434784,
0.4358901083469391,
-0.27403074502944946,
-0.3326236605644226,
0.29176899790763855,
-0.32161518931388855,
-0.5007667541503906,
-0.35984405875205994,
-0.5764753818511963,
0.21341055631637573,
0.0691860243678093,
-0.23839089274406433,
-0.0228161606937... | |
[person_campaigns_id] [int] IDENTITY(1,1) NOT NULL,
[person_id] [int] NOT NULL,
[d_campaign_id] [int] NOT NULL,
[d_physician_disposition_id] [int] NULL,
CONSTRAINT [PK_person_campaigns] PRIMARY KEY CLUSTERED
(
[person_campaigns_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP... | [
-0.10490529984235764,
0.07485523819923401,
0.6233874559402466,
-0.0793725773692131,
-0.0232170931994915,
0.4076380729675293,
-0.1407063603401184,
-0.8547288775444031,
-0.3130112290382385,
-0.4673049747943878,
-0.1258753091096878,
0.31727665662765503,
-0.34806808829307556,
-0.00618401169776... | |
[d_campaign_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[d_campaign] ADD CONSTRAINT [DF_d_campaign_isactive] DEFAULT ((1)) FOR [isactive]
GO
CREATE TABL... | [
-0.1777394711971283,
-0.1494734287261963,
0.6196081042289734,
-0.26431456208229065,
-0.14843739569187164,
0.28717389702796936,
-0.27741846442222595,
-0.6925514936447144,
-0.3487771153450012,
-0.4641970694065094,
-0.4219643175601959,
0.6642767190933228,
-0.7416558861732483,
-0.1806205511093... | |
CONSTRAINT [DF_d_disposition_isactive] DEFAULT ((1)) FOR [isactive]
GO
CREATE TABLE [dbo].[person](
[person_id] [int] IDENTITY(1,1) NOT NULL,
[firstname] [varchar](30) NULL,
[lastname] [varchar](30) NULL,
[dateofbirth] [datetime] NULL
CONSTRAINT [PK__person__0BC6C43E] PRIMARY KEY CLUSTERED
(
[pe... | [
-0.46500930190086365,
-0.1635076403617859,
0.6056312322616577,
-0.14302696287631989,
0.21808329224586487,
0.014596766792237759,
0.10170774161815643,
-0.44944998621940613,
-0.27159810066223145,
-0.6080523133277893,
-0.4714025557041168,
0.42954808473587036,
-0.32431256771087646,
0.1741861253... | |
If it "blows up" it is most likely because the tables contain foreign-key values that do not exist; you'll have to clean these up first. | [
0.239470973610878,
0.44274505972862244,
0.11007312685251236,
0.3658734858036041,
0.5767462253570557,
-0.4266035854816437,
0.03750937804579735,
-0.11713073402643204,
-0.27133867144584656,
-0.18080472946166992,
-0.33671024441719055,
0.10219281166791916,
-0.03400366008281708,
0.07412233203649... | |
How do I write condition statement in `find` or `paginate` method to allow users search in `Project` and `Project Category` names simultaneously?
Now my code looks like this
```
@projects = Project.paginate :per_page => 20, :page => params[:page], :conditions => ['name LIKE ?', "%#{params[:search]}%"]
```
So I have... | [
-0.06120714545249939,
0.14243443310260773,
0.21020974218845367,
0.11979342997074127,
-0.21318857371807098,
0.12430491298437119,
0.18012095987796783,
-0.6516589522361755,
-0.48222705721855164,
-0.43500933051109314,
-0.21132415533065796,
0.2526434063911438,
-0.07493828237056732,
0.2435049563... | |
In my [Ajax](http://en.wikipedia.org/wiki/Ajax_%28programming%29) request (using [jQuery](http://en.wikipedia.org/wiki/JQuery)) I am returning a [JSON](http://en.wikipedia.org/wiki/JSON) response.
So json.Html will have a string of HTML I want to append inside a div.
On the server side, do I have to escape the HTML a... | [
-0.27012184262275696,
-0.053348056972026825,
0.6340711116790771,
-0.18165116012096405,
-0.48729315400123596,
-0.07298419624567032,
0.3141852021217346,
-0.1961519569158554,
-0.2277967929840088,
-0.5778926610946655,
-0.46295034885406494,
0.5651048421859741,
-0.2540057301521301,
-0.1026032641... | |
Are there ways to get around the upper database size limit on Notes databases? We are compacting a database that is still approaching 60 gigs in size. Thank you very much if you can offer a suggestion.
Even if you could find a way to get over the 64GB limit it would not be the recommended solution. Splitting up the app... | [
0.4259388744831085,
0.14826418459415436,
0.19132693111896515,
0.18144090473651886,
0.2231411337852478,
-0.38613539934158325,
-0.03620767965912819,
0.11878889799118042,
-0.6626318693161011,
-0.4735054671764374,
0.4208071529865265,
-0.001930581289343536,
-0.2727108895778656,
0.24804107844829... | |
look up domain search and multi-database search in the Domino Administrator help.
* Maybe some parts of the data is "old" and could be put into one or more archive databases instead?
* Maybe you have a lot of large attachments and can store them in a series of attachment databases?
* Maybe you have a lot of complicate... | [
0.37283840775489807,
-0.10209645330905914,
0.018713323399424553,
0.4180407226085663,
0.0018031769432127476,
-0.15235894918441772,
-0.10973069071769714,
0.11586941033601761,
-0.6158482432365417,
-0.8220037817955017,
0.2917158305644989,
0.23120367527008057,
-0.1758003830909729,
0.22484855353... | |
increase the size of the view index.) | [
0.1324903964996338,
-0.14684344828128815,
0.7125047445297241,
-0.06143670901656151,
0.10743429511785507,
0.15186120569705963,
0.09334787726402283,
-0.05580709129571915,
-0.20664185285568237,
-0.5553574562072754,
-0.21583764255046844,
0.5819151401519775,
-0.0880013033747673,
-0.218267604708... | |
Recently I changed a bunch of columns to utf8\_general\_ci (the default UTF-8 collation) but when attempting to change a particular column, I received the MySQL error:
```
Column 'node_content' cannot be part of FULLTEXT index
```
In looking through docs, it appears that MySQL has a problem with FULLTEXT indexes on ... | [
-0.1662319004535675,
0.07088638097047806,
0.7983522415161133,
-0.23968496918678284,
-0.32119810581207275,
0.04874831438064575,
0.1494268774986267,
0.09755483269691467,
-0.2093762755393982,
-0.8284783363342285,
-0.15933239459991455,
0.5696170926094055,
-0.32021066546440125,
0.46145835518836... | |
utf8\_unicode\_ci on one of its columns, and utf8\_general\_ci on its other columns. | [
-0.5275317430496216,
-0.062055014073848724,
0.5880663394927979,
-0.31448137760162354,
-0.3325040936470032,
0.45024359226226807,
-0.16032201051712036,
-0.10975512862205505,
0.08788171410560608,
-0.7582632899284363,
-0.4132803976535797,
0.2234198898077011,
-0.5712791085243225,
0.205493047833... | |
I have a MS Access database and I want to convert it to run on MS SQL Server.
How can I export it?
You can also use SQL Server Integration Services to import into SQL Server (2005), rather than export. | [
0.017959991469979286,
0.339809775352478,
0.03345894441008568,
0.03871441259980202,
0.0864512175321579,
0.04572386294603348,
0.2518593668937683,
0.1285705268383026,
-0.2560369670391083,
-0.5349884629249573,
0.2514462471008301,
0.35295048356056213,
-0.3859937787055969,
0.36905232071876526,
... | |
I have been doing some work lately with a Pre-compiled .NET3.5 app so i have had to write alot of inline code and i was just wondering about the usage of the # and = and niether when doing inline code?
* <%= is the [equivalent of Response.Write()](http://msdn.microsoft.com/en-us/library/6dwsdcf5.aspx)
* <%# is for [Bin... | [
0.15173684060573578,
0.27821260690689087,
0.5373837351799011,
0.021165315061807632,
-0.22263334691524506,
0.12894552946090698,
0.41886383295059204,
-0.28191718459129333,
-0.053315669298172,
-0.6523427367210388,
-0.14963912963867188,
0.626095175743103,
-0.4813649356365204,
-0.07994004338979... | |
I'm using Perl's [Archive::Tar](http://search.cpan.org/dist/Archive-Tar) module. Problem with it is it pulls everything on to the memory and the does archiving and then writes on to the file system so there is limitation on the maximum file size that can be archived. Most of the times it says out of memory. In case of ... | [
0.3983059227466583,
0.037819504737854004,
0.0596851110458374,
-0.16506871581077576,
-0.1001703217625618,
-0.3222188353538513,
0.07299123704433441,
-0.08557495474815369,
-0.20999564230442047,
-0.5141871571540833,
-0.030843382701277733,
0.6032468676567078,
-0.28662148118019104,
0.29579061269... | |
The downside is that it requires tar to be available on the system it is run on. Still, it is better than puppet-stringing tar yourself. | [
0.4098953306674957,
-0.6026557683944702,
-0.03107381798326969,
0.300580233335495,
0.3526327908039093,
-0.014180556870996952,
0.02970222570002079,
0.04026270657777786,
0.05046934261918068,
-0.18565914034843445,
-0.05434035137295723,
0.6296008229255676,
-0.21697893738746643,
0.03371311724185... | |
1. Is this guaranteed to be always true:
```
std::numeric_limits<int>::max() == INT_MAX
```
What does C++ standard say about it? I could not find any reference in the standard that would explicitly state this, but I keep reading that those should be equivalent.
2. What about C99 types that are not in C++98 standard ... | [
0.29144594073295593,
0.07373002171516418,
0.2697901129722595,
-0.18270820379257202,
0.09021471440792084,
-0.45448991656303406,
0.13200294971466064,
-0.1391916275024414,
-0.13927622139453888,
-0.07832082360982895,
-0.025607865303754807,
0.9204314351081848,
-0.42486605048179626,
-0.299771130... | |
Equivalent to `CHAR_MIN, SHRT_MIN, FLT_MIN, DBL_MIN,` etc.
>
>
> Equivalent to `CHAR_MAX, SHRT_MAX, FLT_MAX, DBL_MAX,` etc
However, those are in footnotes. ISO/IEC Directives Part 3: "[Footnotes] shall not contain requirements." Though footnotes to tables or figures may be requirements. | [
0.20925845205783844,
0.2155926674604416,
0.38338837027549744,
0.12453268468379974,
0.014931384474039078,
0.07786999642848969,
0.03748239204287529,
-0.06667456775903702,
0.07496175915002823,
-0.3955227732658386,
-0.5237589478492737,
0.30398544669151306,
0.17027276754379272,
-0.0836639478802... | |
public static void Refer(ref int a,ref int b)
in this how do i find that these variables are reference variable programatically ..how do i find their type
Do you mean you want to know via reflection that the method parameters are by-ref?
You use [`MethodBase.GetParameters`](http://msdn.microsoft.com/en-us/library/... | [
0.12843498587608337,
0.03968089073896408,
0.32211098074913025,
0.032175272703170776,
-0.2717500627040863,
0.018322421237826347,
0.16133823990821838,
-0.44792062044143677,
-0.0892578735947609,
-0.411284863948822,
-0.09436067193746567,
0.4914410710334778,
-0.4446040987968445,
0.3112076520919... | |
static void Main()
{
MethodInfo method = typeof(Test).GetMethod("Refer");
ParameterInfo[] parameters = method.GetParameters();
foreach (ParameterInfo parameter in parameters)
{
Console.WriteLine("{0} is ref? {1}",
parameter.Name, | [
-0.03731663152575493,
-0.26506340503692627,
0.38494357466697693,
0.0009470899240113795,
0.1526792049407959,
0.2653922140598297,
0.4162004590034485,
-0.23496471345424652,
-0.01364616397768259,
-0.20257295668125153,
-0.10010258108377457,
0.4571664333343506,
-0.36687013506889343,
0.3794021010... | |
parameter.ParameterType.IsByRef);
}
}
}
```
You can't do this in a "strong" way for a variable using `a.GetType()` or `typeof(a)` etc. `GetType()` finds the type of the *value* of `a`, which is just an `int`. | [
-0.07907629013061523,
-0.11809174716472626,
0.007171126082539558,
-0.2893943190574646,
-0.13099168241024017,
-0.2163270115852356,
0.3891981542110443,
-0.35626858472824097,
0.07250895351171494,
-0.30033132433891296,
-0.17503997683525085,
0.5414090156555176,
-0.5087401270866394,
0.2762780189... | |
I have a dll which comes from a third party, which was written in C++.
Here is some information that comes from the dll documentation:
```
//start documentation
RECO_DATA{
wchar_t Surname[200];
wchar_t Firstname[200];
}
```
Description:
Data structure for receiving the function result. All function result will be
s... | [
0.08070170879364014,
0.07735177129507065,
0.9191177487373352,
-0.14104308187961578,
-0.21649062633514404,
0.03681192174553871,
-0.0932091549038887,
-0.430451899766922,
-0.045099396258592606,
-0.5584938526153564,
-0.2895098328590393,
0.5345364212989807,
-0.26133549213409424,
0.0843349993228... | |
public class cnOCRsdk
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECO_DATA{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=200)]
public string FirstName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 200)]
public string Surname;
}
... | [
-0.18821005523204803,
-0.07982485741376877,
0.15093287825584412,
0.011239494197070599,
0.11092202365398407,
0.3122328221797943,
-0.059291157871484756,
-0.22322691977024078,
-0.16718578338623047,
-0.5098822712898254,
-0.39775410294532776,
0.28245434165000916,
-0.22771604359149933,
0.2032508... | |
= new cnOCRsdk.RECO_DATA();
string path = @"C:\WINDOWS\twain_32\twainrgb.bmp";
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
byte[] bytes = encoding.GetBytes(path);
bool res = cnOCRsdk.recoCHN_P_Name(bytes, recoData);
```
And the error I'm getting is
""Unable... | [
-0.022768555209040642,
0.22899892926216125,
0.5024295449256897,
-0.14102257788181305,
0.011909624561667442,
0.17920537292957306,
0.47480833530426025,
-0.023005688562989235,
-0.4150863587856293,
-0.725796103477478,
-0.5139905214309692,
0.6225970983505249,
-0.26012563705444336,
0.14657987654... | |
I do not want the user login block to be displayed for users who are not admin.
I only want it to be displayed for the admin user (sitadmin, uid:1, in my case) and users who are not logged in (uid:0)
In the configure page (/admin/build/block/configure/user/0) for the block, under page specific settings, I have select... | [
0.21390694379806519,
0.3555438220500946,
0.5156323909759521,
-0.24019891023635864,
-0.18004825711250305,
-0.13367272913455963,
0.5266321301460266,
-0.09886277467012405,
0.011178186163306236,
-0.6042342185974121,
-0.12781782448291779,
0.4652036726474762,
-0.3261653184890747,
0.2330763489007... | |
other hand, if I simply put
```
<?php return FALSE;?>
```
The user block is not shown for anonymous users.
Note: Role specific visibility settings do not seem to have an effect on this.
it also could be that in the `$user` array, uid is actually a string. so when you give it the `===` it tries to compare type as we... | [
0.09933632612228394,
-0.08530610799789429,
0.13315029442310333,
0.065154530107975,
-0.2344866394996643,
-0.1724076122045517,
0.3763081431388855,
-0.08063394576311111,
-0.14077399671077728,
-0.6574451327323914,
0.18349318206310272,
0.6513339281082153,
-0.24581307172775269,
0.147821009159088... | |
someone is NOT logged in? How is that different from normal? | [
0.6794487833976746,
0.2223197966814041,
0.2822072505950928,
0.11769664287567139,
0.3466852009296417,
-0.5497157573699951,
0.5543316006660461,
0.27640384435653687,
-0.5879484415054321,
-0.3257003426551819,
0.09164057672023773,
0.17452505230903625,
0.03332117572426796,
-0.22400188446044922,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.