Search Results

Search found 1511 results on 61 pages for 'oh my zsh'.

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

  • How to prove writing specifications beats code cowboys?

    - by Andrew Grant
    So I have a problem. Or rather my friend has a problem, since I would never write about my company on an internet forum. At my friend's company specification writing is, shall we say, a little underused. There's a deeply ingrained culture of writing code first and asking questions later, whether it's for a library routine or a new tool to inflict on their long suffering designers. This of course leads to situations where functionality is partially correct, incorrect, or just completely missing ("oh, just save before trying anything you may want to undo"). This usually results in a loss of productivity for those poor designers, or beta periods where bug-fixing is largely spent implementing things correctly. My friend's found his suggestions of writing (and testing against) specifications to be generally well received. Most of his colleagues have embraced the wonderful feeling of discovering false-assumptions on paper, instead of at 11pm on a Sunday in the middle of beta. Viva La Revolution! However there are a few who poo-poo anything that stands between their task and a keyboard. They laugh at the thought of actually designing anything, and write code with merry abandon. Mostly these are senior, long employed developers, reluctant to "waste time". The problem is that this second group of heretics invariably produce things (or at least something) quicker than the first. Subsequently this becomes justification along the lines of "It's pointless to write specifications for something as simple as an image resizer! Oh and those bugs where width!=height or the image uses RLE just need a few tweaks". And now the question :) Other than saying "told you so" at the end of a project, what are some good short-term ways to demonstrate how the practice of writing functional or technical specifications leads to better software in the long run? Cheers!

    Read the article

  • Fix common library functions, or abandon then?

    - by Ian Boyd
    Imagine i have a function with a bug in it: Boolean MakeLocation(String City, String State) { //Given "Springfield", "MO" //return "Springfield, MO" return City+", "+State; } So the call: MakeLocation("Springfield", "MO"); would return "Springfield, MO" Now there's a slight problem, what if the user called: MakeLocation("Springfield, MO", "OH"); The called it wrong, obviously. But the function would return "Springfield, MO, OH". The system was functioning like this for many years, until i noticed the function being used wrong, and i corrected it. And i also updated the original function to catch such an obvious mistake - in case it's happening elsewhere: Boolean MakeLocation(String City, String State) { //Given "Springfield", "MO" //return "Springfield, MO" if (City.Contains, ",") throw new EMakeLocationException("City name contains a comma. You probably didn't mean that"); return City+", "+State; } And testing showed the problem fixed. Except we missed an edge case, and the customer found it. So now the moral dillema. Do you ever add new sanity checks, safety checks, assertions to exising code? Or do you call the old function abandoned, and have a new one: Boolean MakeLocation(String City, String State) { //Given "Springfield", "MO" //return "Springfield, MO" return City+", "+State; } Boolean MakeLocation2(String City, String State) { //Given "Springfield", "MO" //return "Springfield, MO" if (City.Contains, ",") throw new EMakeLocationException("City name contains a comma. You probably didn't mean that"); return City+", "+State; } The same can apply for anything: Question FetchQuestion(Int id) { if (id == 0) throw new EFetchQuestionException("No question ID specified"); ... } Do you risk breaking existing code, at the expense of existing code being wrong?

    Read the article

  • Error handling in Rails Controller for adding embedded Mongoid documents to Model

    - by Dragonfly
    I have a Item model that has embedded documents. Currently, the following comments_controller code will add a comment to the item successfully. However, if pushing the comment document onto the comments array on item fails, I will not know this. #this does work, but i do not know if the push fails def create comment = Comment.new(:text => params[:text]) @item.comments << comment render :text => comment end I would like to have something like this, but @item.comments << comment does not return true or false: #this does not work def create comment = Comment.new(:text => params[:text]) if @item.comments << comment render :text => comment else render :text => 'oh no' end end Nor does it throw an exception when the document push fails: #this does not work def create begin comment = Comment.new(:text => params[:text]) @item.comments << comment render :text => comment rescue Exception => e render :text => 'oh no' end end Thanks!

    Read the article

  • LINQ - is SkipWhile broken?

    - by Judah Himango
    I'm a bit surprised to find the results of the following code, where I simply want to remove all 3s from a sequence of ints: var sequence = new [] { 1, 1, 2, 3 }; var result = sequence.SkipWhile(i => i == 3); // Oh noes! Returns { 1, 1, 2, 3 } Why isn't 3 skipped? My next thought was, OK, the Except operator will do the trick: var sequence = new [] { 1, 1, 2, 3 }; var result = sequence.Except(i => i == 3); // Oh noes! Returns { 1, 2 } In summary, Except removes the 3, but also removes non-distinct elements. Grr. SkipWhile doesn't skip the last element, even if it matches the condition. Grr. Can someone explain why SkipWhile doesn't skip the last element? And can anyone suggest what LINQ operator I can use to remove the '3' from the sequence above?

    Read the article

  • Jquery: Create hidden attributes? I need to reduce tag bulkyness.

    - by Dan
    I'm sure we've all done this before: <a id="232" rel="link_to_user" name="user_details" class="list hoverable clickable selectable"> USER #232 </a> But then we say, oh my, I need more ways to store tracking info about this div! <a id="232-343-22" rel="link_to_user:fotomeshed" name="user_details" class="groupcolor-45 elements-698 list hoverable clickable selectable"> User: John Doe </a> And the sickness keeps growing. We just keep on packing it inside that poor little element and it's attributes. All so we can keep track of who it is. So with my limited knowledge of JS, someone please tell me how to do something like this: <a id="33">USER #33</a> $(#33).attr({title:'User Record','username':'john', 'group_color':'green', 'element_num':78}); So here we just added what I would call invisible attributes, because we just played God and made those attributes up on the fly like it was no problem. The cool part is that these would be kept in their own little object somewhere in variable land. NOT in the tag itself. Then later on, in a code nested far far away, be able to say, oh, i wonder what group_color John is... user_group_color = $(table).find(a['username':'john']).attr('group_color'); THEN BAM!!!! POW!!!! alert(user_group_color + " is a bitchin color!"); You get to know his group color... all without adding a bunch of bloated element tracking nonsense into our tags. So does this sort of thing exist? If not, how do I make it?

    Read the article

  • php - replace array elements with another array's elements?

    - by Simpson88Keys
    Not sure how to go about this... But, I have two arrays, one with updated information, another with outdated information... There are a lot more elements in the second array, but I'm looking to "update" the outdated one with the updated information. Here's what the arrays look like: //Outdated Array ( [0] => Array ( [anum] => 3236468462 [cid] => 4899097762 [mid] => 1104881401 [na_title] => [na_fname] => JOHN [m_initial] => [na_lname] => DOE [na_suffix] => [na_addr1] => 1234 SAMPLE AVENUE [na_addr2] => [na_city] => NORWALK [state] => OH [zip] => [zip_plus_4] => [route] => R002 [dma_code] => 510334 ) ) //Updated Array ( [1] => Array ( [0] => YUD990 [1] => 98 [2] => 1234 Sample Avenue [3] => [4] => Norwalk [5] => OH [6] => 44857-9215 [7] => 3236468462 ) ) To clarify, I want to: (1) Match up the value for [7] from the updated array with the value for [anum] in the outdated array, and then update [na_addr1], [na_addr2], [na_city], [state], [zip], [zip_plus_4] in the outdated array with the values for [2],[3],[4],[5],[6] (I know I'll need to split the updated [6] in order to get it to map corrected to the outdated) Feel like I'm making this very confusing... sorry about that...

    Read the article

  • Passing Derived Class Instances as void* to Generic Callbacks in C++

    - by Matthew Iselin
    This is a bit of an involved problem, so I'll do the best I can to explain what's going on. If I miss something, please tell me so I can clarify. We have a callback system where on one side a module or application provides a "Service" and clients can perform actions with this Service (A very rudimentary IPC, basically). For future reference let's say we have some definitions like so: typedef int (*callback)(void*); // This is NOT in our code, but makes explaining easier. installCallback(string serviceName, callback cb); // Really handled by a proper management system sendMessage(string serviceName, void* arg); // arg = value to pass to callback This works fine for basic types such as structs or builtins. We have an MI structure a bit like this: Device <- Disk <- MyDiskProvider class Disk : public virtual Device class MyDiskProvider : public Disk The provider may be anything from a hardware driver to a bit of glue that handles disk images. The point is that classes inherit Disk. We have a "service" which is to be notified of all new Disks in the system, and this is where things unravel: void diskHandler(void *p) { Disk *pDisk = reinterpret_cast<Disk*>(p); // Uh oh! // Remainder is not important } SomeDiskProvider::initialise() { // Probe hardware, whatever... // Tell the disk system we're here! sendMessage("disk-handler", reinterpret_cast<void*>(this)); // Uh oh! } The problem is, SomeDiskProvider inherits Disk, but the callback handler can't receive that type (as the callback function pointer must be generic). Could RTTI and templates help here? Any suggestions would be greatly appreciated.

    Read the article

  • Getting a handle on GIS math, where do I start?

    - by Joshua
    I am in charge of a program that is used to create a set of nodes and paths for consumption by an autonomous ground vehicle. The program keeps track of the locations of all items in its map by indicating the item's position as being x meters north and y meters east of an origin point of 0,0. In the real world, the vehicle knows the location of the origin's lat and long, as it is determined by a dgps system and is accurate down to a couple centimeters. My program is ignorant of any lat long coordinates. It is one of my goals to modify the program to keep track of lat long coords of items in addition to an origin point and items' x,y position in relation to that origin. At first blush, it seems that I am going to modify the program to allow the lat long coords of the origin to be passed in, and after that I desire that the program will automatically calculate the lat long of every item currently in a map. From what I've researched so far, I believe that I will need to figure out the math behind converting to lat long coords from a UTM like projection where I specify the origin points and meridians etc as opposed to whatever is defined already for UTM. I've come to ask of you GIS programmers, am I on the right track? It seems to me like there is so much to wrap ones head around, and I'm not sure if the answer isn't something as simple as, "oh yea theres a conversion from meters to lat long, here" Currently, due to the nature of DGPS, the system really doesn't need to care about locations more than oh, what... 40 km? radius away from the origin. Given this, and the fact that I need to make sure that the error on my coordinates is not greater than .5 meters, do I need anything more complex than a simple lat/long to meters conversion constant? I'm knee deep in materials here. I could use some pointers about what concepts to research. Thanks much!

    Read the article

  • Developing Job References

    - by Joe Smith
    How do you develop references for jobs? I have 6 years of programming experience spanning two jobs, but sadly I don't have a lot of people I can draw on as references. It's been several years since I left my last job, which was at a small company, and I've lost touch with the few people I knew there. I now work at another small company. I think I've gone as far as I can in my current position, and would like to look for greener pastures, but I can't exactly use my current boss as a reference, even though I have a very good repore with him. I'm sure he'd make a great reference down the road, but I'm afraid I'd insult him or jeopardize my current job by mentioning that I'm thinking of leaving and would like him to help me. I've applied to some jobs, and I have gotten several replies like, "Oh, you're exactly what we're looking for. Send us a couple references and we'll schedule an interview. Oh, no references? You must be a psychopath, nevermind." I've tried doing some small freelance work on the side, just so I can have a contact who can vouch for my work, but the competition for even small projects is pretty fierce and I can rarely devote adequate time to freelancing while holding a full time job. In addition, I often encounter a Catch-22 where a lot of freelancing jobs also require references. So how do programmers maintain existing references and develop new ones, especially while holding a full time job?

    Read the article

  • Python Interactive Interpreter always returns "Invalid syntax" on Windows

    - by user559217
    I've encountered an extremely confusing problem. Whatever I type into the Python interpreter returns "Invalid Syntax". See examples below. I've tried fooling around with the code page of the prompt I run the interpreter from, but it doesn't seem to help at all. Furthermore, I haven't been able to find this particular, weird bug elsewhere online. Any assistance anyone could provide would be lovely. I've already tried reinstalling Python, but I didn't have any luck - the problem is also there in both 3.13 and 2.7. Running: Python version 3.1.3, Windows XP SP3. Getting: C:\Program Files\Python31>.\python Python 3.1.3 (r313:86834, Nov 27 2010, 18:30:53) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> 2+2 File "<stdin>", line 1 2+2 ^ SyntaxError: invalid syntax >>> x = "Oh, fiddlesticks." File "<stdin>", line 1 x = "Oh, fiddlesticks." ^ SyntaxError: invalid syntax

    Read the article

  • How do I install ant on OS X Mavericks?

    - by Robert Karl
    After upgrading to OS X 10.9 Mavericks, ant is no longer on my path. [126] 11:23:26 rkarl-mba-4:~/mobile-baselayer > ant zsh: permission denied: ant [126] 11:23:50 rkarl-mba-4:~/mobile-baselayer > which ant ant not found I tried installing through homebrew [126] 11:23:09 rkarl-mba-4:~/mobile-baselayer > brew install ant Error: No available formula for ant It's odd that homebrew doesn't have a formula for that.... After googling, I found this article, which suggested using a user's custom formula for brew. [1] 11:23:56 rkarl-mba-4:~/mobile-baselayer > brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/ant.rb curl: (22) The requested URL returned error: 404 Not Found Error: Failure while executing: /usr/bin/curl -f#LA Homebrew\ 0.9.4\ (Ruby\ 1.8.7-358;\ Mac\ OS\ X\ 10.9) https://raw.github.com/adamv/homebrew-alt/master/duplicates/ant.rb -o /Library/Caches/Homebrew/Formula/ant.rb Any help would be appreciated!

    Read the article

  • Accessing the output of a Bash pipe with 'read'

    - by Karthik
    I'm trying to pipe some data from a Bash pipe into a Bash variable using the read command, like this: $ echo "Alexander the Grape" | read quot $ echo $quot $ But quot is empty. Some Googling revealed that this is not a bug; it's an intended feature of Bash. (Section E5 in the FAQ.) But when I tried the same thing in zsh, it worked. (Ditto for ksh.) Is there any way to make this work in Bash? I really don't want to have to type: $ quot=$(echo "Alexander the Grape") Especially for long commands.

    Read the article

  • How to enable key forwarding with ssh-agent?

    - by Lamnk
    I've used the ssh-agent from oh-my-zsh to manage my SSH key. So far, so good, i only have to type the passphrase for my private key once when I start my shell and public key authentication works great. The problem is however that key forwarding doesn't work. There are 2 servers A & B which I can use public key to login. When I ssh into A then from there ssh into B, I must provide my password, which should not be the case. A is a CentOS 5.6 box, B is an Ubuntu 11.04 box. I have this on my local .ssh/config: Host * ForwardAgent yes OpenSSH on A is standard openssh 4.3 package provided by CentOS. I also enable ForwardAgent for ssh client on A, but forwarding still doesn't work.

    Read the article

  • XChat alternative on windows ?

    - by azazul
    I have been using xchat for years, but lately it hangs all the time ( i'm using silverex.org builds ). So i need a temporary alternative. Something with multiple server support. Oh .. and no , i won't use mirc.

    Read the article

  • home, end, delete, pageup, pagedown with ksh

    - by Nicolas
    Hello. I want to use home, end, delete, pageup, pagedown with ksh. My TERM is xterm-color. These keys works fine with tcsh and zsh, but not with ksh (print a tilda ~) I found this: bind '^[[3'=prefix-2 bind '^[[3~'=delete-char-forward bind '^[[1'=prefix-2 bind '^[[1~'=beginning-of-line bind '^[[4'=prefix-2 bind '^[[4~'=end-of-line But when I set one bindkey, the last does not work anymore. How can I use these keys in ksh with a .kshrc ? Thanks.

    Read the article

  • Take VMware VM State Home With Me

    - by Chris
    I work in VMs day in and day out, it's wonderful, encapsulating all the stuff I need for development in a contained unit. My question is: I want to be able to take my VM home with me, the problem is the VM is 30GB, and it takes about 30 minutes to copy that much data to my external HDD. Is it possible to somehow save the "state" of the VM, go home, and just resume it like a I would a laptop? Oh... almost forgot, I use VMware Workstation 6.5

    Read the article

  • HP Proliant Servers - WMI query for system health

    - by Mike McClelland
    Hi, I want to query lots of HP servers to determine their overall health. I don't want to use any packages, or even SNMP - I want to query the server health from WMI and understand if a box is Green/Amber/Red - just like the HP Management Home Page. This MUST be possible - but I can't find any documentation... Oh yes, and the servers are running Windows Server 2003/8. Help!! Mike

    Read the article

  • Online PIM Needed: EverNote + Cozi = ???

    - by Shoeless
    I am looking for an online solution with free-form note-taking ability like OneNote or EverNote, and also a robust calendaring system (tasks, repeating appts, notifications). Cozi has a great calendar but not much else... EverNote lasks the calendar side of things. Scrybe looks very promising on both fronts but is by invitation only. Oh yeah... it should be free, too :D Am I SOL?

    Read the article

  • Constantly diminishing free space on fedora 17

    - by Varun Madiath
    I don't know how to explain this other than to say that my computer seems to magically run out of free when it runs for a while. The output of df -h . oh my home direction is below /dev/mapper/vg_vmadiath--dev-lv_home 50G 47G 0 100% /home When I run sudo du -cks * | sort -rn | head -11 on /home I get the following output. I got this from decreasing free space on fedora 12 32744344 total 32744328 vmadiath 16 lost+found If I restart my system things seem to fix themselves and I'm left with about 20 or 25GB of free space. I'm running XFCE with XMonad as my window manager under fedora 17. Programs I'm running include the XFCE terminal, grep, find, firefox, eclipse, libre-office writer, zsh, emacs. Any help will be greatly appreciated. I'll gladly give you any other output you might need.

    Read the article

  • Batch convert *.avi files using ffmpeg

    - by Darius
    I am trying to convert 20+ .avi files in a batch using ffmpeg. I've got the following @echo off. for file in *.avi do ffmpeg -i "$file" -s 640x480 -vcodec msmpeg4v2 "'basename "$file" .avi'.mpg'; done in my .bat file but it does not work. How can I make it work under Windows OS. Oh, and yes all the files are in the same folder. The error message I get: File was unexpected at this time

    Read the article

  • How to add a MIME handler to Firefox and Internet Explorer from an installer

    - by JustSmith
    I'm looking to create an installer that will add a handler for a MIME type in Firefox and Explorer. The installer I will be using will be either INNO (a.k.a Oh Nooo!) or NSIS. I'm looking for for how Mozilla and Microsoft recommend adding the handler. So far all I have been able to find for Firefox is how to Add/Remove/Augment manually which no matter how simple is something I would like to hide from the user.

    Read the article

  • How to add a MIME handler to firefox and explorer from an installer

    - by JustSmith
    I'm looking to create an installer that will add a handler for a MIME type in Firefox and Explorer. The installer I will be using will be either INNO (a.k.a Oh Nooo!) or NSIS. I'm looking for for how Mozilla and Microsoft recommend adding the handler. So far all I have been able to find for Firefox is how to Add/Remove/Augment manually which no matter how simple is something I would like to hide from the user.

    Read the article

  • Hidden characters inserted after pipe (|) followed by a space

    - by nifty
    Very often, on my Mac, when I use the pipe (|) character followed by a space character, an invincible character will be inserted in between. This is especially annoying when using the terminal, as it makes commands invalid. If I type the following in iterm2, I often get the following: ls | cat zsh: command not found:  cat If I hit the up-arrow-key to get my previous command, and then remove and reinsert the space between | and cat, the command will work. When I copy paste the working and non working commands into a file, like this: non-working: ls | cat working: ls | cat and open it in Hex Fiend it shows the following: non-working: ls |¬†cat working: ls | cat I've also experienced the same kind of issue in SublimeText2 using the square brackets ([]) followed by a space. So I don't believe its an issue with iTerm2.

    Read the article

  • How to increase acpiphp slots?

    - by Eil
    Hi, Oh RHEL 5.5, there are 31 ACPI PCI hotplug slots by default: acpiphp: Slot [1] registered ... acpiphp: Slot [31] registered Is there a way to increase this number? I haven't been able to find an argument to supply to modprobe, or a sysctl knob to tweak, but I know there must be ways to get more slots based on some Google sleuthing. (For the curious, this is just preliminary experimentation to see how many virtual disks I can hot-add to a running KVM guest.)

    Read the article

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