This is an annoying post so sorry, but any recs for fun projects/websites/etc. to use for learning Java the first time? I took a few classes on it in college and was not feeling it but I'd like to give it another chance.
Speaking of converting recursive functions, it's only possible to use trampolines if the function itself is tail recursive right? Like I've never seen an example of one that wasn't and I couldn't figure it out for a simple flatten function which lead me to believe this was the case.
Speaking of converting recursive functions, it's only possible to use trampolines if the function itself is tail recursive right? Like I've never seen an example of one that wasn't and I couldn't figure it out for a simple flatten function which lead me to believe this was the case.
Well, trampoline use on tail-recursive functions is trivial, so it's normal that examples are based on this. But you can use trampolines for more things than just avoiding the risk there's no TRE.
I'd say that since you can transform any recursive function into a tail-recursive function, you basically can use trampoline for everything. But it will require sometimes a LOT of rewriting, and the result may not be efficient.
HLA is not even a real programming language. It's a higher level version of assembly created in order to teach real assembly. Is your ultimate goal actually to learn assembly?
HLA is not even a real programming language. It's a higher level version of assembly created in order to teach real assembly. Is your ultimate goal actually to learn assembly?
I have a tech blog, and I had an idea of writing a series of articles explaining the basic history of programming and advanced usage of PCs, starting with one about about the Command Line Interface's history. Can anybody here recommend some good sources of information of that?
Assembly is just kind of a mindfuck when you're first learning it. It's like saying "well duh, of course 3 + 7 is 10" and then someone asking you "yes, but why? Can you derive it from first principles?" and you don't even know where to begin because how can you get any more basic?
I heard some people like this book, but I haven't read it so I can't really say for sure.
Best advice I can give you is to just not think about translating C to assembly and vice versa. Think about it as a completely different beast. Just learn the instruction set, and learn how to address memory, learn about stack frames, and try to write trivial programs that, for example, loop from 1 to 10 printing each number on a new line, etc. Things like that.
Eventually when you start becoming more familiar, compile some simple C programs and then disassemble them in an advanced debugger that has mixed C / assembly source listings, and see if you can make sense of why each instruction was converted the way it does, or at least convince yourself that the assembly does in fact represent the C code shown.
Maybe it's because I've begun with really early languages (such as Basic 1.0), but Assembly has always seemed the most natural thing to me, and the easiest language to learn.
Of course, there's plently of strange things if you want to optimize things (like the LEA dirty tricks on x86 to do fast multiplications), but still...
idk, the analogy works well for me. It's hard to turn "3+7 = 10" into a rigorous sequence of steps involving the peano axioms, just like it's hard to turn "while (x > 5) { printf("%d", x); }" into a series of 10 or 15 assembly language instructions that are detached from the bigger picture.
In a way, assembly language is like the "axioms" of machine code (i.e. the lowest level operations you can perform), and you have to string together long sequences of them to get results that you can reason about at a high level.
If you want to learn about assembly, build an emulator. The insanity around hyper specific instructions that optimize arcane tasks and the tetris-like arrangement of instructions to fit into opcodes is where the meat is.
it's hard to turn "while (x > 5) { printf("%d", x); }" into a series of 10 or 15 assembly language instructions that are detached from the bigger picture.
Obviously it's a basic translation, but pointers are pretty simple too right? And yet somehow they're like the bane of CS 101 students' existance. Arithmetic in N is simple once you understand groups and rings
Well... To be honest, it took me a lot of time to begin to understand why pointers seem difficult to many.
But after discussing with many, the ones that have troubles with pointers are the one that started algorithmics with some high-level languages that completely hide how things work.
I've encounter students that were killers in assembly and pointers and couldn't write ten lines in Java... but they avoided HL programming at first.
It's not based in any kind of rationality. I just hate it. Like, WTF is this shit?
Code:
leal (%eax,%eax,2), %eax
percents everywhere hurting my eyes, a bunch of commas that provide no insight into what's going on. And then this:
Code:
leal 8(,%eax,4), %eax
I don't even know where to start with this? In intel syntax it's almost a mirror image of the previous example, but here it looks like a completely different construct. Nonsensical.
For my assignment for academy i have to create database and fill it with some data and then write lot of queries. But i manage to fail at start..
While i create it in a query(its T-SQL by the way in SSMS) I get this error :
Directory lookup for the file "C:\Users\user\Desktop\TSQL\DB_ASSIG1.mdf" failed with the operating system error 5(Access is denied.).
I googled it and someone mentioned that i should run it by administrator, i did it and nothing changed.
Any tips?
For my assignment for academy i have to create database and fill it with some data and then write lot of queries. But i manage to fail at start..
While i create it in a query(its T-SQL by the way in SSMS) I get this error :
Directory lookup for the file "C:\Users\user\Desktop\TSQL\DB_ASSIG1.mdf" failed with the operating system error 5(Access is denied.).
I googled it and someone mentioned that i should run it by administrator, i did it and nothing changed.
Any tips?
Make sure the file isn't read only and that your user has permissions to it. Also make sure that no other program (like a file scanner or whatever) has an open handle to it.
Usually SMSS creates databases in it's own directory. If you are using a backup of an existing database, do a restore.
For my assignment for academy i have to create database and fill it with some data and then write lot of queries. But i manage to fail at start..
While i create it in a query(its T-SQL by the way in SSMS) I get this error :
Directory lookup for the file "C:\Users\user\Desktop\TSQL\DB_ASSIG1.mdf" failed with the operating system error 5(Access is denied.).
I googled it and someone mentioned that i should run it by administrator, i did it and nothing changed.
Any tips?
Make sure the file isn't read only and that your user has permissions to it. Also make sure that no other program (like a file scanner or whatever) has an open handle to it.
Usually SMSS creates databases in it's own directory. If you are using a backup of an existing database, do a restore.
I've got a super interesting job opportunity and I'd like to learn how to use git/github. I don't need perfect knowledge, but I'd like to be able to use it. Do you guys know of any great resources to learn? I have some notions of how to use it and I have a github account, but I'd like to learn some more.
I've got a super interesting job opportunity and I'd like to learn how to use git/github. I don't need perfect knowledge, but I'd like to be able to use it. Do you guys know of any great resources to learn? I have some notions of how to use it and I have a github account, but I'd like to learn some more.
Well... To be honest, it took me a lot of time to begin to understand why pointers seem difficult to many.
But after discussing with many, the ones that have troubles with pointers are the one that started algorithmics with some high-level languages that completely hide how things work.
I've encounter students that were killers in assembly and pointers and couldn't write ten lines in Java... but they avoided HL programming at first.
I really don't mind... I'm curious about this, though
I was definitely super confused by pointers as an undergrad. And honestly I wouldn't consider myself a pointer master now, never having worked for a consistent amount of time in a language that employs them. But the concept is simple enough and easily relatable to a realworld analogue in a teaching setting (street addresses!).
For whatever reason I think the most confusing part may simply be the syntax. Referencing and derererencing operators have never seemed intuitive in the way they're used. Also, pointers are just poorly taught I think.
I probably need to get used to git at some point, but it just seems so backward to be typing stuff into a command console when I have a GUI interface I use every day with SVN for my job.
I probably need to get used to git at some point, but it just seems so backward to be typing stuff into a command console when I have a GUI interface I use every day with SVN for my job.
I probably need to get used to git at some point, but it just seems so backward to be typing stuff into a command console when I have a GUI interface I use every day with SVN for my job.
There's plently of GUI interfaces for Git (and also shell integration like Tortoise) but personally, I don't understand why someone would favor a GUI to a CLI tool... Well, to each its own... I know I'm in the minority when I favor Hg over git.
Regardless you should be familiar with how git works and git commands even if you do use a GUI, so you know how to handle situations where the GUI is inssuficient (and they do crop up from time to time) and understand what all the GUI settings/options actually do.
Just wanted to say I started the unreal course on Udemy with C++ and I've been loving it so far. First time programming in C++ and really like how much easier it is to do things than in C.
Just wanted to say I started the unreal course on Udemy with C++ and I've been loving it so far. First time programming in C++ and really like how much easier it is to do things than in C.
Git is decentralized which makes it easier/faster to commit as there's no traffic with a remote repository until you specifically push/pull commits. It's also better at merging branches which makes it better for a CI workflow.
First section is a basic C++ primer then you get into basic stuff in unreal which is where it really gets fun. Thankfully since I already have a basic understanding of programming I've been exploring and adding my own features to the example projects we've been doing and its pretty rewarding seeing your changes come to life instantly. I think I'm more productive here at home than I am at work LOL.
First section is a basic C++ primer then you get into basic stuff in unreal which is where it really gets fun. Thankfully since I already have a basic understanding of programming I've been exploring and adding my own features to the example projects we've been doing and its pretty rewarding seeing your changes come to life instantly. I think I'm more productive here at home than I am at work LOL.
Days when I work from home always feel more productive to me. I'd love my job a lot more if it was a regular thing. First day back from vacation and I've gotten way less done than I wanted to. But I'd lose the opportunity to call people over to check something out that I've been working on. Although I guess there could be ways around there.
First section is a basic C++ primer then you get into basic stuff in unreal which is where it really gets fun. Thankfully since I already have a basic understanding of programming I've been exploring and adding my own features to the example projects we've been doing and its pretty rewarding seeing your changes come to life instantly. I think I'm more productive here at home than I am at work LOL.
Do you think it's worth buying for a programming newbie? I have one programming class under my belt, which used python. I've been told it's a pain in the ass to learn C++ but will have to learn it next spring anyways. Should I bite the bullet and purchase it?
Svn couldn't do a merge to save its life. I remember the dreaded tree conflict which basically translates to "you're fucked". In git it's so easy to do just about everything, from reordering commits, to branching, merges are always very straightforward no matter how complicated, you can move around arbitrary commits almost as easily as copying files. Everything just works. Having multiple branches in svn requires having multiple copies of the source tree, which is patently ridiculous.
Svn couldn't do a merge to save its life. I remember the dreaded tree conflict which basically translates to "you're fucked". In git it's so easy to do just about everything, from reordering commits, to branching, merges are always very straightforward no matter how complicated, you can move around arbitrary commits almost as easily as copying files. Everything just works. Having multiple branches in svn requires having multiple copies of the source tree, which is patently ridiculous.
I know, that's why I said I personally need to get on it and learn git at some point, I was just wondering if there was some critical flaw with SVN that would cause us to switch at work as well.
SVN ain't broke for us, so we will continue to use it for the time being I think.
Do you think it's worth buying for a programming newbie? I have one programming class under my belt, which used python. I've been told it's a pain in the ass to learn C++ but will have to learn it next spring anyways. Should I bite the bullet and purchase it?
He does a lot of hand holding, although I feel he doesn't do a good job if you're absolutely new to programming as he just kinda breezes over some pretty complicated stuff like classes, but if you have knowledge of programming already then it really shouldn't be a problem, the first 52 videos are all about making a simple console program in c++ that you could literally follow along with him as he goes. He does put pauses in the video and challenges you to try to solve the problem on your own, then after the pause he goes and implements it himself in case you can't solve it. The videos are short ranging from probably 5 to 12 minutes so I usually try to hit at least 2-3 a day. The course starts off with making a really basic word guessing game in the console, then you move over to unreal and make a small game where you try to escape a room (very basic 4 walls and a door that opens when you step in a certain spot) then you go into making a first person shooter(just a open map with a gun and you eventually put targets on the map), then finally a very basic tank battle game. I just finished the room section and its been pretty fun So far, the console stuff was a little boring but once you get into unreal it so much more rewarding.
Git is decentralized which makes it easier/faster to commit as there's no traffic with a remote repository until you specifically push/pull commits. It's also better at merging branches which makes it better for a CI workflow.
The main advantate I see is that you can commit non-working things (to be able to go back and forth should something bad happen), and only push them once it's working.
Also, when you're often cut from the internet, like me (wireless in bullet trains is only for the end of the year at best), it's handy to have a local repository.
If you're able to choose your tools, Hg is easier to learn coming from SVN than Git.
Philosophies differ (I prefer Hg's) but at least, you're getting the advantages of DCVS. Once you're at ease with one, basic operations on the other are easy.
I probably need to get used to git at some point, but it just seems so backward to be typing stuff into a command console when I have a GUI interface I use every day with SVN for my job.
Most editors and IDEs have good Git integration for simple branch/stage/commit/pull/push (90% of your commands), and merge assist help if you hit conflicts. You should only need the command line for 5-10% of stuff (mostly rebase/cherry-pick and exotic merge options).
I don't want to live in a world without lightweight branches, complete local histories, and badass merging.
I know, I've even hg-git installed, and tested it on a couple git projects (as curiosity, I believe it's better to use the tool everyone uses in a project).
It make some sense if you want to use github. But it's still using a Hg client on a git repository, so if you prefer the Hg way of doing things with respect to rewrites, that's not satisfying...
And publishing code there helps Git, so as an Hg supporter, I'm reluctant to do this, even if I can. And yes, I know it's useful for job hunting, but well... I'm not hunting currently.
Not sure... I've seen whole threads about this on the internet, usually heated ones. It's apparently a common practice.
From what I understand (either I work alone, or with really clearly defined independant tasks) it's so that you can pull the current version on a regular basis without touching your working copy, so that you can check how things evolve.
I started programming 6 months ago. Finished my first semester in University, got good grades, surprisingly (first semester though is always easier, I suppose).
I'm always doubting myself, always afraid of increasing difficulty levels, of hitting a plateau, because I've never seen myself as being good with logic. So far it hasn't happened yet. So far, programming can be very entertaining and satisfying when things just work, and incredibly frustrating when it doesn't for hours. I wonder if the frustration and failings happen less and less the more experienced you get? I can't imagine the stress of not being able to solve a problem in a professional environment, with all that pressure.
I just got an internship as help desk. Payment is shitty, but I can't seem to get development internships right out of the gate and I heard that's the way to start, so I guess it's ok.
Haven't tried it myself, I've used Git Krakken though before which is similar. I like it, sometimes I guess I'm just used to the command line git and just end up using that but whatever floats your boat I'd say.
I started programming 6 months ago. Finished my first semester in University, got good grades, surprisingly (first semester though is always easier, I suppose).
I'm always doubting myself, always afraid of increasing difficulty levels, of hitting a plateau, because I've never seen myself as being good with logic. So far it hasn't happened yet. So far, programming can be very entertaining and satisfying when things just work, and incredibly frustrating when it doesn't for hours. I wonder if the frustration and failings happen less and less the more experienced you get? I can't imagine the stress of not being able to solve a problem in a professional environment, with all that pressure.
I just got an internship as help desk. Payment is shitty, but I can't seem to get development internships right out of the gate and I heard that's the way to start, so I guess it's ok.
I'm still in college as well, but entering my senior year and currently interning somewhere. I still frequently hit walls and get frustrated, but always ends up panning out somehow. I'm no like principal software engineer ofc, but I'd imagine it never ends. Actually the one senior software engineer guy I work with has been for a few weeks now hitting walls setting up these Docker containers. Guy has been programming since the 80s lol. So nah, not alone. Also check your school if they have help desk jobs there too. That's where I work during the year and love it. Congrats on the internship
From what I understand (either I work alone, or with really clearly defined independant tasks) it's so that you can pull the current version on a regular basis without touching your working copy, so that you can check how things evolve.
It's annoying doing git stash just to check on someone else's branch, so I approve of this.
Alternatively, just learn git stash.
EDIT: I hate C. And I hate C because I hate macros. When your language doesn't have any real concept of modularity you end up with metaprogramming nonsense. C++ was supposed to fix this, theoretically but... Anyway I wanted to review the UNIX errno's. So I thought, ok, I'm including errno.h. If I want to know what the errnos are I'll just cat /usr/include/errno.h.
Code:
#ifndef _ERRNO_H
/* The includer defined __need_Emath if he wants only the definitions
of EDOM and ERANGE, and not everything else. */
#ifndef __need_Emath
# define _ERRNO_H 1
# include <features.h>
#endif
__BEGIN_DECLS
/* Get the error number constants from the system-specific file.
This file will test __need_Emath and _ERRNO_H. */
#include <bits/errno.h>
#undef __need_Emath
#ifdef _ERRNO_H
/* Declare the `errno' variable, unless it's defined as a macro by
bits/errno.h. This is the case in GNU, where it is a per-thread
variable. This redeclaration using the macro still works, but it
will be a function declaration without a prototype and may trigger
a -Wstrict-prototypes warning. */
#ifndef errno
extern int errno;
#endif
#ifdef __USE_GNU
/* The full and simple forms of the name with which the program was
invoked. These variables are set up automatically at startup based on
the value of ARGV[0] (this works only if you use GNU ld). */
extern char *program_invocation_name, *program_invocation_short_name;
#endif /* __USE_GNU */
#endif /* _ERRNO_H */
__END_DECLS
#endif /* _ERRNO_H */
/* The Hurd <bits/errno.h> defines `error_t' as an enumerated type so
that printing `error_t' values in the debugger shows the names. We
might need this definition sometimes even if this file was included
before. */
#if defined __USE_GNU || defined __need_error_t
# ifndef __error_t_defined
typedef int error_t;
# define __error_t_defined 1
# endif
# undef __need_error_t
#endif
Welp, ok. I could run errno.h through the preprocessor I guess but I won't be excited by what I get.
EDIT: Clearly I don't know how to use the preprocessor because this gcc -E test.c isn't work:
Because it's $40 and I could have just done "man errno" instead of trying to read source code. God forbid I actually read the source code to learn about the libraries I'm using. *DRAMATIC EYEROLL*.
If you made it this far through this post then you must really think I'm amateurish, but that's actually the point. I am an amateur and this is mildly challenging. Multiply this times a lifetime of work and you realize how much unnecessary drama is involved in comprehending C++ libraries. The inspiration for this post was trying to figure out std::chrono and discovering name mangling in my std.