Search Results

Search found 324 results on 13 pages for 'benjamin baron'.

Page 11/13 | < Previous Page | 7 8 9 10 11 12 13  | Next Page >

  • How to inline a function for only release build.

    - by Benjamin
    // common.h // This is foo funtion. It has a body. __inline void foo() { /* something */ } // a.cpp #include "common.h" // for foo function // Call foo // b.cpp #include "common.h" // for foo function // Call foo I would like to inline the foo function only when I build for release. -I dont want to inline functions for Debug build. I tried it but linker errors annoyed me. In this case, foo function's body is defined in common.h header file. so if I just do //common.h #if !defined(_DEBUG) __inline #endif void foo() { /* something */ } I will be met a link error in DEBUG build. Because two modules try to include common.h. I have no idea to solve it. Is it possible?

    Read the article

  • Scala Map conversion

    - by Benjamin Metz
    I'm a Scala newbie I'm afraid: I'm trying to convert a Map to a new Map based on some simple logic: val postVals = Map("test" - "testing1", "test2" - "testing2", "test3" - "testing3") I want to test for value "testing1" and change the value (while creating a new Map) def modMap(postVals: Map[String, String]): Map[String, String] = { postVals foreach {case(k, v) => if(v=="testing1") postVals.update(k, "new value")} }

    Read the article

  • Reading web-service information from assembly app.config file

    - by Benjamin Ortuzar
    I have a plugin architecture solution written in .NET C# 3.5, where each plug-in is an assembly loaded by the main project. Each plug-in connects to a different web-service, so I would like to have the configuration of that plugin in its own plugin.dll.config file instead of having it in the app.config of the main project. I have been looking around and I saw that i could load from each class its own config file: // Get the application configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap,userLevel) I see how that would help me get the basic settings from the appSettings section, but I cant see a way to read the web-service information stored in the plugin.dll.config file. Any help on how to approach this situation is very welcome.

    Read the article

  • Is it bad practice to change state inside of an if statement?

    - by Benjamin
    I wrote some code that looks similar to the following: String SKIP_FIRST = "foo"; String SKIP_SECOND = "foo/bar"; int skipFooBarIndex(String[] list){ int index; if (list.length >= (index = 1) && list[0].equals(SKIP_FIRST) || list.length >= (index = 2) && (list[0] + "/" + list[1]).equals(SKIP_SECOND)){ return index; } return 0; } String[] myArray = "foo/bar/apples/peaches/cherries".split("/"); print(skipFooBarIndex(myArray); This changes state inside of the if statement by assigning index. However, my coworkers disliked this very much. Is this a harmful practice? Is there any reason to do it?

    Read the article

  • Command line CSV viewer?

    - by Benjamin Oakes
    Anyone know of a command-line CSV viewer for Linux/OS X? I'm thinking of something like less but that spaces out the columns in a more readable way. (I'd be fine with opening it with OpenOffice Calc or Excel, but that's way too overpowered for just looking at the data like I need to.) Having horizontal and vertical scrolling would be great.

    Read the article

  • Using tarantula to test a Rails app

    - by Benjamin Oakes
    I'm using Tarantula to test a Rails app I'm developing. It works pretty well, but I'm getting some strange 404s. After looking into it, Tarantula is following DELETE requests (destroy actions on controllers) throughout my app when it tests. Since Tarantula gets the index action first (and seems to keep a list of unvisited URLs), it eventually tries to follow a link to a resource which it had deleted... and gets a 404. Tarantula is right that the URL doesn't exist anymore (because it deleted the resource itself). However, it's flagging it as an error -- that's hardly the behavior I would expect. I'm basically just using the Rails scaffolding and this problem is happening. How do I prevent Tarantula doing this? (Or, is there a better way of specifying the links?) Updates: Still searching, but I found a relevant thread here: http://github.com/relevance/tarantula/issues#issue/3 Seems to be coming from relying on JS too much, in a way (see also http://thelucid.com/2010/03/15/rails-can-we-please-have-a-delete-action-by-default/)

    Read the article

  • Perl -check for uninitialized value

    - by benjamin button
    I am doing the below in a perl script: my @pm1_CS_missing_months = `sqlplus -s $connstr \@DLmissing_months.sql`; it takes the output of an sql query. if i have to check for no rows selected,how could i do it? i want to do like this: if(no rows selected) { do this; }

    Read the article

  • percentage of memory used used by a process

    - by benjamin button
    percentage of memory used used by a process. normally prstat -J will give the memory of process image and RSS(resident set size) etc. how do i knowlist of processes with percentage of memory is used by a each process. i am working on solaris unix. addintionally ,what are the regular commands that you use for monitoring processes,performences of processes that might be very useful to all!

    Read the article

  • sql query need a help.

    - by benjamin button
    If i have a table with two fields.customer id and order. let's say i have in total order ID 1,2,3,4 all the customer can have all the four orders.like below 1234 1 1234 2 1234 3 1234 4 3245 3 3245 4 5436 2 5436 4 you can see above that 3245 customer doesnt have order id 1 and 2. how could i print in the query output like 3245 1 3245 2 5436 1 5436 3 EDIT: i dont order table but i have list of order's like we can hard code it in the query(1,2,3,4) i dont have an orders table.

    Read the article

  • NET USE command And Network Provider interface.

    - by Benjamin
    When we command "net use" on command prompt, the result has four columns. Status Local Remote Network OK Z: \\10.x.x.x\Public Microsoft Windows Network X: \\10.y.y.y\Public My Network Redirector The Microsoft Windows Network(SMB)'s Status has OK value, but we don't. It's just empty. We implemented NPEnumResource function in our Network Provider dll. But I don't know how can I set the value(OK). How can I do that? Thanks

    Read the article

  • I can't apply prefast /StackHogThreshold option.

    - by Benjamin
    I'm using ddkbuild for building my driver. And I use prefast also. Prefast has /StackHogThreshold option. The default value is 1024 Bytes. But I can't modify the value. It's my input for 'Rebuild All Command Line' C:\Windows\System32\cmd.exe /k "$(SolutionDir)....\ddkbuild.bat" -WIN7WLHA64 -prefast free $(ProjectDir) -cZ

    Read the article

  • Can someone who understands C code help me understand this code?

    - by Benjamin
    INT GetTree (HWND hWnd, HTREEITEM hItem, HKEY *pRoot, TCHAR *pszKey, INT nMax) { TV_ITEM tvi; TCHAR szName[256]; HTREEITEM hParent; HWND hwndTV = GetDlgItem (hWnd, ID_TREEV); memset (&tvi, 0, sizeof (tvi)); hParent = TreeView_GetParent (hwndTV, hItem); if (hParent) { // Get the parent of the parent of the... GetTree (hWnd, hParent, pRoot, pszKey, nMax); // Get the name of the item. tvi.mask = TVIF_TEXT; tvi.hItem = hItem; tvi.pszText = szName; tvi.cchTextMax = dim(szName); TreeView_GetItem (hwndTV, &tvi); //send the TVM_GETITEM message? lstrcat (pszKey, TEXT ("\\")); lstrcat (pszKey, szName); } else { *pszKey = TEXT ('\0'); szName[0] = TEXT ('\0'); // Get the name of the item. tvi.mask = TVIF_TEXT | TVIF_PARAM; tvi.hItem = hItem; tvi.pszText = szName; tvi.cchTextMax = dim(szName); if (TreeView_GetItem (hwndTV, &tvi)) //*pRoot = (HTREEITEM)tvi.lParam; //original hItem = (HTREEITEM)tvi.lParam; else { INT rc = GetLastError(); } } return 0; } The block of code that begins with the comment "Get the name of the item" does not make sense to me. If you are getting the listview item why does the code set the parameters of the item being retrieved, because if you already had the values there would be no need to retrieve them. Secondly near the comment "original" is the original line of code which will compile with a varning under embedded visual c++, but if you copy the exact same code into visual studio 2008 it will not compile. Since I did not write any of this code and am trying to learn is it possible the original author made a mistake on this line, since the *pRoot should point to and HKEY type yet he is casting to an HTREEITEM type which should never work since the data types don't match? (Side note someone with a better reputation should add a windows ce tag to SO since windows mobile is not the same as windows ce.)

    Read the article

  • Drupal 7 is unable to install modules

    - by Benjamin Wong
    My instance of Drupal 7 is unable to install new modules via FTP link. The error message that comes up is as follows : Warning: fileowner() [function.fileowner]: stat failed for temporary://upd92FE.tmp in update_manager_local_transfers_allowed() (line 924 of C:\inetpub\wwwroot\drupal\modules\update\update.manager.inc). My setup is as follows : Windows 7 Home Premium 64 Bit IIS 7.5 + Zend Community Server

    Read the article

  • What's wrong with this statement in perl?

    - by benjamin button
    print "$_", join(',',sort keys %$h),"\n"; It's giving me an error below: Use of uninitialized value in string at missing_months.pl line 36. 1,10,11,12 this print statement is present in a for loop as below: foreach my $num ( sort keys %hash ) { my $h = $hash{$num}; print "$_", join(',',sort keys %$h),"\n"; }

    Read the article

  • Autocommands for Matlab in vim?

    - by Benjamin Oakes
    I use several different programming languages every day, and I'd like to have different tab widths (in spaces) for each. For example: I use the "standard" 2 spaces for Ruby, but all our existing Matlab code uses 4 spaces. I have this from my personal ~/.vimrc: augroup lang_perl au! set tabstop=4 " tabstop length N in spaces set shiftwidth=4 " make >> and friends (<<, ^T, ^D) shift N, not the default 8 set expandtab " Use spaces instead of tabs augroup END augroup lang_ruby au! set tabstop=2 " tabstop length N in spaces set shiftwidth=2 " make >> and friends (<<, ^T, ^D) shift N, not the default 8 set expandtab " Use spaces instead of tabs augroup END Those work, but the following doesn't: augroup lang_matlab au! set tabstop=4 " tabstop length N in spaces set shiftwidth=4 " make >> and friends (<<, ^T, ^D) shift N, not the default 8 set expandtab " Use spaces instead of tabs augroup END I really don't understand how augroup lang_ruby figures out that I'm editing a Ruby file. (My searches brought up ftdetect, but the solution wasn't obvious.) It doesn't seem like vim knows that I'm editing Matlab using augroup lang_matlab. What do I change to make this work?

    Read the article

  • Break a string into parts, returning all characters

    - by Benjamin
    I want to break a string according to the following rules: all consecutive alpha-numeric chars, plus the dot (.) must be treated as one part all other consecutive chars must be treated as one part consecutive combinations of 1 and 2 must be treated as different parts no whitespace must be returned For example this string: Method(hierarchy.of.properties) = ? Should return this array: Array ( [0] => Method [1] => ( [2] => hierarchy.of.properties [3] => ) [4] => = [5] => ? ) I was unsuccessful with preg_split(), as AFAIK it cannot treat the pattern as an element to be returned. Any idea for a simple way to do this?

    Read the article

  • storing an integer constant other than zero in a pointer variable

    - by benjamin button
    int main() { int *d=0; printf("%d\n",*d); return 0; } this works fine. >cc legal.c > ./a.out 0 if i change the statement int *d=0; to int *d=1; i see the error. cc: "legal.c", line 6: error 1522: Cannot initialize a pointer with an integer constant other than zero. so its obvious that it will allow only zero.i want to know what happens inside the memory when we do this int *d=0 which is making it valid syntax. I am just asking this out of curiosity!

    Read the article

  • What's the difference between PATH_NOT_FOUND and NAME_NOT_FOUND

    - by Benjamin
    In Win32 layer, we often meet ERROR_PATH_NOT_FOUND, ERROR_NAME_NOT_FOUND. When does WinAPI(eg CreateFileW, RemoveDirectoryW) return these values? And What's the difference? If I write a file system driver, when do I set STATUS_OBJECT_PATH_NOT_FOUND or STATUS_OBJECT_NAME_NOT_FOUND? I'm so confused. Is there anyone who can explain clearly? Or are there any documents explain this? I couldn't find them. Thanks in advance.

    Read the article

  • Why do I get strange output from Perl using SQL?

    - by benjamin button
    Here is my Perl code: foreach my $line (@tmp_field_validation) { chomp $line; my ($cycle_code,$cycle_month,$cycle_year)= split /\s*\|\s*/, $line; $cycle_code=~ s/^\s*(.*)\s*$/$1/; $cycle_month=~ s/^\s*(.*)\s*$/$1/; $cycle_year=~ s/^\s*(.*)\s*$/$1/; print "$line\n"; print "$cycle_code|$cycle_month|$cycle_year"; } Here is the output: 1 10 2009 1 10 2009|| What's wrong over here? I expected the pipes to be between the variables. Why are the pipes getting printed after all the three variables?

    Read the article

  • How do I use Perl to parse the output of the sqlplus command?

    - by benjamin button
    I have an SQL file which will give me an output like below: 10|1 10|2 10|3 11|2 11|4 . . . I am using this in a Perl script like below: my @tmp_cycledef = `sqlplus -s $connstr \@DLCycleState.sql`; after this above statement, since @tmp_cycledef has all the output of the SQL query, I want to show the output as: 10 1,2,3 11 2,4 How could I do this using Perl?

    Read the article

< Previous Page | 7 8 9 10 11 12 13  | Next Page >