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.
Images on prog
Does /prog/ need images?
RULES
RULESHURT 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
Programming while crossdressing
hi /prog/
I'm an extremely average programmer and my code is shit. I started looking into ways to improve my code but couldn't really find any legitimate methods.
then I found pic and it opened my eyes.
my code got a little bit better over the past month of crossdressing and I'm not exactly sure why, maybe it's because it puts me in a good mood,
or maybe it's the determination to get it over with and do the best I can so I won't have to keep trying to explain to my mom why I'm wearing my sister's clothes.
but the real question
is what girl clothes will give me both comfort and improve my ability to program really well?
I expect it to be a few months before I'm really good but I'll never get there without the proper outfit.
thanks.
random programming exercise!
Write a program that takes a string of digits and prints them back out in LED style../led 1234567890
_ _ _ _ _ _ _ _
| _| _| |_| |_ |_ | |_| |_| | |
| |_ _| | _| |_| | |_| _| |_|
#!/usr/bin/env python3
from sys import argv
from sys import exit
if argv[1].isdigit():
digits = argv[1]
else:
print("gimme digits, fucko")
exit(1)
leds = {"0": [" _ ", "| | ", "|_| "],
"1": [" ", "| ", "| "],
"2": [" _ ", " _| ", "|_ "],
"3": ["_ ", "_| ", "_| "],
"4": [" ", "|_| ", " | "],
"5": [" _ ", "|_ ", " _| "],
"6": [" _ ", "|_ ", "|_| "],
"7": ["_ ", " | ", " | "],
"8": [" _ ", "|_| ", "|_| "],
"9": [" _ ", "|_| ", " _| "]
}
def get_row(num):
return ''.join([leds[i][num] for i in list(digits)])
print("{}\n{}\n{}".format(get_row(0), get_row(1), get_row(2)))
I'm stupid and need help
Could someone please explain to me what is going on in this code?
#include <stdio.h>
#include <math.h>
// (1):
typedef struct
{
double x,y;
} POINT;
POINT c, o, p[10000]; // (2):
double a, q=0.0; // (3):
int n; // (4):
// (5):
double ccw(POINT a, POINT b, POINT c)
{
return a.x*b.y + a.y*c.x + b.x*c.y - c.x*b.y - b.x*a.y - c.y*a.x;
}
int main(void)
{
int i, j;
o.x=-10001; o.y=-47; // (6):
while (scanf("%d", &n) > 0) // (7):
{
if(!n) // (8):
break;
for (i = 0; i < n; i++) // (9):
scanf("%lf %lf", &p[i].x, &p[i].y);
a=0; // (10):
for(i=0; i<n; i++)
a += ccw(o, p[i], p[(i+1)%n]); // (11):
c.x = c.y = 0.0; // (12):
for(i=0; i<n; i++)
{
q = ccw(o, p[i], p[(i+1)%n])/(3.0*a); // (13):
c.x += q*(o.x + p[i].x + p[(i+1)%n].x); // (14):
c.y += q*(o.y + p[i].y + p[(i+1)%n].y);
}
printf("%.3lf\n", fabs(a) / 2.0); // (15):
printf("%.3lf %.3lf\n", c.x, c.y); // (16):
}
return 0;
}
I really can't grasp C at all, no such problems with JavaScript, HTML or XML or even Python (although I haven't really looked into that one yet), but C will most likely kill me for some reason…
I get the basis and some of the theory of what is going on in this particular code (calculates the area of the object formed by the co-ordinates, as well as the center of gravity(? - English is not my native language, so not sure if I got it right)), but I'm fucking done when it comes to how the parts work.
Could someone please explain it to me?
Input for the example:
4
-1 -1
-1 1
1 1
1 -1
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.
Programming and Weed
I've been smoking/vaping weed on and off for about 8 months now and I've decided to start learning programming. Does marijuana impair one's ability to learn how to code? Should I quit weed altogether and just study programming or is casual use of weed still ok?
Learning how to use HTML
I've got a lot of time on my hands for the next couple of days and I'd like to learn how to use HTML and at least be able to make something functional soon. The thing is, I don't know where so start.
I know basic things such as how to format the code so as it can be read and to use a css for pretty much everything but other than that, I'm useless.
Can you please point me in the right direction to start? Thanks.
Also happy New Year.
Vulkan Thread
Vulkan 1.0 dropped Feb 16, 2016.
Full 1.0 Spec (warning, huge): https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html
Vulkan 1.0 Quick API Reference: https://www.khronos.org/files/vulkan10-reference-guide.pdf
Mantle hello world (almost identical to actual Vulkan use): https://medium.com/@Overv/implementing-hello-triangle-in-mantle-4302450fbcd2
Mantle programming guide and API reference (since the official Vulkan programming guide doesn't land until August): https://www.amd.com/Documents/Mantle-Programming-Guide-and-API-Reference.pdf
Planning to use it? Already using it? What are you using it for?
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).
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
PHP
FUCKING SHIT STUPID ASS PHP, WHY AIN'T THIS WORKING!
function SYS_newsFeed(){
$file = websiteURL()."/assets/database/feeds/news.txt";
$text = readfile($file);
$newsfeed = parseCode("$text");
return(parseCode($newsfeed));
}
It throws up exactly what is in the text file, but with 54 at the end AND parseCode doesn't fucking do its job and replace "%a%" with "<span style='color:#99ff99'>" what the hell am I doing wrong?
>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.
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
Programming practice
Hi guys I'm new to this board.
I know a bit of C++ and Java, but I don't know how to expand my knowledge/get some practice.
So I thought that once a week an "exercise" can be posted and those who want post their code in that thread, with more experienced programmers giving pointers and advice.
First exercise:
Program a fridge with the following properties:
-Is the cooling process working, if not where did the error occur.
-It needs to know if the compressor should work or not based on the internal temperature of the fridge.
-A list of the Items inside and their expiration date.
-The amount of space left inside in cm³, because metric system.
-Anything else you can think of.
Python
Greetings good sirs, python and I went our seperate ways a really long while ago, and the last shitty script i had written before is a web scraper using python 2.
Now that my python skills have rusted, I have been meaning to get into it once again, I have been wondering wether python 2 is outdated or not.
Should I start considering working with python 3 instead of 2 ?
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
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,
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.
whatsapp spy
hey anons my friend know a way to spy on anyone by only his number He didn't want to tell me the whole secret to me but told me he uses Spyware script autoresponder by sending a sms to the victim with a kind of code and Then he will have the access to go get the whatsapp database and coby it and but it in bluestacks and it works if anyone know what he is doing or another way to spy on whatsapp accounts
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.
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?
I would appreciate if someone could find some repos for a nice BBS or booru template I can work with. For some context, I'll be implementing VMs as a page central feature
I was thinking reddit style groups would have a single communal VM with posts optionally linking to the filesystem. So a booru or IB might provide an interesting model twist. Also mongoDB would be ideal. The less database and language there is web-facing, the smaller the attack vector.
What are some cool programming exercises
Hi /prog/,
computer science student here. At one of my courses I recently learned Scala and to finish it I need to write a program together with some other guy. The decision what we program is up to us, but it should have the amount of work a chat or a webcrawler would have.
The only problem: I have no idea. Any cool ideas would be appreciated.
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).
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?
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).
fuck everyone
I'm so sick of these fucking people saying shit like "I'm gonna go do some C++" or "what programming language do i need to learn to be able to suck cock professionally?"PORN
A script that starts a local server at and serves random images from booru sites indexed by the cure.ninja/booru API. I wrote mostly this because webms seem to be broken on the site even after disabling referrer headers, but also because I'm planning to maybe make this into a fap gauntlet thing later.127.0.0.1:8000
Requires Python 3, uses only standard library modules. Images are not saved to the hard drive.
Originally intended to implement this in HTML, but it turns out working around CORS is a pain in the ass.
Usage: run , then point your browser to python3 file.py
. Refresh the page or click on the image.127.0.0.1:8000
query = "-s"
# change this query to whatever, ex. "tanline+naughty_face+-s"
# See https://cure.ninja/booru/about/api for more information.
# This weeaboo porn scraper is licensed under the
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2xxx ure mum m8
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
import http.server
from urllib.request import Request, urlopen
import socketserver
import json
import sys
import time
from datetime import datetime, timedelta
PORT = 8000
order = "r"# r=random, see API details for more options
request = {}
results = []
curImg = 0
page = 1
start = time.time()
def getElapsed():
sec = timedelta(seconds=time.time()-start)
d = datetime(1,1,1) + sec
return str(d.hour) + " hours " + str(d.minute) + " minutes " + str(d.second) + " seconds"
def fetch(u):
print("fetching " +u)
r = Request(url=u)
r.add_header("User-Agent", "Mozilla/5.0 ;Windows NT 6.1; WOW64; Trident/7.0; rv:11.0; like Gecko")
response = urlopen(r)
return response
def fetchResults():
global query, order, page, results
requrl = "https://cure.ninja/booru/api/json/"+str(page)+"?o="+order+"&f=a&q="+query
res = fetch(requrl)
jsn = json.loads(res.read().decode("utf-8"))
for r in jsn["results"]:
results.append(r)
page += 1
def getType(url):
ctype = ""
urlend = url[-10:]
if urlend.count(".jpg") or urlend.count(".jpeg"):
ctype = "image/jpg"
elif urlend.count(".gif"):
ctype = "image/gif"
elif urlend.count(".png"):
ctype = "image/png"
elif urlend.count(".webm"):
ctype = "video/webm"
return ctype
class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
if self.path.count("i="):
iurl = self.path[self.path.index("i=")+2:]
self.serveImage(iurl)
else:
self.servePage()
def serveImage(self, url):
ftype = ""
img = fetch(url)
data = img.read()
ctype = getType(url)
self.send_header("Content-type", ctype)
self.send_header("Content-length", sys.getsizeof(data))
self.end_headers()
self.wfile.write(data)
def servePage(self):
global curImg, page, results
self.send_header("Content-type","text/html")
self.end_headers()
if (curImg) >= len(results)-1:
fetchResults()
self.wfile.write(bytes(
("""
<!DOCTYPE HTML>
<html>
<head>
<title>"""+str(curImg)+": "+results[curImg]["tags"]+"""</title>
</head>
<body>
"""+
("""
<a href='http://127.0.0.1:8000/"""+str(curImg+1)+"""'>
<img style="max-width:100%" src='http:127.0.0.1:8000/i="""+results[curImg]["url"]+"""'>
</a>
"""
if getType(results[curImg]["url"]) != "video/webm"
else """
<video controls autoplay loop=1>
<source type='video/webm' src='"""+results[curImg]["url"]+"""' >
</video>
"""
)
+"""<p><a href='"""+results[curImg]["page"]+"""'>"""+results[curImg]["page"]+"""</a></p>
<p><a href='"""+results[curImg]["url"]+"""'>"""+results[curImg]["url"]+"""</a></p>
<p>"""+results[curImg]["tags"]+"""</p>
<p>query string: """+query+"""</p>
<p>Images loaded: """+str(curImg+1)+""", time elapsed since server start: """+getElapsed()+"""</p>
</body>
</html>
"""), "utf-8")
)
curImg += 1
if __name__ == "__main__":
server = socketserver.TCPServer(('', PORT), Handler)
try:
print("Server starting at 127.0.0.1:"+str(PORT))
server.serve_forever()
except:
server.socket.close()
I need some help, please anyone
Hello /prog/. I am a 19 year old university student. I am really into software engineering but i want to go full professional ( i also study software engineering ). What i know is just some C++ , some Java , some HTML/CSS/JS , some Ruby. I also know nothing about GUI or how to connect GUI to a program. ( i am still pretty much a n00by ).
Here is what i have:
Current IDE : Qt Creator
OS : Ubuntu 14.04.3 , Windows 7 Ultimate (dual boot).
Knowledge : Pretty basic concepts.
Here is what i want :
>Master Java or C++ ( or both if possible )
>Learn how to create and use GUI
>Complete web programming
>Get at least some good knowledge about security,servers,etc.
>Learn some basic Assembly ( which i have no idea about, mostly for some projects in university ).
Links, guides, pdf, anything that can help. I am at your mercy people. As long as it is free i can do it ( right now my economic situation is pretty bad ).
Now most of you would ask why don't i just wait untill finish university. As i mentioned above my economic situation is pretty bad and i can afford going to university untill most this year. Basically i have untill the 2nd of July 2016 to do all this.
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
Programmers!!
i'm C# beginner programmer
i have a small problem ,,,i've searched for it alot but i can't find a solution…pls tell me the solution if u know it is urgent for me
when i start a new form and add a media player window it appears a black square only with nothing…i played a video with it and i can hear the volume but ca'nt see any thing
td;r the code is running well , and the media player appears normally in other devices, and i have tried many video formats
How do I become legion?
I want to learn programming, how do I do it? Where do I start? I'm willing to put as much time as needed.
Why am I wanting to learn?
Make money & hack shit
Note: I'm literally retarded when it comes to maths, so I'm hoping it doesn't require too much maths… Preferably it shouldn't contain any maths at all.
What are the basics? How do people make money? What else can you use programming skills for besides making money and hacking?
I must be coming off as very naive, and I admit that I am… I know nothing. I've heard of the words JavaScript and C++ but know nothing about them, what they're used for, etc… I just know the names and they're coding languages, coding what? Idk.
Any absolute beginner books you can recommend?
Also links to places I can learn would also be nice.
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".
Systems Programming
I'm really interested and wanting to get into systems programming. drivers, compilers, kernels… all that jazz. I have currently come out of university with a CS degree mainly focused on Java and work solely in Linux.
I want to learn C/C++ whilst learning sysprogramming, so it's not vastly different from Java. I know the concepts of programming(algorithms, data structures, procedural and object orientated programming), will just need to learn the C syntax and additional things Java doesn't deal with (malloc etc).
What would you recommend to help me get into systems programming?
Not really looking for code, just ideas on an approach.
Assuming I wanted to create something like a screen locking software, nothing complex. What would be the best way to go about that without exiting the desktop like Windows screenlock?
I was thinking about capturing the mouse, and locking it in place until a specified key combination was pressed. All other key presses are ignored.
I am not concerned with it being super secure, just more of an annoying deterrent for snoopy friends.
With this in mind, would locking the mouse in place and all keyboard input besides the specified input be enough? What about a step further and hiding all desktop icons and the task bar as well?
This is for Windows, so let's assume I can use the registry to my advantage. What would your approach to this be? I don't mind sharing some code once I take a crack at it.
why is there no prog help sticky?
i guess this question will become a noob scripting help general so i won't feel bad for mucking up this board.
i'm trying to crate a script for my zsh prompt to display my laptop's battery in different colors depending on how full it is.
I need to isolate the percentage without the '%' and sometimes a ',' to do the math.
[CODE]
#!/bin/bash
ACPI=$(acpi)
BATTERY=$(echo $ACPI | gawk '{ print $4 }')
STATE=$(echo $ACPI | gawk '{ print $3 }')
STATE=${STATE:0:1}
if [[ ${BATTERY:${#BATTERY}} -ne '\%' ]]
then
echo "hello"
fi
if [[ $STATE -eq "U" ]]
then
STATE=F
fi
echo $STATE:$BATTERY
#${BATTERY:0:${#BATTERY}-2}
[/CODE]
Am I too stupid to program?
Two years ago I tried to learn programming because I wanted t make video games.
I checked out a book called C++ without fear from the local library. I tried my best to understand the concepts but couldn't do the exercises and never made it past chapter 5. I had read online that C++ isn't the easiest language to learn programming, but it still bummed me out because the author stressed at the introduction of the book that "anyone can learn to program" and I couldn't do it.
I then learned about Codecademy and finished the JavaScript course but still felt completely retarded and didn't feel like I learned anything. Haven't really made much attempts to learn since.
Am I just too retarded to learn programming? Should I give up? I only really wanted to make video games anyways.
Would learning a game engine like Blender or Unity be more worth while to achieve my goal?
I never finished high school and only ever made it to Geometry in math.
Would [re-]learning mathematics help me learn programming better than my previous attempts?
What should I do?
The Eudyptula Challenge
Learn how to contribute to the Linux kernel:TheNastiest bugs you encountered
Tell me, /prog/, what were the nastiest bugs you ran into?
Mine was when I coded a multithreaded Java project for university. In our group was a girl which we considered incompetent and so we only gave her lowest-tier tasks where no sentinent being should be able to cause any harm. Stuff like putting the debug output calls in comments for the final version.
The result looked like this:
void runThreads() {
while(!done) {
iteration++;
if (iteration%10000 == 0)
//Debug.out("Iteration: " + iteration + ", State: " + state.toString());
/* I'm a huge comment explaining
what the critical section does*/
syncThreads();
doCriticalStuff();
}
};
Needless to say, our debug version sometimes had incorrect output due a data race resulting from the missing synchronization. The really annoying part was that this was part of the proven, extensively tested and seemingly unchanged core program and merged alongside with a large update to peripheral functions, so we spent several days testing the graphing, output, and other stuff before finding where the problem was. And then there was a huge comment in the middle which made it easy to overlook the if-statement when looking at the seemingly important parts.
Hi, I am a student of physical science and let me know that you recommend for learning languages. I have several interests but I have nothing definite, I like particle physics, solid state, molecular simulation, complex systems.
I have heard now what science is being used in Python and Fortran was used long before How do I find it on my own? Where can I see languages used for research?
Also, would it be good to learn like "Origin"?
Metaprogramming
Let's talk about compile time programming. Do you find it useful? Do you even use it?
I've been scratching the surface since I have not really needed to use it but I've become more aware of the importance of doing calculations at compile time rather than during ruin time. Here are compile time strings:
#include <string>
class CTString{
private:
const char* const p_chars;
const std::size_t _size;
public:
template<std::size_t N>
constexpr CTString( const char(&p_Chars)[N] ):p_chars(p_Chars),_size(N-1){
}
constexpr char operator[]( std::size_t N ){
return N < _size ? p_chars[N]: throw std::out_of_range("");
}
constexpr std::size_t size(){
return _size;
}
constexpr const char* const str(){
return p_chars;
}
};
We Know What Youre Doing
After months of being offline and the loss of our original domain, we know what you're doing is back online at a temp address: http://weknowwhatyouredoing.esy.es/
The abysmal state of the majority of PL development
I can forgive languages like C, C++, LISPs, and even Java to some extent, because at the time we needed performance (where we used C/C++) and we didn't know any better (where we might have used a LISP).
However, there is a glut of modern languages that appear to have been developed by studiously ignoring the last 30 years of programming language research. JavaScript, Python, Ruby, Go, Erlang, and before you think I'm hating on dynamic languages, C#, F# and Scala too.
Concepts such as static types, immutability, parametric polymorphism, tail call elimination, first-class functions, higher-order functions, type inference, type classes, higher-kinded types, and rank-n types have all proven themselves and are absolutely essential to avoid code duplication and enable code reuse. Additionally, concurrency and parallelism become almost trivial when these features are present.
My question is: why are we still creating crippled languages, that do not allow for modularity, reusability, equational reasoning and easy concurrency and parallelism, when we know how to design better languages that do allow for these things?
Let's build a programming language
Hey /prog/, I'm building a language. Here's an example, its the factorial function:
def is-zero [id, #0] =
def decr [id, #1] -
def ! is-zero -> #1 ; [id, decr!]
This should give you a feel for the syntax of the language. All of it. There are no variables, everything is a function application. Tuples, denoted [a,b … z] provide a way of destructing and restructuring data without explicit variables. Here's the basic evaluation rules:
[f1, f2, … fn] applied to a is equal to [f1 applied to a, f2 applied to a, … fn applied to a]
f g applied to a is g applied to f applied to a (composition)
Elements are accessed through the 1, 2, 3 … n functions.
When # is before a constant it is interpreted as a function that when given any argument will return that constant.
Here's paul graham's make-adder function in this language, which makes use of the postpone operator (^) that is used to make closures/delay evaluation:
def make-adder [id, ^id] +
That's basically the whole language.
Hello all, currently I am learning JavaScript, I was wondering if there is a way to save a file to the same directory as the js file that would contain info the the user provided.
The reason I ask this is I'm wondering if I can create a simple game that you can come back to and continue your adventures. I already have every thing else planned out.
Technological Dependency
https://www.youtube.com/watch?v=t7Xr3AsBEK4
I, am, and all of you are, Tech dependant and most likely addicted. Technology in this case being used as a referrant to computational technology, having the amount of social media, sharing, and information we do with modern technology has made us dependant on technology, Socially as much as intellectually. Children are growing up to be ADD and Socially impaired because they live most of their social lives on the internet, where they can be their own Barbie doll; Looking, Thinking, and Communicating exactally how they would like to. This is a major problem. Kids are growing up on their sites only having to interact with the things and people they are interested in, merely discarding anything they care not about. These kids grow up to become rediculously ADD when faced with a task which is not in their area of interest, for that is how they have been conditioned to think. Crowds are exponentially more malleable when it comes to opinion and stance now as well. Without the internet, people like trump would not have as much praise, because people would have to actually think and form their own opinions about him in the stead of reading an article by a 'trusted' news source on Facekaf and preaching it to all of their friends. In the informational sense, dependency forms in that we have the answers to most any question at our fingertips, and take more advantage of that than we should. Our relationship with the internet when it comes to information is directly comprable with the person who uses a calculator for all of their mathematics, or one who uses a wheelchair for all of their movement, despte the fact that the alternitaves for both help build yourself. So this applies, as too it applies to the internet's constant exploitation as a primary informational source. When given a project, people google the project to see what other people have done already. When given a politival decision, people google the topic to find an argument which is close to what they think theirs would be to use as their own. The list of examples goes on and on, and i have a rediculous amount of homework to do, but embed related.
Linking problems.
It's probably something stupid and simple, but I can't find it. Everything compiles fine, I can't link the object files.
Link command:
/usr/bin/c++ CMakeFiles/game.dir/game/src/globals.o CMakeFiles/game.dir/game/src/loadOBJ.o CMakeFiles/game.dir/game/src/generator.o CMakeFiles/game.dir/game/src/loadTexture.o CMakeFiles/game.dir/game/src/camera.o CMakeFiles/game.dir/game/src/loadShaders.o CMakeFiles/game.dir/game/src/main.o -o bin/game -rdynamic -lGLU -lGL -lSM -lICE -lX11 -lXext -lGLU -lGLEW -lglfw lib/open-simplex-noise-in-c/bin/libopen-simplex-noise.a -lGL -lSM -lICE -lX11 -lXext -lGLEW -lglfw
Output:
CMakeFiles/game.dir/game/src/generator.o: In function `getOpenSimplex(int, int, float**, float, bool)':
/media/pidata/project/MENR/game/src/generator.cpp:16: undefined reference to `open_simplex_noise(long, osn_context**)'
/media/pidata/project/MENR/game/src/generator.cpp:22: undefined reference to `open_simplex_noise4(osn_context*, double, double, double, double)'
/media/pidata/project/MENR/game/src/generator.cpp:26: undefined reference to `open_simplex_noise4(osn_context*, double, double, double, double)'
/media/pidata/project/MENR/game/src/generator.cpp:28: undefined reference to `open_simplex_noise4(osn_context*, double, double, double, double)'
/media/pidata/project/MENR/game/src/generator.cpp:30: undefined reference to `open_simplex_noise4(osn_context*, double, double, double, double)'
/media/pidata/project/MENR/game/src/generator.cpp:40: undefined reference to `open_simplex_noise_free(osn_context*)'
collect2: error: ld returned 1 exit status
If lib/open-simplex-noise-in-c/bin/libopen-simplex-noise.a is renamed the command fails with:
c++: error: lib/open-simplex-noise-in-c/bin/libopen-simplex-noise.a: No such file or directory
So I know which file it's linking, and that it is finding it. Here is the the output of objdump -t lib/open-simplex-noise-in-c/bin/libopen-simplex-noise.a:
In archive lib/open-simplex-noise-in-c/bin/libopen-simplex-noise.a:
open-simplex-noise.o: file format elf64-x86-64
SYMBOL TABLE:
0000000000000000 l df *ABS* 0000000000000000 open-simplex-noise.c
0000000000000000 l d .text 0000000000000000 .text
0000000000000000 l d .data 0000000000000000 .data
0000000000000000 l d .bss 0000000000000000 .bss
0000000000000000 l d .rodata 0000000000000000 .rodata
0000000000000000 l O .rodata 0000000000000010 gradients2D
0000000000000040 l O .rodata 0000000000000048 gradients3D
00000000000000c0 l O .rodata 0000000000000100 gradients4D
0000000000000000 l F .text 00000000000000a0 extrapolate2
00000000000000a0 l F .text 00000000000000ef extrapolate3
000000000000018f l F .text 000000000000012f extrapolate4
00000000000002be l F .text 0000000000000036 fastFloor
00000000000002f4 l F .text 00000000000000bc allocate_perm
0000000000000000 l d .note.GNU-stack 0000000000000000 .note.GNU-stack
0000000000000000 l d .eh_frame 0000000000000000 .eh_frame
0000000000000000 l d .comment 0000000000000000 .comment
0000000000000000 *UND* 0000000000000000 free
0000000000000000 *UND* 0000000000000000 malloc
00000000000003b0 g F .text 00000000000000d5 open_simplex_noise_init_perm
0000000000000000 *UND* 0000000000000000 memcpy
0000000000000485 g F .text 00000000000002ef open_simplex_noise
0000000000000000 *UND* 0000000000000000 __stack_chk_fail
0000000000000774 g F .text 0000000000000072 open_simplex_noise_free
00000000000007e6 g F .text 00000000000008fa open_simplex_noise2
00000000000010e0 g F .text 000000000000314b open_simplex_noise3
000000000000422b g F .text 0000000000007c57 open_simplex_noise4
...
0000000000000485 g F .text 00000000000002ef open_simplex_noise
...
0000000000000774 g F .text 0000000000000072 open_simplex_noise_free
...
000000000000422b g F .text 0000000000007c57 open_simplex_noise4
...
Redoing my shit
So I did alot of html, css, javascript and python learning several months ago, I was desperately looking for a job in it. But I was too frustrated that I could not create anything amazing yet. All I did was sit there all day and practice coding, and eventually I got burned out. So I took a break from it and got a job at a market. I want to come back to this, and get a job as a programmer. The pay is much better, and this seems like something I want to do as a career, hell my dad does it for a career. He thinks I might be ready in 2 or 3 months, but idk. I think I have forgotten quite a bit since when I started. My question is, do you think its possible to relearn and surpass my past efforts if I start this again? Will I be ready for some jobs in a few months?
How should I start C programming? Is this good place to start?
https://www.youtube.com/watch?v=2NWeucMKrLI&list=PL6gx4Cwl9DGAKIXv8Yr6nhGJ9Vlcjyymq
So /tech doesn't like my code so I'll share it with all of you :-)
Website Blocker
#include<stdio.h>
#include<dos.h>
#include<dir.h>
char site_list[6][30]={
"google.com",
"www.google.com",
"youtube.com",
"www.youtube.com",
"yahoo.com",
"www.yahoo.com",
"bing.com",
"www.bing.com",
"4chan.org",
"www.4chan.org",
"8ch.net",
"www.8ch.net",
"duckduckgo.com",
"www.duckduckgo.com",
"google.ac",
"www.google.ac",
"google.ad
"www.google.ad",
"google.ae",
"www.google.ae",
"google.af",
"www.google.af",
"google.ag",
"www.google. ag",
};
char ip[12]="127.0.0.1";
FILE *target;
int find_root(void);
void block_site(void);
int find_root()
{
int done;
struct ffblk ffblk;//File block structure
done=findfirst("C:\\windows\\system32\\drivers\\etc\\hosts",&ffblk,FA_DIREC); /*to determine the root drive*/
if(done==0)
{
target=fopen("C:\\windows\\system32\\drivers\\etc\\hosts","r+"); /*to open the file*/
return 1;
}
done=findfirst("D:\\windows\\system32\\drivers\\etc\\hosts",&ffblk,FA_DIREC); /*to determine the root drive*/
if(done==0)
{
target=fopen("D:\\windows\\system32\\drivers\\etc\\hosts","r+"); /*to open the file*/
return 1;
}
done=findfirst("E:\\windows\\system32\\drivers\\etc\\hosts",&ffblk,FA_DIREC); /*to determine the root drive*/
if(done==0)
{
target=fopen("E:\\windows\\system32\\drivers\\etc\\hosts","r+"); /*to open the file*/
return 1;
}
done=findfirst("F:\\windows\\system32\\drivers\\etc\\hosts",&ffblk,FA_DIREC); /*to determine the root drive*/
if(done==0)
{
target=fopen("F:\\windows\\system32\\drivers\\etc\\hosts","r+"); /*to open the file*/
return 1;
}
else return 0;
}
void block_site()
{
int i;
fseek(target,0,SEEK_END); /*to move to the end of the file*/
fprintf(target,"\n");
for(i=0;i<6;i++)
fprintf(target,"%s\t%s\n",ip,site_list[i]);
fclose(target);
}
void main()
{
int success=0;
success=find_root();
if(success)
block_site();
}
How into software security
Most startups, and even gigantic corps have little or no actual security people to test software. It's just a factory where you churn out features and nobody is doing any checking, they work with C libraries with abstracted shit like angular/coffeescript/javascript and don't do proper testing or even best practices. If you learn how to write tests yourself, then you basically create your own CSIO role and parachute yourself into it. Remote CSIO is pretty easy, you just load up Emacs and use plugins like HiLock to quickly search through code, and org-mode to bookmark code you spot is obviously flawed or with to test later. You write your recommendations then go back to the beach in Thailand or w/e you work out of.
Start with
How to Design Program (HtDP)
it focuses on sane design and running tests in Racket (Scheme). The MOOC for it on edX is free, payment only for certificate of completion https://www.edx.org/xseries/systematic-program-design-0
At first it feels like rote learning, you are writing all these templates for seemingly simple functions. Trust me, it makes sense later on in the course/book when the programs become huge. You can slide right into Typed Racket after just a few chapters in https://www.classes.cs.uchicago.edu/archive/2014/fall/15100-1/guide.html
Do the rest of the course in Typed Racket to learn about type safety and you'll see for yourself how it works when you fail tests accidentally.
Now you need to write your own security tests, to start breaking non typed software using your knowledge of how stuff can break from creating type safe software. Read Gray Hat Python http://libgen.io/book/index.php?md5=381ABC536B480375ED49608177BB54E3
It specifically teaches you how to write security tests. If you've never used Python (after doing HtDP course) then read Zed Shaw's Python the Hard way tutorial which you will zoom through if already done HtDP http://learnpythonthehardway.org/book/ and/or Violent Python http://libgen.io/book/index.php?md5=eae478007e8e105aed06876890dfdf3d
Now get and read the following books:
Learn C the Hard Way http://c.learncodethehardway.org/book/
Secure Coding in C and C++ (2nd Edition)
The Art of Software Security Assessment
Zed Shaw's C tutorial has you breaking shitty code in the 4th lesson. The other books are still the defacto guides to secure development. It doesn't matter that they are C related, since the vast majority of errors apply to every program regardless of language. Whenever you come across a problem in the software assessment books, write a test for it and apply it to the software you maintain/build. If it fails, congrats you just saved whoever you work for countless money should anybody exploit that later.
Now go on HN (Hacker News https://news.ycombinator.com/news) and search for Unit Testing, Regression Testing, Fuzzing, and Security Tests. Write some of your own using their examples and apply them to where you work. If they don't parachute you into CSIO by now then nobody else will ever get that job. I guarantee you will break absolutely everything just doing basic tests unless you're using type safe languages from the start, which is hardly any company right now.
Other helpful books:
The Mobile Application Hacker's Handbook
The Web Application Hacker's Handbook
The Tangled Web: A Guide to Securing Modern Web Applications
The Android Hacker's Handbook
Yes, webdev shit but everything is networked, everybody runs a browser, every app has an API, ect. Again, everything you learn from those books write tests for them in your software suite (by now, your suite is so large you could probably sell or license it).
continued next post(s)
How do I get away from Javascript?
Hey /prog/ I just finished everything on http://freecodecamp.com But I don't want to stick with javascript everything. Is there resources you know of that can help me get out of this? I've been looking into Go but I don't know what to do.
Tips for pre-college beginners?
Still in Highschool and I've decided that I want to do programming as an occupation. Does anyone have any tips on how to start out? I'd like to get a strong knowledge base in [insert basic, widely used, programming language here.] before I even think about a post-secondary school.
C Version of Tor's Hammer?
Anyone interested in working on a C DoS tool with me?
I just have a simple prototype so far,
btw yes it's skid'd because i'm lazy, but I had to get something quick as I have a lot of other shit to program but i'm gonna dedicate some time to this.
Anyway here's the link and I can't wait to be shitposted to.
8chan auto-notifications
I made a simple auto-notification script that you can run on your *nix machine. Just toss this script in your crontab, or run it in a loop on screen and you will start getting notifications for your favorite boards.
You can call this script like this to get notifications from /b/ and /prog/.
./8chan.sh b prog
Add as many boards or as few as you'd like.
#!/bin/bash
for board in "$@"
do
if [ ! -f /tmp/$board.hash ]
then
curl --silent http://8ch.net/$board/0.json | md5 > /tmp/$board.hash
else
oldHash=`cat /tmp/$board.hash`
newHash=`curl --silent http://8ch.net/$board/0.json | md5`
if [[ ! $oldHash == $newHash ]]
then
echo $newHash > /tmp/$board.hash
say "$board has a new post"
fi
fi
done
Note: I believe is only available on mac os, so you might need to change that to whatever your OS uses.say
Cheers.
Greetings programmers.
I have a specific request today that I hope someone here has an answer to. There was a book I once found on /g/ years ago that I disregarded but it was held in high repute for its occult like angle of approaching computer science. I'm not sure if it contained actual coding practices within, or information designed to help get your mind into the proper space required for advanced coding but I'd love to read it now and feed my mind.
It may have been a seperate book, but I semi remember seeing a wizard on the front pointing to a Delta (triangle).
Anyway, any other books that would provide a strong introduction into advanced programming thinking (and not so much using the languages themselves) would be much appreciated!
What are the basic things every programmer should know? Any practical advice you can share with new programmers like myself?
For example:
1) Several languages
2) Web development
3) Database basics
4) ability to think abstractly
5) Math?
Please add any of your own or relevant advice/tips/useful skills?
What is the role of cin.get(); in the following code, I believe that it satisfies the requirement that the program wait for user input however the c++ refrence description of get() is confusing me
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main () {
ifstream file ("inputfile.txt")
string line;
while(getline(file,line))
{
cout << line + "\n";
cin.get();
}
}
The developer has locked a word document called "protected.doc" with a password. He left this clue:
You will have to Ask and then See. BHOLD two times to reveal the password from this Key:
01001100, 6F, 154, I, 105, 01110000, 6F, 160, s, 50.
Can someone solve this for me? Or at least help. I tried converting all of it into ASCII (assuming the three digit values were octal).
Reverse Engineer thread
Didn't see one in the catalog.
Let's talk about
>what we're working on
>tools we're using
>essential reads
>our favorite architectures
>other fun things
Also a reminder that REing isn't the dark art some people claim it is, as long as you have a decent understanding of programming, and know some low-level things (how data is stored in memory, how a processor executes code, basic knowledge about different file formats..) you could start reverse engineering today! Especially with tools like IDA and Hex-Rays which make it a lot easier than it was years ago.
Windows 10 - All Secret Folders!
Windows 10 - All Secret Folders!
Action Center.{BB64F8A7-BEE7-4E1A-AB8D-7D8273F7FDB6}
Backup and Restore.{B98A2BEA-7D42-4558-8BD1-832F41BAC6FD}
Credential Manager.{1206F5F1-0569-412C-8FEC-3204630DFB70}
Devices and Printers.{A8A91A66-3A7D-4424-8D24-04E180695C7A}
Display.{C555438B-3C23-4769-A71F-B6D3D9B6053A}
HomeGroup.{67CA7650-96E6-4FDD-BB43-A8E774F73A57}
Notification Area Icons.{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}
Recovery.{9FE63AFD-59CF-4419-9775-ABCC3849F861}
RemoteApp and Desktop Connections.{241D7C96-F8BF-4F85-B01F-E2B043341A4B}
Speech Recognition.{58E3C745-D971-4081-9034-86E34B30836A}
Troubleshooting.{C58C4893-3BE0-4B45-ABB5-A63E4B8C8651}
Administrative Tools.{D20EA4E1-3957-11d2-A40B-0C5020524153}
All Tasks (Control Panel).{ED7BA470-8E54-465E-825C-99712043E01C}
AutoPlay.{9C60DE1E-E5FC-40f4-A487-460851A8D915}
BitLocker Drive Encryption.{D9EF8727-CAC2-4e60-809E-86F80A666C91}
Computer Folder.{20D04FE0-3AEA-1069-A2D8-08002B30309D}
Default Programs.{17cd9488-1228-4b2f-88ce-4298e93e0966}
Ease of Access Center.{D555645E-D4F8-4c29-A827-D93C859C4F2A}
Font Settings.{93412589-74D4-4E4E-AD0E-E0CB621440FD}
Get Programs.{15eae92e-f17a-4431-9f28-805e482dafd4}
Manage Wireless Networks.{1FA9085F-25A2-489B-85D4-86326EEDCD87}
Network and Sharing Center.{8E908FC9-BECC-40f6-915B-F4CA0E70D03D}
Network Connections.{7007ACC7-3202-11D1-AAD2-00805FC1270E}
Network Folder.{208D2C60-3AEA-1069-A2D7-08002B30309D}
Parental Controls.{96AE8D84-A250-4520-95A5-A47A7E3C548B}
Personalization.{ED834ED6-4B5A-4bfe-8F11-A626DCB6A921}
Power Options.{025A5937-A6BE-4686-A844-36FE4BEC8B6D}
Programs and Features.{7b81be6a-ce2b-4676-a29e-eb907a5126c5}
Sync Center.{9C73F5E5-7AE7-4E32-A8E8-8D23B85255BF}
System.{BB06C0E4-D293-4f75-8A90-CB05B6477EEE}
User Accounts.{60632754-c523-4b62-b45c-4172da012619}
Windows Firewall.{4026492F-2F69-46B8-B9BF-5654FC07E423}
GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}
Hi there. Hope you could help me with a small problem - /b/ and /tech/ didn't help much so far.
I'm trying to get rid of one annoying auto-completion feature and I just can't find it anywhere in the settings… It's too specific for Google and too stupid for a new StackOverflow thread - so I hope you could help me. Thanks for any hint.
tl;dr VS15, C#, autocompletion, want if(x==1){x=2;}, getting if(x==1) {x=2;}
* (defun reader-macro (stream char)
(declare (ignore char))
'(print "2 is for nerds"))
READER-MACRO
* (set-macro-character #\2 #'reader-macro)
T
* 2
"2 is for nerds"
"2 is for nerds"
* (+ 32 5)
"2 is for nerds"
debugger invoked on a SIMPLE-TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {1002D7F363}>:
Argument Y is not a NUMBER: "2 is for nerds"
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-KERNEL:TWO-ARG-+ 3 "2 is for nerds")
I'm not sure what I expected…
Lisp general.
>Favourite dialect
>What are you working on
>What is your favourite thing about Lisp
>What is your least favourite thing about Lisp
>Favourite dialect
Common Lisp, though I haven't used enough dialects to have a particular reason why.
>What are you working on
Just messing around with some sample projects and occasionally trying out all the weird things you can do.
>What is your favourite thing about Lisp
The simplicity and flexibility. Particularly Macros.
>What is your least favourite thing about Lisp
Community is too small so other programmers bully ;_;
Why Python sucks
- Slow & inefficient performance
- Annoying indentation syntax that can't even mix tabs with spaces
- Inconsistent
- mutable and immutable primitive types mess
- Implicitly changing passing object by copy or reference, adding artificial complexity.
- No type safety
- Scope mess
- Shit class system
- Can't have more than 1 constructor
- Have to pass the class object to itself and use it to access its own members ('self')
How do I actually get GOOD at programming? I've already got a decent enough understanding of C and C++, and have been doing shitty ass games with SDL, SFML, and Irrlicht, but that's baby shit. Where do I even start if I want to move up to big boy coding?
I want to be able to do stuff that's actually worth being proud of. Like making my own renderer or whatever the fuck else.
Dynamic linking and new languages/compilers.
So, for years, at least in the unix field, we've been using shared libraries to avoid duplication across every binary. This usually goes tightly coupled with a package manager. If myprogram needs libcrypto.so, it "depends" on it, and the package manager makes sure it's installed.
Static linking can be useful for binary redistribution, and when a program requires a specific version of a library to work.
Now, lately, some new (admittedly interesting) programming languages have popped up (Better worded: they have gained some popularity). I've found Go, Rust and Nim, though there could be others.
These three, all come with a package manager of their own to fetch and build dependencies, which is totally fine. The only problem is, it is very difficult if not impossible to build the dependencies as shared libraries, and link the binaries dynamically.
Sure, this might be a good idea if you just want to redistribute a binary, or if you want your dependencies at a very specific version.
But how will system package managers handle this? Sure, they can go the lazy way and provide the static binary, but that goes against what a package manager is meant to do (Hurp durp drag and drop in (/usr)/bin).
Why can't these languages/compilers at least make it easy to build shared objects and dynamically linked binaries "the olde way"?
Can you help me extend the knowledge about the symptoms of a linuxfag coder?
This is what I have so far:
> Didn't discover the concept of GUI. Still uses the command line.
> Didn't discover the concept of IDE. Still using and wasting time with obsolete ancient text editors.
> Didn't discover the concept of abstraction. Still writes code in C.
> Didn't discover the concept of progress. Still wasting time on reinventing square wheels.
Learn to program?
Hey guysLearning tools.
I've been wanting to learn programming for a couple of reasons, one is music stuff (Probably with Python), the other is PHP for putting together a redesign of a site I'm a part of. My question is, are books worth picking up, or is it better going through free tutorials online? Which is more likely to get me to my end goals quicker?
black death group is looking for a very highly skilled hacker for our ongoing contracts, we're paying 3500$ per day whether you work or not
more details and website available on request
contact on: blackdeathgroup@torbox3uiot6wchz.onion
blackdeathgroup@safe-mail.net
BM-2cWUGLuRXvzuJRgAT6FEC5NJpEP8QLxWsp@bitmessage.ch
QUESTIONS GENERAL
There is no sticky here so I'll make a questions thread.
I made a program (for an excercise in a book) that draws an histogram of the length of words in a given text.
It works absolutely fine except for one little thing.
here's the full source code: http://pastebin.com/eFjEGA79
here's the relevant part:
while((c=getchar())!=EOF){
if (c!=' '&&c!='\t'&&c!='\n'&&c!='.'&&c!=',')
++teller;
else if(teller>=10){
++woord[10];
if (woord[10]>=maxteller)
maxteller=woord[10];
teller=0;
}
else{
++woord[teller];
if (woord[teller]>=maxteller)
maxteller=woord[teller];
teller=0;
}
}
++woord[teller];
if (woord[teller]>=maxteller)
maxteller=woord[teller];
When I was testing it I made a typing mistake and I hit backspace. Now this made me wonder if that does ++teller (teller is dutch for counter) since every keystroke except ' ' && '\t' && '\n' adds to it. In my reasoning backspace is part of ascii so getchar() 'gets' it and returns 8, which is the decimal integer for it, resulting in c having that value and c returng true to the first if.
tl;dr
hitting backspace to correct a typing mistake does not add to the word length although I didn't specify it do to so and I don't understand why.
Idris
Get rekt lads Idris master race coming through.
Help/Advise on coding a card game.
Hey guys, first time posting. Im programming a battle card game and im just having some trouble on drawing a random card from a deck of 60 cards and removing the card from the deck completely.
Ive been using a random number generator to test this but since you cant take a variable out of an array it makes it a bit hard. I'll post my code my next post.
Why Python sucks
============
- Slow & inefficient performance
- Annoying indentation syntax that can't even mix tabs with spaces
- Inconsistent
- mutable and immutable primitive types mess
- Implicitly changing passing object by copy or reference, adding artificial complexity.
- No type safety
- Scope mess
- Shit class system
- Can't have more than 1 constructor
- Have to pass the class object to itself and use it to access its own members ('self')
New here, need your advice :)
So /prog/ (phonetically Prague, interestingly) this is my first time here and I have a few questions for you. I have never coded before but I would like to learn for a very specific purpose and I wanted advice.
First, I will explain the concept:
What we want is to create an online live battling league which works in real time, can record battles held with both microphone input and webcam input if enabled and automatically record that data to webserver. It can pull up beats from YouTube SoundCloud etc and have them in a lightweight player, the connections should be lightweight so it doesn't lag an obscene amount on a lesser system or connection. We would need multiple "rooms" and the ability to create them for specific battles and perhaps even a connection sort of like private messaging using the same system. This would be best if it were all built into a website but if ABSOLUTELY NECESSARY to be done well I suppose it could also have an external program.
What coding language would best fill these requirements and do all this well? How difficult would this be on a scale of 1-1000? Do you have any ideas for improving upon the idea or perhaps an efficient way of bringing this about?
Also, once the coding language is decided what is the absolute best way to learn it for me?
>pic unrelated but awesome
Hey /prog/, I'm pretty new to programming, and was looking to make a career out of it, I do enjoy it but feel like what I'm doing is kind of slow going.
So, I started reading books on C++, and I'm not sure when I'll feel like I'm ready to go looking for work with it, but I assume other languages would be more hire-able earlier on.
I was thinking of swapping over to Java in an attempt to find something more quickly and get myself off of the cooking jobs paying just a bit more than minimum wage, but I don't know what resources are best for learning good habits.
Why does everyone like static/strong typing? Maybe it's a consequence of all my codebases being <1mil LOK and used by < 20k people, but I've never seen a use for it. It needlessly keeps your code from being flexible, requires a lot of extra LOC and boilerplate, and doesn't seem to really give you much of a security gain in advance. I've worked with languages with dynamic typing for my entire career and I've never hit a serious bug that would have been fixed if only I was forced to declare that such-and-such a function only took ints, not floats or strings. Whenever I have to work with a language that gives a shit about types I always feel like I'm wasting my time getting it to do things that would be much more straightforward in another language. Is there some huge class of bug that I'm missing?
Questions better suited for stackoverflow thread.
Small questions that don't need a separate thread.
gifts = ['bike', 'cancer', 'rattler', 'toaster']
for n in gifts:
if n != 'cancer':
print " You are getting a " + n + " for christmas!"
elif n == 'cancer':
"You're getting cancer!"
else:
print "fgfgsdf"
You are getting a bike for christmas!
You are getting a rattler for christmas!
You are getting a toaster for christmas!
C++ primer exercise
So, I'm reading C++ Primer 5th edition, I get to chapter 5, and, I'm not sure how to go about solving one of the exercises.
When I get stuck I typically look at how the problem was solved here https://github.com/Mooophy/Cpp-Primer.
But there's a fatal error in how they solve it.
They use pair, and when I look that up in the back of the book, that type doesn't appear for about 230 more pages, and isn't even mentioned beforehand, as they sometimes do with "there's this we'll discuss later"
The exercise is as follows.
Write a program to read strings from standard input looking for duplicated words. The program should find places in the input where one word is followed immediately by itself. Keep track of the largest number of times a single repetition occurs and which word is repeated. Print the maximum number of duplicates, or else print a message saying that no word was repeated. For example, if the input is
how now now now brown cow cow
the output should indicate that the word now occurred three times.
I'm thinking that I'd start with a vector of strings, and a string variable, use a while loop to get input into the string variable, using .push_back to put the strings into the vector.
Then create a for loop to go through the string vector, comparing the current string to the next one, and upping a counter.
My issue being, what do I do to make it so, if I find say 3 of a word, and then 4 of a different word, make it use the 4, not the 3, and not have a counter just go from 3 to 7?
So, what do you think of Julia language? It only came out a couple of years ago but it's getting popular.
It is a dynamically typed language but it has a very powerful type system and a JIT, so you can write code that has close to the speed of C code. It has multiple dispatch and with the type system, you can write generic functions really easily. It has lisp style macros, parallelism, and threads. And it can interface with C and Python really easily.
I'm pretty excited for this language. Hoping it will at least replace Python in the scientific community. What do you guys think?
>my whole life is code
>eat sleep breath code
>i do nothing that isn't code
>i am the code machine
>i am the code
>IF I DREAM AT ALL it is in code
Ok serious. Have any of you had dreams that were just code? How so? I've had a few dreams recently that are just my text editor and me spitting out code. It's kind of neat I guess, sometimes it's not even anything I'm working on IRL. Does this happen to any of you? Anything cool come to you in your sleep? Did you remember it at all?
cross platform c++ development
Microsoft visual studio baby here.
I'm working on a C++ project and I want to put it on my git but I don't want to exclude Linux users so I'd like to know how to get into cross platform c++ compiling.
All I know about compiling my C++ projects is how to open a visual studio project and press "build".
I've never worked with Linux before so I could seriously use some help here.
goto
I see a lot of hate for goto, a lot of places saying never to use it in your code no matter the circumstance, and a lot of languages that despite being procedural decide to completely omit the feature. There was a python module written as an April fool's day joke that implemented goto, but urged the reader to never actually use it for anything. Java treats it as a syntax error. People say that it should be avoided because it makes code harder to read and can always be replaced with structured code.#include <iostream>
#include <vector>
std::string join(std::vector<std::string> const vec, std::string const sep) {
if (vec.size() == 0) return "";
std::string result;
auto pos = vec.begin(), end = vec.end();
goto skip_separator;
while (pos != end) {
result += sep;
skip_separator:
result += *pos++;
}
return result;
}
int main() {
std::vector<std::string> vec {"a", "test", "string"};
std::cout << join(vec, " ") << std::endl;
return 0;
}
Android Programming
Hey guys I'm working on an android soundboard because I am also taking a Java College class and would just like to dive into things because I don't really learn much in that class because its all theoretical.
I am having an issue with the sounds playing and a navigation drawer. Here is the link to my stack overflow question:
http://stackoverflow.com/questions/29581844/button-linked-to-sounds-onstart/29583172#29583172
(Too long to post here) Please help me out! (This is also my first 8chan post be nice plz…)
Holla Holla get dolla
So how can I make money from my programming skills? I know c++ and c# inside out but since I never went to uni and got a degree I have no chance of getting an actual job. How can I make sone money on the side with this stuff though? I've heard that mobile apps are too populated nowadays so that's out.
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."
What uses are there for pointers in C++?
Currently learning Sepples, and I'm genuinely curious about how pointers are used in a general basis. What are some situations where pointers would make your life easier, or save your ass or time? So far, I've only seen how useful it can be for iterating through shit like arrays and cstrings…Reading code
Do you guys know any project/program/app that you think it's useful to read and learn about it? For example, good coding standards or awesome implementation.Web developing noob halp
Hi everyone,
The thing is this: i've been reading books and doing tutorials on HTML/CSS/JS. I've made the excersices for each material i've looked into. I'm trying to make my own web applying Foundation, but i feel very green for what i need to make (which is basically a Carpooling System for my town). Where i can get some real life examples and problems? by real life i mean, from functional/tech designs used in consulting jobs (i'm actually working at one, but in SAP ABAP) to entire source for the projects.
Thanks in advance!
Share something you learnt recently that you thought was cool and explain it.
Doesn't matter what it is. Just state what it does, why you think it's cool, and explain it! Explaining things to others is how you master your own learnings and also has a neat by-product of helping others.
[Web development]
If you use a templating langauge (eg. Handlebars, Mustache, Jade templates) or anything else that injects html elements into the page after it's already loaded, regular javascript selectors (eg. $('element').click) will not work.
They don't work cause the element wasn't mapped when the DOM first loaded. Using this you can select them anyway though:
<code>
$(document).on('event', 'element', 'yourFunction'); </code>
example:
<code>
$(document).on('click', '.aDiv', 'yourFunction');
yourFunction = function () {
$(this).css('color','red');
};
</code>
So basically, when you do something, and that something happens have the class or id of the element you're looking for, run a function.
pic unreleated
semantic pondering
Not being too srs here, but sometimes I like to fantasize about how certain language semantics could be altered. Came up with this earlier:
void eg() {
// Series of if statements, typical for any C-styled language:
if (a) {}
else if (b) {}
else {}
// If you wanted loops, you can (in C):
if (a) while (a) {}
else if (b) while (b) {}
else while (c) {
// This last condition is exactly equivalent to:
// else if (c) while (c) {}
// "while ()" performs a check, defeating the point of "else"
}
// Which brings us to:
// Changing the semantics of while, for, and else:
while (a) {
// "while" and "for" can now be used to create a series of conditions, like "if".
}
else while (b) {
// Now, instead of ending the series of if statements, "else while"
// is treated like an "else if" where "else while (condition)"
// functions like "else if (condition)"
break; // will exit the entire series of blocks, skipping over "else"
}
else {
// This block is executed when neither condition (a) nor (b) are true.
}
// There is no point in an "else" or "default" loop
// since loops perform an "if" check by definition.
// …With one exception, a "do while ()" loop performs no check:
if (a) {}
else do {
// "else do while ()" is already possible in C and already functions
// the same way as in this example. It is just an "else".
} while (c);
// These examples could be mixed:
while (a) {}
else if (b) {}
else for (int i = 0; i < c; ++i) {}
else do {} while (d);
}
I'm sure plenty of you have ideas. Post them, or if you're feeling frisky, tell me how stupid mine is. Consider this a semantic masturbation thread for autists.
Starting programming
Hey /prog/, I'm currently learning my first programming language, C++ (inb4 "retard starting with C++)
Anywho, I'm trying to decide on what language I should pair with it, as I'd like to turn it into a job at some point.
I'm thinking Java / C#, but I can't say I know the upside or downsides to either language and would like some opinions from people with more experience.
Procedural writing.
Hey /prog/ at school we have to do some procedural writing activity, I decided to do Lua, you guys think this is a good TUTORIAL for BEGINNERS, and people with 0% experience with coding? inb4 ur spelling is shit
Commands:
= math.pi –Will print first 14 digits of pie.
= math.random(1,100) –Makes a random number gen.
a = 1
b = 2
= a+b
print(_VERSION)
+: addition
-: subtraction
*: multiplication
/: float division –(Standard Division.)
//: floor division
%: modulo –(Remainder.)
^: exponentiation –(To the power of)
-: unary minus
==:equality
~=:inequality
<:less than
>:greater than
<=:less or equal
>=:greater or equal
random = math.random(0,100)
print(random)
–This prints a valid point.
–Where as.
F = math.random(0,100)
print(f)
–Will have an error.
Introduction: Lua, what is it? Well you see Lua is a coding language, what is code? Code is what you use, to communicate with your computer. Lua is a lightweight addon to C. So where is it used? Lua has been used to make such applications and games as:
Adobe Photoshop Lightroom uses Lua for its user interface.
Cheat Engine, a memory editor/debugger, enables Lua scripts to be embedded in its "cheat table" files, and even includes a GUI designer.
Damn Small Linux uses Lua to provide desktop-friendly interfaces for command-line utilities without sacrificing lots of disk space.
Games that use Lua include:
Angry Birds
Crysis
Dark Souls
Garry's Mod
S.T.A.L.K.E.R: Call of Pripyat
S.T.A.L.K.E.R: Clear Sky
S.T.A.L.K.E.R: Shawdow
Saints Row 2
Saints Row 4
Saint Row 3
SimCity 4
Star Wars: Battlefront
Star Wars: Battlefront 2
The Sims 2: Nightlife
World of Warcraft
So, why lua? Well you see Lua is relatively easy to learn, thus my reasoning.
Today your going to be doing math, and making your own calculator for calculating, probability, and calculate the circumference of a circle.
Alright Step one, here we go.
First step make sure your computer is on. I'm expecting to much of you already aren't I?
Second step connect to internet, via bottom right then, click on the desired WIFI host. (HWDCSB-guest)
Third step open up the terminal via, bottom right, then click on accessories, then LXTerminal.
Forth step type in the terminal. “sudo apt-get install lua5.1” then allow it to run.
Fifth step type in “Lua5.1”
Sixth step Your lua interpreter has been opened, and your ready to code. What do we want to code though? Well today were going to make a calculator for doing probability and circumference of a circle.
Seventh step Alright, time to play around with your, interpreter. Type print(“Hello world”) congrats, you've joined the million of coders who have typed this first, as they begin to set out on there journey to create great things, like well this whole operating system was created by a coder.
Eighth step now that you've done that you can play around with some commands.
Example assign a to 1 via a=1 then do b=2 then do = a+b
Ninth step Now for our Probability calculator, we simple take any question involving probability, anyone got one? Question=false if question == false then print(“Alright lets do the chances of rolling a 5 on a 6 sided die”) end (do = math.random(0,6) if answer equals 5 then boom you won.)
Easy right?
Tenth step Now for that, circumference calculator. So say your trying to find the circumference of a circle with a 10cm long radius? Well this is easy actually. Simply do r = 10 then do = r/math.pi
your answer is? 3.18cm.
Eleventh step Alright guys now its your time to get to play around with your interpreter. What can you do? Well you can write some more calculations with those calculators you recently made, or you could try adding, a+b. Or simply just print some words, you can also use io.write“nil”
If you want to write something more complex you could do a couple of things
With if, then, or else.
And that is how to make a calculator for calculating circumference and probability, in Lua.
<!doctype html>
<html>
<head>
<title>
header
</title>
</head>
<body>
<frameset rows="17%,*">
<frame src="window1">
</frame>
<frameset cols="17%,*">
<frame src="window2" name=menu>
</frame>
<frame src="window3.html" name=display>
</frame>
</frameset>
</frameset>
</body>
</html>
Starter languages
For anyone looking to start from scratch, give Turing a try. It's what I used back in high school to learn the very basic fundamentals. Input and output is made super simplified and easy so you can focus on the actual working code. I found it very helpful in getting my head around the basic programming structures, like if/else conditions, loop types, variable types and arrays, and simple dot and line drawings. Once you have these concepts down it's easy to move up into object-oriented programming and other languages.import sys
def arraySort(unsorted):
largestVar = 0
for i in unsorted:
if float(i) > float(largestVar): largestVar = float(i)+1
sortedArray = [None]*int(largestVar)
for i in unsorted:
sortedArray[(int(float(i))-1)] = i
for i in sortedArray:
if i != None:
print(i)
arraySort(sys.argv[1:])
I'm trying to do more than one spoiler on a html document.
Yet when I click the 2nd spoiler button to show content, it displays the first spoiler content.
Help please.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)">
<meta name="dcterms.created" content="Sun, 19 Apr 2015 20:52:42 GMT">
<meta name="description" content="">
<meta name="keywords" content="">
<title></title>
<!–[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]–>
</head>
<body>
<a id="show_id" onclick="document.getElementById('spoiler_id').style.display=''; document.getElementById('show_id').style.display='none';"
class="link"><b><center> – click on me – Police Match DNA, Charge Man In Brutal Rape & Assault Of 81-Year-Old Woman – click on me – </center></b></a><span id="spoiler_id" style="display: none">
<a onclick="document.getElementById('spoiler_id').style.display='none'; document.getElementById('show_id').style.display='';"
class="link"><b>[Hide]</B></a>
<br>
<center><img src="perp/ME42F.png" width="387" height="248" alt="" title="" /></center>
<center>
<p>An 81-year-old woman was beaten, raped and terrorized for hours.Now, Columbus police have charged a suspect.</p>
The elderly victim spoke with 10TV New's Laura Borchers.Police say they now have DNA evidence that links Shawn Malone Jr to the crimes.
They did not have to go far for an arrest.</p>
<p>
Malone was in the Franklin County jail on a burglary charge.
Detectives say he's the suspect in a string of burglaries in addition to the abuse of the elderly woman.
</p>
<p>
"He picked me up by my heels and was beating me on the floor to wake me up again, because I was unconscious at least two times that I know," she said.
The woman said the suspect broken into a basement window, then crept upstairs to the room where he attacked her with a knife.
She says he left her with serious injuries including deep cuts, broken ribs, a broken tailbone and multiple deep bruises.
</p>
<p>
Columbus police confirmed she was abused and raped for hours January of 2014. The case remained open until they were able to match physical evidence with Malone. Monday afternoon they presented her with a photo line-up that included Malone's mug shot.
</p><p>The victim says after revisiting her memories of that night, she's given thought to what she wishes was Malone's punishment.
</p>
</center>
<center><a href="https://archive.today/ME42F">https://archive.today/ME42F</a></center>
<center><a href="https://web.archive.org/web/20150409055355/http://www.10tv.com/content/stories/2015/04/06/columbus-ohio-police-match-dna-charge-man-in-brutal-rape--assault-of-81-year-old-woman.html">https://web.archive.org/web/20150409055355/http://www.10tv.com/content/stories/2015/04/06/columbus-ohio-police-match-dna-charge-man-in-brutal-rape--assault-of-81-year-old-woman.html</a>
</center>
</span>
</body>
<body>
<center>
<a id="show_id" onclick="document.getElementById('spoiler_id').style.display=''; document.getElementById('show_id').style.display='none';"
class="link"><b>[Show]</b></a><span id="spoiler_id" style="display: none">
<a onclick="document.getElementById('spoiler_id').style.display='none'; document.getElementById('show_id').style.display='';"
class="link"><b>[Hide]</B></a>
<br>dog</span>
</center>
</body>
</html>
Programming Study Group Started
We have a new project on /tech/ that started a couple of days ago. If you're a total beginner, it'd be a good idea to join in.rate this page
Greetings fellow /prog/ers. I have 2 noobz questions for you guys.how ruby on rails?
Any Ruby on Rails users on /prog/?Website on Dedicated Server
If I buy a dedicated server with a static IP, can I host my own website from there?OOP is a fag?
Hello /prog/, I need some advices about object oriented programming, why is it better than procedural? I code for the web so I always faced php, JavaScript and such, and lately I'm seeing OOP everywhere, bunch of frameworks that are messy, I get so confused, I understood the basics, but I can't let go the idea that procedural is more understandable, what can I do about it? Have you got some useful links? I really don't wanna quit coding just cause objects fuck with my headsmall shell utils
Just dicking around making small shell utilities in C. Any thoughts on this simple print util? Possibility to make it faster, more concise, etc. I'm going to be adding an option tomorrow to take in a format string for the remaining args to expand it's functionality to cover printf.
#include<stdio.h>
#include<string.h>
#define VERSION "0.2"
#define AUTHORS "O.P. Faggot"
void help(char * reason)
{
fprintf(stdout, "%s\nkutils 'print' v%s authored by: %s\nusage: print "
"[<-n> <-s '?'>] <variable>…\ndescrip: prints arguments to the screen "
"in the order they are given\noptions:\n-n\tdoes not print newline after "
"all arguments.\n-s '?'\tprints with separator '?' between each argument; "
"defaults to space.\n", reason, VERSION, AUTHORS);
}
int main(int argc, char **argv)
{
//ensure that argc is not 0 (possibility due to C11),
//quick finish no args for echo-like behaviour (argc == 1)
switch (argc)
{
case 0:
{
return 0;
}
case 1:
{
fputc('\n', stdout);
return 0;
}
}
argc–;
argv++;
char print_newline = 1;
char separator = ' ';
//check for program info args
if (!strcmp(argv[0], "–help"))
{
help("");
return 0;
}
else if (!strcmp(argv[0], "–version"))
{
printf("kutils print v%s\n", VERSION);
return 0;
}
//check for no newline and separator arg
while ((argc != 0) && (argv[0][0] == '-'))
{
switch(argv[0][1])
{
case 'n':
{
print_newline = 0;
break;
}
case 's':
{
if ((argv[0][2] != '\0') && !argv[0][3])
{
separator = argv[0][2];
break;
}
argc–;
argv++;
if (!argv[0][1])
{
separator = argv[0][0];
break;
}
//else falls into error below
}
default:
{
help("Invalid argument");
return 0;
}
}
argc–;
argv++;
}
// print all args separated by separator
while (1)
{
fputs(argv[0], stdout);
argc–;
argv++;
if (argc == 0) break;
fputc(separator, stdout);
}
// print newline at end if not specified otherwise
if (print_newline) {
fputc('\n', stdout);
}
return 0;
}
You're welcome to #legit!
We're hosting a channel on irc://irc.freenode.net/legit.
Dart Lang
https://www.dartlang.org/Anyone with nothing to do want to help?
Hello /prog/. On /b/ some of us are trying to get dragonslayer threads over here to 8chan. The problem is that none of us know what the hell we're doing, or just don't want to do it.pythonshit
pythonfags get in here.
JS power of twos
Sorry for the small question, but does anyone know if Javascript cares whether you have numbers in power of twos? i.e. is it any different if I decide the max value for my variable should be 100, or if I decide it should be 64?God please help me thread
I've been trying to get into programming around the clock. I'm quite good at reading and understanding the code, but compiling is such a pain.