|
TooMuchAbstraction posted:Sorry, my bad: I saw "char" and leapt to thinking about strings instead of remembering that it's another term for "byte". It's Friday and I'm, evidently, more tired than I'd realized. If y'all are interested in a deep dive into what you could do with 4-byte floats and 8-byte doubles that only hold integers, the Underhanded C winner was recently announced with a very good writeup.
|
# ? Feb 6, 2016 02:48 |
|
|
# ? May 18, 2024 01:46 |
|
Can anyone suggest a resource for legal issues surrounding programming, specifically intellectual property? My partner and I are in the very early stages of developing a kind of consultancy data analysis project. We have a "client" who's giving us data that we can use to develop our ideas, and they want us to sign something like an NDA. It's quite reasonable that we don't share their data, or the results of our analysis, but we don't want to accidentally give them rights to our actual project or be prevented from working with their competitors in the future. As a complicating factor, this is all international and I'll be relying on translation (my partner speaks their language). The right answer is probably to ask a lawyer, but we don't even have a budget. Is there some kind of primer out there we can read so we're at least aware of the basic issues?
|
# ? Feb 7, 2016 03:10 |
|
I'm sure you can find several lawyers who will give you 30-60 minutes of their time to see if you want to become their client. You probably shouldn't go around to every firm in town abusing that introductory time, but if you're upfront with them I'm sure you can get some advice and maybe know who to turn to down the road.
|
# ? Feb 7, 2016 05:48 |
|
That makes a lot of sense, don't know why we didn't consider that.
|
# ? Feb 7, 2016 06:02 |
|
HappyHippo posted:Fun fact about unions: writing to one field and then reading off the other is technically "undefined behaviour," even though it'll probably work in most modern compilers. Here's some random post I found on the internet which basically concludes that the memcpy solution is the best one. A good blog to follow if you like the subject. Lots of stuff on safety in C with a focus on using modern tools.
|
# ? Feb 8, 2016 07:01 |
|
I'm trying to learn C in my downtime at work, and I'm doing ok with the first chapter I guess, but a lot of the exercises I get stumped on and have to look at some solutions to see what they are even looking for. Is the entire book going to be hard for me and should I maybe look at a more introductory book? I'm not completely new to reading and writing code but the stuff I've done has been primarily HTML and CSS, really basic stuff that isn't as logically intensive. E: I'm reading K&R C Programming Language 2nd ed. crunk dork fucked around with this message at 17:34 on Feb 8, 2016 |
# ? Feb 8, 2016 17:31 |
|
crunk dork posted:I'm trying to learn C in my downtime at work, and I'm doing ok with the first chapter I guess, but a lot of the exercises I get stumped on and have to look at some solutions to see what they are even looking for. Is the entire book going to be hard for me and should I maybe look at a more introductory book? Why C? Going to that directly from HTML/CSS (i.e. not an actual imperative programming language) is going to be pretty rough compared to, I dunno, Python.
|
# ? Feb 8, 2016 17:56 |
|
I had it in my head that learning a lower level language first would help me understand more of the building blocks of a higher level language but maybe I'm thinking backwards? I've got a book on Python from Oreilly as well but haven't touched it yet.
|
# ? Feb 8, 2016 18:01 |
|
crunk dork posted:I had it in my head that learning a lower level language first would help me understand more of the building blocks of a higher level language but maybe I'm thinking backwards? I've got a book on Python from Oreilly as well but haven't touched it yet. Are you familiar with JavaScript? Maybe start doing some more involved JS work, and go from there. At least with JS, you'll be able to make connections to your HTML/CSS work and see practical value, instead of it all being abstract & theoretical. If you DO have some JS experience and want to broaden from there, check out C#/Java. It's a more strongly typed language, but still does things like garbage collection and memory management for you. Jumping straight into C is a big jump, and probably won't be providing much of a benefit to your actual job for some time.
|
# ? Feb 8, 2016 18:24 |
|
crunk dork posted:I had it in my head that learning a lower level language first would help me understand more of the building blocks of a higher level language but maybe I'm thinking backwards? I've got a book on Python from Oreilly as well but haven't touched it yet. It will once you learn your first language first. I'd head to Javascript land if you are doing HTML/CSS. Then either K&R or the Python book. Going full C you are basically being dumped out in the middle of the Pacific ocean instead of the deep end of the pool. EDIT: ^^^ Argh beat but yeah C is hard to get into and not very useful for most work.
|
# ? Feb 8, 2016 18:24 |
|
Right on guys. I don't actually do HTML/CSS for work but instead used to do it as a hobby kind of. I do more IT network admin type stuff at my job and am trying to get into infosec and pentesting so that's why I'm trying to learn, if that has any bearing on suggestions.
|
# ? Feb 8, 2016 18:32 |
|
crunk dork posted:Right on guys. I don't actually do HTML/CSS for work but instead used to do it as a hobby kind of. I do more IT network admin type stuff at my job and am trying to get into infosec and pentesting so that's why I'm trying to learn, if that has any bearing on suggestions. I would suggest starting with C#/Java/Python then. Mainly C#, but that's just me. Microsoft has really turned over a new leaf and the .net framework is looking very good lately, but all three of those you should be able to jump into a lot easier than C and will be exposed to almost all important CS concepts.
|
# ? Feb 8, 2016 18:35 |
|
crunk dork posted:Right on guys. I don't actually do HTML/CSS for work but instead used to do it as a hobby kind of. I do more IT network admin type stuff at my job and am trying to get into infosec and pentesting so that's why I'm trying to learn, if that has any bearing on suggestions. Of the people that I know that do pentesting, none of them use C. They mostly use collections of python/perl scripts that have evolved to support different use cases throughout the years. I think C# is a great language (though I'm biased because I use it everyday), but I don't know that it's going to help you much in the fields you're aiming for.
|
# ? Feb 8, 2016 20:34 |
|
I don't see why he shouldn't learn C if he wants to, or indeed why he couldn't learn it from K&R2. I did, and lord knows I'm not the brightest star in the night sky. Maybe skip some of the exercises as there are a lot of difficult ones and instead keep on reading. Go back to them later when you have a better understanding if you want, but it's probably more fun to work on something of your own devising. One tip I guess is to read very carefully and re-read parts since the book is much more terse than a lot of other programming books (my copy's chapter on pointers and arrays is noticeably more yellowed from wear than the rest of the book).
|
# ? Feb 9, 2016 01:06 |
|
K&R 2nd edition was my first programming book as well. It works just fine and, indeed, working on their exercises and mastering C concepts such as pointers will make a lot of tricky concepts seem trivial in the future("Is Java pass by reference or pass by value?"). I don't think it's the most fun or efficient way to learn a real programming language, but it totally works, even for a total beginner. I have 2 Python books from O'Reilly. One is Learning Python, the other is Programming Python. Programming Python is an awesome book that is totally not suitable for beginners. Learning Python I have mixed feelings about. They do deep dives into every single basic Python language feature in order. That's very informative as a reference for a beginner, but it's not necessarily a book you can read cover to cover to learn Python.
|
# ? Feb 9, 2016 01:15 |
|
The Python thread normally recommends Think Like a Computer Scientist or Learn Python the Hard Way.
|
# ? Feb 9, 2016 01:39 |
|
Neslepaks posted:I don't see why he shouldn't learn C if he wants to, or indeed why he couldn't learn it from K&R2. I did, and lord knows I'm not the brightest star in the night sky. No one is saying he can't, but his original post mentioned he was getting stumped and asked for suggestions on a better way. Going from almost zero programming experience to straight C without any formal CS or math background is tough, and something like C# or Python would probably be easier.
|
# ? Feb 9, 2016 02:48 |
|
crunk dork posted:Right on guys. I don't actually do HTML/CSS for work but instead used to do it as a hobby kind of. I do more IT network admin type stuff at my job and am trying to get into infosec and pentesting so that's why I'm trying to learn, if that has any bearing on suggestions. If you're looking at pentesting your best bets are python and ruby so you can write metasploit modules.
|
# ? Feb 9, 2016 03:46 |
|
Think I'm going to put the breaks on C for now after all the input and dig into the python book I have. Thanks all for the advice
|
# ? Feb 9, 2016 12:38 |
|
Does anyone have any knowledge of using document cameras with some command line/programming interface and not the document camera's own software (maybe using OpenCV or something of the ilk)? Our use case is getting the data from a camera and would hopefully import the png image from the camera into a python application to undergo further processing. Pretty much all of the things I've seen are for regular cameras and then document cameras only talk about their own software to use it.
|
# ? Feb 10, 2016 18:11 |
|
Master_Odin posted:Does anyone have any knowledge of using document cameras with some command line/programming interface and not the document camera's own software (maybe using OpenCV or something of the ilk)? Our use case is getting the data from a camera and would hopefully import the png image from the camera into a python application to undergo further processing. Pretty much all of the things I've seen are for regular cameras and then document cameras only talk about their own software to use it. I've only used the c++ bindings, but reading from a camera in opencv is fairly non-terrible. You just instantiate a cv::VideoCapture object (with an integer index indicating which camera you want), and then just call the .read method to populate a cv::Mat. Depending on your camera you might need to .set() parameters on the object. It's pretty easy, just give it a go and see what happens.
|
# ? Feb 11, 2016 00:32 |
|
Neslepaks posted:I don't see why he shouldn't learn C if he wants to, or indeed why he couldn't learn it from K&R2. It's a base to go to something like C# or Objective-C if he wanted to, though.
|
# ? Feb 11, 2016 15:47 |
|
Bob Morales posted:The only 'bad' thing with C is that these days it's hard to 'make something' with just C I mean, if he eventually wants to do systems or embedded stuff, C is still pretty useful, but outside of that you probably want something with a strong framework built in, yeah.
|
# ? Feb 11, 2016 16:25 |
|
So recently me and some programmer friends were talking about the new idiotic operator font: http://www.engadget.com/2016/02/09/operator-font-hoefler-co/ To sum it up, yes that is an ugly rear end font selling for $200 marketted towards programs which uses both cursive and non-cursive fonts seemingly at random and it is loving god awful in terms of readability. So I was wondering, does anyone have any font recommendations? I just use atom as my editor and whatever its default is I find incredibly readable.
|
# ? Feb 11, 2016 21:58 |
|
Monaco and Inconsolata are my two favorites for coding, but I use Letter Gothic Powerline in the terminal
Sinestro fucked around with this message at 22:06 on Feb 11, 2016 |
# ? Feb 11, 2016 22:01 |
|
Source Code Pro
|
# ? Feb 11, 2016 22:10 |
|
Terminus
|
# ? Feb 11, 2016 22:43 |
|
comic sans.
|
# ? Feb 11, 2016 22:48 |
|
If on Windows then Consolas, if not on Windows then steal Consolas from an available Windows machine (or use DejaVu Sans Mono).
|
# ? Feb 11, 2016 22:57 |
|
I use Consolas everywhere.
|
# ? Feb 11, 2016 23:25 |
|
Thermopyle posted:Source Code Pro This is the only correct answer. If on OS X use the powerline version.
|
# ? Feb 12, 2016 00:50 |
|
Menlo Inconsalata Anonymous Pro Consolas Lucida Console
|
# ? Feb 12, 2016 13:04 |
|
I'm banging my head against Haskell's typeclasses and instances. I've read the chapters on Learn You A Haskell and Real World Haskell and I thought I understood how these things are supposed to work, but evidently I understand nothing. Let's say I'm trying to make a typeclass for large numbers. A number is large if it's an Int with a value of over 10 000. code:
Trying something like code:
And if I try to kludge it by saying code:
I must be miles away from the correct solution, but I just can't figure out how this is supposed to work.
|
# ? Feb 12, 2016 17:23 |
|
You're going to want something more likecode:
|
# ? Feb 12, 2016 17:28 |
|
Asymmetrikon posted:You're going to want something more like OK, thanks! That helps some. I'm still getting the same "No instance for (Num a) arising from the literal 10001" errors when I'm trying to test this, though.
|
# ? Feb 12, 2016 17:41 |
|
That's because 10001 isn't an Int (automatically), it's an Integer - the arbitrary precision number integer type (yes, this is confusing - Haskell has some baggage it can't shake off.) Either you really want an instance of LargeNumber for Integers, or you need to make sure the numbers you're checking are Ints. code:
|
# ? Feb 12, 2016 18:05 |
|
Asymmetrikon posted:That's because 10001 isn't an Int (automatically), it's an Integer - the arbitrary precision number integer type (yes, this is confusing - Haskell has some baggage it can't shake off.) Yeah, this poo poo keeps tripping me up constantly in Haskell and it's horribly frustrating trying to navigate a maze of similar but not replaceable types and values. Right, so that works then. But if I try "isLarge -5" or indeed any negative number, I get a "Non-type variable argument" error, however "isLarge (-5)" produces the expected result. So I guess if I don't enclose negative Integers in brackets, Haskell interprets the - symbol as the mathematical subtraction operation? I gotta say this poo poo isn't intuitive at times E: I mean if I was REALLY GOOD at Haskell, it would probably be an incredibly powerful and elegant language, but right now it's immensely frustrating. 95% of my time seems to be spent trying to cajole types so that Haskell likes them.
|
# ? Feb 12, 2016 18:18 |
|
Der Shovel posted:Yeah, this poo poo keeps tripping me up constantly in Haskell and it's horribly frustrating trying to navigate a maze of similar but not replaceable types and values. Yeah the - thing is a thing that trips up a lot of people new to Haskell. It's pretty isolated though, - is the only unary operator in Haskell and the choice, while annoying, makes the rest of the syntax in the language more clear and consistent. Back to your other problem, you can also do code:
code:
|
# ? Feb 12, 2016 18:36 |
|
It's a precedence issue - if you try to execute "1 + -1", it also won't work. (-) is both the unary negation and the subtraction operator, so "-5" is really "(-) 5". You can do something like "isLarge $ -1" (the dollar sign is a low-binding application operator - basically a left paren that stretches to the end of the expression), or the parentheses, but there's never really much call for putting literals like "-100" directly in a bigger expression, so it doesn't end up being a big problem.
|
# ? Feb 12, 2016 18:37 |
|
|
# ? May 18, 2024 01:46 |
|
If the types are tripping you up, and you aren't married to Haskell itself, you could try learning Elm. It's pretty similar in the basics, and it has a lot more sane basic types.
|
# ? Feb 12, 2016 18:38 |