Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

03-25-2017 , 01:04 PM
How does everyone put code like this on their blog??

** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-25-2017 , 01:23 PM
Quote:
Originally Posted by goofyballer
I think g_m's argument is solid in theory but encounters trouble in practice...
- if you need indentation of less than a full unit (i.e. maybe your tabs are set to 4 but when long lines spill over you try to match something w/ the line above or only indent 2, then...oops (say your tabs are set to 2 but you're trying to line something up with the line above 4 spaces in - if you do that indent w/ 2 tabs instead of 4 spaces, you run into the below problem immediately)
- this is more a problem with people who won't stick to tabs if that's what's agreed upon, but I've never seen a file with mixed tabs and spaces where the tabs didn't wind up making **** look really wrong as soon as you open it on a different tab setting than the person who wrote the tabs
I think you're missing the key element of the tabs argument: tabs are only for indentation, and spaces should still be used for alignment. I won't elaborate further - doing a google search for something along the lines of "tabs for indentation spaces for alignment" probably will result in better articles with pictures, so I won't try to duplicate that.

And of course, no system is really robust against people not agreeing to it and doing different things in a multi-user project.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-25-2017 , 04:21 PM
Spaces are clearly better than tabs because it's just way easier to keep things clean across many developers. It's one of those things where practical reality trumps theoretical arguments.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-25-2017 , 05:25 PM
Quote:
Originally Posted by saw7988
I think you're missing the key element of the tabs argument: tabs are only for indentation, and spaces should still be used for alignment. I won't elaborate further - doing a google search for something along the lines of "tabs for indentation spaces for alignment" probably will result in better articles with pictures, so I won't try to duplicate that.
No, I know what you're saying, it makes perfect sense - unless you're a tabs4lyfe kind of guy who's well practiced doing that right, though, I think it's easy to **** up, which has me on jj's side re: his above post.


Apropos of nothing, an article led me to this tweet that describes how I feel using JS:

** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2017 , 10:10 AM
If you want an example of yak shaving...

1. I needed some custom metal bars to mount bicycle mounts to my truck. I decided to make some.

2. I fire up the mill and start working. I have recently CNC converted it, but I was planning to do this work manually, using the keyboard to control it

3. I quickly got frustrated with this and decided to write a quick facing program

4. I realized during this that one of the axes in my CNC simulator was flipped and this was causing my arcs to go in the wrong direction

5. I start digging into the CNC simulator and hauling out my linear algebra textbooks. OpenGL is very frustrating in the sense that if you **** up, often you won't see anything at all

So like 10 hours later now I have my axes straight. Now, where are those ****ing yaks?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2017 , 11:53 AM
Quote:
Originally Posted by jjshabado
Spaces are clearly better than tabs because it's just way easier to keep things clean across many developers. It's one of those things where practical reality trumps theoretical arguments.
I'll admit bias here as the makefiles and assemblers that I used at the start of my professional career both required tabs to work. Spaces would literally break them (as would symbol names greater than 8 characters long).

As fun as it is to jump into a holy war, it's better for a team just to agree on a standard and follow it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2017 , 08:49 PM
Quote:
Originally Posted by RustyBrooks
If you want an example of yak shaving...

1. I needed some custom metal bars to mount bicycle mounts to my truck. I decided to make some.

2. I fire up the mill and start working. I have recently CNC converted it, but I was planning to do this work manually, using the keyboard to control it

3. I quickly got frustrated with this and decided to write a quick facing program

4. I realized during this that one of the axes in my CNC simulator was flipped and this was causing my arcs to go in the wrong direction

5. I start digging into the CNC simulator and hauling out my linear algebra textbooks. OpenGL is very frustrating in the sense that if you **** up, often you won't see anything at all

So like 10 hours later now I have my axes straight. Now, where are those ****ing yaks?
bunch of solid brags here, not least of which is owning a mill.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2017 , 09:38 PM
In ruby if i do

(1..3).each do |x|

x ** 2

end

this will do

1 ** 2, 2 ** 2, 3 **2

but how do rewrite this code so that 3 + 4 + 9 are added up and 16 is returned?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2017 , 09:42 PM
you mean 1 + 4 + 9?

(1..3).inject {|sum, x| sum + x ** 2}
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2017 , 09:59 PM
thx
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2017 , 10:12 PM
Quote:
Originally Posted by gaming_mouse
bunch of solid brags here, not least of which is owning a mill.
Is it in the living room?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 05:38 AM
Quote:
Originally Posted by RustyBrooks
If you want an example of yak shaving...

1. I needed some custom metal bars to mount bicycle mounts to my truck. I decided to make some.

2. I fire up the mill and start working. I have recently CNC converted it, but I was planning to do this work manually, using the keyboard to control it

3. I quickly got frustrated with this and decided to write a quick facing program

4. I realized during this that one of the axes in my CNC simulator was flipped and this was causing my arcs to go in the wrong direction

5. I start digging into the CNC simulator and hauling out my linear algebra textbooks. OpenGL is very frustrating in the sense that if you **** up, often you won't see anything at all

So like 10 hours later now I have my axes straight. Now, where are those ****ing yaks?
ya I just run my mill and lathe manually. much faster.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 09:34 AM
Quote:
Originally Posted by OmgGlutten!
In ruby if i do

(1..3).each do |x|

x ** 2

end

this will do

1 ** 2, 2 ** 2, 3 **2

but how do rewrite this code so that 3 + 4 + 9 are added up and 16 is returned?
Quote:
Originally Posted by iversonian
you mean 1 + 4 + 9?

(1..3).inject {|sum, x| sum + x ** 2}
I prefer:

Code:
(1..3).map{|x| x**2}.reduce(:+)
Even though it has an extra step, it maps conceptually better onto how you likely think about it. A list, all the numbers of that list getting squared, then the sum.

and to cleanse ourselves of that verboseness, here it is in J:

Code:
+/*:1 2 3
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 10:36 AM
Quote:
Originally Posted by gaming_mouse
bunch of solid brags here, not least of which is owning a mill.
Yeah, having one is nice. I started in wood working 20 years ago and found that I often wanted/needed small metal parts. Getting into metal working was a type of yak shaving of it's own.

Quote:
Originally Posted by suzzer99
Is it in the living room?
Maybe after my wife leaves me

Quote:
Originally Posted by Victor
ya I just run my mill and lathe manually. much faster.
Actually, properly programmed, it's way faster to run it with CNC. The machine will do feed rates up to about 200 inches/minute (not that it can cut anything at that speed) and it can also do a lot of things that are very hard to do manually, like easing into cuts, using high-speed machine techniques, etc. Also, you can cut down on the huge time suck, which is tool changes.

I'm running it as a semi-automated mill. Some things are completely programmed but for any project you have a bunch of stuff that needs to be done manually, like squaring stock. I have "wizards" that I wrote for a lot of that stuff.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 03:44 PM
Guys, super noob questions here. My day job isn't software development, but I do a lot of it as a hobby on the side - right now mostly in the form of game dev, but not exclusively. I've never used a version control system before, and it's never bitten me in the ass, but I figure there's no point in waiting for that to happen when I've known the whole time that I should be using one.

What's the recommendation here? I've read a bit about svn vs git and it seems like git is the more loved one, but I'm not sure if being a solo dev (vs team) changes anything. Also, it seems like there's different specific implementations I can choose after that. GitHub and BitBucket? Others? Also, are these online storage or just local management tools?

Any help here would be appreciated!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 03:58 PM
use git because it's ubiquitous. it's pretty standard for most open-source projects. some large companies use others, but if you want to collaborate with randoms on the internet, git is the way to go. even if it's just for yourself for a tiny project, it's probably better to learn git in case you work in software dev later.

github and bitbucket are services that host your repository for you. bitbucket has a free tier while github is only free if it's also public. github is more widely used and has a better brand and its interface is familiar to more people. but that doesn't really matter if it's just for yourself.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 03:58 PM
Quote:
Originally Posted by RustyBrooks


Actually, properly programmed, it's way faster to run it with CNC. The machine will do feed rates up to about 200 inches/minute (not that it can cut anything at that speed) and it can also do a lot of things that are very hard to do manually, like easing into cuts, using high-speed machine techniques, etc. Also, you can cut down on the huge time suck, which is tool changes.

I'm running it as a semi-automated mill. Some things are completely programmed but for any project you have a bunch of stuff that needs to be done manually, like squaring stock. I have "wizards" that I wrote for a lot of that stuff.
you are right ofc, esp for complicated cuts.

but I would imagine for simple stuff its a bit quicker to just toss it on there and run it few times by hand rather than write out a program, test it, and then run it.

anyway, I had a job with a mill and lathe way back. was fun to make stuff.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 04:17 PM
Quote:
Originally Posted by iversonian
use git because it's ubiquitous. it's pretty standard for most open-source projects. some large companies use others, but if you want to collaborate with randoms on the internet, git is the way to go. even if it's just for yourself for a tiny project, it's probably better to learn git in case you work in software dev later.

github and bitbucket are services that host your repository for you. bitbucket has a free tier while github is only free if it's also public. github is more widely used and has a better brand and its interface is familiar to more people. but that doesn't really matter if it's just for yourself.
+1 to all this
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 04:25 PM
Quote:
Originally Posted by JustASpectator
I stumbled across a John Conway video on Youtube, and I had a flashback to my high school Qbasic programming class (so yeah, high school was a while ago for me). It was probably the coolest class I took in high school, because although we had a textbook, our assignments were basically to write what we felt were cool/interesting/useful programs and show them to the teacher. Sometimes we had some general guidance, but mostly it was up to us.

And I remembered that one of the programs I had written was a Conway's Game of Life simulator. And I remembered that it ran like crap, and I'm pretty sure I had some of the rules wrong also.

So today I spent a couple hours writing a working version from scratch in Qbasic. Which probably sounds like a painful chore. But it felt really good to complete something like that after all these years.
So after doing the above I've been bit with the retro programming bug. I had several Visual Basic 6.0 programs that were anywhere from partially done to quasi-complete, sitting untouched for nearly 20 years on my development server. I started them around the time I took a VB class in college, and these were just side things I wrote back then to make use of some of the things I was learning.

One was an Arkanoid type game, where I had some really funky collision detection between the ball and the blocks, resulting in the occasional "ball bounces off a block but the block doesn't disappear" type scenarios. Totally uncommented code, of course. And a Gosub without a consistent return, along with a block IF statement with a totally misplaced End IF that somehow still allowed the program to function. There was a lot of SMH going on when reviewing it... So the first thing I had to do was figure out WTF the code was doing, and then I wiped pretty much everything out and rewrote it in a much cleaner way, and got it finished. Felt pretty good.

Next was a game of Mastermind where I had it pretty much done, except I didn't have code to start a new game, and I didn't have a drag icon set for when you drag a peg onto the board, and the peg graphics in general were effed up and needed to be redone.. Minor stuff, but good to get it done.

The final one was a Minesweeper clone. I can still remember where I was sitting when I started this program in class, but I got stuck trying to work through the logic of, when a user clicks a box that has 0 neighboring mines, go through and uncover all neighboring boxes that also have 0 neighboring mines, and also uncover the edges of this region. The inability to figure that out at the time caused me to give up on the program completely. So when I looked at it again a few days ago, I was in the same boat. But after a little bit of thought, I came up with a straightforward process to do this that I was able to implement. This one felt the best to complete, since it was essentially me figuring out something that had stumped me for 18 years (although I hadn't given it any conscious thought for probably 17.99 of those years).

Anyone else go back and work on unfinished programs from decades ago?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 04:36 PM
Quote:
Originally Posted by gaming_mouse
+1 to all this
I work for hyper-global-megacorp, and even they've almost completely converted to git. It's just so clearly better than old school version control w/o pull requests and local repositories.

For reference - we still have internal websites that only work with IE 7.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 04:39 PM
Quote:
Originally Posted by iversonian
use git because it's ubiquitous. it's pretty standard for most open-source projects. some large companies use others, but if you want to collaborate with randoms on the internet, git is the way to go. even if it's just for yourself for a tiny project, it's probably better to learn git in case you work in software dev later.

github and bitbucket are services that host your repository for you. bitbucket has a free tier while github is only free if it's also public. github is more widely used and has a better brand and its interface is familiar to more people. but that doesn't really matter if it's just for yourself.
Quote:
Originally Posted by suzzer99
I work for hyper-global-megacorp, and even they've almost completely converted to git. It's just so clearly better than old school version control w/o pull requests and local repositories.

For reference - we still have internal websites that only work with IE 7.
Cool thanks!!!

I'm thinking I'll get going with BitBucket asap since I don't really want all my stuff public. This sounds perfect
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 05:05 PM
git is one of the modern miracles of software engineering.

Its history is basically:
  1. Linus stops using BitKeeper cause its no longer free
  2. Linus takes a look at other VCS's and figures they're all crap so why not write his own
  3. Five days later he has a working version that's self hosting
  4. A month later he's basically made something that surpasses every other VCS in speed, features and stability
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 05:24 PM
How similar was/is BitKeeper to git?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 05:40 PM
it has distributed repos, that's all I know.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2017 , 05:46 PM
Sounds like you can run your own server if you want to keep your code private without paying the monthly fee, according to the Google.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m