Search Results

Search found 617 results on 25 pages for 'brain'.

Page 12/25 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • OpenStreetMap and Hadoop

    - by portoalet
    Hi, I need some ideas for a weekend project about Hadoop and OpenStreetMap. I have access to AWS EC2 instance with OpenStreetMap snapshot in my EBS volume. The OpenStreetMap data is in a PostgreSQL database. What kind of MapReduce function can be run on the OpenStreetMap data, assuming I can export them into xml format, and then place into HDFS ? In other words, I am having a brain cramp at the moment, and cannot think what kind of MapReduce operation that can extract valuable insight from the OpenStreetMap xml? (i.e. extract all the places designated as park or golf course. But this needs to be done once only, not continuously) Many Thanks

    Read the article

  • Graphing new users by date in a Rails app using Seer

    - by Danger Angell
    I'd like to implement a rolling graph showing new users by day over the last 7 days using Seer. I've got Seer installed: http://www.idolhands.com/ruby-on-rails/gems-plugins-and-engines/graphing-for-ruby-on-rails-with-seer I'm struggling to get my brain around how to implement. I've got an array of the Users I want to plot: @users = User.all( :conditions = {:created_at = 7.days.ago..Time.zone.now}) Can't see the right way to implement the :data_method to roll them up by created_at date. Anyone done this or similar with Seer? Anyone smarter than me able to explain this after looking at the Seer sample page (linked above)?

    Read the article

  • django-admin formfield_for_* change default value per/depending on instance

    - by Nick Ma.
    Hi, I'm trying to change the default value of a foreignkey-formfield to set a Value of an other model depending on the logged in user. But I'm racking my brain on it... This: Changing ForeignKey’s defaults in admin site would an option to change the empty_label, but I need the default_value. #Now I tried the following without errors but it didn't had the desired effect: class EmployeeAdmin(admin.ModelAdmin): ... def formfield_for_foreignkey(self, db_field, request=None, **kwargs): formfields= super(EmployeeAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs) if request.user.is_superuser: return formfields if db_field.name == "company": #This is the RELEVANT LINE kwargs["initial"] = request.user.default_company return db_field.formfield(**kwargs) admin.site.register(Employee, EmployeeAdmin) ################################################################## # REMAINING Setups if someone would like to know it but i think # irrelevant concerning the problem ################################################################## from django.contrib.auth.models import User, UserManager class CompanyUser(User): ... objects = UserManager() company = models.ManyToManyField(Company) default_company= models.ForeignKey(Company, related_name='default_company') #I registered the CompanyUser instead of the standard User, # thats all up and working ... class Employee(models.Model): company = models.ForeignKey(Company) ... Hint: kwargs["default"] ... doesn't exist. Thanks in advance, Nick

    Read the article

  • Can I provide nil for the -dequeueReusableCellWithIdentifier: method?

    - by mystify
    dequeueReusableCellWithIdentifier: Returns a reusable table-view cell object located by its identifier. (UITableViewCell *)dequeueReusableCellWithIdentifier:(NSString *)identifier Parameters identifier A string identifying the cell object to be reused. By default, a reusable cell's identifier is its class name, but you can change it to any arbitrary value. Ok so if by default it's the class name, why should I put much brain force into thinking about an identifier? Could I provide just nil? Would it then use the class name? Or what did they try to say here? Must I make an NSString with the class name by myself and provide it as identifier?

    Read the article

  • a missing variable in a switch statement ?!!

    - by mechhfly
    hi folks, i have a strange issue. a variable seems to be missing during a pass through a case statement i have a function like so function checklink($var0, $var1, $var2) { switch($var0) { case "case1": print $var2; //code uses $var2 successfully case "case2": print $var2; //variable has disappeared! } } essentially what i am doing is constructing a string from the last variable based on the first. if i run the code in which the first case is true, i get the expected results, but when i run the second case, my variable seems to have vanished. these first two case statements are syntactically the same and the variable is gathered from the $_GET array (hard coded into hyperlink). any light on this issue? if more explanation is needed let me know, its late and my brain is getting mushy. thanks my friends.

    Read the article

  • UART speed possibly wrong

    - by Mike
    My brain is fried, so I thought I would pass this one to the community. When sending 1 character to my embedded system, it consistently thinks it receives 2 characters. The first received character seems to map to the transmitted character (in some unkown way) and the second received character is always 0xff Here is what I observed: Tx char (in hex) Rx character (in hex), I left out the second byte (always ff) 31 9D 32 9B 33 99 61 3D 62 3B 63 39 64 37 65 35 41 7D 42 7B 43 79 I have check my clocks and them seem to be ok. The only diff between this non working version and the previous version is that i am now using a RS485 chip. I have traced the signal all the way up to the MCU and it looks fine (confirmed the bit value on the rx pin)

    Read the article

  • Storing hierarchical (parent/child) data in Python/Django: MPTT alternative?

    - by Parand
    I'm looking for a good way to store and use hierarchical (parent/child) data in Django. I've been using django-mptt, but it seems entirely incompatible with my brain - I end up with non-obvious bugs in non-obvious places, mostly when moving things around in the tree: I end up with inconsistent state, where a node and its parent will disagree on their relationship. My needs are simple: Given a node: find its root find its ancestors find its descendants With a tree: easily move nodes (ie. change parent) My trees will be smallish (at most 10k nodes over 20 levels, generally much much smaller, say 10 nodes with 1 or 2 levels). I have to think there has to be an easier way to do trees in python/django. Are there other approaches that do a better job of maintaining consistency?

    Read the article

  • Localize DisplayNameAttributes in ActionFilter?

    - by boris callens
    Is it possible to access the DisplayNameAttributes that are used on my ViewData.Model so I can Localize them before sending them to the view? Something like this: Public Void OnActionExecuted(ActionExecutedContext: filterContext) { foreach (DisplayNameAttribute attr in filterContext...) { attr.TheValue = AppMessages.GetLocazation(attr.TheValue); } } What I'm missing is how to access the attributes. Is this possible at all? P.S: We're using vb.net at my job and it's infiltrating my brain. So apologies if my C# is a tad off.

    Read the article

  • Port a live system from App Engine Helper to App Engine Patch

    - by Alexander
    I am running a live system that is currently serving about 20K pages a day which is based on App Engine Helper (Python) with session support provided by AppEngine utilities. One problem that I have been having is that sessions are occasionally randomly logging out. I would like to try using the App Engine Patch, since it has "native" django session support, but I am worried that this is possibly going to be like doing a brain transplant. Specifically, current database models are all inhereted from BaseModel provided by the App Engine Helper. While, App Engine Patch does not have this inheritance. Does anyone know if it is possible to migrate a live system from App Engine Helper to App Engine Patch? If so, do you have any advice or warnings that I should heed, before attempting this transition? Thank you and kind regards Alex

    Read the article

  • Divs being hidden behind content, need to push it down.

    - by wilwaldon
    I'm pretty much at wits end right about now and can't seem to figure out why my divs aren't pushing content down on the page. If you go to http://www.wilwaldon.com/itsbroken/template.php you'll notice that the thumbnails on the right side are getting hidden behind the content below them. I'd like the thumbnails to push the bottom content down as opposed to being behind it. Any help would be greatly appreciated and you'd pretty much save my brain from exploding at this point. Thank you in advance!

    Read the article

  • codingBat last2 using regex

    - by polygenelubricants
    Okay guys, this is similar to my repeatEnd and wordEnds efforts; I want to solve this codingBat Warmup-2 question using only regex-based techniques as a "brain gymnastics" exercise. This solution works for codingBat tests: public int last2(String str) { return str.isEmpty() ? 0 : str.split( str.replaceAll( ".*(.)(.)", "$1(?=$2)" //.replaceAll("(\\$.)", "\\\\\\\\Q$1\\\\\\\\E") ), -1 ).length - 1 - 1; } The monstrous octo-slashes aren't needed to pass codingBat, but is needed for a proper regex-based solution. That is, if I want this (and I do!): assert last2("..+++...++") == 2; I'd have to uncomment the second .replaceAll. I'm just wondering if others can come up with a simpler, more elegant regex solution for this problem. Preferably one that doesn't contain octo-slashes.

    Read the article

  • Handling database failover for Rails applications on FreeBSD

    - by bianster
    I'm working on implementing database (Postgresql) failover for a Rails app that runs with Passenger/FreeBSD. Due to certain constraints regarding the server OS, it's necessary to continue using FreeBSD (as opposed to say, Ubuntu). I'm finding it to be quite a challenge to have failover handled within the Rails application, by way of a customised database adapter due to the fact that this application will be load-balanced between several webservers, and the multiple Rails processes that Passenger spawned in each webserver. I previously looked at setting up Pacemaker/Corosync to manage database server failover on a common IP but unfortunately I wasn't able to get past building the packages on FreeBSD. It does work rather well on Ubuntu 10.04 but I'm not likely to be able to use Ubuntu due to the OS constraints. I'm considering a custom witness daemon that simply pings the primary DB server, and this witness daemon switches all the webservers to the standby DB server when the primary becomes uncontactable (permanently/temporarily), to avoid split-brain. Though I would really like to know if there is a way to get Pacemaker(or something similar) to do the switch on FreeBSD.

    Read the article

  • IDE underlining custom attributes

    - by runrunraygun
    I have a custom attribute... [System.AttributeUsage(System.AttributeTargets.All)] public class Refactor : System.Attribute { private string _message; public Refactor() { _message = string.Empty; } public Refactor(string message) { _message = message; } } Applied to [Refactor("this should be less rubbish")] public virtual void RubbishMethod() { … } Now when someone makes a call to RubbishMethod I'd like the IDE (vs2008) to underline that call in a deep brown colour, similar to if I mark as Obsolete you get a green wave line. Is this possible? I've been racking my brain and hitting the google but I can't find how and where to do this.

    Read the article

  • In windbg, how do I get a heap header address from !heap -l results?

    - by Kevin
    I am playing around with windbg's !heap command, particular the "-l" switch which detects memory leaks. When -l does detect a leak, I am having problems navigating from its results to a stack trace for the source of the leak. Here is a snippet of the results from !heap -l 0:066 !heap -l Searching the memory for potential unreachable busy blocks. Entry User Heap Segment Size PrevSize Unused Flags 0324b500 0324b508 01580000 03230000 20 60 a busy 0324b520 0324b528 01580000 03230000 20 20 a busy 0324b5c8 0324b5d0 01580000 03230000 20 28 a busy Windbg's documentation for !heap tells me to use dt _DPH_BLOCK_INFORMATION with the header address, followed by dds with the blocks' StackTrace field. But the output for !heap -l doesn't specify a header address! It's only specififying Entry, User, Heap, and Segment. I've racked my brain looking over the other commands but can't figure out how to get the header address from any of these fields. Can someone help?

    Read the article

  • Graphing new users by date with Seer

    - by Danger Angell
    I'd like to implement a rolling graph showing new users by day over the last 7 days using Seer. I've got Seer installed: http://www.idolhands.com/ruby-on-rails/gems-plugins-and-engines/graphing-for-ruby-on-rails-with-seer I'm struggling to get my brain around how to implement. I've got an array of the Users I want to plot: @users = User.all( :conditions = {:created_at = 7.days.ago..Time.zone.now}) Can't see the right way to implement the :data_method to roll them up by created_at date. Anyone done this or similar with Seer? Anyone smarter than me able to explain this after looking at the Seer sample page (linked above)?

    Read the article

  • is it possible to have an sqlite database in a sqlserver field?

    - by Behrooz
    I think my question seems to be vague. I am trying to save user settings in SQLServer, but the problem can be expressed in this term:"it needs 20 tables with circular dependencies. and i have enough tables to fill 3 database diagrams", so the best way encountered to my brain is to save it as a sqlite database in a field, like this: Index |Name |Data 1 |Behrooz |*sqlite database here* 2 |User1 |*sqlite database here* ... is this way the right way?is it stupid? should i create more tables instead of doing all these? does it increase database fragmention?

    Read the article

  • rails foobar_path(3) returnes strange path: "/foobar.3/" instead of "/foobar/3/

    - by Dominik
    Hi i have this starnge behavoir... <%= link_to image_tag("image.png"), foobar_path(1), :method => "put" %> produces: <a href="/brain.1" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.met ...[many rails code]... ;return false;"><img alt="Research_4" src="/images/image.png" /></a> a href="/foobar.1" this is the strange part :( any ideas whqt is causing this?

    Read the article

  • Python language API

    - by Oscar Reyes
    Hello. I'm starting with Python coming from java. I was wondering if there exists something similar to JavaDoc API where I can find the class, its methods and and example of how to use it. I've found very helpul to use help( thing ) from the Python ( command line ) I have found this also: http://docs.python.org/ http://docs.python.org/modindex.html But it seems to help when you already the class name you are looking for. In JavaDoc API I have all the classes so if I need something I scroll down to a class that "sounds like" what I need. Or some times I just browse all the classes to see what they do, and when I need a feature my brain recalls me We saw something similar in the javadoc remember!? But I don't seem to find the similar in Python ( yet ) and that why I'm posting this questin. BTW I know that I would eventually will read this: http://docs.python.org/lib/lib.html But, well, I think it is not today.

    Read the article

  • SVN Delete with wildcard?

    - by David Lively
    I'm migrating a VSS repository to SVN and inadvertently included all of the _vti_cnf, *.scc files in the first check-in. I'd like to remove these from SVN. (Not permanently, of course - just in the HEAD). The application in question is quite large, and finding and deleting these files on a folder-by-folder basis will take forever. Suggestions? There must be some obvious way to do this, but the proximity of the weekend is interfering with my higher brain functions.

    Read the article

  • Why are primes important in cryptography?

    - by Michael Stum
    One thing that always strikes me as a non-cryptographer: Why is it so important to use Prime numbers? What makes them so special in cryptography? Does anyone have a simple short explanation? (I am aware that there are many primers and that Applied Cryptography is the Bible, but as said: I am not looking to implement my own cryptographic algorithm, and the stuff that I found just made my brain explode - no 10 pages of math formulas please :)) Thanks for all the answers. I've accepted the one that made the actual concept most clear to me.

    Read the article

  • Frame.Navigate to an embedded resource F#

    - by akaphenom
    I have a 100% silverlight 3.0 / f# 2.0 application I am wrapping my brain around. I have the base application loading correctly - and now I want to add the naigation controls to it. My page is stored as an embedded resource - but the Frame.Navigate takes a URI. I know what I have is wrong but here it is: let nav : Frame = mainGrid ? mainFrame let url = "/page1.xaml" let uri = new System.Uri(url, System.UriKind.Relative) ; nav.Navigate uri Any thoughts?

    Read the article

  • Python noob question - why is my simple regex not working?

    - by coson
    Good Day, I have a simple Python question that I'm having brain freeze on. This code snippet works. But when I substitue "258 494-3929" with phoneNumber, I get the following error below: # Compare phone number phone_pattern = '^\d{3} ?\d{3}-\d{4}$' # phoneNumber = str(input("Please enter a phone number: ")) if re.search(phone_pattern, "258 494-3929"): print "Pattern matches" else: print "Pattern doesn't match!" ####################################################### Pattern does not match Please enter a phone number: 258 494-3929 Traceback (most recent call last): File "pattern_match.py", line 16, in phoneNumber = str(input("Please enter a phone number: ")) File "", line 1 258 494-3929 ^ SyntaxError: invalid syntax C:\Users\Developer\Documents\PythonDemo btw. I did import re and tried using rstrip in case of the \n What else could I be missing? TIA, coson

    Read the article

  • Understanding how to inject object dependencies

    - by Hans
    I have an object that loads an instance of another object in a method. $survey = new survey; $question = new question($survey); $question-load($question_id); class question { public function __construct(&$survey) { $this-survey = $survey; } public function load ($id) { // now a question is loaded // want to load the survey that this question is in $this->survey->load($this->get('survey_id')); // ** survey_id is a field in the questions table // now $this->survey object has all the info about the survey this question is in } private function get($name) { // returns $name, if isset() from array that load() sets } } This is frying my brain, though, because it seems like $survey should come into $response already being a complete object. But, how do I do that, if I don't know what survey_id to load until I'm in the object? I am revamping a site and the most complex part is littered with this issue. TIA - Hans.

    Read the article

  • SICP making change

    - by RyanD
    So; I'm a hobbiest who's trying to work through SICP (it's free!) and there is an example procedure in the first chapter that is meant to count the possible ways to make change with american coins; (change-maker 100) = 292. It's implemented something like: (define (change-maker amount) (define (coin-value n) (cond ((= n 1) 1) ((= n 2) 5) ((= n 3) 10) ((= n 4) 25) ((= n 5) 50))) (define (iter amount coin-type) (cond ((= amount 0) 1) ((or (= coin-type 0) (< amount 0)) 0) (else (+ (iter amount (- coin-type 1)) (iter (- amount (coin-value coin-type)) coin-type))))) (iter amount 5)) Anyway; this is a tree-recursive procedure, and the author "leaves as a challenge" finding an iterative procedure to solve the same problem (ie fixed space). I have not had luck figuring this out or finding an answer after getting frustrated. I'm wondering if it's a brain fart on my part, or if the author's screwing with me.

    Read the article

  • Filtering at server or at client?

    - by ablmf
    I am thinking about how to build advertise site which works like twitter. That means, most user don't not visit the site by browser, they should run a dedicated client application on their PC or smart phone. Then they set some filters about what kind of advertise they like. And when new post that fulfill their needs appear, the client will make a notification. To make that client as real time as possible, it has to poll the server within a short time interval. The problem is, should I do the filtering at the server side when client polls, or should I simply transfer all new posts to client and let client do the filtering? Making server side filtering might cause too much CPU cycles of server, but transferring every post blindly to client might waste a lot of bandwidth. Just a brain game. :)

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >