text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I like to make a .htaccess file to redirect any errors I get from a web site.
I have deleted all pages from the old site. But I have no idea what pages people have bookmaked.
The new webpage and website structure is totally different ... so no page is the same as the old one, not event the index document that changed... | [
0.4720005691051483,
0.1421024054288864,
0.3540182411670685,
0.34326404333114624,
-0.16161386668682098,
-0.3323136866092682,
0.08170798420906067,
0.21698105335235596,
-0.18004941940307617,
-0.6816919445991516,
0.35566607117652893,
0.46836915612220764,
-0.23533719778060913,
0.149103894829750... | |
is the file:
```
#404 - Not Found The requested URL was not found on this server
ErrorDocument 404 http://acecrodeo.com/new/01-acec.php?lang=fra
#400 - Bad Request Your browser sent a request that this server could not understand
ErrorDocument 400 http://acecrodeo.com/new/01-acec.php?lang=fra
#401 - Authorization Re... | [
-0.031009558588266373,
0.36855852603912354,
0.5159103274345398,
0.21475741267204285,
0.08958945423364639,
-0.3023040294647217,
0.5670437216758728,
-0.3696879744529724,
-0.2587006092071533,
-0.29106584191322327,
-0.44742506742477417,
0.5144867300987244,
-0.4732808768749237,
0.26202714443206... | |
http://acecrodeo.com/new/01-acec.php?lang=fra
#406 Not Acceptable
ErrorDocument 406 http://acecrodeo.com/new/01-acec.php?lang=fra
#409 Conflict
ErrorDocument 409 http://acecrodeo.com/new/01-acec.php?lang=fra
##413 - Request Entity Too Large The requested resource does not allow request data with GET requests, or the... | [
-0.2166919857263565,
0.34894314408302307,
0.7472203969955444,
0.10679702460765839,
0.13130049407482147,
-0.08379577845335007,
0.730438232421875,
-0.6568528413772583,
-0.23002506792545319,
-0.3635593354701996,
-0.35045287013053894,
0.6753696799278259,
-0.35757914185523987,
0.150327324867248... | |
!
#301 - Moved Permanently The document has moved URL here
ErrorDocument 301 http://acecrodeo.com/new/01-acec.php?lang=fra
#302 - Found The document has moved URL here
ErrorDocument 302 http://acecrodeo.com/new/01-acec.php?lang=fra
#303 - See Other The answer to your request is located URL here
ErrorDocument 302 htt... | [
0.15136025846004486,
0.44878441095352173,
0.748010516166687,
-0.019801679998636246,
0.10264930129051208,
-0.026749474927783012,
0.7035406827926636,
-0.6486988663673401,
-0.22562547028064728,
-0.1722228229045868,
-0.43653151392936707,
0.7761397361755371,
-0.2644602656364441,
-0.012965431436... | |
a valid Content-length
ErrorDocument 411 http://acecrodeo.com/new/01-acec.php?lang=fra
```
---
what about php request
if i request aaa.php (old file) and the new file request aaa.php?lang=eng
it come up with an error... what should i do, redirect ?
Finally managed to find the issue: the build used Nant to do most ... | [
0.3892521858215332,
0.21137307584285736,
0.28636592626571655,
0.11140206456184387,
-0.29877278208732605,
-0.14086951315402985,
0.5451660752296448,
-0.3585578501224518,
-0.34750762581825256,
-0.4559915363788605,
0.25897884368896484,
0.49597233533859253,
-0.10540209710597992,
0.3427251875400... | |
I recently read the questions that recommend against using switch-case statements in languages that do support it. As far as Python goes, I've seen a number of switch case replacements, such as:
1. Using a dictionary (Many variants)
2. Using a Tuple
3. Using a function decorator (<http://code.activestate.com/recipes/... | [
0.13153260946273804,
-0.002389378845691681,
-0.2068479210138321,
-0.0837492123246193,
-0.10107431560754776,
0.09820203483104706,
0.4058781564235687,
0.0019834127742797136,
-0.20016688108444214,
-0.5642906427383423,
-0.3057122528553009,
0.4086751639842987,
-0.33195170760154724,
-0.164982840... | |
these methods over the other in general. In addition, I would appreciate advice on what to do in the specific cases where I am having trouble deciding (with an explanation of the choice).
Here is the specific problem:
(1)
```
def _setCurrentCurve(self, curve):
if curve == "sine":
self.currentC... | [
-0.3823430836200714,
-0.493221640586853,
0.7676969170570374,
-0.24842827022075653,
0.0776636004447937,
0.0231771320104599,
0.06007837504148483,
-0.6135460734367371,
-0.12065982073545456,
-0.4507494866847992,
0.07275069504976273,
0.4616665840148926,
-0.1791365146636963,
0.14336267113685608,... | |
centerPos = (0.0, 0.0))
elif curve == "quadratic":
self.currentCurve = QuadraticCurve(lineColor = (0.0, 0.0, 0.0))
```
This method is called by a **qt-slot** in response to choosing to draw a curve from a menu. The above method will contain a total of 4-7 curves once the application is complete. I... | [
-0.22404997050762177,
-0.23040857911109924,
0.7654857635498047,
-0.00884430855512619,
-0.05305903032422066,
0.311569482088089,
0.033632855862379074,
-0.23483292758464813,
-0.06167560815811157,
-0.7311700582504272,
-0.07518070191144943,
0.46645352244377136,
0.06595242768526077,
0.0577370375... | |
\*\*kargs here (with a friends help) since all the curve classes use \*\*kargs...
(2)
This second piece of code is a **qt-slot** that is called when the user changes a property of a curve. Basically the slot takes the data from the gui (spinBox) and puts it in an instance variable of the appropriate curve class. In... | [
-0.1932128220796585,
-0.23796986043453217,
0.2166023850440979,
-0.06529030948877335,
-0.21288920938968658,
-0.024547571316361427,
-0.21125644445419312,
-0.25263193249702454,
0.122771255671978,
-0.7425367832183838,
0.015084235928952694,
0.5674105882644653,
-0.2267683446407318,
0.20354747772... | |
self.amplitude = value
elif name == "expansionFactor":
self.expansionFactor = value
elif name == "startAngle":
self.startAngle = value
elif name == "endAngle":
self.endAngle = value
```
For reference, here is the code for connecting to the above slot -
```
def _connectToPage(se... | [
-0.436204731464386,
-0.22792649269104004,
0.4612150192260742,
-0.14450033009052277,
-0.09109331667423248,
0.21369583904743195,
0.06007005274295807,
-0.4603385329246521,
-0.27062466740608215,
-0.7315608263015747,
0.011773387901484966,
0.5776069164276123,
-0.259827584028244,
0.21761235594749... | |
SIGNAL(connectionData["signal"]),
lambda value, name = connectionData["property"]:\
self.currentCurve.propertyChanged(name, value))
self.connect(connectionData["object"],
SIGNAL(connectionData["signal"]), | [
-0.21680887043476105,
-0.2781953811645508,
0.6201760172843933,
0.05299723148345947,
0.19717855751514435,
0.2522534430027008,
-0.012465107254683971,
-0.284060537815094,
-0.33989790081977844,
-0.5270840525627136,
-0.010996677912771702,
0.43198147416114807,
-0.5704767107963562,
0.385860264301... | |
self.hackedDisplayArea.update)
```
**Note** - The self.endAngle etc. are initialized in the constructor.
As far as I know, the reasons for choosing a dict is for fast lookup. When is that warranted? when I have 100 cases or more? Is it a good idea to keep building and throwing away a dictionary each time the functi... | [
0.16567304730415344,
0.20497296750545502,
0.1446201354265213,
-0.036669787019491196,
-0.26034045219421387,
-0.07429397106170654,
0.4961238503456116,
-0.17736011743545532,
0.27233627438545227,
-0.7370384931564331,
0.18035344779491425,
0.7109152674674988,
-0.03745352104306221,
-0.44031745195... | |
What is the best/most elegant way to go about things? Put in yet another way, when to use **if-elif-else**, when to use each of the other options?
Sigh. Too much hand-wringing over the wrong part of the problem. The switch statement is not the issue. There are many ways of expressing "alternative" that don't add **mean... | [
0.14530682563781738,
-0.28109338879585266,
0.25256243348121643,
0.2870291769504547,
-0.07915683090686798,
-0.1542903482913971,
0.20546682178974152,
-0.18812085688114166,
-0.13528402149677277,
-0.7767611742019653,
0.02705102413892746,
0.5947398543357849,
0.01791536435484886,
-0.246780648827... | |
on the fly each time you need it is silly. You can use this if it's what you **mean**: your "conditions" are simple, static key values that map to objects.
* **Variant behavior among subclasses**. Use Polymorphism instead of type checking objects. Correct. If you have similar objects in multiple classes with variant be... | [
0.3034045696258545,
-0.4299086630344391,
-0.26812416315078735,
0.2583177387714386,
-0.07742375135421753,
-0.20739486813545227,
0.18905073404312134,
-0.07308419793844223,
-0.43948668241500854,
-1.0089972019195557,
0.001823541009798646,
0.5476564168930054,
-0.7162575721740723,
-0.18037258088... | |
achieve similar results.
Using a Tuple. This is just dictionary without the mapping. This requires search, and search should be avoided whenever possible. Don't do this, it's inefficient. Use a dictionary.
Using a function decorator (<http://code.activestate.com/recipes/440499/>). Icky. This conceals the if-elif-elif... | [
0.29300379753112793,
-0.17824968695640564,
0.09715253114700317,
0.11897522956132889,
-0.09163842350244522,
-0.13945439457893372,
0.6935398578643799,
-0.037120457738637924,
-0.18761363625526428,
-0.9643315672874451,
-0.21720781922340393,
0.619377851486206,
-0.3188779354095459,
-0.1181167364... | |
i have the following template method,
```
template <class T>
void Class::setData( vector<T> data )
{
vector<T>::iterator it;
}
```
and i'm getting the following compilation error ( XCode/gcc )
> error: expected `;' before 'it'
i found someone else with a similar problem [here (read down to see it's the sam... | [
0.2526839077472687,
0.06368362158536911,
0.07596796005964279,
-0.22421549260616302,
-0.21148383617401123,
0.0008741908823139966,
0.23912906646728516,
-0.38728728890419006,
-0.3527737557888031,
-0.7201279401779175,
0.05512446165084839,
0.6291651725769043,
-0.40225687623023987,
0.08013626933... | |
way i would prefer to implement this function. Is there another way around this?
Thanks
Classic case of when to use the `typename` keyword. Hoping that you have `#include`-ed `vector` and `iterator` and have a `using namespace std;` somewhere in scope. Use:
```
typename vector<T>::iterator it;
```
Look up dependent ... | [
0.3539661169052124,
-0.2500458061695099,
0.7219496369361877,
-0.11143561452627182,
-0.04515456780791283,
-0.04712572693824768,
0.27804163098335266,
0.022735897451639175,
-0.13688471913337708,
-0.9923575520515442,
-0.019832734018564224,
0.5375289916992188,
-0.4036698043346405,
0.08299048244... | |
I have a class called `IssuesView` which implements `INotifyPropertyChanged`. This class holds an `ObservableCollection<Issue>` and exposes it as a `DependencyProperty` called Issues for consumption by `Bindings`. It is defined as below -
```
public class IssuesView : DependencyObject, INotifyPropertyChanged
{
... | [
0.06467489898204803,
0.13442547619342804,
0.7085739970207214,
-0.06497595459222794,
0.03557349741458893,
0.10897152870893478,
-0.19790029525756836,
-0.2772725522518158,
-0.10322016477584839,
-0.5390391945838928,
-0.19674934446811676,
0.7745999097824097,
-0.2443183809518814,
-0.016930170357... | |
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("Issues"));
}
}
}
// Using a DependencyProperty as the backing store for Issues. This enables animation, styling, binding, etc...
public static readonly DependencyProperty Issu... | [
-0.031335026025772095,
0.041017353534698486,
0.5952019095420837,
0.09921016544103622,
0.432174414396286,
0.05790853500366211,
-0.09959501028060913,
-0.29893726110458374,
-0.4414999783039093,
-0.3658428490161896,
-0.27848440408706665,
0.6308093667030334,
-0.2613012194633484,
-0.002597569720... | |
new UIPropertyMetadata(null));
public IssuesView()
{
Refresh();
}
public void Refresh()
{
this.Issues = new Issues();
}
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
#endregion
}
```
I have a test page declared... | [
-0.3513118028640747,
-0.1774757355451584,
1.026684284210205,
0.03593485429883003,
-0.06401955336332321,
-0.32152608036994934,
0.08933897316455841,
-0.6326170563697815,
-0.4694877862930298,
-0.5553799867630005,
-0.3809714615345001,
0.3531128168106079,
0.012956551276147366,
0.164487302303314... | |
the event hadnler for the button i have this code -
```
private void Button_Click(object sender, RoutedEventArgs e)
{
IssuesView iv = Application.Current.FindResource("issuesView") as IssuesView;
if (!once)
{
foreach (Issue i in iv.Issues)
{
i.Dorman... | [
-0.013533899560570717,
-0.17150677740573883,
0.812580406665802,
-0.36316803097724915,
-0.0435226634144783,
0.2174246460199356,
0.14297617971897125,
-0.2205062359571457,
-0.2728171944618225,
-0.5577769875526428,
-0.12377415597438812,
0.5601928234100342,
-0.1845523715019226,
0.26079586148262... | |
0);
i.AssignedUserID = 12;
i.Name = "MyName";
i.Priority = Issue.Priorities.Critical;
i.Status = Issue.Statuses.New;
i.Summary = "NewSummary"; | [
-0.009772634133696556,
-0.060274798423051834,
0.5625424385070801,
-0.06672652065753937,
0.09751439094543457,
0.13689397275447845,
0.14281702041625977,
0.17336951196193695,
-0.259431391954422,
-0.33947721123695374,
-0.6019747853279114,
-0.037885021418333054,
-0.20324452221393585,
0.62895387... | |
}
once = true;
}
else
{
iv.Refresh();
}
```
once is a simple boolean to test mutation of the collection versus repopulation.
The first button click alters the collection's items and the UI is updated properly since the items implement INotifyPropertyChanged but... | [
0.052790895104408264,
-0.40106749534606934,
0.30529463291168213,
0.027048377320170403,
0.09306130558252335,
0.05244700610637665,
0.08284502476453781,
-0.30311715602874756,
-0.1556701958179474,
-0.7518188953399658,
-0.17962153255939484,
0.3182561993598938,
-0.3538929224014282,
0.30369332432... | |
not update the UI even though the event is not null and fires properly.
Why does the UI not update on the second click? How can i make it so that repopulating the collection will cause a UI update?
It's a case where you could use [the strategy pattern](http://en.wikipedia.org/wiki/Strategy_pattern) along with [the vis... | [
0.43704962730407715,
-0.43928396701812744,
0.5319132208824158,
0.25018638372421265,
-0.09211283177137375,
-0.07850673049688339,
0.08327920734882355,
-0.3721522390842438,
-0.29091981053352356,
-0.771457314491272,
0.13020819425582886,
0.6311982870101929,
-0.26706257462501526,
-0.192802608013... | |
into the visitor quite easily.
The voucher strategy could look something like this:
```
public interface IVoucher
{
decimal CostOf(CartItem cartItem);
}
```
The default would be something like this:
```
public class FullPriceVoucher : IVoucher
{
public decimal CostOf(CartItem cartItem)
{
return... | [
-0.3631584346294403,
-0.3468181788921356,
0.6588770747184753,
0.39293980598449707,
0.007929123006761074,
0.15435528755187988,
-0.02237229235470295,
0.3864746391773224,
-0.1464201956987381,
-0.5232552289962769,
-0.23754075169563293,
0.713288426399231,
-0.03783009201288223,
0.029172888025641... | |
visitor for calculating cart value like this:
```
public class CartValueVisitor
{
private IVoucher voucher;
public CartValueVisitor(IVoucher voucher)
{
this.voucher = voucher;
}
public decimal CostOf(Cart cart)
{
return cart.Items.Sum(item => voucher.CostOf(item));
}
}
``... | [
-0.7142805457115173,
-0.2930386960506439,
0.9337126612663269,
0.5188061594963074,
-0.3172125518321991,
0.2920283079147339,
-0.14007268846035004,
0.27185678482055664,
-0.401507705450058,
-0.46949195861816406,
-0.3581553101539612,
0.7162046432495117,
-0.12358460575342178,
0.12915846705436707... | |
fullPriceCartValueVisitor.CostOf(cart);
var tenPercentOffPrice = tenPercentOffCartValueVisitor.CostOf(cart);
```
This obviously only works with a single voucher at a time but should give you an idea of the general structure. | [
0.10838355869054794,
-0.15653996169567108,
0.8461302518844604,
0.2543397545814514,
-0.24990646541118622,
0.1162073090672493,
-0.22293640673160553,
0.11727431416511536,
-0.10644640028476715,
-0.2377452701330185,
-0.12207774072885513,
0.6199594140052795,
0.13999605178833008,
0.02395920269191... | |
I need in a DLL to use a class, defined in an executable (DLL and executable are compiled by the same compiler). But I don't want the source code of this class definition to be available to DLL, only declaration.
One possible way to do it is to make all the necessary class methods to be `virtual` (so that DLL linker w... | [
0.16346494853496552,
-0.09896349161863327,
0.06641092896461487,
0.2583261728286743,
-0.25798502564430237,
-0.3348272144794464,
0.04711340367794037,
-0.018921777606010437,
-0.08892521262168884,
-0.728474497795105,
-0.1642463058233261,
0.5793215036392212,
-0.3790954053401947,
0.4126021265983... | |
don't need to
be `virtual`.
There is a way to export a class from a DLL to an executable using Microsoft's `__declspec(dllexport)` storage-class extended attribute.
Is there a way to export a class from executable to DLL using the same technique?
My old Borland C 6 compiler does not allow me to create import library ... | [
0.35755655169487,
-0.11092805117368698,
0.2755413055419922,
0.2021838128566742,
-0.010768832638859749,
-0.39901745319366455,
0.39952343702316284,
0.3958471119403839,
-0.37758997082710266,
-0.5717214941978455,
-0.13836263120174408,
0.7294959425926208,
-0.5387241840362549,
0.3000618219375610... | |
dllexport to export a class or function from a exe and use it in a DLL. and it runs cool if your DLL and Exe execute **in one process**. | [
0.14051716029644012,
-0.4000661075115204,
0.45754876732826233,
0.24613609910011292,
0.04681630805134773,
-0.42986175417900085,
0.02757931686937809,
0.18084017932415009,
-0.08136790245771408,
-0.8971007466316223,
-0.11263986676931381,
0.6349995732307434,
-0.42756742238998413,
0.115897342562... | |
I am trying to deploy a web application to a remote server over which i have no control.
If I use FTP deployment from visual studio, I manage to get the files onto the server, but when I point my browser to the server, it gives me the standand error page:
> Server Error in '/' Application.
> Runtime Error
> Descrip... | [
0.3518756628036499,
0.38045990467071533,
0.0752386823296547,
-0.2780417799949646,
0.12221471220254898,
-0.11288329213857651,
0.5257695913314819,
0.04521962255239487,
-0.17365501821041107,
-0.7462539076805115,
-0.04389384761452675,
0.45187056064605713,
-0.16759437322616577,
0.27556255459785... | |
server machine.
>
>
> Details: To enable the details of this specific error message to be viewable on remote >machines, please create a tag within a "web.config" configuration file >located in the root directory of the current web application. This tag >should then have its "mode" attribute set to "Off".
>
>
>
>
... | [
0.03351111710071564,
0.024885041639208794,
0.4247250556945801,
0.0548270158469677,
-0.04619716852903366,
-0.23917056620121002,
0.5786454081535339,
0.16880200803279877,
-0.22232133150100708,
-0.9402920007705688,
0.040445681661367416,
0.5021612644195557,
-0.46641767024993896,
0.3052007555961... | |
text above suggests. No amount of refreshing or Cntl-F5-ing gives me anything other than the error page above.
Its most likely is that the location you have put it is not setup as an IIS Application and this is required for the .net framework application to work correctly.
As you have no control on the server you won'... | [
0.3122369945049286,
0.015504693612456322,
0.22773641347885132,
0.16349728405475616,
0.059858277440071106,
-0.3668690025806427,
0.5226230621337891,
0.03386584669351578,
-0.009760147891938686,
-0.5637115836143494,
-0.10386264324188232,
0.3007110357284546,
-0.12727227807044983,
0.310193687677... | |
Is there a way to write binary literals in C#, like prefixing hexadecimal with 0x? 0b doesn't work.
If not, what is an easy way to do it? Some kind of string conversion?
C# [7.0](https://github.com/dotnet/roslyn/issues/2136) supports [binary literals](https://github.com/dotnet/roslyn/issues/215) (and optional digit se... | [
0.03797110915184021,
0.030780840665102005,
0.14319828152656555,
0.1325070708990097,
-0.0966397151350975,
0.022588780149817467,
0.20777003467082977,
0.12108714878559113,
-0.4498775601387024,
-0.2274664342403412,
-0.26604124903678894,
0.42668455839157104,
-0.22627364099025726,
-0.34219920635... | |
I have a class, lets call it A, and within that class definition I have the following:
```
static QPainterPath *path;
```
Which is to say, I'm declaring a static (class-wide) pointer to a path object; all instances of this class will now have the same shared data member. I would like to be able to build upon this cl... | [
0.49214968085289,
-0.08076377213001251,
0.2444126158952713,
-0.2986023724079132,
-0.2168273627758026,
-0.006951665971428156,
0.14085373282432556,
-0.03415367007255554,
-0.12522901594638824,
-0.6688909530639648,
0.024893715977668762,
0.26240918040275574,
-0.44521498680114746,
0.338514953851... | |
example), I want F to use the inherited drawing routines from A, but to use the static (class-wide) path object declared in F. I have tried having the declaration above in the private section (and repeating it in the derived class F), and tried having it in the protected section, all with no joy.
I can sort of see why... | [
0.4530963897705078,
-0.06909380108118057,
0.1633094698190689,
-0.34792351722717285,
-0.08200564980506897,
0.039714135229587555,
0.32272759079933167,
-0.19911004602909088,
-0.3090861141681671,
-0.7399516105651855,
0.04649055376648903,
0.7382007837295532,
-0.5281602740287781,
-0.119932636618... | |
while still using drawing code defined in the base class, and having all classes (except perhaps the base class) be real and instantiatable?
Use a virtual method to get a reference to the static variable.
```
class Base {
private:
static A *a;
public:
A* GetA() {
return a;
}
};
class Derived: publ... | [
0.3322383761405945,
-0.24617034196853638,
0.0831075981259346,
-0.232806995511055,
-0.08977607637643814,
0.2535059452056885,
0.41925138235092163,
-0.22486424446105957,
0.02461371384561062,
-0.5138944387435913,
-0.16196028888225555,
0.6259272694587708,
-0.41835930943489075,
0.008040160872042... | |
this->GetA() ...
}
``` | [
-0.17889930307865143,
0.24155709147453308,
-0.016451122239232063,
-0.2992563247680664,
-0.3212530314922333,
-0.2940486669540405,
0.19024783372879028,
-0.05596885830163956,
0.2710029184818268,
-0.513137936592102,
-0.45169350504875183,
0.416665256023407,
-0.5044571757316589,
0.12469497323036... | |
I've just read [Apple documentation](http://developer.apple.com/documentation/Cocoa/Conceptual/Strings/introStrings.html#//apple_ref/doc/uid/10000035) for `NSScanner`.
I'm trying to get the integer of this string:
```
@"user logged (3 attempts)"
```
I can't find any example, how to scan within parentheses. Any ideas... | [
-0.0563976988196373,
0.13468720018863678,
0.5245575308799744,
-0.34276384115219116,
0.025786396116018295,
0.0992172360420227,
0.45682287216186523,
-0.48264726996421814,
-0.3073166608810425,
-0.7968723177909851,
-0.056468695402145386,
0.4515070617198944,
-0.08863779157400131,
-0.29341548681... | |
NSScanner *scanner=[NSScanner scannerWithString:data];
[scanner scanUpToString:leftData intoString: nil];
left = [scanner scanLocation];
[scanner setScanLocation:left + leftPos];
[scanner scanUpToString:rightData intoString: nil];
right = [scanne... | [
-0.28871771693229675,
-0.524326503276825,
0.5714528560638428,
-0.2931973934173584,
-0.18483717739582062,
0.18686699867248535,
-0.053434330970048904,
-0.41630256175994873,
-0.23331218957901,
-0.5384137630462646,
-0.3950788378715515,
0.3794415295124054,
-0.15747986733913422,
-0.0966527163982... | |
left += leftPos;
foundData = [data substringWithRange: NSMakeRange(left, (right - left) - 1)]; return foundData;
}
```
Then call it.
```
foundData = [self getDataBetweenFromString:data leftString:@"user logged (" rightString:@"attempts)" leftOffset:13];
```
leftOffset is the number of charact... | [
-0.5788435339927673,
-0.14724057912826538,
0.49845537543296814,
-0.31438133120536804,
0.14976437389850616,
-0.06673229485750198,
0.23345504701137543,
-0.13149957358837128,
-0.08335989713668823,
-0.4263569414615631,
-0.16852983832359314,
0.47762396931648254,
-0.10687898099422455,
-0.1630361... | |
Is there any method for creating a dynamic array in C#?
Take a look at [Generic Lists](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx). | [
0.1415315568447113,
-0.32575470209121704,
0.0800623744726181,
0.14682744443416595,
0.007775231264531612,
-0.16891416907310486,
0.12995414435863495,
0.16091227531433105,
-0.4695570766925812,
-0.24272535741329193,
-0.1659027338027954,
0.27922117710113525,
-0.4411828815937042,
-0.045149732381... | |
I get this problem in IE7 when running a piece of code that uses jquery and 2 jquery plugins. The code works in FF3 and Chrome.
The full error is:
```
Line: 33
Char: 6
Error: bg is null or not an object
Code: 0
URL: http://localhost/index2.html
```
However line 33 is a blank line.
I am using 2 plugins: draggab... | [
0.04373513162136078,
0.08244145661592484,
0.5710786581039429,
-0.2745975852012634,
-0.3195123076438904,
0.028135834261775017,
0.5925201177597046,
-0.1356503665447235,
-0.09188694506883621,
-0.8378921151161194,
-0.03871916979551315,
0.7410369515419006,
-0.45176637172698975,
-0.0870248526334... | |
$('#draggable').drag();
$('#zoom').zoom({target_div:"draggable", zoom_images:new Array('tiles/mapSpain-smaller.jpg', 'tiles/mapSpain.jpg') });
});
</script>
</body>
```
Essentially what I am trying to do is recreate the Pragmatic Ajax map demo with jQuery.
---
It would appear that the second line of this snipp... | [
-0.0038599835243076086,
-0.03197663277387619,
0.44005852937698364,
-0.11680347472429276,
-0.23138590157032013,
-0.23642131686210632,
0.37082603573799133,
0.17813150584697723,
-0.14127828180789948,
-0.6989454030990601,
-0.22245128452777863,
0.8060115575790405,
-0.524177610874176,
-0.0741195... | |
Debugger but that is nearly useless. Can't inspect variables or anything else.
A bit more digging about on the Interweb has revealed the answer: IE doesn't understand the selector `background-position`. It understands the non-standard `background-position-x` and `background-position-y`.
Currently hacking something tog... | [
0.4409717917442322,
0.10060063749551773,
-0.3377731740474701,
0.20070981979370117,
-0.2464343160390854,
-0.20268455147743225,
0.32673346996307373,
0.0514991395175457,
-0.015698686242103577,
-0.5913076996803284,
0.10039933770895004,
0.3985273540019989,
-0.3861435651779175,
-0.02129252627491... | |
I have been doing some reading on this subject, but I'm curious to see what the best ways are to optimize your use of the ASP.NET cache and what some of the tips are in regards to how to determine what should and should not go in the cache. Also, are there any rules of thumb for determining how long something should sa... | [
0.6119468212127686,
0.08157449215650558,
0.051547180861234665,
0.09141473472118378,
0.035372063517570496,
-0.13458770513534546,
0.21134816110134125,
0.15444457530975342,
-0.2658608853816986,
-0.7121811509132385,
0.11725868284702301,
0.4422913193702698,
0.2374708354473114,
0.181843504309654... | |
may not outweigh the cost of maintaining that cache item
* Contemplate the **query expense vs cache retrieval expense** (e.g. for simple reads, SQL Server is often faster than distributed cache due to serialization costs)
Some tricks
-----------
* gzip strings before sticking them in cache. Effectively expands the ca... | [
-0.008192009292542934,
-0.0580153651535511,
0.11162786185741425,
0.45945683121681213,
-0.11321678012609482,
-0.15491966903209686,
0.34359678626060486,
-0.30680975317955017,
-0.4894632399082184,
-0.8175815343856812,
0.03384256362915039,
0.49591588973999023,
-0.10371549427509308,
-0.04818040... | |
cases the benefits can be worth it (e.g. SO rep for each user might be a good candidate depending on implementation details, number of unanswered SO questions would probably be a poor candidate) | [
0.2318183332681656,
-0.0942358747124672,
0.32992953062057495,
0.4455226957798004,
-0.25650399923324585,
0.4092977046966553,
0.15447793900966644,
-0.29793331027030945,
-0.09847771376371384,
-0.5516523122787476,
-0.22739769518375397,
0.6498363018035889,
0.0799407884478569,
-0.251189708709716... | |
I really like the way ASP.NET MVC works. I'd love to implement it on all new web projects moving forward, but I hit a snag in a prototype the other day that I really haven't found a good solution for, so I ask you, how would you design an MVC app that doesn't fit the typical REST pattern? As an example, the prototype I... | [
0.5907638669013977,
-0.02108801156282425,
0.22980138659477234,
0.22984986007213593,
-0.06652965396642685,
-0.27118971943855286,
0.028770212084054947,
0.11237268894910812,
-0.489531546831131,
-0.5295572280883789,
-0.055079732090234756,
0.22727087140083313,
-0.1982080489397049,
0.05693511664... | |
might require an admin section to deal with such details as moderating sign ups or reviewing data. In a standard ASP.NET web app, I might add the following
* /Admin/Default.aspx
* /Admin/ListRegistrations.aspx
* /Admin/ViewReports.aspx ...
Would it be an unacceptable deviation from the MVC pattern, in this case, to h... | [
0.26905837655067444,
0.07297366112470627,
0.37656348943710327,
0.07256054878234863,
0.09606247395277023,
0.04905698820948601,
0.04638729989528656,
-0.4054645299911499,
-0.23134830594062805,
-0.6350424289703369,
-0.26658010482788086,
0.35607385635375977,
-0.1971176713705063,
-0.226903811097... | |
the way it's setup, but I don't really know how I'd like to see that work either.
I guess when I think MVC, I tend to think REST as well, and having controller actions that represent pages rather than actual entities or actions doesn't sit right with me. What do you think?
You can always mix ASP.NET Web Forms with MVC... | [
0.48280763626098633,
-0.35634884238243103,
0.3427902162075043,
0.3598354458808899,
0.0038501815870404243,
-0.4920281767845154,
0.062071237713098526,
-0.038817062973976135,
-0.5354987382888794,
-0.7025604248046875,
0.09767398238182068,
0.4893730878829956,
-0.46736109256744385,
-0.1580868661... | |
Before you answer **vi**...
I'm looking to set a development environment for programmers with mainly Windows/Visual Studio background. Of course Emacs and Eclipse come to mind as IDEs, any other useful tips? thanks
I think the editor is incidental. Just read the kernel coding standards on tabs, indentation, functions v... | [
0.4721803665161133,
0.11206942796707153,
0.04386596009135246,
0.34727513790130615,
-0.1892300844192505,
0.06905308365821838,
0.1936362236738205,
0.33553868532180786,
-0.12078984081745148,
-0.7890720963478088,
0.016723904758691788,
0.7506809830665588,
-0.05006249621510506,
-0.11987260729074... | |
editors.
If you kidnapped me and sat me down in front of any version of emacs then pointed a gun to my head and told me to code, I'd ask you to just shoot me. I have nothing against emacs, in fact I still have one of the few surviving copies on tape which I paid $50 to get a long time ago.
Use an editor that lets you... | [
0.5049158334732056,
0.23477493226528168,
0.043157629668712616,
0.7785506844520569,
0.011190911754965782,
0.008677924983203411,
0.08376392722129822,
0.08326983451843262,
-0.10777971148490906,
-0.5301334261894226,
0.18920986354351044,
0.8962870240211487,
-0.19652539491653442,
-0.251682043075... | |
Toyota (had to put a straw man argument in there somewhere, after all, this is debating Linux development)
In the spirit of that, I'm now going to re-tag your question. | [
0.6378681659698486,
0.2084772139787674,
0.4000249207019806,
0.1794503629207611,
-0.3690192997455597,
0.36221128702163696,
-0.5220986604690552,
0.21937784552574158,
0.17283843457698822,
-0.19819092750549316,
0.677595853805542,
0.7651861906051636,
0.2878802716732025,
0.1922929435968399,
-0... | |
Has anyone *really* wanted and used inheritance support on ORM tools, and if yes which one do you think offers the best support?
Or is ORM Inheritance a "pie in the sky" concept?
I like this question a lot. I've used ORM tools (Toplink, now eclipselink, Hibernate) for a while and I've always seen this as referenced i... | [
0.7222075462341309,
-0.0024628075771033764,
-0.11299563944339752,
0.0435786247253418,
-0.13938498497009277,
-0.17703877389431,
0.14430636167526245,
0.18835489451885223,
-0.2902560234069824,
-0.3710847496986389,
0.2554513216018677,
0.4375387132167816,
-0.08664615452289581,
0.140907570719718... | |
you from making stupid mistakes. Sure you can do fancy stuff with this, but why not save it for the controller (if you're following MVC) than stick it in the model? | [
0.4179774820804596,
-0.1540205478668213,
0.018793342635035515,
0.5644501447677612,
0.19008910655975342,
-0.3302457630634308,
-0.08644154667854309,
-0.43337690830230713,
-0.06449233740568161,
-0.017114169895648956,
0.4480908215045929,
0.8117414116859436,
-0.1772681176662445,
-0.306412041187... | |
I have a Java program, in which, I'm using a JTextField, but if i don't specify a default size, it'll have the width 0. I'm inserting it in a BorderLayout, so how do I make it expand to fill the whole container?
In the above example, the text field will work fine. However, if you insert into EAST or WEST, it will not w... | [
0.32437223196029663,
-0.052255723625421524,
0.6647884249687195,
-0.45138177275657654,
0.2801661193370819,
0.12746594846248627,
0.3158577084541321,
-0.4514220654964447,
-0.006261570379137993,
-0.8425076007843018,
-0.06473717093467712,
0.5852290987968445,
-0.5443816781044006,
0.2665345072746... | |
JTextField tf = new JTextField();
f.getContentPane().add(BorderLayout.EAST, tf);
f.pack();
f.setVisible(true);
}
}
```
My question back to you is: Does this need to be a BorderLayout or can you use other Layout Managers? If you can, you should check out GridBagLayout that you can have an e... | [
0.21751685440540314,
-0.3202618956565857,
0.5794026255607605,
-0.30043983459472656,
0.2481505274772644,
-0.3219791650772095,
-0.027415471151471138,
-0.428262323141098,
-0.18885324895381927,
-0.7653642296791077,
-0.09970703721046448,
0.4797769784927368,
-0.42910677194595337,
-0.117747254669... | |
Can anyone think of a nicer way to do the following:
```
public string ShortDescription
{
get { return this.Description.Length <= 25 ? this.Description : this.Description.Substring(0, 25) + "..."; }
}
```
I would have liked to just do string.Substring(0, 25) but it throws an exception if the string is less than ... | [
0.05249202623963356,
-0.09123389422893524,
0.19524799287319183,
-0.1926604062318802,
0.05431777983903885,
-0.18479393422603607,
0.4855272173881531,
-0.3187905550003052,
0.02594907023012638,
-0.3703189790248871,
0.02787211164832115,
0.7085100412368774,
-0.27621614933013916,
0.11638519167900... | |
not cause an arithmetic overflow - not that this is likely, but still...
if (input.Length >= (startIndex + length))
{
if (suffix == null) suffix = string.Empty;
return input.Substring(startIndex, length) + suffix;
}
else
{ | [
-0.45602142810821533,
-0.28766098618507385,
0.24567344784736633,
-0.22863543033599854,
-0.23019161820411682,
0.12876105308532715,
0.5085310339927673,
-0.2019638568162918,
-0.10299167782068253,
-0.44498831033706665,
-0.45187923312187195,
0.38984939455986023,
-0.005375554785132408,
0.1039583... | |
if (input.Length > startIndex)
{
return input.Substring(startIndex);
}
else
{
return string.Empty; | [
-0.5089496374130249,
-0.35675644874572754,
0.18207645416259766,
-0.3694804608821869,
0.1618984341621399,
-0.06917287409305573,
0.13365870714187622,
-0.2566348910331726,
-0.03034595400094986,
-0.2530175745487213,
-0.5322610139846802,
0.37492111325263977,
-0.21384066343307495,
0.140184000134... | |
}
}
}
}
```
if you only need it once, that is overkill, but if you need it more often then it can come in handy.
*Edit:* Added support for a string suffix. Pass in "..." and you get your ellipses on shorter strings, or pass in string.Empty for no special suffixes. | [
-0.07134226709604263,
-0.2137182205915451,
0.49898216128349304,
-0.02134808525443077,
-0.10976404696702957,
-0.1057257205247879,
0.231886625289917,
0.1396804004907608,
-0.13170365989208221,
-0.6381941437721252,
-0.2756350040435791,
0.48576682806015015,
-0.1433160901069641,
-0.1505534499883... | |
I'm hoping there is a way to do this with mod\_rewrite and Apache, but maybe there is another way to consider too.
On my site, I have directories set up for re-skinned versions of the site for clients. If the web root is `/home/blah/www`, a client directory would be `/home/blah/www/clients/abc`. When you access the cl... | [
0.764137327671051,
0.4110053777694702,
0.23002122342586517,
-0.23356324434280396,
0.0076813469640910625,
-0.08889661729335785,
0.39005032181739807,
0.1361861228942871,
-0.32788679003715515,
-1.0067743062973022,
0.05636277049779892,
0.5152966976165771,
-0.11028679460287094,
0.35590529441833... | |
would determine that there is no `index.html` in `/home/blah/www/clients/abc` and will instead use the one in `/home/blah/www`. Keep in mind that I don't want to redirect the client to the web root at any time, I just want to use the web root's file with that name if the client directory has not specified its own copy.... | [
0.6854397058486938,
0.34452658891677856,
0.36380285024642944,
-0.10587406903505325,
0.002429510932415724,
-0.04026010259985924,
-0.009440707974135876,
0.1262892782688141,
-0.39379817247390747,
-0.6427211761474609,
-0.2340904325246811,
0.40305095911026,
-0.258573442697525,
0.369377166032791... | |
root's `news.html`. The user's experience should be seamless.
I need this to work for requests on any filename. If I need to, for example, add a new line to `.htaccess` for every file I might want to redirect, it rather defeats the purpose as there is too much maintenance needed, and a good chance for errors given the... | [
0.06655704975128174,
-0.026916027069091797,
0.2731528580188751,
0.04527885094285011,
-0.2787003517150879,
0.020011967048048973,
0.5677489638328552,
0.42135944962501526,
-0.27706608176231384,
-0.8796020150184631,
-0.026334019377827644,
0.3722541332244873,
-0.060972075909376144,
0.2081032544... | |
to do the wrong thing in certain places, and some `/` characters seem to be missing. Here is my solution, which goes in the `.htaccess` in the web root.
Instead of using two rules (one for the case where the file under clients/ is found, and one for not found), all I need to check is if the requested file (or director... | [
-0.10013563185930252,
0.13563965260982513,
0.4697940945625305,
-0.125667005777359,
0.15052564442157745,
-0.048272017389535904,
0.39154908061027527,
-0.32495006918907166,
-0.18615391850471497,
-0.8140830993652344,
-0.05615004524588585,
0.7370159029960632,
-0.26488906145095825,
0.12637428939... | |
I am trying to build a cross-compiler with x86\_64 being the host and i386 being the target. I'm getting the (all to common) crti.o: No such file error. Instead of grabbing an already built crti.o and crtn.o from a distro... how might I go about building these files explicitly from glibc (or possibly gcc) sources?
FYI... | [
0.2121298462152481,
0.5219714045524597,
0.10728368163108826,
-0.05997133255004883,
-0.40406104922294617,
-0.06412897258996964,
0.06516856700181961,
0.2441394031047821,
-0.0809190422296524,
-1.0846458673477173,
0.10615576058626175,
0.6436730623245239,
-0.7242770791053772,
0.4020532071590423... | |
versions depending on my testing needs.
Thanks,
Chenz
Are you sure you're using configuring the cross-compile correctly? It should be
```
CBUILD = CHOST = x86_64-pc-linux-gnu
CTARGET = i386-pc-linux-gnu
```
as you're running a build on an `x86_64`, for a compiler to run on an `x86_64`, which generates code for an `i... | [
0.0408838614821434,
0.32201799750328064,
0.4756326377391815,
-0.08611825108528137,
-0.44248253107070923,
-0.20081065595149994,
0.1473747342824936,
0.1879652738571167,
-0.22583751380443573,
-0.7878650426864624,
-0.048381507396698,
0.49349987506866455,
-0.6937925219535828,
0.2292231768369674... | |
I'm making an app on facebook and have chosen iframe instead of FBML. The problem i'm facing is linking to various other pages of the app. Suppose that I've hosted my app here <http://fbapp.mysite.com> and I want to link <http://fbapp.mysite.com/page1>, how should I do that inside the iframe? Linking directly to fbapp.... | [
0.3859543800354004,
0.22370794415473938,
0.6950792074203491,
-0.28697001934051514,
-0.3318454325199127,
0.1544133722782135,
0.2001083791255951,
-0.016369475051760674,
-0.29642733931541443,
-0.8633430004119873,
0.05166929215192795,
0.4477023482322693,
-0.3162233233451843,
-0.027862347662448... | |
(Facebook itself), and Facebook automatically passes through any arguments (paths AND query strings) to your callback URL. | [
0.11978892982006073,
0.031863126903772354,
0.517890453338623,
0.12729695439338684,
-0.042048100382089615,
-0.11842577159404755,
0.2230684906244278,
0.3569261133670807,
-0.20668147504329681,
-0.20541945099830627,
-0.4315238893032074,
0.25752338767051697,
-0.17934651672840118,
0.120441511273... | |
Stemming is something that's needed in tagging systems. I use delicious, and I don't have time to manage and prune my tags. I'm a bit more careful with my blog, but it isn't perfect. I write software for embedded systems that would be much more functional (helpful to the user) if they included stemming.
For instance: ... | [
0.2368709295988083,
-0.17109450697898865,
0.21635966002941132,
0.23031869530677795,
-0.3114442527294159,
-0.39951109886169434,
0.20521976053714752,
0.043570321053266525,
0.0048142424784600735,
-0.3591781556606293,
0.07596385478973389,
0.5094042420387268,
-0.07605906575918198,
-0.3527027666... | |
other open source licensed stemmers are out there?
-Adam
[Snowball](http://snowball.tartarus.org/) stemmer (C & Java)
I've used it's Python binding, [PyStemmer](http://pypi.python.org/pypi/PyStemmer) | [
0.34149011969566345,
-0.11911605298519135,
0.3446615934371948,
0.06551486998796463,
-0.08407697081565857,
-0.29594916105270386,
0.257968544960022,
-0.21275798976421356,
-0.4397765100002289,
-0.21647368371486664,
-0.31149449944496155,
0.11407420039176941,
-0.3789006769657135,
-0.38129982352... | |
I have not found a way to load an RSA private key from a PEM file to use it in python-crypto (signature).
python-openssl can load a PEM file but the PKey object can't be used to retrieved key information (p, q, ...) to use with Crypto.PublicKey.construct().
is this (close to) what you tried doing?
```
public_key_file... | [
0.46026611328125,
0.15456534922122955,
0.07199473679065704,
-0.022484077140688896,
0.07220501452684402,
-0.17201639711856842,
0.1253567785024643,
-0.3662106692790985,
-0.14279711246490479,
-0.5141973495483398,
0.05586450546979904,
0.3961549699306488,
-0.24108371138572693,
0.112833268940448... | |
I'm trying to get structuremap to correctly create my controllers, I'm using DI to inject an INewsService into a NewsController and thats the only constructor I have.
```
public class NewsController : Controller
{
private readonly INewsService newsService;
public NewsController(INewsService newsService)
{... | [
0.1869858056306839,
-0.4460543096065521,
0.4404492974281311,
0.4338967800140381,
0.06469710171222687,
-0.11220717430114746,
0.07202570140361786,
-0.009120354428887367,
-0.29853329062461853,
-0.7796342968940735,
-0.17248494923114777,
0.42478886246681213,
-0.41377851366996765,
0.500097990036... | |
to start the app
```
public class Application : HttpApplication
{
protected void Application_Start()
{
RegisterIoC();
RegisterViewEngine(ViewEngines.Engines);
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterIoC()
{
ObjectFactory.Initialize(config => ... | [
-0.045537181198596954,
-0.09328106790781021,
0.5025785565376282,
-0.18347610533237457,
0.25406715273857117,
0.2758117616176605,
0.4878811836242676,
-0.21056415140628815,
-0.08182772248983383,
-0.7677185535430908,
-0.5644216537475586,
0.3674528896808624,
-0.5491793751716614,
-0.014807946048... | |
config.AddRegistry<DomainRegistry>();
config.AddRegistry<ControllerRegistry>();
});
DependencyResolver.InitializeWith(new StructureMapDependencyResolver());
ControllerBuilder.Current.SetControllerFactory(typeof(IoCControllerFactory));
}
}
```
But Structuremap doesn'... | [
-0.15563903748989105,
-0.2624358534812927,
0.6981874704360962,
0.006620383821427822,
0.0644821748137474,
-0.2616235613822937,
0.10223767906427383,
-0.27306851744651794,
-0.3084016740322113,
-0.6388210654258728,
0.17445485293865204,
0.4523303210735321,
-0.5524130463600159,
0.492150664329528... | |
code I use to make that work:
My Global.asax has this line in Application\_Start (which uses the StructureMap factory from MvcContrib):
```
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
ObjectFactory.Initialize(x =>
{
x.AddRegistry(new RepositoryRegistry());
});
C... | [
0.10280415415763855,
-0.07711020857095718,
0.5984541773796082,
-0.2548464834690094,
0.15189851820468903,
-0.01701047085225582,
0.28990840911865234,
-0.3277568221092224,
-0.213944673538208,
-0.7618477940559387,
-0.13694103062152863,
0.24256041646003723,
-0.5932549238204956,
0.63508218526840... | |
x.With<DefaultConventionScanner>();
});
}
}
```
The DefaultConventionScanner looks for pairs of Interfaces/Classes that follow the nameing convention of ISomethingOrOther and SomethingOrOther and automatically associates the latter as a concrete type for the former interface.
If you didn't want to use ... | [
0.13065889477729797,
0.07231433689594269,
0.44010573625564575,
-0.043551914393901825,
0.06464370340108871,
-0.03607562184333801,
0.056375015527009964,
-0.11296636611223221,
0.14044605195522308,
-1.0145901441574097,
-0.04571424797177315,
0.474252849817276,
-0.493221253156662,
0.151839762926... | |
I have created my own Role Provider because I found the one that ASP.Net provides to be way too bulky in terms of tables in the database. I found implementing a custom RoleProvider to be quite easy.
My only problem is that right now I cannot have multiple roles for a page. I saw somewhere that at the top of your class... | [
0.023401658982038498,
-0.24072295427322388,
0.4749526083469391,
0.048951406031847,
-0.0292557030916214,
0.10467599332332611,
-0.003105555661022663,
-0.045600615441799164,
-0.20558850467205048,
-0.9625306725502014,
0.17705270648002625,
0.6483170390129089,
-0.1757393777370453,
0.023127730935... | |
I also get errors. Do i Need to specify multiple PrinicipalPermissions by any chance?
I have very little experience with ASP.Net's role management. Can someone point me in the right direction or at some good literature.
you can add the PrinicpalPermission attribute multiple times.
```
[PrincipalPermission(SecurityAct... | [
0.023136146366596222,
-0.3874080777168274,
0.28096863627433777,
0.2595936357975006,
0.1666523814201355,
0.11894404888153076,
0.116230808198452,
0.11105614900588989,
-0.20929868519306183,
-0.567085862159729,
-0.040631745010614395,
0.5706404447555542,
0.06378527730703354,
0.22062112390995026... | |
Do you know of any ORM tool that offers deadlock recovery? I know deadlocks are a bad thing but sometimes any system will suffer from it given the right amount of load. In Sql Server, the deadlock message says "Rerun the transaction" so I would suspect that rerunning a deadlock statement is a desirable feature on ORM's... | [
0.22970646619796753,
-0.07521732896566391,
0.14861540496349335,
0.409259557723999,
0.0285906121134758,
-0.2923349142074585,
0.33295536041259766,
0.2593204975128174,
-0.65579754114151,
-0.35818731784820557,
0.1034277081489563,
0.9553903341293335,
-0.10157818347215652,
0.16524596512317657,
... | |
your transactions and queries in a way that deadlocks are avoided or at least reduced. There are lots of options for improvement, like choosing the right isolation level for (parts) of your transactions, using lock hints etc. This depends much more on your database system then on your ORM. Of course it helps if your OR... | [
0.11913131922483444,
0.01826435513794422,
0.19487911462783813,
0.5631662607192993,
0.35906386375427246,
-0.018267590552568436,
0.28091883659362793,
0.20999974012374878,
-0.42322006821632385,
-0.3630990982055664,
0.002990000182762742,
0.5999656319618225,
-0.16663877665996552,
-0.29065012931... | |
whatever call, check catched exceptions if they indicate that the failed transaction is a "deadlock victim", and then simply recall save/commit/persist after a few seconds sleeping. Waiting a few seconds is a good idea since deadlocks are often an indication that there is a temporary peak of transactions competing for ... | [
0.30426788330078125,
-0.14405690133571625,
0.3418436646461487,
0.2410934716463089,
0.30295878648757935,
-0.22878146171569824,
0.2626296877861023,
0.14520631730556488,
-0.4567994177341461,
-0.4388740360736847,
0.08300285041332245,
0.4816747307777405,
0.00307654682546854,
0.00157252873759716... | |
about 80% of the "deadlock victims" succeeded on the second go. But I strongly recommend to digg deeper to fix the actual reason for the deadlocking, because these problems usually increase exponentially with the number of users. Hope that helps. | [
0.09942407160997391,
-0.02551480382680893,
0.1912883073091507,
0.34109166264533997,
-0.07252905517816544,
-0.06959845870733261,
0.7184016704559326,
0.3123835623264313,
-0.2829029858112335,
-0.23847036063671112,
-0.07534994184970856,
0.372420072555542,
-0.19305230677127838,
-0.1621762365102... | |
I am trying to create a commenting system whereby admins are able to moderate comments and users are able to post comments all in the one page load. I have all the backend knowledge on how to delete the comments, but I really have to know how the new comments could be loaded from the database and shown on the current p... | [
0.5731588006019592,
0.11744959652423859,
0.329275518655777,
0.020376885309815407,
-0.27146363258361816,
-0.12104734033346176,
0.2381347119808197,
0.1062542125582695,
-0.2210131734609604,
-0.5861166715621948,
0.07627668976783752,
0.36559170484542847,
-0.09965252131223679,
-0.016309000551700... | |
and the question ID to query the server, to optimize your traffic.
Using JQuery:
```
var refreshId = setInterval(function() {
$.getJSON("http://server.com/form?question=" + questionId + "?time=" + datetimeStamp",
function(data){
$.each(data.items, function(i,item){
$("#comments").ap... | [
0.0870639979839325,
-0.346873939037323,
0.7585671544075012,
-0.037966690957546234,
0.01174695324152708,
0.11120886355638504,
0.17141270637512207,
-0.3793211579322815,
-0.14738047122955322,
-0.6586307287216187,
-0.3805464208126068,
0.5729260444641113,
-0.27004656195640564,
0.166845127940177... | |
How I could determine if JDBC driver is `TYPE_FORWARD_ONLY`? In my program the user configures connection parameters to database and he could use any JDBC driver in the class path. I want to know if the driver is `TYPE_FORWARD_ONLY` before executing any statements. Is this possible?
DatabaseMetaData has a method suppor... | [
-0.03193921595811844,
-0.07478129863739014,
0.05527118220925331,
-0.040245842188596725,
-0.2781543433666229,
-0.11252119392156601,
-0.03800538554787636,
0.013114061206579208,
-0.15093891322612762,
-0.5883447527885437,
0.3143695294857025,
0.49365660548210144,
-0.2207287698984146,
0.26351279... | |
I have written code to save cookies in JavaScript. Now I need to clear the cookies irrespective of values that I assigned.
Are there any script modules to delete all cookies that were generated by [Javascript](http://en.wikipedia.org/wiki/JavaScript)?
### My Sample Code:
```
document.cookie = 'ppkcookie2=another tes... | [
0.3568415939807892,
0.34911006689071655,
0.6373372077941895,
-0.10901875048875809,
-0.08149433881044388,
-0.09462089091539383,
0.8283542394638062,
-0.2570350468158722,
-0.17358601093292236,
-0.4644598960876465,
0.12791961431503296,
0.14156614243984222,
-0.16679225862026215,
0.4227481782436... | |
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c... | [
0.04264165088534355,
0.22839002311229706,
0.4477860927581787,
-0.16009362041950226,
0.20660530030727386,
-0.03702767193317413,
0.47667402029037476,
-0.39554330706596375,
-0.1695130169391632,
-0.432205468416214,
-0.27869829535484314,
0.6038101315498352,
-0.22426727414131165,
0.4111397862434... | |
test the code on the webserver?
On the face of it, it looks okay - if you call `eraseCookie()` on each cookie that is read from `document.cookie`, then all of your cookies will be gone.
**Try this:**
```
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++)
eraseCookie(cookies[i].split(... | [
0.4195454716682434,
0.10352854430675507,
0.10586690157651901,
-0.17646580934524536,
0.24827130138874054,
-0.4414699673652649,
0.5782590508460999,
-0.30498453974723816,
-0.05604920536279678,
-0.7048447728157043,
-0.3105144202709198,
0.6398199200630188,
-0.10715816915035248,
-0.0708910599350... | |
I have a method where I want to have a parameter that is a Type, but of a certain interface.
E.g.:
```
public static ConvertFile(Type fileType)
```
where I can specify fileType inherits IFileConvert.
Is this possible?
One option is generics:
```
public static ConvertFile<T>() where T : IFileConvert
{
Type ty... | [
0.28761324286460876,
-0.20648792386054993,
0.25349944829940796,
-0.058522630482912064,
0.04604388028383255,
-0.1431293785572052,
0.12057098746299744,
-0.28947117924690247,
0.012061395682394505,
-0.4316451847553253,
-0.05852430313825607,
0.6222832202911377,
-0.4475880563259125,
0.1998745501... | |
What is the difference between this:
```
void MyMethod(IMyInterface value)
{
//...
}
```
and this:
```
void MyMethod<T>(T value) where T : IMyInterface
{
//...
}
```
The main functional difference is that you can know the actual type of the object inside of the generic method. The T parameter will contain ... | [
0.2245517075061798,
-0.026748841628432274,
0.2449045479297638,
0.06756464391946793,
-0.17109626531600952,
0.005880760494619608,
0.37765470147132874,
-0.10059086978435516,
0.12433815002441406,
-0.6864562630653381,
-0.0785984918475151,
0.7056196331977844,
-0.610041081905365,
0.33716619014739... | |
The following line of code presents the title error:
```
ITestClass t = new TestClass();
```
TestClass implementation:
```
public class TestClass : ITestClass {
public static TestClass Instance
{
get
{
return TestClass.Instance;
}
}
//Inte... | [
0.07019782811403275,
-0.025960585102438927,
-0.021953172981739044,
-0.10886843502521515,
-0.008002817630767822,
-0.23544874787330627,
0.5873485803604126,
-0.16707970201969147,
0.053089696913957596,
-0.6977550983428955,
-0.22187578678131104,
0.5893703103065491,
-0.14825521409511566,
0.15423... | |
another set of classes with similiar interfaces where this cast works, why doesn't it work here?
Most likely the Interface that you are trying to assign do isn't part of the class that you are newing. Double check your interface implementations for mistakes, this is a completely valid piece of code.
If you have a spec... | [
0.40049228072166443,
-0.10822131484746933,
-0.43967050313949585,
0.45610156655311584,
-0.439702570438385,
-0.21402165293693542,
0.30715611577033997,
-0.08730681985616684,
0.08985850214958191,
-0.9084383845329285,
0.4682208001613617,
0.7406424880027771,
-0.31398969888687134,
0.1243358403444... | |
Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?
There is a difference between python runtime and python apps. Also from PyS60 app developer point of view, it's the heapsize that's more interesting...
Version 1.9.5 comes by default with heapsize 100k min and 4M max. Of cour... | [
-0.1261707991361618,
-0.349935382604599,
0.3214510977268219,
-0.06354265660047531,
0.09995301067829132,
0.10657058656215668,
0.5077139735221863,
0.013953129760921001,
-0.5071334838867188,
-0.6706336140632629,
-0.3386632800102234,
0.635043740272522,
-0.3631349802017212,
-0.7364802956581116,... | |
and fixed some endless loops :) Never had any real stack problems. Usually it's the heap that runs out, esp with graphics manipulation. | [
0.2354775369167328,
-0.08527067303657532,
0.1662946492433548,
0.538240373134613,
-0.007215839810669422,
-0.02629239670932293,
-0.032088857144117355,
0.26194897294044495,
-0.687611997127533,
-0.229696586728096,
-0.009096638299524784,
0.31354236602783203,
-0.17788107693195343,
-0.00526653695... | |
In French, typography requires that we use **narrow** **non-breaking** space (U+202F) at various places (“Comme ça !”).
Apparently every browser on windows fails to support that and they all display a weird character instead. This works on most browsers on Mac OS X as well as Linux.
Does anyone know how to make Windo... | [
0.3182927072048187,
0.26632556319236755,
0.4949793517589569,
0.137225940823555,
-0.09239257127046585,
-0.054135289043188095,
0.23377037048339844,
0.33656224608421326,
-0.5489881634712219,
-0.9128921031951904,
-0.2942975163459778,
0.2263936549425125,
-0.22043710947036743,
-0.135637715458869... | |
style="white-space:nowrap"> </span>
```
to correct the breaking behavior. Why?
* Because the French *fine* is effectively using a nearly fixed width between one sixth to one fourth of a cadratin (0.166 ca. to 0.25 ca., when the standard space is 0.5 ca.) The choice of the width depends on the approach already ... | [
0.2030121237039566,
0.01761777326464653,
0.5004826188087463,
0.012080944143235683,
0.05247976630926132,
0.2853710353374481,
0.26726406812667847,
-0.13677991926670074,
-0.37076830863952637,
-0.8817117214202881,
-0.18038085103034973,
0.4377443194389343,
0.3560602068901062,
-0.098832286894321... | |
texts generally contain more letters than equivalent English texts (for exemple the printed Bible), and to avoid increasing the number of printed pages, the glyphs in French fonts were made a bit narrower and with a reduced approach; to compensate this reduction, the French *fine* was increased in size. (It is often sa... | [
-0.10566551238298416,
0.39447954297065735,
0.26554256677627563,
-0.04969366267323494,
-0.3889019191265106,
0.40836256742477417,
0.6393154263496399,
0.2414223700761795,
-0.06262493133544922,
-0.7010313868522644,
-0.36526182293891907,
0.299600213766098,
0.24028579890727997,
-0.26431727409362... | |
enough to justify the fact that a no thin space is used in texts near most *double* punctuation signs. However, if French is rendered with a font using an English typography (which has larger inter-character gaps), the *fine* should be narrower and should be reduced to 1/6th cadratin.
* So yes, U+2009 (` ` in th... | [
0.2696315050125122,
-0.05340307950973511,
0.4174067974090576,
-0.1030731275677681,
-0.21203240752220154,
0.3007628619670868,
0.6337438225746155,
0.027931399643421173,
-0.38216376304626465,
-0.49799567461013794,
-0.2499804049730301,
0.6145901083946228,
0.024371424689888954,
-0.1942931860685... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.