Search Results

Search found 1369 results on 55 pages for 'jc martin'.

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

  • How to define a custom iterator in C++

    - by Robert Martin
    I've seen a number of posts on SO about how to define custom iterators, but nothing that seems to exactly answers my question, which is... How do I create an iterator that hides a nested for loop? For instance, I have a class Foo, inside of the Foo is a Bar, and inside of the Bar is a string. I could write for (const Foo& foo : foo_set) for (const Bar& bar : foo.bar_set) if (bar.my_string != "baz") cout << bar.my_string << endl; but instead I want to be able to do something like: for (const string& good : foo_set) cout << good << endl; How do I do something like this?

    Read the article

  • Symfony on virtual host (document root problem)

    - by Martin Sikora
    Hello, I'm developing an application in Symfony and on localhost (XAMPP) I want to simulate the same conditions as on the webserver. The web server is configured as follows: /www => mydomain.com /foo => foo.mydomain.com /bar => bar.mydomain.com ... I'm going to put my Symfony application into /www direcotry so there'll be: /www /www/apps /www/apps/frontend /www/apps/frontend/... /www/apps/backend /www/apps/backend/... /www/cache /www/config ... and so on... /www/web The thing is that the document root is still set to the /www directory but Symfony expects it in the /www/web. Of course it will work if I call http://mydomain.com/web but I guess you understand this is quiet stupid solution. So my question is: Is there any way how can I change/bypass the default document root setting using .htaccess or whatever?

    Read the article

  • Static keyboard in uitableview

    - by Martin
    I have a UITableView that holds just two cells with a textfield in each. As my tableview is just for editing the text in these textfields I always want the keyboard to be shown static in the bottom of the screen. So in viewDidLoad I set the first textfield to become first responder. Something I have noticed though is that when I push the UITableViewController into the UINavigationController the keyboard show up a little bit slower so you can see it animate into the screen. It would be much better if it was there already there when the uitableview shows up. I also tried making the textfield first responder before pushing it as recommended but that didn't made the keyboard show at all: MyTableViewController *myTableViewController = [[MyTableViewController alloc] initWithNibName:@"MyTableViewController" bundle:nil]; [myTableViewController.textField becomeFirstResponder]; [self.navigationController pushViewController:myTableViewController animated:YES]; [myTableViewController release]; How can I accomplish this? Thanks!

    Read the article

  • global counter in application: bad practice?

    - by Martin
    In my C++ application I sometimes create different output files for troubleshooting purposes. Each file is created at a different step of our pipelined operation and it's hard to know file came before which other one (file timestamps all show the same date). I'm thinking of adding a global counter in my application, and a function (with multithreading protection) which increments and returns that global counter. Then I can use that counter as part of the filenames I create. Is this considered bad practice? Many different modules need to create files and they're not necessarily connected to each other.

    Read the article

  • how to send text to a process in a shell script?

    - by Martin
    So I have a Linux program that runs in a while(true) loop, which waits for user input, process it and print result to stdout. I want to write a shell script that open this program, feed it lines from a txt file, one line at a time and save the program output for each line to a file. So I want to know if there is any command for: - open a program - send text to a process - receive output from that program Many thanks.

    Read the article

  • Ruby on Rails in SpringSource tool suite?

    - by Martin Klosi
    I have been using Grails for some time now, but in school they are making us use Ruby on Rails. I have been trying to find an extension for ruby on rails for STS as there is for Grails, but I have failed. The only thing that comes close is a plugin so i can use ruby code in my Grails app using JRuby. I just want to make sure that a fully integrated extension DOESN'T exist. If that is the case, what would be the graphical IDE way of developing in ruby on rails, the same way one would use STS for Groovy on Grails development? (preferably free :) )

    Read the article

  • Where to put the star in C and C++ pointer notation

    - by Martin Kristiansen
    For some time the following has been annoing me, where should I put the star in my pointer notation. int *var; // 1 and int* var; // 2 obviously do the same thing, and both notations are correct, but I find that most literature and code I look at use the 1th notation. wouldn't it be more 'correct' to use the 2th notation, separating the type and the variable name by a whitespace, rather than mixing the type and variable tokens?

    Read the article

  • Writing module to get video/audio from HDMI

    - by Martin
    I would like to write a small module that can check if anything is connected to my computer's HDMI input, and if so write a frame of video to bitmap once in a while. Can anyone point me to resources regarding grabbing audio/video from HDMI on windows?

    Read the article

  • How to verify object creation in Django ?

    - by Martin
    So.. this never crossed my head before but now I just can't figure out how to do that !! I want to verify that the object I created was really created, and return True or False according to that : obj = object(name='plop') try: obj.save() return True except ???: return False Any idea ? Cheers, -M

    Read the article

  • Rails forms: render different actions based on validation

    - by Martin Petrov
    Is it possible to render different actions based on what fails at validation? For example - I have one field in the form - email addres. It is validated like this: validates :email, :presence => true, :uniqueness => { :case_sensitive => false } In the controller: def create @user = User.new(params[:user]) if @user.save redirect_to somewhere else # render :new if email is blank # redirect_to somwhere if email is taken end end

    Read the article

  • Help with java threads or executors: Executing several MySQL selects, inserts and updates simmultane

    - by Martin
    Hi. I'm writing an application to analyse a MySQL database, and I need to execute several DMLs simmultaneously; for example: // In ResultSet rsA: Select * from A; rsA.beforeFirst(); while (rsA.next()) { id = rsA.getInt("id"); // Retrieve data from table B: Select * from B where B.Id=" + id; // Crunch some numbers using the data from B // Close resultset B } I'm declaring an array of data objects, each with its own Connection to the database, which in turn calls several methods for the data analysis. The problem is all threads use the same connection, thus all tasks throw exceptios: "Lock wait timeout exceeded; try restarting transaction" I believe there is a way to write the code in such a way that any given object has its own connection and executes the required tasks independent from any other object. For example: DataObject dataObject[0] = new DataObject(id[0]); DataObject dataObject[1] = new DataObject(id[1]); DataObject dataObject[2] = new DataObject(id[2]); ... DataObject dataObject[N] = new DataObject(id[N]); // The 'DataObject' class has its own connection to the database, // so each instance of the object should use its own connection. // It also has a "run" method, which contains all the tasks required. Executor ex = Executors.newFixedThreadPool(10); for(i=0;i<=N;i++) { ex.execute(dataObject[i]); } // Here where the problem is: Each instance creates a new connection, // but every DML from any of the objects is cluttered in just one connection // (in MySQL command line, "SHOW PROCESSLIST;" throws every connection, and all but // one are idle). Can you point me in the right direction? Thanks

    Read the article

  • regex. How can I match the value between '+' and ':' ?

    - by martin
    I have this string: sometext +[value]:- I would like to match the value(1-3 numerical characters) (with regex, javascript) sometext may contain a +sign if i'm unlucky so I don't wanna end up with matching some +text +value:- I sat up last night banging my head against this, so I would be really glad if someone could help me.

    Read the article

  • How can I get all the versions of a given file?

    - by Martin
    I would like to obtain all the versions of a given file in my SVN repository. For instance, let's say that the file ThirdPartyAssembly.dll was checked 3 times, is there a command that will get me all the version on my HD (e.g. ThirdPartyAssembly.dll.v1, ThirdPartyAssembly.dll.v2, ThirdPartyAssembly.dll.v3, etc.)? Thanks!

    Read the article

  • Best method to cache objects in PHP?

    - by Martin Bean
    Hi, I'm currently developing a large site that handles user registrations. A social networking website for argument's sake. However, I've noticed a lag in page loads and deciphered that it is the creation of objects on pages that's slowing things down. For example, I have a Member object, that when instantiated with an ID passed as a construct parameter, it queries the database for that members' row in the members database table. Not bad, but this is created each time a page is loaded; and called more than once when say, calling an array of that particular members' friends, as a new Member object is created for each friend. So on a single page I can have upwards of seven of the same object, but containing different properties. What I'm wanting to do is to find a way to reduce the database load, and to allow persist objects between page loads. For example, the logged in user's object to be created on login (which I can do) but then stored somewhere for retrieval so I don't have to keep re-creating the object between page loads. What is the best solution for this? I've had a look at Memcache, but with it being a third-party module I can't have the web host install it on this occasion. What are my alternatives, and/or best practices in my case? Thanks in advance.

    Read the article

  • Notify the user on Facebook at some time

    - by martin.malek
    Let's say I have a Facebook application which is monitoring friends birthdays. I want to notify the user that her friend will have a birthday in next two days. The first part is only cron which will check the dates, but is there any way how to notify the user? I didn't found anything for this. It was there a year ago but all of the API changes it looks like the removed all offline messages. I don't want to send an email to the user, it will be much more better to stay with everything on Facebook.

    Read the article

  • Dynamic search result when typing

    - by Martin
    I'm using asp.net and want to filter a search result everytime the user enter letters in a textbox. For exmaple this website do exactly what I want: http://www.prisjakt.nu/ (try searching in the right top corner). I have tried just putting my textbox and the gridview with the search result in an updatepanel, it's working but it's really slow, can I make it faster and how? Is there any articles or something about this?

    Read the article

  • Help me with query string parameters (Rails)

    - by Martin Petrov
    Hi, I'm creating a newsletter. Each email contains a link for editing your subscription: <%= edit_user_url(@user, :secret => @user.created_at.to_i) %> :secret = @user.created_at.to_i prevents users from editing each others profiles. def edit @user = user.find(params[:id]) if params[:secret] == @user.created_at.to_i render 'edit' else redirect_to root_path end end It doesn't work - you're always redirected to root_path. It works if I modify it like this: def edit @user = user.find(params[:id]) if params[:secret] == "1293894219" ... 1293894219 is the "created_at.to_i" for a particular user. Do you have any ideas why?

    Read the article

  • detect when a webpage is updated

    - by Martin Trigaux
    Hello, There is a website (very simple) which will be updated soon and I'd like to receive an alert at the moment it changes (like a sound, a popup,...) I guess I should send request every x minutes and compare the result with what's now but I don't know how to do that. I don't really care about the language used, I know java, python, php, a bit of c and bash (I'm on linux)... Thank you

    Read the article

  • Swap function for a char*

    - by Martin
    I have the simple function below which swap two characters of an array of characters (s). However, I am getting a "Unhandled exception at 0x01151cd7 in Bla.exe: 0xC0000005: Access violation writing location 0x011557a4." error. The two indexes (left and right) are within the limit of the array. What am I doing wrong? void swap(char* s, int left, int right) { char tmp = s[left]; s[left] = s[right]; s[right] = tmp; } swap("ABC", 0, 1); I am using VS2010 with unmanaged C/C++. Thanks!

    Read the article

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