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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 317
Thread images: 36

File: 1468266827746.png (297KB, 640x480px) Image search: [Google]
1468266827746.png
297KB, 640x480px
Previous Thread: >>55671121
Next Thread: N/A

Final /dpt/ Edition

What are you working on /g/?
>>
what is wrong with her jaw
it is
  nca
o v
c e
>>
What is discrete math and why we need it?
>>
>>55677171
hipster math we don't need it
>>
>>55677171
Math that respects your privacy is always a good thing.
>>
>>55677171

http://www.globeuniversity.edu/blogs/information-technology/how-is-discrete-math-relevant-to-it-and-business/

I believe this is a sufficient answer.
>>
File: anime_awkward_laugh.jpg (369KB, 1000x1000px) Image search: [Google]
anime_awkward_laugh.jpg
369KB, 1000x1000px
First for C.
>>
I want to have sex with Retrofit+RxJava+OkHttp+GSON
>>
someone know where i can find what positions in memory map to what letters in Brainfuck?

i can't find such a table for some reason
>>
>>55677559
Use IDA Pro and reverse engineer it
>>
>>55677559
It's ASCII.
>>
>>55677185
>>55677183
kek

>>55677228
Doesn't sound a lot like math.
>>
File: qqqqq.jpg (127KB, 500x500px) Image search: [Google]
qqqqq.jpg
127KB, 500x500px
How many users do I need on the Play Store to escape NEETdom?
>>
>>55677639
oh i see
>>
>>55677668
6 gorillon
>>
My father asked me to write a program that remotely controls other computers (cory) in the house. So he can able to take control the router settings w/o going to its "website" and be able to access to run commands in the other Windows machines from one program.

My idea is to make a server on my dad's PC and hide the client programs as Windows Services on the other computers.

But cause I need a plan I am using UML diagrams to do it but I hate drawing with a mouse so i do it "analog" with pen and paper.


How did you guys get use to drawing with a mouse?
>>
File: Chrno.Crusade.full.401527.jpg (1MB, 1860x2673px) Image search: [Google]
Chrno.Crusade.full.401527.jpg
1MB, 1860x2673px
>>55677105
Would it be a good idea to write an IRC bot that takes BNF grammar?
What could BNF be used for in a bot?

Azmaria a best.
>>
File: tree trimming.png (23KB, 813x308px) Image search: [Google]
tree trimming.png
23KB, 813x308px
Can someone think of good names for these functions?

takeDepth and takeBreadth don't sound right, maybe trimDepth and trimBreadth?
>>
File: 1466282446300.png (271KB, 500x500px) Image search: [Google]
1466282446300.png
271KB, 500x500px
>>55678256
Why would you do that? What is its benefit to you?
>>
>>55678253
I have a tablet>>55678253
>>
>>55678253
>My father asked me to write a program that remotely controls other computers (cory) in the house.
This program is called Remote Desktop and is already running on every windows machine.
>>
>>55678253

pruneDepth/Width
>>
>>55678310
>Width
Been working with textures. Forgive me dark lord.
>>
>>55678310
Jesus Christ I'm an idiot.

Reply intended for >>55678263
>>
>>55678310
I don't think prune is explicit enough about the fact that it's just limiting the number of children or the number of nested branches
>>
>>55678268
I fight for the user.
>>
>>55678347
branchFloor
>>
I'm trying to copy a bracket parser in python from this book I'm reading, but I'm fucking it up badly. Bully away
class Stack:
def __init__ (self):
self.items = []

def is_empty(self):
return self.items == []

def push(self, items):
self.items.insert(0)

def pop(self):
return self.items.pop()

Stack()

def par_checker(symbol_string):
s = Stack()
balanced = True
index = 0
while index < len(symbol_string) and balanced:
symbol = symbol_string[index]
if symbol == "(":
s.push(symbol)
else:
if s.is_empty():
balanced = False
else:
s.pop()

index = index + 1

if balanced and s.is_empty():
return True
else:
return False
print (par_checker('((()))'))
print (par_checker('(()'))
>>
Does minecraft still do redundant texture uploads to the GPU every frame?
>>
>What does this code do?
    OpCapability Shader
OpMemoryModel Logical Simple
OpEntryPoint Vertex %1 "vmain"
OpEntryPoint Fragment %2 "fmain"
OpExecutionMode %2 OriginUpperLeft
%3 = OpTypeVoid
%4 = OpTypeFunction %3
%1 = OpFunction %3 None %4
%5 = OpLabel
OpReturn
OpFunctionEnd
%2 = OpFunction %3 None %4
%6 = OpLabel
OpReturn
OpFunctionEnd
>>
print(int(float(float(tuple[2])/len(activeDocuments[int(tuple[0])][int(tuple[1])]))*int(chapterdata[int(tuple[0])][int(tuple[1])+1])-int(chapterdata[int(tuple[0])][int(tuple[1])]))+int(chapterdata[int(tuple[0])][int(tuple[1])])) //converts paragraph number to page number
>>
>>55678305
He wants to run commands on them in the background without those 3rd party spywares.

The user cannot know about that hidden service I will create. He wants to scare the senpai that they did something wrong so he can take full control of them.

Soon he will be retired and he wants a hobby, monitoring people is a hobby.

Devilish?
>>
>>55679240
>Vertex and Fragment

That looks like some kind of shader to me.
>>
>take a look at libffi
>it's fucking useless
>>
>>55679006
probably, people say MC hasn't been optimized since Notch left
>>
>>55677171
No rigor, grasping at straws. Analysis is the only true, manly math.
>>
>>55677105
Just finished my MP3 tags rename program. Naive way.
Samples :
sub release_by_dir {
my $path = shift;

my $release = {};
my @files = glob("$path/*.mp3");

die "Empty dir or dir not found at $path\n" if (!@files);

foreach (@files) {
my $mp3 = MP3::Tag->new($_);
push($release->{file}->@*, $_);
push($release->{artiste}->@*, $mp3->artist);
push($release->{album}->@*, $mp3->album);
push($release->{genre}->@*, $mp3->genre);
push($release->{annee}->@*, $mp3->year);
push($release->{morceaux}->@*, $mp3->title);
$mp3->close;
}

return $release;
}

sub modify {
my $release = shift;

die "Undef\n" if (!$release->%*);

print "Same ARTIST/ALBUM/GENRE/YEAR ? (y/n) ";
chomp(my $input = <STDIN>);
_same($release->{file}) if ($input eq 'y');

foreach ($release->{file}->@*) {
my $mp3 = MP3::Tag->new($_);
my $title = $mp3->title;
print "New TITLE: [" . $title . "] ";
chomp(my $input = <STDIN>);

if ($input) { $mp3->title_set($input); }
else { $mp3->title_set($title); }

$mp3->update_tags;
$mp3->close;
}
}
>>
>>55678591
tokenize them
keep states to a minimum
compose your methods
array comprehensions
>>
Alright guys so I know its late and Ill probably have to ask later in the day. But Im at my limit here. Does anyone have any experience with using windows common file dialog. I need a file dialog box to appear with multiselect multiple times, but I can only get it to work once then it throws an error. Except for the very first time I run the code.
#include <Windows.h>
#include <Commdlg.h>
#include <tchar.h>

class OpenFileDialog
{
public:
OpenFileDialog(void);

TCHAR*DefaultExtension;
TCHAR*FileName;
TCHAR*Filter;
int FilterIndex;
int Flags;
TCHAR* InitialDir;
HWND Owner;
TCHAR*Title;

bool ShowDialog();
};

OpenFileDialog::OpenFileDialog(void)
{
this->DefaultExtension = 0;
this->FileName = new TCHAR[MAX_PATH];
this->Filter = 0;
this->FilterIndex = 0;
this->Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
this->InitialDir = 0;
this->Owner = 0;
this->Title = 0;
}

bool OpenFileDialog::ShowDialog()
{
OPENFILENAME ofn;

ZeroMemory(&ofn, sizeof(ofn));

ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = this->Owner;
ofn.lpstrDefExt = this->DefaultExtension;
ofn.lpstrFile = this->FileName;
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = MAX_PATH;
ofn.lpstrFilter = this->Filter;
ofn.nFilterIndex = this->FilterIndex;
ofn.lpstrInitialDir = this->InitialDir;
ofn.lpstrTitle = this->Title;
ofn.Flags = this->Flags;

GetOpenFileName(&ofn);

if (_tcslen(this->FileName) == 0) return false;

return true;
}


int main()
{
OpenFileDialog* openFileDialog1 = new OpenFileDialog();


openFileDialog1->InitialDir = _T("C:\\Windows\\");

if (openFileDialog1->ShowDialog())
{
MessageBox(0, openFileDialog1->FileName, _T("b"),
MB_OK | MB_ICONINFORMATION);
}
openFileDialog1->FilterIndex = 1;
openFileDialog1->Flags |= OFN_SHOWHELP;
openFileDialog1->InitialDir = _T("C:\\Windows\\");
openFileDialog1->Title = _T("Open Text File");

if (openFileDialog1->ShowDialog())
{
MessageBox(0, openFileDialog1->FileName, _T("h"),
MB_OK | MB_ICONINFORMATION);
}
}
>>
>>55680215
If memory serves correctly I tried this about a month ago and didnt have any problems. But now I cant get it to open the second dialog box. And if I try to enable multiselect I get a weird box. Any help would be great. Im having a hard time even googling examples of the dialog box.
>>
>>55679327
ok I fixed it I guess

def getPageNum(tuple):
book_number=tuple[0]
chapter_number=tuple[1]
paragraph_number=float(tuple[2]-1)

pages_in_chapter=int(chapterdata[book_number-1][chapter_number])-int(chapterdata[book_number-1][chapter_number-1])
print(pages_in_chapter)

starting_page=int(chapterdata[book_number-1][chapter_number-1])
print(starting_page)

max_paragraph_number=(len(activeDocuments[book_number-1][2]))
position=paragraph_number/max_paragraph_number
print(position)

return (int(position * pages_in_chapter) + starting_page)
>>
When would you need to use a RPC framework? I can't think of a good use-case, but then I don't do a lot of microservices programming
>>
>>55680300
on wednesdays
>>
>>55680058
Thank you. I will rewrite following your advice.
>>
What's a moderately sized project I can do in C?
I'm going to try and test out of an intro CS class from a school I'm transferring to.
(Last school taught Python, this school teaches Java/C)
>>
>>55680215
Member initializer lists are a thing, Anon.
>>
r8
j = \x y z t -> putStrLn $ x $ y map z t
f = (!! 20593)
m = \x y -> y x $ m x y
s = \x y z -> [] : (y z >>= (\t -> x (:t) z))
u = map toEnum [74..85] :: String

main = j f m s u
>>
Recursion you say?

But Anon! Iteration is objectively superior!

>https://www.youtube.com/watch?v=HgX3aAd4rHE

why is this recursion meme a thing again?
>>
File: 1456140751203.jpg (28KB, 500x375px) Image search: [Google]
1456140751203.jpg
28KB, 500x375px
>>55680456
A very simple virtual machine sounds like it's right up your alley.

https://en.m.wikibooks.org/wiki/Creating_a_Virtual_Machine/Register_VM_in_C
>>
>>55680574
I feel like that's a bit much.
The midterm for this class is a Caesar Cipher, and the final is a bubble sort.
>>
File: penn_jillette.jpg (56KB, 250x312px) Image search: [Google]
penn_jillette.jpg
56KB, 250x312px
>>55680482
>Hasklel
>>
File: micosoft certified poo.jpg (194KB, 640x800px) Image search: [Google]
micosoft certified poo.jpg
194KB, 640x800px
>>55680538
>Bhambhani
>>
>>55680456
Generate some files containing numbers, implement from scratch several sorting algorithms (merge, quick, heap)? and sort your files. Compare times.
>>
I'm messing around with Emacs Lisp.
Empty list is nil, so this works:
(defun fizzbuzz ()
(interactive)
(let ((number nil)
(fizzbuzz-list (number-sequence 0 100)))
(while (setq fizzbuzz-list (cdr fizzbuzz-list))
(insert (cond ((= (mod (setq number (car fizzbuzz-list)) 15) 0) "FizzBuzz")
((= (mod number 3) 0) "Fizz")
((= (mod number 5) 0) "Buzz")
(t (number-to-string number)))
?\n))))

I'd like to make it look even better.
>>
>>55680716
>implying that is an indian accent
kys
>>
>>55680785
Common Lisp is better.
(defun fizzbuzz ()
(loop for n to 100
for res = (concatenate 'string
(when (zerop (rem n 3)) "Fizz")
(when (zerop (rem n 5)) "Buzz"))
if res do (print res)
else do (print n)))
>>
How could I make a Grand theft auto mod that will run on my Ps4's ofw.

Would I need special programs?

I don't know much about this stuff, but I'm thinking about getting my game data, and finding a way to code a mod menu into it, putting the altered data on a USB, and overwriting the old on the Ps4. I don't know how that'd work, or if it'd even work.

But is it possible?
>>
>>55680826
>second generation poo in loos
even worse
>>
How to wrire baremetal C programs for x86 or x86_64 processor?
>>
>>55680881
>(loop for n to 100 for res =
Disgusting. This isn't prefix. It looks more like English than Lisp.
>>
File: jeb why.jpg (70KB, 456x694px) Image search: [Google]
jeb why.jpg
70KB, 456x694px
>>55680538
>check out this faggot's channel
>liked videos: le current year man and college>humor
>>
>>55680898
>
FFS, that is not an indian

also, you are not in the right thread
>>/pol/
>>/b/
>>
>>55680937
the faggot is making a good point tho
>>
>>55680934
Fine.
(defun fizzbuzz ()
(do* ((n 1 (1+ n))
(res (concatenate 'string
(if (zerop (rem n 3)) "Fizz")
(if (zerop (rem n 5)) "Buzz"))))
((= n 100))
(if res
(print res)
(print n))))
>>
Excuse me I have a question
>>55680893
>>55680893
>>55680893
>>
>>55680957
>FFS
>can't link to other boards
>>>/out/
>>
>>55680997
Can you do a FizzBuzz in C++?
Until then fuck off
>>
>>55681003

right right...

>>>/out/
>>
>>55681022
What I know how to do is irrelevant.

I asked a question about whether the basic method I have thought up is possible.
>>
File: 2016-07-21-13:04:25-scrot.png (10KB, 457x105px) Image search: [Google]
2016-07-21-13:04:25-scrot.png
10KB, 457x105px
>>55680990
Elisp has wrappers for CL stuff, but I wanted to iterate through a list like that to use the properties of an empty list.
>>
>>55680990
Never mind, doesn't work. res is never nil. Here's another approach, however ugly:
(dotimes (i 100)
(format t "~%~[~[FizzBuzz~:;Fizz~]~:;~[Buzz~:;~D~]~]"
(rem i 3)
(rem i 5)
i))
>>
>>55681115
>tfw
(format)
in elisp has format strings just like in
printf()
>>
Hi guys,

Sorry to bother you with this, but (in/with Docker) is it better to:

>contain scripts (e.g the Rails skeleton) in "open" "volumes" so I can edit them from outside the container and edit them whenever needed
or
>contain scripts in the container image itself, inaccessible from the host and rebuild the whole image every time

Sure I can still access the files from the host both ways but the second one is a little harder.

Also, if the first one, how should I move around the separate volume if using dockerhub or github or something?
>>
>>55678253
>write a program
Literally just use something like Comodo One.
>>
File: 32rGdBO.png (49KB, 1095x525px) Image search: [Google]
32rGdBO.png
49KB, 1095x525px
Working on a semi-golfed, but not obfuscated Hangman.

An anon was saying he had a goal of 25 lines, so I thought I'd shoot for close to that, without cheating and putting more than one statement per line.

Just need to get the stickman graphic in and work on formatting. I have a feeling that's going to blow my line goal away.
>>
>>55681634
>no ascii hangman
dropped
>>
>>55681818
Working on it, friend.
>>
why are people hating on atom anyways?
downloaded it a few days ago and its honestly a better version of emacs
>>
>>55681847
Atom is good, but VSCode exists.
>>
>tfw I got the max possible score of my country (France) for my programming exams
>>
>>55681961
tell us about the exams, jan pierre
>>
>>55677105
Started to learn programming. Is there any website which gives you some programming assignments or some tasks to create small time programs?
>>
>>55681998
rosetta code for example
>>
>>55681960
meh
i feel like extension support is still too immature in comparison
but yeah, the debugger and better intellisense are pretty great
has potential but will take time
>>
>>55680918
help guys
>>
>>55681998
http://better-dpt-roll.github.io/
>>
File: literally john carmack.png (9KB, 696x50px) Image search: [Google]
literally john carmack.png
9KB, 696x50px
>>55681972
I am too ashamed to talk about it was JAVA. Basically it was multiple choice questions in the first part then create some bullshit programs in the second one (only pen and paper allowed). Hopefully I'll be able to go back to Haskell once I am done with this bullshit and I get a job.
>>
>>55682070
>Haskell
>job

Possible, but not probable.
>>
>>55682070
>some bullshit programs
like what
>>
>>55682094
Create JFrame GUI with listeners, menu, layout and basic math operation (enough to confuse retards).

Implementing stack, queue, linked list from scratch

I/O operations on text files and error handling.

Basically all you need to become comfortable drone in a cubicle.
>>
>>55682151
at least it's practice oriented and you should be happy about your perfect score
>>
File: pity.jpg (16KB, 465x287px) Image search: [Google]
pity.jpg
16KB, 465x287px
>>55682151
>Basically all you need to become comfortable drone in a cubicle.
oh boy, someones in for a rough wake up call
>>
>>55682196
Well I am learning J2EE, servlets and Spring on my own. Enlighten me what else would be useful to learn?
>>
>>55677105
Covariant return types
>>
File: saTN6Np.png (58KB, 1061x751px) Image search: [Google]
saTN6Np.png
58KB, 1061x751px
>>55681634
>>55681818
ASCII man added

he is not currently hanging, but his parts get removed as you fail

I'm actually curious what a C solution would look like.

Is the big dick playa here to enlighten us?
>>
the solution is that you have all the states as strings and switch between them as the game progresses

much easier than removing parts
>>
>download visual studio community 2015
>download c# e-books
What am i in it for?
>>
>>55682323
>state
>>
>>55682323
>you have all the states as strings
That's a fuckton of lines and extra data within the program.

I'm going for semi-golfed, without obfuscating.
>>
>>55682325
>What am i in it for?
I don't know, you tell us.

It's an easy language to program in. What do you want to do with it?
>>
>>55682393
[spoiler]make game[/spoiler]
>>
>>55682416
You can't spoiler here, and it's likely you're young and you frequent /v/.

Go research Unity and fuck off to >>>/vg/agdg

C#'s a good language for newbs, though.
>>
>>55680477
I dont know what you are implying. Also the problem was fixed by setting the initial directory to documents. I dont understand why that fixed it, and why setting it to the desktop doesnt work, but I dont care enough about windows specific things to understand it.

Btw Ive been looking at the code some more and doesnt this create a memory leak. The filename is dynamically allocated but never deleted.
>>
>>55682435
>agdg told me to fuck off to /g/
>/g/ told me to fuck to agdg
I can't win
>>
>>55682416
Unity is super simple and used by even the most mentally handicapped JS devs so you'll be fine.

I wouldn't jump directly into Unity though, get used to C# a bit first before you end up biting off more than you can chew.

Good luck mate.
>>
>>55682435
>>55682486

Oh and additionally here's a Discord server with a pretty large Unity community - They're a bunch of normies so they don't mind helping out scrubs.

https://discord.gg/0TYNJfCU4De7YIk8

If you make yourself known to me at any time I'd be happy to help you out, spent a fair bit of time dicking about with Unity.
>>
>>55682477
Well, if you just want to get used to using C#, then start doing simple things from the /dpt/ roll site.

Then post code here so we can tell you why you're retarded, and hopefully you'll learn something.

>>55682062
>>
>>55682504
>>55682501
thx weird oldfags. one day i will be as grumpy and insightful as you guys
>>
>>55682540
>he isn't grumpy and cynical yet

Yeah, you need to spend some more time here. It makes you a better person.
>>
let us all band together /dpt/ brothers and finish making a large application together
>>
>>55682861
like what? Gentoo 2.0?
>>
>>55682899
A Captcha Solver
>>
the documentation for the .getRotateinstance (theta, x ,y ) says

https://docs.oracle.com/javase/7/docs/api/java/awt/geom/AffineTransform.html#getRotateInstance(double,%20double,%20double)

>The matrix representing the returned transform is:
[ cos(theta) -sin(theta) x-x*cos+y*sin ]
[ sin(theta) cos(theta) y-x*sin-y*cos ]
[ 0 0 1 ]

my question is, what the fuck do they mean by x*cos ?
Do they mean x* cos(theta) ? Do they mean x*cos(x)
it's impossible to multiply x by a cos function with no argument!
>>
>>55682939
must be theta, x is coordinate, makes no sense for it to be cos(x)
>>
What's a good intermediate level book to read after Dive Into Python?
>>
>>55683146
Beginners guide to C
>>
>>55683146
How To Think like a Computer Scientist Python
>>
>>55678253
>>55679374
You write like a Pajeet.
>>
>>55683182
It looks like a first year book and a lot of that seems to overlap with the Pilgrim book, though I could definitely use more OOP, design and algorithm stuff over learning the syntax basics again and slicing lists.
>>
Nice Youtube channels for programming stuff?
>>
>>55683524
>>55683146
SICP, at least give it a try

it's not really intermediate, it's introductory, but i only read it after i'd done some learning in python, just likey ou
>>
>>55682060
You need to build a cross-compiler toolchain that targets a freestanding environment.
http://wiki.osdev.org/GCC_Cross-Compiler
Have fun.
>>
File: Android N.png (20KB, 1200x1200px) Image search: [Google]
Android N.png
20KB, 1200x1200px
I tried my hand at learning Python a couple of years back. I didn't really finish Learn Python The Hard Way. Now I am planning to start developing for Android. I have like 0% experience with Java and I only know about HTML/CSS. Should I dive right into Android development or go and learn Python first like I originally tried to?

Pic unrelated
>>
>>55683899
>Java
>Android

I'll pray for your soul anon
>>
Marshaling data form Ada to Lua and back again.
It's boring ass fuck.
>>
Alright guys, i am not sure if i understand REST.
Please answer me this question:

is the "requests" module in Python a RESTful API? you can perform get, post, head, puts and delete requests with it, so it must RESTful right?

And CRUD would be something like JDBC for Java, yeah?
>>
>>55683871
>GCC_Cross-Compiler
>Have fun.
Yeah, no.
Cross compiling is hell.
There is no better way to learn to hate autotools than build a proper cross gcc.
>>
>>55684010
What would you suggest then?
>>
>>55683899
>Should I dive right into Android development or go and learn Python first like I originally tried to?
If your goal is pure Android dev, then you should start learning Java ASAP.

Alternatively, you could start learning C#. This would allow you to develop for Android in Xamarin or Unity while not using the clusterfuck that is Java.

>>55684067
>>
>>55684067
Literally anything other than Java or Android
>>
>>55683550
No. But they'd be useless anyway.
You have to actually write shit to learn *anything*.
>>
>>55684090
>>55684082
>anything other than Java
but m-muh flappie bird clone

Seriously I want to reach consumers or is there a better way that possibly leads to early retirement for me? I'm not a capitalist I just want enough to get by, been freelancing for years and all that.
>>
>>55684168
If you want income from developing, first you must learn to be a developer.

I recommended C# + Xamarin or Unity because you can dev it once and it'll run on iOS, Android, and Windows Phone, giving you a larger audience immediately.

It's probably the easiest way to get something working and on the Play Store / App Store.
>>
>>55684248
I have some C# knowledge from college programming classes. If that's a viable path then I wonder how come I don't hear about it often? I am inclined to believe you I just want to learn more.
>>
>>55684272
I write C# for a living, ask me anything.
>>
>>55684272
Xamarin only recently became free (open source + free beer).

Previously, it cost about $1,000 per year for a license before Microsoft bought them and made it free.

That's why it's a new thing for entry-level developers.

They make their money on if you want to host your database/application on Azure, and if you want to use their hive of all Android devices ever created to do testing.
>>
>>55684286
I have a macbook air and I already have android studio installed but I guess that's useless.

I have gedit, sublime text, what do I need to get started? Is ther a kind of Learn Python The Hard Way for C#? I really enjoyed that book that's why I keep coming back to it.
>>
>>55684272
>I wonder how come I don't hear about it often?
Because it's boring.
A lot of the lol-enterprise Java stuff migrated to C#.
So there are plenty of C# jobs around doing mostly boring stuff.
Also, if you know C#, you know most of Java and vice versa.
(C# is the bigger language of the two, tough)
>>
>>55684307
>macbook
Well, Xamarin Studio is probably what you'd want to go with.

Visual Studio would be preferred, but there's no OSX port for it at the moment, seeing as how it's based on the WPF framework.

I learned C# with Murach's, but there are probably better beginner books. Murach's focuses on database integrations and GUI creation, which is nice but Xamarin GUI is done differently than something like WinForms.
>>
>>55684299
sounds interesting. Thanks. What's the best simple resource on C# + Xamarin/Unity?

>>55684308
Ive all but forgotten the C# college courses I took but I'm sure I can get into it again within a month.

If lets say my plan is to make a simple text editor, or a chat app, be it web based or app based, C# would be sufficient for me to get started right?
>>
>>55684342
>What's the best simple resource on C# + Xamarin/Unity?
They have lots of example code and solutions you can compile and play with on their site. There's video tutorials, too.

I'd hesitate to recommend any random thing when their tutorials and documentation is solid.
>>
>>55684348
Sorry to be a bother but would you mind posting a link?
>>
>>55684307
>what do I need to get started?
A compiler and a .net runtime, so mono.
You can install mono (open source .net implementation, AFAIK soon to be merged with the open sourced .net) and use their compiler.

But for "professional" C# development:
Get a Windows machine and prepare to suck Microsoft dick.

>Is ther a kind of Learn Python The Hard Way for C#?
Sorry, I never used a C# book. I knew Java reasonably well and picked up the rest on the go.
I heard of 'C# in Depth' from John Skeet, but it's probably not a good introductory book.

>C# would be sufficient for me to get started right?
I know next to nothing when It comes to Web or App development.
However, whipping something up in WPF or WinForms should be manageable.
IIRC mono can't do WPF though.
>>
>>55684413
>'C# in Depth' from John Skeet
I meant to say that book was written by John Skeet.
I didn't want to imply that I know him.
>>
>>55684470
>John Skeet
That motherfucker was in nearly every single SO accepted answer for like 5 years. I swear he lived on that site.
>>
>>55684413
Thanks a lot, it fucking sucks bcause I actually just switched to Mac like this whole entire month so far. I hate what has become of Windows. I'll try to look into getting a Thinkpad to install Windows 7 on then.
>>
>>55684373
It's all here:
https://developer.xamarin.com/guides/cross-platform/getting_started/

There are videos interspersed throughout, but you're certainly going to need to do some reading.
>>
I want to become godlike at Java programming what it do?
>>
>>55684526
I'm that guy >>55684413

Just for the record. I don't think you absolutely have to do it in C#.
And I'm not sure that it's going to be a better experience.
Mostly because the Java Android API is directly supported by the vendor, and
I'm sure that there is a lot of material on that.
I guess having a cross platform intermediary is going to lead to some pain.

In my experience these "pancea" type that promises to cure all problems over a set of different platforms
tend to be more trouble than they are worth.
Be it ORM mappers or mobile cross platform systems.

People, and especially /g/tards, love to hate Java, so always take it with a grain of salt when they talk about it.

Also, depending on what you want to do, you can get away with a pure webapp.
Then you just open that thing in a Android browser to get mobile.
That way you could build up on the Python, HTML and Javascript you already learned.

>>55684683
Write something neat in Java?
>>
>>55684788
I can only write beginner and intermediate programs I don't know how to get to the level of really good at java programming?
>>
>>55684801
write a program that sends a bit into t he past
>>
          :::l~lllll:.
.xUHWHll ll?M88WHX:.
.X*#M@$ll lXlM$$$$$$WWx:.
:llllll?Hl :l$l$$$$$$$$$$8X:
ll~ ~:~ll :~l$l#$$$$$$$$$$8X:
:l~::lHl< ~.U$Xl?R$$$$$$$$MMl
~l~llll~~ .:XW$$$Ull?$$$$$$$MMl
l:~~~ .:lMTT#$$$$WX??#MRRMMMl
~?WuxiW*` `\#$$$$8llll??lll
M$$$$ `"T#$T~l8$WUXU~
~#$$$m: ~l~ ?$$$$$$
~T$$$$8xx. .xWW- ~""##*"
l ~?T#$$@@W@*?$$ /`
ll .:XUW$Wl~ `"~: :
lH: lWM$$$$Ti.: .lWUn+l`
?H.lu "$$$B$$$lW:UlT$$M~
?@WTWo("*$$$W$TH$l `
?$$$B$Wu("**$RMl
~$$$$$B$$en:``
~"##*$$$$M~
>>
>>55684863
is it a fetus

or a girl's head

or a 9
>>
File: UzmV9tY.png (19KB, 429x485px) Image search: [Google]
UzmV9tY.png
19KB, 429x485px
>>55684897
>>
>>55684969
oh i see
>>
C gurus,

any good instructional video/book that visualizes pointers, variables, arrays, and referrences?

I love C because its so fast and more rigid (coming from Bash Scripting) but pointers and references have been a guessing game for me just going by what the compiler tells me.
>>
>>55685067
Java
>>
File: 0673999866[1].jpg (162KB, 500x648px) Image search: [Google]
0673999866[1].jpg
162KB, 500x648px
>>55685067
I got you, senpai.
>>
>>55685067
Understanding and Using C Pointers
>>
>>55685147
>>55685154
Thanks, family.
>>
>>55684897
It's Froomey the Skeleton King.
>>
>explicitly writing Functor, Applicative and Monad instances for your types
>using free monads instead of the objectively superior right Kan extensions
What are you, some kind of faggot?
>>
https://www.strawpoll.me/10800451
>>
>>55685373
Damn, I don't fall into any of those groups.
>>
>>55685409
Damn, nobody asked you anything.
>>
What is the best way to calculate the absolute Value of an integer (c++):

#define abs(x) ( (1 + 2*(x >> -1))*x )


or

#define abs(x) ( x < 0 ? -1*x : x )
>>
>>55685432
inline constexpr int abs(int x)
{
return x < 0 ? -x : x;
}
>>
>>55685432
~x + 1
Assuming signed ints only
>>
>>55685432
>-1*x
lol

#define abs(x) ( x < 0 ? -x : x )
>>
A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with fewer than two elements is trivially a wiggle sequence.

For example, [1,7,4,9,2,5] is a wiggle sequence because the differences (6,-3,5,-7,3) are alternately positive and negative. In contrast, [1,4,7,2,5] and [1,7,4,5,5] are not wiggle sequences, the first because its first two differences are positive and the second because its last difference is zero.

Given a sequence of integers, return the length of the longest subsequence that is a wiggle sequence. A subsequence is obtained by deleting some number of elements (eventually, also zero) from the original sequence, leaving the remaining elements in their original order.


public class Solution {
public int wiggleMaxLength(int[] nums)
{
int pos = 0;
int max = 0;

for(int i = 0; i < nums.length;i+=2)
{
if(nums[i+1] - nums[i] > 0)
{

pos++;
}

if(nums[i+1] - nums[i] > max)
{

max = nums[i+1] - nums[i];
}

}
return max;
}
}



I figured out how to do it for positive or negative but I am having difficulty figuring out how to combine the two different patterns if it's negative first or positive. It's always random things like this that makes me struggles with algorithms. What it do?
>>
>>55685461
What the hell am I saying, please ignore me
>>
>>55685457
>int
>>
>>55685409
What group do you fall in? I think it's implied that "new programmer" means 0-2 years of experience.
>>
>>55685457
Or even better:

template <typename T>
inline constexpr std::enable_if_t<std::is_integral<T>{} && std::is_signed<T>{}, T>
abs(T x)
{
return x < 0 ? -x : x;
}
>>
>>55685522
you might need to define a class for this problem
>>
>>55685522
what is wrong with "#define"?
>>
>>55685566
Macros don't respect your privileges.
>>
>>55677668
Well what your app, I'll gladly download it
>>
how to call a function in the terminal if i'm using bash?

script.sh
#!/usr/bin/env bash

function test() {
echo -e "testing..."
}

function now() {
echo -e "testing now ..."
}

function later() {
echo -e "testing later ..."
}



i want to call
 sh script.sh 
and want the fucntion later to print

how do i do that?
>>
Should I learn C or C++?
>>
>>55684299
>use linux
>start developing for upcoming .net core (windows-only at the time)
>install windows
>xamarin is a 1000 obamas
>give up mobile
>all the tools I use are available on linux now
>install linux
>hear xamarin became free

I want to kill myself now.
>>
>>55683871
Oh shiet
>>
>>55685635
Just use later.
>>
>>55685579
so no reason?
>>
>>55685635
just enter the name of the function lol
>>
>>55684801
Program more.
Just continue to write stuff.
Always do something that's just over the edge of your current knowledge.
You have a faint Idea of how multi threading works? Write something multi threaded.
>>
>>55685654
>We face a QA problem here.

>The problem with supporting Linux is that we would need to create a self-contained Mono packaging for all of the bits we ship since most Linux distributions are slightly off when it comes to Mono.

>It also means that if we advertise "Linux" we would need to QA a dozen different combination due to different Linux distributions and different editions of each distribution.

>Perhaps we would support just a single distribution and a single version, which is closer to what we have to do on Windows/Mac today.
>>
File: avgint.png (3MB, 882x782px) Image search: [Google]
avgint.png
3MB, 882x782px
PLC program for computing the average of three 8-bit integer numbers
>>
>>55685668
>>55685687
how?
 sh script.sh later 


doesn't work
>>
>>55685713
Why?
>>
>>55685722
#!/usr/bin/env bash

function test() {
echo -e "testing..."
}

function now() {
echo -e "testing now ..."
}

function later() {
echo -e "testing later ..."
}

later
>>
>>55685713
Why do so many PLC programmers use graphical program generators or ladder logic instead of just writing in assembly
>>
>>55685738
but that will always call "later" you retard.
>>
File: zFxvGQg.png (12KB, 763x140px) Image search: [Google]
zFxvGQg.png
12KB, 763x140px
>>55685654
>>55685710
From the lead dev, pic related.
>>
>>55685635
Take out the hashbang from the script and do
source script.sh; later
>>
>>55685763
>>55685635
>i want to call sh script.sh and want the fucntion later to print
>>
>>55685741
Because it is much clearer to follow and see the program execution on function block diagram and continuous function chart.
>>
>>55685780
calling the function "later" was an example.

what if i want to call another function?
>>
File: dude.png (21KB, 365x176px) Image search: [Google]
dude.png
21KB, 365x176px
>>55685722
>>55685722
>>
>>55685800
thanks john!
>>
>>55685764
>>55685710
I don't understand.

Can I develop Xamarin compatible code with Mono/MonoDevelop or what?
>>
>>55685821
MonoDevelop includes Xamarin Studio on OSX.

Visual Studio includes Xamarin tools on Windows (best option).

MonoDevelop on Linux does NOT include Xamarin Studio.
>>
File: scratch-screenshot.jpg (262KB, 1384x625px) Image search: [Google]
scratch-screenshot.jpg
262KB, 1384x625px
>>55685795
Do you also write in Scratch?
>>
>>55685841
yes
>>
>>55685838
But does it ship the SDK?
>>
>>55685797
#!/usr/bin/env bash

function test() {
echo -e "testing..."
}

function now() {
echo -e "testing now ..."
}

function later() {
echo -e "testing later ..."
}

now
later
test
echo "fuck off";
>>
>>55685854
Technically, the SDK is completely open source, and you could build whatever you want with it on a Linux system. You'd have to build the tools to build the application yourself, though.

http://open.xamarin.com/
>>
>>55685857
retard
>>
>>55685881

Are you genuinely asking or are you actually dense?
>>
>>55685713
Here is the generated program in ST.
PROGRAM program1
VAR
int8bit_1 : SINT;
int8bit_2 : SINT;
int8bit_3 : SINT;
total_value : INT;
average_value : REAL;
calculate : BOOL;
SINT_TO_INT7_OUT : INT;
SINT_TO_INT12_OUT : INT;
SINT_TO_INT13_OUT : INT;
ADD1_ENO : BOOL;
ADD1_OUT : INT;
INT_TO_REAL11_ENO : BOOL;
INT_TO_REAL11_OUT : REAL;
DIV8_ENO : BOOL;
DIV8_OUT : REAL;
END_VAR

SINT_TO_INT7_OUT := SINT_TO_INT(int8bit_1);
SINT_TO_INT12_OUT := SINT_TO_INT(int8bit_2);
SINT_TO_INT13_OUT := SINT_TO_INT(int8bit_3);
ADD1_OUT := ADD(EN := calculate, IN1 := SINT_TO_INT7_OUT, IN2 := SINT_TO_INT12_OUT, IN3 := SINT_TO_INT13_OUT, ENO => ADD1_ENO);
total_value := ADD1_OUT;
INT_TO_REAL11_OUT := INT_TO_REAL(EN := calculate, IN := total_value, ENO => INT_TO_REAL11_ENO);
DIV8_OUT := DIV(EN := INT_TO_REAL11_ENO, IN1 := INT_TO_REAL11_OUT, IN2 := 3.0, ENO => DIV8_ENO);
average_value := DIV8_OUT;
END_PROGRAM
>>
>>55685635
This is fucking stupid, but you could do
sh <(cat script.sh; echo "later")

to run the later function by tacking it on to the end of the script passed to sh
>>
>>55685635
source script.bash

notice it's not called script.sh

BECAUSE IT'S NOT AN SH SCRIPT YOU FUCKING LINUX MONG
>>
>>55685899
retard
>>
>>55685875
Can't I build it on a docker container or heroku or some shit like this?
>>
>>55685857
function is deprecated.
use example() { }

the semicolon isn't needed
-e for echo isnt needed, furthermore use printf

+1 internet for using env
>>
>>55685934
bash isn't needed also, sh is enough and faster
>>
>>55685934
Does it have map reduce tho?
>>
>>55685966
yes
>>
how can i do this faster

red = color.red * 255 / 65535
blue = color.blue * 255 / 65535
green = color.green * 255 / 65535
>>
>>55686014
red = color.red / 257
>>
>>55686014

Make a table of the results for all values of red blue and green at the start of the program. Then just do a table look up.
>>
>>55686014
You could probably use some fancy bitshifting, but really I don't think you'd need to optimize that much and the compiler probably does that for you anyways
>>
>>55686037
hmm how does this work?

can you explain?
>>
>>55686055
x * 255 / 65535 = x * (255 / 65535) = x * 1 / (65535 / 255) = x * 1 / 257 = x / 257

I really shouldn't need to explain this to you
>>
File: 1468899863437.jpg (95KB, 394x404px) Image search: [Google]
1468899863437.jpg
95KB, 394x404px
>>55686075
very nice

+1 internet points for you
>>
>>55686099
Please die
>>
>>55686104
there's no need to be mad
>>
>>55686037
The compiler should already be doing constant folding.
>>
Is there a make option that will link to libraries in a specified directory over /lib? Basically I want to compile a program against very specific versions of the libraries and I want make to pick them up from a custom lib directory even though newer versions exist in /lib.
>>
>>55685432
Neither, consider what happens if you do this:
abs(x++);
>>
File: index.jpg (5KB, 236x213px) Image search: [Google]
index.jpg
5KB, 236x213px
>>55686190
and why would i want this?
>>
>>55686139
It doesn't
>>
>>55686203
I'm not saying you would want this, I'm saying that there's a flaw to using macros that might have unexpected results when you accidentally do something like this.
>>
>>55686213
what font?
>>
>>55686227
Profont
>>
>>55678591
There's a typo in the push function. Pay attention to the errors the compiler gives to you.
>>
>>55686213
It does with -O2 though.
>>
>>55686237
how do you get your vim to look like that?
>>
>>55686213
>volatile float
Also: what compiler flags did you use?
For float contestant folding, you might need -ffast-math
>>
>>55686316
>contestant folding
Thanks, spell check.
>>
>>55678591
Even if this compiled, it wouldn't do what you think it's doing.

par_checker('()') will pass
par_checker('(a') will also pass
>>
File: 1462825735282.jpg (128KB, 900x675px) Image search: [Google]
1462825735282.jpg
128KB, 900x675px
I have a C++ test for an interview tomorrow. They're sending me the questions, I am to write the code and send the answers + code back.

Give me some sample questions & challenges /dpt/, it's for a data analysis-type position.

I'm going through "Cracking the Coding Interview" by Laakman right now, it's ok.
>>
>>55686533
I don't help Pajeets.
>>
>>55686055
>>55686099
Holy fuck, you are dumb as a sack of bricks.
>>
>>55686683
thanks for your contribution to the thread.
>>
>>55686533
Convert an std::array to std::tuple.
>>
>>55686692
I've contributed lots to this thread, anon.
>>
>>55686533
Make a minimal hangman game in under 30 LOC
>>
>>55686733
i'm not *that* advanced yet
>>
>>55686285
>It does with -O2 though
No it doesn't, and it never should. A compiler should never optimize in a way that violates the expected order of operations, and for good reason

A compiler will not and should not ever reduce
red * 255 / 65535
to
red / 257

That is the programmer's job to do if he wants that, as it can have implications in the result. It's obvious that >>55686014 doesn't care about those implications, but the compiler doesn't know about that
>>
>>55686533

Know Mvc and Mvvm. Study up on the standardd design patterns / algorithms.

Be sure you know enough c++ to not look like a fucktard when they ask a question that requires deep knowledge on pointers or how the class system works / how to use it (vtables, inheritance types and when to use them, Composition vs Inheritance, etc)
>>
>>55686765
you haven't answered my question , anon
how do you get your vim to look like that?
>>
>>55686790
The bar is lightline with the wombat theme, and the syntax theme is jellybeans
>>
File: vim.png (26KB, 1015x688px) Image search: [Google]
vim.png
26KB, 1015x688px
>>55686815

<3 I find it funny how most of the dpt vim users do a rainbow on black style color scheme.
>>
>>55686815
>need to install a fuck load of plugins for this shit

fuck that
>>
best GUI toolkit for c++?
>>
>>55687370
Qt
>>
Are there any good programming-oriented certifications I can get that will look good on a resume?
I'm basically getting some free money to use on this.
>>
>>55687591

MCSD,
ACE,
CSSLP,
C / C++

Are probably your best bets for employment.
>>
>>55687682
Thanks.
You're going to have to explain ACE because I'm not getting the right results from google.
I don't know what you mean by C/C++, is that a specific certification?
>>
>>55687768

Something like this for c / c++
http://cppinstitute.org/certification

Ace = Adobe Certified Expert
http://www.adobe.com/training/certification.html
>>
>>55687952
Oh alright, thanks again.
>>
kind of fucking late but whatever, could you make a chrome extension that has power over the bookmark folder suggestions when you're bookmarking something new? Is that possible? And how would you make it?
>>
File: yea.png (430KB, 768x474px) Image search: [Google]
yea.png
430KB, 768x474px
How do I run test.py from poweshell script?

googling leads to people asking how to run python interpreter inside the poewrshell
but I am a simple retarded guy
>>
>>55688176
Yes you need to have Python installed and just do:
python test.py


Where the file is located.
>>
why isn't this true?
int a = b = 0;
int num = a & b; //0, false

0 & 0 are in their intersection, therefor the conjunction of them should be true.
>>
>>55688257
>I'm such a math fag
>>
>>55688257
For argument's sake, we'll just assume a and b are bytes
a = 00000000
b = 00000000

a & b = 00000000 & 00000000 = 00000000 = 0
>>
>>55688257
0     0     0
0 1 0
1 0 0
1 1 1
>>
What's a good resource for the useful parts of .NET? Tried just browsing through the MSDN, but it's fucking massive...
>>
File: d.jpg (68KB, 652x390px) Image search: [Google]
d.jpg
68KB, 652x390px
>>55688176
and you run the interpreter by just typing 'python' into powershell

but it won't work if you didn't do pic related

just a suggestion, but run from windows either to Mac or Linux it doesn't matter as long as it's not windows. Everything will be easier.
>>
>>55688257
What fucking intersection? & means bitwise AND in C, 0 AND 0 is 0 -> false.
>>
>>55688333
I am on linux
but the shit I am making is for windows
I asked yesterday and continue with it - automatic installation of software.. using powershell and python (pywinauto)
so far I got irfanview and 7zip
>>
File: Logic_Gates.svg.png (95KB, 755x791px) Image search: [Google]
Logic_Gates.svg.png
95KB, 755x791px
>>55688300
>>55688292
I understand how it works, but it's wrong.

>>55688334
pic related, 0 and 0 are the same circle therefor to say 0 AND 0 is true. saying otherwise is like saying the null class is not itself.
>>
>>55688361
>automatic installation of software

what are you making?
>>
>>55688379
>0 AND 0 is true
Good luck to the rest of your career
>>
>>55688379
>but it's wrong
It's not
>>
>>55678253
Functionality for that already exists and is called remote desktop.
You would also be able to do it much quicker by having all of the computers connected to the network and have one of them be administrator of the network.
Are you sure you're not a pajeet skiddie?
>>
>>55688383
i am a pc techy in pc shop
I spend time reinstalling windows on all kind of PCs and notebooks
even though installation of all the software on a contemporary rig takes ~15 min, I would like to automate it
>>
>>55688379

Misunderstanding the logical and operation. Every comparison that isn't True and True returns false. This is why we use & for bit masking.
>>
>>55685067
C : can use pointers only
C++: can use pointers and refs

Just before You go further, here is in short:
int a; //declares variable a, allocates a with size of int, variable is undefined
a = 5; //variable is defined
a; // will give 5
&a; //gives address of variable in stack
int * ptr; //declares pointer variable ptr
&ptr; //gives address of where pointer is stored
ptr = a; //WRONG ! You are not assigning value to pointer
ptr = &a; //OK! You are assigning the address of a to ptr
ptr; // Gives address of a, therefore.
*ptr; // de-reference operator, it POINTS to value
*ptr = 10; // now a == 10 as well

*ptr + 1; //11
ptr + 1; // address of space AFTER ptr
*(ptr+1); // will try to de-refer to another element AFTER ptr, same as ptr[1], unknown behavior
>>
>Want to start programming again
>Completely forgotten everything
>Not sure what language to even start with again

Someone end my suffering. I have a little bit of experience with C, Java, and Python but I just can't decide.
>>
>>55688574
C, you're welcome.
>>
>>55688574

C, Rust, or C++
>>
>>55688514
you use ninite.com, you can automate it with pyautogui to just select all the installer and then run it
>>
>>55688622
theres difference in just installing all the shit blindly
and actually setting things up to how you like all the stuff
>>
Anyone here ever work with a dysfunctional team? I've been on this team for about a month now, ~20 people randing from QA, Escalation, devs and a tech writer.

there is 3-4 senior devs but no one is the "top dog".

The product its self was inherited and is absolute fucking trash in terms of how it was built, talking 20k lines of javascript for the webclient.

everyone seems to agree that shit is wrong but nothing is being done about it, any advice? I don't want to bail (pay/benefits are good) but fuck am I stressed out after a month of this.
>>
Is it possible to learn asp.net in 1 week?
>>
>>55688595
>>55688601

Thanks guys. If I go for C I can just learn C++ at a later date anyway. Rust looks interesting though.
>>
>>55688656

If you're learning ASP MVC and you already know C#, yes.
>>
I have a couple of questions about C++:

frankly speaking pointers and references are just like soft and hard links under linux right ? (or at least vaguely similar)

and heres a long one please read carefully:

say I have a
main.cpp 
and a
foo.cpp 
and foo.h am I correct to assume that when I
#include foo.h
I can use only the things I declared in the header file ?

what is the purpose of include, coming from a java backround it does not seem like import, can you clear that up in maybe 1-2 sentences ?
>>
>>55688655
Refactor the whole thing.
Hope that it's not pure JS.
Try converting it to coffee script.
If all fails, minify it.
>>
>>55688695
Include basically does "copy and paste the contents" into the file that includes.
>>
>>55688695
Separating interface from implementation.
>>
How does one get out of programming limbo where you are stuck at doing medium programming skilled projects
>>
>>55688707
Buddy the whole thing is JS + JQuery and an internal wrapper around a fuck ton of libraries like backbone, kendo, bootstrap. Its a total mess.

I 6 years experience doing this shit and this is by far the most fucked up thing I've ever seen, and people are just (slowly) building features on top of it. Because of the "pattern" the original idiots used, you basically have to just pile shit on top of shit to get anything to work too.
>>
>>55688563
Pointers are just memory addresses. Nothing more. A pointer needs to have a type, because pointers support arithmetic.

Imagine an array of characters, each taking 4 byte of memory.

int arr[] = {1, 2, 3, 4, 5}

Now, a pointer,

int *p = arr;

Now, the pointer p points to the first character in the array. Now, pointers support arithmetic. If you increase a pointer:

p++;

Now, the pointer has shifted forward in memory 4 bytes, pointing to the second character. Thats why a pointer needs a type, to know
how much to shit. If it was a char, it would shift 1 byte, if it was a long long, it would shift 8 bytes, and so on.

If you go out of bounds:

ptr += 6;

Now, you are violating the memory rules and reading memory you should not, usually garbage.

Now, strings:

char *str = "Hello world!";

The str pointer points to the start of the string in memory. If you pass the pointer to printf():

printf(str);

Printf will start reading from memory and writing it to standard out until a null byte (\0) is found. If it isn't there, or you initialized the string in some retarded way, printf will read memory longer than the string and again start writing garbage to stdout untill a null pointer is found.
>>
>>55688737
Sounds much like how Windows development is done, eh, good luck with that crap.
>>
File: 2a9dtgp.gif (760KB, 500x266px) Image search: [Google]
2a9dtgp.gif
760KB, 500x266px
>>55688737
Dear god.
>>
>>55688742
>>55685067
>>
>>55688772
>>55688771

There are dinosaurs there that are forcing the web client to act like the windows client as well, I can't make this shit up.

Probably ride it out for a bit then jump ship if nothing changes (likely).


fuck me
>>
>>55688683
I only know other stuff like C++, Javascript, PHP etc. It's a course the uni gives, it's 1 week long and has a exam after it.
>>
>>55688737

Start phasing out the older code base for new cleaner alternatives as you work on features. It's about the only way you'll be able to trick management into allowing a rewrite to happen.
>>
>>55688724
>>55688716
thanks for replies
>>
>>55688379
Wew lad

#include <set>
#include <iostream>
#include <algorithm>

int main() {
std::set<int> s1{0, 1};
std::set<int> s2{0, 1};
std::set<int> s3{0, 2};

std::cout << "s1 == s2: " << (s1 == s2) << std::endl;
std::cout << "s2 == s3: " << (s2 == s3) << std::endl;

std::set<int> u;
std::set_union(s2.cbegin(), s2.cend(), s3.cbegin(), s3.cend(), std::inserter(u, u.begin()));
std::cout << "s2 ∪ s3: {";
for (auto& item: u) { std::cout << item << " "; }
std::cout << "}" << std::endl;

std::set<int> i;
std::set_intersection(s2.cbegin(), s2.cend(), s3.cbegin(), s3.cend(), std::inserter(i, i.begin()));
std::cout << "s2 ∩ s3: {";
for (auto& item: i) { std::cout << item << " "; }
std::cout << "}" << std::endl;
}
>>
>>55688790
Pretty much this.
>>
>>55688790

I WANT to get it onto angular, but the way the old code is entrenched it seems impossible without a complete rewrite (not going to happen).

>>55688789

One week doesn't seem like enough if you're coming into it from PHP/JS. C++ will help but it would be tough, IMO.
>>
In python3, how do I get this to print a message when one is added?
This is comfy :
d[ip_address1] = d.get(ip_address1, 0) + 1

It just doesn't print a message like this ugly code:
                            if ip_address1 in d:
d[ip_address1]+=1
else:
print('reset/added', ip_address1, dest_port)
d[ip_address1]=1

What do I do? Keep old code?
>>
What's the best way to split an array made of n ints into a x number of arrays in C?
>>
>>55682306
he's too busy averaging 2 ints and writing his fizzbuzz variation #1240
>>
NEW THREAD!!!

>>55688901
>>
>>55685489
I'm not that guy, I put that I have experience and hate Java, but I don't really dislike Java enough to "hate" it, I would just avoid it for personal projects.
>>
>>55688379
0 represents the empty set. O∩O=O
>>
>>55680456
>>55680620
virtual machines are super easy though

also how the fuck does a class on programming end with bubble sort
>>
>>55681141
they're much more powerful actually
>>
>>55686014
> using floats for colors
>>
>>55680058
tokenization is kind of pointless when each token is a single character

they already are tokens
Thread posts: 317
Thread images: 36


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.