« first day (271 days earlier)      last day (4683 days later) » 

11:10 PM
This is a pretty geek revealing question, but has anyone ever seen a truly transcendent, beautiful example of a class structure, where inheretence and polymorphism where structured in such and effortless, clear way that it changed your coding style?
 
what normal people call a "life changing experience"? :p
 
Yes.
 
I woudnt say there is any one example, the way I code now is as a result of taking the bits i thought were well done in bits 'n pieces ive read
 
Hey all, how would you have an external button (as in from radio shaclk
) interact with a program?
 
@JShoe was nice 'n easy back when everything had serial/parallel ports...no idea now
perhaps via a microcontroller with built in support for talking to USB?
 
11:16 PM
@JShoe you could try something like this instructables.com/id/USB-Easy-Button
 
Thanks both! I'll check it out @josh
 
I can say a pretty interesting usage of encapsulation is in the Crypto++ library
He definitely took the concepts of sources and sinks to the next level; the first time I used it I thought it was pretty obtuse, until I realized it was pretty efficient way to "pipeline" a bunch of transformations
 
@JShoe you can use a serial port
run a program that loops and prints to the serial port
if you connect pins 2 and 3 on the serial cable, characters will echo back to your program
otherwise you will read back nothing
 
Okay I understood none of that. What @portforwardpodcast ?
 
@portforwardpodcast Really, you can just hook a NO switch to pins 2 & 3 and poll for status like that?
 
11:26 PM
All I want is when I press a button, in c++ x now = 1
 
I don't know what a "NO" switch is
however if you short 2 and 3 with a wire
it works
 
@portforwardpodcast Sorry, Normally Open
 
yes @Josh
 
That's pretty cool; I'm going to try that out right now
 
computers dont have serial ports these days though
 
11:27 PM
you can short with a standard jumper
 
Hey guys, what would that do exactly? Still lost...
 
@JShoe with the switch not pressed
you print a character to the serial port and read nothing back
when the switch is pressed
you will read back every character you press
 
Would it be better to use a resistor of some kind? I assume the current doesn't matter, you are just pulling it +12 high, right?
 
not press, but send
I would say 100 to 1000 ohm would be fine
 
And could I use that to get x to equal 1?
 
11:28 PM
i can verify
 
Sweet
brb
 
@Jshoe yes
 
And would that at all work with usb?
 
no...serial
serial port is really old
 
wow
works like a champ - that's a neat hack - thanks :)
 
11:30 PM
How do I get it so when a button plugged into a USB port is pressed, x = 1?
 
no worries! I will podcast about this next week, now that you reminded me
 
I actually used a 10k resister, it was the first I grabbed and figured what the hell
 
nice!
I'm glad you appreciate the hack @Josh
 
It was in my random pile, no digging through the bags
 
u must be hardware guy
 
11:31 PM
Well, hobbyist
 
Anyone? x = 1 usb button?
 
Hacker by day, amateur magic smoke releaser by night
 
@JShoe look at the link that @Josh sent you! :)
nice dude i work for an embedded systems company
 
The instructable one? I'm on a mac.
 
Cool - like ALIX?
@JShoe Have you seen this? superuser.com/questions/269039/…
 
11:36 PM
No, but I'm on a mac
 
@JShoe What difference does that make?
I don't own a Mac, but I assume HID input must be the same.
 
with a fun video of me!
 
So the instructable link should work?
 
@portforwardpodcast Looks like a fun job
I imagine you spend a lot of your paycheck at SparkFun or Adafruit :)
It's funny - my mom got me a parallax acoustic sensor for Xmas
 
So the instructable link should work? @Josh
 
11:42 PM
I didn't ask for it, and she didn't even know what it was....
@JShoe I would imagine it would either work or require very little changes
 
But what it wants you to do is make it so it opens a program for you. I just want to be able to interact with it in c++. how would I do that?
 
@josh very nice. haha i actually am an ios dev by night
embedded stuff is just my day job :)
use your sensor for good!!!
 
And also, eventually, I don't want to use an easy button, I want to use a blank one @josh
 
@portforwardpodcast Yeah, I'm still trying to figure out a cool project for it
@JShoe You could probably buy a cheap USB numeric keypad, strip out the circuitry, and wire up a switch to the contact pad. Put the whole thing in a little project box, call it a day.
 
I agree with josh
usb keyboard is the best approach
 
11:47 PM
What's a contact pad? And then would it be c++ interfaceable @Josh
?
 
@JShoe have you ever taken a keyboard apart before?
 
@portforwardpodcast No. And then would it be interfaceable if I did whatever you guys are talking about?
 
@JShoe The advantage with the KB is you could test it out with a little console program or the mac equivalent of notepad. You wouldn't have to write USB specific software at the same time you were hardware hacking for the first time.
 
@Josh All I want is to make x = 1. Do I really need to strip a keypad, rewire it, and test it? I just want to change a sibngle value. How would I do that?
 
@JShoe I think, unfortunately, you are missing a lot of foundational knowledge to answer that question. I don't want to come across as condescending, but if you are asking me how to hook up a peripheral to your mac to change a local variable in an arbitrary program, there is a LOT you are missing in between.
 
11:52 PM
@Josh Okay how do I learn that? I don't take it as condescending at all, I have no idea what I'm doing, but you just described it perfectly. So where do I learn?
 
At like a 10000 foot level, you need some way to communicate with the hardware, and then you have to have some way of setting the variable in your code (which you probably wouldn't want to do, I think what you are trying to accomplish is responding to an event)
 
@JShoe you want a button in the physical world. A keyboard already has a chip onboard which has input switches on one side, and a usb port on the other. It's perfect
 
You are not going to communicate directly with hardware using vanilla C++. You need to interface with some OSX API that I am not aware of.
 
are you using xcode?
 
I don't want to respond to an event, I want to change a variable, so if x = 1, then the bvutton has been pressed.
I... Will have xcode soon.
 
11:55 PM
(pressing the button is the event)
 
Well, the event is how you are going to set x.
 
i feel retarted right now @Josh
 
Oh. Then yes I want an event response. So how do I do that if I were using a USB keypad.
?
 
Well, I cannot help you with OSX specific stuff - I simply am not familiar with it.
 
It's more interaction with the program! With the IDE. Shouldn't that be cross-platform?
 
11:57 PM
Well, the way I was originally recommending would make it appear that someone was pressing a specific key on your keyboard
 
Okay, how would I do that?
 
google for it!
 
Ok. Here is what I would do if I were in you shoes.
 
in J's shoes? har har
 
I don't know what I would google.
 
11:59 PM
and yes, I would be using google quite a bit.
Yes, in JShoe's shoes.
Find out what you need to do to subscribe to a key press event.
 

« first day (271 days earlier)      last day (4683 days later) »