I want to make a manga viewer in Python that has continuous scrolling (sumatrapdf's scrolling speed is like that of a snail). What module should I use? General advice is welcomed too.
>>32352 Depends what you want. Do you want to do networking related shit? If so front-end or back-end? Do you want to do high or low level programming? If low level, which architecture? If high, which language?
The easiest multi-purpose but still useful language to learn is definitely Python. The codeacademy course will teach you the basics, but it will teach you nothing on theory or even how to maintain any reasonably sized project. For that you'll need a book (there are many available freely online).
Other notable recommendations are Common Lisp and Scheme and C (and maybe C++). The Lisp family is really different from all other languages around, but that's a good thing; Lisp is incredible when you finally grok it. I actually also really like C, but only because it's really low level, while still being easier to program with than assembly.
pic related, lots of easy to medium difficulty practical programs for when you need a project (I recommend you start doing them early on, they're really the best way to learn the logic behind programming; projecteuler is another important resource). >>32355 Cool project wizbro. Glad you want to make your own game engine and aren't going to try and use a pre-made one, it will pay off in the end.
>>32350 Hum, I'm not really sure what you should use. I'll have to do some research and then get back to you.
>>32370 Doing it myself helped already - I badly wanted to experiment with architecture wherein the entire simulation is completely deterministic and replayable with just machine inputs saved. By virtue of that I can have tens of thousands of entities synchronized through the network and the server bandwidth stays rock-hard proportional to the square of the number of players alone. Further, I made all game components devoid of containers and/or pointers, making them trivial to copy, therefore it is possible to clone the entire world with just several memcpy calls - cloning plain linear memory is an order of magnitude faster than memory interleaved with vectors, maps etc. - giving me almost instant saves, loads and server backups even for worlds whose logical data spans on the order of 40-50 megabytes.
I cannot imagine enforcing determinism of the simulation and complete linearity of the memory with something like Unity. With Unreal Engine perhaps (it's open source), but that will come if and when I decide to make a 3D sequel to my game.
I recommend you watch bisqwit on youtube. He has an amazing video of his 3d game engine made in C++, not as hard as it seems.
I'm personally working on a small OS in assembly and C for x86 and x86-64. I really like the control I have over the machine that making my own (very small) OS gives me.
>>32373 Good stuff, this vid hits so close to home.
Do you plan on putting the OS to practical use or is it purely a learning experience? I have always wondered what could my own OS gain me apart from sheer satisfaction.
Are you by chance inspired by Terry A. Davis (the guy behind TempleOS)?
>>32376 Well, my main inspirations are definitely Lisp Machines (https://en.wikipedia.org/wiki/Lisp_machine), but their usefulness came from hardware tailored for Lisp. My goal is to make a hobby OS for programming Lisp (not sure which dialect yet, but probably Scheme or my own) that will hopefully be at least as fast or faster than current implementations of Lisp (this might be a good way to do it: https://en.wikipedia.org/wiki/Tagged_architecture).
Yes, TempleOS is a big inspiration of mine. It's a shame Terry A. Davis has become a /g/ meme and is now getting raided by memelords in his youtube stream.
>>32378 Oh man, I dream on making a lisp based OS of sorts. For now, I've just been planning the memory layout and how functions and data are to be represented. However I'm planning on using pure assembly, I don't want any part of it to be C, or to be constrained by the way C does things. I am thinking then I would make a lowest-level lispy dialect that translates cleanly to a set of assembly constructs to fit the lisp model, rather than the C model. Thanks for the link on tagged architectures, I didn't know about that. Actually one of my ideas is to tag every word at the first, say, 4 bytes with metadata about both the type and the segment in memory where it's to be found (for example, reals would all be in one partition of memory, floats in another one, cons cells in yet another one, functions in another one, etc). My computer autism is kicking, so I'll stop here.
>>32380 Well, I'm using C to build up to the point where I can get a reasonable environment to then be able to modify the OS while it's running with Lisp and, eventually, replace almost all C code with Lisp.
Your idea of basic assembly functions mapping to basic Lisp functions is nothing new (they're called primitives and most Lisp languages have around 25, but only around 9 are needed), but the problem is how to compile the Lisp code. Are you going to make a compiler in assembly that will compile the Lisp part of the OS when the OS boots? That's possible, but why not use C? When i'm programming with C I know almost 100% of the time what it's going to compile into, so I use C to make it easier to maintain the code later on (imagine maintaining thousands of lines of asm code, wew).
But I still really like your idea of using Lisp and asm exclusively, I certainly thought about doing the same but decided against it. Fortunately, I'm not very deep into my OS and I would be interested in following your idea or, at least, something close to it.
I'm thing assembly for the booting process (IDT, GDT and all that stuff which is a pain in the ass but I have already done a few weeks ago) and then a small compiler (written in C for sanity's sake) that will compile and run the Lisp code. What do you think about the plan? I already have a pretty good idea on the 9 primitives we need and how to implement them in x86 assembly.
I would also like to ask if you would like to join me? It will be nothing formal or demanding. I personally haven't done much this past month except for reading and theorizing about how to implement a good keyboard interface in x86. We can use something like Tox to talk ( I expect full anonymity between us) and we even no publish it until we feel like it's ready.
Either way, I'll get on forking my current OS and removing almost all of the (thousands of lines) C code and prepare it for the Lisp compiler. Like I said, all the really low level stuff is done, it boots and prints to the VGA frame buffer without a problem. I have stuff like malloc, print, and keyboard input implemented, but it's all in C so we'll have to scrap most of it, unless we want to use it for the compiler.
I completely understand if you don't want to join me, and will take no offense if you refuse to do so.
>>32382 thanks a lot for the offer, but I have a lot in my plate right now (and ADD) and I wouldn't be able to follow through. Good luck with your project tho.
>>32387 No problem. The invitation is still open if anyone wants to join me. I'm not asking for any consistent dedication. Just contribute what you want, when you want, if you want. Really just a casual project for everyone.
I've decided to write the compiler in Common Lisp. It will output x86 assembly to a desired file and then I can use an assembler to assemble that and run it in the OS itself. I'm doing this because it's much easier to implement a Lisp inside another Lisp instead of doing in C. The goal is obviously to make a good enough compiler that it's able to compile a compiler to run on the OS that I'll then use for further development of the OS.
Here's a nice feature I found on slimv, you can actually disassemble any function right there in the REPL, here's the asm for CAR:
>>32447 >DISASSEMBLE is a standard lisp feature Damm, those guys really thought of everything, guess that's why the standard cost the US gov like $3M.
Yeah, I'll certainly keep on posting updates. I've shunt away the idea of publishing the entire code for the moment, simply because I can't decide on a license.
Working on this project is pretty fucking comfy, I get to work with all my favorite languages (asm, C and CL) at the same time and in my favorite architecture, fucking nice man.
You can try to use some obscure libraries to get QT to read the pdf, but that would probably be unnecessary since converting pdf to jpg or png is pretty easy.
The program sound pretty simple so I don't have much more advice for you. I guess if you plan on doing more that just having 2 buttons to scroll through the pdf's I recommend you structure and comment your code well from the beginning.
I don't like it for any particularly objective reason. It's just the architecture I grew up with. x86 has dominated the PC market for I guess over 20 years now, so it's the architecture of the common man, everyone uses it (and everyone complains about it).
Essentially, I like it for the same reason that some people prefer Commodore or Amiga or whatever. It's , at the moment, the easiest to learn, the most common (on pc at least), and one of the most useful to learn.
>>32555 projecteuler.net has some great exercises and doesn't require you to login. Only problem is they're all mathematical exercises, so they're good for learning algorithms but not so good for learning how to maintain a larger (and more useful) project.
>>32559 Codeacademy is good for learning the very basic stuff (like basic syntax) for your 1st language, but not much more.
I'm not sure what language you're learning or why you're learning so it's hard for me to give you good recommendations, but I suggest you look at a pic I posted on the last thread called 'g-challenges', it has a lot of easy to medium projects that are a good stepping stone from small exercises and books to practical applications. I particularly enjoyed making a brainfuck interpreter (like less than 100 lines in CL, I think, pretty happy with it, I can post it here if you want).
>>32562 It covers more than two years of university programming classes, of which I got sick and only did them partially, just OK enough for Ds. What's your opinion on the challenges? How many have you done?
Well, by the time I started doing these challenges I had already done a lot of small projecteuler exercises and other stuff small sized project, so I didn't spend anytime doing the easier challenges. I did the Little Man Computer, Brainfuck interpreter and a roguelike game engine. From taking a quick look at the challenges, I see that I did several of the smaller projects when solving projecteuler stuff (i.e. 66 and 27).
I did all of those in Lisp, but I've also done random stuff that interests me in Lisp or assembly (i.e. I did collatz conjecture in x86 asm, rule110 and for any number, mersenne primes and a bunch of other stuff in Lisp).
So yeah, I didn't do too many of those exercises, instead I implemented neat mathematical and computer science stuff and did projecteuler exercises.
I recommend you start working on a medium sized project that you can build up piece by piece and maybe even something useful. My project was a roguelike game engine, but I switched to making an OS that runs Lisp.
>>32564 No problem, can I ask why you're learning C++ and what areas of cs interest you the most?
>>32565 I recently started taking actual classes in progamming but feel often far behind compared to my classmates so I feel like that I should practice a little bit more at home. I was mostly interested in learning how to code for the purpose of creating my own videogame someday but I find that just making simple programs is already kind of fun so I guess it's also a new hobby of mine.
>>32567 Well, game making is a common goal of beginner, and a noble one. I highly recommend you watch the video I posted earlier in this thread and also checkout other videos by bisqwit, he does a lot of stuff related to the inner workings of games, but nothing tutorial style.
Making a simple 2d game engine is extremely easy anon, especially if you go with ANSI graphics. You can start right now with your plan to start writing your own games if you want. Oh, and C++'s object oriented style is particularly useful for game dev, so make sure to exploit the advantages of object-oriented programming!
So yeah, either learn a basic library like SDL to get some 2d graphics or just use ncurses for ANSI graphics, or even, just use printf and getchar, that's what I did for a very basic Tetris game, and it worked fine (it's still pretty buggy, but that's because it was my first C project and I didn't want to spend too much time on it).
>>32568 Yes I'm actually aware that simple 2D games aren't that difficult to make, I've already made some very basic programs like one where you can make a ">" character move and make it pick up an "o" character and then letting it reappear in another part of the screen. I haven't used any libraries yet aside from one that just lets you change the x and y position of a character if you press a certain button so I need to catch up on that first. Anyway, thanks for the advice.
For me, videogames is quite frustating. Too multidisciplinar and if you aim/dream high you fail.
What I enjoy most of videogames is prototyping them and testing them. But I find that there's a lack of tools for do that. I'd like to just focus on coding the mechanics, logic, and elements of the games. But… you've got from one hand game engines, like Unity, UE, PyGame, whathever… And on the other hand, you have the option of using some existing videogame and doing mods, WCIII, HF, etc.
>>32607 Well, I'm not sure what "a middle way" would be.
Games like HF are pretty easy to mod and let you mod almost every part of the engine, so it's like using something like Unity, but starting from a built product and modifying it from there (I guess, I have no experience in modding myself).
I really don't know what to recommend you. I guess something like gamemaker might be what you're looking for.
If I don't understand most basic code and can't understand documentation does it mean that I should stop trying to learn anything? I'm going nowhere. No matter what I try to make my mind is blank. I can fool myself I get it all I want but in the end I can't write a line properly. I've done some tutorials and read a few books but forgotten most of it by now. It's all worthless anyway. I've tried making some basic chrome extension using chrome api but i get nothing. Everything says blablabla retrieves information about blablabla…how am i supposed to know how it looks in reality and how to use it? It's all nonsense, most I can do is copy paste from code samples like a ghetto thief and try to make it work without understanding. Even if something works i still don't know why. I keep rereading the same shit and after a while i still dont remember what function does what. I hate wasting time and being stuck and making no progress for 100000 years.
>>32650 From what I'm getting the problem is the shit API you're using that provides no decent documentation and retarded names for functions and vars.
I personally fucking hate dealing with API's and that type of cancerous shit made by pajeets for 1$/h. That's why I never do any web stuff, it's all fucking aids.
Surprisingly, lower level stuff is often much higher quality, simply because it's often too hard for the common pajeet. I recommend you get into system level programming, or really just anything not made by pajeets (aka no web stuff, no micro$oft stuff or really anything that SJW's conglomerate around, i.e. meme languages like ruby and python).
So yeah, you have experienced the worst of the worst in programming. You worked with shit API's made by pajeets just to finish the contract and nothing more. I recommend you avoid using API's and starting doing more stuff at a lower level (asm and C are good options), or avoid commercially significant languages, like python and all the web stuff like HTML and CSS, except for C.
Try to choose a good language for hobbyists. Languages like CL and other Lisp dialects are used by die-hard fans and very rarely for commercial purposes, so you can expect high quality libraries and a skilled community that isn't there just to make money.
Sorry for ranting so much, but pajeets and SJW's are ruining coding, but they're too dumb to do anything more than CSS and Python for their shitty apps, so just avoid that general area of programming, it will leave a bitter taste.
Pic related, quality programming is harder to market than you may think. Most "programmers" are just idiots doing basic front-end shit that they barely understand, but are still "qualified" cuz of their meme degree.
>>32349 I'm doing the first course in codeacademy: HTML and CSS, and I'm curious, after finishing all the courses what else should I do? I want to gain money selling webpages to people.
>>32668 >I want to gain money selling webpages to people.
I seriously doubt there's good money to be made in making CSS webpages for people. I'm much more confident that there's good money in making and maintaining webpages, especially online stores using purpose made programs that deal with much of the back and front-end stuff.
So yeah, HTML and CSS are useful to know, but bare CSS webpages are kinda of obsolete now, most services use lot's of extra stuff to get what they want. What I would recommend for those wizzies looking to make money out of making and money webpages, would be "magento". It's an e-commerce platform that makes it several magnitudes easier to setup e-stores, but still gives you loads of controls. Also, it's so easy that normies will stop paying you when they learn how to use it.
I just said that I was learning HTML and CSS. I didn't say that I will try to sell html/CSS web pages. I want to sell web pages, that's why I ask what else should I do after finishing all the courses in codeacademy.
>>32674 Selling webpages is a weird way of saying it. You want to build websites and have clients that buy that service from you is that it ? If so wordpress and knowing how to build themes or like >>32671 said, setting up simple ecommerce sites with ready made software is the way to go.
>>32675 Selling webpages was a pretty real thing in the 00's. Lot's of people were looking for their own personal or commercial websites, but not so many knew how to make them.
What happens nowadays is more of a "build and maintain" kinda of thing. You make the webpage to the costumers demands (often much more complex than the stuff from the 00's), then maintain website, which is really just back-end routine stuff and maybe a few updates to the software (mainly for security reasons). Most small online stores around are run by small companies that are contracted by other small companies to make and maintain most of their web stuff.
>>32675 >Selling webpages is a weird way of saying it. I'm sorry, english is not my mother tongue. >You want to build websites and have clients that buy that service from you is that it ? Yes
>>32653 >Surprisingly, lower level stuff is often much higher quality, simply because it's often too hard for the common pajeet. This is also true of functional programming, the purer the better (at least until you go full academic). Basically anything that involves formal modelling, analysis, and verification, logic, mathematics, or thinking in general, is pajeet repellent.
Web and mainstream OOP languages were designed with the dual goals of enabling borderline retarded code monkeys to hack together minimally adequate software as fast as possible whilst also limiting the amount of damage they could cause in the process, and the result is poorly designed (and usually broken) product that is considered "good enough" because its flaws can be worked around by someone with enough patience. >That's why I never do any web stuff, it's all fucking aids. >Most "programmers" are just idiots doing basic front-end shit that they barely understand, but are still "qualified" cuz of their meme degree. I live with this shit everyday and I've come to hate most programmers. I wish it was just front-end, but the ignorance, lack of principles, and cargo-cult mentality sadly extends throughout the entire stack.
Ok, so here's what I've done since my earlier posts: >Made significant progress in the compiler, it allows for calls to primitives, can handle numbers and cons, and has a load of macros that will help a lot with it's development >In conjunction with the compiler, I've been writing the primitives in nasm
I'm now figuring out a puzzling bug involving recursive cons (probably obvious bug, but I just can't figure it out).
Also, I learnt that recursive macros will lead to stack overflow during compile time in SBCL, 10/10!
To avoid completely stalling my progress because of a simple bug, I'll probably spend the weekend porting it to x86-64. I started with 32bit x86 because it's easier and it will also run on x86-64, but the port shouldn't be TOO hard and it will, hopefully, allow me to make full use of x86-64 pc's, which is pretty much all pc's released in the last years.
pic related, the bug has been bothering me for over 24h now, and I feel defeated.
I've spent the past 3 days trying to get the OS to boot in long mode (64bits mode) on x86-64. I lost count of the times I thought: "Finally this is what I need! It will finally work now!"
There's a huge lack of documentation out there about getting from protected mode or real mode (what you boot up in) to long mode (which allows you to use the new 64bit features) in x86-64. All the guides I was reading were very sparse, and I had to piece together 10yr old guides with reading source code for another hobby OS to figure it out, and read the wiki so many times.
But, I was saved from reading the Intel or AMD manuals.
So yeah, it boots into long mode! The hardest part of bootstrapping the OS is done (for the 2nd time now, I already did this for x86). Now it's an easy task of porting the C code and small parts of assembly to x86-64 and then porting my Lisp compiler (also trivial).
All in all, I'm just happy I was able to power through it. I only saw the light at the end of the tunnel when it was blinding me, before that I had no real hard, conclusive clue about how close I was.
>>32885 Wow. Neat. I wish I was that dedicated. I never get anything done because I can't get myself to research or even have the drive to do what I already have and idea how to do it.
See picture, did I make decent choices of subjects in my computer science degree? I could make changes to 2017, ones below that are just subjects I was considering.
I already have an undergrad math degree but I haven't done much statistics, yet I don't want to do hard statistics courses as I've learned that computer science courses are much easier than math and don't punish me for not attending class, so I have much better marks than my previous degree. I have doubts now that I seem like i'm going in a data science background, but I just didnt want to waste my math background and thought artificial intelligence was interesting. I hate how companies steal people's data yet i'm doing to do all this data mining stuff…
I'm considering switching the C++ course as it looks annoying and I guess I can just teach languages to myself, but maybe it will look good on my transcript assuming I don't fuck it up. I'm going to graduate at almost 26 years old with no work experience at all
You do not need to worry about learning programming languages. If you understand the fundemants of programming, you can learn any language in one or two days. I think anyone who had a bachelors in CS will be able to learn a new language on a whim. That was my experience, at least. My upper level CS classes casually switched languages, graphics design used C++ and my advanced programming class forced me to juggle between ada, C, and fortran (reasonable since at the end of the class we basically had to write our own language from scratch). My school used java in all of the "learning to program" classes, but once we had the basics down we were expected to adapt to whatever the fuck was thrown at us.
Your math background is great for data science, but you do need to know statistics since stats is a basic thing when it comes to manipulating data. If you are unable to successfully filter out data through statistics then you are going to get garbage results. Machine learning is a part of the data scientist's toolbox, though. However, figuring out what to use as inputs for your learning algorithms require a solid understanding of statistics and mathematical manipulation. For example, for an algorithm I developed I had to find the critical points of a fourier series in order to give data for the neural network to train on. That shit wasn't taught to me in a single class in college, and I was only able to do it due to me remembering stuff from my differential calculus and multivariable calculus classes. Statistics was necessary to understand and fine tune the results that came from the neural network.
>>32890 Well, I personally hate academia, so I look at all those courses with disdain.
With that said, I do have some experience with Deep learning, and I can tell you that most papers coming out are made by people working in large corporations, like Google or Baidu, not from MIT or other universities. This doesn't mean you want learn anything. I'm sure they will do a fine job of teaching you the basics of ML. But to really learn ML, you need to have experience with applying large neural nets. So, it basically depends on whether or not they're going to let you play with 4 Titan X's or if they're going to just teach you how NN's usually work, and leave it at that.
I'm personally more interested in more theoretical stuff. I'm not sure what exactly they mean by "Design and Analysis of Algorithms", but I hope they teach you stuff like Big O notation. If so, it might be a very interesting course.
Learning C++ should really be a sideshow. If you want to learn a language, just read a good book on it and go use it. There's really no better way. And you'll probably use it for projects for other classes too, so there you, more practice!
I think machine learning might interest you. Deep down, ML is pure mathematics, and some of the biggest open questions about ML can only be solved through the development of new maths.
Again, applying ML, and especially Deep Learning is much harder than it looks. When you first grasp Deep Learning it will sound like the solution to all our problems. But as soon as you start actually using it, you'll learn what exponential growth means, and why finding a replacement for backpropragation would allow for the application of DL in completely new areas.
And, I guess that's the real problem with DL; the neural networks used atm are just way too big, and they're getting bigger! Nobody truly knows how DL works, it just does.
So yeah, I recommend you get into ML, if you're crazy enough. If not, I don't know what to recommend you, go become a codemonkey? Or maybe learn arm assembly, C and maybe Forth and go do some ultra low-power stuff?
Also, what do they mean by "Artificial Intelligence"? If they anyway hinted that "Artificial Intelligence" is in any way a real field with active research except for ML, then they're lying to you 100%. General AI has made no progress for like the past 50-40 years, it's all bs. Don't expect to see sentient AI before the end of this century, or even the next.
pic related, did you take anything on electronics? Knowing how computers work at a low level is what separates us from codemonkeys, never forget that!
>>32917 Fractals are pretty cool. What fractal is that exactly? I can't recognize it.
Unfortunely I've never messed with fractals, simply because I rarely do any graphical stuff, and when I do, it's usually ASCII only. What libs are you using for drawing that? It looks pretty good.
>>32897 Different anon here but you seem to know your stuff - I have a 40yr old textbook on microprocessors I'm reading through, but as it's not an academic textbook there are no exercises and I feel I'd grasp things better with the opportunity to play around a bit. I don't want to build a physical computer but I'd like to go through the motions. Do you think it would be edifying/plausible to emulate a 40yr old hypothetical computer by using a modern high level language?
The Mandelbrot set zn=zn-1^2+c serves as an atlas of Julia sets which are almost the same iteration, except c is a constant rather than being set to z0 for each point.
You can obtain higher order Julia sets from higher order Mandelbrots. This one is from the 8th order analog to the M-set.
I did these in PHP with native libraries, not an approach I would recommend. I lost the source though, I did a quick M-set with C# inside monogame the other day, I might work on making it into an interactive tool for finding interesting Julia sets.
Most of the heavy lifting was in designing the coloring algorithms, these have a smoothed histogram coloration which starts cycling faster as the details become finer. Hopefully it'll be quicker to replicate this time round, although I am also thinking C++/OpenGL may be the way to go. I know far more about mathematics than programming.
>>32920 Building emulators for simple computer architectures (fictional or not) is a great way to learn both the architecture you're emulating, and the language you're using to do it! I myself made a brainfuck interpreter which emulated a theoretical brainfuck vm, and also an emulator for a "Little Man Computer", which is a theoretical machine closely matching the von Neuman architecture.
I made both of those projects in Lisp, but you can certainly use another language (Lisp might be very helpful with the parser though, which is one of the hard parts when starting your emulator).
Here's the code for the brainfuck interpreter (which is the one I'm most proud of): http://pastebin.com/bYDVSHEi
As you can see, it's less than 50 lines of code, even when taking into account the function to nicely read a file (which is unnecessary btw), but it's still pretty easy to understand (hence why there are no comments). I doubt you could make such an easy to read bf interpreter in a fortran family language (like C or C++).
The LMC interpreter/emulator is also less than like 150 lines, and still easy to read, despite the lack of comments. I believe this is due to my choice of using Lisp.
So yeah, making an emulator for an old microprocessor is a great project! I highly recommend you do it. Additionally, I recommend you look into using Lisp, it will make it much easier.
>>32923 >I did these in PHP with native libraries You're a madman. Even C# is pretty fucking crazy.
Have you messed around with OpenGL? From the small amount of experience I have with it, it seems to be tailored for 3d graphics, but it's still a very powerful tool for any graphical work.
Again, I would like to shill Lisp, but I do recognize that all Lisp dialects suffer from a lack of good libraries. This certainly doesn't mean you can't do it in Lisp, it just means the documentation might be a bit more obscure, depending on how the library differs from the same library in other languages.
What you do gain from Lisp is the far superior syntax, which might interest you since it's just Polish notation, but with parenthesis added in.
>>32924 Pretty nice stuff. I'm glad my image didn't derail the thread (too much).
currently stuying artificial inteligence and writing diferent algorithmes on c to get the best aswers from something. it was good to learn but i am on uni and i didn't even have time to learn more about the subject since i have exams coming up and have other things to study. do people here have some ongoing project? i know mostly c and c++ will learn java next months. i don't have any projects of my own going but i am trying to think about something
>>33037 What exactly were you doing with "AI"? Machine learning? Or more general "AI" stuff?
My ongoing project is a Lisp OS. I recommend you skim through the thread, you'll find posts by other anons talking about their projects.
>>32938 Here's a small update to the Lisp OS project: >finished almost all of the porting work to port it to x86-64 (only need to re-do the IDT, but I'm not using interrupts for now, so doesn't matter) >got 'if' working (was interesting most Lisp functions and primitives evaluate all their arguments, but doesn't, so it's implemented pretty differently to other primitives >cons, fixnums and chars work without a problem (can car and cdr with cons; can add and sub with fixnums; can print chars)
I'm now finishing up strings. It's going pretty well, just need to figure out some stuff and it should work without a problem.
Next I'll move on to symbols, so I can implement global variables.
>>33038 i use AI to get the best results from a problem. nothing like machine learning that would be good but on uni i really can't learn more about a subject
that os you are doing is a unix redestribution? from what i gather lisp is good because of the hardware soo it can't really be used widely and is good only for a set of problems.
>>33059 >i use AI to get the best results from a problem.
I can't think of way to better generalize all of AI. What is "AI", and ML, if not just a way get the best results for a problem?
>that os you are doing is a unix redestribution? from what i gather lisp is good because of the hardware soo it can't really be used widely and is good only for a set of problems.
No, the OS is not based on UNIX. All of the code is written by me, and the philosophy is closer to Lisp Machines and TempleOS than UNIX (or Linux):
Well, Lisp does have hardware problems, simply because it doesn't adapt well to the von Neuman architecture. But, I wouldn't say that Lisp "is good only for a set of problems", because it certainly isn't. The innovations Lisp has introduced to programming over the years as spread far and wide. If it wasn't for Lisp, you'd still be programming in C. Here's a good article about it: http://www.paulgraham.com/diff.html
I use Lisp whenever I can, which is basically always, except for problems where efficiency and low-level control is REALLY important.
Any good books on assembly? I've been reading Assembly Language Step By Step : Programming With Linux. I've also got The Zen of Assembly Language and The Art of Assembly Language too, but they're older and a little less easy to understand.
>>33529 Well, first of all, what would you define as a "server based programming language"? I'm pretty that by "server based programming language", you don't mean a programming language "based" on servers.
Also, python and ruby aren't "web programming languages", they're general porpuse/scripting languages.
Most "contemporary" languages today are defined not by standards, but by implementations. This is really just another symptom of pajeets taking over, and so I recommend you stray away from these languages (and all of web development in general).
>>33529 In JS itself not much has changed. Most additions are stuff that nearly everybody was importing from same libraries, new browser features, and sugar that makes it more compact and helps avoid mistakes in common usage scenarios. What really changed was the toolchain you use to build apps with it. Now you install dependencies with a single command, have parts of your app reloaded on the fly after saving changes to views, and have cutting edge syntax translated for current browsers.
C# is made by Microsoft specifically for pajeets. Java is shite too.
Stick to C, assembly and Lisp. Those are the only pajeet and SJW free languages (or at least, as close as it gets).
But more importantly, what do you want to do? If you want to do web dev than there's no way to avoid cancerous languages. If you're more interested in lower level stuff (like C and asm) or more pure theoretical stuff (like Lisp), then you're pretty much fine.
>>33573 Both are solid choices. Doesn't matter. Just make sure that you have some interest in the most common usage domain of the language you end up learning. And that there are junior jobs in your area.
I want a job and they are mostly for java, c/c++/c# and js.
If I am going for assembly, lisp or C I will be probably facing the old guard people, guys in their 40s with much more experience, I don`t want to go autistic on it, I just want a job and that`s it and I kinda like web dev.
How hard is it to find a job with assembly, lisp or C? And against who I am going to compete for them?
>>33599 >I tell me the languages he wants to learn are pajeet languages >He tells me he wants to be a pajeet
I know it can be hard taking the pajeet meme seriously, but you should know that it didn't come out of nowhere. The pajeet meme represents everything wrong with contemporary commercial programming: >Inefficient OOP languages made so dumb people can't fuck shit up too much. >The cheaper the better! >What does "Planning for the future" mean? >What do you mean we should improve our security system? You shouldn't even be looking at it! Shut up or we'll take you to court! >Pajeets and succubus good cuz muh diversity quotas! > etc.
I hope you understand that the jobs for pajeet-tier languages are filled with that kinda of bullshit, on top of you having to compete with literal pajeets making 3$/h in India.
Yes, it is significantly harder to find a job in assembly and Lisp (C is filled with pajeets for the most part, simply because of it's universal), but these jobs will be much more rewarding, mentally and financially.
The reason there are more jobs for pajeet-tier languages is because companies want to just push the product out of the door for the lowest price, with no concern over security or quality.
For pajeet-tier languages you're going to be competing with literal Indians making a stupid small amount of money for a piss poor job, but the companies don't care, the damage of their piss poor job will only be felt in the long term, and their cheap price is much better for the short term.
For other languages, you'll be competing with westerners for VERY well paying jobs (expect to make 100k$ per year in 5-10 years, easy) with a high skill demand. Don't be fooled by the number of people working on shit languages, the demand for skilled programmers is VERY high. If you can prove your skill, expect to very easily get a job, with the added benefit of not being a codemonkey, so you can actually rise up in your career later on.
Now, I was very harsh and made generalizations about certain languages, and I want you to know the truth isn't black and white. For example, Python is often loved by SJW codemonkeys, but it's genuinely a good scripting language. C is also full of pajeets, but it's also great. Most languages can be used to make high quality programs, but some (the pajeet-tier ones) promote bad design, very costly abstractions and a general feeling that you can ignore the hardware (which is NOT true, even for Lisp).
>>33038 I've been bared from working for pretty much 2 weeks, so I'm kinda of picking up the pace again, here's the progress report: >Implemented strings, symbols and global variables >Made small optimizations to the compiler and simplified some of the macros/functions a bit
I'm now working to implement functions as a data type, starting with lambda and funcall.
Do any of you have a job doing this? I'm looking at interview questions and some of them are labelled as 'telephonic question'. >Given a string, find the longest substring with k distinct characters.
I could solve it now, but I'm pretty sure my mind would blank if someone asked me it over the phone, or if they were looking over my shoulder.
>>33705 No, they hire people with the minimal skill to do the job, and that skill is "knowing" the language. If they want someone to maintain their shitty java program, the'll just put out an ad looking for a java programmer, that's how it works.
If you don't know the language, it's either a very obscure language that they'll probably give you some training for, or you're not fit for the position, considering there are many more applicants that do know the language.
>>33706 I do have what I'll call "professional experience" in programming (worked in a professional environment doing programming), and I saw a all lot of googling of basic stuff, even in front of the boss, without any second thought about it.
Those questions (FizzBuzz is the most well-known of them all) are really just made to rule out those that don't know even the most basic thing about programming, which rules out a surprisingly high amount of theoretically qualified applicants.
In the end the best way to show your knowledge is by showing them what you've done, either prior professional work, or amateur projects.
>>33702 >The basic skeleton for let and lexical variables is done, now just need to fix up some stuff evolving calling functions inside the body of the let, and it should be ready >Tomorrow or later today I should be able to make significant progress in implementing functions thanks to let.
is there any way to do this quickly? any guides, etc? i mean, besides the website for it (useful, but no exercises) and the book behind a paywall. does anybody know anything about it, is it very different from other languages, etc?
it seems it's pretty useful for making basic scripts to enhance scenarios for various games; i don't need to write entire programs from scratch, just to alter properties of various units and behaviors (i assume that most of what i can do will be handled by pre-made functions that allow me to directly touch in-game objects, for instance)
is there any trick to this besides basic if then else do while repeat until / and assigning values to variables(?) i feel so uncharacteristically out of my depth about the whole thing. it doesn't seem too tough, but maybe it's just dunning-krueger and i'm actually a useless idiot who doesn't even know that he's clueless?
Considering what you want to use it for, that page combined with something telling you what variable does what for whatever game you're working work should be plenty to get started!
So I've started learning programming very recently. I chose to start with Python since it is often recommended for beginners. The only experience I had beforehand was the little that I did in high school.
The thing is, I feel like I'm progressing very slowly. Basic excercises are giving me trouble. I can easily understand the solutions that I find online. Applying what I've learned to come up with them myself, on the other hand? My mind goes blank, much of the time.
Do most people learn the basics easily? Am I just dumb and should give up? Or would you say this is normal for a beginner and I should keep trying?
>>33715 Not knowing what book/s you're reading and what exercises you're doing to learn, it's a little difficult pointing out the exact problem, but it might have something to do with dividing the problem into smaller, easier problems.
Have you tried making small functions to help you with your problems? If not, then either try forcing yourself to learn a functional style, or embark on such a big project, that it really can't be done without functions.
I recommend you take a look at some of the exercises posted above and find something on your level. Also, be careful with the size of your functions, they should really just do one thing. If one starts to get too big, and does several very different things, consider splitting into small functions, it will be much easier to understand the code, and therefore, debug it!
Thanks for the advice. I think I should definitely focus on trying to break things up into smaller problems.
I'll look into the excercises that were posted here. The basic ones seem fitting for me right now, and I won't be running out of ideas later on, at least!
>>33702 >The reason there are more jobs for pajeet-tier languages is because companies want to just push the product out of the door for the lowest price, with no concern over security or quality. I can attest to this. I live with it every day. The mentality is pervasive in shitty enterprise/web dev shops: cargo cult "engineering" (hurr, Google does it/Martin Fowler said it so stop arguing), mindlessly following the latest retarded tech fad making the rounds on Hacker News (because they themselves lack the knowledge to make appropriate design decisions), meme management practices optimized for wrangling hordes of marginally competent codeniggers and shitting out software as fast as possible, and a general culture anti-intellectualism and unwarranted self-confidence. I hate it so much.
I think I'm going to be stuck here forever, spending all day with these godawful programming languages, working with morons who believe their personal opinions are just as valid as theoretically-grounded facts.
I'm trying to escape codemonkey hell, but it feels so hopeless. I can't focus on my own projects for long enough to complete anything substantial, and I have been doing this bullshit for years and have nothing to show for it. >Most languages can be used to make high quality programs, but some (the pajeet-tier ones) promote bad design, very costly abstractions and a general feeling that you can ignore the hardware (which is NOT true, even for Lisp). The funny thing is that even if you try to write good software in a shitty pajeet language, your coworkers will find a way to shit it up and your manager will complain because it's not following the Established Pajeet Code Guidelines (you see, pajeet is terrified of things he doesn't understand, such as logic). Blech.
Maybe I'll finally lose it and pull a TempleOS with a programming language I've been thinking about.
>>33720 We aren't arguing about which language is better, we're arguing about which languages will get you a job in a pajeet breeding ground, and which one's want.
>>33719 Thanks for backing up my arguments with your own experience.
I know the pajeet thing might sound like just another meme, but it's the result of programmers that are actually interested in quality programming being constantly put down by codemonkeys and greedy companies. >Maybe I'll finally lose it and pull a TempleOS with a programming language I've been thinking about. >He doesn't code in HolyC
Can you guys just a give a list to database and programming languages without pajeets and companies filled with bad source to reduce costs and this way making you out of the market even if you are better than pajeets?
>>33735 ksh, tmux, vi. Thinking of switching ksh to zsh and vi to vim but I'm kind of lazy, and stuff like zsh need some configurations so I don't hate it (particularly with some arbitrary ass completion schemes it has by default) and I'm too lazy to go read the manual.
>>33712 Spent all weekend and a big part of the week procrastinating, hence the delay. Anyway, here's an update: >Got functions "fully" (obviously haven't implemented advanced features like optional arguments and rest) working! Very excited about this!
I think I'm now going to work on implementing the eval function (essentially an interpreter) without any asm (this has been a big goal of mine since the start, and the implementation of functions has finally opened up a way for me to do it). Eval itself will be easy, harder will be implementing "read" to read keyboard input and transform it into a list to pass to eval.
Thread suddenly died after a rush of new posters, weird
I'm going to implement some popular sorting algorithms in C to help prepare for an interview in a couple of days. I'm also using this as motivation to finally install linux on my new desktop because it's awkward to work on my laptop given my physical desk space situation. I'm going with Debian since I haven't used it before (I'm familiar with Ubuntu, though).
>>33735 A bunch of tiled/tabbed Vim instances in i3. While I'm accustomed to manually searching through documentation, I may try some auto-completion options on my new install. For python development, I use jupyter (ipython) notebooks; it has nice features, particularly inline plots.
>>33907 I recommend YCM for autocompletion in Vim, it's fucking great (pretty hard to get it setup though). I also highly recommend clang-format plugin for Vim to help massively with formatting FORTRAN family languages.
Your use of i3 interests me; what distribution are you using? Why aren't you just using tmux?
>>33898 Neat. I am the other guy who's been considering implementing lisp low-level and implementing functions were one of the things that puzzled me. I'd say that implementing eval represents the point where you have a complete lisp core.
I'm using Fedora right now. My use of i3 is actually a recent development because I previously just had terminals side-by-side in GNOME and more recently XFCE. I would just alt-tab between them and use the built-in tabbing system that gnome-terminal and xfce4-terminal have. In the past, I've just wanted to get started and didn't have sufficient motivation to customize my environment because what I was using was "good enough". Essentially, my use of i3 is just my first time experimenting after being too lazy to customize for several years. I will also look at tmux and compare that with my recent experience with i3.
>>33911 Yeah, I've been thinking about using i3 for a while, but Ubuntu just works, you know? I'm too focused on more important things than spending a month configuring Arch. I've already spent too much time fiddling with Linux.
>>33909 >I'd say that implementing eval represents the point where you have a complete lisp core.
Indeed my friend, I'm silently excited about my success.
Oh, and btw, to implement functions, I compile the expressions inside the lambda, and then make a let holding the variables. It certainly is pretty tricky, but I'm happy with how fast it went.
>>33912 >Oh, and btw, to implement functions, I compile the expressions inside the lambda, and then make a let holding the variables.
Hum, let me clarify that a little bit: >I compile the code of the function >When it's called, I setup the lexical enviroment , this essentially means making a let where the bindings correspond to binding the variables the function expects to the passed arguments >I then jump to it and let it do it's thing >Then just restore the lexical enviroment to what it was and return
Here's what it looks like (in theory, in practice I had to basically compile big parts of it by hand):
>>33907 I only got around to merge sort, and it's not "comprehensive", but it's better than nothing. Using C for the first time in three years was harder than I thought. Hopefully it isn't too pajeet-tier: https://a.desu.sh/fnxlzm.c
I ended up installing Fedora instead of Debian because the install image didn't ship with the right wireless drivers and I have no ethernet access. I tried transferring them over USB, but that didn't work right away and I didn't want to spend any more time troubleshooting.
>>33970 The code looks pretty good to me, no glaring flaws. Really only thing I would change would be the name of the 2nd argument to mergesort from "l" to "len" or "length", to make it clear that "l_len" refers to the left list, and not the original "l" list.
Also, I would rename "mergesort" to "merge_sort", not sure why you chose not to use an underscore when you use them for everything else.
C is surprisingly easy to pickup for anyone coming from any other FORTRAN family language, so don't expect to ever "unlearn" it. With that said, the only thing in C that can cause some headaches is really double pointers and knowing the practical differences between an array and a pointer.
Small update: >"Fixed" a problem with malloc (will probably completely re implement in Lisp when I get to doing garbage collection, so the fix was only temporary) >Made defun to simplify making functions (no longer need to do something like (set 'fact (lambda (n) blahblah)) to make a function)
There's still a lot to do, but the framework to do it has been laid down, and it's only about 350 line of CL code and 350 of assembly (for the compiler).
>>33970 At a glance, the C code looks well to me. I didn't actually try to make sense of it in detail, but the overall structure and the individual statements (that last part is usually the clumsiest part of a beginner's code) look like good C.
Is there a Scheme implementation similar to MIT-Scheme? I am afraid of getting a random interpreter and in the mid of the book stumble upon unknown commands, given that the language received several updates since SICP was released.
Note the integration with Emacs, that should help you out a ton with getting some sort of IDE started, do check it out, it will help you so much!
Also, I don't know exactly how scheme has developed along the years, but I know that the Common Lisp standard focuses quite a lot on compatibility with several older Lisps, so it's possible that Scheme does too.
>>33987 >tfw one mistake with popping values from the stack leads to your function crashing in very specific situations
Small update: >Made "cond" >Fixed a bug with "funcall" where it failed to save the lexical environment in the stack because it popped the wrong thing from the stack
>>33970 I'd like to further recommend for you to do some more exercises with pointers and, especially, double pointers. Stuff like implementing linked lists (or even a malloc which uses linked lists to store the available blocks, which is what I did for my OS) or some other form of "complex" data storage should be pretty fun and helpful.
>>33970 Could you also show us the body of the merge function? I don't see where you allocate sorted on the very first level of recursion. Since you're passing an uninitialized pointer to mergesort, you would get undefined behavior with a list of length 1 (and possibly other lengths, depending on the initial value of sorted if you simply check for sorted == NULL in merge).
>>34025 EDIT: Okay I didn't notice the link, upon looking at the code in it I see that you never allocate sorted for the first level of recursion, which produces a segfault for me as expected. This code has pretty slim chance of running correctly, and I'm surprised it did for you.
>>34026 You're right, that's odd. I think changing [code]int *sorted; int list[] = { 22, 79, 83, 69, 41, 35, 76, 42, 41, 41, 2, 94, 50, 93, 69, 23, 51, 79, 28, 52, 9 }; int length = 21;[/code] to [code]int list[] = { 22, 79, 83, 69, 41, 35, 76, 42, 41, 41, 2, 94, 50, 93, 69, 23, 51, 79, 28, 52, 9 }; int length = 21; int *sorted;[/code] should fix it. Running a list of length 1 still works for me using the original code, but I don't think that matters and it should have resulted in a segfault for any length. Even if it isn't used on the first level of recursion, it will be used in the final call to merge.
Updated: https://a.desu.sh/fbsdgj.c We do have code tags, I hope.
>>34028 the code in the link you posted looks good to me, you seem to have posted the wrong thing in your post though. >"We do have code tags, I hope." >says increasingly worried wizard
>>34019 Another update: >added type checks to all primitives that need them >added an "include" primitive to compile another file during compile time (like in C) >got a basic "eval" working
>>34028 Yeah, now that the code does the job, we can optimize it further.
Notice that the list is read-only, which means you don't have to split it into two smaller lists explicitly, you can just pass the pointer with an offset to the second recursive call. I've done some benchmarking and it turns out that this version if about 50% faster than the current one.
Moreover, algorithms such as merge sort and quicksort perform worse than insert sort for small lists. Although they have better O complexity, they also have worse constants. That's why I've added a test at the beginning to check if len is sufficiently small and if so, make the function use insert sort instead of merge sort. This version if about 100% faster than the current one.
Lastly, on a side note, local arrays are better than dynamic arrays in terms of performance, but they can easily lead to stack overflow for large values of len. Use them only if you're sure that your code doesn't need to handle very long lists.
I would like to learn programming,the problem is that I suck at math…like really suck (funny because I used to be ok at math back in middle school,but I forgot everything).
There's hope for me? Where I can learn enough math for programming?
>>34088 I don't exactly know what you mean by "really suck." Can you remember operator precedence for the big four (addition, subtraction, multiplication and division), do basic calculations in your head and round numbers? That's about how much you have to know to get started with programming. If you have problems, I recommend you read the first few chapters of "Basic Math for Dummies.": http://rajeet.yolasite.com/resources/Basic%20Math%20%26%20Pre-Algebra%20Workbook%20For%20Dummies.pdf
Of course, if you want to move on to game programming later on, you'll have to learn proportion and some basic vector math, trigonometry, etc., but in general you don't need much mathematical expertise to program well. Programmers often use mathematical theorems in practice without really understanding how they work. Bisqwit is a great example of that. In his raycasting 3D engine video he uses vector cross product and projection while admitting that "it's like black magic to him."
>>34088 Well, you certainly don't need to know math for pajeet-tier programming, so I guess you can get pretty far with 1st grade math.
On the other hand, if you don't want to be a pajeet, you also certainly don't need to be some sort of math genius. Much of the theoretical side of computer science is based on math, but by math I don't mean just pure calculus and trigonometry. The math you'll need for computer science is more of the intuitive kind.
For example, the time it takes to execute an algorithm is one of the most important parts of computer science, but you don't need to know advanced calculus or trigonometry to grasp it.
You also don't need high-school math to understand Turing machines or the mathematical beauty of Lisp. >>34043 >added "asm" to allow compile-time use of assembly >in the process of changing "eval" to work better for a REPL >also working on "read" and keyboard input
Toady is probably not a wizard but he seems to have the ideal codewizard lifestyle. He gets to work on his huge neverending project forever and get thousands a month by normgroids who enjoy his game.
>>34093 Thanks,great book,do you have anything more advanced for when I finish it?
I used to have programming classes back in High School,they did things like fibonacci,prime numbers,encryption,etc and I couldn't understand pretty much anything,it certainly interests me a lot,developing a useful software or a small videogame,but I thought that only people gifted at math could do it.
That's why I'm trying to learn web development (add Free Code Camp to the OP,it's great) as it seems to be very very light on math,I hope it stays like that.
I went through all of this (and part 2) and it improved my programming massively. Better than any other course I've taken. It starts off simple, but it ramps up pretty quickly. Some of the exercises will tax you.
If you've been struggling for a while on an exercise though, then carry on. Don't get too focused on completing everything. Can always come back with a fresh outlook later on
hi wizards, i'm really fucking terrible at this shit. i posted upthread about lua, and now i come to you with i hope a slightly more useful question:
for a scenario i'm writing i need to call a function that identifies the time of day, bind that to a variable, then activate a mission based on the result (so, a conditional. if it's 9 o'clock, 50% of the time it will scramble the jets, then a 50% chance again every 3 hours) however, because i am an idiot i cannot think of a way to do it besides just listing ifs like this:
if time = 9 then b = math.random(1,2) if b = 1 (do nothing) if b = 2 (scramble jets) if time = 12 then c = math.random(1,2) if c = you get the idea
etc. obviously this is really fucking terrible because it takes forever to write and it's not scalable. ideally i'd like to check every 3 hours onto infinity. is this what i use a for loop for?
anyway sorry if that's not clear, but i need a way to every 3 hours check for a true value then call a function. uh, my terminology might be all wrong too. shit.
Is there any place to get codes or help with programing for physics in c++, like example codes? I need to numerically integrate, solve ODE's numerically, and plot trajectories. My current assignment is to solve ODE's with verlet integration, euler's method and runge kutta methods. Computer Science textbooks teach you the syntax, but don't provide you with any physics examples.
>>34111 I'd recommend exploring sites such as MathIsFun or KhanAcademy, but I think that if you want to learn programming you should just focus on that, and tackle the mathematical problems as they come. Like another person said, there is a lot of math in theoretical CS, but you won't see much of that in your average textbook; there are works dedicated to, for example, algorithm analysis, but I don't recommend reading those until you have solid understanding of the basics.
There's also another use for math in programming, i.e. various branches of math dealing with specific kinds of problems (geometry for games, statistics for search engines and content recommendation, etc.) Since the usability of a branch is entirely dependent on the type of a problem, I'd advise you to learn them along with projects you'll be working on. Once you get more experience and know what you're interested in, you can focus your research on a specific branch that is useful in that area.
Most of web development doesn't require math and it is in large part about communication between various parts of a web app. What I don't like about web development is that frameworks force you to use many high-level abstractions in order to manage complexity. I tried making a few simple web apps in Ruby on Rails and decided it's not my type of programming. If I ever made a real web app it would probably be from scratch in Go.
>>34122 I don't know LUA, but general approach for something like that in programming is to use modulo (division remainder,) which we denote using % operator. 3 % 3 is 0, 4 % 3 is 1, 5 % 3 is 2, 6 % 3 = 0, 7 % 3 = 1, etc. If time % 3 = 0, then time is divisible by 3. Thus all of your code can be condensed into a single if statement:
if time >= 9 and time % 3 = 0 and math.random(1, 2) = 2 then (scramble jets)
>>34126 Pajeet is a stereotypical Indian name, and is meant to carry with it the idea of a stereotypical indian code monkey with all the baggage that entails. This "pajeet" is the mental image one conjures up imagining that random guy in India who is being given work from countries where wages are higher, despite their lack of proficiency, simply because they are cheap.
>>34131 ah, you're a genius anon. i never thought of using and. there's a large red palm imprint on my face. that makes more sense.
another snag though: the script "works" (IE, it returns valid syntax and it runs) however the modulo function is too exact; the program doesn't execute every .01 seconds (or whatever fraction) so the script never really activates because when it runs time is always a decimal and never returns exactly 0.
is there some way to tell it to chop the decimals when running and/or "if % time is a decimal of zero, then" etc?
i could use if % time <= 0 then however i'm pretty sure that always returns true because time is always a positive number.. so as far as i can tell i need to use == (exactly equals) but then it never runs.
thanks for your help so far btw, the modulo function was exactly what i was looking for but i'm not skilled in math so i didn't know what it was called.
I criticized the pajeet mentality and the situation that promotes it, but only in relevant circumstances.
Not only that but, I mentioned it because the "pajeet meme" is actually real, and, as another anon has pointed out, it's ruining the IT field, especially for us wizards interested in computer science.
I don't want to make of this a long discussion, I'm just pointing out that "pajeets" do exist and aren't just a /g/ meme.
>>34142 Rethinking the problem, the code I suggested might not give you the desired properties, depending on what you want to do (for example, if you only want to launch at integer times).
>>34144 nah it's OK anon. the solution i eventually settled on is a little hacky (if time % 3600 < 50 then)
it means that it will launch fighters to intercept as long as it is within ~1 minute or so of the hour, assuming that the other conditions are met (probability, enemies nearby, etc) hacky because it launches only on one side of the hour (after the hour and some seconds) but whatevs, it works. more importantly, it gives me a blueprint to follow to use for other, similar functions (you can just replace the values and you can set up an almost arbitrary number of conditions & end results)
it was very helpful, thanks.
also i've always thought that .jpg was hilarious and i didn't think you were insulting me.
>>34153 What's the exact frequency with which that function gets called? Because if separate calls are not at least 50 seconds apart, there's a possibility that the condition will test positive more than once (for example when it's called twice with 3603 and 3649 as time values), on the other hand, if the calls are more than 50 seconds apart there's a possibility that the condition will not have a chance to test positive even when it should have (for example called twice with 3599 and 3650). You should use something like this for more stable results (note that I don't know any LUA):
// global variables initialized to 0 timePrev = 0 timeCnt = 0
// our function of interest, time an argument that will get passed to function by program when it's called func callback(time) { timeCnt += time - timePrev timePrev = time if timeCnt >= 3600 { timeCnt -= 3600 if math.random(1, 2) == 1 /* and other conditions are met */ { // do the stuff } } }
>>34165 i think it depends quite a bit on the time compression as to how often it's called, but i could be wrong about that. i tested it on various hours and compressions and it seemed to work flawlessly.
it getting called twice is not actually a problem, save one of inefficiency. there is no downside of aircraft getting assigned to a mission twice. in fact i think there should be a way to set a conditional to stop it from running again once the aircraft are assigned. maybe. i'll look at it. >that example
hmm. i assume that some of those things don't mean what i think they mean. for instance, what does += and { mean in your context? i think i understand the general thrust though, thanks. i'll probably have more questions about all this stuff. i'm continuing to work on it. lua is sometimes a requirement for complicated scenarios.
>>34172 Yeah, sorry I used pseudo-C syntax, here's the same example after I tried translating it to LUA (I'm not sure if it's syntactically correct though, I've made it just to convey the conception):
– global variables initialized to 0 timePrev = 0 timeCnt = 0
– our function of interest, time an argument that will get passed to function by program when it's called function callback(time) timeCnt = timeCnt + (time - timePrev) timePrev = time if timeCnt >= 3600 then timeCnt = timeCnt - 3600 if math.random(1,2) == 1 [[ and other conditions are met ]] then – do the stuff end end end
Essentially timePrev keeps track of what the time value was in the previous call to callback function, it's initialized to 0, since if the function hasn't been called at all yet, we want to set it to the time at the start of the program. We can get the time that passed between the current and the last call (or start of the program, if the current call is the first one) by subtracting timePrev from time. Then, we add that value to the second global variable timeCnt, which, at the beginning, simply keeps track of how much time passed since the start of the program. Once the counter reaches 3600 or more, however, we restart it by subtracting 3600, so that it counts time since that moment onward. We subtract 3600 instead of setting it to 0, because we can get more accurate frequency this way. We want to run it every 3600 seconds, but it's very rare that the timeCnt will have that value, if it's, for example 3643, we want to do the thing, but also, since actually more than 3600 seconds have passed, we set the counter to 43, so that the next call will happen in a little shorter amount of time, to balance the fact that the current call took a bit too long.
Now as to why this is a better approach and why you should use it: your code works now, but it's not conceptually correct for what you want to accomplish. If the frequency with which the function get's called changes for whatever reason, your code could stop running properly. If you plan to use this code for a prolonged period of time, something like this could happen in a month from now and it would take you a while to get down to the root of the problem. It's better to solve problems like these before they have a chance to appear. Also, to me it seems like the conditional to check if the planes have launched already is a bad idea, take a look at something like this, for example:
planesLaunched = false
function callback(time) if time % 3600 < 50 and !planesLaunched and math.random(1, 2) == 1 [[ and other conditions ]] then – do the stuff planesLaunched = true else planesLaunched = false end end
First of all, this protects you only from the problem that arises when the function is called too often, it doesn't change anything if the function gets called less frequently than it should have. Secondly, if function the gets called three times with, for example, values 3601, 3620, 3643, then math.random and other conditions still get evaluated two times and there's possibility that planes will get launched two times. And even if the function gets called only two times, the real chance that the planes get launched is actually 75%, not 50%, because if planesLaunched isn't set to true the first time, the second call still has a chance to test positive for all of the conditions.
Anyone have experience with freelancing as a programmer?
I'm struggling to think of what to put in my portfolio. I know a bunch of languages and technologies but I don't have any projects to show off. Can I get away with making a bunch of basic projects to just show that I have knowledge (i.e. simple shit like a ToDo list app etc. in AngularJS, C++ Tetris game, similar "learner" projects) or do I need to have actual big original projects to get hired?
>>34394 Some say that having a Github account with lots of commits and some projects is good too, but I don't know, never tried it. Programming is just a hobby for me.
>>34394 What >>34400 said and fork some projects and commit everyday with stuff like comments and the like if you want to cheat. If you don't really want to cheat that bad, fork them but study them and write actually insightful comments
I'm working on a game with procedural terrain generation, something similar Minecraft or Dwarf Fortress. For now I've written 3D Perlin noise implementation and generated some GIFs like this to test it.
Suggestions for things to read for some of my complaints pls:
- I do not get the "point" behind OOP. Why it's useful and when to apply it. - It feels like 90% of my time programming is spent messing with i/o instead of…actually making algorithms and coding. - I do not get the point of a lot of error management techniques, things like why try/catch is superior to traditional conditionals, etc..
OOP kinda works better for most large and/or long term projects. if you are the sole author of all the code it doesn't really matter and is mostly personal preference/
I/O is time consuming, but there are libraries to make shit easier. Java 8's new File class is amazing and it eliminates a lot of code.
The try/catch type of error management is basically an abstraction of hidden low level conditionals.
OOP is just all about thinking of blocks of code as 'objects'. You give an object to something else to handle and do something to. I remember having to remember shit that defined object oriented programming such as encapsulation, inheritance, polymorphism, and overloading, which is what defines OOP, but really all that stuff becomes internalized fairly quickly when you code in an OOP language.
A quick google search of 'OOP programming exercises' will provide you with a ton of examples to help you understand the concepts of OOP. The first google result for me was this:
I like that result because it also shows UML diagrams, which are a useful thing to learn because it is a really compact way to describe your classes.
If you are really new to programming, the MIT OCW introduction to computer science lectures are the best thing on the internet right now, I think. You can find that here:
I think learning "good code" is about a semester's worth of learning, but here are a few pointers off the top of my head:
Good code is typically stuff that is easily readable. Stuff you can understand without comments.
However, things that require complex evaluation such as the inverse square root to understand are also good. In that situation comments are absolutely necessary. So I suppose the rule of thumb is to make your code as self descriptive as possible, unless that gets in the way of efficiency. Proper naming conventions should also always be followed. Personally I always use CamelCase, with classes being capitalized, and all variables start with a lowercase letter. This is the standard in java I think. I also use K & R style for braces placement, but in the real world that depends on the organization you work for. Descriptive variables are always a requirement, since the length of your variable doesn't really matter.
Individual functions shouldn't be too long. If you cannot view your function without scrolling down, it is probably too long. If you think ANY part of your function's code can be reused, put it in another function.
>>36141 Ideally, code that does what it should in the fastest way possible while also being readable and easily maintainable for any reasonable competent individual.
Realistically, code that does what it should, more or less, while balancing speed and readability depending on what's more important for the project.
>>36182 >When should sql be used? When you have large quantities of data with complex relationships and constraints. SQL is based on the relational model, a data model for representing and manipulating data at the logical level. Additionally, SQL databases try to provide ACID guarantees (usually only relevant when multiple users are changing the database at the same time).
Basically, if you have a lot of data and you want it to be easy for people to analyze, manipulate, and define machine-enforced constraints, SQL is what you're looking for.
Put another way: SQL is for managing important "enterprise" data, that is to say, data that is significant to humans rather than machines. SQL is often the next step from a spreadsheet.
If you're asking because you're trying to choose between SQL and the various NoSQL databases, that's going to depend on what exactly you're trying to do. For some use cases there are simpler databases perfectly suited to the task (such Redis for caching or S3 for distributed file storage). Others are designed to scale better for certain data sets than current SQL databases (something you probably don't need to worry about). Most of them are just trash preying on uneducated web devs who don't know how to do proper data modelling in SQL. >What are its advantages over json/xml. What are their advantanges over plain old csv files? SQL is a language and set of standards for database management systems; JSON, XML, and CSV are text formats for structuring data that have nothing to do with databases. They are typically only used to transmit data and not for long-term storage because they are inefficient for computers. Binary formats are what serious databases use under the hood because they are more efficient, but text formats are human-readable and don't require a special application or hex editor when you want to quickly change something by hand.
The advantage of JSON and XML over CSV is that the former two can represent arbitrary nested structures and sets of objects with different attributes. This flexibility comes at the cost of making them much more expensive to parse and annoying to work with analytically (please don't store your data as a giant list of JSON/XML objects, you'll thank me later). They are convenient if you're transmitting individual or nested objects with complicated attributes over a network.
A CSV file is essentially a single table and is obviously much simpler if your data can fit into a table nicely. Often though, the data actually belongs in multiple tables so the CSV gets really ugly because you're mashing a bunch of unrelated stuff into one table. This is one of the issues normalization solves in an SQL database.
I realize that I've been fairly abstract with this and haven't provided any examples, so feel free to ask for clarification.
>>36184 As for JSON/XML, the main advantage is just when you want to encapsulate your data, basically, right?
As for SQL, from what I'm reading of you, the main advantage of SQL is database normalization, right? But can't you "normalize" a csv file into separate csv files the same way you'd "normalize" a SQL database into a bunch of different tables? And if so, why not just stick with the csv files, since they're so much easier to io and generally work with?
Just to bring in an example, say I had a bunch of climate data, consisting of latitude,longitude,and wind speed around that grid point (e.g., Uncharted Waters). If I had a csv file of a giant matrix of latitude x longitude, I could just read the temperature as T(i,j) for the ith latitude and jth longitude, right? But if I used SQL, having potentially >10k columns of different finely grained longitudinal points, then that's considered "bad" for a database (right?), and instead it would be preferred to make a [latitude,longitude,value] table.
>>36205 >As for JSON/XML, the main advantage is just when you want to encapsulate your data, basically, right? They're basically to give an "object" or "document" structure to your data. So for your climate sample data it would be like `{"coordinates": {"latitude": 0.0, "longitude": 0.0}, "wind_speed": 55.0, "temperature": 25.5}` with JSON and, if you're a masochist, like `<sample><coordinates><latitude>0.0</latitude><longitude>0.0</longitude></coordinates><wind_speed>55.0</wind_speed><temperature>25.5</temperature></sample>` with XML. Obviously this is more useful with complicated nested structures and overkill for such simple data. >As for SQL, from what I'm reading of you, the main advantage of SQL is database normalization, right? The main advantage of SQL is its performance, data integrity, and data manipulation features. >But can't you "normalize" a csv file into separate csv files the same way you'd "normalize" a SQL database into a bunch of different tables? And if so, why not just stick with the csv files, since they're so much easier to io and generally work with? Sure you could, but then you would have to keep track of multiple CSV files. CSV is nice because it's simple and you can edit it by hand, but it's still relatively slow for computers to process. Probably won't be a problem for any data set that's less than a few hundred megabytes though.
A database will manage all of the tables in one place and store the data efficienly. It will also have indexes that can make data access much faster and is agnostic to row order unlike CSV. The main benefit though is that the database has an extremely useful query language and it will enfore all kinds of contraints such as data types, ranges, required attributes, unique constraints, etc. This can save you a lot of work that you would otherwise have to code yourself.
I would say the IO is generally simpler with SQL too since all you have to do is open a connection to the database and query for what you need (every serious programming language has SQL APIs). >But if I used SQL, having potentially >10k columns of different finely grained longitudinal points, then that's considered "bad" for a database (right?), and instead it would be preferred to make a [latitude,longitude,value] table. Yep. A table in SQL is essentially a set of answers to a particular predicate; a list of facts. So your example would be something like `CREATE TABLE climate_sample (latitude FLOAT, longitude FLOAT, sample_time TIMESTAMP, wind_speed FLOAT, temperature FLOAT, PRIMARY KEY (latitude, longitude, sample_time))`. The predicate for this table would be "At [sample_time], the location at latitude [latitude] and longitude [longitude] measured wind speed [wind_speed] km/h and temperature [temperature] C.", and each row plugs in values for the attributes in brackets. Most SQL database support geometric types too so instead of two floats for latitude and longitude you might do something like `coordinates GEOGRAPHY(POINT)` as an example from PostGIS.
The benefit of structuring things this way is that it makes it very easy to formulate queries such as "what is the average wind speed within at radius of 5 miles from this point?" or "what was the maximum temperature at this latitude 7 days ago?" and the database will be able to answer them fast without any extra effort on your part other than writing the query.
Again though, it depends on what you're trying to do. If I was making a game and all I needed was an in-memory grid data structure for climate, I would just use a two-dimensional array and write my own IO routines to read and write it as binary, it's not that hard.
I would greatly appreciate any help with learning how to use header files in c++. I've been stuck on trying to learn them for 3 weeks now, but nothing I do works and asking on normalfag sites ends with me being ignored. When I try to compile it says "no such file or directory" and it wont compile. I think it has something to do with the preprocessor, but beyond that I don't know what I should do to solve it.
>>36226 also when I build my header file "i.h", it says undefined reference to main and it wont compile. So, I went to the main.cpp in the i.cpp file which holds my header file, and I added "int main() {return 0;} and it compiles, but nothing shows up now. I have no idea how to solve this, can anyone please help me?
>>36226 First off, you're missing a semi-colon on line 4 of i.h
Second, you're trying to include a header file that is from another project (meaning different directory from where your main.cpp is located and the compiler can't find it).
To properly include it, either move the files to your "nu" project, or go into nu's project settings and set the additional include directories (basically, where should the compiler look for the files other than its main project directory).
I thinks it's right click on nu > Properties > C/C++ Parser Options > then add the directory where i.h is located. You might or might not need to use <> instead of "" after this, though.
>>36228 Thank you very much for trying to help. I forgot to save those projects so I made a new one with the same functions, just different names. Anyway, I did that and now it says "undefined reference to main", but when I add a "int main() {return 0}", to the function I made a header for, it compiles and nothing shows up. These are screenshots for what I just did.
>>36229 >>36231 Well, it's trying to compile the main.cpp from the lo project, where you wrote the implementation for the park function instead of your main source file in him. The implementation of your header should be in the same directory as the header and it should include the header at the beginning.
Example: Header: sum.h int add(int a, int b);
Source: sum.cpp #include "sum.h" int add(int a, int b) { return a+b; }
Then in your main.cpp file you should #include "sum.h" to access the functions.
The multiple project thing is fucking everything up, I'm not sure how to set the active project in CB, I mostly work with VS. Recreate everything in a single project, you should have three files, i.h, i.cpp and main.cpp.
I'm trying to make sure I understand database normalization correctly. Going to the climate example from earlier…
Say I have the table:
Dataset Latitude Longitude valueType Value
Where "Dataset" is the name of the dataset that the data comes from, Latitude/Longitude are the position on the Earth, valueType is whether it's temperature/pressure/etc., and value is the temperature/pressure/etc. at that latitude/longitude for that dataset.
If (Dataset Latitude Longitude valueType) is the primary key, this is in third normal form, right?
>>36314 >If (Dataset Latitude Longitude valueType) is the primary key, this is in third normal form, right? At a glance, yes, but it's important to understand that normalization is a consequence of the logical model of your data. Hence, I cannot say for sure unless I have the same context for the data that you do.
I'm assuming that you are pulling data from multiple data files with the same format.
Some things I noticed:
1. What distinguishes the datasets other than file name? There could be potentially valuable information you're not including in your table. Unless for your purposes you only care about what file the data came from.
2. valueType. How many value types are there? Can you assume that every single one will have the same data type?
For example, if the datasets had the format latitude,longitude,windSpeed,temperature,humidity then you would be better served by defining your table as climate_sample(dataset TEXT, latitude FLOAT, longitude FLOAT, wind_speed FLOAT, temperature FLOAT, humidity FLOAT).
I will mention that although I've been defining latitude and longitude as floats, it's bad practice to use floating-point numbers in a key. This is because keys are used for exact comparisons. SQL has a decimal type with exact precision which should be used instead. A spatial type would be even better since it will use a more efficient spatial indexing scheme and perform conversions automatically, although spatial types are more complicated to use.
Now if the datasets have different parameters and you need to be flexible, the table you have would work as long as you know that all of the parameters will be real numbers. But if you have parameter that has a different type, such as an integer, boolean, or a member of some user-defined set, it should have its own attribute with the appropriate type. The way many programmers would approach this problem is to encode them all as floats, I would caution against doing that: it makes the data much more difficult to understand and either introduces bugs (for example, negative wind speed) or expensive and unnecessary constraints to control them.
The proper way to handle that sort of situation is to have multiple tables for each entity subtype (this is a discussion of its own). This can be done elegantly, but it is a bit more advanced. For example, let's say you have an additional dataset over bodies of water which adds water temperature and 'S' or 'F' (for salt water and fresh water). These parameters don't make sense over land, and one of them is not a float type. You could do this:
I'm also not completely sure what happens memory wise in a database. I'm assuming databases are somewhat "smart" about their memory usage? In other words, if I add 30k rows under the same dataset, when you store the rows, will it copy the same 'dataset' entry 30k times? >1. What distinguishes the datasets other than file name? There could be potentially valuable information you're not including in your table. Unless for your purposes you only care about what file the data came from.
In the case I'm looking at, the difference between datasets is that some datasets have, say, pressure datatype, while others don't. Or some have higher resolutions (every half degree latitude and longitude) while others don't (they have a value every 5 degrees latitude and longitude). Some have pressure data at one resolution and temperature at yet another resolution. >2. valueType. How many value types are there? Can you assume that every single one will have the same data type?
This is an interesting scenario. It isn't in the example I'm thinking of, but it makes sense that then you'd have to split up the tables. >it's bad practice to use floating-point numbers in a key. This is because keys are used for exact comparisons. SQL has a decimal type with exact precision which should be used instead.
If you use a float without designating its size, are you saying it will essentially try to auto-truncate or introduce machine epsilon errors that cause entries to be placed on top of one another? >(for example, negative wind speed)
(a float should be able to handle negative numbers…no?) >The proper way to handle that sort of situation is to have multiple tables for each entity subtype (this is a discussion of its own)
>>36327 >I'm also not completely sure what happens memory wise in a database. I'm assuming databases are somewhat "smart" about their memory usage? In other words, if I add 30k rows under the same dataset, when you store the rows, will it copy the same 'dataset' entry 30k times? With SQL, what you see is generally what you get. So if store the file name as the dataset identifier, it will be replicated for each row (possibly compressed depending on which DBMS you use). If this is using too much space for you, you can make another table with a shorter identifier for each dataset like so:
CREATE TABLE dataset(dataset_id CHAR(8), dataset_file TEXT NOT NULL UNIQUE);
I chose char(8) arbitrarily, you could use any type or combination of types. Don't forget to mark the long identifier as NOT NULL UNIQUE (ie, an alternate key).
When you choose an ID, prefer one that you can derive from the dataset so that you don't have to look it up unless you actually want to know the file name. So if the datasets were by date, you could use the date as the primary key for dataset. Most programmers would just add an auto-incrementing integer ID and call it a day, and this is called a surrogate key. Since a surrogate key contains no information by itself, you have to lookup the actual data when you want to know what it is. Doing this means you have to do more joins.
If you go the surrogate key route, I recommend creating a view which does the join to the table of samples so you don't have to keep doing that yourself. >In the case I'm looking at, the difference between datasets is that some datasets have, say, pressure datatype, while others don't. Well it's your call what to do about it. If they're all the "same thing" I would combine them into a single table and mark the missing entries as NULL. If they have different parameters because they have distinct purposes, then I would do what I did above with the marine_climate table, maybe add a mutual exclusivity constraint as well. >Or some have higher resolutions (every half degree latitude and longitude) while others don't (they have a value every 5 degrees latitude and longitude). Some have pressure data at one resolution and temperature at yet another resolution. For latitude and longitude use the most precise resolution, the others can be floats if you don't care about the precision. >If you use a float without designating its size, are you saying it will essentially try to auto-truncate or introduce machine epsilon errors that cause entries to be placed on top of one another? SQL will treat it as a normal machine floating-point number, so it will make locating rows and performing joins slower and more complicated because you have to account for precision errors. >(a float should be able to handle negative numbers…no?) I meant that you might want to assert that wind speed is always non-negative. If it has its own column you can just add a check constraint to it, but with valueType,value you would have to combine all of those kinds of constraints into one big, complicated, slow constraint.
What do I use to make a real GUI? Currently, I write everything up in PHP and use an app that is essentially secretly bundling everything up in a browser.
I've been working on this little game in c++ with glut. currently runs smooth even with 50,000 cube sides rendered. What i need to figure out is how to detect collisions between a point and a side and for it to be fast enough. My original intention was to do physics simulations but that's really confusing and i wanted a map anyway. I guess i'm just getting back to the same issue i had a few months ago.
Here's how my current motion simulation works: a 3d object (cube) stores pointers to motion functions which will set the cube's vertices using the current time. so i could start by giving each object a gravity function
My plan is when i detect a collision i will add more motion functions to the cube? Not really sure haha
I don't know if there are any good ones, but you could also look for an open source 3D physics engine and only extract the code that you need, that is, mathematical functions determining whether two arbitrary shapes collided and where, without all of the physical simulation. That is very much possible with Box2D, for example, and I frequently take advantage.
Is 'Learn C the Hard Way' actually a good book for learning C? I'm a total noob, so I really can't know any better one way or the other; I'm more willing to trust a /hob/ recommendation than the opinion of some random amazon review normgroid but, do you think I could get a real-time follow-up opinion?
It's another resource for learning. Unless you're paying money for it, it won't hurt to read it or do the exercises. Read a bunch of books, you don't have to focus on one.
>>36538 If you're a total noob you should just pick up the K&R C book and watch some tutorials on youtube, any detailed questions you have while learning you can google or ask here or anywhere. In K&R C they go through the whole language in 150 pages, you'll eventually find that C is a very simple language. Additionally in K&R C the back of the book contains around 100 pages detailing the standard library and general info about compiler related things and such, I like to carry it around everywhere so I can program without worrying about internet.
Don't fuss about memorizing the standard library, many newbies confuse the libraries as being the language, they're actually two different things, once you have the syntax down you'll be able to implement anything, from the standard lib to any 3rd party shit.
Cool that there's some talking about sql and databases because I'm doing something and can't get it to work fast enough. I'm doing a vids, tags and vidstotags tables in a database and I've got the vids and tags colums down, each of these tables has an auto increment id primary key so I can make them relate to each other in the vidstotags table. Now, I'm reparsing the original csv file that has the tags separated by commas in a certain column and then doing 2 selects and looking up what the id of the tag is and then what the video id is. I tried to write directly in the vidstotags table the result and it works but it's far too slow. (this table has two foreing keys on the vids and tags id and I know indexes makes inserts slower). So I got rid of the insert and just decided to write the results in a csv file then do a LOAD DATA LOCAL INFILE after because that goes faster I think. But even that is taking ages. I'm talking about hours and hours, I go to bed and I wake up and it's still going, I'm at not even 300 000 vids done and there's approximately 10 times more. And it's been DAYS ! So annoying, if a database/sql master could help it'd be greatly appreciated.
Wizards who are currently interested in C, this site has an interesting article and structure packing, I'd suggest taking a look at it, it gives some neat useful info for optimizing your code. http://www.catb.org/esr/structure-packing/
Does anyone here use codeblocks? I need help adding multiple files to a project. I look all over the internet and I seem to be the only person having this problem. Ive seen tons of youtube videos already on how to fix it like this guy https://www.youtube.com/watch?v=QG5s42I_75c, but its not working the same way for me.
Whenever I make a project and try to add another .cpp file to it, I go to file, then new, the project, select console project and make it. and then I have to manually add it to my other project by right clicking on the other projects name and pressing add files. But when I add the files, it shows two files one with what I named the file like "example.cpp" and then a "main.cpp", but the only one with my actual code is in the "main.cpp" and "example.cpp" has a bunch of random code that I never made. Its the same as in my picture here. and when I try to compile with 2 main.cpp's in the same project or that code I never typed there is always problems with it. It says something like "unidentified reference to main".
The only way I can add another file to a project is if I choose the option to make a class, and it automatically adds a main.cpp, another .cpp file and a .h header file, and when I compile that way everything works. The second picture is what it looks like when I make a class and everything works. Also I'm using c++ if that matters.
>>36232 I had to make a class for it to work, but I want know how to do this without making a class, so I can add multiple .cpp files into a project since classes only let me use one .cpp file if I make one.
>>36569 You will have to explain your problem better; I can barely make sense out of what you're saying.
First of all, the optimal thing to do depends on which DBMS you use. It seems you're using MySQL, which I'm not so familiar with.
Anyway, I would load all of the video names and all of the tags into temporary tables first for analysis.
CREATE TEMPORARY TABLE video ( video_id TEXT NOT NULL ); CREATE TEMPORARY TABLE tag ( tag TEXT NOT NULL );
Then check the video identifiers to see how long they are. If the longest one is less than 256 then use CHAR (fixed size can be faster depending on your DBMS). Do the same for the tags. If they are too long you'll have to get creative, maybe look for ways to truncate them. Otherwise you have to create surrogate keys which will slow you down because of joins.
Ultimately I would insert the data into only one table:
CREATE TABLE video_tag ( video_id CHAR(127) NOT NULL, tag CHAR(127) NOT NULL, PRIMARY KEY (video_id, tag) );
The order of the columns in the primary key is important. With most indexing schemes you can think of the order of the columns as the order they're sorted by in the index. With the order above you can very quickly get all of the tags for a particular video. You can swap it to (tag, video_id) to optimize the other way and make looking up all videos with a particular tag very fast. If you need to do both, just add an extra index for the other order. Remember that indexes have a cost though.
If inserting into this table is still too slow it might help to disable the index and rebuild it after populating the table. That's a bit more advanced.
I can only speculate what you're actual issue is, though. 3 million is not a lot of data and it really shouldn't be taking days to do anything with it with any computer made in the last decade. If you show me the tables it will likely be much easier for me to identify the problem.
>>36586 it's hard to give you advice on this. First: try to make modular code. Make use of techniques like callback functions. Try to reduce the number of if-then clauses to a minimum. Use dispatch tables, macros, whatever you can to hide those things (which I feel are a main ingredient for spaghetti). Try to separate the components of the project logically, and encapsulate as possible. I don't mean OOP encapsulation, but rather, keeping a bunch of internal logic functions, and an interface for the other components in your code to use. Separate in files what is logically unrelated. Use higher order functions as well, and reuse your code as much as possible. Give Higher Order Perl a read, that book helped me a lot to organize my own code.
If you want, I can give you some examples of how I've done this in my own projects…
I'm currently trying to learn C++ and the DirectX API. I'm reading "the C++ Programming Language" by Bjarne Stroustrup, but it's pretty difficult. I also still don't understand what the heck an rvalue reference is.
>>36631 So, I didn't know how to reply to this, because I was anticipating and I had been studying quite a bit, OOP stuff. Mainly because I thought OOP was the way to organize stuff and thereby cut down on spaghetti.
But I feel like what you told me was, "Nah wiz, slow down, go back to basics, use your basic data structures more. Horizontal, not vertical."
And, I don't know how to respond to it, because you're probably right.
>>36346 I've come back to this problem. Because there are so many redundant rows, I am wasting a lot of memory and I was trying to find a way to get around it, and essentially came across BCNF or 3.5NF.
If I split the data into the tables: (DataID),{Dataset,Scenario} (FileID),{DataID,Type} (DateID),{Year,Day} (FileID,DateID,Lat,Lon),{Value}
then I should have it in this form and save on a lot of redundancy, right?
>>36811 If you're trying to cut down on memory usage you need to think about the storage requirements in bits. >(DataID),{Dataset,Scenario} >(FileID),{DataID,Type} Don't understand what's going on here. How many files are there for each data set? Is each file totally independent from the others? >(DateID),{Year,Day} This is really wasteful. The built in date type should be 4 bytes, 8 at the most. Just use that. If you really need to squeeze it further you can use a 2-byte integer and do the conversion in a view. Remember that every table you add has at least one index (for the PK), so taking something that could be in a column and putting it in another table will have overhead. >(FileID,DateID,Lat,Lon),{Value} Looks ok, just get rid of the DateID and use DATE. If you want to save space on indexes think carefully about the order of the columns. If you're always looking up values by file, date, and coordinates (in that order) this is fine.
For normalization, go straight for 5NF (or 6NF if you have NULLs). It looks like you're there already, and don't get hung up on academic definitions, but the goal of normalization is to eliminate all logical redundancies. For example, File -> (Dataset,Scenario,Type) means that you only need to know the file and including the other data is redundant because you can just retrieve them with the function. That's what a functional dependency (FD) is, and essentially what you want to do is make sure the only FDs in each table are from the primary key to the non-key attributes.
Normalization usually reduces redundancy in your data as well, but minimizing data usage is an optimization at the physical level while normalization is a property of your logical model. So a relation being normalized doesn't necessarily mean it uses the least amount of storage space; that may require some ugly hacks.
>>36822 To the fellow wiz who is actually taking the time to respond to me, don't take the bait, ignore this guy. Don't make this like every other forum.
>>36581 Better learning experience to just use a text editor and build directly with the compiler and then proceed with a Makefile etc. IDE is snakeoil in my opinion, people think they need them when they don't.
>>36837 I agree that it is best to keep a premake/CMake/Makefile script instead of relying on and versioning the project files of Code::Blocks or Visual Studio, but the IntelliSense that Visual Studio provides, and especially its syntax coloring capability, is really something to be commended and useful to advantage of. The only thing I have to nitpick is that the standard Go To File functionality is painfully slow in comparison to simple text editors.
Is there a better place to learn web development than freecodecamp.com? I just starting using it learning html and css but it doesn't explain a lot of things and gives you bare minimum information so I'm not liking it. Any books that are better to learn from or websites or vids?
Whenever trying to learn something new, I just read the language's reference manual. If you already know how to code that is pretty much all you need to do to learn a new language.
But then again I have a degree in CS so I dunno if that makes any difference or not. Probably.
>>37118 After you become comfortable with html and css it would be helpful to look at front end development blogs or pages on particular topics (like accessibility, or frames) to elaborate on uses for things that general tutorials would gloss over.
Because there are so many web developers there is also lots of unofficial documentation of very specific use cases. Any problem you run into is probably solved three different ways on stack exchange.
Can anyone figure out how this guy gets his borders with the </> at the end and in the middle and how he changes the length of them. ————-</> and ——–</>——— are what they look like, but I've been looking at his code for days and I've still got no idea how he does it. I tried making a seperate div and colored it to look like a border, and then I can place an image to look like </> and place it next to the div to copy what the guy does in the codepen, but I think the guy does the same thing in a better way somehow, I just can't figure out how or where in his code.
I wanted to learn to program seriously for a while (I know a bit of MATLAB but that's not considered "real" programming), but then I realized a couple of things:
1) I derive almost no intrinsic pleasure from it. 2) I derive no extrinsic rewards from it. 3) Nothing in my life requires me to learn how to program. There is no pressing need to program. 4) The field is saturated with autists and pajeet codemonkeys that have already tackled most of the interesting problems. 5) I'm too old to contribute anything meaningful to it.
So I guess I'll be giving up that particular ambition.
I've searched about it and it actually seems to be quite good >generates executables independent from additional DLLs and VM's >can be faster than C++ in some cases >easy to build graphical interfaces
Note that programming is just a hobby to me, so no, I'm not asking whether delphi is used in the market or not.
>>37562 Programming is not a hobby, it's just a tool. I don't think there are people out there that actually enjoy typing in code, it's just a means to an end. The enjoyment of programming is all about seeing the thing you want to build come to life.
You can compare programming to hammering. Imagine if you wanted to learn how to use a hammer but had no idea what you wanted to build. I wanted to make games until I realized you also need 4-5 more skills on top of that to actually make something good.
So yeah, if you really want to learn programming, focus on the product, that's your main motivator and main source of enjoyment, unless you just want a job.
>>37564 >Is delphi a good language, worthy to learn?
Why not just give it a try? It's pretty much Pascal so it's as powerful as any other general-purpose language.
>>37495 Yes, but I don't understand it. I used freecodecamp to learn css and w3schools but the stuff there looks nothing like what is in the css. I did some googling and I'm told I need a psuedo element to do this, but I'm still not sure where he gets the </> from and how he placed it in the middle of the border. I think I'll just skip over this part though since I can't figure it out and its been a week.
>>37604 It's using some CSS preprocessor. Click the button on the right and click on View Compiled CSS.
The line is just a hr element and the </> is a symbol from the Font Awesome CSS library. It uses a ::after tag so the browser draws it above the line and it uses relative positioning to center it inside the line.
>>37603 >Programming is not a hobby, it's just a tool. I don't think there are people out there that actually enjoy typing in code Speak for yourself, I love programming and have been learning and amassing knowledge about programming topics and such since I was 15. For me programming is fun and exciting, I don't mind spending 5 hours implementing some stupid algorithm or procedure for even no reason at all because I find it fun, I love writing and rewriting code until it's perfect/fast/high performance, I like reinventing the wheel. The biggest problem in the software industry right now is the influx of people who don't like to code, in general they just suck and their skill level is and never will be toe-on-toe with someone passionate about computer programming.
>>37607 I've been programming since I was 12 but I've never felt like programming was at all enjoyable just by itself, it was more about getting that dopamine hit every time you hit f5 and you made progress on a project. I also liked getting into a flow state after coding for a while with music playing on headphones. >their skill level is and never will be toe-on-toe with someone passionate about computer programming.
You're right about that. I just don't find theoretical CS and analyzing algorithms enjoyable. If you're the kind of person that gets a hard on when he reads about the newest path finding algorithm then good for you.
I guess I'll share this program that I made a while ago, though I can't use it because I haven't gotten it to work right on GNU/Linux. The GUI will not draw the arc.
It trains you to judge angles by your sight. The 'handicap' is the interval that the target angle will be in, e.g. a handicap of 15 will give you the angles 15, 30, 45, 60, 75, 90, etc., and a handicap of 1 will give you any angle.
>>37806 I asked this on another forum and I was told to install https://nodejs.org/en/ and instead of using the code runner type "ctrl + `" and then node myapp.js . I did that but now it still doesn't work, but it says different things. When I use the code runner now it shows exited with code=-2 but thats not what it should say. When I press ctrl + ` and type node myapp.js it says some random stuff I don't understand. Here are screen shots.
if visual code studios is so great then why do they make it so hard to run code. I was using the code editor in my browser before and all I had to do was type enter for anything to work, but code studios has been to confusing to use.
>>37810 I just tried node (file name) in the terminal and I got the correct output. Is this how javascript files are usually run? I'm very new to this and nothing seems to show a standard way of running javascript code.
>>37812 nope. This doesn't work. It worked when I made my code to print the number, but then I completely changed my code to print some text, but it keeps printing the number from my previous code.
Visual studio is overkill for a beginner. To keep things simple, get another lightweight ide, write a html file which includes your javascript and open it directly in your web browser, from there you can easily test out your codes
I am not so much into programming anymore, rather on administration stuff, particularly netadmin. However, most people are into programming so you don't really find much discussion on the subject. Anyway, I would like to find a way to make a living doing netadmin stuff, but all the positions require one to have some degree and have experience with .NET bullshit as well as apache and nginx. Though what I like is more on the side of switches, firewalls, etc. I would want to try independent work, but I don't know how I could offer my services. Even though I know networks are everywhere, I wouldn't know how to find somebody that needs a netadmin the way you'd need a plumber. If anyone has any ideas they would be much appreciated.
Any linux wizard here? How do I set a python script as a default program to certain file types? For example, when image.jpg is opened the viewer.py will be called; like opening text.txt will call the notepad application. I'm using mint and nemo if that's of any help
>>37873 Depends on your file browser, usually you can right click on a file of that type and set the default application using "Open With…". You might want to add the script to your PATH too if you use it often. Do `echo $PATH` and place an executable version of the script in one of those directories. You can make a python script executable by adding `#!/usr/bin/python` to the top of the file and setting the executable bit with `chmod +x <file>`.
I created a Etherpad pad its link is https://factor.cc/pad/p/wizcode. Etherpad is a real-time editor, so anyone who has this link can code with other wizards in real-time.
How do I upgrade my mongodb version from db version v2.6.10 to version 3.4.7 and make a symlink thats in my path enviromnent variable?
I already downloaded the 3.4.7 version from the mongodb download center in my downloads directory by doing wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.4.7.tgz and then I extracted the archive using -tar zxvf linux/mongodb-linux-x86_64-amazon-3.4.7.tgz and then to make a symlink in my path enviromnent variable I did echo $PATH which showed /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games and then I tried to make a symlink to the usr/local/bin/mongod path by doing this sudo ln -$ ~/Downloads/mongodb-linux-x86_64-amazon-3.4.7.tgz /usr/local/bin/mongod but when I do this it says ln: failed to create symbolic link '/usr/local/bin/mongod': File exists but when I type mongod –version it says I'm using db version 2.6.1 instead of the version 3.4.7 that I downloaded. I tried doing the sudo apt update and sudo apt upgrade commands but It doesn't update my db version to the version I originally downloaded ( version 3.4.7).
I don't know what any of these commands do or what they mean, but I just started a course on udemy teaching this stuff and the first video shows all these steps to set up mongodb but it already doesnt work. Do any wizards know about this stuff and can please help me out?
How should I approach doing exercises programming books? I pirated pic related and the chapter one exercises want me to perform tasks like adding numbers, but I was forced to look up the syntax (hope I used that right) to know what I should be using to do things like that. Am I supposed to just skip some and come back to them later or am I expected to dig through the API or whatever? There's so much stuff in the latter I have no idea how I'm supposed to be looking up exactly what I need.
>>39192 Do you know the specific commands to remove the old mongodb version so that I can use the new version I downloaded? I have been looking how for hours but nothing seems to work.
I tried doing /usr/bin/mongodb –config $PATH-TO-CONFIG –shutdown to shut down my current version but it said the usr/bin/mongodb can't be found.
On the mongodb site where it shows how to upgrade it has steps to do mongod –dbpath /var/mongod/data –shutdown but I tried this and it says there is no server running. I don't know if this means I can remove it or not, but I don't know the commands to remove the 2.6.1 version and add the new 3.4.7 version.
>>39192 >>39202 Never mind I'm quitting trying to learn shitty mongo. Its confusing and not very much help on how to use it out there. I'll start learning mysql instead. Thanks for trying to help.
>>39195 Yeah just do what you can and move on. If you were taking an Uni class on Java, the professor would never make you work through every exercise, just a selection of the most important ones.
Once you know the basics, a good way to keep learning more without getting bored (because believe me, the endless exercises will get boring) is to think of a program you would want to use or of a problem that interests you and then look up what you need to solve it. For example maybe you'd like to play the Wikipedia 'Clicks to Hitler' game. You could open a connection with Java and then use the jsoup library to parse out links, then traverse each link until you get to Hitler and count up the number of links it took to get there. Maybe to improve its efficiency you add a list of links/keywords like "Germany" or "War" to prioritize. I honestly might do this when I have some free time. Once you learn about object orientation you can message me on this thread and we can work on it together if it's something that sounds interesting to you as well.
>>39205 Oh yeah and you shouldn't have to read the API to solve the exercises for early chapters. And ideally, the chapters should not require you to use any information that you did not learn about within the chapter or previous chapters. If that keeps happening, maybe pick a different Java book to learn from.
Is anyone learning Machine Learning? I took a course on it but I didn't have time to really study it and now I'm trying to refresh and the concepts. Currently reading "Hands-On Machine Learning with Scikit-Learn and TensorFlow" which seems like nice application oriented book. Maybe afterwords will read something more theoretical. I am studying physics and I think it might be helpfull to know this. Anyone has any experience learning ML?
>>39285 I'm learning it this semester but I feel totally lost haha. We haven't done much yet, mostly went over python and looked up how to do common tasks on scipy/pandas/numpy etc. We did our very first actual machine learning activity on Thursday, but it was mostly just recording output. If you want I can pass you our assignments. What's an e-mail I can reach you at?
>>39285 >>39289 The reason I feel lost is that we've been reviewing linear algebra and statistics, both of which I didn't do too well on and don't really understand.
>>39289 Thanks but from my own experience taking ML and programming courses, school assignments are very basic and not very application oriented.
When I had to take lineal algebra, I learned from MIT lectures. On youtube. I can't post links for some reason bust just search MIT linear algebra on youtube and it's the first playlist.
What are places where I can ask about my programming problems besides stack overflow? I was banned from there but I still have a lot of questions to ask regularly.
>>39464 They said I asked dumb questions so they banned me, but I can get privileges back if I answer questions and get up votes. What website is /dpt/ and /g/ on?
What do you guys think the best compiled language that is actually employable is? I love haskell, but I'm not elite enough to get paid to write that. I was going to give in and learn Java, but I've started working on a small server application with spring boot and it immediately pissed me off with how unnecessarily complicated everything is and the fucking endless LAYERS of shit for every tiny thing. And apparently it just gets worse from here.
I'm going to dip my toes in to programming because someone who must have in the past dumped all of their "for dummies" books at the thrift store and I bought them. One on Visual Studio 2008 and another on C# 2008, then some on Linux. Tough cookies if that's not the best to start with
If I wanted a day-to-day job in the UK what should I aim for? I just want something that is better than lifting boxes up and down in a warehouse.
I self-taught web languages which I was much younger and that lead to me doing freelancing full-stack javascript/web work over a couple of years before I had a total depression induced breakdown. I got good reviews on maybe 30 jobs so I guess I had some basic level of skill, but it's been a long time and I don't know if that's even a viable way to work these days. I've got a nearly non-existent job history, I dropped out of university, and I'm nowhere near an "ideal candidate" so I guess I'm going to have to rely on having a good enough portfolio to speak for itself.
Do you need to be a savant to get hired if you've only got your skills to go on? I've heard the advice of maintaining your github, contributing to open source projects, and creating things like "plugins" or "apps" as self contained examples of your work; is that enough to get a job if you're mediocre? Are there blogs discussing these kinds of things and what to expect in a day-to-day programming job? I'm a wizard so I find it pretty hard to relate to people but I think I'm polite and courteous enough; it's just I can't play the role of upcoming spunky web dev.
>>39537 Different fields look for different things. Web dev is pretty much the easiest to get into (as a result, a little over-saturated), and probably the most stress free. As long as you can show previous work, either hobby or professional, and answer a couple technical questions, it's pretty easy to get hired unless there's a lot of competition. You don't need an insane portfolio, just a couple projects that will showcase your skills (for instance, a website that uses a specific language or framework etc.)
Also, a lot of employers are looking for full-stack devs because they don't want to pay multiple people, so being a jack of all trades is a big plus (having gfx skills is also a big advantage).
What's a good way to assign a value to the next index of an array during a loop? I've been messing around with arrays since they seem more complex than what came before and the idea by the program was to take input for a value that would be the array size and input for the starting number. Then during the loop the first array would be multiplied by pi then assigned to a second afterwards both would be printed out and the value of the first array at its current index would have 20 added to it then assigned to the next index in the first array.
The problem I've run into is that when increasing the first array's value eventually it'll go out of bounds before the loop ends. Not sure what to do that will let me print out all the index values from the input.
>>39838 If capital I is the length of your array, the condition should be i < I. And since you're referencing the i+1'th element of an array, the condition should really be i < I - 1.
Let's say you have an array of size I = 5. This means that the last valid reference is arr[4]. In the last statement of your for loop, you say arr[i+1]. So in other words, i can at most be 3 because arr[3+1] = arr[4] is the last valid reference. 3 is 2 less than 5, hence the condition should be i < I - 1 or i < 4 (or in other words, i can be at most 3 before the loop ends).
>>39839 Makes sense, but would it be possible to have 5 as a valid reference when doing something like this? I'm assuming I'd have to rewrite it in a different way.
>>39849 Just adding one to I after input made it work, pretty obvious and I don't know how I didn't notice it at first. Feels like a bandaid fix though.
Do any of you guys like Rust? I love it so far, it's rekindled my interest in low-level programming and is much nicer than C++ in my opinion (not to mention safer). Interfaces nicely with C too.
Now I just need to find a way to get paid for it so I can escape corporate webdev hell.
[3,7] and [2,3] and [6,7] in [[1, 2], [3, 4], [1, 5], [2, 6], [4, 8], [5, 6], [6, 7]] returns True. Anyone know why? What do I type to get it to return false?
>>40204 I think python is treating those as three separate logical expressions. [3,7] is not null so it returns True, [2,3] is not null so it returns True, and [6,7] is contained in the list, so again True True and True and True = True.
You need to check for each value separately with the in operator. I'm not fluent in python so I'm not sure if there's a function or a way to check if all the elements are contained with just one call.
>>40204 `and` is a boolean operator, and because Python uses retarded "duck typing" rules, any non-empty array is considered "True" when used in a boolean expression. So your expression is equivalent to "True and True and ([6,7] in [[1, 2], [3, 4], [1, 5], [2, 6], [4, 8], [5, 6], [6, 7]])", which evaluates to True.
[code] >>> [3,7] and True True >>> [3,7] and [2,3] and True True >>> [3,7] and [2,3] and [6,7] in [[1, 2], [3, 4], [1, 5], [2, 6], [4, 8], [5, 6], [6, 7]] True [/code]
what I think you're trying to do is this:
all(x in [[1, 2], [3, 4], [1, 5], [2, 6], [4, 8], [5, 6], [6, 7]] for x in [[3,7],[2,3],[6,7]])
i always wanted to program out if a desire to create something able to interact with
i started learning the interactive fiction programming of "Twine" and found it easy enough. it is made for stories though. i learned about variables, arrays, etc and how to make things like inventory or storage systems, character stats, items, word and other forms of generators, choice based story progression, chat display… basically the mechanics for what could eventually lead to a text based game like a visual novel or something
but it is hard to continue. i get other ideas and lose interest in stuff after a matter of days
in addition i want things with a story but that itself is another difficulty. i think i understand why people specialize in tasks, it is hard to do everything by yourself. you focus on one area and get tired of it and the other aread meanwhile havent even been touched
For a long time I've wanted a wizchan browser for Android. I was thinking of adding wizchan support for an existing open source viewer. How hard would be to do something like that? I'm a brainlet who barely knows programming, is this a realistic goal? Where should I start?
>>40310 You probably wouldn't need to do much, if anything at all to add wizchan for read-only viewing, since most chans use vichan and enable the JSON API, so maybe the viewer has the ability to add new chans without needing to extend anything. For posting, some features of wizchan might not be supported so you might need to extend those features of the viewer. >is this a realistic goal?
Sure. You should be familiar with Java and object-oriented programming, some basic GUI concepts and probably basic networking like the HTTP protocol (which is probably already abstracted by the viewer enough that you don't have to do stuff from scratch, but you do have to understand concepts like GET/POST requests).
Oh, and I guess you need to know how to setup everything so you can compile and test Android projects.
>JS for greasemonkey I finally got around to learning some javascript to solve a problem I've had with sadpanda for a long time. I hate seeing all of the nasty galleries, but the query bar is very limited; I indirectly resolved this by using js to look up tags and filter results on a page-by-page basis. One script adds a black box over everything so that I don't have to look at the thumbnails. The other processes the actual filtering and removes the box when it's done.
It's a mess, but I started learning js a few hours ago and now it's 3 am. I think it works reasonably well/efficiently for what it does. >You must have at least one post to post URLs I'm pretty sure I've posted in this very thread, so I don't know what's up with that. I'll reply to myself after this post with links to the scripts.
>>40322 >>40323 >>40324 I am aware this is the programming thread and being a non-programmer I suppose I should be encouraging since you just started, but are you aware of the many userscripts out there for Sadpanda? I love to see people extending a page's functionality with a little JS though.
>>40326 I assume they exist, but I did not want to look for them for no particular reason. Maybe I'll check to see if I've replicated some known functionality when I get the chance later. Could give me some tips for improvement, at least.
>>40506 How are you doing the SQL? My only idea was to have each post have a "parent" field. If the post was an op, it would be 0. If the post was a reply on a thread, the parent field would be the post ID number of the OP. I suspect that was not a very elegant solution.
I was currently contemplating the idea of re-working my so called "fap system".
I've coded basically a simple, small web application that let me store porn videos along with their producers and models and a primitive tagging system for both the videos and the models' body type and set status of fapped or not. All information are editable of course.
While it's doing its job I'd like to improve it a little bit, also because every time I need to lay my hands on the code I become crazy on how messy it is, especially the SQL side of it. Also I'd like to get rid of the VM (I'm on Windows) I'm using for making it run.
The stack I used is LAMP+Laravel+Bootstrap.
I made a web application for the simple reason that I need this available both on PC for uploading/management and on my phone as I find myself more comfortable fapping from the phone late at night as I don't have a laptop.
What I'd like to transition is to a RESTful Django application as backed and using Vue.js + Bulma on the frontend. As database engine I'd probably go for SQLite as you may already understood portability, scalability and easy-to-maintain will be the main focus of this new version.
>>40516 I used to use Inform for that kind of stuff, and there is a nice book documenting the language and design patterns affectionately known as DM4. There is another system I've heard of (actually the author of Inform mentions it in DM4) called TADS, but I haven't tried it.
On a related note, I've always wanted to write my own Z-Machine compiler in Common Lisp, but I haven't been so brave. Maybe I'll take the project soon.
i have shit computer so i stream a lot of things like anime, movies, even hentai
but the problems i encounter are like 95% of the links are broken, the videos get taken down for copyright violations, the subtitle language is often incorrectly labelled, and dubbed versions are labelled as subtitled
would it be possible to embed some sort of bittorrent streaming app inside a webpage instead of the standard video file? it would be immune to takedowns and copyright violations because the video file isn't hosted on the site/page
would it be too hard to implement? i just wonder why no one has done it yet
>>40514 I went with the following approach: A table for Original Posts. A table for Posts that includes Posts ie answers to Original Post and answers to regular Posts.
OPs are affected with ID_OP as a primary key.
Posts are affected with their de facto primary key which is conventionally ID_Post. Considering that Posts are the weak identity when it comes to the OPs-Posts relationships their primary key becomes: {ID_OP,ID_P}.
In order to reflect the fact that some Posts could also be the parent of other Posts in cases of replies, I decided that in such cases the primary key for answered posts would be {ID_Post,ID_Answer}. That is of course if we consider that an answer is made for a unique post. Otherwise we'd have to create another table for Answers exclusively.
I should also start diving into php in order to feed my homepage.
>>40641 C. Perfect mix of modern syntax and low-level enough that you're not completely clueless what's under the hood. Barebones standard library also helps you learn the fundamentals by not relying on magic. You can then easily transfer to C++ and learn the OOP paradigm.
After that you can learn and use any language you wish.
>>40643 >C as your first language I wish I had never received this advice when I was younger. I was stunted for at least 5 years before I switched to something that I could actually understand and build myself up on. There are so many bit-level hacking tricks that just confuse the whole issue with C that if you really are an ABSOLUTE beginner, I would not suggest it as a FIRST language.
Start with Python. It has a lot of libraries that you can use to make anything you want. It has very, very legible syntax. You can go in almost any direction you want with it. There are a lot of people who want Python code. Most importantly, you'll still be in a position to go deeper and learn LISP and C later.
Start with something that actually incites motivation early on.
>>40646 If you learn it properly, it has the potential to save you time in the long run. Sure, learning python might have a lower entry-barrier but you'll most likely end up dependent on certain habits that you will have to unlearn or relearn entire concepts because it was neatly abstracted away from you.
Modern languages allow you to save time in development, but learning a lower-level language is pretty crucial to getting a good understanding of computers and ultimately becoming a better programmer.
I got game maker studio as a gift from my brother and decided to give it a go. This was a couple of days ago. At first they keep talking about this drag and drop system and how great it is but 5 hours in to the tutorial you pretty much realize you'll need to learn how to program in their language called gms. I studies very little of java years ago and there's a bunch of things that work very similar. My question is; should I drop gml and learn a language outside this software or just keep going with it? My goal is to make simple run'n'gun game.
I'm not a professional game dev or anything but gamemaker was one of the only tools I got things done in. The language is very simple and has a lot of built in stuff to help you make your game but things degenerated into a confusing mess that was hard to follow pretty fast.
>>40652 The GML is good enough, it's easy to learn, and the way I remember it (back in GM6) the reference manual is good enough. It actually served as my gateway towards stronger drugs like Java and C. But I never felt GML lacking for my purposes, the framework saves you a great deal of boilerplate as you have everything ready to make a game. If all you want is to make a simple game you ought to stick to it for a while, perhaps in the future you will want to learn whatever other language, but I don't feel GM hindered my understanding of more general purpose languages. In fact, it allowed me a great deal of creativity. Have fun
>>40649 >Yeah, but learning C before Python or other easier language gives you a much better foundation— Like learning group theory before elementary algebra. Or how it’s better to learn orbital mechanics before changing the oil on your car. Or how it’s better to learn risk-weighted portfolio theory before starting up a bank account. Or how you better read up on Norse Mythology before reading Lord of the Rings.
I sincerely would have hoped we learned something as a society since the failure of New Math. Let’s not repeat the same mistakes.
I've been studying web dev today. Going back over html, css, javascript, and jquery. None of it's hard stuff, but it wouldn't hurt me to review, and it's a more immediately useful skill for me then studying C any further.
When I try to use this function I made I get the error .addEventListener
I think .addEventListener isn’t being found as a function because it is not finding the class in my html. but I added document.addEventListener(“DOMContentLoaded”, function(event) {
}); after it so the function with the addEventListener should only work after all the html is loaded. It still doesn’t work and I’m not exactly sure why. Does anyone know how I can solve this or if there is a better way to do this?
here is my javascript I will appreciate any help.
function newQuote(){ let httpRequest; let reset = document.getElementsByClassName('reset'); reset.addEventListener('click', makeRequest);
function makeRequest(){ httpRequest = new XMLHttpRequest();
if(!httpRequest){ alert('giving up, can not create http instance'); return false; }
function randomQuote(){ if(httpRequest.readyState === XMLHtttpRequest.DONE){ if(httpRequest.status === 200){ alert(http.responseText) } else { alert('there was a problem with the request'); } } }
I just started learning ncurses using the tldp ncurses programming how-to (can't post the url as this my first post from this IP). I am not sure how this compares to other resources since this is just the first one I clicked on, but it is easy to understand and has been informative at least in the getting started phase.
I have a few ideas about what I want to do with it, but I want to understand the library better before I get into any specific project.