text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
How do the relationships magically function when only the models are altered?
**If I want a "has\_\_and\_\_\_belongs\_\_\_to\_\_many" relationship, what should I name the table (so Rails can use it) that contains the two foreign keys?**
Short answer: You can't just tell the models that they're related; there have to b... | [
-0.005800637882202864,
0.003992252051830292,
0.0946904718875885,
0.3135048449039459,
0.075948566198349,
-0.19561491906642914,
-0.028843585401773453,
-0.08463192731142044,
-0.20763558149337769,
-0.5383729338645935,
-0.12806954979896545,
0.4698813259601593,
-0.24123352766036987,
0.0415908545... | |
In this table, when you have a relationship to another table, you have to create that column and name it in another predictable way (e.g. `bank_account_id`, if you're relating to the `bank_accounts` table).
2. You write a model class inheriting from ActiveRecord::Base
`class Person < ActiveRecord::Base`
When you inst... | [
-0.2603350579738617,
0.0033329338766634464,
0.014342962764203548,
-0.02516377717256546,
-0.03072379343211651,
0.07009124755859375,
-0.13874438405036926,
-0.07372649013996124,
-0.07011722773313522,
-0.6210739612579346,
-0.018234627321362495,
0.2717946171760559,
-0.3843953311443329,
0.046616... | |
output to figure out what the columns are.
3. You add relationships to the model: `has_many`, `belongs_to` or `has_one`.
When you type something like, `has_many :bank_accounts`, it assumes a few things:
1. The name of the model that you relate to is BankAccount (from camel-casing `:bank_accounts`).
2. The name of t... | [
-0.00034122428041882813,
-0.010233940556645393,
0.16195495426654816,
0.16898269951343536,
-0.08771072328090668,
-0.12009675055742264,
-0.18945638835430145,
-0.06830966472625732,
-0.1969773918390274,
-0.7810884714126587,
0.25285112857818604,
0.44344404339790344,
-0.08986927568912506,
0.0545... | |
It knows where to find everything, because you followed a naming convention that it understands when you created the table and its colums.
One of the neat things about Ruby is that you can run methods on a whole class, and those methods can add other methods to a class. That's exactly what `has_many` and friends are d... | [
0.3246344029903412,
-0.07571866363286972,
-0.2739945352077484,
0.39937400817871094,
-0.10070361942052841,
-0.44849804043769836,
0.5476719737052917,
0.19061142206192017,
-0.3990938663482666,
-0.34223315119743347,
-0.00417244853451848,
-0.01664871722459793,
-0.03871715068817139,
0.0261982586... | |
In Delphi, I've added a Scrollbar component (oriented vertical) to the right side of my form.
I've added a Scrollbar OnChange event so I can change the view of the form and the position of the scrollbar thumb when the user clicks on the UpArrow or DownArrow button with his mouse, and this works fine.
But the OnChange... | [
-0.02301773428916931,
-0.20708532631397247,
1.061208724975586,
-0.1061505675315857,
-0.2172859162092209,
0.09701075404882431,
-0.06876646727323532,
-0.21313276886940002,
-0.011141614057123661,
-0.5451171398162842,
0.26585331559181213,
0.5704314708709717,
0.009723447263240814,
-0.2179686874... | |
I easily detect if the user has not moved the mouse and continues to press the mouse button while the mouse remains over the arrow?
---
Conclusion. Somehow something in the scrollbar in my project got corrupted. After I deleted the ScrollBar, and added it again, the problem vanished.
This is one of those tricky one... | [
0.18048162758350372,
0.2500354051589966,
0.4950254559516907,
-0.01685052551329136,
0.024162273854017258,
-0.13005617260932922,
0.40756481885910034,
-0.0432647243142128,
-0.17628557980060577,
-0.6583898663520813,
-0.19913609325885773,
0.5591650605201721,
-0.1985248625278473,
0.1019389107823... | |
ScrollCode: TScrollCode;
var ScrollPos: Integer);
begin
Memo1.Lines.Add( 'xxx' );
end;
``` | [
-0.21843405067920685,
-0.0694548487663269,
0.6042540073394775,
-0.04765430465340614,
-0.17231915891170502,
0.2252979725599289,
0.2840575575828552,
-0.22350077331066132,
-0.002764330944046378,
-0.8380891680717468,
-0.477321058511734,
0.23631253838539124,
-0.1166984811425209,
0.1728044152259... | |
I want to save the current tab the user is in when the user quits the application, so I can load the application with that tab highlighted when the user re-enters the app.
I presume I use the following method within my app delegate to save the current tab
`- (void)applicationWillTerminate:(UIApplication *)application... | [
-0.018685413524508476,
0.19374088943004608,
0.8146012425422668,
0.013824325054883957,
0.12165619432926178,
0.07585874199867249,
0.3168276250362396,
0.032109785825014114,
-0.15380500257015228,
-0.8219871520996094,
-0.34209349751472473,
0.6884410381317139,
-0.34938231110572815,
0.08838228136... | |
setIndex = [[NSUserDefaults standardUserDefaults] objectForKey:@"tabBarIndex"];
[[NSUserDefaults standardUserDefaults] synchronize];
```
setIndex is an NSUInteger. Then set the TabBarController in your viewDidLoad like so:
```
[tabBarController selectedIndex:setIndex];
```
This is from memory, so you'll need t... | [
-0.05866831913590431,
-0.15902653336524963,
0.5207419395446777,
0.09410037845373154,
-0.06819475442171097,
-0.1533249169588089,
0.1278846561908722,
-0.06683531403541565,
-0.2004125416278839,
-0.5131791830062866,
-0.30134886503219604,
0.49334073066711426,
-0.4636525809764862,
-0.10259134322... | |
Most of the places on the internet say it stands for **WEB INF**ormation.
I rather doubt it. The folder contains executables. **Information** is not a suitable name for it.
As far as I know, "INF" stands for "Information", as you said. It probably was named `WEB-INF` for similarity with the `META-INF` directory in JAR... | [
0.4113263487815857,
0.06577196717262268,
-0.10215141624212265,
0.3322973847389221,
-0.13392838835716248,
-0.4144271910190582,
-0.003592922119423747,
0.3780999481678009,
-0.3446919620037079,
-0.6439120769500732,
-0.29004037380218506,
0.22598014771938324,
-0.17445479333400726,
0.657175719738... | |
i am making a noughts and crosses game (tic tac toe) and in my logic class i represent the state of the game with a 2d array, but this is the problem, im checking the array like so
```
if(gameModel[0][0] == gameModel[1][1] && gameModel[0][0] == gameModel[2][2]){
return true;
}
if(gameModel[2][0] == gameMod... | [
0.052591510117053986,
0.06703376024961472,
0.3925112783908844,
-0.2253316342830658,
-0.04304096847772598,
-0.04597756639122963,
0.3019666075706482,
-0.4455534517765045,
0.16571956872940063,
-0.7824177742004395,
-0.08159768581390381,
0.4141922891139984,
-0.0850193202495575,
0.18847018480300... | |
can i get round this problem without having to change the whole of my code
thanks
In that case you just have to add a check if a value is set:
```
if ( gameModel[0][0] == gameModel[1][1]
&& gameModel[0][0] == gameModel[2][2]
&& gameModel[0][0] != 0) {
return true;
}
``` | [
0.1286013126373291,
0.04195656254887581,
0.3274341821670532,
-0.07833845168352127,
0.07594604790210724,
-0.3873521685600281,
0.3307953178882599,
-0.36998456716537476,
0.02214866317808628,
-0.6329225897789001,
-0.060877274721860886,
0.7563073039054871,
-0.2560400068759918,
-0.18263885378837... | |
I have a VPS and i'm trying to host several SVN projects. I'd like the URL paths to be like this:
```
http://svn.domain.com -> Welcome HTML page (at /var/www/svn.domain.com/httpdocs/index.php)
http://svn.domain.com/project1 -> Project 1 SVN Root
http://svn.domain.com/project2 -> Project 2 SVN Root
http://svn.domain.co... | [
0.08939167857170105,
0.02578599750995636,
0.639883279800415,
-0.12426614761352539,
-0.38690242171287537,
-0.004895041696727276,
0.1997641921043396,
-0.08817891776561737,
-0.545619010925293,
-0.6613729000091553,
-0.08571165055036545,
0.12938112020492554,
0.016015183180570602,
0.492176026105... | |
DocumentRoot /var/www/svn.domain.com/httpdocs
<Location />
DAV svn
SVNParentPath /var/svn
SVNIndexXSLT "/svnindex.xsl"
AuthzSVNAccessFile /var/svn/access
SVNListParentPath On | [
-0.6058175563812256,
-0.20239783823490143,
0.9506726861000061,
-0.030195310711860657,
-0.1734725534915924,
-0.3398157060146332,
0.19453975558280945,
-0.43639278411865234,
-0.33343759179115295,
-0.533080518245697,
-0.11157035827636719,
0.4449206292629242,
0.09990618377923965,
0.196888700127... | |
# try anonymous access first, resort to real
# authentication if necessary.
Satisfy Any
Require valid-user
# how to authenticate a user | [
0.025686804205179214,
0.007218813989311457,
0.3635829985141754,
0.22872936725616455,
-0.11414468288421631,
-0.2514456510543823,
0.8675487637519836,
-0.05197102576494217,
-0.00391974113881588,
-0.4193536341190338,
-0.24941372871398926,
0.5546164512634277,
-0.1398332118988037,
-0.32967421412... | |
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/svn/passwd
</Location>
</VirtualHost>
<Directory /var/svn>
Allow from all
</Directory>
```
you can use **SVNPATH** directive, however you have to set up three locations (each project needs its own) | [
0.3207768201828003,
-0.019351501017808914,
0.3389635682106018,
-0.05428948253393173,
-0.25257375836372375,
-0.048395924270153046,
0.416147381067276,
-0.3207792043685913,
0.11444941908121109,
-0.4787858724594116,
-0.2774406373500824,
0.5150099396705627,
-0.3772750794887543,
0.12967248260974... | |
When reading about and playing with Rails last year, one of the tools that made the biggest impression on me was Rake. A database versioning system that keeps all dev db's identical integrated right into the build...something like that would make life so much easier (and safer)!
However, one of the things that I haven... | [
0.5616213083267212,
-0.1664969027042389,
0.024760685861110687,
0.25803348422050476,
-0.25195905566215515,
-0.312740296125412,
0.247127965092659,
0.05823814868927002,
-0.2150813639163971,
-0.6144054532051086,
0.6012434959411621,
0.5127741098403931,
-0.045096997171640396,
0.10933317244052887... | |
about strategy than Rails/Rake specific technologies. We don't use rails, we use .Net. But if I can figure out this publish scenario, there seem to be several tools [Migratordotnet being one](http://code.google.com/p/migratordotnet/) that might enable us to do something similar.
Here's a quick example on how you could ... | [
0.3782595098018646,
-0.31609612703323364,
0.2474052757024765,
0.11513154953718185,
-0.3128040134906769,
-0.23894454538822174,
0.2794725298881531,
-0.5702732801437378,
0.12912406027317047,
-0.6757060885429382,
0.12232190370559692,
0.7349056601524353,
-0.43160197138786316,
-0.178291529417037... | |
private var textField:TextField;
public function LabeledCircle(radius:Number, label:String = "")
{
// Prepares the textField
var textFormat:TextFormat = new TextFormat();
textFormat.align = TextFormatAlign.CENTER;
textField = new TextField(); | [
-0.1173471212387085,
0.08199470490217209,
0.6447070837020874,
-0.3698573410511017,
-0.0554378516972065,
0.29733145236968994,
0.07216772437095642,
-0.35668501257896423,
0.33374783396720886,
-0.7289180755615234,
-0.45450082421302795,
0.5374821424484253,
-0.10244537144899368,
0.24845384061336... | |
textField.defaultTextFormat = textFormat;
addChild(textField);
// Sets the default parameters
this.radius = radius;
this.label = label;
}
public function set radius(radius:Number):void
{
// | [
0.0764484778046608,
-0.1395198404788971,
0.31197604537010193,
-0.22363939881324768,
-0.200853168964386,
0.057125404477119446,
0.09394321590662003,
-0.2821556031703949,
-0.08396872133016586,
-0.5111779570579529,
-0.20990420877933502,
0.7361884713172913,
-0.2942160964012146,
0.14545351266860... | |
redraws the circle
graphics.clear();
graphics.beginFill(0x000000, .5);
graphics.drawCircle(0, 0, radius);
// recenters the textfield depending on the radius
textField.width = radius * 2;
textField.x = -radius;
} | [
-0.35647231340408325,
-0.1186085119843483,
0.8710606694221497,
-0.345824271440506,
-0.16257427632808685,
0.3424275517463684,
0.12042970955371857,
-0.27249521017074585,
-0.2654142379760742,
-0.6701070666313171,
-0.10966499149799347,
0.4734543263912201,
-0.04857245832681656,
0.19887195527553... | |
public function set label(label:String):void
{
textField.text = label;
}
}
}
``` | [
0.11914985626935959,
-0.10437910258769989,
0.2030775249004364,
-0.23303432762622833,
-0.0233328677713871,
-0.32422372698783875,
0.1531001180410385,
-0.051591675728559494,
0.030632492154836655,
-0.4363867938518524,
-0.7252458930015564,
0.9133619070053101,
-0.6947789788246155,
0.096844099462... | |
Suppose I have an object like
```
public class Handle {
private String handle;
public Handle(String name) {
this.handle=name;
}
public String toString() {
return this.handle;
}
}
```
that is a property of some POJO that I would like to persist with Hibernate. How do I define the ma... | [
0.12686339020729065,
-0.1015864908695221,
0.14115284383296967,
-0.07606454938650131,
-0.2092999368906021,
-0.3704954981803894,
0.3389325737953186,
0.04084356129169464,
-0.18105383217334747,
-0.3413211703300476,
-0.12513767182826996,
0.5257270932197571,
-0.1450991928577423,
0.06459371745586... | |
The answer is to implement a UserType.
Here's a quick example on how you could do it (to be continued to achieve your particular needs)
```
package
{
import flash.text.TextFormatAlign;
import flash.text.TextField;
import flash.display.Sprite;
import flash.text.TextFormat;
public class L... | [
0.3929380774497986,
0.01156798005104065,
0.5317578911781311,
-0.3467477858066559,
-0.2900025546550751,
0.07081158459186554,
0.3429517447948456,
-0.6087145805358887,
0.30874449014663696,
-0.5725595951080322,
-0.1227886900305748,
0.7910298705101013,
-0.46949970722198486,
0.023337295278906822... | |
// Prepares the textField
var textFormat:TextFormat = new TextFormat();
textFormat.align = TextFormatAlign.CENTER;
textField = new TextField();
textField.defaultTextFormat = textFormat;
addChild(textField);
// Sets the default | [
-0.03977753221988678,
0.10525903850793839,
0.8123048543930054,
-0.2466314285993576,
0.10347985476255417,
0.2092321217060089,
-0.027942536398768425,
-0.501233696937561,
0.25954797863960266,
-0.7925622463226318,
-0.49467554688453674,
0.48517900705337524,
0.18327681720256805,
0.01027742121368... | |
parameters
this.radius = radius;
this.label = label;
}
public function set radius(radius:Number):void
{
// redraws the circle
graphics.clear();
graphics.beginFill(0x000000, .5); | [
-0.06790000945329666,
-0.09717778861522675,
0.6505188941955566,
-0.22483468055725098,
-0.12484181672334671,
0.2405143678188324,
-0.026364879682660103,
-0.28906771540641785,
-0.2072034329175949,
-0.5547511577606201,
-0.008536012843251228,
0.6173632740974426,
-0.29811227321624756,
0.25043070... | |
graphics.drawCircle(0, 0, radius);
// recenters the textfield depending on the radius
textField.width = radius * 2;
textField.x = -radius;
}
public function set label(label:String):void
{
textField.text = label; | [
0.021237529814243317,
-0.11101463437080383,
0.7670682668685913,
-0.3194285035133362,
-0.1899372935295105,
0.23248280584812164,
-0.10074920952320099,
-0.18192200362682343,
-0.11709484457969666,
-0.7425274848937988,
-0.15930092334747314,
0.6733831763267517,
-0.24566610157489777,
0.1191065013... | |
}
}
}
``` | [
0.033695679157972336,
0.4034728407859802,
0.1949702352285385,
-0.15257494151592255,
0.4299153685569763,
-0.20141436159610748,
0.07711705565452576,
0.4467844069004059,
0.3091506361961365,
-0.5090379118919373,
-0.3048633635044098,
0.5600791573524475,
-0.33611243963241577,
0.3141762912273407,... | |
I know its possible to integrate jQuery within Firefox addons, but are we able to manipulate (animate, move, adjust transparency, etc) XUL elements themselves?
From what I understand, the Firefox addon can use jQuery to manipulate HTML/DOM elements, but not sure about XUL elements.
XUL and HTML actually deal with opac... | [
0.18325108289718628,
-0.02441834844648838,
0.7286547422409058,
0.24391059577465057,
-0.27485448122024536,
-0.10099188983440399,
-0.22959820926189423,
-0.2248869389295578,
-0.14532114565372467,
-0.41364586353302,
0.11981182545423508,
0.5626148581504822,
-0.46724197268486023,
-0.214359909296... | |
can override this like so:
jQuery.support.opacity = true
Do this right after jQuery is loaded.
There is probably a whole category of similar fixes that can be post-applied to jQuery to make it behave better, but I haven't looked in to it. | [
0.20289897918701172,
-0.09312746673822403,
0.2494683563709259,
0.2310105711221695,
0.1717710942029953,
-0.5599766373634338,
0.41104814410209656,
0.1620556116104126,
0.08201473206281662,
-0.32913997769355774,
-0.024007584899663925,
0.8379335403442383,
-0.20606477558612823,
-0.21494376659393... | |
New to unit testing and have an app that is spread out over several dlls. What are some suggestions for unit testing the app? If I put the unit tests in their own project, i can only test the published interface for each dll. Is that what most people do? Or should I put the unit tests in with the code in the dlls and t... | [
0.6734710931777954,
0.1581379473209381,
-0.07242432981729507,
0.32478395104408264,
-0.15258660912513733,
-0.051083799451589584,
0.04771885648369789,
-0.20780836045742035,
-0.15913008153438568,
-0.5826191902160645,
0.3552605211734772,
0.5589602589607239,
0.03332723677158356,
0.1205763295292... | |
haven't found much information.
Thanks.
Update:
I guess to clarify a bit I have class A and class B in a dll. Class B is used by Class A, but only Class A is exposed. I'm wanting to get unit tests in place before refactoring this existing code.
So the question is should I put unit tests in with the dll code to test ... | [
0.3522496521472931,
-0.05194392800331116,
-0.19025813043117523,
0.14449100196361542,
-0.12255493551492691,
-0.20306594669818878,
0.14646285772323608,
-0.10234083980321884,
-0.12127324938774109,
-0.7160801887512207,
-0.04048264026641846,
0.5045987367630005,
-0.10696311295032501,
-0.00059238... | |
testing. Both are necessary, but it's better to test things at as low level as possible. Take a look on v-model: <http://en.wikipedia.org/wiki/V-Model_(software_development)>. | [
0.7880586385726929,
-0.05695735290646553,
0.015370013192296028,
0.029167506843805313,
-0.11804984509944916,
-0.22122129797935486,
0.23633043467998505,
-0.18110056221485138,
-0.09342333674430847,
-0.45729440450668335,
0.20847676694393158,
0.6742361187934875,
0.03408142179250717,
0.123073846... | |
Does it make sense to group all Interfaces of your Domain Layer (Modules, Models, Entities, Domain Services, etc) all within the Infrastructure layer? If not, does it make sense to create a "shared" project/component that groups all of these into a shared library? After all, the definition of "Infrastructure Layer" inc... | [
0.42393168807029724,
0.22147859632968903,
0.06948506832122803,
0.4901265501976013,
-0.028114644810557365,
-0.062010765075683594,
-0.11020403355360031,
0.05303368344902992,
-0.32674527168273926,
-0.8591384887695312,
0.015447594225406647,
0.3372982144355774,
-0.2850962281227112,
0.4272785186... | |
Layer project, say for IPost, then you'll have a circulur reference when you have to reference the Domain Layer project from the Infrastructure project when you are defining the IPostRepository.Save(IPost post) method. Hence, the idea of "define all Interfaces in the Shared library".
Perhaps the repositories should no... | [
0.08232592791318893,
-0.18055526912212372,
0.2759668827056885,
0.411186546087265,
-0.05132937431335449,
-0.3301541209220886,
0.11030278354883194,
-0.11809659749269485,
-0.2600753903388977,
-0.916962742805481,
-0.15675757825374603,
0.14020654559135437,
-0.21160490810871124,
-0.0176037531346... | |
where to put the repositories, personally I always put the repositories in a dedicated infrastructure layer (e.g . MyApp.Data.Oracle) but declare the interfaces to which the repositories have to conform to in the domain layer.
In my projects the Application Layer has to access the Domain and Infrastructure layer bec... | [
0.40120208263397217,
0.5089393258094788,
-0.11850841343402863,
0.2925134003162384,
0.26005083322525024,
-0.13607580959796906,
-0.08704912662506104,
-0.07959893345832825,
-0.31544384360313416,
-0.739387035369873,
-0.160580113530159,
0.1760196089744568,
0.09294861555099487,
0.190529301762580... | |
inject the dependencies into the domain.
Again I do not state that this is the way DDD recommends to structure your projects, it’s just the way, I architecture my apps.
Cheers. | [
0.6447336077690125,
0.3418109714984894,
0.5251404047012329,
-0.019774872809648514,
-0.2205115258693695,
-0.12332160770893097,
0.3778453469276428,
0.36399590969085693,
-0.028785523027181625,
-0.7050361633300781,
0.09173613786697388,
0.6682354211807251,
0.07553882151842117,
-0.05128816515207... | |
As you already may know,I'm migrating into C# and some things in C++ look different.
C++ code
```
BYTE packetBuffer[32] = {0};
*(LPWORD)(packetBuffer + 0) = 0xC;
*(LPWORD)(packetBuffer + 2) = 0x5000;
*(LPDWORD)(packetBuffer + 6) = dwArgs[13];
*(LPDWORD)(packetBuffer + 10) = *(keyArray2 + 0);
*... | [
-0.09204239398241043,
-0.1553746461868286,
0.7112825512886047,
-0.3060074746608734,
-0.09321735799312592,
-0.08697646111249924,
0.0059968228451907635,
-0.6202486753463745,
-0.39596280455589294,
-0.7699601650238037,
-0.19266265630722046,
0.4434351921081543,
-0.3520614802837372,
-0.086299039... | |
C#?
I tried this,but it doesn't work
```
packetBuffer[0] = 0xC;
packetBuffer[2] = (byte)0x5000; //error
packetBuffer[6] = (byte)dwArgs[13];
```
You can use [`BitConverter`](http://msdn.microsoft.com/en-us/library/system.bitconverter.aspx) to convert data to and from byte arrays. Unfortunately there's no facility to ... | [
0.11621377617120743,
0.08613170683383942,
0.3635074198246002,
-0.3401542603969574,
0.03915578871965408,
-0.052537184208631516,
0.23493081331253052,
-0.3561253845691681,
-0.20370763540267944,
-0.3131715953350067,
-0.23264431953430176,
0.6968843936920166,
-0.40724143385887146,
-0.01187186967... | |
but included for clarity (bearing in mind the previous line!).
EDIT: Another alternative if you'd rather stick with the .NET standard libraries, you might want to use [`BinaryWriter`](http://msdn.microsoft.com/en-us/library/system.io.binarywriter.aspx) with a [`MemoryStream`](http://msdn.microsoft.com/en-us/library/sy... | [
0.05404528230428696,
-0.2595089375972748,
0.11327897012233734,
0.2798066735267639,
0.002532307291403413,
-0.15318399667739868,
0.07137884944677353,
0.14880667626857758,
-0.1264558881521225,
-0.4668062925338745,
-0.1903458684682846,
0.516367495059967,
-0.2027079164981842,
-0.415232151746749... | |
im doing some queries in Zend Framework and i need to make sure no SQL injection is possible in the next kind of formats. I can use mysql\_escape(deprecated) and wont do all the work. If i try to use real\_mysql\_escape it wont be able to grab the conection with the database and i cant find how zend\_filter would solve... | [
0.03163851797580719,
0.05400544032454491,
0.31460943818092346,
0.011621043086051941,
-0.18864484131336212,
-0.08209604769945145,
0.4692293107509613,
-0.5921148657798767,
0.20253704488277435,
-0.5908191204071045,
0.05747052654623985,
0.6424444317817688,
-0.47485265135765076,
0.2019924074411... | |
FROM message m
WHERE m.message LIKE '".$username." %'";
$row = $db->fetchRow($select);
```
What is the best way to prevent SQL INJECTION with this framework?
Easy:
```
$db->quote($username);
```
So:
```
$username = $db->quote($username . '%');
$select = 'SELECT COUNT(*) AS num
... | [
-0.08377950638532639,
-0.09017685055732727,
0.44269341230392456,
-0.3749687373638153,
-0.12642979621887207,
0.268184095621109,
0.3077699542045593,
-0.4421164095401764,
-0.10478363931179047,
-0.33984577655792236,
-0.37097978591918945,
0.4887257218360901,
-0.4482722878456116,
0.3232348561286... | |
WHERE m.message LIKE ' . $username;
$row = $db->fetchRow($select);
``` | [
-0.016782227903604507,
0.037219829857349396,
0.6385851502418518,
-0.4630310535430908,
0.04033241420984268,
0.15172524750232697,
0.4832651615142822,
-0.23602469265460968,
-0.14545899629592896,
-0.49431130290031433,
-0.19430509209632874,
0.4236178994178772,
-0.5328426361083984,
0.60189867019... | |
```
INSERT INTO `tableA`
SELECT `Col1`,
`Col2`,
NOW()
FROM `tableB`
WHERE tableA.Col1 is not already in tableB.Col1
```
I can't get the WHERE clause right to ensure that the record copied from tableA only appears in table B once...
should | [
-0.2035309225320816,
0.2973036468029022,
0.3553085923194885,
-0.202997088432312,
0.42250320315361023,
-0.10337035357952118,
-0.22975604236125946,
-0.05073338374495506,
-0.33365964889526367,
-0.43381205201148987,
-0.3978886008262634,
0.31920692324638367,
-0.25650736689567566,
0.203322246670... | |
read:
where tableA.col1 not in (select col1 from table B) | [
-0.4729318916797638,
0.10783195495605469,
0.12951573729515076,
-0.2612174451351166,
0.06669105589389801,
0.2391463816165924,
-0.11636573821306229,
0.03232761472463608,
-0.3855638802051544,
-0.4754799008369446,
-0.4436255693435669,
-0.027882074937224388,
-0.43295276165008545,
-0.00094286579... | |
I must be missing something.
I want to set up a database user account for select-only transactions but mysql is not letting me choose the hash method for a password on creating a user account.
this fails:
```
GRANT SELECT ON myDB.* TO 'selectuser'@'localhost'
IDENTIFIED BY hash('sha256', 'salted-myfakelongrandompas... | [
0.017259927466511726,
0.3671775162220001,
0.21748588979244232,
0.015006202273070812,
0.1690187007188797,
-0.20341196656227112,
0.6833141446113586,
0.1918172836303711,
-0.07950718700885773,
-0.2778973877429962,
0.11911080777645111,
0.48954275250434875,
-0.30364692211151123,
0.24580655992031... | |
to change the default hashing algorithm for mysql, or is the syntax just incorrect on my SQL?
No, you shouldn't use your own password-hashing for MySQL authentication.
MySQL 5.x uses its own hashing function ([`PASSWORD()`](http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html#function_password)), which pro... | [
-0.06018488109111786,
0.1869155317544937,
0.3967709541320801,
0.07807733118534088,
-0.17473329603672028,
-0.18296116590499878,
0.17943356931209564,
-0.32432764768600464,
0.04968338459730148,
-0.6101215481758118,
0.07068602740764618,
0.4465636610984802,
-0.14127208292484283,
0.2902064621448... | |
for it to match what is in the MySQL authentication database.
Also, MySQL supports the [`SHA2()`](http://dev.mysql.com/doc/refman/6.0/en/encryption-functions.html#function_sha2) family of hash functions as of MySQL 5.5.
The [`hash()`](http://php.net/hash) function is something you're probably remembering from PHP. It... | [
-0.21665704250335693,
0.251731812953949,
0.35645702481269836,
-0.0990859791636467,
-0.22376638650894165,
-0.2913232445716858,
0.30820778012275696,
0.13764633238315582,
-0.24175798892974854,
-0.6448838114738464,
0.039011452347040176,
0.3094487488269806,
-0.04244549572467804,
0.0760886147618... | |
compute the [`hash()`](http://php.net/manual/en/function.hash.php) of their input password, combined with the [salt](http://en.wikipedia.org/wiki/Salt_(cryptography)) value on record for their account. Then compare this to the hash stored in the database for that user. In pseudocode:
```
$salt = $db->query("SELECT sal... | [
-0.2501181662082672,
0.4573100507259369,
0.01676636002957821,
-0.3480827808380127,
-0.036594539880752563,
0.2195260226726532,
0.27138808369636536,
-0.5144751071929932,
0.11282262951135635,
-0.37406012415885925,
-0.0025589666329324245,
0.2679064869880676,
-0.11430778354406357,
0.04233344271... | |
Here is an interesting issue I noticed when using the `Except` Operator:
I have list of users from which I want to exclude some users:
The list of users is coming from an XML file:
The code goes like this:
```
interface IUser
{
int ID { get; set; }
string Name { get; set; }
}
class User: IUser
{
#reg... | [
-0.1166265532374382,
-0.07248689234256744,
0.42513108253479004,
-0.15577152371406555,
0.06940684467554092,
-0.19456280767917633,
0.06945531070232391,
-0.03496529161930084,
-0.3025873303413391,
-0.8693373203277588,
-0.2754199206829071,
0.056354328989982605,
-0.3401545584201813,
0.4105040729... | |
string Name
{
get;
set;
}
#endregion
public override string ToString()
{
return ID + ":" +Name;
}
public static IEnumerable<IUser> GetMatchingUsers(IEnumerable<IUser> users)
{
IEnumerable<IUser> localList = new List<User>
{ | [
-0.1368105262517929,
-0.34720492362976074,
0.8301763534545898,
-0.2592708170413971,
0.11321782320737839,
-0.14845427870750427,
0.3074359595775604,
-0.10603739321231842,
-0.007270115427672863,
-0.7392878532409668,
-0.4671485722064972,
0.5595180988311768,
-0.3482590317726135,
0.0664412006735... | |
new User{ ID=4, Name="James"},
new User{ ID=5, Name="Tom"}
}.OfType<IUser>();
var matches = from u in users
join lu in localList
on u.ID equals | [
-0.1993301808834076,
-0.31550440192222595,
0.8771113157272339,
-0.23188544809818268,
0.2282295972108841,
0.3601023852825165,
0.11050545424222946,
-0.21247269213199615,
-0.2648482024669647,
-0.9575397372245789,
-0.12415643036365509,
0.4095672369003296,
-0.3196415603160858,
0.481095373630523... | |
lu.ID
select u;
return matches;
}
}
class Program
{
static void Main(string[] args)
{
XDocument doc = XDocument.Load("Users.xml");
IEnumerable<IUser> users = doc.Element("Users").Elements("User").Select
(u => new User | [
0.08316191285848618,
-0.2823815941810608,
0.49915841221809387,
-0.28159990906715393,
0.3045665919780731,
0.4471786320209503,
-0.09943921864032745,
-0.03642022982239723,
-0.08090158551931381,
-0.6431184411048889,
-0.3563216030597687,
0.49295860528945923,
-0.4026011824607849,
0.4343302249908... | |
{ ID = (int)u.Attribute("id"),
Name = (string)u.Attribute("name")
}
).OfType<IUser>(); //still a query, objects have not been materialized
var matches = User.GetMatchingUsers(users);
var excludes = users.Except(matches); // excludes should contain ... | [
0.12490081787109375,
-0.02837424725294113,
0.5765825510025024,
-0.027448970824480057,
0.25486570596694946,
0.036866530776023865,
0.4788280725479126,
-0.6682317852973938,
-0.3079904615879059,
-0.4506014883518219,
-0.22402514517307281,
0.24218009412288666,
-0.556201696395874,
0.2644267082214... | |
but here it contains 8 users
}
}
```
When I call `User.GetMatchingUsers(users)` I get 2 matches as expected.
The issue is that when I call `users.Except(matches)` The matching users are not being excluded at all! I am expecting 6 users ut "excludes" contains all 8 users instead.
Since all I'm doing in `GetMatch... | [
-0.05475342646241188,
0.14527906477451324,
0.4131072759628296,
-0.14931921660900116,
-0.2800295352935791,
-0.15415187180042267,
0.40312230587005615,
-0.4333478808403015,
-0.229983851313591,
-0.5564091801643372,
-0.21172066032886505,
0.5060675144195557,
-0.4729849100112915,
0.12009324133396... | |
materialize the objects using `.ToList()` and then get the matching users, and call `Except`,
everything works as expected!
Like so:
```
IEnumerable<IUser> users = doc.Element("Users").Elements("User").Select
(u => new User
{ ID = (int)u.Attribute("id"),
Name = (string)u.... | [
0.07915592193603516,
0.01742671988904476,
0.5374875664710999,
-0.07392704486846924,
0.24051693081855774,
0.08672957122325897,
0.43328148126602173,
-0.387364000082016,
0.01996549963951111,
-0.7718855738639832,
-0.41169533133506775,
0.5234067440032959,
-0.31970295310020447,
-0.09770241379737... | |
).OfType<IUser>().ToList(); //explicity materializing all objects by calling ToList()
var matches = User.GetMatchingUsers(users);
var excludes = users.Except(matches); // excludes now contains 6 users as expected
```
I don't see why I should need to materialize objects for calling `Except` given that its defined... | [
-0.04569915309548378,
0.17608743906021118,
0.5252897143363953,
-0.3505270481109619,
0.07076823711395264,
-0.08589236438274384,
0.5851984620094299,
-0.5853430032730103,
-0.19506226480007172,
-0.5664200782775879,
-0.4122914671897888,
0.3338009715080261,
-0.621139407157898,
0.2001024931669235... | |
would lead to different references and so no matches. Using `ToList` fixes this because it iterates the LINQ query once only and so the references are fixed.
I've been able to reproduce the problem you have and having investigated the code, this seems like a very plausible explanation. I haven't proved it yet, though.... | [
0.4705400764942169,
0.07957539707422256,
0.4935136139392853,
0.12984488904476166,
0.13055846095085144,
-0.18283502757549286,
0.364205002784729,
-0.19021950662136078,
-0.3307373523712158,
-0.5354438424110413,
0.24914288520812988,
0.577076256275177,
-0.1454201489686966,
0.12744376063346863,
... | |
is the output for each of the calls:
```
==> Start
ID=1, Name=Jeff, HashCode=39086322
ID=2, Name=Alastair, HashCode=36181605
ID=3, Name=Anthony, HashCode=28068188
ID=4, Name=James, HashCode=33163964
ID=5, Name=Tom, HashCode=14421545
ID=6, Name=David, HashCode=35567111
<== End
==> Start
ID=1, Name=Jeff, HashCode=650668... | [
-0.38558027148246765,
0.4998004138469696,
0.4879853129386902,
-0.22499795258045197,
0.12116523087024689,
0.7739545702934265,
0.45263898372650146,
-0.5893346667289734,
-0.04789283126592636,
-0.12982811033725739,
-0.5899907946586609,
0.5179014801979065,
-0.4411316215991974,
0.354550689458847... | |
{
get;
set;
}
}
class User : IUser
{
#region IUser Members
public int ID
{
get;
set;
}
public string Name
{
get;
set;
}
#endregion
public override | [
-0.2790088355541229,
-0.3026893436908722,
0.5839499235153198,
-0.15773266553878784,
0.1791445016860962,
-0.24519675970077515,
0.16724863648414612,
0.007999719120562077,
-0.06588199734687805,
-0.9659330248832703,
-0.35787948966026306,
-0.004113214556127787,
-0.1785859316587448,
0.4587496221... | |
string ToString()
{
return ID + ":" + Name;
}
public static IEnumerable<IUser> GetMatchingUsers(IEnumerable<IUser> users)
{
IEnumerable<IUser> localList = new List<User>
{
new User{ ID=4, Name="James"},
new User{ ID=5, Name="Tom"}
}.OfType<IUse... | [
-0.1724800169467926,
-0.3639443814754486,
0.7974427938461304,
-0.326433390378952,
0.35844627022743225,
0.1200401559472084,
0.2936951220035553,
-0.1932280957698822,
-0.16200564801692963,
-0.4127504229545593,
-0.5863771438598633,
0.6870835423469543,
-0.3748008608818054,
0.325748473405838,
... | |
OutputUsers(users);
var matches = from u in users
join lu in localList
on u.ID equals lu.ID
select u; | [
-0.256848007440567,
-0.3307897448539734,
0.5891126394271851,
-0.2730335593223572,
-0.039605725556612015,
0.3554585576057434,
0.031980399042367935,
-0.12109587341547012,
-0.152386873960495,
-0.8579663634300232,
-0.11179416626691818,
0.4094978868961334,
-0.40151163935661316,
0.28492245078086... | |
return matches;
}
public static void OutputUsers(IEnumerable<IUser> users)
{
Console.WriteLine("==> Start");
foreach (IUser user in users)
{
Console.WriteLine("ID=" + user.ID.ToString() + ", Name=" + user.Name + ", HashCode=" + user.GetHashCode().ToString());
}
... | [
-0.1986134648323059,
0.03848257660865784,
0.5728462934494019,
-0.4414407014846802,
0.3014812171459198,
0.13950558006763458,
0.3213546574115753,
-0.18982946872711182,
0.1048370748758316,
-0.5310607552528381,
-0.39340853691101074,
0.5562211871147156,
-0.5620816946029663,
0.4357169270515442,
... | |
args)
{
XDocument doc = new XDocument(
new XElement(
"Users",
new XElement("User", new XAttribute("id", "1"), new XAttribute("name", "Jeff")),
new XElement("User", new XAttribute("id", "2"), new XAttribute("name", "Alastair")), | [
-0.008282347582280636,
0.1876741349697113,
0.8259063363075256,
-0.2463446855545044,
0.12550659477710724,
0.27605435252189636,
0.14561809599399567,
-0.13247935473918915,
-0.04306084290146828,
-0.3338126540184021,
-0.4952630400657654,
0.5518136620521545,
-0.4044015407562256,
0.41143971681594... | |
new XElement("User", new XAttribute("id", "3"), new XAttribute("name", "Anthony")),
new XElement("User", new XAttribute("id", "4"), new XAttribute("name", "James")),
new XElement("User", new XAttribute("id", "5"), new XAttribute("name", "Tom")),
new XElement("User", new X... | [
0.13513965904712677,
0.12811733782291412,
0.686717689037323,
-0.16396892070770264,
0.06453187018632889,
0.4905521273612976,
0.2705498933792114,
-0.256151407957077,
-0.09059768170118332,
-0.6483967900276184,
-0.8083333969116211,
0.4727644920349121,
-0.35547295212745667,
0.1662115752696991,
... | |
(u => new User
{
ID = (int)u.Attribute("id"),
Name = (string)u.Attribute("name")
}
).OfType<IUser>(); //still a query, objects have not been materialized | [
-0.37316614389419556,
-0.07919415086507797,
0.8014873266220093,
-0.16827361285686493,
0.1104678064584732,
0.2783384621143341,
0.26798176765441895,
-0.32421478629112244,
-0.10798001289367676,
-0.8205719590187073,
-0.31961169838905334,
0.45201730728149414,
-0.18942996859550476,
0.40677222609... | |
User.OutputUsers(users);
var matches = User.GetMatchingUsers(users);
User.OutputUsers(users);
var excludes = users.Except(matches); // excludes should contain 6 users but here it contains 8 users
}
}
``` | [
0.027072062715888023,
0.16249127686023712,
0.4076980948448181,
-0.35863420367240906,
0.13975656032562256,
-0.09672916680574417,
0.4797634482383728,
-0.4014170467853546,
-0.36538049578666687,
-0.3831278383731842,
-0.3019010126590729,
0.34198129177093506,
-0.7271044254302979,
0.0760379582643... | |
I'm designing a language, and I'm wondering if it's reasonable to make reference types non-nullable by default, and use "?" for nullable value and reference types. Are there any problems with this? What would you do about this:
```
class Foo {
Bar? b;
Bar b2;
Foo() {
b.DoSomething(); //valid, but w... | [
0.17524950206279755,
0.4495247006416321,
-0.0631079375743866,
-0.1874828189611435,
-0.04984626546502113,
-0.13866931200027466,
0.5611487030982971,
-0.11821135878562927,
0.039179477840662,
-0.44133272767066956,
-0.07025543600320816,
0.47279465198516846,
-0.6649063229560852,
0.04583916068077... | |
by default on reference types (in this, I agree with Tony Hoare - Google for his recent QCon talk).
On this specific example, with the unnullable b2, it wouldn't even pass static checks: Conservative analysis cannot guarantee that b2 isn't NULL, so the program is not semantically meaningful.
My ethos is simple enough... | [
0.16291961073875427,
0.45186755061149597,
-0.07144075632095337,
0.0009739231318235397,
-0.3059498369693756,
-0.1657731682062149,
0.5149279832839966,
0.0651131346821785,
-0.18483714759349823,
-0.39903193712234497,
-0.24105341732501984,
0.3663169741630554,
-0.3925953507423401,
0.232463836669... | |
This gives either a multitude of checks up front (Is it null? No? Yay!), or the inevitable NPE (or equivalent). Most programming resources are, these days, not massively resource constrained or bound to some finite underlying model - null references are, simplistically, one of...
* Laziness: "I'll just bung a null in ... | [
0.06300929188728333,
0.36092594265937805,
-0.3586842119693756,
0.07539451122283936,
0.019128616899251938,
-0.23603719472885132,
0.6310062408447266,
0.6392404437065125,
-0.4380054175853729,
-0.4261821210384369,
-0.2966703772544861,
0.09176455438137054,
-0.1078919768333435,
0.354210883378982... | |
Better error reporting mechanisms are thus essential in a language
* A hole: "I know I'll have something soon, give me a placeholder". This has more merit, and we can think of ways to combat this.
Of course, solving each of the cases that NULL current caters for with a better linguistic choice is no small feat, and ma... | [
0.06634288281202316,
0.0653349757194519,
-0.04147404804825783,
0.2420951873064041,
-0.18030104041099548,
0.028189068660140038,
0.6119361519813538,
0.4127199053764343,
-0.15613123774528503,
-0.7195244431495667,
-0.20334216952323914,
0.4843732416629791,
0.0642344206571579,
-0.248527243733406... | |
for better solutions in this space worthwhile. | [
0.4351711869239807,
0.237574964761734,
0.249921053647995,
0.33675360679626465,
0.16361793875694275,
0.11188676208257675,
0.27677416801452637,
0.00511260936036706,
-0.05369437858462334,
-0.727084755897522,
-0.02907140739262104,
0.26714155077934265,
0.15345335006713867,
0.12808717787265778,
... | |
i have 3 tables - films, films\_genres (for connect 2 tables) and genres.
In Model film.rb - has\_and\_belongs\_to\_many :genres
In Model genre.rb - has\_and\_belongs\_to\_many :films
So, how I can write this sql code:
SELECT \* FROM `genres` INNER JOIN `films_genres` ON `genres`.id = `films_genres`.genre\_id WHERE (... | [
0.4301886558532715,
0.36743560433387756,
0.5802407264709473,
0.21773166954517365,
0.08114735037088394,
-0.04172755032777786,
-0.30532532930374146,
-0.5254668593406677,
-0.40757817029953003,
-0.26319077610969543,
0.2471223622560501,
0.7289330959320068,
0.025440305471420288,
0.43508994579315... | |
more complex in order to specify multiple genres as part of your named scope. Hope it helps. | [
0.6295400261878967,
-0.03133517876267433,
-0.014200528152287006,
0.07245375961065292,
-0.012257399968802929,
-0.10442410409450531,
0.20894283056259155,
0.23482684791088104,
-0.33966997265815735,
-0.64366215467453,
-0.017089499160647392,
0.6224069595336914,
0.014195499941706657,
0.231240153... | |
I know there are thousand of visual effects made in JS that can be found on Google. But most of that effects are useless in web-design, or are outdated like "clock following mouse cursor" :| Also I know sites like <http://www.chromeexperiments.com> and <http://www.dhteumeuleu.com> but those examples make web-browser us... | [
0.42656680941581726,
0.13536308705806732,
0.244521364569664,
0.11426321417093277,
-0.22373448312282562,
-0.07345506548881531,
0.20535850524902344,
-0.02656039409339428,
-0.16531039774417877,
-0.8068901300430298,
0.3066890835762024,
0.7196309566497803,
0.11440680176019669,
0.071041904389858... | |
at header.
[jParallax](http://webdev.stephband.info/parallax.html) is an efficient jQuery plugin that does game-like parallax scrolling. Useful for web design? Well... if you *really* want something that acts like a video game, maybe. | [
0.22561362385749817,
-0.20207026600837708,
0.2140609472990036,
0.42394500970840454,
-0.24646183848381042,
-0.2352934330701828,
-0.042535778135061264,
0.022818878293037415,
-0.23981258273124695,
-0.4584447145462036,
0.0975567176938057,
0.23292545974254608,
-0.1605197638273239,
0.16952824592... | |
There are a handful of open-flash-charts tutorials on the web, mostly php from what I can see. I know there is a Java helper class, but I haven't found documentation or examples.
The helper library is also includes in the ofcharts grails plugin.
Java/Groovy or Grails suggestions welcome.
thanks!
One of the single be... | [
0.17432492971420288,
0.2432113140821457,
0.033842120319604874,
0.1866893172264099,
-0.1209142804145813,
-0.12256257236003876,
0.21844525635242462,
0.5370591282844543,
-0.3175039291381836,
-0.5353895425796509,
0.057347141206264496,
0.4894854426383972,
0.10428155213594437,
-0.165807500481605... | |
do little else to make the charts work than to generate JSON. To that end Grails is ideal - however what you will spend a lot of time working on is structuring that JSON data.
The linked site provides the most detailed JSON API documentation that exists for the different chart types OFC supports. | [
0.39105796813964844,
0.21236470341682434,
0.3675917685031891,
0.17392432689666748,
-0.24466398358345032,
-0.19175070524215698,
0.08103480190038681,
0.10396649688482285,
-0.2664574384689331,
-0.669981837272644,
-0.1525113433599472,
0.46276846528053284,
-0.137667715549469,
-0.188982710242271... | |
For my programming languages class, I'm writing a research paper on some papers by some important people in the history of language design. One by CAR Hoare struck me as odd because it speaks against independent compilation techniques used in C and later C++ before C even became popular.
Since this is primarily an opt... | [
0.3323073089122772,
0.5021599531173706,
-0.4154081344604492,
0.033958446234464645,
-0.19825321435928345,
0.1343388706445694,
0.013119084760546684,
-0.06792395561933517,
-0.43864208459854126,
-0.1488627791404724,
0.3618638217449188,
0.4659343659877777,
-0.22893394529819489,
-0.1436808556318... | |
these techniques before them?
Short answer: Java and C# don't avoid separate compilation; they make full use of it.
Where they differ is that they don't require the programmer to write a pair of separate header/implementation files when writing a reusable library. The user writes the definition of a class once, and th... | [
0.38663312792778015,
-0.09959058463573456,
-0.40417513251304626,
0.13490240275859833,
-0.18457219004631042,
-0.20243458449840546,
-0.017563028261065483,
-0.40140941739082336,
-0.1325378566980362,
-0.6442227363586426,
0.04404642432928085,
0.42319393157958984,
-0.34978222846984863,
-0.067908... | |
a single package.
Then when another class is compiled and it depends on the first class, it can look at the metadata instead of having to find a separate include file.
It happens that they target a virtual machine rather than a specific chip architecture, but that's a separate issue; they could put x86 machine code i... | [
0.5395510196685791,
-0.006284544710069895,
-0.33242520689964294,
0.0002475186192896217,
-0.03211856260895729,
-0.46331146359443665,
0.16660107672214508,
-0.25935739278793335,
-0.33751851320266724,
-0.6135006546974182,
-0.5433393716812134,
0.41751110553741455,
-0.6186821460723877,
0.1175394... | |
`.dll` and `.class` files is much like a pre-compiled header - already parsed and indexed, ready for rapid look-ups.
The upshot is that in these modern languages, there is one way of doing modularization, and it has the characteristics of a perfectly organised and hand-optimised C++ modular build system - pretty nifty... | [
0.15808334946632385,
-0.010583165101706982,
0.0915309339761734,
-0.06115895137190819,
-0.06565031409263611,
-0.09161376953125,
-0.1584644913673401,
-0.1699853539466858,
-0.2906505763530731,
-0.36660099029541016,
-0.22749802470207214,
0.4663051962852478,
-0.3509402871131897,
-0.212777152657... | |
I was able to configure NetBeans for 2.6.1 by going to to the Python Platform Manager, creating a new platform, and pointing NetBeans at python.exe where I installed 2.6.1. However, when I follow the exact same steps for 3.0, I get an error in the NetBeans console that says "SyntaxError: invalid syntax".
If it matters... | [
0.04511525109410286,
0.18908610939979553,
0.3182857036590576,
-0.3327758312225342,
-0.056265659630298615,
-0.3136163651943207,
0.497770220041275,
0.031498972326517105,
-0.15430161356925964,
-0.5512591004371643,
-0.0833311378955841,
0.828011691570282,
-0.49798083305358887,
0.156627908349037... | |
python.exe and everything else
```
I'm wondering if anyone else has experienced this and what they did to correct the problem.
Yep- it's actually very easy. The scripts in the plugin use 'print' as a keyword which has been changed in Python 3; you just have to convert all 'print' statements in the console.py and plat... | [
0.2073432207107544,
0.15248626470565796,
0.2809540033340454,
-0.25818362832069397,
-0.22877615690231323,
-0.008724709041416645,
0.20551419258117676,
0.05592910945415497,
-0.2536250352859497,
-0.45655107498168945,
-0.1890251487493515,
0.7904666662216187,
-0.36945468187332153,
-0.39369025826... | |
statements. Then go into the NetBeans and import your Python30 directory into the Python Platform Manager; it will work just fine.
I haven't run into any other issues yet, but there might be some other small syntax issues in the plugin; they should be very easy to fix. | [
0.4569852352142334,
-0.010565994307398796,
-0.14790767431259155,
0.06523805856704712,
-0.17649681866168976,
-0.12772731482982635,
0.4455290734767914,
0.20984193682670593,
0.09729494899511337,
-0.37200239300727844,
0.04738830029964447,
0.8693930506706238,
-0.34355685114860535,
-0.2096421867... | |
We can bundle all files into an Amazon Machine Instance and upload it. But I'd like to see if there is a more efficient way to regularly upload source code on to test our app and constantly have the latest version up and running. Thanks!
I am not sure I understand your question correctly, but an Amazon Machine Instance... | [
0.4321463704109192,
0.03600914403796196,
-0.003387605771422386,
0.5760126113891602,
-0.0032146067824214697,
-0.020885992795228958,
0.11762432754039764,
0.04858870431780815,
-0.1778700202703476,
-0.880825936794281,
0.22694966197013855,
0.7640865445137024,
-0.1424742043018341,
0.302861630916... | |
an instance using tools like [Putty](http://www.chiark.greenend.org.uk/~sgtatham/putty/) or [WinScp](http://winscp.net/) - you probably know about these, if you are able to create a new image. Use these tools to configure your instance as you would have configured a machine in your local network. | [
0.2549375891685486,
-0.03564230352640152,
0.30052414536476135,
0.00471279164776206,
-0.011586032807826996,
0.0530351847410202,
0.1800590604543686,
0.1258060187101364,
-0.45361360907554626,
-1.0281867980957031,
-0.0701674371957779,
0.31266531348228455,
-0.23993080854415894,
0.12946274876594... | |
A colleague of mine agreed to using Subversion (SVN) for our little project, but only if he doesn't have to install it. He has a [U3 USB stick](http://en.wikipedia.org/wiki/U3) where he keeps the project files and he would like the SVN client to live there as well. I tried searching for a non-installable SVN client, bu... | [
0.719021737575531,
0.01955620013177395,
-0.011769548058509827,
0.13756228983402252,
0.020899944007396698,
-0.2934529781341553,
0.25191164016723633,
0.2916676104068756,
-0.27997836470603943,
-0.40107136964797974,
0.25986558198928833,
0.24801740050315857,
-0.15455827116966248,
0.215188071131... | |
too, not just the command line.
**Added:** The copy-paste from an existing installation is one solution, but I'd like to see first if there perhaps isn't some client that does not require installation by design. If not, I guess RapidSVN is nice enough (although it does leave stuff in Windows registry).
Try **[RapidSVN... | [
-0.2013901323080063,
-0.08064665645360947,
0.4204750061035156,
0.1148628368973732,
-0.24598993360996246,
-0.23665739595890045,
0.5308507084846497,
0.2753441631793976,
-0.6925543546676636,
-0.6268665790557861,
-0.19745759665966034,
0.6221061944961548,
-0.2582189440727234,
-0.120148494839668... | |
PortableApp](http://portableapps.com/node/6767)**. There is an "installer", but it really just unzips things into a directory of your choice and writes a default configuration file into that directory. | [
0.03704293072223663,
0.08102209120988846,
0.5108445882797241,
-0.007750652264803648,
0.05354086682200432,
-0.3164913058280945,
-0.1706235408782959,
0.357761949300766,
-0.4545305073261261,
-0.7600182294845581,
-0.002559517975896597,
0.5603978037834167,
-0.021964576095342636,
0.2766160964965... | |
Even the standard blank-window Cocoa app that gets built when you make a new Cocoa project in Xcode uses almost 6 MB of memory. What's the reason for this? Is it possible to make an app use less, or does OS X simply manage memory differently for Cocoa apps?
Not that I'm complaining. I know that performance "hardly mat... | [
0.19999012351036072,
0.5705254673957825,
0.08381609618663788,
0.3753563165664673,
-0.005823373328894377,
0.06728123873472214,
0.14346721768379211,
0.22866472601890564,
-0.6058291792869568,
-0.5173516273498535,
0.06865551322698593,
0.575589120388031,
0.012675113044679165,
-0.056152179837226... | |
can check exactly how memory blocks are mapped by running:
```
sudo vmmap <PID of the process>
``` | [
-0.031325310468673706,
0.06506512314081192,
0.02651120536029339,
0.33925023674964905,
0.15066328644752502,
-0.05456309765577316,
0.0819377526640892,
0.01943458989262581,
-0.08769110590219498,
-0.7962573766708374,
-0.19475656747817993,
0.5511936545372009,
0.08971242606639862,
0.012303263880... | |
I have the below enum that I use for one of my filters and suit well to my object model
```
public enum ColorGroups
{
White = 1,
Brown = 2,
Red = 3,
Black = 4
}
```
My concern is in the future when a client want to another color to the collection how do I extend the collection. I want the system to b... | [
0.31876179575920105,
-0.11583387851715088,
0.346073180437088,
-0.07862894982099533,
0.34472519159317017,
-0.16400177776813507,
-0.0706305280327797,
0.08699916303157806,
-0.43939638137817383,
-0.8297455310821533,
-0.10167857259511948,
0.5228552222251892,
-0.47198936343193054,
0.051923323422... | |
suitable to use an enum. Enums are compile-time units, so will require a developer (or some hacky code generation).
Instead, consider using a database table for this data, pre-populated with your items (and perhaps with a "System" column to control which ones are user-defined vs required by the system). Then changes a... | [
0.25002026557922363,
-0.1988869309425354,
0.3869866728782654,
0.3808923661708832,
0.40629783272743225,
-0.05777742713689804,
-0.24883876740932465,
-0.27295082807540894,
-0.3469441831111908,
-0.8187351226806641,
-0.16518263518810272,
0.3893899619579315,
-0.07417992502450943,
0.0891753658652... | |
In my application I've a main *shell* window and lots of dialogs (classes `extends Dialog`). I use `setSize(width,height)` when initializing them, but I know that users constantly resize them for their taste.
What is a smarty way to get notified when the size changes so I can store/load them?
(And why don't do toolki... | [
0.22314198315143585,
0.08108671754598618,
0.26533961296081543,
0.14291028678417206,
0.07478205114603043,
-0.06443324685096741,
0.021718010306358337,
-0.002545223105698824,
-0.12710699439048767,
-0.9067983627319336,
-0.052423764020204544,
0.29815760254859924,
-0.047466933727264404,
0.163811... | |
pre-populated with your items (and perhaps with a "System" column to control which ones are user-defined vs required by the system). Then changes are just inserts (etc) to the table.
You can, of course, use any other storage mechanism - for example, a delimited string in a config file - but I'm guessing you'll want a ... | [
0.29100489616394043,
-0.179396390914917,
0.520003080368042,
0.30351701378822327,
0.299871027469635,
0.08445630967617035,
-0.306281715631485,
0.09998607635498047,
-0.47985050082206726,
-0.632319986820221,
-0.07586707174777985,
0.3665165305137634,
-0.06705263257026672,
0.1023213267326355,
... | |
I'm working in Adobe AIR, and I have a list of divs that show expanded information for each list item in a hidden div on a click - like so:
```
$(this).click(function(){
$(this).next('div.info').toggle();
});
```
This extends the height of the whole app, so eventually, if the user were to expand all of the divs, th... | [
0.5404301285743713,
0.0448077991604805,
0.8259249925613403,
-0.2775888741016388,
0.015479214489459991,
0.12603813409805298,
0.10725793242454529,
-0.3727520704269409,
-0.11418221145868301,
-0.7821086049079895,
0.14493006467819214,
0.4748551547527313,
-0.2908949851989746,
0.07037253677845001... | |
or show) is going to be applied. Setting my if() statement to key on the end-state of the info div doesn't work, because it assesses the div immediately on the click.
Is there any way to know which .toggle is being applied in jQuery so I can use that state change to apply my other changes?
After the toggle finishes, y... | [
0.2575748562812805,
-0.18534792959690094,
0.8949920535087585,
-0.40589606761932373,
0.009763933718204498,
-0.1792275756597519,
0.30912259221076965,
-0.11494366824626923,
0.04568278789520264,
-0.6275476217269897,
-0.11737795174121857,
0.6768907904624939,
-0.30181464552879333,
0.012138732708... | |
I have a table with a nullable field of type text. When I run an InsertOnSubmit(), it inserts successfully but all formatting is lost. Specifically, I'm storing the stack trace of an error. Each entry has been formatted into its own line and it looks nice, but when I retrieve it from SQL it loses all its crlf4's.
I ha... | [
0.08128038793802261,
0.23265519738197327,
0.4779052734375,
-0.312588095664978,
0.09540160000324249,
-0.17250020802021027,
0.4052892327308655,
-0.6192095279693604,
-0.157443568110466,
-0.5069882273674011,
-0.01975906640291214,
0.5661914348602295,
-0.6171393990516663,
0.07779698073863983,
... | |
stack += stacktrace[i].Trim() + "\r\n";
Error err = new Error();
err.Severity = (byte)sev;
err.Product = (byte)prod;
err.Location = stacktrace[0];
err.Title = message;
err.datetime = DateTime.Now;
err.StackTrace = stack;
dc.Errors.InsertOnSubmit(err);
dc.SubmitChanges();
```
Note that if I debug into the app, err.S... | [
-0.22184279561042786,
0.1551380604505539,
0.8622839450836182,
-0.22356560826301575,
0.28888145089149475,
0.3229147791862488,
0.6070810556411743,
-0.3878464698791504,
-0.1807151585817337,
-0.5967335104942322,
-0.5998357534408569,
0.6986451148986816,
-0.32891640067100525,
0.02806722745299339... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.