Search Results

Search found 619 results on 25 pages for 'orange'.

Page 9/25 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • C# text creation issue

    - by Mike
    This is whats going on. I have a huge text file that is suppose to be 1 line per entry. The issue is sometimes the line is broken with a new line. I edit this entire file and wherever the file doesn't begin with ("\"A) i need to append the current line to the previous line ( replacing \n with " "). Everything I come up with keeps appending the line to a new line. Any help is appricated... CODE: public void step1a() { string begins = ("\"A"); string betaFilePath = @"C:\ext.txt"; string[] lines = File.ReadAllLines(betaFilePath); foreach (string line in lines) { if (line.StartsWith(begins)) { File.AppendAllText(@"C:\xt2.txt",line); File.AppendAllText(@"C:\xt2.txt", "\n"); } else { string line2 = line.Replace(Environment.NewLine, " "); File.AppendAllText(@"C:\xt2.txt",line2); } } } Example: Orig: "\"A"Hero|apple|orange|for the fun of this "\"A"Hero|apple|mango|lots of fun always "\"A"Her|apple|fruit|no pain is the way "\"A"Hero|love|stackoverflowpeople|more fun Resulting: "\"A"Hero|apple|orange|for the fun of this "\"A"Hero|apple|mango|lots of fun always "\"A"Her|apple|fruit|no pain is the way "\"A"Hero|love|stackoverflowpeople|more fun

    Read the article

  • SQL Joins Excluding Data

    - by Andrew
    Say I have three tables: Fruit (Table 1) ------ Apple Orange Pear Banana Produce Store A (Table 2 - 2 columns: Fruit for sale => Price) ------------------------- Apple => 1.00 Orange => 1.50 Pear => 2.00 Produce Store B (Table 3 - 2 columns: Fruit for sale => Price) ------------------------ Apple => 1.10 Pear => 2.50 Banana => 1.00 If I would like to write a query with Column 1: the set of fruit offered at Produce Store A UNION Produce Store B, Column 2: Price of the fruit at Produce Store A (or null if that fruit is not offered), Column 3: Price of the fruit at Produce Store B (or null if that fruit is not offered), how would I go about joining the tables? I am facing a similar problem (with more complex tables), and no matter what I try, if the "fruit" is not at "produce store a" but is at "produce store b", it is excluded (since I am joining produce store a first). I have even written a subquery to generate a full list of fruits, then left join Produce Store A, but it is still eliminating the fruits not offered at A. Any Ideas?

    Read the article

  • How can I remove certain characters from inside angle-brackets, leaving the characters outside alone

    - by Iain Fraser
    Edit: To be clear, please understand that I am not using Regex to parse the html, that's crazy talk! I'm simply wanting to clean up a messy string of html so it will parse Edit #2: I should also point out that the control character I'm using is a special unicode character - it's not something that would ever be used in a proper tag under any normal circumstances Suppose I have a string of html that contains a bunch of control characters and I want to remove the control characters from inside tags only, leaving the characters outside the tags alone. For example Here the control character is the numeral "1". Input The quick 1<strong>orange</strong> lemming <sp11a1n 1class1='jumpe111r'11>jumps over</span> 1the idle 1frog Desired Output The quick 1<strong>orange</strong> lemming <span class='jumper'>jumps over</span> 1the idle 1frog So far I can match tags which contain the control character but I can't remove them in one regex. I guess I could perform another regex on my matches, but I'd really like to know if there's a better way. My regex Bear in mind this one only matches tags which contain the control character. <(([^>])*?`([^>])*?)*?> Thanks very much for your time and consideration. Iain Fraser

    Read the article

  • django class with an array of "parent" foreignkeys issue

    - by user298032
    Let's say I have a class called Fruit with child classes of the different kinds of Fruit with their own specific attributes, and I want to collect them in a FruitBasket: class Fruit(models.Model):     type = models.CharField(max_length=120,default='banana',choices=FRUIT_TYPES)     ... class Banana(Fruit):     """banana (fruit type)"""     length = models.IntegerField(blank=True, null=True)     ... class Orange(Fruit):     """orange (fruit type)"""     diameter = models.IntegerField(blank=True, null=True)     ... class FruitBasket(models.Model):     fruits = models.ManyToManyField(Fruit)     ... The problem I seem to be having is when I retrieve and inspect the Fruits in a FruitBasket, I only retrieve the Fruit base class and can't get at the Fruit child class attributes. I think I understand what is happening--when the array is retrieved from the database, the only fields that are retrieved are the Fruit base class fields. But is there some way to get the child class attributes as well without multiple expensive database transactions? (For example, I could get the array, then retrieve the child Fruit classes by the id of each array element). thanks in advance, Chuck

    Read the article

  • How to use PHP preg_replace regular expression to find and replace text

    - by Roger
    I wrote this PHP code to make some substitutions: function cambio($txt){ $from=array( '/\+\>([^\+\>]+)\<\+/', //finds +>text<+ '/\%([^\%]+)\%/', //finds %text% ); $to=array( '<span class="P">\1</span>', '<span>\1</span>', ); return preg_replace($from,$to,$txt); } echo cambio('The fruit I most like is: +> %apple% %banna% %orange% <+.'); Resulting into this: The fruit I most like is: <span class="P"> <span>apple</span> <span>banna</span> <span>orange</span> </span>. however I needed to identify the fruit's span tags, like this: The fruit I most like is: <span class="P"> <span class="a">apple</span> <span class="b">banna</span> <span class="c">coco</span> </span>. I'd buy a fruit to whom discover a regular expression to accomplish this :-)

    Read the article

  • Need some advice before starting coding my next iPhone app...

    - by Tom
    Hi! I need some advice about how should I start coding something. So here is the context: I've just finished building a CMS that manage a SQLite database. My application will be picking this database and use its content as the application's content. So far it's pretty simple. The application will have a navigation that will browse through various workflows, and once at the end workflow, it'll show contents from the database. A consultation kind a thing, example: Liquids - Juice - Orange Juice - Informations about Orange Juice. For my SQLite transactions, so far I believe I'll be using fmdb. It looks like a great wrapper. Here's a simple schema from one of the database: Workflow: id: { type: integer(3), primary: true, autoincrement: true } workflow_id: { type: integer(1) } name: { type: string(255) } That table's rows will be my navigations. Do you believe I should use a navigation controller? If so, then how could I generate the navigation tree from it? I have a good working knowledge of Objective-C and Foundation framework, but never went too far with it so that is why I'm asking before starting in the wrong direction :) Thanks a lot.

    Read the article

  • Problem with checkboxes, sql select statements & php

    - by smokey20
    I am trying to display some rows from a database table based on choices submitted by the user. Here is my form code <form action="choice.php" method="POST" > <input type="checkbox" name="variable[]" value="Apple">Apple <input type="checkbox" name="variable[]" value="Banana">Banana <input type="checkbox" name="variable[]" value="Orange">Orange <input type="checkbox" name="variable[]" value="Melon">Melon <input type="checkbox" name="variable[]" value="Blackberry">Blackberry From what I understand I am placing the values of these into an array called variable. Two of my columns are called receipe name and ingredients(each field under ingredients can store a number of fruits). What I would like to do is, if a number of checkboxes are selected then the receipe name/s is displayed. Here is my php code. <?php // Make a MySQL Connection mysql_connect("localhost", "*****", "*****") or die(mysql_error()); mysql_select_db("****") or die(mysql_error()); $variable=$_POST['variable']; foreach ($variable as $variablename) { echo "$variablename is checked"; } $query = "SELECT receipename FROM fruit WHERE $variable like ingredients"; $row = mysql_fetch_assoc($result); foreach ($_POST['variabble'] as $ingredients) echo $row[$ingredients] . '<br/>'; ?> I am very new to php and just wish to display the data, I do not need to perform any actions on it. I have tried many select statements but I cannot get any results to display. My db connection is fine and it does print out what variables are checked. Many thanks in advance.

    Read the article

  • Objective C number keypad, custom comma button

    - by rom_j
    I'm trying to add a comma button on a number keypad that has previous, next and done buttons, so that it looks like this : Problem is, that the orange button does not respond to taps. Actually if I moved it above the "7" button and tapped it, the 7 would be tapped. So my orange button may be shown above the keyboard, but it's reacting to taps as if it were below. Here is an abstract of my code : -(void)textFieldDidBeginEditing:(UITextField *)textField{ UIView *inputAccessoryView = [[UIView alloc] initWithFrame:CGRectMake(0, 500, screenWidth, 40.0)]; // 3 buttons on top UIView *topToolbar = [[UIView alloc] initWithFrame:CGRectMake(0, 0.0, screenWidth, 40.0)]; [topToolbar addSubview:self.inputPrevButton]; [topToolbar addSubview:self.inputNextButton]; [topToolbar addSubview:self.inputDoneButton]; [inputAccessoryView addSubview:topToolbar]; // Comma button UIButton *commaButton = [UIButton buttonWithType:UIButtonTypeCustom]; [commaButton setFrame: CGRectMake(0, 204, 105, 52)]; [commaButton setTitle:@"." forState:UIControlStateNormal]; [commaButton addTarget:self action:@selector(addComma) forControlEvents:UIControlEventTouchUpInside]; [commaButton setBackgroundColor:[UIColor orangeColor]]; [inputAccessoryView addSubview:commaButton]; // Useless, but tried anyway [inputAccessoryView bringSubviewToFront:commaButton]; [textField setInputAccessoryView:self.inputAccessoryView]; } All I know is that I should not be doing this (which is actually not working), so what should I do ?

    Read the article

  • Assign different colors to individual array elements

    - by rk.
    Say I have the array, arr1. I want to print this array (i.e. just display the numbers) but, I want to color the numbers based on their values. If arr1[i]<15, green, if arr1[i]20, red, else orange. Something to this effect. var arr1 = [ 5,10,13,19,21,25,22,18,15,13,11,12,15,20,18,17,16,18,23,25,25,22,18,15,13,11,12,15,20,18]; Here is what I tried doing: for(var i=0; i<arr1.length;i++){ if(arr1[i]<15){ var temp = $(this).css("color","green"); $this.text(temp); } else if(arr1[i]>20){ var temp = $(this).css("color","red"); $this.text(temp); } else { var temp = $(this).css("color","orange"); $this.text(temp); } } I tried changing the css property of individual elements and them adding them to the div, but it did not work for me. Can someone suggest how should I go about doing this?

    Read the article

  • UIPickerview filter list from a user previous textfield input

    - by user1547180
    int variabla; - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 1; } - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { if (variabla == 1) return list4.count; else if(variabla == 2) return list3.count; if (variabla == 3) return list1.count; if (variabla == 4) return list2.count; return YES; [pickerView reloadAllComponents]; } - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { if (variabla == 1) { subjectField.text = [list4 objectAtIndex:row]; } else if (variabla == 2) { gradeField.text = [list3 objectAtIndex:row]; } else if (variabla == 3) { mathField.text = [list1 objectAtIndex:[pickerView selectedRowInComponent:0]]; selectedRow = [pickerView selectedRowInComponent:0]; coreTView.text = [mathMeaning objectAtIndex:selectedRow]; } if (variabla == 4) { elaField.text = [list2 objectAtIndex:[pickerView selectedRowInComponent:0]]; selectedRow = [pickerView selectedRowInComponent:0]; coreTView.text = [elaMeaning objectAtIndex:selectedRow]; } [pickerView reloadAllComponents]; NSLog(@"row selected is %d", selectedRow); } - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { if (variabla == 1) return [list4 objectAtIndex:row]; if (variabla == 2) return [list3 objectAtIndex:row]; if (variabla == 3) return [list1 objectAtIndex:row]; if (variabla == 4) return [list2 objectAtIndex:row]; return NO; [pickerView reloadAllComponents]; } Hey I would like to know or pointed in the right direction on how to load a UIPickerView based on the user input from a previous uitextfield so if they type in the previous textfield apple I would like red, green, blue to show in the UIPickerView or if they type orange I would like to see orange, yellow grape thanks for the help in advance.

    Read the article

  • Is there a way to check if a div has the same class as an ancestor in jQuery?

    - by T.R.
    I'm looking to dynamically highlight a tab, if it represents the current page. I have: <style> #tabs li{bg-color: white;} body.Page1 #tabs .Page1, body.Page2 #tabs .Page2, body.Page3 #tabs .Page3{bg-color: orange;} </style> <body class="Page1 ADifferentClass"> <ul id="tabs"> <li class="Page1 SomeClass"> <li class="Page2 SomeOtherClass"> <li class="Page3 AnotherClass"> </ul> </body> As you can see, there needs to be CSS for each tab, so adding another page involves modifying both the HTML and the CSS. Is there a simple (DRY) way to check if two divs have the same class already built into jQuery? I ultimately went with this: <script> $(document).ready(function(){ var classRE = /Page\d+/i; var pageType = $('body').attr('className').match(classRE); $('li.'+pageType).addClass('Highlight'); }); </script> <style> #tabs li{bg-color: white;} #tabs li.Highlight{bg-color: orange;} </style>

    Read the article

  • [iPhone] Play video not in full screen mode

    - by Kyo
    Hello, First, excuse my english :) I've read on apple developer website that video playback provides by the framework supports only full screen mode. I will need to develop an application where video can be played in reduce screen mode. I've see that Orange TV make something which looks like what i need to do. http://img218.imageshack.us/img218/1228/tvplayerorange.jpg The application is available on app store but you need to have a subscription to test this application. Whatever, to resume it, we can see video (tv stream video) in a reduce mode and if we click on the screen it switch to a full screen mode. So my question, what i want to do is possible (Orange TV made it) but i wonder the difficulty to make it. It seems that I have to make a video player. If it take a bunch of time, I tkink I will use Media Player Framework of iPhone even isn't the optimal solution for me. Feel free to ask me more details ;) Thank you for your answers.

    Read the article

  • Create Clone Without Effecting Results of Original Object

    - by user1655096
    I have a function that when selecting an option, returns results. I want to be able to clone that function and have the ability to return another set of results, without adding the new results to the original object. // shows / hides results based on selection $(".categories-select").live("change" ,function(){ if($(this).val() == 'red'){ $('.red').removeClass('hide'); // toggles red results, sub menus $(this).parent('.controls').find('.sub').removeClass('hide'); } if($(this).val() == 'blue'){ $('.blue').removeClass('hide'); $(this).parent('.controls').find('.sub').addClass('hide'); } if($(this).val() == 'purple'){ $('.purple').removeClass('hide'); $(this).parent('.controls').find('.sub').addClass('hide'); } if($(this).val() == 'orange'){ $('.orange').removeClass('hide'); $(this).parent('.controls').find('.sub').addClass('hide'); } }); // Duplicates category select menu $(".add-color").find(function(){ $(".color-category").clone().removeClass('color-category').appendTo("#we-want-to").find('.sub,').addClass('hide') ; }); $(".add-color-alternate").click(function(){ $(".color-category-alternate").clone().removeClass('color-category-alternate').appendTo("#we-want-to").find('.sub, .results-table').addClass('hide'); });

    Read the article

  • find on page neighbouring siblings jquery?

    - by Stefan
    ok i've been searching for an answer to this (if there even is one) with no luck i have a succession of div elements as shown in the pic bellow: http://i61.photobucket.com/albums/h46/DrAcOliCh_2006/untitled-1.jpg?t=1300520458 the blue background is the absolute parent of the orange divs which are also siblings the DOM is not quite organized according to how the orange elements appear on the page because they are all draggable (i used jquery UI) and i moved them around inside the parent, yet, as some know, the DOM doesn't get reorganized when i move draggable elements around, so basically the siblings structure remains the same inside the DOM what i kinda need (again if that is even possible) is to determine the immediate on page neighbouring siblings of eachother; in other words, say we take that "FlashBanner" element which, on page, has the "Logo", the "Search" and the "ShoppingBasket" elements as immediate top siblings and the "Categories" and "Content" elements as immediate bottom siblings (and no left or right siblings) i have a manual solution to this, that is to pre-specify the on page neighbouring siblings for each element through a series of form fields and stuff (another story and another wall of text to explain), but that is not important atm as i want to know if it can be done automatically (i.e tell jquery to find them for me) appreciate any help, even an "it can't be done automatically", and thank you for your time hope this doesn't sound to ambiguous (or silly for that matter) and why i need to do that don't ask :P wall of text to explain cheers :)

    Read the article

  • Spinner setonitemselectedlistener is not called

    - by Gabrielle
    I have a strange problem. I need to do something when an item from spinner is selected. Here is my code : language = (Spinner) findViewById(R.id.current_language_text); ArrayAdapter adapter = new ArrayAdapter(this, com.Orange.R.layout.my_spinner_textview, languages); adapter.setDropDownViewResource(com.Orange.R.layout.multiline_spinner_dropdown_item); language.setAdapter(adapter); language.setSelection(Integer.valueOf(language_id) - 1); language.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) { System.out.println("position "+position); Toast.makeText(Settings.this, "Hello Toast",Toast.LENGTH_SHORT).show(); } @Override public void onNothingSelected(AdapterView<?> parentView) { // your code here } }); The problem is that onItemSelectedListener is not called. I put System.out.println in onItemSelected() but I don't get it in LogCat. I tried with Toast, and I get the same, it doesn't appear. Every time I select an item from spinner, in LogCat I get this warning : Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@2b1dabd0 Any idea why onItemSelectedListener is not called ?

    Read the article

  • What is a modern C++ approach to structures containing symbolic constants?

    - by Ken
    enum bool { FALSE = 0, TRUE = 1 }; I'm wondering how to translate this in a modern C++ approach and if there is a well suited container for that; i know that the enum are not really that appreciated, but i can't think about a real alternative in the C++ world. What if would like to associate the execution of a particular method with a state? Ok, this is the part where i will be more verbose. I would like to stress the fact that i'm asking about structures symbolic constants and not about TRUE and FALSE, i'm not that "needy". Suppose that i have a structure that can represent several states with their own constants enum semaphore { GREEN = 0, ORANGE = 1, RED = 2 }; this is C code, now my question is about how to do the same in C++ if there is a better way. My question continue when i ask about the possibility to do something like an automatic triggering when a change of state will occur, for example: int main{ ... semaphore = 1; ... } and without any extra statements this has to trigger a method() just because the semaphore is now orange. I hope that is more clear now.

    Read the article

  • Flex Sprite xy Coordinates

    - by Ian
    Hi, I have a drawing that looks more or less like the attached image. image The orange square is the currently selected selected sprite. The sprites are all draws from coordinates that i receive from XML. var sprObject:Sprite = new Sprite(); sprObject.graphics.beginFill(itemList.c.toString()); sprObject.name = strName; sprObject.graphics.moveTo(iX, iY); sprObject.graphics.lineTo(iX2, iY2); sprObject.graphics.lineTo(iX3, iY3); sprObject.graphics.lineTo(iX4, iY4); sprObject.graphics.lineTo(iX, iX); sprObject.graphics.endFill(); mainUI.addChild(sprObject); // mainUI is a mx:UIComponent g_Sprite.push(sprObject); // array of sprites. What I want to do is the following. If I'm currently on the orange square and I use my keyboard direction buttons (up/down/left/right). I want to deselect the current sprite and select the next sprite in the appropriate direction. The problem I'm having is that I cannot get the x and y coordinates of the drawn sprites. If I look in the array, the x and y coordinates of the sprites are all 0. If I can retrieve that I can write an algorithm to determine the next sprite to select. Any help would be appreciated.

    Read the article

  • C# - Wait to finish before doing the next task

    - by Alex Ogden
    i have a server application with a richtextbox as the console text basically. The problem is, i have start, restart and stop buttons - But my restart button doesn't work. Heres my code for the restart button: consoletxt("RESTART", "Restarting Server..."); statuslabel1.Text = "Restarting"; statuslabel1.ForeColor = Color.Orange; statuslabel2.Text = "Restarting"; statuslabel2.ForeColor = Color.Orange; command("stop"); //The performclick just starts the server startbtn.PerformClick(); statuslabel1.Text = "Online"; statuslabel1.ForeColor = Color.DarkGreen; statuslabel2.Text = "Online"; statuslabel2.ForeColor = Color.DarkGreen; consoletxt("RESTART", "Restart completed, server online!"); However, the output is this: 2012-04-01 11:32:12 [RESTART] Restarting Server... 2012-04-01 11:32:12 [RESTART] Restart completed, server online! 2012-04-01 11:32:12 [INFO] CONSOLE: Stopping the server.. 2012-04-01 11:32:12 [INFO] Stopping server So, it says that the restart has finished in the text - but it hasn't - all it has done is stop the server. Please can sombody explain to me how to do this properly? Thanks!

    Read the article

  • Coloring Default Buttons - color filter only on unfocused state

    - by rlo
    I want to buttons of different colors, but I want to do so while using the default button background resource in order to preserve the onfocus and onclick states. This is because I want to use the default highlight color of the OS for my app, which is NOT always orange (HTC Sense makes it green). I found that adding a color filter to the button's background drawable works great (in this case, blue): myButton.getBackground().setColorFilter(Color.parseColor(this.getString (R.color.button_blue)), Mode.MULTIPLY); BUT, when the button is focused or clicked, it turns a nasty orange_blue because it mixes the color filter with the orange of the background drawable. I want to ONLY set this color filter for the unfocused/unclicked nine- patch drawable within the default button's statelistdrawable. I'm not sure how else to do this. I see a similar solution here: http://stackoverflow.com/questions/2065430/fixed-android-detecting-fo... but I have some concerns with that solution, mainly what if the OS changes the graphic of the default button? Since the normal unfocused/ unpressed graphic is now hardcoded into the app, it would break the flow. Maybe can someone comment on whether it would be good or bad practice to hardcode the default graphic into the app? What are the chances of the OS completely changing the graphic? Any help please? Thanks very much!!

    Read the article

  • Monitor occasionally doesn't display properly

    - by homestead
    Hi, I am using dual monitors, and this behavior has occured on 2 different computers (using the same monitors). When I turn the monitors off, and then on again after a while, 1 monitor turns on, displays the Dell logo etc. but doesn't display the windows login. It is just a blank page, and then the green light turns orange. Turning it on/off many times or just waiting a while eventually results in it working again, but I am very confused why!

    Read the article

  • How to reset outlook 2010 options to default settings

    - by Jake
    How can I reset the outlook 2010 default options that are accessed via the orange Ribbon File Tab Options (left navi bar)? Searching online gives many step-by-stepp instruction in creating an Outlook Profile, which lets you add email accounts, data files etc. but does not seem to reset the Outlook options. Another popluar and more acucrate search result goes along this line https://kb.wisc.edu/wiscmail/page.php?id=9357 but it does not apply to Outlook 2010.

    Read the article

  • Which connector do I need for a "line level" subwoofer?

    - by Ben Brocka
    I've got a separate pair of speakers and I'm looking at adding a subwoofer (this, specifically). I noticed on the detail page it's inputs are listed as such: Inputs: Speaker level, line level If I'm not mistaken "line level" are the standard 3.5 audio jacks on your motherboard/sound card, right? My motherboard has the standard 6 ports for sound, if I get a subwoofer like this can I simply plug the input into the orange 3.5 jack? My audio software supports up to 7.1 so software-wise, 2.1 wouldn't be a problem.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >