Search Results

Search found 1007 results on 41 pages for 'kevin'.

Page 31/41 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • python : in which timezone is it a specific time right now?

    - by kevin
    i have users from all timezones, and i want to send out alerts at around 8AM in each users respective timezone. i need a python script that runs every hour [in a cron job] and i need to find out at which timezone it is 8AM right now, and i can use that info to select the users that have to receive the alerts. how do i go about doing this? there seems to be gmt+14 to gmt-12 that is 27 timezones, and there are only 24 hours in a day!

    Read the article

  • How does Core Data determine if an NSObjects data can be dropped?

    - by Kevin
    In the app I am working on now I was storing about 500 images in Core Data. I have since pulled those images out and store them in the file system now, but in the process I found that the app would crash on the device if I had an array of 500 objects with image data in them. An array with 500 object ids with the image data in those objects worked fine. The 500 objects without the image data also worked fine. I found that I got the best performance with both an array of object ids and image data stored on the filesystem instead of in core data. The conclusion I came to was that if I had an object in an array that told Core Data I was "using" that object and Core Data would hold on to the data. Is this correct?

    Read the article

  • Preventing dictionary attacks on a web application

    - by Kevin Pang
    What's the best way to prevent a dictionary attack? I've thought up several implementations but they all seem to have some flaw in them: Lock out a user after X failed login attempts. Problem: easy to turn into a denial of service attack, locking out many users in a short amount of time. Incrementally increase response time per failed login attempt on a username. Problem: dictionary attacks might use the same password but different usernames. Incrementally increase response time per failed login attempt from an IP address. Problem: easy to get around by spoofing IP address. Incrementally increase response time per failed login attempt within a session. Problem: easy to get around by creating a dictionary attack that fires up a new session on each attempt.

    Read the article

  • Switching to HTML 5 and CSS3

    - by Kevin Sylvestre
    I constantly find myself creating sites using newer technologies (such as HTML 5 and CSS 3, then adding either backwards compatibility layers or porting entirely to XHTML 1.0 and CSS 2.1. This process often involves replacing CSS with sprite images and adding in flash components for advanced asynchronous support. My question is when can I can start to use the modern standards exclusively. Do I need to wait until Internet Explorer 9 is released or is it acceptable to request users switch to a "better" browser? Furthermore, if dropping compatibility for non HTML 5 browsers is an option, is it reasonable to ask mainstream users to install the Google Frame Frame? Thanks.

    Read the article

  • Setting Rails Checkbox from Another Model

    - by Kevin
    I have a checkbox that belongs to "Foo" class. I have another "Preferences" class that sets the default for what that checkbox should be. I tried using f.check_box :email_preference, :value => preferences.email_preference but it doesn't work. I use this page to do new record creation as well as edit, so obviously for new records I would want to take the preferences.email_preference setting as a default, then for editing the record use the foo.email_preference. Any suggestions?

    Read the article

  • Rails Plugin for Multiple Ratings Per Model?

    - by Kevin
    I'm looking to add the capability of rating a model I have under several different categories like "Knowledgeable" "Organized", etc. Is there a plugin that will allow me to do this, and maybe even have a cool x/5 stars graphical representation as well?

    Read the article

  • Linux Access physical memory (NOR flash)

    - by Kevin
    Hello, I am trying to access a Linux system's NOR flash memory. I tried use __raw_readl(xxxxx) (through io_p2v) to read NOR memory data, but I failed. Is there any way I can access that memory? Will driver /dev/mem work for this? I guess not. it is only for the RAM maybe. Can anyone help?

    Read the article

  • Getting Result of $q's Resolution or Rejection

    - by Kevin Meredith
    I'm looking at a $q example from Mastering Web Application Development with Angular. For this code, how can I retrieve the String result of pizzaOrderFulfillment.resolve(...) or pizzaOrderFulfillment.reject? var myApp = angular.module('myApp',[]); myApp.controller("MyCtrl", function ($scope, $q) { var Person = function(name) { this.eat = function(food) { return name + " is eating " + food; }; this.beHungry = function(reason) { return name + " is hungry because" + reason; }; }; // success var pizzaOrderFulfillment = $q.defer(); var pizzaDelivered = pizzaOrderFulfillment.promise; var man = new Person("man"); pizzaDelivered.then(man.eat, man.beHungry); pizzaOrderFulfillment.resolve("chicken"); // TODO: var successResult = "man is eating chicken" });

    Read the article

  • Msysgit bash is horrendously slow in Windows 7

    - by Kevin L.
    I love git and use it on OS X pretty much constantly at home. At work, we use svn on Windows, but want to migrate to git as soon as the tools have fully matured (not just TortoiseGit, but also something akin the really nice Visual Studio integration provided by VisualSVN). But I digress... I recently installed msysgit on my Windows 7 machine, and when using the included version of bash, it is horrendously slow. And not just the git operations; clear takes about five seconds. AAAAH! Has anyone experienced a similar issue? Edit: It appears that msysgit is not playing nicely with UAC and might just be a tiny design oversight resulting from developing on XP or running Vista or 7 with UAC disabled; starting Git Bash using Run as administrator results in the lightning speed I see with OS X (or on 7 after starting Git Bash w/o a network connection - see @Gauthier answer). Edit 2: AH HA! See my answer.

    Read the article

  • Codeigniter: Pass data to library funciton

    - by Kevin Brown
    I need my function to do one of two things based on the method variable, but I don't know how to get it done... My controller: function survey($method) { $id = $this->session->userdata('id'); $data['member'] = $this->home_model->getUser($id); $data['header'] = "Home"; $this->survey_form_processing->survey_form($this->_container,$data); } Library function: function survey_form($container,$method) { if($method == 1){ $this->CI->load->view($container,$data); } if($method == 2){ Do stuff... }

    Read the article

  • Using Google Map Headers (YM4R) on Heroku

    - by Kevin
    I have the following at the top of my view: <%= GMap.header %> Heroku is giving me an ActionView::TemplateError on that line.... this works on my own machine but not on Heroku.... why is that? Is there something about Heroku that doesn't allow? In the final compile on the browser, the above code translates into this on the client side: <script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=XXXXX;hl=&amp;sensor=false" type="text/javascript"> </script> <script src="/javascripts/ym4r-gm.js" type="text/javascript"></script>

    Read the article

  • How does Rails Plugin Storage work?

    - by Kevin
    Trying to figure out how to install rails plugins manually on windows so I have a few questions. What does the directory need to be named in vendor/plugins? Is it arbitrary or is it linked to something within the plugin config files or is that what you set in the environment.rb? Once I've copied the files to the correct directory, do I always need to run something inside like init.rb or is it good to go? What's the difference between 'require' and 'include'? Thanks!

    Read the article

  • Html newbie! background-image question

    - by Kevin Li
    Hi! I'm learning HTML and I wanted to practice by recreating a invoice sent to me by Electronics Expo. However, I used the background-image property and repeated it by repeat-x and now, the background stretches across the page so much that it has a horizontal bar to drag. http://htmlpocketreference.110mb.com/index.html You can see what I did in my link above. Also, I would really appreciate some advice on simplifying my CSS coding. It seems really messy and I have to move every element once something changes. -.- Thanks!

    Read the article

  • PHP: Adding text to a file

    - by Kevin Duke
    I'm trying to set up authentication on my server, however, I know little about Php. I have a php file filled with users and passwords: function getPassword( $user ) { // the user/password database. For very small groups // of users, you may just get away with expanding this // array. $passwords= array ( 'user1' => 'password1', 'user2' => 'password2', 'user3' => 'password3', 'user4' => 'password4' ); $password = $passwords[ $user ]; if ( NULL == $password ) return NULL; Without manually editing the array of passwords, I want a php file to read in user inputs for usernames and passwords and append it to the array. I have a vague idea of how this could work by looking up documentation: <?php function fwrite_stream($fp, $string) { $fp = fopen('shit.php', 'w'); for ($written = 0; $written < strlen($string); $written += $fwrite) { $fwrite = fwrite($fp, substr($string, $written)); if ($fwrite === false) { return $written; } } return $written; fclose($fp); } ?> How do I tell this to write to the array?

    Read the article

  • SEO Language information

    - by Kevin
    I was wondering if defining your language in HTML is better for search enigines. For example, I've got a French site, then i've got three options: 1.) have faith that google can say my site is french 2.) define language in the HTML tag <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr"> 3.) define language in a meta tag <meta http-equiv="content-language" content="FR-fr" /> Which option you believe is best? Or which combination of options?

    Read the article

  • Dividing a 9x9 2d array into 9 sub-grids (like in sudoku)? (C++)

    - by kevin
    I'm trying to code a sudoku solver, and the way I attempted to do so was to have a 9x9 grid of pointers that hold the address of "set" objects that posses either the solution or valid possible values. I was able to go through the array with 2 for loops, through each column first and then going to the next row and repeating. However, I'm having a hard time imagining how I would designate which sub-grid (or box, block etc) a specific cell belongs to. My initial impression was to have if statements in the for loops, such as if row < 2 (rows start at 0) & col < 2 then we're in the 1st block, but that seems to get messy. Would there be a better way of doing this?

    Read the article

  • Where do I put the Current user query so as to not repeat per controller?

    - by Kevin
    I have a standard query that gets the current user object: @user = User.find_by_email(session[:email]) but I'm putting it as the first line in every single controller action which is obviously not the best way to do this. What is the best way to refactor this? Do I put this as a method in the Application controller (and if so, can you just show me a quick example)? Do I put the entire @user object into the session (has about 50 columns and some sensitive ones like is_admin)? Or is there another way to remove this kind of redundancy?

    Read the article

  • jQuery validation: .each with form

    - by Kevin Brown
    If I have a form of about 40 questions, how do I apply the same rules to questions 1-20, and 21-40? For example: $("#form_survey").validate({ rules: { a_ +i: {max:12, maxlength:2}, }, messages: { a_ +i:{ max: "That's too much!" } } Where the "+i" is the ideal increment of +1... Should be easy, I'm just stuck on syntax...

    Read the article

  • Is long long in C++ known to be very nasty in terms of precision?

    - by Kevin
    The Given Problem: Given a theater with n rows, m seats, and a list of seats that are reserved. Given these values, determine how many ways two friends can sit together in the same row. So, if the theater was a size of 2x3 and the very first seat in the first row was reserved, there would be 3 different seatings that these two guys can take. The Problem That I'm Dealing With The function itself is supposed to return the number of seatings that there are based on these constraints. The return value is a long long. I've gone through my code many many times...and I'm pretty sure that it's right. All I'm doing is incrementing this one value. However, ALL of the values that my function return differ from the actual solution by 1 or 2. Any ideas? And if you think that it's just something wrong with my code, please tell me. I don't mind being called an idiot just as long as I learn something.

    Read the article

  • How can I make this simple C# generics factory work?

    - by Kevin Brassen
    I have this design: public interface IFactory<T> { T Create(); T CreateWithSensibleDefaults(); } public class AppleFactory : IFactory<Apple> { ... } public class BananaFactory : IFactory<Banana> { ... } // ... The fictitious Apple and Banana here do not necessarily share any common types (other than object, of course). I don't want clients to have to depend on specific factories, so instead, you can just ask a FactoryManager for a new type. It has a FactoryForType method: IFactory<T> FactoryForType<T>(); Now you can invoke the appropriate interface methods with something like FactoryForType<Apple>().Create(). So far, so good. But there's a problem at the implementation level: how do I store this mapping from types to IFactory<T>s? The naive answer is an IDictionary<Type, IFactory<T>>, but that doesn't work since there's no type covariance on the T (I'm using C# 3.5). Am I just stuck with an IDictionary<Type, object> and doing the casting manually?

    Read the article

  • String vectors not working as expected with newline and iterators? (C++)

    - by kevin
    I have a text file made of 3 lines: Line 1 Line 3 (Line 1, a blank line, and Line 3) vector<string> text; vector<string>::iterator it; ifstream file("test.txt"); string str; while (getline(file, str)) { if (str.length() == 0) str = "\n"; // since getline discards the newline character, replacing blank strings with newline text.push_back(str); } // while for (it=text.begin(); it < text.end(); it++) cout << (*it); Prints out: Line 1 Line 3 I'm not sure why the string with only a newline was not printed out. Any help would be appreciated. Thanks.

    Read the article

  • jQuery: if value is true without user action

    - by Kevin Brown
    I want to show a div if the value of an input =='CP'. Right now this is my code: $(".register-type").change(function(){ var value = $(this).val(); if(value == 'CP'){ $('.cp-show').show(); This works fine if they change the input, but if things get validated false and the page reloads, this input is still 'CP', but the div doesn't show... Is there a way to correct this so that jquery checks if this is set on the page load?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >