Search Results

Search found 101 results on 5 pages for 'nils riedemann'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • How do I handle nils in views?

    - by Badweather
    I have the following models set up: class Contact < ActiveRecord::Base belongs_to :band belongs_to :mode validates_presence_of :call, :mode validates_associated :mode, :band validates_presence_of :band, :if => :no_freq? validates_presence_of :freq, :if => :no_band? protected def no_freq? freq.nil? end def no_band? band.nil? end end class Band < ActiveRecord::Base has_many :logs end class Mode < ActiveRecord::Base has_many :logs end When I enter a frequency on my new view it allows for no band to be specified if a freq is entered. This creates a problem in my other views though because band is now nil. How do I allow for band not to be specified and just show up as empty on my index and show views, and then in the edit view allow one to be specified at a later point in time. I have been able to get my index to display a blank by doing: contact.band && contact.band.name But I'm not sure if this is a best approach, and I'm unsure of how to apply a similar solution to my other views. Many thanks from a rails newb!

    Read the article

  • ruby syntactic sugar: dealing with nils..

    - by luca
    probably asked already but I couldn't find it.. here are 2 common situation (for me while programming rails..) that are frustrating to write in ruby: "a string".match(/abc(.+)abc/)[1] in this case I get an error because the string doesn't match, therefore the [] operator is called upon nil. What I'd like to find is a nicer alternative to the following: temp="a string".match(/abc(.+)abc/); temp.nil? ? nil : temp[1] in brief, if it didn't match simply return nil without the error The second situation is this one: var = something.very.long.and.tedious.to.write var = something.other if var.nil? In this case I want to assign something to var only if it's not nil, in case it's nil I'll assign something.other.. Any suggestion? Thanks!

    Read the article

  • Is there some advantage to filling a stack with nils and interpreting the "top" as the last non-nil value?

    - by dwilbank
    While working on a rubymonk exercise, I am asked to implement a stack with a hard size limit. It should return 'nil' if I try to push too many values, or if I try to pop an empty stack. My solution is below, followed by their solution. Mine passes every test I can give it in my IDE, while it fails rubymonk's test. But that isn't my question. Question is, why did they choose to fill the stack with nils instead of letting it shrink and grow like it does in my version? It just makes their code more complex. Here's my solution: class Stack def initialize(size) @max = size @store = Array.new end def pop empty? ? nil : @store.pop end def push(element) return nil if full? @store.push(element) end def size @store.size end def look @store.last end private def full? @store.size == @max end def empty? @store.size == 0 end end and here is the accepted answer class Stack def initialize(size) @size = size @store = Array.new(@size) @top = -1 end def pop if empty? nil else popped = @store[@top] @store[@top] = nil @top = @top.pred popped end end def push(element) if full? or element.nil? nil else @top = @top.succ @store[@top] = element self end end def size @size end def look @store[@top] end private def full? @top == (@size - 1) end def empty? @top == -1 end end

    Read the article

  • What software companies have offices in Melbourne, Australia?

    - by Nils Schmidt
    I was wondering about doing my Master Thesis in Melbourne, Australia. Our university is setting up the contacts with Melbourne University right now. My question now is, what (big/succesfull/interesting) software companies (preferable Java EE focus, but not necessarily) have offices in Melbourne, Australia? Thanks in advance and kind regards Nils

    Read the article

  • How to detect whether an Object came to sleep at a specific position?

    - by Nils Riedemann
    I'm currently writing a small game with box2dweb and I need some direction for this: I'm throwing a Box and have to hit a specific place and trigger an event when the object that's been thrown isn't moving anymore, "fell asleep" so to say. What's the proper way / best practice for this? I'm currently thinking of asking the b2World whether an Object is within a specific AABB and then wait a few seconds, check if it's still there and then trigger the event. But this seems to me like the roundabout way and the object might still be moving inside of that AABB and eventually even drop out of the AABB.

    Read the article

  • Problem with Bibtex

    - by Tim
    Hi, I just wonder why this item not shown properly in bibliography? @misc{Nilsson96introductionto, author = {Nilsson, Nils J.}, citeulike-article-id = {6995464}, howpublished = {\url{http://robotics.stanford.edu/people/nilsson/mlbook.html}}, keywords = {*file-import-10-04-11}, posted-at = {2010-04-11 06:52:28}, priority = {2}, title = {Introduction to Machine Learning: An Early Draft of a Proposed Textbook.}, year = {1996} } [12] Nils J. Nilsson. Introduction to machine learn- ing: An early draft of a proposed textbook. http://robotics.stanford.edu/people/nilsson/mlbook.html, 1996. Thanks and regards!

    Read the article

  • GWT carousel widget

    - by Nils
    Hello, I'm currently working on a GWT project, in which I need to use a "carousel" widget. The carousel widget is supposed to display pieces of information and 2 arrows - when the user clicks on one of the arrow, the content is moved with an animation and replaced with new content. I've been looking through the available widget libs, but the "carousel" widget does not seem to be that available. The only real candidate I found is the gwt-yui-carousel widget (see link below), but this seems to be an overload of ressources - though it does almost exactly what I need, but instead of displaying simple images, I'll have to display, in MVP terms, a view/presenter. Here is the widget running : http://gwt-yui-carousel.googlecode.com/svn/trunk/www/com.gwtyuicarousel.javascriptload.JavaScriptLoad/javascriptload.html (coming from here : http://code.google.com/p/gwt-yui-carousel/ ). Is there a better carousel widget available that I would not know of ? Or should I extend an existing one to create the desired effect ? Would you recommend to use the gwt-yui-carousel (I don't think so) ? If there is no better option, do you think that it would be a good idea to create the widget myself ? Note that I think that the key thing is, here, that I'll have to display presenter/views, which will fetch data in DataBase on arrow clicks and so on - so a customisation of an existing widget would be required, or the chosen widget should be able to display a list of GWT Widgets. Again I don't think that I can use one of the existing usual carousel widgets, since those are not "gwt-oriented" and could not support view/presenters and all this gwt stuff ;) Any answer would be greatly appreciated :) Best regards, Nils

    Read the article

  • GWT forced height HTMLPanel

    - by Nils
    Hello, I'm developing a GWT project, and I encountered a problematic cross-browsering problem. When using firefox, there are problems with the display of all the pages. I found the reason why : In UIBinder, each of my pages are wrapped by a "g:HTMLPanel" : at start and at the end of the xml file, to wrap the content of all the pages When doing this, the generated code of the panel goes like this : div style="width: 100%; height: 100%; .... The problem is that "height : 100%". If I remove it with firebug, the display is perfect. So my goal is to programatically remove that generated 100% height.. But no way to do it ! I tried everything : setHeight, setSize, working on the Element itself with getElement().methods()... I tried to do things like style.clear(), everything that could have a chance to work.. But in the generated code that "height: 100%" will ALWAYS be there. If I set it's height to "50%" or "50px" it has no effect at all. I even tried to give it an ID, then with pure javascript to change it's style, but no solution either.. Note : I'm sure that I'm working on the right element : adding a styleName, for example, works well. Any idea ? Your help would be really appreciated, I have no clue of how to remove this bit of generated code, and I've been looking for hours already :(:(:(:( Best regards, Nils

    Read the article

  • X doesn't find nvidia module when installing developer driver

    - by Nils
    I just downloaded the developer driver from Nvidia's CUDA Zone. Executed it and typed in restart gdm and the it worked. However after rebooting X didn't come up (xorg log), to fix it I can simply rerun the installer and the restart gdm again. What I don't understand is where it breaks and why X11 doesn't find the module?! I removed all (I think..) of the Nvidia packages which can with Ubuntu 10.10. I've also googled a bit and found some HOWTOs about manually installing the Nvidia driver. However all of them were for an earlier version of Ubuntu. Please do not respond telling me I should use the proprietary Nvidia driver supplied by Ubuntu, because I need the development drivers.

    Read the article

  • Rights and use of developed software

    - by Nils Munch
    I have been working on a piece of software for a company, that they wish to resell. There was an mail-based agreement upon a flat hourly rate for my work, and eager me chose to accept a rather low fee. Due to the stress and tempo of the task, a direct contract was never formed or signed. The software was developed locally on my machine, and I was pretty much alone with it, except by excellent help from StackOverflow when I got stuck. Now, the software is nearing completion, I suddenly hear that they have hired a new developer to make the same piece of software as me, and that I was expected to resign within long. Confused I ask around, and realize that the CEO of the company had informed the rest of the company that I was terminally ill and had cancer, and was expected to leave the company soon. Since I'm perfectly healthy, this confused me even more, until I realized what was going on. When I confronted my boss with this, I was no longer seen as a member of the company, and I left the same day, never to return. Later, I raised the question about my missing pay, since I had been working for quite a bit, and not received any payment for my software. I saw that they had already sold a fair copy of my software, and since it's not exactly sold cheap, the company should have plenty of gold to pay me. The company refused, and said that they owned the software, and everything it contained. That was a lot of drama, but my question is this: Who has the rights to the software ? The source code had my personal watermarks and copyrights inprinted, but they have since simply deleted it. The company claim that they have all the rights, because they have a website made about the product, where they write that they have "All rights reserved" in the bottom. My instinct tells me that if a company buys a service like this, and then refuses to pay their developer, then they should not be allowed to keep, and much less resell the product. I have not signed any agreements about giving the company the use of this product, I have made it in my own time and without help from the rest of the company. This all takes place in Denmark, Europe, but I would guess that the rules about this is somewhat universal. Im not the strongest person to legal-talk, so I might be wrong.

    Read the article

  • Mobile 3D engine renders alpha as full-object transparency

    - by Nils Munch
    I am running a iOS project using the isgl3d framework for showing pod files. I have a stylish car with 0.5 alpha windows, that I wish to render on a camera background, seeking some augmented reality goodness. The alpha on the windows looks okay, but when I add the object, I notice that it renders the entire object transparently, where the windows are. Including interior of the car. Like so (in example, keyboard can be seen through the dashboard, seats and so on. should be solid) The car interior is a seperate object with alpha 1.0. I would rather not show a "ghost car" in my project, but I haven't found a way around this. Have anyone encountered the same issue, and eventually reached a solution ?

    Read the article

  • Ubuntu doesn't boot after adding a bootflag to the Windows partition

    - by Nils
    I have Ubuntu 10.10 installed on one (physical) hd and on the other one Windows. On both drives grub is installed to boot both operating systems. When I wanted to install SP1 for Win 7 I had to add a bootable flag to the partition from which Windows boots, otherwise the installation of SP1 does not work. I did so by booting into Ubuntu and using gparted to add this flag. After doing so the update for SP1 worked without any problems. When trying to boot back into Ubuntu grub complained that it couldn't find the kernel anymore! I tried to boot into a Ubuntu minimal cd and to restore grub using chroot, update-grub and grub-install which didn't work. I still had the problem that it was Unable to boot Ubuntu putting me in some minimal system called initramfs. It seems however that the uuid of the partitions changed. I guess this happened when I added the bootflag to the windows disk. Next thing I tried was to tell grub not to use the uuid for loading the kernel by uncommenting something in /etc/default/grub. Then I got the kernel booting but it suddenly stops (I guess when it is trying to mount the root file system) saying that the concerning uuid does not exist putting me into initramfs again. The strange thing is that there I coulnd't even manage to mount the root partition using /dev/sdb1 (on which it is in my case). I would be glad if there is a way to restore the system again without having to reinstall it.

    Read the article

  • Balancing agressive invites

    - by Nils Munch
    I am designing a trading card game for mobiles, with the possibility to add cards to your collection using Gems, aquired through victories and inapp purchases. I am thinking to increase the spread of the game with a tracking system on game invites, enabling the user to invite a friend to play the game. If the friend doesn't own the game client (which is free) he will be offered to download it. If he joins the game, the original player earns X amount of gems as an reward. There can only be one player per mobile device, which should rule out some harvesting. My question is, how do you think the structure of this would be recieved ? All invites are mail based, unless the player already exists in the game world (then he gets a ingame invitation.) I have set a flood filter, so a player can only invite a friend (without the client installed) once a month.

    Read the article

  • Victory rewards in digital CCG

    - by Nils Munch
    I am currently polishing a digital CCG where people can play against friend and random opponents in a classical Magic the Gathering-like duel CCG. I plan to award the players with 20 ingame currency units (lets call them gold) for each hour they are playing, 50 for each day they are playing and X for each victory. Now, the X is what I am trying to calculate here, since I would prefer keeping the currency to a certain value, but also with to entice the players to battle. I could go with a solid figure, say 25, for beating up an opponent. But that would result in experienced players only beating up newly started players, making the experience lame for both. I could also make a laddered tier, where you start at level 1, and raise in level as you defeat your opponents, where winning over a player awards you his level x 2 in gold. Which would you prefer if you were playing a game like this. There is no gold-based scoreboard, but the gold is used to purchase new cards along the way.

    Read the article

  • How do I set my environment up for TopCoder?

    - by Nils
    I tried out TopCoder today. While I liked the problem, the Java editor didn't work for me. The remote compiling time and the lack of unit tests also made it difficult to complete the task. I ended up coding the solution in Eclipse and the pasting it into the TopCoder window. I tried out EclipseCoder, but it didn't suit my needs either. What tools do you use and how do you hook up your development environment with TopCoder? How does TopCoder handle submissions, and is there any way to speed up the time it takes to process them?

    Read the article

  • ICQ offline messages (do not show up)

    - by Nils Riedemann
    Hi there, I have a weird problem with offline messages: I use Adium on 2 Macs (home and office) and Beejive (iPhone) for connecting to ICQ and other protocols. When someone sends me an offline messages I expect them to show up the next time I login with any of my 3 devices. But thats not the case. Recently some show up at the office, some at home and some on my iPhone – couldnt figure out any logic behind it, seems rather random. I thought for a while that it depends on the last device i have been logged in with. But thats not the case either. A friend can send me offline Messages during the weekend, i can login with my Mac at home or iPhone, yet in some cases it only shows up when logging in from office. Weird. It really freaks me out – and no, i can't make 'em go to jabber or the like. Anyone experiencing a similar problem?

    Read the article

  • Mighty Mouse is jumping around on screen

    - by Nils Riedemann
    Hi there, I have a really annoying problem with my mighty mouse since a couple of weeks now. When moving my mouse (mightymouse) sometimes it jumps (about once in 30minutes) directly to a (propably) random spot of my screen. I cleaned the mightymouse several times and there is definately no hair or the like, and the desk is not the problem as well - I have the same problem with my other mighty mouse at home. Since I don't have any other mouse i couldn't test whether this relates to the mighty mouse or the mouse in general. Has anyone experienced such issues as well? Is there a solution? Greetings btw: Mac OS X 10.6.4

    Read the article

  • Weird behaviour/rendering of backspace in Terminal.app when SSHing into zsh

    - by Nils Riedemann
    Hi there, I just stumbled upon a weird problem. When I SSH into my server (centos, zsh) and I type some stuff and hit backspace It looks like a space - but internally it really deleted the characters. ls -l a Note that the space between land a is actually when I hit backspace. When I now hit return ls -a gets executed. This is only in zsh, in bash it works fine. Hope anyone has an idea what this is all about and how to fix this.

    Read the article

  • Looking for a sketch program with an infinite canvas

    - by Nils Riedemann
    Hi there, I'm not quite sure if such questions are allowed on SU. I was just wondering whether there is a sketch program like Adobe Ideas for iPad that has an infinite canvas but for OSX. It need not be feature rich and all that. Very simple, just for sketching out some stuff without thinking about the space. I was thinking about some vector tool where I could infinitely zoom in and draw. I'm sure you get the idea of what I am looking for. Any hints? OS is OS X.

    Read the article

  • Weird behaviour/rendering of backspace in Terminal.app when SSHing into zsh using tmux/screen

    - by Nils Riedemann
    Hi there, I just stumbled upon a weird problem. When I SSH into my server (centos, zsh) and I type some stuff and hit backspace It looks like a space - but internally it really deleted the characters. ls -l a Note that the space between land a is actually when I hit backspace. When I now hit return ls -a gets executed. This is only in zsh, in bash it works fine. Hope anyone has an idea what this is all about and how to fix this. Update: Only happens when using tmux/screen

    Read the article

  • zsh behaves weird in screen

    - by Nils Riedemann
    Hi there, I have zsh set up as my default shell. It works fine as long as i am not within a screen. When i start screen it looks as if some dotfiles are not loaded. For example my $PATH isn't set correctly and some directories are missing. I'm not quite sure where to start looking. Since all is fine, as long as i'm not in a screen. My dotfiles can be viewed on github. I also use oh-my-zsh — as you will notice.

    Read the article

  • Autocompletion based on filenames in a directory

    - by Nils Riedemann
    Hi there, I want to have a function in my zsh for faster accessing my todo-files. It should look inside the folder ~/tasks where i put my todo-lists and stuff. Now i want to type task p and when I hit tab, it should use the files in that directory for autocompletition. Can anyone point me some direction? Or share some snippet to work with? Thanks

    Read the article

  • How to get some randomized concats based on 2 columns from 1 table?

    - by Nils Riedemann
    Hey folks, i have a large user Database (13k+), and for some reason i need to create random names. The users table has "first_name" and "last_name". Now i want to have 10 concats of full_name and last_name of two completely random rows. Is that even possible with SQL? My other idea was just to create a full_names and last_names table … but that would'nt be as much challenging. Oh, and it should not take up too much performance :) (so order by rand() is not an option ;))

    Read the article

1 2 3 4 5  | Next Page >