Search Results

Search found 248 results on 10 pages for 'florin andrei'.

Page 7/10 | < Previous Page | 3 4 5 6 7 8 9 10  | Next Page >

  • C# How can I trigger an event at a specific time of day?

    - by Andrei
    Hello everybody. I'm working on a program that will need to delete a folder (and then re-instantiate it) at a certain hour of the day, and this hour will be given by the user. The hour will most likely be during the night, because that's when nobody is accessing the folder (it's outside working hours). Is there a way to trigger that event at that certain hour? I know about timers, but is there an easier way to do this without a timer that ticks and checks to see what time it is? Thanks.

    Read the article

  • Using WAMP's MySQL with Cygwin Ruby on Rails

    - by Andrei
    I'm trying to install a Rails app on a Cygwin Rails + WAMP MySQL setup, but rake trows an error : Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Of course, it's trying to connect to MySQL trought a Cygwin socket, and since there's no MySQL server running on Cygwin, it fails. How do I get Rails to connect to WAMP's MySQL (perhaps through TCP/IP instead of a socket) ?

    Read the article

  • How to secure phpMyAdmin

    - by Andrei
    Hi, I have noticed that there are strange requests to my website trying to find phpmyadmin, like /phpmyadmin/ /pma/ etc. Now I have installed PMA on Ubuntu via apt and would like to access it via webaddress different from /phpmyadmin/. What can I do to change it? Thanks

    Read the article

  • Hidden Features and Dark Corners of STL?

    - by Andrei
    C++ developers, all know the basics of C++: Declarations, conditionals, loops, operators, etc. Some of us even mastered the stuff like templates, object model, complex I/O, etc. But what are the most hidden features or tricks or dark corners of C++/STL that even C++ fans, addicts, and experts barely know? I am talking about a seasoned C++ programmer (be she/he a developer, student, fan, all three, etc), who thinks (s)he knows something 99% of us never heard or dreamed about. Something that not only makes his/her work easier, but also cool and hackish. After all, C++ is one of the most used programming languages in the world, thus it should have intricacies that only a few privileged know about and want to share with us. Boost is welcome too! One per post with an example please P.S Examples are important for other developers to copy and paste!

    Read the article

  • What inspired WPF?

    - by Andrei Rinea
    I was told by someon that, just as .NET started inspired from Java, WPF was inspired by a similar technology, as "Microsoft never innovates". However, I can't find anything remotely close to WPF. What particular technology did or could have inspired Microsoft to write WPF?

    Read the article

  • Why no ArgumentEmptyException in .NET ?

    - by Andrei Rinea
    I am beginning to think I am doing something wrong. I mean they did place System.String.IsNullOrWhitespace finally but no ArgumentEmptyException class. public FilterItem(string name, IEnumerable<string> extensions) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException("name"); } if (extensions == null) { throw new ArgumentNullException("extensions"); } if (extensions.Count() == 0) { throw new ArgumentOutOfRangeException("extensions"); } this.Name = name; this.Extensions = extensions; } throwing an ArgumentOutOfRangeException feels unnatural. Also an instance of ArgumentException is too general in my opinion. It's easy to me to create a new exception class call it this way and have it over with. What bugs me is that it's not in the BCL/FCL and I am beginning to think there's a good reason not to have it. Should there be one?

    Read the article

  • C system calls open / read / write / close problem.

    - by Andrei Ciobanu
    Hello, given the following code (it's supposed to write "hellowolrd" in a "helloworld" file, and then read the text): #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #define FNAME "helloworld" int main(){ int filedes, nbytes; char buf[128]; /* Creates a file */ if((filedes=open(FNAME, O_CREAT | O_EXCL | O_WRONLY | O_APPEND, S_IRUSR | S_IWUSR)) == -1){ write(2, "Error1\n", 7); } /* Writes hellow world to file */ if(write(filedes, FNAME, 10) != 10) write(2, "Error2\n", 7); /* Close file */ close(filedes); if((filedes = open(FNAME, O_RDONLY))==-1) write(2, "Error3\n", 7); /* Prints file contents on screen */ if((nbytes=read(filedes, buf, 128)) == -1) write(2, "Error4\n", 7); if(write(1, buf, nbytes) != nbytes) write(2, "Error5\n", 7); /* Close rile afte read */ close(filedes); return (0); } The first time i run the program, the output is: helloworld After that every time I to run the program, the output is: Error1 Error2 helloworld I don't understand why the text isn't appended, as I've specified the O_APPEND file. Is it because I've included O_CREAT ? It the file is already created, shouldn't O_CREAT be ignored ?

    Read the article

  • Add to SortedSet<T> and its complexity

    - by Andrei Taptunov
    MSDN states the following SortedSet(T).Add Method : If Count is less than the capacity of the internal array, this method is an O(1) operation. Could someone please explain "how so"? I mean when adding new value we need to find a correct place to add a value (comparing it with another values) and internal implementation looks like a "Red-Black tree" with O (log N) insertion complexity.

    Read the article

  • How to do HABTM management with auto completion in Rails?

    - by Andrei
    I am looking for a good solution for a probably typical problem of managing models with HABTM association in Rails. Let's assume that we have two models -- products and categories: Products has_many :categorizations has_many :categories, :through => :categorizations Categories has_many :categorizations has_many :products, :through => :categorizations Categorization belongs_to :product belongs_to :category Pat Shaughnessy is developing modified auto_complete plugin which can allow to manage one-to-many (and many-to-many) association: For someone that would be enough, but I don't really like so many text fields. I guess it is possible to combine the Ryan Bates' screencasts used by Pat in a slightly different way, namely, using one text field with autocomplete: Also it would be better to remove from the list of suggested tasks (one-to-many), or products|categories (many-to-many) those which have been already added. In the case of products-categories relationship, such auto completion would be used both in the form for product, and in the form for category. I hope that there is an existing plugin for that. I am not very experienced in Ruby, and don't really know how to implement such logic by myself. Any help is appreciated!

    Read the article

  • Is there any open source AI engine?

    - by Andrei Savu
    I am searching for an open source AI engine implemented in C/C++, ActionScript or Java with no success. Do you know any open source implementation? Update: Thanks for answers! I had no idea how vast the AI field is. I am working on a sample application. I want to add intelligent behavior over a physics engine. I need some sort ai engine designed for games.

    Read the article

  • Help with data retrieval MACRO

    - by Andrei Ciobanu
    Hello, given the following structure: struct nmslist_elem_s { nmptr data; struct nmslist_elem_s *next; }; typedef struct nmslist_elem_s nmslist_elem; Where: typedef void* nmptr; Is it possible to write a MACRO that retrieves the data from the element and cast it to the right type: MACRO(type, element) that expands to *((type*)element->data). For example for int, i would need something like this: *((int*)(element->data)) .

    Read the article

  • Determine stale data

    - by Andrei
    Say I have a file of this format 12:04:21 .3 12:10:21 1.3 12:13:21 1.4 12:14:21 1.3 ..and so on I want to find repeated numbers in the second column for, say, 10 consequent timestamps, thereby finding staleness. and I want to output the beginning and and end of the stale timestamp range Can someone help me come up with it? You can use awk, bash Thanks

    Read the article

  • Database application using MVC paradigm

    - by Andrei K.
    In classic Delphi database application we have a form, a set of data-aware visual controls connected to TDataSets via TDataSources. If one wants to design database application using MVC model, where to place TDataSet components? Should they stay on form and therefore be a part of View? Or should they be encapsulated inside some Model object? If the latter how they could be bound to visual components?

    Read the article

  • Passing parameter to pthread

    - by Andrei Ciobanu
    Hello, i have the following code: #include <stdlib.h> #include <stdio.h> #include <pthread.h> #define NUM_THREADS 100 struct thread_param { char *f1; char *f2; int x; }; void *thread_function(void *arg){ printf("%d\n", ((struct thread_param*)arg)->x); } int main(int argc, char *argvs[]){ int i, thread_cr_res = 0; pthread_t *threads; threads = malloc(100 * sizeof(*threads)); if(threads == NULL){ fprintf(stderr,"MALLOC THREADS ERROR"); return (-1); } for(i = 0; i < NUM_THREADS; i++){ struct thread_param *tp; if((tp = malloc(sizeof(*tp))) == NULL){ fprintf(stderr,"MALLOC THREAD_PARAM ERROR"); return (-1); } tp->f1 = "f1"; tp->f2 = "f2"; tp->x = i; thread_cr_res = pthread_create(&threads[i], NULL, thread_function, (void*)tp); if(thread_cr_res != 0){ fprintf(stderr,"THREAD CREATE ERROR"); return (-1); } } return (0); } What i want to achieve, is to print all the numbers from 0 to 99, from threads. Also i am experimenting a way to pass a structure as a thread input parameter. What i am finding curios, is that not all the numbers are shown, eg: ./a.out | grep 9 9 19 29 39 49 And sometimes some numbers are shown twice: ... 75 74 89 77 78 79 91 91 Can you please explain me why is this happening ? No errors are shown.

    Read the article

  • Simple logger, how to ?

    - by Andrei Ciobanu
    Hello, I want to write a default Logger for my application. Currently I am using the default Java API Class Logger . I was wondering if it's possible to format my logs to look somthing like this: [level] [dd:MM:YYYY] [hh:mm:ss] message The logger should also be able to print the messages into the System.out and into a file ? Where should I look for this functionality ? Can you please give me some code snippets ?

    Read the article

  • Huge page buffer vs. multiple simultaneous processes

    - by Andrei K.
    One of our customer has a 35 Gb database with average active connections count about 70-80. Some tables in database have more than 10M records per table. Now they have bought new server: 4 * 6 Core = 24 Cores CPU, 48 Gb RAM, 2 RAID controllers 256 Mb cache, with 8 SAS 15K HDD on each. 64bit OS. I'm wondering, what would be a fastest configuration: 1) FB 2.5 SuperServer with huge buffer 8192 * 3500000 pages = 29 Gb or 2) FB 2.5 Classic with small buffer of 1000 pages. Maybe some one has tested such case before and will save me days of work :) Thanks in advance.

    Read the article

  • Problem with skipping login validation for authlogic

    - by Andrei
    Hi, I want to use email for signing in, and to allow users to have similar names. One way to do this is to rename login/username field to something different. However, I want to do it just by setting up authlogic. I tried the following acts_as_authentic do |c| c.login_field :email c.validate_login_field false c.validate_email_field true end but it still complains that the login already exists. What must be done to avoid username validation without renaming the field?

    Read the article

  • Function overloading in C

    - by Andrei Ciobanu
    Today, looking at the man page for open(), I've noticed this function is 'overloaded': int open(const char *pathname, int flags); int open(const char *pathname, int flags, mode_t mode); I didn't thought it's possible on C. What's the 'trick' for achieving this ?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10  | Next Page >