[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: 28
File: gotta go fast.webm (1 MB, 718x404) Image search: [Google]
gotta go fast.webm
1 MB, 718x404
Old thread: >>52598743

Redditâ„¢ :^) please go edition.

What are you working on, /g/?
>>
/r/programming general
>>
OCaml general.
>>
It hasn't even hit bump limit yet.
You should be beheaded.
>>
>>52606374
Still better than moonrunes and reddit.
>>
File: fag.webm (3 MB, 800x384) Image search: [Google]
fag.webm
3 MB, 800x384
just leaving my fag calculator here for r8's and h8's
>>
>>52605831
>Try block with no catch block, no finally

Hello Java my old friend
>>
Everyone subscribe to /r/MonthlyProgram
>>
ayy lmao
>>
>>52606493
>hey these guys are shitting in the pool, i should do exactly the same thing!
>>
>>52606543

As I recall, try needs either catch, finally, or both. So, uh... good stuff.
>>
>>52606188
Can someone explain me why in python people use something among the lines of

if __'name'___ == __'main':
do stuff
>>
>tfw I just realised multiple monitors are a waste of money
>>
>>52606657

Doesn't that allow some file to run standalone or as a module/class/etc to some other code?
>>
>>52606667
Depends on the setup.
If you can't get the colours to match perfectly then it's just distracting rather than helpful.
You end up moving everything to the better looking screen, the others become disused.
>>
>>52606675
this
>>
>>52606667
For you, maybe. Not everyone has a low-powered brain like you.
Multi-taskingi is very common.
>>
File: vaccine.png (207 KB, 2296x1496) Image search: [Google]
vaccine.png
207 KB, 2296x1496
I need a logo for this
>>
Studying react js with the hopes of developing a library with it for my web framework ("middleware"). React seems popular and is generally something a lot of developers use, problem is a lot of people want to use it with node and asp, so I might try.

A jsx renderer seems pretty bulky though, why would anywant want this?
>>
>>52606712
But you can just switch workspaces instead of having multiple monitors.
>>
>>52606731
You're so retarded it hurts.
>>
>>52606657
when __name__ is '__main__', it means the file was called as the main entry point. You can use it for various stuff like having tests run or be able to use a library like it was a program.
>>
>>52606732
Are you retarded? Do you not know what multi-tasking means?
Switching workspaces would be doing 1 thing at a time, not 2 or more.
>>
>>52606667
Two is still not enough for me
>>
>>52606732
Having a browser open on one screen, and a text editor and/or terminal on the other is incredibly useful.
Especially with shit like android studio which pretty much takes up the whole screen if you want any text editor space to be visible.
>>
>>52606684
I think this is the problem, I have an IPS monitor and an LCD TV connected.
>>
>>52606188
>using the smiley with a carat nose
>>
>>52606792
You pretty much need 2 of the exact same make and model to get the settings to match.
Even just having the blacks slightly different can make one screen look grey in comparison.
>>
Just finished reading How to Think Like a Computer scientist

I'm on a journey to being able to create my own 3D games but I know Im not there yet

Where should I go once I feel I am comfortable understanding everything from variables, classes, functions, etc all the basics of programming?

Was thinking of building my own lightweight 2D games to start off and understand how game dev works

Not sure where to start looking on things to work on though as far as languages/engines/APIs etcetera
>>
>>52607069
Download Unity and follow the tutorials on their website.
>>
>>52607135
Would a beginner be fine making a game in Unity with no prior gamedev (I was under the impression I should start by making something in 2D and working my way up)
>>
>>52606543
not to mention he should be closing the stream on the finally block.
Or using try-with-resources which does exactly that
>>
>>52607254
>try-with-resources

An excellent, and yet direly underused, feature imo.

I didn't really gain an appreciation for them until I started using C# w/ the 'using' statement.
>>
>>52607254
>he should be closing the stream on the finally block
KEK, you fell into the trap of thinking logically about something!

.close also has to be caught for IOException
Yes, java could fail to close a file, literally refusing to let you drop it.

The idea is if the open fails, it doesn't have to close anyway, so put both in the same try block.
If the close fails then well, hope for the best.
>>
I don't like JS
why is everyone praising it like the second coming of christ
>>
>>52607365
Because it runs on anything that has a browser from this century, practically never any compatibility issues except IE shitting the bed

Similar to a malignant tumour , it spreads like wildfire.
>>
>>52607365
try typescript
>>
>>52607239
nowadays 2d and 3d are the same thing because you won't worry about the engine faggot. Everything is already done for us, we just need to drag and drop shit and boom, AAA game done.
>>
Question: interested in going into computer science/programming/etc, and want to ensure that I'm starting it off the right way. The program my university offers starts you off learning C-- however, I've read that C is an undesirable language to begin learning, recommending something like Java instead. What are your thoughts, /dpt/? Is C an okay language to begin coding on?
>>
>>52607581
C is god tier anon, Java is shit tbqh, also you will probably need to learn C first then go to java when you're ready for object oriented bullshit.
>>
>>52607581

C is fine. Then you'll learn something from this millennium and be gobsmacked at how feature-packed languages have become.
>>
>>52607716
C is great if you want to shoot yourself in the foot constantly, and if you are alright with shooting your foot taking your entire lowerbody with it.
>>
Working through a book made to teach python and got this error
$ python downloadXkcd.py 
Traceback (most recent call last):
File "downloadXkcd.py", line 4, in <module>
import requests, os, bs4
ImportError: No module named 'bs4'


how do I fix this? running antergos
>>
>>52607787
>downloadXkcd.py

Be glad it didn't work.
>>
>>52607787
it looks like you're getting an ImportError because there's No module named 'bs4'
>>
>>52606502
What result to do you get with 1/3*3?
>>
>>52607581
It's only "undesirable" in the sense that it is much more low-level than other more modern languages. But because of this, it provides a good foundation. If you start with C/C++, it will be way easier to learn other languages, as long as you are ok with the initial learning curve.
>>
here's a pacman kind of sound using phase modulation

    private static final void test() throws LineUnavailableException {
final int bufferSize = 8192;
final AudioFormat audioFormat = new AudioFormat(44100, 16, 1, true, false);
final DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat, bufferSize);
final SourceDataLine soundLine = (SourceDataLine) AudioSystem.getLine(info);
soundLine.open(audioFormat, bufferSize);
soundLine.start();
final byte[] buffer = new byte[bufferSize];

new Thread(new Runnable() {
final int getNote(int i, final int p) {
i += p;
final int m1 = 100;
final int m2 = 50;
final int m3 = 25;

double f;
f = (m1 * Math.sin((i % m1) * ((2.0 * Math.PI) / m1)));
f += (m2 * Math.sin((i % m2) * ((2.0 * Math.PI) / m2)));
f += (m3 * Math.sin((i % m3) * ((2.0 * Math.PI) / m3)));

final int r = (int) f;

return r << 4;
}

@Override
public final void run() {
final int m = 22050;
int i = 0;

while(!exit) {

for(int j = 0; j < bufferSize; j += 2) {
++i;

final int phase = (int) (200 * Math.sin((i % m) * ((2.0 * Math.PI) / m)));

final short note = (short) getNote(i, phase);

final byte bhigh = (byte) (note >> 8);
final byte blow = (byte) note;

buffer[j] = blow;
buffer[j + 1] = bhigh;
}

soundLine.write(buffer, 0, bufferSize);
}

soundLine.close();
}
}).start();
}
>>
>>52607792
fuck off tripnigger
>>52607801
Somehow reading that when you typed it helped me figure it out, thanks
>>
>>52607903
>fuck off tripnigger

:)
>>
File: welllad.webm (279 KB, 656x1020) Image search: [Google]
welllad.webm
279 KB, 656x1020
>>52607805
thought you'd get me huh?
>>
>>52608026
are you doing the stanford ios class that's on youtube?
>>
>>52608059
well lad I didn't watch any tutorials for this, but I'm using this expression:

return String(NSExpression(format: "String operation here fag!").expressionValueWithObject(nil, context: nil) as! Double)
>>
>>52608026
now do .1 + .2 - .3
>>
>>52608100
This is a good ios series on youtube.

https://www.youtube.com/watch?v=OJUsghbtbF8&list=PLy7oRd3ashWodnpf8rjfYEkTgwbOEsKfU&index=3
>>
File: wat.webm (736 KB, 656x1020) Image search: [Google]
wat.webm
736 KB, 656x1020
>>52608101
literally wat happened pls halp

>>52608155
thanks m8 I will take a look!
>>
>>52608260
Welcome to computer science.
>>
>>52606657
__it's__ __pythonic__ (also know as ugly).
>>
>>52608260
you just got hacked lmao
>>
File: 1422811183106.png (176 KB, 494x468) Image search: [Google]
1422811183106.png
176 KB, 494x468
>>52608260
>He doesn't know
>>
>>52608260
iOS devs everyone
>>
File: doglang.jpg (410 KB, 876x2350) Image search: [Google]
doglang.jpg
410 KB, 876x2350
>>
>>52606188
Off topic, but is there any interest in a Gentoomen Library "expansion pack"? I don't have much to do tomorrow because of all this snow (classes are cancelled) and I'd use the day on making an updated version of it. It pissed me off enough that the most Python book is from 2011 (so not Python 3, obviously), but there aren't even any HTML books from the current decade.
>>
>>52608424
join #/g/sicp on rizon
i think they used to have a bot collecting books recommendations
>>
>>52608437
Thanks, I will do so.
>>
>>52608417
this is cute! cute!
>>
>>52608424
If you can't learn HTML from https://www.w3.org/TR/html5/, you should just give up on learning to use your adding machine.
>>
>>52606188
I use green-on-black for my terminals and there's nothing you can do to stop me
>>
File: lsdft.jpg (138 KB, 640x427) Image search: [Google]
lsdft.jpg
138 KB, 640x427
>>52608417
swift
>>
File: fag.jpg (113 KB, 423x590) Image search: [Google]
fag.jpg
113 KB, 423x590
>>52608555
Dog about to rub his dick on a branch? It's alright, how about this one tho?
>>
File: spurdo_bird.png (32 KB, 400x400) Image search: [Google]
spurdo_bird.png
32 KB, 400x400
C++ bros, i need help again.

Ok so. Lets say i want to make an amateur screenshot of my screen (1600x900) with GetPixel function in windows.h.

POINT ofarray[1440000];
int count;
int x;
int y;
for (count = 0; count < 1440000; count++)
{
for (x = 0; x < 1600; x++)
{
for (y = 0; y < 900; y++)
{
ofarray[count].x = x;
ofarray[count].y = y;
}
}
}


am i doing it right?
>>
>>52608595
that's a cute fag dog tho
>>
>>52608610
>am I doing it right?
Fuck no.
>>
>>52608610
Feminine as fuck
>>
>>52608610
>SPOONFEED MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
How did you decide WHAT you wanted to code first? I burned through a java book and I believe I grasped the syntax and concepts.

Problem is: I don't know what the fuck I should now do with this knowledge.
>>
Accurate?

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

I made a RuneScape combat level calculator because it was what I was interested in, and it seemed like it would be useful to me.

Make something related to your hobbies and own curiosity.
>>
>>52608899
Agreed. This is why I stuck with the arts.
>>
>>52608897
I knew what I wanted to do before learning my first language.
>>
/pol/fag here, can someone make this work


public class OP{

private boolean isOpAFaggot;
public static void main(String args[]){

System.out.println("Is Op a Faggot ? " + isOpAFaggot );

}

public boolean setOpAFaggot(){
this.isOpAFaggot = true;
return true;
}

}
>>
Why does
public int packageType(Object[] package)
{
return 4;
}

report an "identifier<> expected" error at line 1?
this is java.
>>
>>52608966
also, how do you make it in those code boxes?
>>
>>52608975
Is package a java keyword?
>>
>>52608907
>>52608945
Vidya is my biggest hobby so I guess I could try my hand at amateur game dev.
>>
>>52608966
>>52608993
How about you go and study instead you fucking racist airhead
>>
>>52608966
You're not /pol/, you're /b/, well, I guess /pol/ is /b/ these days so there's not much difference.

Why did /pol/ turn to shit, /g/? I blame flags and IDs. /pol/ used to be my favourite board.
>>
 testing  
>>
>>52608994
Oops, that'd fuckin do it
my bad
>>
>>52608975
what the fuck kind of shit IDE do you use?

mine marks 'package' and says
>Syntax error on token "package", invalid VariableDeclaratorId
>>
>>52609014
You're just being as insufferable as him by using buzzwords like "racist".
>>
>>52608966
>can someone make this work
make it work yourself
Not surprised that a skinhead would need other people to do his work for him, they're never intelligent enough to make things work by themselves.
>>
>>52609015
exodus of redditfags ruined it


and mods

all the legit /pol/ users went to f.u.l.l.c.h.a.n
>>
File: ss (2016-01-25 at 12.34.06).png (2 MB, 1679x677) Image search: [Google]
ss (2016-01-25 at 12.34.06).png
2 MB, 1679x677
Not sure if HTML is allowed in these threads, but here goes.

Not really intending to make this functional or anything, just trying to get back into HTML after years of not actually making anything and learning how to use bootstrap.
>>
>>52609027
>buzzwords like "racist".
what
/pol/ is incredibly racist (and xenophobic, homophobic, etc)
>>
File: 1453520188057.jpg (268 KB, 1280x855) Image search: [Google]
1453520188057.jpg
268 KB, 1280x855
>>52609028
>Not surprised that a skinhead would need other people to do his work for him, they're never intelligent enough to make things work by themselves.
hitler was a smart guy though
>>
>>52609039
Buzzwords everywhere.
>>
>>52608899

>look at other videos
>all piano recordings
>Chopin
>take a look
>description says it'll be his last one, and that he won't have much free time anymore
>sad that he spent so much time learning how to play so well only to have to give it up

The feels are real
>>
>>52608260
U got meme'd on
>>
>>52609045
Hitler was a smart man that knew how to drive throngs of stupid and desperate people.
>>
File: 1434064612674.png (586 KB, 589x1006) Image search: [Google]
1434064612674.png
586 KB, 589x1006
http://pastebin.com/vT0zRS8K
[@arch ~]$ ./a.out 
Hyatczesgog l hyimeiga okjwoe zmsaiw lnedyi.
[@arch ~]$ ./a.out
Pmzuddlno azjieamd ohojltems lik ghdkspcmtaz ey ipioiud aozpdid okicfae teoahmro binwl yeonh pnod piz.
[@arch ~]$ ./a.out
Amgr cegiroyanyoi meg nyehirardafjt laauoprpfnipoa ywmtbtdsuuwu fn.
>>
Do all characters have a numeric value, /dpt/?

How do I get this number?
>>
>>52609075
ASCII TABLE
S
C
I
I

T
A
B
L
E
>>
>>52609075
man ascii
>>
>>52609075
printf("%i\n", 'a');
>>
>>52609058
Just like Steve Jobs.
>>
I need to write a program for an assignment that creates an absolute shitload output to a text file.
Now, I'm aware that system calls cause massive drops in speed.

So what I'm wondering is what I should do to reduce the number of system calls I make while maintaining a sane amount of memory usage.
I mean I have 32GB of RAM, but still. It doesn't sound smart to buffer 16GB worth of text data and then shit it out all at once.

What is the right thing to do in this situation?
>>
>>52609127
Pretty much any leader does this for a living
>>
>>52609075
110 105 103 103 101 114
>>
>>52609133
Your disk overhead is WAY higher than any syscall overhead.
Stop being retarded.

I'd say buffer a few megabytes at most.
>>
>>52609143
All leaders are literally Hitler.
>>
>>52609039
fucking brainwashed sheep faggot

it's not racism etc. if it's the truth
>>
>>52609149
rude
>>
>>52609153
I have a 1TB SSD.
>>
Sublime or Atom?

Ignore emacs and vim.
>>
>>52609078
>>52609081
>>52609088
I see, is this the value encryption uses to shift the characters when encrypting?
>>
>>52609088
int i;
for (i = 0; i < 256; i++)
printf("%hhi\t%c\n", i, i);
>>
>>52609172
Doesn't matter, your SSD overhead is still way higher than any syscall overhead.
I/O will always be slower.

>>52609177
Shitty ciphers yes.
>>
>>52609177
No.
>>
>>52609188
>256
>>
>>52606188
teaching myself to program with python. currently making a shitty clone of tetris. by which i mean i'm creating the mechanics and mathematics of it but i have no idea how im going to handle things like outputting the (x, y) coordinates to any sort of display or handle things like calculation frequency.
>>
File: bait-in-eyes.jpg (20 KB, 477x347) Image search: [Google]
bait-in-eyes.jpg
20 KB, 477x347
>>52609177
>>
>>52609195
><
>>
>>52609203
>
>>
>>52609190
>>52609192
>>52609202
Why it would be a bad idea to use the ascii values of a key as shifts?
>>
>>52609157
whatever you say buddy
I love it when /pol/acks go to places for help, loudly announce that they are /pol/acks even when it isn't even relevant, and then get hostile when people tell them to fuck off.
>>
>>52609177
Shit ciphers do, any one worth their salt encrypt on the bit-level
>>
File: 345345345.png (17 KB, 274x242) Image search: [Google]
345345345.png
17 KB, 274x242
>>52609288
JIDF detected
>>
>>52609288
I hate it when you think people from /pol/ are the same person.

You shouldn't generalise, anon. Not all of us are insufferable shitposters.
>>
>>52606188
that is such a cool gif, whatdo you think he's hacking?
>>
>>52609298
So how do I get the bit value of a character?
>>
File: condom hotdogs.jpg (228 KB, 1280x850) Image search: [Google]
condom hotdogs.jpg
228 KB, 1280x850
What are some simple projects I could do in rust? I've been messing around doing pointless things with it and I like it, but I want to work on a real project.
>>
>>52609288
>I love it when /pol/acks go to places for help, loudly announce that they are /pol/acks even when it isn't even relevant, and then get hostile when people tell them to fuck off.
nice generalisation, stupid kid

and you're the one calling people racist...
>>
File: uUyytCG.webm (176 KB, 310x220) Image search: [Google]
uUyytCG.webm
176 KB, 310x220
It's time to ask your favorite programming literate anything !

>>52604767
After http://roscidus.com/blog/blog/2014/06/06/python-to-ocaml-retrospective/

>>52609173
http://zedapp.org/
http://limetext.org/

>>52607581
it's horrible for learning: can't at abstraction, shit type system, doesn't abstract the target machine enough, shit semantics, shitty syntax, ...
>>
>>52608260
Leeeeel
>Saved
>>
>>52608966
Call setOpAFaggot before you print it. Also, why do you return a boolean if you set it directly, make it a void function.
>>
>>52608966
public class OP {

private boolean isOpAFaggot;

public static void main(String args[]){
setOpAFaggot();

System.out.println("Is Op a Faggot ? " + isOpAFaggot);

}

public static void setOpAFaggot() {
this.isOpAFaggot = true;
}

}


or

public class OP {

public static void main(String args[]){
System.out.println("Is Op a Faggot ? " + isOpAFaggot());

}

public static boolean isOpAFaggot() {
return true;
}

}
>>
>>52606657
When you import a file, that code isn't run. So you can put everything you want in functions, then when you want to test them, you put your tests in __main__ and call it as the entry point. Once it's fully tested, you can import it without removing tests.

Personally, I have instances where I have one file that performs a huge task, and one that performs a sub task, but both are doubly useful, yet quite large, so it wouldn't help to put them in the same file. I'm talking about something as simple as a 4chan board and thread image downloader, sometimes you want board which calls the thread function for every thread without calling its main, or sometimes you want to do the the thread download which does call its main
>>
>>52609870
should be private static boolean since you're accessing it from a static method
>>
>>52608966
public class OP{

private boolean isOpAFaggot;
public static void main(String args[]){

OP op = new OP();
op.setOpAFaggot();

System.out.println("Is Op a Faggot ? " + op.isOpAFaggot );

}

public boolean setOpAFaggot(){
this.isOpAFaggot = true;
return true;
}

}
>>
I've implemented a search function into my application, but due to the sheer amount of data it occasionally hangs the UI like a motherfucker.

How do I make it less heavy handed? I can't run this method asynchronously because it modifies the UI which means it has to be on the same thread.

Any ideas?

        private void txtSearch_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
{
if (txtSearch.Text != "")
{
lstMoviesView.ItemsSource = MovieList.Where(x => x.MovieName.Contains(txtSearch.Text, StringComparison.OrdinalIgnoreCase)).Select(MovieObject => MovieObject).ToList();
}
else
{
lstMoviesView.ItemsSource = MovieList;
}
}
>>
Been playing around with Ruby a lot lately and think it's pretty fun. Is finding a career as a programmer possible without any degrees or anything? I know web dev is but not sure about programming which is what i'd rather do.
>>
>>52609882
and it should be OP.isOpAFaggot = true or isOpAFaggot = true instead of this

or >>52609886
>>
File: 1451930799451.png (175 KB, 259x320) Image search: [Google]
1451930799451.png
175 KB, 259x320
What books is /dpt/ reading?
>>
>>52609892
nigger what the fuck are you doing
why are you handling queries in the same thread as the UI
Put data allocation in one thread and signal to the controller that the UI thread needs to update the data
>>
>>52609918
Just computing books. I don't read fiction (fairytales)
>>
>>52609918
kill yourself hamsterposter
>>
$ git commit -m "combined type and meme modules"
>>
>>52609953
>don't read fiction
You'll never become an efficient programmer if you don't read fiction, anon.
>>
>>52609920
>Yeah senpai just drop the search onto another thread when you want the UI to update live every time you press a key
>It's just that simple

If at any point I try to do ANYTHING on another thread that at ANY POINT has an effect on the UI, it throws an exception.

At least as far as I know, I've tried everything I can think of to get the search running on another thread.
>>
>>52610021
bullshit
>>
>>52609892
Csharts everyone
>>
File: 986.jpg (12 KB, 232x231) Image search: [Google]
986.jpg
12 KB, 232x231
>>52610041
Exactly what I needed, thanks!
>>
>>52610025
You'll just be a code monkey with no creativity.
>>
>>52610049
>search on separate thread
>tell UI thread to update
what's the problem?
>>
>>52610024
Then start over. You've clearly fucked this entire thing up because you have no idea how to work with a UI.
>>
>>52610058
fiction is masturbation

all you're doing is consuming someone else's more or less uninspired crap that tends to follow some simple formula

you can be plenty creative without it
>>
>>52610058
Second. Code isn't everything anon
>>
>>52610075
Given that response, I would be positively shocked if you had any creative ability. You're the sum of your experiences, and fiction is one of many ways to share the experiences and mindsets of others.
>>
>>52610102
k tard
>>
My life isn't shit so I don't need fiction
>>
>>52609893
pls respond
>>
>>52610113
<3
Learn2Life
>>
>>52610135
read fiction all you want but it's pathetic to be this smug and elitist about it
>>
>>52610024
you nig, run the query on another thread
then when the query is done, you send a signal to the controller
controller updates UI thread
bam, UI doesn't freeze.

Your UI will now update as fast as your shit-ass queries can complete. Maybe if your db wasn't set up on top of garbage it would complete faster.
>>
i bet you only read works by certain select authors because you'll only read what you enjoy reading (because it's a form of masturbation or escape from reality)
>>
>>52610144
You don't have to be mad about being wrong.
>>
>>52610193
Give him a break, I think he's autistic.
>>
File: ridiculously bad book.jpg (48 KB, 438x641) Image search: [Google]
ridiculously bad book.jpg
48 KB, 438x641
>>52610193
>i read some shitty ass books and watched some shitty ass movies, i'm such an intellectual xDD oh and that guy in a game of thrones is so hot xDDD mmm <3
>>
>>52606188

I should program with a balaclava on sometime... but it would probably get way too warm, because of my beard.

>>52608260

Stop using IEEE if you want accuracy.
>>
>>52610062
I've tried multiple times to get the search on another thread, the only implementation I've managed so far doesn't fix the issue because you can't update the UI asynchronously, it's got nothing to do with the actual search as far as I can tell, but the updating of the UI.

>>52610066
The problem isn't the query, it's the UI damnit.

>>52610191
My query is on another thread family, but the UI hangs because of the actual display of the information, I need a method of displaying the results in a way that doesn't hang the UI thread.
>>
File: trap programmer.png (1 MB, 1702x2471) Image search: [Google]
trap programmer.png
1 MB, 1702x2471
>>52610228
put on a schoolgirl outfit to improve programming ability
>>
Is LaTeX programming?
>>
>>52610024
you need to schedule UI updates on the UI thread
check your toolkit's documentation
>>
>>52610235
move to java so you can do proper multithreading
>>
>>52610225
I bet you don't even watch anime either.
>>
>>52610263
anime is autistic as shit and doesn't really teach you anything, not even the "serious" animes
>>
>>52610235
You're using Visual Studio, so use it.
Profile your shit.
http://stackoverflow.com/questions/17829692/wpf-controls-performance-issues-with-large-amounts-of-data
>>
I want to install Arch, but I don't have a printer to print out the guide and I obviously can't check the guide while I'm installing it.

What do?
>>
>>52610247
Technically speaking, LaTeX is Turing complete.
However I would consider it mostly markup.
It's as much programming as using Microsoft Word to do your math homework on.
>>
>>52610300
memorize it you pleb
>>
>>52610300
Just follow the on screen prompts
>>
>>52610300
Install it on a virtual machine then dd the image to a physical disk
>>
>>52610333
There isn't any, you just get a command line.
>>
>>52610235
>the UI hangs because of the actual display of the information
it's a list of text, jeez
you're doing something very wrong
like the UI thread could be getting lockblocked or something
>>
>>52610282
For some reason I literally cannot find any of the performance tools, this project seems to have hidden them and I can't see any options at all in any of the menus.

Visual studio is a pain in the ass sometimes.
>>
>>52610240

No. I'm a man, dammit!

>>52609893

It depends on what you want to program, and how much experience you have programming it. Many companies expect a minimum of a bachelor's in computer science purely as a policy. Many others expect more experience if you don't have a degree. Web development is one of those areas where I've heard a few companies/startups that see a degree as a negative on someone's resume.

Get a degree if it would be necessary for the specific jobs you are looking at.

>>52610300

Read the guide on your phone. Or, alternatively, use something like Linux Deploy or another chroot application to install arch on your phone.
>>
>>52610379
I'm not doing anything wrong, WPF just has a problem with dealing with displaying large quantities of information - each of those items is actually just two properties of an object with many other properties behind it.
>>
>>52610408
pass smaller objects to it then?
>>
>>52610400
>No. I'm a man, dammit!

Ruby is a girl's name. :3
>>
I'm starting to get into programming, but I'm unsure what to actually look into. I'm currently in highschool, but I plan on studying computer science in college next year. At the moment I'm taking a html basic class on Codecademy.
>>
>>52610400
All of you tripfags are starting to blend together anyway.
You might as well shave your legs and start shagging a black chick while snorting crack next to your weeaboo 2hu server rack.
>>
is the page with book resources (the one with the sicp wizard) still there?
>>
>>52610441
https://docs.oracle.com/javase/tutorial/
>>
>>52610423
Completely invalidating the whole point of the thing anyway.

I don't quite understand why it's hanging, I was dealing with far larger quantities of data in another project and it seemed to work just fine.

My diagnostics tools are just refusing to work, without providing me with any information on what's wrong with it.

Just having my shit pushed in by this particular problem at the moment.
>>
>>52610475
you wouldn't be having this problem if you used java instead
>>
File: inori_protection.png (61 KB, 256x256) Image search: [Google]
inori_protection.png
61 KB, 256x256
>>52610487
Halt, fiend!
>>
>>52610487
Well perhaps not, but on the other hand I'd have the problem of having to use Java.

So on balance, I think I'm alright.
>>
>>52610501
Enjoy your failed program.
>>
>>52610501
ooh burn xd
>>
>>52610441
Codecademy teaches syntax but not programming.
Look at any book aimed at beginners and do all the exercises.
ALL OF THEM.

I recommend "Programming in C" by Kochan.
>>
>tfw have to read a file line by line backwards
the things I do for sane memory usage
>>
>>52610626
what's so sane about that?
>>
>>52610534
Isn't it good to know the syntax?
>>
>>52610664
slowing down the algorithm because access speeds suck--that's just life.
>>
>>52610427

While mostly feminine, the name Ruby is, in fact, unisex, and at one point, it ranked in the top 1000 names for boys in the United States. Moreover, my first use of this name on 4chan was in a roleplay thread on /vp/ in its early days. Guess which character I was playing. I'll give you a hint: his name isn't Brandon, and he doesn't actually have white hair; it's a hat.

>>52610447

Nah. I think I'll finish up my master's degree, get a job in security or something, and impregnate some woman 2 or 3 times, resulting in what will likely be at least one new autistic kid in the world.

>>52610626

Are the lines a constant length, by chance? Either way, lseek.
>>
>>52610686
that's like reading a japanese phrasebook and thinking you know japanese grammar
>>
>>52610697
Coincidentally, yes they are constant length.
>>
>>52610686
you'll learn most of the syntax in like a day at most
>>
>>52609870
my nigga
>>
>>52610712

Then you're in luck. Seek to the end, and lseek backwards by a constant amount of bytes each time.
>>
>>52610704
>>52610714
Alright, guess I wasted some hours then...
However, should I continue learning html and other web languages? Or would it be a waste of time in regards to computer science?
>>
>>52610770
do you want to study math or make websites?
You don't need computer science for web dev, like, at all.
>>
>>52610770
Computer science is not about programming.
It's about critical thinking. Understanding algorithms, and their relation to data structures.

You need to understand how computers work at the CPU datapath level to get a feel for how algorithms change depending on the underlying hardware.

On the critical thinking part, you also need to understand how to break down a problem into smaller problems, and then complete them in a sane manner with other people. That's just software engineering though.
>>
>>52610809
>>52610810
I know, I know! CS and programming is not the same, but I'm asking if I should learn a specific language before attending college.
>>
Is accessing a member of a struct more costly than using a non-member variable? I'm thinking of creating several sub-structs inside a huge main struct for organizational purposes but am wondering whether this will cost me any performance. The huge main struct has to remain a struct.
>>
>>52610870
you'll be surprised just how behind everyone else is
most people who enter CS/SE programs are completely unmotivated shitters and will actually be surprised if they find out you program in your own time for fun.
>>
>>52610893
the whole point of structs is to group data together in a logical way
instead of passing 20 arguments, you can pass 1 struct that contains 20 members
>>
>>52610810
Learning either LISP, C or some Assembly dialect would probably teach him/her a lot of basic concepts by proxy though.
>>
>>52610697
>Moreover, my first use of this name on 4chan was in a roleplay thread on /vp/ in its early days. Guess which character I was playing. I'll give you a hint: his name isn't Brandon, and he doesn't actually have white hair; it's a hat.
jesus christ the tism
no 1 curr
>>
>>52610893
how costly is dereferencing a pointer?
>>
>>52610870
There is no particular specific language that you -need- to learn.

Everyone starts somewhere different.
Python is good for people that don't even understand control flow, and need the interpreter to hold their hands or otherwise they'd make scope errors.

All of the below is good for people who already understand control flow and don't fuck up their scope because they can indent and space their code properly.

C++ is good for people who would benefit from learning how data is organized in memory.

C is good for people who want a healthy hatred of I/O.

Java is good for people who just don't give a fuck and want to learn abstract concepts like OOP and deal with data structures right off the bat. Needless to say these people become code monkeys.

>>52610916
Assembly isn't good as a first-timer because people will be tempted to bypass control flow all the time with gotos. Concepts such as jump-lists are useful but Assembly really is something that is only good when paired with computer architecture.
>>
>>52610915
Yup. It is just that the huge struct now has like 40 variables belonging to three different groups which are responsible for 3 different things. Grouping those variables together in sub-structs would make the program more readable.
>>
>>52609870
The only one that worked was the second
>>
>>52610928
More costly than using a regular variable with no indirection, though not by much.
>>
>>52610940
stop worrying about optimization and focus on making your program modular and readable
it will help immensely once you decide to add new features
>>
>>52606188
>actually doing the programming
>not having people do it for you

Reminder that you are literally replacable by Indians and you will be outsourced soon, plebs. Real talents like me don't have to write a single line of code anymore.

I am the next Steve Jobs in 20 years time.
>>
>>52610893
Please, you're trying to micro-optimize an O(1) operation instead of optimizing your O(n^2) algorithms.
>>
>>52610985
this desu
>people trying to optimise stuff when they don't know shit about big O
>>
>>52611002
>implying anyone doesn't know about big O
>>
>>52609892
>WPF
>LINQ
>UI hangs
pick 3
>>
>>52611018
Most people in this thread don't even know what a P/NP problem is, or what a polynomial reduction is, or how Turing machines are used to determine the few decidable problems there is.
>>
>>52611037
That's actually not LINQ.
It's merely enumeration, lambda expressions, and lazy evaluation.
There doesn't appear to be a real database involved.
>>
>>52611018
lots of people don't. i can't even count the number of "self-taught" programmers who either had LITERALLY no clue what the fuck i was talking about when i asked about big O notation or had such a tenuous grasp that the extent of their familiarity was the intro paragraph on wikipedia.

I'm not saying formally educated students are experts, but i've only found a small handful of properly educated people have absolutely nothing to say about the complexity of something they were doing.
>>
>>52611053
I don't know any of these things and I know big O.
>>
>>52610898
this

if you're actually interested in programming you may as well not even go to college at all
>>
>>52611067
LINQ doesn't have to involve databases. If you do list.Select or list.OrderBy, that's already LINQ.
>>
>>52611084
Yeah well you are a fucking pleb then.

Big O notation is something that you typically learn in your "Basics of Programming" course in a fucking bachelor's first year.
>>
>>52609892
Try creating the list in async thread and then assigning it to lstMoviesView.ItemsSource in main.
>>
>>52611141
Isn't the whole point of LINQ that it transforms the command into a SQL query that the database itself performs?
>>
>>52611145
Yeah. Super basic stuff, hence why I said literally everyone know this shit. Nothing to be proud of.
>>
>>52611072
Just how much big O does anyone need?
It's just a fancy way to describe if your program's runtime will grow exponentially with the amount of input it receives.
>>
>>52611159
Well, it can do that, and the same library does the work when you do list.Select or list.OrderBy, with list being just a plain list stored in memory.
>>
>>52609058
and then it took the entire rest of the world combined to stop these stupid and desperate people

americans and their history knowledge
>>
>>52606188
does someone have the link with sound to OPs video?
>>
>>52611167
You've got enough big O when you can calculate the growth of sleepsort().
>>
>>52611067
>Real Database
>Needlessly complicating working with data that is barely 1-2mb of JSON stored in plaintext

And it is LINQ, actually.

>>52611158
Yeah I already am, if my diagnostics tools weren't just completely failing to work I'd have a slightly better understanding of the problem, but as far as I can tell in this specific instance for some unknown reason loading all the stuff back up hangs the thread. Ideally I'd have the display run on it's own thread, but as far I know that's not doable.
>>
>>52611208
>sleepsort
/prog/ lives on.
I wonder where VIPPER is now.
>>
>>52609918
sicp
>>
>>52611224
maybe ask hiroshima nagasaki if he would reopen /prog/
>>
>>52611167
if people could talk about that, that would be a huge improvement. the extent to which 90% of self-taught applicants know "Big O notation" is the explanation of what it is that you just gave me. I actually want them to have a vague sense of what growth their code will face given some language they're very familiar with.

as an example, on HN a while back there was a useful page from some university on python's big O notation for various data structures. i'll see if i can find it...

https://www.ics.uci.edu/~pattis/ICS-33/lectures/complexitypython.txt

there it is. if you come to me and say you're primarily a python programmer, great. you should be vaguely able to identify that there are a number of operations on sets that are much faster than similar (or equivalent) operations on lists. i don't need the terminology, but if you're talking about doing several nested for loops and appending your results to a list when there's no need for order and no concern about mutability or redundant results, i *definitely* expect you to identify that several of those characteristics will affect performance.

this is why it's upsetting that self-taught programmers have such a chip on their shoulders and resent university graduates so much. because they feel like their second class status is undeserved but it's shit like this that makes it so richly deserved. if you don't even know about this stuff (let alone understand it deeply enough to make decisions based on it), you sure as fuck aren't qualified to contribute to substantial codebases (and certainly not codebases on which careers rest).
>>
>>52611268
>abloo bloo bloo self-taughts learned to code for free without wasting years of their life learning theoretical garbage and having liberal doublethink programming shoved down their throats
>a-at least they don't know how to calculate a big O!
>this is literally the only thing that makes me more valuable than those freeloading scumbags who didn't start their careers off with 20 years of debt ahead of them
>>
>>52611300
i was really clear that i didn't need people to "calculate" anything. i just want a vague sense of self-awareness.

but this is what i'm talking about - someone who thinks he's a self-taught prodigy overreacting to a post he hasn't even read, but was evidently "triggered" by
>>
>>52611167

>Just how much big O does anyone need?
You need to know what big O is, how different complexities rank, and how to judge what the big O of an algorithm is given a description. That's more or less all you need.

>>52611053
P - Programs solvable in polynomial time by a deterministic turing machine
NP - Programs solvable in polynomial time by a non-deterministic turing machine.

In general, problems in NP can be verified in polynomial time on a deterministic turing machine, but it is not known whether or not they can be solved in polynomial time. An algorithm is called "NP-complete" if it is in NP, and can be reduced in polynomial time to any other problem in NP. That is, finding a solution for it in polynomial time would find a polynomial time solution for everything in NP.

Determining whether a problem is undecidable is done either via a contradiction proof (i.e. the classic "if H thinks I'm going to halt, I'll loop forever, and otherwise halt" proof used for the halting problem), or by showing that it reduces to another undecidable problem (if I have a decider for this problem, then I have a decider for another undecidable problem, therefore I can't logically have a decider for this problem). Proving a problem is decidable requires only that one can show it runs on a turing machine.
>>
>>52611320
what was the point of this thread? do you want a cookie? was someone challenging you personally on this issue?
>>
>>52611320
>>52611053
>>52611268
what the fuck does this shit have to do with programming?

>>>/sci/
Thread replies: 255
Thread images: 28

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.