/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

youtube.com/watch?v=9a3eCHij4Vo
google.ca/about/appsecurity/research/
twitter.com/NSFWRedditGif

my DICK

nothing

I want to do some programming but have no ideas

Keep overflowing the stack Hime!

Making a 3D modelling interface for my game engine that will just outright display the VBO you assemble.

Currently working on the input forms. So far the input form changes colour when you mouse over.

That is it.

Reading K&R C book. C is the master race of programming languages.

C was shilled by (((MIT))) and other organizations to deliberately make software less secure and increase funding for (((Lisp))) and "functional programming" boondoggles.

Butthurt

>Reading K&R C book.
Same desu, sitting right next to me.

(((faggot)))

youtube.com/watch?v=9a3eCHij4Vo

MIT students detected. Go read your high school kids' book.

I bet you think null-terminated strings are safe and efficient. Does your school still teach that strings are linked lists?

>Implying I am anywhere near qualified to get into MIT

make a rendering engine for HTML

Not even an MIT student senpai.

inappropriate
that's nonsense there's plenty of code to write and so little time left time's awasting get to work pickle pee pump a rum
what did you mean by this
that sounds like the most needlessly overcomplicated explanation of something so extremely trivial as to be pointless
only for writing device drivers and OS kernels
intensifies
>buying books
I like your style
not watching this
don't be jealous that they're in MIT dude go watch some opencourseware on yt I'm "taking" linear algebra right now feels amazing man
don't be so hard on yourself, just do it, etc
don't be rude
never say never

:3333333333

are you 12

(((3===8)))

Nobody else respond.

C is better than noob languages like Java or Python.

He probably is.

(((8===D3)))

>C is better
If you want to create the next big security vulnerability.

>waaaaah waaaahh i did a buffer overflow all over the carpet waaahh i can't clean it up myself waahh

#include

That's the programmers fault, not the language.

Scheme implementation

I have roughly 7 mb of html

what do you suppose would be a good method of searching it for strings?

I was thinking of taking the first word of input, returning all those results, take the second word and only search those first set of results and so on to make it as efficient as possible

Is that the best way to do it?

$ grep PATTERN [FILE]

Take 2, this time without that stupid newline.

Nokogiri should do it really nicely if you want to get rid of the HTML noise.

Example:
require 'nokogiri'
require 'open-uri'

puts Nokogiri::HTML(open("

If I have a Juction Table with 2 Foreign Keys, do I need to add this IDs manually or they're automatically added when I insert something in the other tables?

For this user See

oh no I know how to parse html with both regex and bs4, that's not a problem
this would be from a downloaded file anyways

I just was looking for a quick method of doing it owing to the large amount of text (like a hashtable, if someone knew how to generate that) preferably with little or no dependencies

I suddenly don't understand what your want to do then.
What would you do with it..?

>just ass off to learn C++ in two days
>build up code
>debug it all night until it compiles
>code runs for 1 hour
> no data has been written
>found out Cygwin has aborted the execution itself (core dump)
>mfw

first time building a bot
it would take inputs of quotes, for example:
"But my best memory of those days is now what I did but what I almost did", conduct a search of the text, and return From Living to Tell the Tale by Gabriel Garcia Marquez, Page 466, Chapter 30, Full Context: {Paragraph}

I have html I've extracted from various books for e-readers for this purpose

>MIT students detected
I fucking wish, user.

kek you guys are so retarded.

Neo Venezia will never be done at this rate, user.

If the HTML is in a consistent format, something like this could work:
#!/usr/bin/ruby
require 'nokogiri'

def search(search)
Dir.glob("**/*").each do |file|
doc = Nokogiri::parse(open(file)).css(".selector.for.text")

doc.find_all do |node|
node.text_content.include? search
end.map do |node|
node.parent.css(".title").text_content
end.each do |title|
puts "Found in #{file}, Heading: #{title}"
end
end
end

This is just untested almost-psuedocode, but it's how I'd do it.

Wrong, the same chance to get fucked is for every popular language.

If they have parts written in C.

No

Well, what's the issue user?

Yeah, no.
Programmer error leads to horrible memory vulnerabilities in C, whereas you'd be hard-pressed to do that in something else.

>Programmer error leads to horrible memory vulnerabilities in C
Just as much as in other languages.

>when he hasn't even written a line editor
why even call yourself a programmer

You can't even ACCESS memory directly in most languages.

Lmao just fuck my shit up senpai.
I have literally no idea.

You can do that in C as much as in other languages.

If you were a more disciplined programmer and just didn't do everything haphazardly, maybe your shitty programs wouldn't have those memory vulnerabilities.

gdb?

looks like 0 fun

how many hours did you spend on yours, if you don't mind me asking?

Does codecademy actually teach you anything?
I feel like I'm just copy and pasting with no understanding of what i'm doing.

this is wrong

Right.
I am good enough to write mostly anything in C, but I would never trust that I didn't slip up with a double free somewhere or something stupid.

Not really. Try accidentally writing exploitable memory access in C#.

>Not really. Try accidentally writing exploitable memory access in C#.
Probably just as easy as in C.

This bait is delicious. But I'll keep biting.

>C exploitable memory requires you to miss a single detail somewhere
>C# exploitable requires pentesting the language

So what you're saying is that you're too shit to use a language like C safely?

Correct.

I am OK with writing things, but I would never offer to write something people would rely on for security purposes in it.

>>C exploitable memory requires you to miss a single detail somewhere
Except not, what are you talking about?

Just because you're incompetent, so is everybody else?
Stop projecting so hard.

>Double free
>Unchecked buffers
>Raced mallocs

I'm not saying everyone is, I am saying that is untrue. C can easily fuck someone up in ways that is impossible in other languages.

(((Smug C Weenies))) are (((Smug Lisp Weenies))) in disguise.

>>Double free
Almost everything being nullable (java and C#).

>>Unchecked buffers
Just like in every language.

>>Raced mallocs
...what?


As I said, C is just as safe as the majority of the languages.

Throwing an exception isn't the same as memory corruption.

The C standard does not say anything about memory corruption. It is not the language's fault that you are using an unsafe implementation.

>I-it's not the languages f-fault!

Sure, but apparently everybody is too fucking stupid to use it, because every sizable C project results in extreme & dangerous vulnerabilities.

That is why c++ has the string class.

>Hurr it's the languages f-fault that people are retarded!

For a language to be safe it isn't enough to be possible to program in a safe way, it has to make it desirable other than the safety (ease, performance, etc.) and the community has to support idioms that reduce the chance of doing something unsafe.

An example of something C doesn't have

how do you make two classes in separate header files include each other for mutual friendship.

A string type would go against the spirit of C.

Either only C programmers are retarded, or the language is more dangerous.

Again, see Nothing to do with C programmers.

Strings are truly underappreciated.

If it's so easy to do something outside of the spec that almost every sizable program written in the language does it, then you have a problem.

Doing something outside the spec has nothing to do with hat I said.

>that almost every sizable program written in the language
Not true, I hope at least.

>Not true, I hope at least.
How many of these are not written in C or something that uses C's memory management?
google.ca/about/appsecurity/research/

Most of them are not due to UB.
For the rest of them it could be solved if they followed my advice above.

>or something that uses C's memory management?
careful, his might be too broad, since many compilers/interpreters are in C

>written in C or something that uses C's memory management
That statement encompasses probably 95% of programs. Of course most most vulnerabilities occur in most programs.

-_- The rendering on my rust chip8 emulator bugs me.

Oh, well. It's working at least. Still deciding on the next project.

This is why only the best should be allowed to use C

You can only become the best by using C.

>interning as a part of a university program
>team lead has to meet up with someone from my school and talk about my performance
>talking to my lead before they sit down
>"this meetup could go either way - good or bad. how do you want it to go?"
>"..preferably well"
>suggests that if an envelope were to be placed on his desk everything would go well
>start laughing because he's the type to tease people
>he continues to talk about it
>ask him if he's being serious (multiple times)
>he avoids answering the question
>mentions another student who "learned quick"
>"I've done my job"
>changes the subject of our conversation

Is he actually attempting to extort me? I still have no clue if he was yanking my chain or if he was actually serious. I don't know who would joke about something like this.

I'm as socially clueless as you.

Depends on the his personality. There is a very real chance of it happening.

The person / his personality*

I really should drink some coffee before posting.

>I really should drink some coffee
go to sleep

It's a good idea user. I've been up since forever on a death march.

trying to learn C because I feel like a pleb web dev / java game developer....

how would you go about writing a game engine from scratch in C... particularly the graphics drawing part

>tfw you can't find the bug that's making your code shit itself
Feels bad man. I swear to god everything looks right.

Dumb frogposter.

the bug that exists because of you
kill yourself

Do I smell new fag? Or is that the aroma of a brogrammer?

What uni and company?

Oh God, I saw a lighting deal on a Raspberry Pi kit and bought it without a second thought
Damn you capitalism

now why would I give that info

So I could avoid them.

which country do you live in

UK