[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 33
File: 1444164399410.png (1 MB, 1702x2471) Image search: [Google]
1444164399410.png
1 MB, 1702x2471
old /dpt/: >>51364248

What are you working on, /g/?
>>
>there are people ITT who can't even reverse an array in place
>>
Reimplementing Wolfenstein 3D in Racket Scheme.
>>
>>51369628
getting python to play windows solitare
>>
>>51369659
>there are people in this thread
>>
File: solitare win.webm (2 MB, 947x630) Image search: [Google]
solitare win.webm
2 MB, 947x630
>>51369673
1 card draw
>>
File: solitare win 3 draw.webm (2 MB, 947x638) Image search: [Google]
solitare win 3 draw.webm
2 MB, 947x638
>>51369673
3 card draw

They're kinda fun to watch, IMO
>>
File: EEEEeEEEEeeeE.jpg (19 KB, 705x417) Image search: [Google]
EEEEeEEEEeeeE.jpg
19 KB, 705x417
>>51369659
I do it in n^4 time

unstable
>>
>>51369659
I can do it, but I make a temporary array of equal size to hold the reversed version and then overwrite the original.
Is that bad?
>>
>>51369673
>>51369691
>>51369702
does your software cheat? (i.e. it reads memory to find the values of hidden cards)
or does it simply read pixels and determine card number from that?
>>
>>51369659
But isn't it just
Get the first one, get the last one, assign them the opposite way, then move inwards using n and size - n?
Who could fuck that up?
>>
>>51369735
it reads memory and then dumps everything that isn't the top card
>>
>>51369739
It would make a better retard filter than fizzbuzz.
Too many scrubs have that solution memorized.
>>
>>51369659
reversed(array)

or
array = array[::-1]

done.
>>
>>51369764
hello pajeet
>>
>>51369764
go solder some CPUs
>>
>>51369628
Decided to write the roman numerals thing from the last thread in Scheme. Took a little longer than it should because I forgot about begin.

(define numeral-list (list (cons 10 "X") (cons 9 "IX") (cons 5 "V") (cons 4 "IV") (cons 1 "I")))

(define (print-romanstyle n list)
(if (null? list)
'()
(let ((modulus (car (car list))) (numeral (cdr (car list))))
(if (< (- n modulus) 0)
(print-romanstyle n (cdr list))
(begin (display numeral)
(print-romanstyle (- n modulus) list)))))
)

Maybe if begin wasn't implicit in most structures, I'd remember what it is.

Any tips on making this cleaner/look better?
>>
I seriously hope you aren't still handcoding everything in either C or C++, /g/.
>>
>>51369771
>>51369777
>not using the best tool for the job
>being this much of an elitist
>>
>>51369659
in all seriousness, things like >>51369764 are the correct answer
writing your own logic when a language provides it's own implementation is ugly
only do it if it needs to be faster than writing a new array, otherwise you're microoptimising
>>
>>51369809
What if you're using a language that has nothing built-in, like C?
>>
>>51369800
>he hasn't experienced the pleasure of C++11/14 inside
>>
>>51369673
>>51369691
>>51369702
I'm fucking awful at solitare, and this isn't much better, it wins about 25% of the time on 3 card draw
>>
>>51369815
then you should use a real language?
>>
>>51369838
sorry pajeet, scripting is not programming
>>
>>51369821
It's fun being a masochist, ne?
>>
>>51369800
Modern c++ is basically rust
>>
>>51369847
scripting?
I use C#. Any collection which implements the IEnumerable<T> interface has an extension IEnumerable.Reverse() method.
>>
>>51369847
I never knew the difference, honestly.
>>
Not really programming, but im reading up for exams in parallel computing and distributed systems.
>>
>>51369663
What
>>
>>51369724
>in place
>>
>>51369864
you should make an account on Heroku, and set up 5 free apps (they give 5 without credit card, 100 with credit card)
with a worker and web dyno, you can have 10 process all up
try coding a system which distributes tasks from a master to 9 other slaves
fun stuff
>>
>>51369659
def reverse(array):
first,last = 0,len(array)-1
while first < last:
array[first], array[last] = array[last],array[first]
first += 1
last -= 1
return array


If I can't use inbuilt functions
>>
>>51369925
Why do you need an external server for that? Couldn't you just do IPC on one machine with 10 processes for that?
>>
>>51369925
we have a cluster on the school, made a key-value store, and implemented leader election in a ring network with 80 nodes.
>>
Writing an AI in FORTRAN that will shitpost /dpt/ and /g/ for me.
>>
>>51370068
do you have a pass? or are you going to write a AI which does captcha for you?
>>
i dont get it
im reading up on content addressable networks and i see only disadvantages compared to a single content lookup server
>>
>>51369702
How successful the computer at winning?
>>
>>51370579
see
>>51369831
I suck at solitaire, so it does too.
>>
>>51370594
Could you post code of it?
>>
>>51370611
It's ugly right now, I'll post it tomorrow after cleanup, right now it's 4 am and I need sleep
>>
>>51370684
I don't mind ugly code in this case
>>
Should whitespacefags be gassed?
>>
>>51369847

Why reinvent the wheel? Just to show that you know how a wheel works?
>>
>>51371142
so you can invent a better wheel

imagine if we stuck with the stone wheel forever because "why reinvent the wheel?"
>>
I have a program in Java

L is a linked list and H is a hash table

l.add(value)
h.put(x, value)
l.set(l.size() - 1, l.getLast() + 1) // +1 to the value I just added


If I print the value in the list now and the value in the hash table, only the value in the list shows the +1 update. Am I misunderstanding how Java is passing this? I thought it always passed a reference (pointer) to the item in the list.
>>
File: zig_zag_method.gif (4 KB, 249x258) Image search: [Google]
zig_zag_method.gif
4 KB, 249x258
>>51369628
The set of all ordered pairs of natural numbers is countably infinite, that is, it is possible to establish a bijection between the set of all ordered pairs of natural numbers and the set of all natural number (N) with the zig-zag method in pic-related. Write a program which determines an ordered pair which corresponds to an entered natural number and vice-versa.
>>
>>51371799
Not everything in Java is an object, if you are working with a primitive type like int then it is not passed as a pointer.

Furthermore, while Integer is an object wrapper for int, it is immutable.
>>
>>51371799
> l.set(l.size() - 1, l.getLast() + 1)
retrieves the last value from the list, adds 1 to it (creating a new value), then replaces the old value with the new value. The hashtable still contains the old value.

If the values stored in the list were of a mutable type, and you did e.g.
> l.getLast().increment()
then you would see the modified value in both the list and the hashtable, because they would both still be referring to the original object, but the object's value has now changed.

But integers are immutable; you can't change them. And replacing an integer with a different integer only affects the container on which you perform the replacement.
>>
>>51371855
>>51371862
Thanks dudes
>>
>>51371837
Not going to do your homework, Rajesh.
>>
>>51371837
Are you required to use zig-zag? The Cantor pairing function achieves the same result (a bijective mapping between N^2 and N) and is somewhat simpler.
>>
File: Shutter 2015-11-06 21:20:45.png (291 KB, 1424x1176) Image search: [Google]
Shutter 2015-11-06 21:20:45.png
291 KB, 1424x1176
>>51369800
Why yes I am in fact
>>
>>51369809
>correct answer
For what? In actual code, yeah, but the point of doing it yourself is to show you can think through algorithms. On one hand, it's simple enough to be a decent interview question, but on the other it's simple enough to have been implemented thousands of times already.
>>
>>51371799

You're creating and putting a new Integer(?) object into the list in line 3.
>>
>>51369815
>a language that has nothing built in
>like C
>>
I might need to learn Javascript, what are some good resources? Not really used to web development desu
>>
>>51372059
A gun and a single bullet.
>>
>>51372059
This thread is for programming.

>>>/g/wdg
>>
>>51369628
>What are you working on, /g/?
official /dpt/ toolkit.
>>
>>51372089
Oh, thanks.
>>
Mornin

Work up this morning, dogpiling in /r/haskell

>>>51372229
>>
int y=0;
while(1)
{if (GetAsyncKeyState(VK_UP) != 0 ) y++;
if (GetAsyncKeyState(VK_DOWN) != 0 ) y--; }


Sleep(200);
>>
>>51372165
>informal implementation of half of Common Lisp
at least you have tests, so it's probably not too bug-ridden
>>
>>51372347
>Implying the tests don't return true no matter what happens
>>
>>51372375
>>51372347
someone posted this some days ago
http://melpon.org/wandbox/permlink/QllsZZhdwGTUMZBS
>>
>>51372347

It's a ruse, my man. It's benchmarks 2.0.

There are no data structures.
There are no algorithms.
>>
Writing a compiler in Coq.
>>
Writing an assembler in C.
>>
File: nosignal.jpg (62 KB, 438x750) Image search: [Google]
nosignal.jpg
62 KB, 438x750
>>51372545
>It's benchmarks 2.0.
not really, i have shared the source code of the benchmark (but i shouldn't have).
>>
>>51369628
Just started a converter app for Android, using Android Studio. To select what you're converting from/to, I just grab the string from a Spinner (dropdown box) and have a soon-to-be monolithic switch statement.
>>
File: AD9Vt.png (30 KB, 522x297) Image search: [Google]
AD9Vt.png
30 KB, 522x297
why do people keep guiding beginners towards python and not C/C++
it's so ugly and shit
>>
>>51372611
Sod off, mate.
>>
File: 1447396241034.jpg (110 KB, 600x600) Image search: [Google]
1447396241034.jpg
110 KB, 600x600
>>51372723
>C/C++
>>
>>51372749
is that Coq?
>>
>>51372802
yup
>>
>https://bitbucket.org/Tetsumi/cdptlib/src
>>
>>51372723
i agree
>>
>>51372749
Looks like pure garbage.

You can't even tell what it does. It's like creating equations... however, the *objects* in your web app for cats isn't universal things like *Heat*, *Electrons*, *Protons*, *Mass*.

You're laying out *Your own mental creation* as if they are universal things everyone else should understand.

https://en.wikipedia.org/wiki/Solipsism

https://storify.com/realtalktech
>>
File: 1488686459.gif (881 KB, 250x188) Image search: [Google]
1488686459.gif
881 KB, 250x188
>>51372723
>ugly as sin color scheme
>blames python
>>
>>51372892
pure autism
>>
File: 8KAqk.jpg (122 KB, 830x513) Image search: [Google]
8KAqk.jpg
122 KB, 830x513
>>51372901
:^)
you can't unshit it no matter the color scheme
>>
How would I go migrating a foreign hosted mysql database onto Azure if I only have a DreamSpark subscription ? It is not possible right ? Unless I create a VM and then do it.
>>
File: Untitled-1.jpg (2 MB, 6000x3000) Image search: [Google]
Untitled-1.jpg
2 MB, 6000x3000
>>51369628
still faffing around with canvases, will get there eventually
>>
>>51373183
If that database is small enough you could probably just design the same database in Azure and then dump the data from mysql db into a csv file and import it on the Azure db. If it's too big, you could quickly write a little tool.
>>
>>51369628
FAGGOT
>>
I'm learning assembly for Comp Architecture and this line in my decryption program still confuses me:

xor buffer[esi],al

I understand what's happening of course. The AL register is receiving data from 0x000000CE which happens to be the key needed for decryption. Now, why is it that the memory address contains no readable data, or rather shows as a '??' for its contents. I'm using VisualStudios to read the registers and it usually just shows an ASCII value. buffer happens to be the encrypted message. esi being the number of times through the loop, looping for each character. Does that register (0x000000CE) contain the binary representation of my key or does it actually XOR the character with the address name itself? And how does buffer[esi] get me to the first character? The syntax is confusing me. I'm not really familiar with what the brackets do, obviously bufferesi wouldn't work because there's no variable named bufferesi.
>>
>>51372723
Because C/C++ aren't beginner friendly and python forces a good use of whitespace which beginners need to learn.
>>
>>51373206
>higurashi
top tier taste my african-american compatriot
>>
>>51373276
shoot I said register incorrectly again, meant to say 'register (al)' or 'address (0x000000CE)'
>>
>You can learn Scheme (and a lot of deep ideas about programming) from Structure and Interpretation of Computer Programs by Abelson and Sussman. That book is now free/libre although the printed copies do not say so.
-rms

Is SICP a good book to start with lisp or the emacs guides on lisp?
>>
What's a good style for constructor implementation?

MyObject::MyObject(
std::size_t a,
std::size_t b,
std::size_t c,
std::size_t d,
std::size_t e,
std::size_t f
) :
a(a),
b(b),
c(c),
d(d),
e(e),
f(f)
{
std::cout << "MyObject constructed.\n";
}

This just feels weird.
>>
>>51373371
probably wouldn't feel as weird if your variables were named something other than the alphabet.
>>
>>51373407
The ) : feels weird there in the middle.
And the initializers as well. It looks like a scope with some code in it, but its just a list of variables being initialized.
>>
>>51373371
and I'm not entirely sure about C++ but in java, if you really want to keep the same variable name as the parameter inside the constructor I would use "this.x" For example in that code you can picture it as this.a(a). Or choose a different name for the parameter.
>>
>>51373454
Feels like you're retarded.
>>
>>51373371
In this case, use a builder or factory pattern.

Otherwise I prefer
                                                                                                                                  horizontal over vertical grouping
>>
>>51373461
Those initializations are not inside the constructor, moron.
>>
>>51369628
>What are you working on, /g/?
My Objective-C compiler.

Currently working on type encoding.
>>
File: 1430670386199.jpg (280 KB, 1536x1536) Image search: [Google]
1430670386199.jpg
280 KB, 1536x1536
>>51373474
>horizontal over vertical grouping
>>
>>51373474
>use memes
ftfy
>>
>>51373454
lmao. idk man you could try putting it after the f if you're really that OCD. I don't think someone reading your code would really be bothered by it.
>>
>>51369628
Searching for an alternative to php for web server side scripting, any suggestions to anything that's easy to deploy on apache & IIS?
>>
>>51373492
>implying someone else will read the code
well memed, m8
>>
Working on the mechanics for aerosolized diseases allowing them to disperse and flow realistically through a simulated atmosphere.
>>
>>51373454
It is scope with some code in it
MyObject::MyObject( size_t a, size_t b, size_t c, SomeType stuff, SomeType moreStuff )
: a( a ), b( b ), c( c )
, someOtherMember( stuff )
, yetAnotherMember( moreStuff )
{
std::cout << "Space is good, mkay?" << std::endl;
}
>>
>>51373371
MyObject::MyObject(
std::size_t a, std::size_t b, std::size_t c,
std::size_t d, std::size_t e, std::size_t f,
)
: a{a}
, b{b}
, c{c}
, d{d}
, e{e}
, f{f}
{
}
>>
>>51373502
Go.
>>
>>51373485
Your screen is wider than it is tall, why write code that's 15 characters wide and hundreds of lines long when you have at least 80 characters width (I prefer 110, but yeah).
>>
>>51373514
Why {} instead of ()?
>>
>>51373531
Because it doesn't compile and thus to make sure you're not stealing my code without permission.
>>
>>51373531
Why () instead of {}?
>>
Gotta take a codility test for an internship. Any tips?
>>
>>51373539
>doesn't compile
Your mom doesn't compile.
https://ideone.com/9sNids
>>
>>51373519
Looks interesting, thanks.
>>
>>51373530
Because scrolling down is easier than across and it's very easy to reach the 80 char limit anyway.
>>
>>51373576
>80 char limit
ishyggy
>>
>>51373576
I never said anything about writing code that's wider than the screen, but you can assume that 80 characters is okay.
>>
>>51373502
Ruby, Python, Go
dont know if apache can run Mono Asp.NET yet but the new MVC5 is actually really good despite being released by microsoft
>>
>>51373576
>afraid of crossing 80 char limit
>better not type more than 20 chars on a line
/g/
>>
File: freepie.webm (567 KB, 786x780) Image search: [Google]
freepie.webm
567 KB, 786x780
How would I go about periodically removing a percentage from a variable in python?

I found a script that does a subtraction over a specified time but not sure how I'd modify it for my needs
>something like throttle * .99 every 16ms until throttle <0.4
>>
what's ascii for non-disappearing space
>>
>>51373603
That's not what I said at all, stop being a gigantic retard.
>>
>>51373510
>>51373514
So many choices. Which style do big FOSS projects use?
>>
>>51373530
>Your screen is wider than it is tall, why write code that's 15 characters wide
>>51373576
>Because scrolling down is easier than across
>>51373603
>>better not type more than 20 chars on a line
>>51373611
>That's not what I said at all
/g/
>>
>>51373610
A non breaking space is:
Unicode U+00A0
UTF-8 C2 A0
ASCII has no nbsp, but 0xA0 may work.
>>
>>51373624
Big FOSS projects don't use C++.
>>
>>51373639
>only linux kernel is FOSS
>>
>>51373636
>0xA0
thanks
>>
>>51373559
So what's the difference between {} and ()?
>>
>>51373629
I said it's very easy to reach the 80 char limit and I said scrolling down is easier than scrolling across, both are objective facts.
Stop being a gigantic retard.

Also, formatting is for you, make it readable for you. All on one line is less readable than multiple lines.
>>
>>51373639
>what is GCC
>>
>>51373685
>I said it's very easy to reach the 80 char limit
So therefore you limit yourself by typing 15 characters wide code?

You're retarded.

Also
>implying you can't safely type at least 110 characters wide.

>>51373669
One initialises an array, the other a non-array. In other words, anon's code is unspecified behaviour (which is different from undefined)
>>
>>51373639
kek

>>51373669
Read "The C++ Programming Language 4th Edition" by Bjarne.
>>
>>51373715
>One initialises an array, the other a non-array. In other words, anon's code is unspecified behaviour (which is different from undefined)
Please don't spread bullshit and educate yourself.
http://en.cppreference.com/w/cpp/language/initializer_list
>>
>>51373685
Again, you autistic fuck, the question you were answering was
>why write code that's 15 characters wide and hundreds of lines long
Fucking retard.
>>
Dear /dpt/,
would you use the following program?

- standalone / portable
- gets search results from google
- filters out shitsites like google books and stackoverflow clones using lists
- lists can be downloaded automatically (like adblock)
- heuristic and language filters
- randomized user agent, no link redirection, etc

I'm currently working on a file manager but thinking about coding this afterwards
>>
>>51373685
>Also, formatting is for you, make it readable for you. All on one line is less readable than multiple lines.

You really think >>51373371 is more readable than >>51373510 ?

What is wrong with you?
>>
>>51373734
>What is wrong with you?
Brain damage.
>>
>>51373727
No, too much hassle.
>>
Microsoft decided to use "\" as a separator, yet cares enough to fully support "/" as well, so paths like
C:\Users\anon\Desktop/foo\bar/test.txt
are perfectly valid and work as expected.
>>
>>51372654
Yeah and I guess maybe you shouldn't have shared your "closed-source" "community dpt library"
https://bitbucket.org/Tetsumi/cdptlib
Cunt. Now can you fuck off with this retarded poorly thought out troll? Implementation details are no longer confidential.
>>
>>51373303
aye, Watanagashi just came out on steam so playing through that again.

good fun, but graphics take a bit of getting used to
>>
>>51373775
>work as expected sometimes
ftfy
>>
>>51373758
You mean because it's a separate program?
>>
>>51373796
No, because it could be a web app, but its not.
>>
>>51373788
Holy shit, that's some atrocious code. Looks like he took one semester of Java and decided to crap out "a C library". The guy clearly doesn't grasp C.
>>
>>51373262
But I can't create any databases with my subscription.
>>
>>51373790
are the spooky parts still spooky?
>>
>>51373727
Maybe as a browser extension could have some use. Nobody will bother to switch to an external program for searching with google and the open links in the browser anyway.
>>
File: C.png (136 KB, 2000x2126) Image search: [Google]
C.png
136 KB, 2000x2126
>>
>>51372839
nice. I've been meaning to try out Coq for actual software. The syntax is ugly but I think I can live with that for the expressiveness of the type system~
>>
>>51373892
2nd edition
>>
>>51373892
Garbage.
>>
>>51373862
There is a browser extension for this, but it's pretty slow and can't do much

You make a good argument though
Definitely a problem for the majority of single-monitor users
>>
>>51373841
then don't use azure if you can't use database, github student pack also has some free hosting options or get a proper subscription
>>
File: Untitled-1.jpg (464 KB, 1920x1080) Image search: [Google]
Untitled-1.jpg
464 KB, 1920x1080
>>51373849
yeah, they're done ok.

Mions breasts however...
>>
>>51373715
>>51373726
>15 characters long
By what count? All on one line and it's 33 with single char names, change the names to something a bit more realistic and it's retarded.
MyObject::MyObject(
std::size_t someVar, std::size_t otherVar, std::size_t nextVar, std::size_t notDescriptiveVar, std::size_t poorlyNamedVar, std::size_t yourAFaggotVar
) :
someVar(someVar), otherVar(otherVar), nextVar(nextVar), notDescriptiveVar(notDescriptiveVar), poorlyNamedVar(poorlyNamedVar), yourAFaggotVar(yourAFaggotVar)
{
std::cout << "MyObject constructed.\n";
}
>>
File: functinoalprgrammer.png (771 KB, 862x812) Image search: [Google]
functinoalprgrammer.png
771 KB, 862x812
>>51372914
>>51372892

https://storify.com/realtalktech/why-functional-programming-sucks

new work live
>>
>>51374009
if those boobs are any higher she'll start to suffocate
>>
>>51373734
>You really think
Yes.
>>
>>51374012
>change the names to something a bit more realistic
>notDescriptiveVar
>poorlyNamedVar
>yourAFaggotVar
>realistic
family...
>>
>>51374025
>how clever there are
>>
>>51374062
They're about the length of a realistic variable if you're not being full autist for short or long.
They might be a bit on the long side but you get the point.
>>
File: router log.jpg (426 KB, 1509x964) Image search: [Google]
router log.jpg
426 KB, 1509x964
I want to make a program/script that can read my router log and process it into something more readable.

What would be the easiest way to do this?
(pic related)
>>
>>51373929
>best language
>garbage
back to the shitbag along with JVM with you
>>
>>51374148
>Garbage that C is
>best
uhhh
>>
>>51374148
>best language
>c strings
No. Gotta have a bit more functionality than that.
>>
>>51374114
>you get the point
All I get is that you're a moron.
>>
>>51374164
>>51374180
>>>/lgbt/
>>
>>51374219
Sorry your post ended up as garbage, you must've forgot the null terminator.
>>
>>51374135
Perl. Regex.
Something as simple as.. (I'm just typing this in the box so ignore typos, it's basically pseudocode at this point)
#!/usr/bin/perl
use warnings;
use strict;

while (<>) {
chomp $_;
my $line = $_;

if ($line =~ /(.*?)\s(.*?)\s(.*?)\s(.*?)/) { #etc etc etc
my ($date, $time, $type, $host) = ($1, $2, $3, $4);
print "Date: $date\nTime: $time\nType: $type\nHost: $host\n\n";
}
}

invoke with
perl scriptname.pl routerfile.log
>>
>>51374164
>>51374180
>>51374250
>I don't know C.
>>
File: sussman shig.jpg (71 KB, 500x375) Image search: [Google]
sussman shig.jpg
71 KB, 500x375
>>51369659
>arrays
>in-place
i shiggy didgeridoo
(define (reverse ls)
(define (iter ls res)
(if (null? ls)
res
(iter (cdr ls) (cons (car ls) res))))
(iter ls '()))
>>
>>51374308
C++ is close enough, no need to learn something even more archaic.
>>
>>51371837
Why that? It's simpler to just enumerate through rational numbers p/q with p+q=s and going from p = 1 to q = 1, then going through s = 2, 3, 4, ...
>>
>>51374340
>implying he knows C++ although he doesn't know C
top fucking kek
>>
>>51374369
>he thinks he knows what other people know on facebook2
>>
>>51374414
>he uses facebook while pretending to know stuff
>>
Convince me not to learn Common Lisp.
>>
>>51374491
>>51374414
Could you two just shut up, fuck and get it over with?
>>
Why are you people so abrasive?
>>
>>51374538
What's the matter, nancy? Nobody replied to your bait shitpost? Here's your (You), cunt.
>>
File: 1446883705867.jpg (33 KB, 350x386) Image search: [Google]
1446883705867.jpg
33 KB, 350x386
Where can I learn how to work on software? That is, the precise steps and etiquette which one should generally follow, and such.
I can program software by relying on intuition and common sense, but it feels as though if I ever worked for a software development company, I would have to follow precise steps and etiquette, which I don't know.
>>
>>51374561
What shitpost? That was the second post I've posted in this thread. My first was >>51374269
Spend less time arguing over bullshit and more time programming and maybe you wouldn't be such a retard.
>>
>>51374491
I said facebook2, faggot.
You're using it too.
>>
File: you people.gif (1 MB, 245x190) Image search: [Google]
you people.gif
1 MB, 245x190
>>51374544
>>
Best software license, /g/?

Personally I don't use anything unless it's public domain. Fuck attribution requirements.
>>
>>51374567
https://en.wikipedia.org/wiki/Software_development_process
Look up SCRUM
>>
I was following this guide http://python-packaging.readthedocs.org/en/latest/command-line-scripts.html and noticed that the script inside bin does not have an extension. Is that the norm? Why is that?
>>
>>51374660
What's a file extension for, anon?
>>
>>51374660
Not that odd, though not common I suppose. I guess some people don't want to include an extension on any file that can be executed; personally I would add the .py.
>>
>>51374351
Well, a common use case is for triangular arrays (if m[p,q]=m[q,p], there's no need to store both halves). But you'd normally use Cantor pairing rather than zig-zag.
>>
>>51374660
Because if you implement `ls` in Python, you should be able to type `ls`, not `ls.py`
>>
>>51374637
Thanks anon, this helped a lot.
>>
>>51374704
Association?
>>51374707
So would I. Specially for windows fags.
>>51374724
You mean on import? You can omit the .py.
>>
>>51374785
No, he means if you place it in /usr/bin or whatever and want to be able to execute 'ls' from the terminal and have it call his python script.
>>
>>51374846
OK. Then how can I make both windows and linux users happy? If I don't include an extension windows users can't execute the script by typing 'ls' but if I include it the linux users have to type 'ls.py'.
>>
>>51374986
You don't desu senpai.
>>
>>51374986
stop trying to satisfy ungrateful windows users and just write clean unix shell scripts.
>>
>>51369628
How fast is racket. Would it be fast enough to make a video game with or should I just use c++ for that. c doesnt have oop and the only languages I know that do are racket and c++.
>>
>>51375278
Tell you what.
Grab a tutorial on how to use question marks, then maybe think about programming.
>>
>>51375301
so funny
>>
>>51374986
Include the extension on Windows, don't include it on Unix. Additionally, ensure that PATHEXT contains .py so that they don't have to type the extension.
>>
This is probably the wrong place to ask this question.

I want to learn C and C++. I've got background in other languages (C# [hurr .NET fag], Python, JavaScript, and a tiny bit of Java [not my favorite language]).

Can anybody recommend a starting spot for me?
>>
>>51375345
At least I didn't choose the easy target of your language choices.
>>
>>51375379
Let me guess. You use C
>>
>>51375396
You know it baby.
>>
>>51372165
what UT library is it? looks nice.
>>
>>51375368
Starting C by Dennis Ritchetoe
>>
>>51375368
I went roughly the same path as you, none of those languages prepare you for the thing that C is.
>>
>>51375481
I know. I get hand held by all those other languages.

>>51375461
Awesome. Thanks. Dare I ask any recommended Operating System to install and get started on?
>>
>>51369628
this image is not safe for work and you mods need to do your damn job. Worthless scumbags. This is supposed to be our best thread in this worthless board and you let it get shit on by trolls
>>
>>51375368
>Java [not my favorite language]

If you don't love Java then I suggest you choose another career path.
>>
>>51375503
>2015
>using an OS
It's like you don't wanna be natty
>>
>>51375368
Learn C the Hard Way by Zed Shaw
He shits all over K&R
>>
>>51375503
It really doesn't matter.
I guess if you wanted to learn C, then Unix system commands would "make more sense", but C11 kind of does away with a great amount of OS-specific code.
>>
>>51375512
Seriously, it's fucking awful. Every thread we get this sick pornography as our OP pic. Not cool, mods.
>>
>>51375516
I don't have to love a language in order to use it. I'll take my chances, regardless.
>>
>>51375512
>>51375533
It's better than the reddit fag that keeps trying to push his shit ass agenda on us.
What really needs to be done is that you faggots should stop making threads as soon as we hit the bump limit. It's fucking stupid.
>>
>>51375552
kill yourself or get out, scum. Go to /b/ if you want to look at gay porn
>>
>>51375565
Enjoy your code of conduct, kekold.
This isn't your safe space and you shouldn't be here during work.
>>
>>51375528
He's also retarded. How many functions can you possibly need for a circular buffer?
>>
>>51374660
>>51374785
>>51374846
>>51374986
>not including both a .bat and bash script which both run an executable JAR
>>
>>51375586
one for every one line of code it would otherwise take
>>
File: 1428353052866.jpg (282 KB, 1000x1000) Image search: [Google]
1428353052866.jpg
282 KB, 1000x1000
>>51375597
>JAR
>>
>>51375580
I can say whatever, faggot. No one monitors the traffic wear I work. I just don't want to see this gay shit.
>>
>>51375580
And why shouldn't I be here during work? Even though that's beside the point of this being a WORK-SAFE BOARD.
>>>/lgbt/ Off you go.
>>
>>51375636
>>51375640
>4chan as a whole defines boards as work-safe
>somehow implies that 4chan in general should be work-safe
You should just admit that you're slacking off and stealing wages from your company.
>>
>>51375672
so asshurt you don't have a tech job that you can slack off at.
>>
>>51375640
I get the feeling all the stupid questions come from the employed shitstains who can't program their way out of a paper bag without looking up basic standard library functions.
>>
>>51375686
they come from kids who can't do their homework desu. No one is going to hire you if you are retarded.
>>
>>51375706
you'd be surprised
it's not what you know, it's about who you know
>>
>>51375686
>>51375672
I don't work as a programmer. Assume some more shit.
I also didn't say 4chan in general should be work safe, where the fuck do you see that?
I also, rarely ask questions here.
I have my own office, if I want to look at porn all day while still getting my work done, no one would give a fuck, because I'm doing my job. Maybe one day you'll have that freedom.
All this is besides the point. It's a work-safe board. Take your gay weeb bullshit and fuck off to /b/, /lgbt/, /a/, or better yet, hold your breath until you feel the world is a better place.
>>
>>51375726
>i don't mind looking at porn
>please get rid of all the porn
>>
>>51369628
how can i test if one of these
char name[maxNameLength];

is a blank line? the user presses enter without inputting any information if they want to stop inputting names, so i'm planning on having an if statement inside of the for loop that looks back and checks if the thing they entered had anything in it and if it did, then it would break out of the loop
>>
>>51373300
>C/C++ aren't beginner friendly
Bullshit
>>
>>51375767
I'm not sure why you have such a problem with reading comprehension, or getting the point of something so simple, so I will spell out your memetext references.
I don't mind looking at porn. You're right. I didn't say I watch porn at work. I said if I wanted to, I could and no one would give a shit, because a) I do my job and b) I have my own office.
I'm not saying get rid of all the porn. I'm saying keep the shit off of work-safe boards. Super simple concept but I imagine the effects of holding your breath are starting to kick in, so I'll let you get back to work.
>>
>>51375869
I don't see how the OP pic is not worksafe.
>>
>>51375799
Depends on how you get the input. fgets() will include a '\n' in the string, so you just have to check the position of the newline. scanf() may not, then you'd have to check the string length (assuming you have the insurance the string does have terminating character).
>>
>>51375827
I would not say that C++ is a beginner friendly language. C is pretty good for explaining basic programming concepts to beginners.
>>
>>51375614
Well, if you don't like your code being multiplatform and portable...
>>
>>51375726
4chan isn't your personal homepage
>>>/tumblr/
>>
>>51375948
>portable
>not a meme

Guess what retard, C code is portable too. It's just as fucking portable as Java you ignorant fuckwad.
>>
>>51375953
You're a special sort of retard, aren't you.
>>
>>51373300
C certainly isn't beginner friendly. It forces you to learn irrelevant bullshit while being error prone and encouraging bugs. All modern languages abstract that shit away that you don't need to know about.
>>
>>51375987
If you don't know what's behind the abstractions you're a shitty code monkey who shouldn't be programming.

Yes, I'm suggesting that to program you should have at least a BASIC understanding of logic gates and assembly.
>>
>>51376068
opinions
>>
>>51376068
Right, but the question is whether it's better to start from the bottom up, or go for a top down approach. I don't think anyone is suggesting that you should learn python and be satisfied with that forever.
>>
>>51375970
Write a C snippet that traverses a directory recursively and prints the total size of the directory contents in a portable way. I'm waiting.
>>
What was this god damn book called again that u keep posting constantly? "Data structures and algorithms" or smth like that
>>
>>51376141
Am I allowed to use libraries? :^)
>>
>>51376153
I think it's called
>muh data structures
>muh algorithms
by N.E. Briated Esq.
>>
>>51375922
Teaching C++ includes teaching a lot of C
Thread replies: 255
Thread images: 33

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.