Search Results

Search found 15316 results on 613 pages for 'coding style'.

Page 43/613 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • php troubles with coding variables

    - by user342391
    I am trying to echo certain values if the variable $cardtype == $paymentmethod = if( $cardtype == 'visa' ) echo 'VSA'; elseif ( $cardtype == 'mastercard' ) echo 'MSC'; elseif ( $cardtype == 'mastercard' ) echo 'MSC'; elseif ( $cardtype == 'maestro' ) echo 'MAE'; elseif ( $cardtype== 'amex' ) echo 'AMX'; How would I do this???

    Read the article

  • I would like some help with an autoroller im coding in javascript

    - by Ian
    I have a game that requires you to click on an object to collect prizes, but instead of giving my user carpel tunnel I want to create an autoroller. I have some code done already but I cant get it to work. If there is anyone out there that would be able to help me get this code working, it would be greatly appreciated. Thanks

    Read the article

  • ASP.Net incorrect background image style rendered

    - by user144612
    Using ASP.Net, I have a server control for which i would like to add the inline css style "background-image:none". However, when i call: writer.AddStyleAttribute("background-image", "none"); The following inline style is generated (and tries to resolve the url "none"): background-image:url(none) Is there a special syntax I can use to set the background image to none inline?

    Read the article

  • question for jsp coding

    - by sheetal
    I am reteriving the set of values inside a table from database in a jsp page then it is in the form of link. Now I want to click that value and move to another jsp page. How to code the program so that it can recognise that value and it can move to the next desired page. But I unable to do that. please help me....

    Read the article

  • How to Conduct an online coding competition?

    - by Alice
    I need to design a website for a programming competition event. It will be similar to TOP CODER competitions. User will be given all questions & then user submits the code, that will be running on the server and checks if it gives the correct solution or not. The first one to finish all the questions is the winner. I've no clue about how to proceed. Assume that languages that are supported are C, C++, Java.

    Read the article

  • wpf: bind to a style property on main window from UserControl

    - by Sonic Soul
    I have a UserControl which has a style, that i would like to be influenced by a settings checkbox on the main window hosting my user control so myControl.xaml has a Style which i would like to have a trigger, that should observe a CheckBox inside MainWindow.xaml i know one way to do this, would be to create a local property in myControl.cs which would look at the property in MainWindow.cs which would in turn return state of that cheeckbox.. but maybe there is a way to do this w/out writing any c# code ?

    Read the article

  • argparse coding issue

    - by Carl Skonieczny
    write a script that takes two optional boolean arguments,"--verbose‚" and ‚"--live", and two required string arguments, "base"and "pattern". Please set up the command line processing using argparse. This is the code I have so far for the question, I know I am getting close but something is not quite right. Any help is much appreciated.Thanks for all the quick useful feedback. def main(): import argparse parser = argparse.ArgumentParser(description='') parser.add_argument('base', type=str) parser.add_arguemnt('--verbose', action='store_true') parser.add_argument('pattern', type=str) parser.add_arguemnt('--live', action='store_true') args = parser.parse_args() print(args.base(args.pattern))

    Read the article

  • [Linux] Coding a GTK+ application without window manager?

    - by ShoX
    Hi, I want to code sth. that basically works like TiVo. Switch it on, you only see the menu or an output, so no underlying OS or anything else is directly visible to the user. So I want to use Linux as base. Can you suggest a good base distribution? Can I code a frontend without having a window-manager up and running? If yes, is that possible with java-gnome or what language/gui-framework combination would you suggest? If no, what's the minimal window manager that can handle fancy menus, etc? What does it take to create video-overlays over a HD-stream? Are there some libraries I should take a look at? Thanks

    Read the article

  • Python program to search for specific strings in hash values (coding help)

    - by Diego
    Trying to write a code that searches hash values for specific string's (input by user) and returns the hash if searchquery is present in that line. Doing this to kind of just learn python a bit more, but it could be a real world application used by an HR department to search a .csv resume database for specific words in each resume. I'd like this program to look through a .csv file that has three entries per line (id#;applicant name;resume text) I set it up so that it creates a hash, then created a string for the resume text hash entry, and am trying to use the .find() function to return the entire hash for each instance. What i'd like is if the word "gpa" is used as a search query and it is found in s['resumetext'] for three applicants(rows in .csv file), it prints the id, name, and resume for every row that has it.(All three applicants) As it is right now, my program prints the first row in the .csv file(print resume['id'], resume['name'], resume['resumetext']) no matter what the searchquery is, whether it's in the resumetext or not. lastly, are there better ways to doing this, by searching word documents, pdf's and .txt files in a folder for specific words using python (i've just started reading about the re module and am wondering if this may be the route, rather than putting everything in a .csv file.) def find_details(id2find): resumes_f=open("resume_data.csv") for each_line in resumes_f: s={} (s['id'], s['name'], s['resumetext']) = each_line.split(";") resumetext = str(s['resumetext']) if resumetext.find(id2find): return(s) else: print "No data matches your search query. Please try again" searchquery = raw_input("please enter your search term") resume = find_details(searchquery) if resume: print resume['id'], resume['name'], resume['resumetext']

    Read the article

  • issue with vhdl structural coding

    - by user3699982
    The code below is a simple vhdl structural architecture, however, the concurrent assignment to the signal, comb1, is upsetting the simulation with the outputs (tb_lfsr_out) and comb1 becoming undefined. Please, please help, thank you, Louise. library IEEE; use IEEE.STD_LOGIC_1164.all; entity testbench is end testbench; architecture behavioural of testbench is CONSTANT clock_frequency : REAL := 1.0e9; CONSTANT clock_period : REAL := (1.0/clock_frequency)/2.0; signal tb_master_clk, comb1: STD_LOGIC := '0'; signal tb_lfsr_out : std_logic_vector(2 DOWNTO 0) := "111"; component dff port ( q: out STD_LOGIC; d, clk: in STD_LOGIC ); end component; begin -- Clock/Start Conversion Generator tb_master_clk <= (NOT tb_master_clk) AFTER (1 SEC * clock_period); comb1 <= tb_lfsr_out(0) xor tb_lfsr_out(2); dff6: dff port map (tb_lfsr_out(2), tb_lfsr_out(1), tb_master_clk); dff7: dff port map (tb_lfsr_out(1), tb_lfsr_out(0), tb_master_clk); dff8: dff port map (tb_lfsr_out(0), comb1, tb_master_clk); end behavioural;

    Read the article

  • JQuery performance issue (Or just bad CODING!)

    - by ferronrsmith
    function getItemDialogContent(planItemType) { var oDialogContent = $('<div/>').append($('#cardDialogHelper').html()).addClass("card"); if (planItemType) { oDialogContent.find('#cardDialogHeader').addClass(planItemType).find('#dialogTitle').html(planItemType); oDialogContent.find('#cardDialogCustomFields').html($('#' + planItemType + 'DialogFields').html()); if (planItemType == 'announcement' || planItemType == 'question') { oDialogContent.find("#dialogPin").remove(); } } return oDialogContent; } I am doing some code cleanup for a web application I am working on. The above method lags in IE and most of our user base use IE. Can someone help me. I figure the find() method is very expensive because of the DOM traversal and I am thinking of optimizing. Any ideas anyone? Thanks in advance :D Been doing some profiling on the application and the following line seems to be causing alot of problems. help me please. is there any way I can optimize ? $('').append($('#cardDialogHelper').html()).addClass("card"); This is the ajax call that does the work. Is there a way to do some of this after the call. Please help me. (Added some functions I thought would be helpful in the diagnosis) GetAllPlansTemp = function() { $.getJSON("/SAMPLE/GetAllPlanItems",processData); } processData = function(data) { _throbber = showThrobber(); var sortedPlanItems = $(data.d).sort("Sequence", "asc"); // hideThrobber(_throbber); $(sortedPlanItems).each(createCardSkipTimelime); doCardStacks(); doTimelineFormat(); if (boolViewAblePlans == 'false') { $("p").show(); } hideThrobber(_throbber); } function createCardSkipTimelime() { boolViewAblePlans = 'false'; if (this.__Deleted == 'true' || IsPastPlanItem(this)) { return; } boolViewAblePlans = 'true'; fixer += "\n" + this.TempKey; // fixes what looks like a js threading issue. var value = CreatePlanCard2(this, GetPlanCardStackContainer(this.__type)); UpdatePlanCardNoTimeLine(value, this); } function CreatePlanCard2(carddata, sContainer) { var sCardclass = GetPlanCardClass(carddata.__type); var editdialog = getItemDialogContent(sCardclass); return $('<div/>').attr('id', carddata.TempKey).card({ 'container': $(sContainer), 'cardclass': sCardclass, 'editdialog': editdialog, 'readonly': GetCardMode(carddata) }); }

    Read the article

  • Modify the windows style of another application using winAPI

    - by karthik
    My application starts up another application. whereby, i want to remove the title bar of the application which is started using c#. How can i do this, starting up with the piece of code below ? //Get current style lCurStyle = GetWindowLong(hwnd, GWL_STYLE) //remove titlebar elements lCurStyle = lCurStyle And Not WS_CAPTION lCurStyle = lCurStyle And Not WS_SYSMENU lCurStyle = lCurStyle And Not WS_THICKFRAME lCurStyle = lCurStyle And Not WS_MINIMIZE lCurStyle = lCurStyle And Not WS_MAXIMIZEBOX //apply new style SetWindowLong hwnd, GWL_STYLE, lCurStyle //reapply a 3d border lCurStyle = GetWindowLong(hwnd, GWL_EXSTYLE) SetWindowLong hwnd, GWL_EXSTYLE, lCurStyle Or WS_EX_DLGMODALFRAME //redraw SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_FRAMECHANGED

    Read the article

  • Enjoy bug fixing more than coding from scratch

    - by kylex
    As I get more and more into my job I've had a lot of opportunity to code new projects from scratch. Almost every programmer I know really appreciates that opportunity. But the further I go into it, the more I enjoy bug fixing. In fact, if I can spend a whole day looking over code, whether it be mine or someone else's code, and find some obscure bug, I feel much more accomplished than when I create code. Does anyone else feel this way, and are there any job advantages to this?

    Read the article

  • How to start coding the "Dining Philosophers" simulation?

    - by GrizzlyGuru
    I'm not a beginner at C# but I really need to increase my understanding, so I've picked a classic deadlock problem to code to help teach myself some of the more advanced concepts of C#. The Dining Philosophers Problem seems like a good one, but I need a little help to get started. I know I need to approach the "diners" as objects, but to simulate the random delays between eating, should I look to threading with each diner in a separate thread? Do I need some kind of "master" to monitor all the actions? Any general design concept advice is welcome, but I'd like to do the grunt programming as an exercise. Thanks!

    Read the article

  • Python new-style classes and __subclasses__ function

    - by Fraser Graham
    Can somebody explain to me why this works (in Python 2.5) : class Foo(object): pass class Bar(Foo): pass print(Foo.__subclasses__()) but this doesn't : class Foo(): pass class Bar(Foo): pass print(Foo.__subclasses__()) The latter returns "AttributeError: class Foo has no attribute '__subclasses__'" but i'm not sure why. I know this is related to old-style vs. new-style classes but i'm not clear on why that would make this functionality unavailable.

    Read the article

  • GCC doesn't like C++ style casts with spaces

    - by uj2
    I am porting some C++ code to GCC, and apperantly it isn't happy with C++ style casting when sapces are involved, as in unsigned int(-1), long long(ShortVar) etc... It gives an error: expected primary-expression before 'long'. Is there any way to make peace with GCC without going over each one of those and rewrite in c-style?

    Read the article

  • JavaScript Coding for Finding Shipping Total

    - by user2913279
    I am having a very hard time with this code. I have been working on it for days and cannot seem to figure it out. Please help!! Here are the specific I need for the code: Many companies normally charge a shipping and handling charge for purchases. Create a Web page that allows a user to enter a purchase price into a text box and includes a JavaScript function that calculates shipping and handling. Add functionality to the script that adds a minimum shipping and handling charge of $1.50 for any purchase that is less than or equal to $25.00. For any orders over $25.00, add 10% to the total purchase price for shipping and handling, but do not include the $1.50 minimum shipping and handling charge. The formula for calculating a percentage is price * percent / 100. For example, the formula for calculating 10% of a $50.00 purchase price is 50 * 10 / 100, which results in a shipping and handling charge of $5.00. After you determine the total cost of the order (purchase plus shipping and handling), display it in an alert dialog box. Here is the code I have: <!DOCTYPE> <head> <title>Calculate Shipping</title> <script type="text/javascript"> function parseInt() { var salesPrice = document.salesForm.Price.value; var minCharge = salesPrice + 1.50; var shipping = salesPrice * 10/100; if (salesPrice <= 25) window.alert('Your sales total including shipping is $' + minCharge); else window.alert('Your sales total including shipping is $' + salesPrice + shipping); } </script> </head> <body> <form name="salesForm"> <div > <p>Enter Your Purchase Price</p> <input type="text" name="Price" /><br /><br /> <input type="button" name="Calculate" value="Calculate Shipping" onclick="parseInt ()" /> </div> </form> </body> </html> Everything works except for the math in the alert box. It will show an incorrect total...

    Read the article

  • Coding the R-ight way - avoiding the for loop

    - by mropa
    I am going through one of my .R files and by cleaning it up a little bit I am trying to get more familiar with writing the code the r-ight way. As a beginner, one of my favorite starting points is to get rid of the for() loops and try to transform the expression into a functional programming form. So here is the scenario: I am assembling a bunch of data.frames into a list for later usage. dataList <- list (dataA, dataB, dataC, dataD, dataE ) Now I like to take a look at each data.frame's column names and substitute certain character strings. Eg I like to substitute each "foo" and "bar" with "baz". At the moment I am getting the job done with a for() loop which looks a bit awkward. colnames(dataList[[1]]) [1] "foo" "code" "lp15" "bar" "lh15" colnames(dataList[[2]]) [1] "a" "code" "lp50" "ls50" "foo" matchVec <- c("foo", "bar") for (i in seq(dataList)) { for (j in seq(matchVec)) { colnames (dataList[[i]])[grep(pattern=matchVec[j], x=colnames (dataList[[i]]))] <- c("baz") } } Since I am working here with a list I thought about the lapply function. My attempts handling the job with the lapply function all seem to look alright but only at first sight. If I write f <- function(i, xList) { gsub(pattern=c("foo"), replacement=c("baz"), x=colnames(xList[[i]])) } lapply(seq(dataList), f, xList=dataList) the last line prints out almost what I am looking for. However, if i take another look at the actual names of the data.frames in dataList: lapply (dataList, colnames) I see that no changes have been made to the initial character strings. So how can I rewrite the for() loop and transform it into a functional programming form? And how do I substitute both strings, "foo" and "bar", in an efficient way? Since the gsub() function takes as its pattern argument only a character vector of length one.

    Read the article

  • Point one style class to another?

    - by user246114
    Hi, I have a css class like: .foo { background-color: red; } then I have a class specified for a list: .list1 li { background-color: tan; } is it possible to set one style class to just point to another? Something like: .list1 li { .foo; } not sure how to articulate that - I just want the .list li style to be whatever I define for the .foo class. Thanks

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >