Search Results

Search found 6502 results on 261 pages for 'dont reinvent the wheel'.

Page 198/261 | < Previous Page | 194 195 196 197 198 199 200 201 202 203 204 205  | Next Page >

  • how to go through a string array and apply functions for different strings?

    - by Newbie
    Ok, this may be really noobish question, but i am wishing there is something i dont know yet. I go through a file, and check which string each line has, depending on the string value i execute a different function for it (or functions). This is how i do it now: if(str == "something"){ // do stuff }else if(str == "something else"){ // do stuff }else if(str == "something more"){ // do stuff }else if(str == "something again"){ // do stuff }else if(str == "something different"){ // do stuff }else if(str == "something really different"){ // do stuff } I am afraid this will become "slow" after i have to repeat those else if lines a lot... I tried to use switch() statement, but obviously it doesnt work here, is there something similar to switch() to use here?

    Read the article

  • How to do visible EditText Data on Activity change

    - by user1249134
    HellO friends i am having edit text in my program and if i am writing some thing on there and if i am clciking on other option which will move to anothe activity and when i am coming back to same page the data of my edit text is clearing i dont want to clear data if i move on another page can any body tell me how to do it ..i am doing it by writing below code.. if(PresetQuestion.value=="true") { String note1=note.getText().toString(); note.setText(note1); } but its not woring i thing i am not doing correctly ...

    Read the article

  • Trying to get excel 2003 into already made windows form

    - by Dcurvez
    good afternoon everyone :) I got sucha dilemma! (hate being new at stuff!) What my problem is is that I have a project that is in full design mode swing right now. I built it using the Windows form.. Anyways, on one of my forms..that I already started building (very painstakingly).. Minds have changed and now what needs to be on that form is either a full excel 2003 workbook..or at the very least..excel worksheet. The problem is that I have not been using studio 2008 for long..and coding experience shows the same. Can someone please tell me how the heck I can put a worksheet or a workbook on that form without starting my whole project over using office forms? Please..go slow with this newbie cuz i really dont know anything and Jargon is confusing me even more :( thanxxXXX :)

    Read the article

  • AS3 Passing data between objects/classes

    - by 1337holiday
    So i a building a categorized menu of different foods. I have a class for "categories" (buttons) which essentially will return a string "salads", "drinks", etc. I now have another class "menuItems" for items within categories and this handles sizes such as "small", "med", "large", etc. My problem now is that when i return "salads", i want to invoke an array which contains all the elements of salads, send it to menuItems which will populate the menu. So far i have both the category objects and the menu object setup. I just cant seem to be able to send the data that the category object is returning and pass it to the menu object. Both of which are added to the stage as shown below: If there was a way that i could say add all these classes to one class so that they can talk to each other that would be great but i dont know how to do this. Been stuck for hours, please any help is greatly appreciated.

    Read the article

  • Accessing controls created dynamically (c#)

    - by Aliens
    In my code behind (c#) I dynamically created some RadioButtonLists with more RadioButtons in each of them. I put all controls to a specific Panel. What I need to know is how to access those controls later as they are not created in .aspx file (with drag and drop from toolbox)? I tried this: foreach (Control child in panel.Controls) { Response.Write("test1"); if (child.GetType().ToString().Equals("System.Web.UI.WebControls.RadioButtonList")) { RadioButtonList r = (RadioButtonList)child; Response.Write("test2"); } } "test1" and "test2" dont show up in my page. That means something is wrong with this logic. Any suggestions what could I do?

    Read the article

  • NodeJS + Express: res.redirect('back'); with params

    - by Ilya Rusanen
    I have register form on every page of my website. During registration some error may occur. After cathing error, I have to return user to previous page, showing some error tips. The problem is I dont know from which page user performs registration. That's why I use res.redirect('back');. However, I cant just redirect user back, I have to show him whats wrong. Thats why I have to pass some parameter. But res.redirect('back', (reg_error:'username')}) can not be used directly 'cause res.redirect() doesn't support parameters. How can I render prevous page with some parameter? Thanks!

    Read the article

  • Getting all inner classes by reflection

    - by Roman
    I have the following problem. I have this pretty class and now I want to get all the classes that extend that class (inner classes ) and fill 'classList' with it. ( in an automatic way of course ) public abstract class CompoundReference { private static List<Class<? extends CompoundReference>> classList = new ArrayList<Class<? extends CompoundReference>>(); @CompoundKey(gsType = User.class, dbType = UserDetailsMappings.class) public static class CUser extends CompoundReference { } @CompoundKey(gsType = Catalog.class, dbType = CatalogDetailsMappings.class) public static class CCatalog extends CompoundReference { } @CompoundKey(gsType = Product.class, dbType = ProductDetailsMappings.class) public static class CProduct extends CompoundReference { } @CompoundKey(gsType = Category.class) public static class CCategory extends CompoundReference { } @CompoundKey(gsType = Poll.class, dbType = PollDetailsMappings.class) public static class CPoll extends CompoundReference { } // much mroe inner classes Some manual solution would be just to main such a static block , that is something that I dont want to do. static { classList.addAll(Arrays.asList(CUser.class, CCatalog.class, CProduct.class, CCategory.class, CPoll.class, CComment.class, CWebPage.class, CReview.class, CPost.class, CMessage.class, CStory.class,CPicture.class)); }

    Read the article

  • Get child elements from a parent but not first and last

    - by Cleiton
    I would like to know how could I write a jQuery selector that get all children from a parent element except first and last child? Example of my current HTML: <div id="parent"> <div>first child( i don't want to get)</div> <div>another child</div> <div>another child</div> <div>another child</div> (...) <div>another child</div> <div>another child</div> <div>last child (i dont want to get neither)</div> </div>

    Read the article

  • How do you make the script wait for the status of an Ajax get request before continuing?

    - by codeninja
    Basically what I'm doing is checking for the existence of an object, if it's not found, the script will try to load the source file using getScript. I only want to check this once though then return true or false to the function that calls fetch() fetch:function(obj){ ... isReady = false; $.getScript(obj.srcFile,function(){ isReady=true; warn("was able to load object "+key); }); return isReady; } but return kicks in before the script loads =/ later the script is loaded but the function returned false. This is the beauty of asynchronous I suppose... What's the best way to handle this... Maybe I could check again at some other point if the object exists? Or maybe there's a better way to do this where I dont have to potentially lock the browser?

    Read the article

  • haskell. words into binary numbers

    - by Katja
    I need to convert words into binary numbers. With a bit help of yours I got this blCo::String -> Integer blCo x = num2bin(lett2num x) blCo (x:xs) | x:xs = num2bin(lett2num x):blCo xs num2lett :: Int -> Char num2lett n | (n <= ord 'A') && (n <= ord 'Z') = chr(ord 'A'+ n - 1) | (n <= ord 'a') && (n <= ord 'Z') = chr(ord 'A'+ n - 1) num2bin :: Integer -> String num2bin n | n >= 0 = concatMap show (reverse ( n2b n)) | otherwise = error "num2bin: negative number" where n2b 0 = [] n2b n = n `mod` 2 : n2b (n `div` 2) he tells me a mistake.I dont undertsand it mistake: Couldn't match expected type `Char' against inferred type `String' In the first argument of `lett2num', namely `x' In the first argument of `num2bin', namely `(lett2num x)' In the expression: num2bin (lett2num x)

    Read the article

  • QT4: How to restart application? Reset settings?

    - by Revollt
    Hi. 1.) I would like to restart my QT4 application. Just a normal shutdown and start of the same application. 2.) Why? Well i need an Option to "reset" everything. To restart the application seems to be the easiest way to do this. The problem is, that there are a LOT of classes and everything. I dont have the time to put every setting of them back to standard, every textBox, Widget to clear... I Know application restart is not the best way, what do you think is there another way? Thank You

    Read the article

  • C#, Using Custom Generic Collection faster with objects than List

    - by Kaminari
    Hello, I'm using for now List< to iterate through some object collection and find matching element, The problem is that object has only 2 significant values Name and Link (strings) but has some other values wich I dont want to compare. I'm thinkig about using something like HashSet (wich is exactly what I'm searching for - fast) from .NET 3.5 but target framework has to be 2.0. There is something called Power Collections here: http://powercollections.codeplex.com/ But maybe there is other way? If not, can you suggest me a suitable custom collection?

    Read the article

  • how to execute a .exe program by php script

    - by user347262
    hello I want to execute a .exe file on my Apache server using a php script. the procedure is as follow: 1- user comes, fills a html form 2- it goses to a php script 3- php script executes the name.exe file 4- php prints the output of the name.exe file on the page. I execute the name.exe normally from windows like this: run--> cmd--> D:\name [command] the name.exe needs to communicate with other files like libraries in the same directory. the complete comand in cmd at windows is like this: D:\name library.dll [input from user] then program executes and prints some results in cmd window. I actually want to run this program on my server form my clients. I dont know how, but I now there is a way to do this. another related questoin is that, is there any shell that i can install on Linux server and execute name.exe in it? thanks in advanced, John.

    Read the article

  • vb.net checkboxes. Need to populate from database and also help in designing

    - by redr
    i have this requirement and since im new to vb.net dont really have much of idea how to do this. I have 20 checkboxes with dropdowns and textbox with it. the example is - table tr td checkbox -- textbox -- dropdownlist /td /tr tr td chk1 txtbox1 ddl1 /td /tr tr td chk2 txtbox2 ddl2 /td /tr and so on. the above structure shall be in one row of a table. does anyone know how to design this in code recursive and also how to take the checkbox data from here and send it to db table for records insert, update and select. thanks

    Read the article

  • Active Scaffold + Ruby 2.3.5 not working

    - by rodrigoaronas
    Hello, I have an application with Rails 2.3.5. And Im trying to use AS latest version, I have used it previously but cant make it work here. I have my ingredient_categories Controller, where i put class Administration::IngredientCategoriesController < ApplicationController layout "default" active_scaffold :ingredient_categories end I have this set up on routes to be :active_scaffold=true I have a model also called ingredient_category, and in the views folder (inside administration/ingredient_categories, and /ingredient_categories) i have nothing as it is usual. And Im getting over and over again: Template is missing Missing template ingredient_categories/list.html in view path themes/aqueouslight:app/views I had an error before asking me for a list.erb, which I created and put <%= render :active_scaffold = 'ingredient_categories', :label = 'Categorias' % And now this error of the list.thml... Cant make it work! dont know whhy really... whould be SO simple and its burning my head now.. Thanks!

    Read the article

  • Template variable in ASP.NET

    - by williamrichards
    Hi, I have to add a Page's variable into a ItemTemplate but dont know how. For example: <rad:RadMenuItem ID="f" runat="server" Text="Products"> <ItemTemplate> <div class="pitem"><%= MyText %></div> </ItemTemplate> </rad:RadMenuItem> The MyText variable does exist in the context and has value but the text does not show up Another question: How can I add MyText to the ASP.NET page like the following? <asp:Button Text="<%=MyText%>" .../>

    Read the article

  • Version control PHP Web Project

    - by Adam Lerman
    We have a php project that we would like to version control. Right now there are three of us working on a "Dev" version of the project that all have our Eclipse linked to it with just an external folder, and thus no version control. What is the right way, and what is the best way, to version control this (not necessarily the same I dont think) We have a SVN set up but just need to find a good way to check in and check out that lets us test on the dev server. Any ideas?

    Read the article

  • Unassigned value error asp.net C#

    - by slash shogdhe
    if variable is not assigned,then it takes the default value at run time. for example int A1; if i will check the value of A1 at runtime it will be 0; then why at compile time it throws a error of unassigned value; why clr dont use to alot the default value at runtime; int A1; int B1 = A1+10; it shud be 11 as the default value of A1 is 0; there project property where i can check for "assignn defalut values for unassigned variable"; can any one tell me where i can find it;

    Read the article

  • JSF selectItem question

    - by DD
    Hi, Is there a way to dynamically create a selectItem list? I dont really want to have to create lots of bean code to make my lists return List<SelectItem>... I tried this: <ice:selectManyCheckbox> <ui:repeat var="product" value="#{productListingService.list}"> <f:selectItem itemLabel="#{product.description}" value="#{product.id}"/> </ui:repeat> </ice:selectManyCheckbox> but it doesnt work. Any ideas?

    Read the article

  • how sharepoint lookup column store its values?

    - by ps123
    Hello, I was trying to create a custom field type similar to lookup column just mine is filtered lookup column.Its working fine but I wanted to implement the same functionality like lookup column does,by that I mean: For e.g lookup column is having title of some list so it stores its value as SPListiem.ID#;title....but it shows only title when we r selecting or editing value in it. I am using listboxes and doing listbox.Items.Add(title); but how to get Id also and specially hidden from users like lookup column does....means I can do like this... listbox.Items.Add(title+"#;" + SPListitem.ID)... but I dont want this.... Any idea how to achieve this...

    Read the article

  • const member functions can call const member functions only?

    - by Abhi
    Hi all. Do const member functions call only const member functions? class Transmitter{ const static string msg; mutable int size; public: void xmit() const{ size = compute(); cout<<msg; } private: int compute() const{return 5;} }; string const Transmitter::msg = "beep"; int main(){ Transmitter t; t.xmit(); return EXIT_SUCCESS; } If i dont make compute() a const, then the compiler complains. Is it because since a const member function is not allowed to modify members, it wont allow any calls to non-consts since it would mean that the const member function would be 'indirectly' modifying the data members?

    Read the article

  • The best practice to setup hierarchy data

    - by eski
    I'm trying to figure out the best practice to setup hierarchy data that i take from a database into some contoller that would show the hierachy. Basicly this would look like a normal tree but when you press the items that are under "chapters" you get a link to another page. I have these tables and this is the way they are connected Period Courses Subjects Chapters I select Period from a DropDownBox and then i want all the courses in that period to line up. Under each course would be the subject and under them are the chapers, typical hierarchy. The tables are linked together with refrences to each other in linear way. I have tried to use treeview to show this, but dont understand how to do it. I though i could use <ul><il> tags and do it at runtime. Reapeter or datalist, possible ? Is it better to do this with databinding in XAML or in code ?

    Read the article

  • Is it possible to block a certain character or group of characters from entering into text box or an

    - by Param-Ganak
    Hello friends! I have a text input field like text box or text area. I want to prevent the user from entering certain character or a group of characters. That is for example if I dont want # * @ and numbers from 0-9 these characters. So Whenever user press any of the above character key then that character should not appear in to an input field. It means directly blocking that character. Is this possible in Jquery? Please give me some guidelines to achive it. Thank You

    Read the article

  • select distinct over specific columns

    - by Midhat
    A query in a system I maintain returns QID AID DATA 1 2 x 1 2 y 5 6 t As per a new requirement, I do not want the (QID, AID)=(1,2) pair to be repeated. We also dont care what value is selected from "data" column. either x or y will do. What I have done is to enclose the original query like this SELECT * FROM (<original query text>) Results group by QID,AID Is there a better way to go about this? The original query uses multiple joins and unions and what not, So I would prefer not to touch it unless its absolutely necesary

    Read the article

  • Magento: setup both APC and memcached

    - by snh_nl
    Magento: setup both APC and memcached Hi, our hosting party installed both APC and memcached. How do I configure both correctly - so that they dont start caching each other for example. any ideas? I would like the following: opcode for php, so APC is primary cache cache /var/session and /var/cache cache / speedup database requests And we have fullpage cache now, how do we relate this My question - What settings do I need? It is not clear how these two work together ... I did some research and found this: http://www.coeusblue.com/blog/48-magento/65-magento-caching http://magebase.com/magento-tutorials/speeding-up-magento-with-apc-or-memcached/

    Read the article

< Previous Page | 194 195 196 197 198 199 200 201 202 203 204 205  | Next Page >