text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
<url>myurl</url>
<modules>
<module>mymodules</module>
</modules>
<properties>
<my.version>x.x.x-needs_change</my.version>
</properties>
<dependencies>
<dependency>
<groupId>hhhhh</groupId>
<artifactId>hhhhh</artifactId>
<version>x.x.x-should not change</version>
... | [
0.37190812826156616,
0.3114425837993622,
0.6772619485855103,
-0.23153455555438995,
-0.17777909338474274,
-0.2114543914794922,
0.0331636443734169,
-0.2696820795536041,
0.06627316772937775,
-0.851701557636261,
-0.37191808223724365,
0.1561044305562973,
-0.31582602858543396,
0.4164321720600128... | |
want to go the maven version plugin route. I have tried it and it does not suit my requirements.
I prefer sed / python script.
Thanks
You could try:
```
sed -e '/<dependencies>/,/<\/dependencies>/ !{
s!<version>[0-9.]\+</version>!<version>'"$NEWVERSION"'</version>!
}' MY_FILE
```
The `/<dependencie... | [
0.01237459946423769,
-0.014428296126425266,
0.6225552558898926,
-0.24335353076457977,
-0.03975580632686615,
-0.09275972098112106,
0.278669148683548,
0.1802784502506256,
0.03447156026959419,
-0.7358744740486145,
-0.05538664013147354,
0.6616687774658203,
-0.3438597321510315,
-0.0401772484183... | |
quotes (`'"$NEWVERSION"'`) was because I wanted single quotes for the main part of the sed command (so I don't have to worry about the exclamation mark & backslashes), but I *do* want `$NEWVERSION` to be expanded.
Modify to suit your script. | [
0.5202890634536743,
0.03780858591198921,
0.28808876872062683,
-0.16569256782531738,
-0.11852631717920303,
0.15035763382911682,
0.1823122203350067,
-0.009258471429347992,
-0.050163719803094864,
-0.4132959544658661,
-0.026781203225255013,
0.6059284806251526,
-0.2674601674079895,
-0.090258546... | |
HI I am new at Scala Trying to run this code:
```
class Number(x : Int){
var number = x
def inc(): Int = {
number => number + 1
}
}
```
But I get the following error: solution.scala:12: error: missing parameter type
number => number + 1
I dont know how to fix this.
or simply:... | [
-0.17474213242530823,
-0.01371567603200674,
0.7396765351295471,
-0.1471717208623886,
-0.021602975204586983,
-0.004184025339782238,
0.5047401189804077,
-0.45299413800239563,
-0.0737696960568428,
-0.315701425075531,
0.062010567635297775,
0.4591000974178314,
-0.5274752974510193,
0.02111804857... | |
need to specify it
As for dealing with mutability in the question, inc(1), inc(5), etc. are themselves transformed representations of the number passed to the class instance (i.e. they equate to "var number", but immutably so). No real need for mutability based on what we see here... | [
-0.11882752180099487,
-0.13463035225868225,
-0.07960130274295807,
-0.01402679830789566,
-0.11577796936035156,
0.14504529535770416,
0.2749273478984833,
-0.21325014531612396,
-0.18767587840557098,
-0.5457513928413391,
-0.36457356810569763,
0.6495794653892517,
-0.112513467669487,
0.3164933621... | |
I have a class with a property that's a Dictionary:
```
public class Entity
{
public Dictionary<string, string> Name { get; set; }
}
```
I would like switch this property to use lazy initializtion. I tried the following:
```
public class Entity
{
private Lazy<Dictionary<string, string>> name = new Lazy<Di... | [
-0.07295213639736176,
0.09463978558778763,
0.08572275936603546,
-0.08293982595205307,
-0.023853011429309845,
0.01268140971660614,
0.18078860640525818,
-0.20795319974422455,
0.013334522023797035,
-0.6010247468948364,
-0.026972750201821327,
0.6948025226593018,
-0.15334215760231018,
0.3633226... | |
name have different types. For the life of me though, I can't figure out how to specify this correctly. All I really want is to have Name remain null until I access it, then create it on the first read or write.
You can use the initialization with `Lazy`, but what you want is pretty simple and you could simply do this
... | [
0.11140519380569458,
-0.030653776600956917,
0.17011773586273193,
-0.08380836993455887,
-0.010480049066245556,
-0.10636661946773529,
0.3895077407360077,
0.04692527651786804,
-0.007869611494243145,
-0.6407819986343384,
-0.0031355912797152996,
0.5210771560668945,
-0.21917828917503357,
0.59963... | |
Dictionary<string, string>();
return _name;
}
set _name = value;
}
```
EDIT: Note that this approach will have some thread safety issues. Check if this can be a problem for you. | [
0.20406898856163025,
-0.017260367050766945,
0.25701186060905457,
-0.1658991426229477,
0.07180819660425186,
-0.28824612498283386,
0.36158856749534607,
0.07675419002771378,
0.07318300008773804,
-0.653383731842041,
-0.05231364443898201,
0.7326074838638306,
-0.388963907957077,
0.17132082581520... | |
I am currently building an authentication server for a game. Basically how I have it planned out is a client will connect to our servers and they will authenticate the client and then issue the client a ticket. As long as the ticket is valid the client is able to join servers. Besides authentication I would like to dis... | [
0.19947455823421478,
-0.24983195960521698,
0.37179985642433167,
0.3388853073120117,
-0.16653525829315186,
-0.24246402084827423,
-0.07800757139921188,
0.10419966280460358,
-0.20584531128406525,
-0.8155580759048462,
0.5318670272827148,
0.31148216128349304,
-0.16411949694156647,
-0.0367166027... | |
with an ASP.NET web app. Is that too big of a step since I haven't used ASP.NET before? Should I start with something smaller?
**EDIT:**
Ok so I have a simple WCF Service now but I am having trouble understanding exactly how to use it. How do I actually use the service I created to exchange data between a console app ... | [
0.5515375733375549,
-0.1331731677055359,
0.2997295558452606,
0.14003829658031464,
-0.1814810037612915,
-0.10661274939775467,
0.10226385295391083,
-0.10161133110523224,
-0.33024728298187256,
-0.7109465599060059,
0.31081676483154297,
0.6296133995056152,
-0.21884366869926453,
-0.0689429417252... | |
it's a website then all you really need is a Login page. Otherwise, yeah WCF. | [
0.7487896084785461,
0.17942960560321808,
0.3220894932746887,
0.23607957363128662,
-0.10170607268810272,
-0.568381667137146,
0.24909791350364685,
0.8254305124282837,
-0.22706781327724457,
-0.43282198905944824,
0.20400235056877136,
0.6370232105255127,
0.1703449934720993,
0.19662505388259888,... | |
I have 2 problems with my code below:
Problem 1:
For questionId, it is not displaying the correct question number. Lets say I have 2 questions. Then for question 1, questionId should be '1' but instead it displays '3' Another example is that if I have 7 questions, then for question 1, questionId should be '1' but it ... | [
-0.030244357883930206,
-0.0312560610473156,
0.24211053550243378,
0.06921881437301636,
-0.37493133544921875,
0.13257181644439697,
0.6660957336425781,
-0.22008273005485535,
-0.5287125110626221,
-0.48771554231643677,
0.06208963692188263,
0.3425102233886719,
-0.5875985622406006,
0.196144148707... | |
is:
```
Question 1:
SessionId QuestionId QuestionContent OptionId
ABV 1 What is my name? O6
Question 2:
SessionId QuestionId QuestionContent OptionId
ABV 2 What is my age? O9
```
Then in the echo $questionsql it should display:
INSERT INTO Question (... | [
0.13985487818717957,
0.34323862195014954,
0.35437923669815063,
-0.4152112305164337,
0.2960020899772644,
0.6621327996253967,
0.10136211663484573,
0.00324636185541749,
-0.024852341040968895,
-0.2391163855791092,
-0.14297255873680115,
0.24052417278289795,
0.29585888981819153,
-0.0769082307815... | |
name?','O6'), ('ABV' ,'2','What is my age?','O9')
But it is not displaying the above, instead it is displaying this below which is incorrect as it displays wrong question number and it displays only 1 question which is the latest question added.
INSERT INTO Question (SessionId, QuestionId, QuestionContent, OptionId)... | [
0.05724223703145981,
0.029742538928985596,
0.49762535095214844,
-0.20175106823444366,
0.5544561147689819,
0.4569089114665985,
0.0688827782869339,
-0.2905152440071106,
-0.14003339409828186,
-0.5629355311393738,
-0.11370334774255753,
0.6581797003746033,
0.151988685131073,
0.24831046164035797... | |
$selected_option = "A-D";
break;
case "5":
$selected_option = "A-E";
break;
default:
$selected_option = "";
break;
}
$optionquery = "SELECT OptionId FROM Option_Table WHERE (OptionType = '". mysql_real_escape_string($selected_option)."')";
$optionrs = mysql_query($optionquery);
... | [
-0.5247170329093933,
-0.5923539400100708,
0.32654720544815063,
-0.2201627492904663,
0.5376480221748352,
0.46531516313552856,
0.14835703372955322,
-0.29961061477661133,
-0.49047940969467163,
-0.4796850085258484,
-0.8008103966712952,
0.8101836442947388,
-0.23641306161880493,
-0.0727126896381... | |
$questionsql = "INSERT INTO Question (SessionId, QuestionId, QuestionContent, OptionId)
VALUES (" . implode('), (', $insertquestion) . ")";
$i++;
}
echo($questionsql);
```
Below is the form code. How it works is the user types in a question in the textarea ('name='questionText') and types in an option... | [
-0.11929526180028915,
-0.08974155783653259,
0.14483672380447388,
-0.08730324357748032,
-0.0800020843744278,
0.07072407752275467,
0.170847550034523,
-0.41879644989967346,
0.023849228397011757,
-0.5540747046470642,
-0.35159364342689514,
0.6545232534408569,
-0.29197460412979126,
-0.2472972571... | |
:)
What kind of game? Is it a game played on your website or a client application? If it's a website then all you really need is a Login page. Otherwise, yeah WCF. | [
0.6067831516265869,
-0.09526179730892181,
0.32621195912361145,
0.482532799243927,
0.08573533594608307,
-0.4165343642234802,
-0.06287211179733276,
0.5186508893966675,
-0.2026555836200714,
-0.39098167419433594,
0.14654161036014557,
0.7709466218948364,
-0.24478760361671448,
0.1558686494827270... | |
Is there any way that I could see a view is loaded without checking the source code of that view controller (e.g., viewDidLoad, viewWillAppear, etc.)
or how can I check at the run time / dynamically if any view is loaded to grab the subviews.
If you have an instance of a view controller, you can ask it:
```
viewContr... | [
0.4798721671104431,
-0.3073481023311615,
0.33466076850891113,
0.19278687238693237,
-0.06992604583501816,
-0.1886042356491089,
0.013538309372961521,
0.030453113839030266,
-0.3049858510494232,
-0.5416700839996338,
-0.07799668610095978,
0.6786232590675354,
-0.23188184201717377,
0.263230323791... | |
What is the default transaction isolation level for SQL Server with ADO.NET? I am using a default installation of SQL Server and just the normal System.Data.SqlClient classes.
> READ COMMITTED is the default isolation level for the Microsoft SQL Server Database Engine.
Source:
* [Customizing Transaction Isolation Lev... | [
-0.21760649979114532,
0.1307840198278427,
0.09116607159376144,
-0.23789669573307037,
0.05939067155122757,
-0.15120267868041992,
0.11616982519626617,
-0.24201670289039612,
-0.2942504584789276,
-0.3881889879703522,
0.14230988919734955,
0.40216416120529175,
-0.5385304689407349,
0.231626033782... | |
I'm new to developing iOS applications and Objective C itself, so I have a probably very simple question.
Currently I have the following method that is called from a ToolBar Button click. The method is designed to create a table view in the frame variable *fr*.
```
- (IBAction)addGolfer:(id)sender {
CGRect fr = C... | [
0.03936301916837692,
0.11800181120634079,
0.9662078022956848,
-0.11530428379774094,
-0.11639139801263809,
0.2427617311477661,
0.30736157298088074,
-0.4501744508743286,
-0.16769249737262726,
-0.5857423543930054,
-0.016319626942276955,
0.5931393504142761,
-0.3357616662979126,
0.0412805005908... | |
self;
tabrleView.dataSource = self;
[tabrleView reloadData];
self.view = tableView;
}
```
The result of calling this method is not what I expect. Instead of creating the Table View in the frame "fr", the table view fills the entire screen.
Again I'm totally new and would a appreciate any answers and any... | [
-0.04248751327395439,
0.15684360265731812,
0.7156181335449219,
-0.20020535588264465,
-0.3352598249912262,
-0.13445591926574707,
0.6042154431343079,
-0.5277026891708374,
-0.13469170033931732,
-0.7727082371711731,
0.14250539243221283,
0.7346453070640564,
-0.2754858732223511,
0.03745441883802... | |
code may contain syntax or logic errors** - I wrote it in notepad):
```
@interface YourViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> {
UITableView *firstTableView;
UITableView *secondTableView;
}
@end
```
//
```
@implementation YourViewController
#pragma mark - Objects Pro... | [
-0.006703645456582308,
-0.17164650559425354,
0.4400845766067505,
-0.1796472668647766,
-0.2427976131439209,
0.22130586206912994,
0.6196798086166382,
-0.5979245901107788,
0.0680311992764473,
-0.7845243215560913,
-0.47826212644577026,
0.2469557821750641,
-0.352277547121048,
0.0939154028892517... | |
[self.view addSubview:secondTableView];
}
#pragma mark - TableView DataSource Implementation
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (tableView == firstTableView) { // your tableView you had before
return 20; // or other number, that you want
}
... | [
-0.1850806027650833,
-0.2081967443227768,
0.8384969234466553,
-0.3677637279033661,
-0.2819713354110718,
0.08343195170164108,
0.3453637361526489,
-0.6410251259803772,
-0.19823028147220612,
-0.7657601237297058,
-0.02600538544356823,
0.4291318953037262,
-0.05094960704445839,
-0.00116875255480... | |
(cell == nil)
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
cell.backgroundView = [[UIView alloc] init];
[cell.backgroundView setBackgroundColor:[UIColor clearColor]];
[[[cell contentView] subviews] makeObjectsPerformSelector:@selector(re... | [
-0.17384694516658783,
-0.18177951872348785,
0.8141452074050903,
-0.23844340443611145,
-0.025171898305416107,
-0.03200200945138931,
0.24556401371955872,
-0.41567307710647583,
-0.11402755230665207,
-0.6982050538063049,
-0.2945876121520996,
0.37550100684165955,
-0.09173085540533066,
0.3197408... | |
I have the following columns in SQL Server 2008 table `t_list`:
`firstid, firstpoints, secondid, secondpoints`
I want to select all of those columns in an SQL query but order in a specific way.
I want to select the top 400 of those columns, ordering by `firstpoints` only for the `firstid` column, and `secondpoint... | [
-0.42201462388038635,
0.018046345561742783,
0.2024110108613968,
0.013910927809774876,
-0.35808122158050537,
0.19614124298095703,
0.029234271496534348,
-0.18427544832229614,
0.13912856578826904,
-0.8514994978904724,
-0.0019686741288751364,
0.47025954723358154,
-0.24612130224704742,
-0.00821... | |
firstidresult, firstpointresult, secondidresult, secondpointsresult
2. etc...
```
This works on MS SQL Server
```
Select t1.FirstID, t1.FirstPoints, t2.SecondID, t2.SecondPoints
From (Select Top 400 row_number() Over (Order By FirstPoints desc) As r, FirstID, FirstPoints From t_list) As t1
Join (Select Top 400 ro... | [
-0.6764530539512634,
-0.3081234395503998,
0.4528844356536865,
-0.05965110659599304,
-0.04934743791818619,
0.14194661378860474,
0.15022322535514832,
-0.2662394940853119,
-0.24695247411727905,
-1.1247801780700684,
-0.23808851838111877,
0.2904777526855469,
-0.10784754157066345,
0.207449808716... | |
I'm working on an app that behaves like a photo gallery, and I'm implementing the option to have the user delete photos from their gallery. To accomplish this, I decided to place an invisible button over each picture. When the user hits an "Edit" button, the hidden delete buttons over each picture become active. I'm us... | [
0.40582960844039917,
-0.22408317029476166,
0.42320847511291504,
-0.02313339337706566,
0.038005102425813675,
0.07558313757181168,
0.28149035573005676,
-0.06651638448238373,
-0.24585995078086853,
-0.4727121591567993,
0.06074882671236992,
0.5510717034339905,
-0.3534342646598816,
0.10373789072... | |
yes, I call removeObjectAtIndex. Here is the code I'm using:
```
- (IBAction)deleteButtonPressed:(id)sender {
NSLog(@"Sender is %@", sender);
UIAlertView *deleteAlertView = [[UIAlertView alloc] initWithTitle:@"Delete"
message:@"Are you sure you want... | [
0.1961006373167038,
0.07965485006570816,
0.6019746661186218,
-0.32746621966362,
0.04723344370722771,
-0.03278007730841637,
0.3202632963657379,
-0.14088943600654602,
-0.2518385350704193,
-0.30299338698387146,
0.015061560086905956,
0.23717214167118073,
-0.6393669247627258,
0.0604427456855773... | |
delegate:self | [
0.07400886714458466,
0.0893937349319458,
-0.2357151359319687,
0.32526955008506775,
-0.4601134955883026,
0.10130532830953598,
0.2042742520570755,
-0.3384566605091095,
-0.5265433192253113,
-0.22925089299678802,
-0.22519326210021973,
-0.0492587573826313,
0.01855991594493389,
0.083309203386306... | |
cancelButtonTitle:@"No"
otherButtonTitles:@"Yes", nil];
[deleteAlertView show];
int imageIndex = ((UIButton *)sender).tag;
deleteAlertView.tag = imageIndex;
}
- (void)alertView: (UIAlertView *) alertView
clickedButtonAtIndex: (NSInteger) buttonIndex
{
... | [
0.4098467230796814,
-0.5287704467773438,
0.6630476713180542,
-0.21355988085269928,
-0.20261628925800323,
0.16871196031570435,
0.31486719846725464,
-0.15784421563148499,
0.0652463361620903,
-0.2172309011220932,
-0.1635473370552063,
0.6933994293212891,
-0.5712409615516663,
0.0846402794122695... | |
NSLog(@"User Clicked Yes.");
[self.array removeObjectAtIndex: alertView.tag];
}
[self.user setObject:array forKey:@"images"];
}
```
The issue here is that when I click "Yes" in the alert view, nothing happens. However, if I tap on the image and click "Yes" a second time, the app crashes, and the debug... | [
-0.09945835918188095,
0.1616598665714264,
0.721220850944519,
-0.2039022296667099,
0.24226754903793335,
-0.27279046177864075,
0.692639172077179,
-0.020862191915512085,
-0.3996078073978424,
-0.5152665376663208,
-0.30222514271736145,
0.7418402433395386,
-0.4139295518398285,
0.0177127588540315... | |
is much appreciated, thanks!
Here is how I add them into the array:
```
////start of saving////
- (void)viewWillAppear:(BOOL)animated
{
self.user = [NSUserDefaults standardUserDefaults];
self.array = [[self.user objectForKey:@"images"]mutableCopy];
while(self.array == nil)
{
[self.user setOb... | [
-0.029819214716553688,
-0.21837449073791504,
0.9836365580558777,
-0.16680119931697845,
-0.04658322036266327,
0.364786297082901,
0.25295647978782654,
-0.4428412914276123,
-0.28362447023391724,
-0.8260599374771118,
-0.3235001266002655,
0.6799956560134888,
-0.11067609488964081,
-0.07884914427... | |
[self.array addObject:[NSData dataWithData:UIImagePNGRepresentation(imageView2.image)]];
[self.array addObject:[NSData dataWithData:UIImagePNGRepresentation(imageView3.image)]];
[self.array addObject:[NSData dataWithData:UIImagePNGRepresentation(imageView4.image)]];
[self.array addObject:[NSData dataW... | [
-0.26158401370048523,
-0.22607795894145966,
0.3791102468967438,
-0.3998965919017792,
-0.3127966821193695,
0.2048632949590683,
0.41951534152030945,
-0.6548328399658203,
-0.1404498815536499,
-0.6475856304168701,
-0.5563966631889343,
0.6481879353523254,
-0.2012965828180313,
0.0194137543439865... | |
imageView.image = [[UIImage alloc] initWithData:[self.array objectAtIndex:0]];
imageView2.image = [[UIImage alloc] initWithData:[self.array objectAtIndex:1]];
imageView3.image = [[UIImage alloc] initWithData:[self.array objectAtIndex:2]];
imageView4.image = [[UIImage alloc] initWithData:[self.ar... | [
-0.07702217251062393,
-0.23904624581336975,
0.770477831363678,
-0.04653582349419594,
-0.6811658143997192,
0.2810366749763489,
0.5167871713638306,
-0.48051172494888306,
-0.10907454043626785,
-0.9477463364601135,
-0.24458660185337067,
0.5383120179176331,
-0.1598479002714157,
-0.2515800893306... | |
selector:@selector(applicationDidEnterBackground:) | [
-0.0803418681025505,
-0.0938248485326767,
-0.1687026470899582,
0.025225132703781128,
-0.062127143144607544,
0.06681352853775024,
0.11792489141225815,
-0.1552683562040329,
-0.26906707882881165,
-0.580260157585144,
-0.3189506530761719,
0.2703409790992737,
-0.17747154831886292,
0.459102034568... | |
name:UIApplicationDidEnterBackgroundNotification
object:app];
backToGalleryButton.hidden = YES;
tapToDeleteLabel.hidden = YES;
deleteButton1.hidden = YES;
[super viewDidLoad];
}
- (void)viewDidUnload
{ | [
-0.3490614891052246,
-0.38694295287132263,
0.6316927671432495,
-0.058420028537511826,
0.12024756520986557,
0.544097363948822,
0.5740177035331726,
-0.05576537922024727,
-0.2643335163593292,
-0.4574252963066101,
-0.5206332802772522,
0.6272139549255371,
-0.34652024507522583,
0.144954964518547... | |
self.user = nil;
}
////end of saving
///// shows the hidden and invisible "delete" button over each photo.
- (IBAction)editButtonPressed:(id)sender {
grabButton.hidden = YES;
editButton.hidden = YES;
backToGalleryButton.hidden = NO;
tapToDeleteLabel.hidden = NO;
deleteButton1.hidden = NO;
}
-... | [
0.04930596798658371,
-0.0945844054222107,
0.5870914459228516,
-0.3035609722137451,
-0.11561061441898346,
0.3053091764450073,
0.634818434715271,
-0.6232210993766785,
-0.017201457172632217,
-0.4016827940940857,
-0.05924469977617264,
0.6112304925918579,
-0.32116249203681946,
-0.11848822236061... | |
message:@"Are you sure you want to delete this photo?" | [
0.600258469581604,
0.012936078943312168,
0.01690378598868847,
0.1589404195547104,
0.406033992767334,
-0.0858602449297905,
0.5467901825904846,
0.5932111740112305,
-0.46289801597595215,
-0.14456835389137268,
-0.02710234746336937,
0.07910370081663132,
-0.525534987449646,
0.12763826549053192,
... | |
delegate:self
cancelButtonTitle:@"No" | [
0.28657662868499756,
-0.18058308959007263,
-0.1120043396949768,
0.1650715321302414,
-0.1405441015958786,
0.08002723008394241,
0.3308491110801697,
0.061797723174095154,
-0.31829437613487244,
-0.33602607250213623,
0.021510833874344826,
0.2942218780517578,
-0.2145889401435852,
0.2426190823316... | |
otherButtonTitles:@"Yes", nil];
[deleteAlertView show];
int imageIndex = ((UIButton *)sender).tag;
deleteAlertView.tag = imageIndex;
}
- (void)alertView: (UIAlertView *) alertView
clickedButtonAtIndex: (NSInteger) buttonIndex
{
if (buttonIndex != [alertView cancelButtonIndex]) {
NSLog(@"User... | [
0.2837090492248535,
-0.30990341305732727,
0.7627186179161072,
-0.23330610990524292,
-0.01622660830616951,
-0.06838583201169968,
0.23127661645412445,
-0.5321481227874756,
-0.0766029953956604,
-0.24061168730258942,
-0.05230778828263283,
0.5462484955787659,
-0.4959675371646881,
-0.05211769044... | |
into the UIImageView from the users camera roll:
```
- (IBAction)grabImage {
self.imgPicker = [[UIImagePickerController alloc] init];
self.imgPicker.delegate = self;
self.imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserIn... | [
-0.3371431529521942,
-0.21200184524059296,
1.0165703296661377,
0.1681492030620575,
-0.017875364050269127,
0.28603675961494446,
0.289886474609375,
-0.2322208136320114,
0.00880049355328083,
-0.7254809141159058,
-0.7238578796386719,
0.49236589670181274,
-0.1306161880493164,
0.2096754312515258... | |
*)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
if (imageView.image == nil) {
imageView.image = img;
[picker dismissModalViewControllerAnimated:YES];
[self.popover dismissPopoverAnimated:YES];
return;
}
if (imageView2.image == nil) {
... | [
-0.20713454484939575,
-0.2941531538963318,
0.48552635312080383,
-0.10530699789524078,
-0.19558298587799072,
0.14090193808078766,
0.17930413782596588,
-0.23530912399291992,
-0.016965847462415695,
-0.2331518530845642,
-0.47964420914649963,
0.5383744835853577,
-0.28093421459198,
0.22393620014... | |
}
if (imageView3.image == nil) {
imageView3.image = img;
[picker dismissModalViewControllerAnimated:YES];
[self.popover dismissPopoverAnimated:YES];
return;
}
if (imageView4.image == nil) {
imageView4.image = img;
[picker dismissModalViewControllerAnimated:Y... | [
-0.05787934735417366,
0.09546427428722382,
0.5371593832969666,
-0.1457558125257492,
-0.11500600725412369,
0.3112436830997467,
0.2649940848350525,
-0.17046841979026794,
0.021375350654125214,
-0.4087798297405243,
-0.4164432883262634,
0.6566939949989319,
-0.3693316876888275,
0.511760830879211... | |
NSLog(@"Array: %@, index: %d", self.array, alertView.tag); just before removeAtIndex the console says **2012-04-03 18:39:39.066 AppName[1631:f803] Array: (null), index: 0.** Could that be the cause? I'm not sure why it would be, I think the code looks fine.
There are many oddities with this code but I think the problem... | [
-0.177083358168602,
-0.013258122839033604,
0.5404143929481506,
-0.19488517940044403,
-0.12685145437717438,
-0.07726463675498962,
0.8075876235961914,
0.3427544832229614,
-0.5412511825561523,
-0.534101128578186,
-0.014343304559588432,
0.4614991545677185,
-0.30665937066078186,
0.4496017396450... | |
> **Possible Duplicate:**
>
> [JQuery .each() backwards](https://stackoverflow.com/questions/1394020/jquery-each-backwards)
What is the easiest way to use `.each()` in reverse? At the moment I am doing this:
```
var temp = [];
$("#nav a").each(function()
{
temp.push($(this));
});
temp.reverse();
for(var i = ... | [
0.05876576155424118,
-0.0030481936410069466,
0.37185412645339966,
-0.4322049021720886,
-0.22716963291168213,
0.4210693836212158,
0.33551812171936035,
-0.4353407323360443,
-0.34179067611694336,
-0.5601204037666321,
0.14488081634044647,
0.2776465117931366,
-0.5259804129600525,
0.167262226343... | |
like normal.
Use this
```
$($("#nav a").get().reverse()).each(function() {
//..........
});
``` | [
0.043238818645477295,
-0.17332492768764496,
0.47129568457603455,
-0.49463367462158203,
0.0025853533297777176,
0.15937404334545135,
0.3813537359237671,
-0.11053817719221115,
-0.037790726870298386,
-0.21202462911605835,
-0.27500611543655396,
0.8718170523643494,
-0.4296194016933441,
0.0694269... | |
I've come across both `xterm-color` and `xterm-256color` as options when trying to set up my terminal program to use color - i.e. you can set your `TERM` environment variable to either one.
I was wondering if anyone can describe the difference between the two?
I've searched for documentation on my Ubuntu server as w... | [
-0.051299113780260086,
-0.19974222779273987,
0.2285604625940323,
0.03721856698393822,
-0.04964442178606987,
0.05438905954360962,
0.12153676152229309,
0.5223426818847656,
-0.22759006917476654,
-0.5316743850708008,
-0.18486882746219635,
0.7418452501296997,
-0.5162244439125061,
0.301501125097... | |
Xterm that’s less functional and that you’re not likely to be using. Usually you’ll want to use `xterm`, `xterm-16color` or `xterm-256color`.
In particular, `xterm-256color` is the default for Terminal starting with Mac OS X 10.7 Lion, with the next-best recommended values being `xterm-16color` or `xterm` (which only ... | [
-0.10846133530139923,
-0.10506906360387802,
0.7417646050453186,
-0.006374037824571133,
-0.025018049404025078,
-0.10759321600198746,
0.04559650272130966,
0.5022870302200317,
-0.3039884865283966,
-0.7485111951828003,
-0.23022177815437317,
0.6533230543136597,
-0.5024703741073608,
0.1814618855... | |
disable functionality or work around incompatibilities between the available terminfo values on a particular computer and the terminal emulator being used.
Note that technically Terminal should have its own up-to-date terminfo values that describe exactly which features it supports, instead of using the values for Xte... | [
0.004769354127347469,
-0.11843835562467575,
0.3350403904914856,
-0.09622826427221298,
0.44627153873443604,
-0.4526931047439575,
0.15578263998031616,
0.5264784693717957,
-0.08196286112070084,
-0.629109799861908,
-0.19774645566940308,
0.6555988788604736,
-0.5928600430488586,
0.20632573962211... | |
A number of programs and shell customization scripts explicitly check whether `$TERM` starts with (or is equal to) `xterm`. So some users would still need to know about using the recommended Xterm values with Terminal for compatibility with those.
If you’re not familiar with the terminfo system, take a look at the x-m... | [
0.1394263505935669,
-0.09854826331138611,
0.33930128812789917,
0.18253138661384583,
0.06470193713903427,
-0.22117997705936432,
-0.06561198085546494,
0.03510284423828125,
-0.16177110373973846,
-0.6501660943031311,
-0.03952844440937042,
1.000589370727539,
-0.34468182921409607,
0.068794652819... | |
```
$mystring="This is mystring. <a href='http://www.google.com'>Google.</a>";
$dom = new DOMDocument;
$dom->loadHTML($mystring);
$xPath = new DOMXPath($dom);
$nodes = $xPath->query('//a');
if($nodes->item(0)) {
$nodes->item(0)->parentNode->removeChild($nodes->item(0));
}
echo $dom->saveHTML();
```
I wan... | [
-0.2981951832771301,
-0.03931242600083351,
1.0239741802215576,
-0.4005489647388458,
-0.07840298116207123,
0.043990328907966614,
0.3053229749202728,
-0.45799148082733154,
-0.17634089291095734,
-0.5249610543251038,
-0.23071196675300598,
0.5643036961555481,
-0.44496941566467285,
0.16827745735... | |
So I am developing locally using Rails 3.2 and mysql. My local machine is a Mac and my database.yml for development is:
```
development:
adapter: mysql2
database: dbname
encoding: utf8
host: localhost
port: 3306
timeout: 5000
socket: /tmp/mysql.sock
```
And for test it's
```
test:
... | [
-0.056738678365945816,
0.37918782234191895,
0.3893016278743744,
-0.07788509130477905,
0.1153983548283577,
0.2482524961233139,
0.18172335624694824,
0.11826455593109131,
-0.04662729799747467,
-1.0931521654129028,
-0.20657865703105927,
0.5687509179115295,
-0.011479432694613934,
0.106545217335... | |
servers are on CentOS and the socket works correctly when deploying to them. However I just went to do a manual rake and got the
> Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
My site works, but I'm curious if I'm should be handling database.yml separately for deployment since it's someho... | [
0.06340618431568146,
-0.010148209519684315,
0.2655108869075775,
-0.015867536887526512,
-0.2659204304218292,
0.08557239174842834,
0.23685243725776672,
-0.04258454963564873,
0.06524211913347244,
-0.9902570843696594,
0.003522743470966816,
0.5260670781135559,
-0.1310359388589859,
0.00552350515... | |
I'm not terribly certain what the correct wording for this type of regex would be, but basically what I'm trying to do is match any string that starts with "/" but is not followed by "bob/", as an example.
So these would match:
```
/tom/
/tim/
/steve
```
But these would not
```
tom
tim
/bob/
```
I'm sure the ans... | [
0.3543761074542999,
0.037894342094659805,
0.4489322304725647,
0.09484752267599106,
0.011136738583445549,
0.4862845242023468,
0.10715848207473755,
0.6165075898170471,
-0.5124539136886597,
-0.17741288244724274,
-0.30548685789108276,
0.4542069733142853,
-0.1280779391527176,
0.226455956697464,... | |
for
You can use a negative lookahead (documented under ["Extended Patterns" in perlre](http://perldoc.perl.org/perlre.html#Extended-Patterns)):
```
/^\/(?!bob\/)/
``` | [
0.45084771513938904,
-0.19452479481697083,
0.24700461328029633,
-0.32235121726989746,
0.015706097707152367,
0.20206427574157715,
0.4701688885688782,
-0.15127523243427277,
-0.7546615600585938,
-0.32963767647743225,
-0.07377167791128159,
0.33413517475128174,
-0.6126372218132019,
-0.240515574... | |
In the program I am creating, I have a large amount of enums
```
enum kEvents
{
Start = 0,
End,
EntityCreated,
}
```
In this program, there is a huge list of Entities.
Each entity holds a list of "kEvents" that it is "Registered to"
Every time an object says "Call the Start event" I have to iterate thro... | [
0.23948940634727478,
0.21308737993240356,
0.08546340465545654,
0.021109137684106827,
0.13104166090488434,
-0.19465447962284088,
0.10206537693738937,
-0.20120938122272491,
-0.0008939530816860497,
-0.5035440921783447,
-0.13474681973457336,
0.5173224210739136,
-0.0707610696554184,
0.366897046... | |
case, what is the best way to:
1. Hold the collection of enums in each entity object
2. Check if the entity holds the triggered enum
I am wondering if Enums, being basically numbers, have a lower level, quicker way to handle this than a `List<T>` of objects.
> Every time an object says "Call the Start event" I have t... | [
0.2726227045059204,
-0.13581275939941406,
0.02784176729619503,
0.257328599691391,
0.017568524926900864,
-0.2989340126514435,
0.10507377982139587,
-0.2842490077018738,
-0.18089298903942108,
-0.46398499608039856,
0.225935697555542,
0.7388961911201477,
-0.18106849491596222,
-0.103849351406097... | |
pattern](https://stackoverflow.com/questions/1249517/super-simple-example-of-c-sharp-observer-observable-with-delegates) and there are several ways to go about this, here are a couple:
1. Have a single event which gets raised and has an enum parameter for event type (every subscriber gets it).
2. Have a dictionary of ... | [
0.16798003017902374,
-0.3151756823062897,
0.38284769654273987,
-0.07575919479131699,
0.04932241141796112,
-0.21846748888492584,
0.14823926985263824,
-0.3882335126399994,
-0.48075467348098755,
-0.6765005588531494,
-0.06462153047323227,
0.40460631251335144,
-0.5270108580589294,
0.01870160736... | |
{
// switch through all the events and handle the ones that you need
}
}
}
MyEventObserver observer = new MyEventObserver();
MyEventObservable observable = new MyEventObservable();
observable.OnEvent += new OnEventDelegate(observer.OnEventReceived);
```
Here is **option 2**:
```
public class... | [
-0.0664224624633789,
-0.10043729096651077,
0.44845759868621826,
0.04069063812494278,
0.15468885004520416,
0.1882634311914444,
0.22918465733528137,
-0.16634444892406464,
-0.2535710334777832,
-0.8863426446914673,
-0.2607842683792114,
0.6831504702568054,
-0.46900448203086853,
-0.1100497543811... | |
_observers[event].Add(observer);
}
}
interface class IObserver
{
void Notify(kEvents anEvent);
}
public MyEventObserver: IObserver
{
// Constructors and all
// ...
// Override the IObserver
public void Notify(kEvents anEvent)
{
switch(anEvent)
{
// switch t... | [
0.23217785358428955,
-0.039337724447250366,
0.22994929552078247,
-0.02244011126458645,
0.2321709394454956,
0.19933301210403442,
0.1878487914800644,
-0.2479931116104126,
-0.3319902718067169,
-0.6574468612670898,
-0.09757443517446518,
0.583391547203064,
-0.519214928150177,
-0.096884317696094... | |
}
}
}
MyEventObserver observer = new MyEventObserver();
MyEventObservable observable = new MyEventObservable();
observable.RegisterObserver(kEvents.Start, observer);
```
Option two will reduce the number of events each observer has to handle, but it comes at the cost of having to register for every event separat... | [
-0.2081591635942459,
-0.22788864374160767,
0.5476697087287903,
0.12741413712501526,
0.26551270484924316,
-0.09612803906202316,
0.4174049496650696,
-0.27736806869506836,
-0.24109964072704315,
-0.767694890499115,
-0.11160027980804443,
0.7603062987327576,
-0.341614693403244,
-0.06092290207743... | |
any of the code, but it should give you a general idea of how things ought to work. | [
0.6888314485549927,
0.11866315454244614,
0.09194541722536087,
0.3436855971813202,
0.24003402888774872,
-0.32340314984321594,
0.1872519701719284,
0.2533634603023529,
0.03142905235290527,
-0.33899110555648804,
-0.04272531718015671,
0.536227822303772,
-0.07647130638360977,
-0.1921362578868866... | |
I have declared a `struct`, and I try to pass an array of those structs (as well as a `double` array of doubles, and an integer) into a function. I get an *"array type has incomplete element type"* message from gcc when I compile it. What have I gotten wrong in how I pass the `struct` to the function?
```
typedef stru... | [
-0.02201918512582779,
0.28766417503356934,
0.4189496636390686,
-0.1298517882823944,
-0.2193288654088974,
-0.060323942452669144,
0.4801619052886963,
-0.2831364572048187,
-0.14465360343456268,
-0.556188702583313,
-0.33836114406585693,
0.40231022238731384,
-0.7097147107124329,
0.2626698017120... | |
int nodes);
```
The second and subsequent dimensions must be given:
```
void print_graph(g_node graph_node[], double weight[][32], int nodes);
```
Or you can just give a pointer to pointer:
```
void print_graph(g_node graph_node[], double **weight, int nodes);
```
However, although they look similar, those are ... | [
0.008783758617937565,
-0.03518286347389221,
0.6225998401641846,
-0.1280060112476349,
-0.15228678286075592,
0.2154717743396759,
0.0897601917386055,
-0.5508592128753662,
-0.4879921078681946,
-0.4608131945133209,
-0.3799203634262085,
0.294078528881073,
-0.49490469694137573,
-0.146301195025444... | |
tag {
int (*y)[n]; // invalid: y not ordinary identifier
int z[n]; // invalid: z not ordinary identifier
};
int D[m]; // valid: auto VLA
static int E[m]; | [
0.24473297595977783,
-0.41960227489471436,
0.3261977434158325,
-0.055787257850170135,
0.010369024239480495,
0.24988725781440735,
0.13307709991931915,
-0.5160191655158997,
-0.028759373351931572,
-0.08859653770923615,
-0.5684236884117126,
0.6928603053092957,
-0.6083388328552246,
-0.059139434... | |
// invalid: static block scope VLA
extern int F[m]; // invalid: F has linkage and is VLA
int (*s)[m]; // valid: auto pointer to VLA
extern int (*r)[m]; // invalid: r has linkage and points to VLA
static int (*q)[m] = &B; // valid: q is a static block pointer to VLA
}
``... | [
0.022716589272022247,
-0.12936750054359436,
0.2321624457836151,
-0.09752284735441208,
-0.07076180726289749,
0.32326656579971313,
0.21536417305469513,
-0.5329046249389648,
-0.2279737889766693,
0.12188395857810974,
-0.5495752692222595,
0.495187908411026,
-0.5539570450782776,
0.06057899445295... | |
comments
> [...] In my main(), the variable I am trying to pass into the function is a `double array[][]`, so how would I pass that into the function? Passing `array[0][0]` into it gives me incompatible argument type, as does `&array` and `&array[0][0]`.
In your `main()`, the variable should be:
```
double array[10]... | [
-0.04339311644434929,
-0.02148999273777008,
0.5802211761474609,
-0.21878564357757568,
-0.17337816953659058,
0.22073538601398468,
0.46499255299568176,
-0.029163815081119537,
0.09118720144033432,
-0.6562253832817078,
-0.12616263329982758,
0.3651856482028961,
-0.596013069152832,
0.08151488006... | |
g_node g[10];
double array[10][20];
int n = 10;
print_graph(g, array, n);
return 0;
}
```
That compiles (to object code) cleanly with GCC 4.2 (i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)) and also with GCC 4.7.0 on Mac OS X 10.7.3 using the com... | [
-0.43219855427742004,
0.09487000107765198,
0.6575725078582764,
-0.2147405743598938,
0.08084642142057419,
-0.0029469223227351904,
0.6500522494316101,
-0.1111491248011589,
-0.24111151695251465,
-0.7088457345962524,
-0.39363813400268555,
0.3882746398448944,
-0.6327605843544006,
0.116280987858... | |
I have a vb.net project that has 2 exe's that get built as well as the installer. The two exe's share a bunch of common files. I do not want to have two copies of the common files or mess around with having build events that copy things around (if possible).
My method was to create two projects in the same folder and ... | [
0.7400547862052917,
0.21117565035820007,
-0.12197928875684738,
-0.24799448251724243,
-0.055982720106840134,
-0.04246310889720917,
0.328177809715271,
0.03372733294963837,
-0.26956984400749207,
-0.9379615187644958,
0.25407665967941284,
0.49219033122062683,
-0.533240556716919,
0.2697693705558... | |
file in their folder and when I have two solutions in the same folder they conflict.
So my next effort was to create the second project in it's own folder and just add the items as needed. The problem here is that VS2010 doesn't hold a link to a file in a different folder it copies the file to the new project folder. ... | [
0.12122681736946106,
-0.13084496557712555,
0.3722671866416931,
0.13505925238132477,
-0.3727007210254669,
0.08436203747987747,
0.08116002380847931,
-0.38914892077445984,
-0.5503458976745605,
-1.1156686544418335,
0.17735956609249115,
0.5203431844711304,
-0.4589696228504181,
-0.00812208279967... | |
a pointer to pointer:
```
void print_graph(g_node graph_node[], double **weight, int nodes);
```
However, although they look similar, those are very different internally.
If you're using C99, you can use variably-qualified arrays. Quoting an example from the C99 standard (section §6.7.5.2 Array Declarators):
```
v... | [
0.14115409553050995,
-0.2486761212348938,
0.641836941242218,
-0.18469087779521942,
-0.1377972513437271,
0.277741402387619,
0.07885577529668808,
-0.6123232841491699,
-0.4071943759918213,
-0.318584680557251,
-0.37619340419769287,
0.3007511794567108,
-0.5006682872772217,
-0.09197711944580078,... | |
// invalid: y not ordinary identifier
int z[n]; // invalid: z not ordinary identifier
};
int D[m]; // valid: auto VLA
static int E[m]; // invalid: static block scope VLA
extern int F[m]; | [
0.201958566904068,
-0.2811470925807953,
0.2466382086277008,
-0.20744825899600983,
-0.1926446110010147,
0.23460151255130768,
0.1905297338962555,
-0.205466166138649,
-0.07522886991500854,
0.17398318648338318,
-0.8417870402336121,
0.5836676359176636,
-0.515023410320282,
-0.04206320270895958,
... | |
// invalid: F has linkage and is VLA
int (*s)[m]; // valid: auto pointer to VLA
extern int (*r)[m]; // invalid: r has linkage and points to VLA
static int (*q)[m] = &B; // valid: q is a static block pointer to VLA
}
```
---
### Question in comments
> [...] In my main(), the variab... | [
0.01505416538566351,
-0.09121561795473099,
0.33141109347343445,
-0.4658350348472595,
0.06947729736566544,
0.27450045943260193,
0.2949802875518799,
-0.2832699418067932,
-0.022059554234147072,
-0.015845369547605515,
-0.4377497434616089,
0.4388992190361023,
-0.5728569626808167,
0.140540778636... | |
so how would I pass that into the function? Passing `array[0][0]` into it gives me incompatible argument type, as does `&array` and `&array[0][0]`.
In your `main()`, the variable should be:
```
double array[10][20];
```
or something faintly similar; maybe
```
double array[][20] = { { 1.0, 0.0, ... }, ... };
```
... | [
0.0271599143743515,
-0.09522432088851929,
0.40702614188194275,
-0.18829844892024994,
0.01368445623666048,
0.007122921757400036,
0.48449042439460754,
-0.4337363839149475,
0.21453483402729034,
-0.4019133150577545,
-0.09225214272737503,
0.44287657737731934,
-0.5894765257835388,
0.085818417370... | |
array, n);
return 0;
}
```
That compiles (to object code) cleanly with GCC 4.2 (i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)) and also with GCC 4.7.0 on Mac OS X 10.7.3 using the command line:
```
/usr/bin/gcc -O3 -g -std=c99 -Wall -Wextra -c zzz.c
``` | [
0.05544578284025192,
0.22623613476753235,
0.5035580396652222,
-0.3154842257499695,
-0.0853685662150383,
0.1737678349018097,
0.3403991162776947,
-0.5575764775276184,
-0.3912808299064636,
-0.42177873849868774,
-0.1843990832567215,
0.464182585477829,
-0.28620174527168274,
0.18752266466617584,... | |
i have a li items i need to change class of the clicked items as follow
* remove class current from the default one
* add class current to the clicked one
my html code here
```
<ul class="filter">
<li><a href="#" title="" class="current">recent</a></li>
<li><a href="#"... | [
-0.3174595236778259,
-0.25826290249824524,
0.9805309772491455,
-0.28183576464653015,
-0.14057624340057373,
-0.05675360932946205,
0.13615989685058594,
-0.1552889049053192,
-0.06900037825107574,
-0.767140805721283,
-0.004961568862199783,
0.24908219277858734,
-0.44383829832077026,
0.108476638... | |
<li><a href="#" title="">top commented</a></li>
<li><a href="#" title="">other ...</a></li>
</ul>
```
and here is the jquery code to do that job
```
$(".filter > li a").click(function(){
$(".filter li a.current").removeClass("current");
$(this).addClass("current");
... | [
-0.22814205288887024,
-0.15025164186954498,
0.7523542046546936,
-0.22011034190654755,
-0.02146853692829609,
-0.09204159677028656,
0.059970829635858536,
-0.3701559603214264,
0.15474922955036163,
-0.7795534729957581,
-0.21163375675678253,
0.670223593711853,
-0.523372232913971,
-0.07093793898... | |
this code only to ul.filter
If you want the click processing to occur only within ul.filter then you should update your selector to reflect that:
```
$("ul.filter > li a")
```
Rather than
```
$(".filter > li a")
```
If you have more than one ul element with the "filter" class and you only want to apply the functi... | [
-0.06944450736045837,
-0.2761252522468567,
0.38173431158065796,
-0.10790102183818817,
-0.10336144268512726,
0.0587303526699543,
-0.16318878531455994,
-0.19688232243061066,
-0.05485130846500397,
-0.9011307954788208,
-0.11962918937206268,
0.4861249327659607,
-0.5940343737602234,
-0.063425548... | |
This is homework. I'm trying to work with arrays and this is the first project working with them. My book shows all kinds of examples but the way they code the examples doesn't do any justice to what the assignment calls for.
I am trying to write a program that asks a user to enter students into the system. The progra... | [
0.3524147570133209,
0.025605713948607445,
-0.11456762999296188,
0.3076377809047699,
0.03459634631872177,
0.018019171431660652,
0.04082025960087776,
0.0685349777340889,
-0.2859799861907959,
-0.7702102065086365,
0.15179190039634705,
0.09042110294103622,
-0.13268379867076874,
-0.0435569621622... | |
enter. The line of code that says
```
getStudentCount();
```
is a method that collects that information and then returns studentCount
I tried to code this to where the length of the array is going to be the number the user enters but it's not working so I wanted to ask for guidance. Ideally if this works and t... | [
0.1208939254283905,
0.05901472643017769,
0.6231290698051453,
-0.2940906584262848,
0.2135215848684311,
0.04879782348871231,
0.1369677633047104,
-0.009532107040286064,
-0.20300008356571198,
-0.7113605737686157,
-0.25074610114097595,
0.3257090151309967,
-0.35238102078437805,
0.374985694885253... | |
Scores Application.");
int studentCount = 1;
getStudentCount();
studentCount = sc.nextInt();
String [] students = new String[studentCount];
for (int i = 0; i < students.length; i++)
{
Student s = new Student();
String firstName = getString("Enter first name: ");
s.set... | [
-0.12101512402296066,
-0.48735031485557556,
0.8662381172180176,
0.12781107425689697,
0.3784222900867462,
0.021532218903303146,
0.1230745017528534,
-0.3875981569290161,
-0.22389823198318481,
-0.6978715658187866,
-0.5799865126609802,
0.10118396580219269,
0.043963320553302765,
0.3632896840572... | |
int score = getScore("Enter score: ");
s.setScore(score);
}
}
```
Everything I had in the program worked up until I tried to code
```
String [] students = new String[studentCount];
for (int i = 0; i < students.length; i++)
```
which tells me there is something wrong with the way I am doing th... | [
0.08652941882610321,
-0.19611528515815735,
0.23587733507156372,
0.049572814255952835,
-0.0048134238459169865,
0.0669465959072113,
0.29503318667411804,
-0.32946962118148804,
-0.10886067897081375,
-0.5045207738876343,
-0.002652163617312908,
0.24268855154514313,
-0.03581797704100609,
0.047226... | |
setters and getters. Is that enough to store it? How would I call it?
Again this is homework so any guidance is appreciated.
Thanks!
Well that's at least a homework example that shows some work on the part of the askee (and nicely written), so here's some help:
You set the studentCount to 1 and then call `getStudentc... | [
0.023591142147779465,
-0.47788238525390625,
0.4438491761684418,
0.3151469826698303,
-0.05875774100422859,
-0.13656020164489746,
-0.02730027213692665,
-0.1405859738588333,
-0.15177369117736816,
-0.43817776441574097,
-0.15902820229530334,
0.5302882194519043,
-0.06839926540851593,
-0.16113467... | |
value of your method to the variable [1]
[1] Yes I know I shouldn't answer homework questions completely, but I really saw no way whatsoever to answer that only partially - proposals welcome though :) | [
0.21511301398277283,
0.14839953184127808,
0.18012882769107819,
0.11857283860445023,
-0.2491174042224884,
-0.11531994491815567,
0.09581353515386581,
-0.2959042489528656,
0.29933229088783264,
-0.0757317841053009,
0.41323941946029663,
0.41406887769699097,
-0.12937483191490173,
0.0991708040237... | |
I am using `myFile.write("...")` often and sometimes I'd like to see the output in the console rather than re-opening the updated file. I am using IDLE.
So, I'd like to know, instead of going and replacing `myFile.write()` with `print()` everywhere, can I replace the filename (`output.txt`) with something like STDIO w... | [
0.2515307068824768,
0.2992691993713379,
0.4751873016357422,
-0.2535618841648102,
-0.04145195707678795,
0.07716004550457001,
0.04558080434799194,
0.3626512587070465,
-0.1463383585214615,
-0.920757532119751,
-0.11124135553836823,
0.8103582262992859,
-0.34617093205451965,
0.026599494740366936... | |
I'm trying solve a challenging problem in C++ with the concepts I'm not familiar with.
I'm trying to apply a filter to a matrix. However like I said I'm quite new at this and after some investigation I've found this link where it shows applying a filter is basically a multiplication
However what confuses me that wha... | [
0.25675058364868164,
-0.25289759039878845,
0.20230410993099213,
-0.09894794225692749,
-0.28446638584136963,
-0.07816816866397858,
0.0684472993016243,
-0.12110864371061325,
-0.21627108752727509,
-0.8282161951065063,
0.04102053493261337,
0.6592388153076172,
-0.48044225573539734,
0.0019104048... | |
the "application" process. If I follow the idea of creating a 3x3 matrix with only diagonal [0,1,0] am i going to apply it like in the second link or do I have to apply it to every single cell in matrix. Or if its really going to be a 1-D filter should I,again, apply it to every single cell or leave out the edges and c... | [
0.21024943888187408,
-0.12723971903324127,
0.42943742871284485,
-0.09968633204698563,
-0.29614660143852234,
0.05098642781376839,
0.027651812881231308,
-0.548303484916687,
-0.34720468521118164,
-0.7547934651374817,
-0.039195071905851364,
0.46009373664855957,
-0.6601616144180298,
-0.07818307... | |
using a 3x3 filter for a single pixel:
```
. . . . . . . . . .
. - - - . . . . . . . . .
. - @ - . x . . . -> . . @ . .
. - - - . . . . . . . . | [
-0.2858884036540985,
0.0764675885438919,
0.19871510565280914,
-0.3792107105255127,
-0.29855474829673767,
0.18963012099266052,
0.3990651071071625,
-0.5268072485923767,
0.02631792612373829,
-0.7294471263885498,
-0.09736070781946182,
0.045190781354904175,
-0.7929379940032959,
-0.3027994930744... | |
.
. . . . . . . . . .
```
I've labelled one input pixel with a `@` and its neighbors with `-`. You use the smaller matrix:
```
- - - . . .
- @ - x . . . = 3x3 array
- - - . . .
```
Sum up the numbers in the resultant 3x3 array, and store that value into the *new* image, in place of the ... | [
0.15122750401496887,
0.1683640331029892,
0.43522030115127563,
-0.347730815410614,
-0.28125378489494324,
0.38196808099746704,
0.08154847472906113,
-0.3818000257015228,
-0.09453786164522171,
-0.6740537881851196,
0.026143260300159454,
0.32851889729499817,
-0.48765191435813904,
0.0225696954876... | |
example, when filtering a 5x5 image using a 3x1 filter:
```
. . . . . . . . . .
. . . . . . . . . .
. - @ - . x . . . -> . . @ . .
. . . . . | [
-0.1169542595744133,
-0.23373882472515106,
0.11345478892326355,
-0.19966702163219452,
-0.13305138051509857,
0.11136951297521591,
0.14698004722595215,
-0.24135495722293854,
-0.4460945725440979,
-0.8882145285606384,
-0.22566922008991241,
0.20004680752754211,
-0.2829304039478302,
0.1722726374... | |
. . . . .
. . . . . . . . . .
```
You'll use a smaller subset of the input array, to match your kernel;
```
- @ - x . . . = 1x3 array
```
Then, again, sum the numbers in the resultant array, and store that value into the new image in place of the `@` pixel. | [
0.03986496478319168,
0.13093778491020203,
0.5192300081253052,
-0.051687486469745636,
-0.05283115804195404,
0.30239972472190857,
0.02057032287120819,
-0.2933443784713745,
-0.0014164044987410307,
-0.7829940915107727,
-0.17173367738723755,
0.596304178237915,
-0.5301466584205627,
-0.0711193829... | |
I am unable to open the .trace file which is the output of a test script run in Xcode-instruments.
When I try to open it, it says Unable to open the file.
Please suggest if there is a way to open it
```
prot = (char *)malloc(sizeof(char *));
```
Should be:
```
prot = malloc(sizeof(char) * SIZE); // SIZE is the no. ... | [
0.08226889371871948,
0.2275926172733307,
0.37389039993286133,
-0.15712079405784607,
0.39666488766670227,
-0.03950515761971474,
0.5069065690040588,
-0.20087768137454987,
-0.00813459511846304,
-0.48496589064598083,
-0.33124712109565735,
0.3593864440917969,
-0.3309040665626526,
0.184711560606... | |
I'm developing a php web service which generates some plists so I can use them in my iPhone app. It's everything working perfectly, except for this blank line that appears in the end of the document and makes it unreadable by my app. What could it be? I'm sure all the tags are being properly opened and closed.
Thanks!... | [
0.5810262560844421,
-0.009603523649275303,
0.4992671012878418,
0.1998986005783081,
0.08438389003276825,
-0.11074250191450119,
0.05005921795964241,
-0.20441344380378723,
-0.16952510178089142,
-0.6095843315124512,
0.044335637241601944,
0.22576917707920074,
-0.21277885138988495,
-0.2090720981... | |
Assume the simple file substitution below:
```
get-content db.cfg | %{$_ -replace 'a', 'b'} | out-file db.cfg.new -encoding default
```
out-file automatically uses \r\n as a line separator. Is there a way to force a different separator (like \n)?
I'm looking for an elegant solution. Other than that, one can certain... | [
0.015636781230568886,
0.09679193794727325,
0.6811105012893677,
0.022993464022874832,
0.0007436287123709917,
-0.08980395644903183,
0.27651917934417725,
-0.32840877771377563,
-0.021863842383027077,
-0.6279451847076416,
-0.09222494065761566,
0.6409354209899902,
-0.2059752643108368,
-0.0279321... | |
still streaming the file one line at a time. | [
0.38915255665779114,
-0.014967316761612892,
0.3014450669288635,
0.15543051064014435,
-0.137698695063591,
0.041395388543605804,
0.18766732513904572,
0.14083032310009003,
-0.3616224229335785,
-0.34191519021987915,
-0.0010019915644079447,
0.12966817617416382,
-0.030880428850650787,
0.00908640... | |
I renamed a web project in VS2010 and checked in.
In Team explorer the csproj file was not renamed, hence my colleague got an unable to load exception. He fixed the path but now the project loads but on both our machines the lock icon next to the renamed web project isn't there anymore although it's constituent files... | [
0.17566591501235962,
-0.07159549742937088,
0.2682829201221466,
-0.008358928374946117,
-0.23406726121902466,
-0.20499876141548157,
0.4700614809989929,
-0.04699129983782768,
-0.4426697790622711,
-0.7557129859924316,
-0.005414539948105812,
0.19285207986831665,
-0.44397062063217163,
0.42660880... | |
in the solution are affected.
Is there a fix for this that doesn't involve recreating the project and copying over. I don't want to lose all our edit history.
The problem is that `exp(x)` is approx `1+x`, but is being evaluated as `1` due to the `1` being indistinguishable from `1+x` in the floating point representati... | [
-0.37368133664131165,
0.28551432490348816,
0.4187676012516022,
0.021061671897768974,
0.021662600338459015,
0.1964585781097412,
0.1002112329006195,
-0.05594521015882492,
-0.20976471900939941,
-0.5789497494697571,
-0.11188293993473053,
0.3761151432991028,
-0.23271061480045319,
0.132269412279... | |
i Have created this script, but i dont know why the second select box is not showing...
Maybe my ASP is wrong??
look:
[HERE](http://fakedc.com/sites/luilui/teste.asp) is the demo page
this is the script:
```
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<%
strConnection ="Provider=Microso... | [
-0.081403449177742,
-0.00575964106246829,
0.5576108694076538,
0.16917100548744202,
0.29473549127578735,
-0.2542560398578644,
0.29371461272239685,
-0.20976240932941437,
-0.15296946465969086,
-0.8172407746315002,
-0.3118536174297333,
0.7233259081840515,
-0.0018727219430729747,
-0.12886880338... | |
End if
If cidade = "" Then
modelo = trim(Request("cidade"))
session("cidade") = true
End if
%>
<% set rs_estado = Server.Createobject("ADODB.RecordSet")
rs_estado.Open "SELECT distinct estado FROM ondeencontrar", objConn
%>
<script>
$("#first-choice").change(function() {
$("#second-c... | [
-0.4547058641910553,
-0.3822229504585266,
0.697939395904541,
-0.02895430289208889,
0.21754752099514008,
0.21861842274665833,
-0.042382799088954926,
-0.29134631156921387,
-0.07528243958950043,
-0.26481953263282776,
-0.2546452581882477,
0.670072078704834,
-0.23091256618499756,
0.207868427038... | |
if rs_estado.EOF then Exit do %>
<% Loop %>
</select>
<br /> <br />
<%
If not trim(Request("estado")) = "" then
set rs_cidade = Server.Createobject("ADODB.RecordSet")
rs_cidade.Open "SELECT distinct cidade, estado FROM ondeencontrar where estado = '"&estado&"'", objConn
%>
<select id="second-choice" style="displ... | [
-0.6264774203300476,
-0.09639003872871399,
0.624328076839447,
0.019078603014349937,
0.024242272600531578,
0.12226763367652893,
-0.2660595774650574,
-0.3600676357746124,
-0.01625322550535202,
-0.7137786746025085,
-0.24218720197677612,
0.5019465684890747,
-0.15472055971622467,
0.186944022774... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.