Search Results

Search found 88955 results on 3559 pages for 'code wizard'.

Page 111/3559 | < Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >

  • Does malloc() allocate a contiguous block of memory?

    - by user66854
    I have a piece of code written by a very old school programmer :-) . it goes something like this typedef struct ts_request { ts_request_buffer_header_def header; char package[1]; } ts_request_def; ts_request_buffer_def* request_buffer = malloc(sizeof(ts_request_def) + (2 * 1024 * 1024)); the programmer basically is working on a buffer overflow concept. I know the code looks dodgy. so my questions are: Does malloc always allocate contiguous block of memory ?. because in this code if the blocks are not contiguous , the code will fail big time Doing free(request_buffer) , will it free all the bytes allocated by malloc i.e sizeof(ts_request_def) + (2 * 1024 * 1024), or only the bytes of the size of the structure sizeof(ts_request_def) Do you see any evident problems with this approach , i need to discuss this with my boss and would like to point out any loopholes with this approach

    Read the article

  • Asp.net MVC 3 Razor code problem in a if statement

    - by ray247
    I have the following asp.net mvc 3 razor code, where "item" is my model, <a @if (item.Selected) { class="youarehere" } href="@item.Href" title="@item.Title">@item.Description</a> This code throws up the following error, CS1513: } expected which is pointing to class="youarehere" portion of the code, but I could not figure out why. Could someone help point out how to fix it please? Thank you.

    Read the article

  • ANTLR - Embedding Java code, evaluate before or after?

    - by wvd
    Hello all, I'm writing a simple scripting language on top of Java/JVM, where you can also embed Java code using the {} brackets. The problem is, how do I parse this in the grammar? I have two options: 1] Allow everything to be in it, such as: [a-z|a-Z|0-9|_|$], and go on 2] Get an extra java grammar and use that grammar to parse that small code (is it actually possible and efficient?) Since option 2] is basically a double-check since when evaluating java code it's also being checked. Now my last question is -- is way that can dynamically execute java code also with objects which have been created at runtime? Thanks, William van Doorn

    Read the article

  • How to safeguard my code

    - by ram
    I had posted my question in the below link on how to protect my code using Hg http://stackoverflow.com/questions/173875/how-do-you-protect-code-from-leaking-outside The question is: In a DVCS scenario how can we restrict the code leakages? Is there any way technically to restrict this like when I move our of my work automatically history of codes should not be viewed?

    Read the article

  • Navigating through code with keyboard shortcuts

    - by MarceloRamires
    I'm starting to feel the need to run fastly through code with keyboard shortcuts, to arrive faster where I want to make any changes (avoiding use of mouse or long times holding [up], [left], [right] and [down]). I'm already using some: [home] - first position in current line [end] - last position in current line [ctrl] + [home] - first line of the entire code [ctrl] + [end] - last line of the entire code [pageup] - same vertical position, one screen above [pagedown] - same vertical position, one screen below [ctrl] + [pageup] - first line in current screen [ctrl] + [end] - last line in current screen [ctrl] + [left/right] - skipping word per word What have you got ? I use Visual Studio. (but I'm open to any answer, as I maybe can use others soon) obs: I've searched through stackoverflow and didn't find a nice question with this content, nor a list of keyboard code searching. If it's repeated, I'm sorry for not finding it, I'm here in my best intentions. This question is NOT about any shortcuts, and not only about visual studio, it's about running through code with shortcuts. Answers that suit the question so far: [Ctrl] + [-] - jumps to last cursor position [Ctrl] + [F3] - Jumps to next occurance of the word the curson is in [Shift] + [F3] - Same as the above, backwards. [F12] - Goes to definition of method/variable the cursor is in [Ctrl] + [ ] ] - Jumps to matching brace and select I'll ad more as there are answers.

    Read the article

  • preg_replace on xss code

    - by proyb2
    Can this code help to sanitize malicious code in user submit form? function rex($string) { $patterns = array(); $patterns[0] = '/=/i'; $patterns[1] = '/javascript:/i'; $replacements = array(); $replacements[0] = ''; $replacements[1] = ''; return preg_replace($patterns, $replacements, $string); I have included htmlentities() to prevent XSS on client side, is all the code shown is safe enough to prevent attack?

    Read the article

  • TFS 2008 checks out code automatically on edit

    - by Jangwenyi
    I am working on a Visual Studio 2008 project that is already added to TFS server. I am not sure which settings and policies have been configured for the TFS (this is done by a separate dept, not developers) Every time I make an edit to a code file , the file is checked out automatically (without explicitly checking out the code file myself) Please help me locate this setting or policy because it is not very useful at the moment. Sometime you want to make a local change to try out something, and not necessarily check out the code....

    Read the article

  • How does TopCoder evaluates code?

    - by Carlos
    If you are familiar with TopCoder you know that your source-code gets a final "grade/points" this depends on time, how many compiles, etc, one of the highest weighted being performance. But how can they test that, is there some sort of simple code (java or c++) to do it that you could share for me to evaluate and hopefully write my own to test the programs I write for University? This is sort of a follow up question to this one where I ask if shorter code results in best performance. P.S: Im interested in both of how topcoders knows performance and writing code to test performance.

    Read the article

  • How to Use Eclipse to Debug JNI code (Java & C/C++)

    - by tkryger
    While I can debug my application with the Eclipse JDT debugger for Java code and GDB for C code, I would prefer to use a single tool for all my debugging. I found several projects that enable "mixed-mode" debugging in Eclipse and include support for single stepping between Java and native code. Intel's Integrated Debugger for Java/JNI Environments Mariot Chauvin's Summer of Code Project: Support Seamless Debugging between JDT & CDT Unfortunately, one claims to be pre-release quality and the other is currently unmaintained. Are there any plug-ins that bring mixed mode debugging functionality to Eclipse in a reliable way or should I continue to use two separate debuggers?

    Read the article

  • I dont know how or where to add the correct encoding code to this iPhone code...

    - by BC
    Ok, I understand that using strings that have special characters is an encoding issue. However I am not sure how to adjust my code to allow these characters. Below is the code that works great for text that contains no special characters, but can you show me how and where to change the code to allow for the special characters to be used. Right now those characters crash the app. enter code here - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ if (buttonIndex == 1) { //iTunes Audio Search NSString *stringURL = [NSString stringWithFormat:@"http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?WOURLEncoding=ISO8859_1&lang=1&output=lm&term=\"%@\"",currentSong.title]; stringURL = [stringURL stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; NSURL *url = [NSURL URLWithString:stringURL]; [[UIApplication sharedApplication] openURL:url]; } } And this: -(IBAction)launchLyricsSearch:(id)sender{ WebViewController * webView = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]]; webView.webURL = [NSString stringWithFormat:@"http://www.google.com/m/search?hl=es&q=\"%@\"+letras",currentSong.title]; webView.webTitle = @"Letras"; [self.navigationController pushViewController:webView animated:YES]; } Please show me how and where to do this for these two bits of code.

    Read the article

  • Public code repository

    - by Andy White
    Can anyone recommend a public code repository? A few friends and I are thinking of starting a few projects for iPhone, web, Android, etc., and it would be nice to have a public (internet) code repository to use that would work well on any platform (Mac, PC, Linux). Any type of repository is fine (SVN, CVS, Git, etc.). A few ideas are Sourceforge or Google Code. Any recommendations? Thanks

    Read the article

  • What is the best way to create a wizard in C# for web?

    - by Yan
    Hi , i want to create a wizard the include a few steps ,that in the final steps we need to include all the steps and save on the data base. what is the best design to do this ? there is implemante for a jquery ? i need to save the steps in sessions till the final save ? thanks !!!!

    Read the article

  • tool to auto-format R code

    - by Keith
    Is there any tool (editor, script, whatever...) available that can automatically reformat R code? It does not need to be customizable but it must be able to recognize statements separated by either semicolons or newlines since this code has both. If it can put all statements on a separate line, consistently indent code blocks and consistently place braces I will be very happy.

    Read the article

  • Meteor 0.3.9 on Windows XP exits with code: -1073741819

    - by slawpe13
    I have installed recently Meteor 0.3.9 on Windows XP (msi installer from: http://win.meteor.com/) and when I try to run (under CMD): meteor create --example leaderboard cd leaderboard meteor I get: [[[[[ C:\temp\leaderboard ]]]]] Running on: http://localhost:3000/ Exited with code: -1073741819 Exited with code: -1073741819 Exited with code: -1073741819 Your application is crashing. Waiting for file change. How can I fix that error?

    Read the article

  • Good Open Source Code to learn Web Programming

    - by Prabu
    Hi can someone point me to some Good Open Source Code to learn Web Programming (Language doesn't matter). i'm looking for source code of web-applications not frameworks I'm not a beginner, I can code to some extent. I want to know how stuffs are done in real world applications.

    Read the article

  • How to host 50 domains/sites with common Django code base

    - by Off Rhoden
    I have 50 different websites that use the same layout and code base, but mostly non-overlapping data (regional support sites, not link farm). Is there a way to have a single installation of the code and run all 50 at the same time? When I have a bug to fix (or deploy new feature), I want to deploy ONE time + 1 restart and be done with it. Also: Code needs to know what domain the request is coming to so the appropriate data is displayed.

    Read the article

  • Advise guidance on how to form this jQuery script for show/hide fade element

    - by Rick
    Hey guys.. I basically have several links on the left side of the screen and on the right is a preview window. Below the preview window is another box for the affiliate link code. So what I am trying to do is create an affiliate page where you choose the banner size on the left by clicking on the link and on the right you see it dynamically change to the banner size and the code changes accordingly as well. So far I have the following code and it works but it seems very very cumbersome and bloated. Can you see if I can trim this down? jQuery(".banner-style li").click(function() { jQuery(".banner-style li").removeClass("selected"); jQuery(this).addClass("selected"); var $banner = jQuery(this).attr("class"); $banner = $banner.replace(" selected",""); jQuery(".preview img").fadeOut('fast',function() { jQuery(".preview img").attr("src", "http://localhost/site/banners/"+$banner+".jpg") .fadeIn('slow'); }); jQuery(".code p").removeClass('hide').hide(); jQuery(".code p."+$banner).show(); }); Also to note the funny thing is in FF, when you click for the first to on any link, the original image on the right fades out and in real quick and then it loads the "clicked" image. This does not happen in other browsers...

    Read the article

  • Resources for learning how to better read code

    - by rsteckly
    Hi, I recently inherited a large codebase and am having to read it. The thing is, I've usually been the dev starting a project. As a result, I don't have a lot of experience reading code. My reaction to having to read a lot of code is, well, umm to rewrite it. But I need to bring myself up to speed quickly and build on top of an existing system. Do other people have techniques they've learned to absorb a code base? At this point, I'm just reading through the code. I've tried generating UML diagrams using UModel. They're so big they won't print cleanly and when I zoom in, I really do lose the perspective of seeing all the relationships. How have other people dealt with this problem?

    Read the article

< Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >