Hey /prog/, I'm 19 and for a while I've been half-assing an attempt at a "tech career" straight out of high school. I'm now taking it more seriously , reflecting on what I've been doing and wondering if I'm retarded, so I'd appreciate a second opinion.
>did some gay C++ programming youtube tutorials while i was in middle school, didn't learn shit and stopped after a week
>tried a bunch of free online programming courses and lose interest in them all
>buy cheap python beginner's book off the internet, it's more interesting but i'm lazy and am only 1/2 of the way through after almost a year
>know some basic shit and some formatting, "etiquette" stuff
>enroll in local technical college IT course hoping i can learn more about computers, maybe get a job and carry the experience over to different fields
>starting to worry that the certification won't be enough to get any job
>now am looking for any sort of internship to get experience and become more confident in abilities
>trying to get to the point where i can make a PR on github without looking like a sped
I'd also appreciate if anyone could point me towards somewhere else where I could talk with experienced programmers and get tips, like an IRC or discord server. Thanks.
How to get a solid foundation in compsci mathematics
This guide assumes you forgot everything from highschool. No you don't have to learn any of this in order to program you can just start hacking around every .c file in your kernel.org git source clone and see what happens. Why would you want to learn math? Because it will change your thinking. You won't be easily fooled by bullshit, you will have tools to sort through obvious logical fallacies. You will be able to optimize programs and create your own algorithms. You will be able to estimate. Above all, you will be able to solve problems using computation which is what computer science is all about. And least of all, you will get paid more than anybody else without this knowledge so if your goal is shekels then read on. Note: DO THE EXERCISES. You won't learn otherwise. Books instead of video lectures were chosen because they've lasted 30+ years some of them in relevancy in the field, also lectures disappear all the time like when MIT nuked all one prof's Physics OCW lectures because he tried to pickup a student, setting a precedent that at anytime this information can disappear. Read a book nigga.
Math Preliminary
Basic Mathematics by Serge Lang
Buy/Pirate this book (he's dead). It's highschool math, from the perspective of a Mathematician. You will learn up Pre-Calculus and be prepared for rigorous proofs later.
An Introduction to Mathematical Reasoning" by Peter J Eccels
This changes you from rote drilling and being a human calculator in highschool to learning what math actually is, and what proofs do. Excellent, excellent book.
How to Solve It by G. Polya
How to do proofs, written in 1940s and still for sale in every Chapters/B&N bookstore to this day because it's the best proof helper that exists.
Welcome to Proofs
Calculus" by Spivak
Actually, you are learning ANALYSIS, in addition to calculus. Torrent the 3rd edition w/the answer book. This is a fucking hard assed book, you may be better off reading "Advanced Calculus" which is actually easier, as the intro points out that Spivak's exercises are difficult as shit: http://www.math.harvard.edu/~shlomo/docs/Advanced_Calculus.pdf
Discrete Math Intro
http://cglab.ca/~michiel/DiscreteStructures/ it also comes with lectures on jewtubes https://www.youtube.com/channel/UCG96LXNYz9x7eTqSRtQ2R9A Doing real discrete math and probability.
Linear Algebra by Friedberg, Insel and Spence
Get the latest version (piracy). It's proof centric, this will come in handy later when you need to understand some Linear applications and don't know how something works so can revert back to your training in LA in proofs. LA is heavily, heavily used in all game programming. Also in cryptography and numerous other CompSci fields.
Nature of our reality
We are not really are able to know for sure what world we are living in. We were given information by whoever is in power to understand our world in certain, specific way and we take it for granted. The scientists are supposedly confirming the information or changing and adding new things according to request of controllers. However some people started questioning this information that came with education…..
We're moving
We have officially created a new board over at https://8chan.moe/t/
Come join there if you're sick of pictures getting deleted for no reason at all .
Distributed hash table
Can someone help me understand DHTs with Byzantine fault tolerance? I read the wikipedia pages but they it didn't quite click for me. I'm also new to writing P2P stuff.
What is the algorithm, exactly? So I write a bunch of servers that all store some values with some keys and listen on a port. Then I want to query a key.
1. Do I send that key to every server and see which one replies? That sounds very inefficient if I have millions of servers all retrieving values frequently.
2. Is there a way to make it so that the server can't see the information it stores? I suppose I could somehow break up the file but now every query requires many more connections. Would it work if I encrypt the file and break it up into a small number of pieces, say 2, and store each piece on a different server? Even if an individual knew the key it couldn't decrypt even the part that it has.
3. How do I know the IPs of the servers without having a centralized directory?
4. What if the servers sometimes go offline? Is it enough to just store the same key-value on multiple peers and hope that at least one will be up?
>Be me
>work in low-level kernel/driver development
>Working long nights to get everything done as soon as I can
>bi-annual performance review comes up
>MFW my boss says he's disappointed because I don't talk to the other employees
>apparently its a problem that none of them know anything about me
What are some fields where I can find a programming job that doesn't involve talking to normies or anyone else? I'm a motivated self-learner who's willing to do whatever it takes to get the job done on time as long as it doesn't involve interacting with other people.
Programming languages that compile to native binaries; also WASM
There is a resurgence in programming languages and compilers that target native binaries. Go is already popular. Rust enjoys a lot of hype. D and Haskell seem to be making a bit of a comeback. New compilers are being worked on for existing languages, like Kotlin Native and Scala Native, and entire new languages are being developed, like Zig, Swift, Pony, Nim, Crystal and V. Which are you betting on? Which do you find interesting?
Do you think WASM will overturn the trend? There is certainly a lot of people trying to make "write once, run everywhere" happen with WASM for some reason.
Meta thread: new BO
Having a million stickies and meta threads was annoying so I claimed the board and cleaned it up a bit. If you have any desires in regards to this board I'd like to hear them; what rules should we have, what settings to change (e.g. should we have images or not?), should we have banners, should we have a dedicated newbie/QTDDTOT thread, what do you think in regards to the board CSS, etc.
In case you encounter a thread that gives 404, you can fix it by logging in at https://sys.8ch.net/mod.php with the username "Anyone" and password "0", and then posting in the thread through mod.php. You can also post in this thread if you want me to fix it.
In case the board goes up for claims or there's an unresolved problem, I'd like to hear about it in this thread first. Since this board is not fast I may not feel the need to log in too often, but that doesn't mean I'm not active here.
--
/prog/ rules:
1. Common sense rules; no spam, stay on the topic of programming, don't bait for more specific rules, etc.
2. Don't start shit about the languages other people use if there's no good reason to, especially if you just plan to shill another language in it's place. You don't need to be a supreme gentleman or avoid arguments but basically don't shit up the board and derail threads needlessly.
3. Meta is only allowed in this thread.
4. Making new threads for your projects is allowed, but don't beg for people to do things for you, this includes "do my homework" type posts.
Hi, i am with the Haiku project here.
If you never heard about it: “Haiku is an open-source operating system that specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.”
The project have serious lack of manpower, this is why am i here.
Haiku and the HaikuPorts project searching for devs and experts for the following areas:
- CPP developers
- Go port developers
- Python experts
- driver developers
- marketing magicians
- media related developers
- infrastructure operators
- translators
And many more!
Join today!
https://github.com/haikuports/haikuports
Sorry if this unrelated here.
I stay hete to answer your eventually questions.
Thank you guys!
HTTPS
I'm making a Node.js application for the first time without a tutorial and I am trying to use an external API someone else made to grab data.
I am getting a mix content error in the console log whenever I try to call the API because it is HTTP and not HTTPS.
I deployed on Heroku and Heroku is of course secure/https.
I have no idea how to convert the HTTP API into a secure HTTPS link.
Please let me know what tools I need and how to go about it. I have a feeling NGROK may be useful but I am pretty lost with this problem.
Where to declare variables
Hi I'm been amateur programming for years and now go to school to learn it.
I've always been confused about what the best practice is for declaring variables. When I first did programming in highschool we were told to declare all the variables at the top of the scope (I guess for the convenience of the teacher) but also see people declare them in the middle of the code as needed (like a counter right before a while loop).
So redpill me on the variable question. Logically declaring it right before needing it seems like the best thing to do.
Distributed systems
I'll have an internship at back-end of some huge service. But I've never programmed anything more serious than homework or site with 3 pages. What should I learn or do in order not to fuckup at my work?
Someone's advised me to read SRE book. Will it help?
ideas and advice for a web site
my first thread here ,my friends suggested to me this site so if its the wrong board suggest me the right one
so
running out of time
anons , i have a project for uni
i must create a website and i only have sum days left
when it comes to programming i have no problem
the problem that i dont have any ideas for the content of my website
its not a big thing
its like a website for an online library when a customer can check books , loan and order them or a website for an online school ,bank and that shiit
but the fuckers my mates took all subject and here i am with just a week left
anons any ideas or examples of content for the website ??? i really need help
any thing that comes to your mind anons
HolyC Language
Discuss and share HolyC related talks here.
Important: Stay only on the subject of HolyC only. Terry is wonderful but nobody seems to ever focus on his work. This will try to fill that gap.
Some documentation: https://web.archive.org/web/20170531043554/http://www.templeos.org:80/Wb/Doc/HolyC.html
Images on prog
Does /prog/ need images?Compilers and Programming languages
Hi /prog/,
I'm looking for some books about Designing programming languages and compilers, give me your best!
(I lost my collection)
I remember specifically liking a book from a professor from the University of Amsterdan, which had a more applied approach.
It had examples in C, but that's all I can remember…
Also, general Compiler and Programming Language Design thread…
Improvement
Sup /prog/,
I am currently at uni and I am also working as a dev. I've been programming for 3-4 years but I feel like I'm stuck on a platoe. How can I improve? I have 2-3 projects I've completed but they're not very serious.
I can work with Python/C++/Rust/C#/Java/C but I spend most of my time working with Python and Rust.
I tried starting to pick up some CS in order to help me but I'm unsure if this will help me be a better programmer.
What advice would you give me?
FutureOS
Hey, i'm working on a hobby operating system called FutureOS. The name is because it'll only get finished in the future, as in, never complete. The goals are to have a FAT12 or FAT32 filesystem, basic sound support, and TCP networking by then end of 2016. The operating system currently runs in 16 bit real mode on the x86 architecture but there will be a way to enter 32 bit protected mode later in development. If you want to contribute to the github repo, you can find it here: https://github.com/Penot1/FutureOS
Right now, there are two commands, "echo" and "loadb". echo prints whatever parameter it is given and loadb loads the second floppy disk into memory. Feel free to submit pull requests, and if you have any questions either send me an email or put them in this thread.
Alright, so I've been making scripts that interact with websites for awhile now, usually what I do is view the relevant requests with Live HTTP Headers and then work from there. However, this program I am working on now isn't showing the requests to send a message to the chatroom in Live HTTP Headers. Someone told me to use mitmproxy however I am having trouble installing the certificates. Does anyone have any suggestions?
Do any of you know any learning resources similar to build your own lisp(http://www.buildyourownlisp.com/), except for C++?
A tutorial where you build a small/medium sized project, and in the meantime learn about the language.
/prog/ We need to talk about the posters.
Most of your posts are written by brand new coders who are dabbling with a variety of languages. Too many languages. These posters don't seem to know very much about the standards or styles of the code they discuss, yet have many opinions on the quality of the languages they have dabbled with.
Do you know why?
This is because of the Dunning-kruger effect.
Absolute beginners believe they are superior to anyone else, yet while gaining real experience in their confidence is shattered and they become aware of their impotent struggle against the ocean of knowledge that programming actually is.
Well? What do you have to say for yourself.
Terminal in C using <curses.h>?
Hello /prog/!
Learning myself C at a steady and slow pace. Now I've learn that creating even the most simple TUI using printf is bloody murder. So I've decided to take it to the next level.
Can anyone please tell me if there's a good tutorial on how to create terminals using <curses.h> (or some other library).
US tech job interviews
I'm a Brit, recently relocated to the US on a fiance visa, and I'll be eligible to work here later this year.
My last job was as a developer for just under 5 years, working in fintech in London, in a company that's respected in the sector in Europe, but not very well known in North America.
I know that my previous experience and my education (CS at an Oxbridge uni) count for a significant amount in the UK tech job market - lots of tech companies are full of Oxbridge grads, and they like people who went to the same university as them, it's not very fair and it's not deliberate on their part but it's the way it is.
I expect that those things won't count for nearly as much when applying to US companies, and I will probably have to put in some effort to secure a job, I can't simply rely on networking and cronyism again.
What sort of experience should I expect in interviews? Do companies actually look at github profiles? Is HR as stupid over here as is often depicted and should I fill my resume with buzzwords? I'm sure I could pick up whatever technologies most job listings mention given time, but at the moment my skills are not very broad.
Is there any tool that can generate C#, Java and Javascript class files (I know javascript have no classes) that can be easily converted to byte[] and back?
I remember google having something like it, but I don't even know how to search for something like it
I am expecting something that read some xml/json/proprietary file, and produce empty classes with just the serialize and deserialize methods ready
If I wanted to make a programmable VM with customizable opcodes, is there any more performant way to do so than using C to fill an array with function pointers that doesn't involve assembly magic? I would like to keep the code more or less portable.
I am asking because accessing a function pointer is always kind of expensive, so I was wondering if there is some better way to do it or simply any other language that is faster for this purpose than C.
Is it worth it?
Hey /prog/,
Feeling down today about my major of choice. While most /g/ and /tech/ users are apes from poo-littered shitholes, I'm starting to think that I really have just fallen for the CS meme.
Somewhat sadly I fit the stereotype described in pic related to a T, but I have been very devoted to my studies since starting uni 2 and 1/2 years ago. I'd rather graduate with this degree than get weeded out in law or med school.
It remains my dream to become a computer wizard. Is it worth the effort, /prog/? Should I really be investing all of my time into this, or have I fallen for a meme profession in relatively low demand with high standards for new recruits?
How to change the build target in autotools project
I want to build libotr but under a different name, like libotr-asdf.so
How the fuck do I do this?
Spent a really long time googling, grep'ing and looking at .m4 and Makefile.am and whatnot but none of it makes sense.
here's the code, one start by running autoreconf -i or ./bootstrap:
A distributed javascript forum
Using localStorage, the forum's content can be stored offline in the browser, which'd then get synchronized between online users with Peer.js.
There'd need a signalling server to introduce users to each other, but the server-side database load would be absolutely zero. And client-side localStorage has a limit of 10MB per domain, but I think that can be worked with if it doesn't grow excessively big, or maybe it can be circumvented somehow.
You could just go to your regular php file manager and upload an index.html, then go to yourhost.com/forum/ and the forum would be there, wholely javascript without page loads.
Const by default in C
I often forget to put my values as const, and my code ends up as a mess of sometimes using const and sometimes not. To mitigate this, I was thinking of ways to have const be the default behavior.
I was thinking that it would maybe be possible to achieve this with preprocessor tricks. Something like this:
typedef int m_char;
#define int const char
#define mut(x) m_##x
int main() {
char x = 0;
mut (char) y = 0;
x++; // Error
y++;
return 0;
}
This, however, fails with types that use two keywords like "unsigned char".
Is there a way to have "unsigned m_char", or have "mut (unsigned char)" be translated into m_unsigned_char?
Thought I'd come here to ask:
I'm trying to self-teach programming so that I can find a job doing it, though the main reason is I want to write my own games since modern games are shit and I want more Tactics Ogre and Sengoku Rance.
I have begun by picking up "Java: A Beginner's Guide 6th Edition" by Herbert Schilt and am working through it now. I'm in chapter 4 now, which is about classes and methods, and it is making me really excited.
Question, though: am I learning the right language? What other steps should I take? I have looked at github and it very confusing to me, but then again I only started in earnest about a week ago. I know that it's possible to develop games with Java 8 and libgdx, but I also want to make sure I can get a job with the skills I'm learning because my current one (teaching middle school) is the worst fucking job on the planet.
If this isn't the right place to ask I'll delete my post,
Haxe
I have never in my life seen anybody talk about this programming language.
Personally I love it, since its syntax, libraries, and cross-compile features are amazing.
Is it just because it is unpopular or do I most people dont like it and thats why they dont talk about it.
html
hey /prog/
I'm having a little problem here that you can hopefully help me with, even though it's not a hundred percent programming related.
I have to do some frontend stuff in html and css. Thing is, last time I touched that shit was back in junior high, using macromedia dreamweaver. And doing the layout with tables and frames.
Do you guys know of any good html/css crash course tutorials, and maybe some useful "dev" tools?
learning PHP right now. I bought some cheap ass kindle book and noticed that on the first chapter on variables it said that I add two variables like this
$a = $b.$c;
the period acting as a plus sign. When I tried doing that all it did was put the two numbers next to eachother. After a quick google search I found that PHP actually uses "+" for adding and "." for concatenating strings, you know, the sane way.
Before I blast this author on Amazon for putting downright wrong information in their book, is there any reason the author would do this? is it something that was changed in PHP or is it downright wrong information?
pic unrelated
Z80 Assembler == comfy
I wanteds a 4x6 screen mode for a bespoke Z80 board with a 128x96 bitmap display… The likes of the ZXSpectrum sites have code for it, but they made use of lots of register rolls (enough of which to be slow).
Eh, I don't have much experience with Z80 coding (I was a C64 kid..), but it was fun.
Dear anybody with a career in computer science
Hi /prog/.
I'm 17 and in my Senior year of high school. I love programming, and I recently scored an internship at a Software Engineering/Cybersecurity firm. I was one of 3 people out of the 10 that were interviewed that was chosen. I'm pretty pumped about it, and feel like this could lead to opportunities.
But I still want to talk to people that are farther than I am.
If this internship leads to some sort of apprenticeship that I can learn significantly more from, then I don't think I'm going to head straight to college to start working on a degree in Computer Science, mainly for debt and time-saving reasons.
However, if it doesn't, I'll probably head to community college and take classes to get knowledge and experience that I need to get started in the field.
What I want to know is, what did you do to get a career in programming going? What do?
I posted this on /g/ as well, but since this board is strictly about programming, I feel I should mention that I know HTML, CSS, some JavaScript and C++, and have been learning Java for a little bit (definitely looking like my favorite thing I've learned thus far).
ho
Hello /prog/, newfag here. I have about 7 years worth of experience programming professionally in various languages at various companies. Right now I'm out of work, and for all my job interviews the people ask if I'm an expert at [radom programming language] which I've used before. My trouble is I don't feel like an expert even though I smoke their technical questions. So I ask to you this, at what point in time did you realize you were an expert or at what point in time did you not feel like a fraud?
I'm currently working on a Chip-8 interpreter after a rolling it in a challenge thread on /g/, but I decided to take it a step further.
I want to make it cross platform compatible with every system and operating system possible. Linux (which I'm currently focusing on with SDL and ncurses (after I get it working with SDL) support), then Windows and OS X. I also want to use something like Turbo C for DOS and cc65 for C64 and Apple ][.
Is it at all possible or realistic to do this with one "project" and using several io_<platform>.h/c and #ifdef PLATFORMNAMEs without splitting it up into multiple projects, or am I completely full of shit?
Data transfer
Hello /prog/ I am interested in learning about data transfer and file formats. I have a final project to do for my college program(a whole year away), and would like to get some project ideas or maybe even start it early.
I've been curious about how image data is formatted for example, but never had the time to learn since I had to focus on school work.
During this summer break I would like to learn to be able to programmatically manipulate images, transfer files using IR, and cool stuff like that. Any recommendations for books dedicated to the topic? Or at least websites/videos?
Lastly I am curious to learn about data transfer using RF. Is it possible to transfer files faster by using 4 different transmitters/receivers operating at different frequencies in parallel?
Python 3: ValueError and NameError
What in the god damn is wrong with my Python code?
from math import sqrt
a=float(input("a="))
b=float(input("b="))
c=float(input("c="))
posQuad=(-b+sqrt(b**2-4*a*c))/2*a
negQuad=(-b-sqrt(b**2-4*a*c))/2*a
print(str(posQuad) + ", " + str(negQuad))
It keep giving me a 'ValueError' for not calling math for 'sqrt' even though I did in the first line and when I do it individually for each 'sqrt' function, it gives me a 'NameError math not defined'.
requesting knowledge
Okay so i have done a little here, little there on codeacademy and i have very basic knowledge on python… I would like to learn java, c# and html to make my own programs or websites.
Do you have anything to recommend? Ex: reading material, website, torrents, blogs…?
Good book for arduino programming
I would like to learn programming with the arduino platform, I do not have any relevant programming experience so a book with good programming explanations would do great.
Anyways I have been tinkering around with arduino and have a decent understanding of electronics so that wouldnt be necesary.
Programming/reverse engineering challenge: Figure out what my obfuscated code does.
/*
k.c
-1 17 36 29 19 -1 13 13 04 14
-1 00 00 00 00 -1 00 00 00 00
-1 00 00 00 00 33 00 00 00 00
-1 07 00 00 00 00 00 00 35 08
-1 00 00 00 00 00 31 00 00 00
-1 00 00 10 00 00 00 27 00 00
-1 00 00 00 19 00 00 00 00 00
-1 03 11 00 00 00 00 00 00 14
-1 00 00 00 00 -1 00 00 00 00
-1 00 00 00 00 -1 00 00 00 00
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1
19 00 00 00 00 27 00 00 00 00
30 00 00 00 00 13 00 00 00 00
-1 22 00 00 00 00 00 00 -1 -1
26 00 00 00 00 00 13 00 00 00
13 00 00 24 00 00 00 09 00 00
14 00 00 00 34 00 00 00 00 00
-1 -1 22 00 00 00 00 00 00 -1
22 00 00 00 00 11 00 00 00 00
14 00 00 00 00 30 00 00 00 00
*/
int vt [10] [10], ht[10][10],inv
[10] [10] ,inh [10][10],sl
[10][10];;int cp(int x,int
y){{int s[10] ={0},h=ht[y]
[x],hs=0,xx=x ;for(;;){int
c=sl[y][xx--] ;if(c==-1)
break;if(s[c] )return 0;
s[c]=1;hs+=c; ;;if(hs>h)
break;}if(x+1>=10||sl[y]
[x+1]==-1){if(hs!=h)
return 0;}else if(hs
>=h)return 0;};;int s
[10]={0},v=vt[y][x],vs
=0,yy=y;for(;;){int c=sl
[yy--][x];if(c==-1)break;
if(s[c])return 0;s[c]=1;vs
+=c;if(vs>v) break;}if(y+1
>=10||sl[y+1 ][x]==-1){;;;
return vs==v ;}return vs<v;
}int s(int x ,int y){if(y>=
10)return 1; if(sl[y][x]==
-1){if(x+1< 10)return s(x
+1,y);return s(0,y+1);}for
(int i =1;i< 10;++i){sl[y]
[x]=i;if(!cp (x,y)){;;;;;;
continue;;;} int cd=0;if(x
+1<10)cd=s(x +1,y);else cd
=s(0,y+1);;; if(cd)return 1
;}sl[y][x]=0 ;return 0;}int
main(){;;;;;; for(int i=0;i
<10;++i)for( int j=0;j<10;
++j)scanf("%d" ,&inv[i][j]);
for(int i=0;i< 10;++i) for(
int j=0;j<10;++j )scanf("%d",&inh
[i][j]);;for(int i=0;i < 10;++i) {int t0=-1,t1=-1
;;for(int j=0;j <10;++j){if(inh [i][j]>0)t0=inh[
i][j];ht[i][j]= t0;;if(inv[j][i ]>0)t1=inv[j][i]
;vt[j][i]=t1;;; int e=0;;if(inh [i][j]||inv[i][j
])e=-1;sl[i][j] =e;;}}if(s(0,0) ){for(int i=0;i<
10;++i){for(int j=0;j < 10;++j) printf("%2d ",sl
[i][j]);;printf ("\n");;;}}else printf("?\n");;}
Choosing a language to program a project in
Hey /prog/, I have a large project I have been brainstorming for a few years or so and I now want to start programming it. The problem is I am a little indecisive on what language to do it in. Anyone have any tips on this matter?
I was thinking of doing C++ or Java but a friend got me into Haskell lately. It really shouldn't matter too much, but I just am wondering if anyone has experience in these matters. Thanks!
Factorials and C++
The equation in pic related describes the behavior of cubes in any number of dimensions, with m being the total number of dimensions in a cube, and f(n m) describes "the number of n dimensional forms in a m dimensional cube."HURT ME MORE SNAKE, MAKE ME FEEL ALIVE AGAIN!
import numpy
"""training data"""
x = numpy.array([[1,1,1,0,0,0],
[1,0,1,0,0,0],
[1,1,1,0,0,0],
[0,0,1,1,1,0],
[0,0,1,1,0,0],
[0,0,1,1,1,0]])
correct_label = numpy.array([[1, 0],
[1, 0],
[1, 0],
[0, 1],
[0, 1],
[0, 1]])
"""initializes weight and bias as zero vectors"""
weight = numpy.zeros((6, 2))
bias = numpy.zeros((6, 2))
def softmax(a_vector):
"""Compute a logit for a vector."""
denom = sum(numpy.exp(a_vector))
logit = numpy.exp(a_vector)/denom
return logit
def softmax_a_set(a_set):
"""computes logits for all vectors in a set"""
softmax_set = numpy.zeros(y.shape)
for x in numpy.nditer(a_set):
x = softmax(x)
return softmax_set
def cross_entropy(logit, label):
"""generates the cross entropy between label and logit"""
return -1*sum(numpy.log(logit)*label)
def train(x):
"""walks the function closer to the best value"""
pass
y = numpy.dot(x,weight) + bias
What projects are you guys working on?
I got a not-yet-conforming to PEP8 Python project.
https://github.com/keithstellyes/Seams-Bot
I have unlimited SMS but limited data, figured I'd just run a script using Twilio for texting. It also can run in a terminal and can be easily ported as an IRC bot or email interface.
Pic related, show me your cool stuff.
ITT: Prove your worth
Let's play a game.
>Pick a open source project you like/hate/think is horribly buggy or bloated
>post example code on how to make something it does better
>Hard Mode: Test and commit the change to the project.
>Damn Fine Autism Mode: Show profiled proof that your change made it better. Valgrind.
8ch shut the fuck up this isn't even flooding yet
CompTIA Linux+ Cert [Books] - Question
Hello there people with no lives and girlfriends.
I've this question that I would like you to answer for me, please.
This Linux+ book came out just recently and I there is this other 2 books that are a bit older but not that much, should i buy the newest or not? I know new =/= good.
>1.CompTIA Linux+ / LPIC-1 Cert Guide BY Ross Brunson and Sean Walberg (thats the newest one)
>2.Linux+ Guide to Linux Certification 4th Edition by Jason W. Eckert (I was told it's good)
and finally…
>3. CompTIA Linux+ Study Guide: 2nd Edition by Roderick W. Smith (seems like everyone advises this one and that it's the best and easy to follow.
Now what do you think guys?
ps before you mention RHCSA is much better, don't worry thats on my mind too but everything in its own time.
I wrote a python script to download images from tinyboard/vichan imageboards.
It works on every imageboard I try except 8ch, which gives me a 403 forbidden error. I tried changing my user agent within the script (perhaps unsuccessfully), but still 403. What gives?
#!/usr/bin/env python3
import argparse, bs4, os, urllib.request, urllib.parse
parser = argparse.ArgumentParser()
parser.add_argument("url", help="Link to thread")
parser.add_argument("-d", help="Directory to download to")
args = parser.parse_args()
if args.d:
if not os.path.exists(args.d):
os.makedirs(args.d)
os.chdir(args.d)
soup = bs4.BeautifulSoup(urllib.request.urlopen(args.url))
domain = urllib.parse.urlparse(args.url).netloc
http = urllib.parse.urlparse(args.url).scheme + "://"
for link in soup.find_all("p", class_="fileinfo"):
image = http + domain + link.next_sibling.get("href")
filename = image.rsplit("/", 1)[1]
if not os.path.exists(filename):
urllib.request.urlretrieve(image, filename
How plausible is finding a remote job as a middle C++ dev?
One of my internet buddies works through upwork, but based on what I've heard from him, it's not very pretty. Remote jobs are mostly web-related and very few job propositions that are there quite often are small, low pay contract jobs that have tons of indians competing, promising that they'll make it for free and this instant.
Learn to Program
Alright, faggots. You're going to take a first-year computer science class at MIT.
https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-6
Register. It starts next week.
>But Python is for plebs!
Well, good thing that Harvard is running a course that uses C and recommends Linux. No excuses. This one is even self-paced.
https://www.edx.org/course/introduction-computer-science-harvardx-cs50x
>But muh blub languages
I SAID NO EXCUSES. Here's a course that uses Scheme. This one is also self-paced.
https://www.edx.org/xseries/systematic-program-design
Those are your choices. If you don't choose any of these, you're a lazy sack of shit.
Even if you already know the basics of programming, you will almost definitely get something out of these if you haven't had a formal education yet.
If we do it together, we can make threads about it and encourage each other. I'm doing the third one, and I've been programming for 2 years.
Lads I have been trying to teach myself c++ and this exercise from my book is driving me crazy!
"Write a program in which you create a Text class that contains a string object to hold the text of a file. Give it two constructors: a default constructor and a constructor that takes a string argument that is the name of the file to open. When the second constructor is used, open the file and read the contents of the file into the string member object. Add a member function contents() to return the string so that you can display it. In main(), open a file using Text and display the contents."
I have a full solution that compiles but does not actually store any information from the inputed file (it prints empty lines or sometimes a single } )
http://coliru.stacked-crooked.com/a/d1ab2c2ad4e1b05d
Help me obi-wan you are our only hope
i need some serious help. i was in court today and the prosecutor asked the secretary if it was possible to run the vin and see when that vehicle had insurance and when it was canceled and so on. she said no. got me thinking if i can write a code and bring it maybe i can get off. what language would be best for this do you guys think. basically i need the prog to have a search bar to put in the vin. then i need it to search the databases of the insurance companies (with permission of course) just wondering what language and where i should start. writing the code or getting permission. i think i should write the code show it to them then they can get the companies databases since they wouldnt want to give it to a criminal. please help. here is a pic of my baby shaking her bones to trey and the gd at fare thee well gd50
Yearly Library Thread
Hello /prog/,
I would like to start off this new year by committing to learning at least 1 new, major library or SDK. Why only 1 library for the year? This way we don't end up hopping from library to library without gaining any real skill. This way we get to master it.
I suggest these:
>Android (make mobile apps, make money!)
>OpenCL (accelerate your computation, put that graphics card to better use!)
>Qt (gui's and so much more!)
>SQLite (master your data!)
Alternatively, it would also be very useful for any anons looking for a job to master machine learning techniques. I was thinking of working through pic related for starters. Would any anons be interested in learning neural nets / svm's / relevant tools, techniques, and libraries instead?
Who else would be interested in this? Are there any very useful, very practical libraries you would recommend beyond those listed?
After we settle on a library / learning we work through it for the year, post code, results, ideas, advice, explanations, and keep each other motivated.
Jquery/jquery mobile help
I need help. I am working on a text editor for mobile and its a hybrid app, so its made with web technology. Everything is fine and all until I want to make a button that bolds future text, kind of like in Word. But I can only find one that makes everytext in the text area bold. This is not what I want. I cant find any help on how to do this in Javascript/Jquery on the internet.
This is what I have with jquery and jquery mobile:
$("#bold").on("tap",function(){
$(".editor").toggleClass("bold");
});
It makes every text in the editor bold. I want to make only future text bold.
Can someone help me?
Thank you
so, i was thinking about starting the development of a "normal" program, and i have honestly no idea how to that, since i never created something with a proper interface.
with "normal" i'm talking about a program meant to be used by not expert, with the standard stuff like automatic re size of windows and stuff like that. The office family is pretty much my idea.
are there some libraries that allow you to implement standard features like control+z?
do they have a simple graphic engine?
and how "normal" programs are even called?
How acceptable is calling external commands?
Hi, for years, I've been writing most of my things in python, where it's completely unacceptable to be calling external commands, and been working on low level things with C and assembly, where I barely even need libc most of the time, so calling external commands in a program other than a shell script is very weird to me.
Now, after opening my eyes to (the awesomeness that is) lua, I'm wrapping a script around a tool written in shell (can't be written/it's very cumbersome to write in anything else, for a number of reasons). I'm also calling curl somewhere in the script. I do this because I've used libcurl in C before, and to me, the library doesn't seem to be made for using it to simply get a file, and instead, the command line interface is.
I'm aware that calling external commands breaks portability, but that is a non-issue in this case.
Now, I'm debating if I should either call find -type f or use LuaFileSystem to recursively iterate over every file in a directory.
I'd like to know: What is the most acceptable option, calling curl and find, or using their respective libraries? Also, is one of the options actually objectively better?
Disgusting features
What is something you hate about programming in general?
In other words, what programming features do you hate most that nearly every language incorporates?
Personally, I fucking loathe falsiness.
I hate it when any language inherently treats 0 as false, or empty strings, or empty lists, or NaN floating point values. It's excusable in C, and in C++ for C compatibility, but any language with a dynamic type system has no excuse.
The only things that should evaluate false are an actual boolean false value, or a null pointer (ie. pointer type with a null value, where type is significant, as integer 0 should still evaluate true).
Line - Line Intersection Algorithms
So needed an algorithm to detect if 2 lines intersect
SAT doesnt work to well for lines, so i decided to see if i could figure out something myself
Remembered from Geometry class that if a quadrilateral is convex, then its diagonals must intersect, and if its concave, then they dont
So i thought: "if quad(line1point1,line2point1,line1point2,line2point2) is convex, then the lines intersect, otherwise no"
But then i thought: "but wouldnt the 'convex-test' algorithm itself need to test if the diagonals intersect?
Aka:
Line intersection algorithm needs a function to determine whether a quad is concave or not
Concave-test algorithm needs a line intersection algorithm to determine if the quads diagonals intersect
Its a paradox
CPU murdering recursion
Help me
What's the most basic instruction set a machine must implement in order to solve problems that isn't as impractical as a Turing machine?
I am not talking about real world implementations of simple CPU. I mean something more abstract, since CPU tend to use registers for performance purposes when all you actually need is a way to access stored variables, independently of how you do it.
With "most basic", I mean the bare minimum to run. You will need an add operator and a bitwise negation operator, but there is no need for a sub operation since a + !b = (a - b).
What's the actual bare minimum a virtual machine would need to be operable? I have been searching for a Turing completeness article that goes straight to the point, but they often end up saying "just implement a Turing machine".