[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
/dpt/ - Daily Programming Thread
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

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

Thread replies: 336
Thread images: 28
File: gotta go fast.webm (1 MB, 718x404) Image search: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [Google]
1422811183106.png
176 KB, 494x468
>>52608260
>He doesn't know
>>
>>52608260
iOS devs everyone
>>
File: doglang.jpg (410 KB, 876x2350) Image search: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [Google]
lsdft.jpg
138 KB, 640x427
>>52608417
swift
>>
File: fag.jpg (113 KB, 423x590) Image search: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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
>>
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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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.
>>
>>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: [iqdb] [SauceNao] [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: [iqdb] [SauceNao] [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/
>>
>>52611348
>what the fuck does this shit have to do with programming?
this bit:
>there are a number of operations on sets that are much faster than similar (or equivalent) operations on lists
tends to have bearing on reality when you make a decision about whether to use a list or a set or a dictionary.
>>
>>52611357
What if I'm not writing in a scripting language so slow that these sort of decisions actually matter?

If you care about performace, you won't be using python.
>>
>>52611341

Since Anon stated that most anons aren't aware of this, I felt it would be useful to provide an explanation for the uneducated anons.
>>
File: 1369541502746.jpg (432 KB, 740x740) Image search: [iqdb] [SauceNao] [Google]
1369541502746.jpg
432 KB, 740x740
>>52611348
>this guy
>>
>>52611348
>what the fuck does this shit have to do with programming?

Pretty much everything?

>>52611320
>Proving a problem is decidable requires only that one can show it runs on a turing machine.
On a complete Turing machine (one which always says "YES" or "NO" for the language). If it runs on just a Turing machine then it's not decidable / partially-decidable (can say "yes").
>>
If CS majors are so great, how come none of them can program worth a damn?
>>
>>52611357
just use fucking arrays you goddamn pleb

hashmap/dictionary is ok on occasion
>>
>>52611365

The use of a faster language can only improve performance by a constant factor. Granted, it can be very high constant factors, but nonetheless, the point of big O is to talk about "what if the problem grows in size?"
>>
>>52611365
>What if I'm not writing in a scripting language so slow that these sort of decisions actually matter?
these decisions matter in every programming language. a poorly implemented solution written in C can perform worse than a vaguely intelligent implementation written in Python.
>>
>>52611366
that's fair, but any idiot can google these things and read the wikipedia page's introduction, which you didn't give any special insight over.
>>
>>52611384
today's cs major are shit. just do the comparison of sicp with the new mit book.
>>
hey im still novice to programming, took some general C and C++ classes in college. just getting ready to start an online course to learn objective c for iphone app development. my question is how many of you guys have success doing this on non-mac computers? i own all linux and windows machines. do i have to bite the bullet and get a macbook or do you guys have flawless performance from vm's and emulation software on your windows machines?
>>
>>52611384
CS was somehow taken over by large corporations that decided that they didn't want to spend time and money on job training and decided to offload it onto CS programs, and now expect absurdly high levels of experience out of the gate, especially in comparison to literally any other job market.

The only other field I can think of that is this asinine is art schools where they literally refuse to teach you if you're not already a great artist.
>>
>>52611418
Times change, people don't. Go fuck yourself.
>>
>>52611420
you think pedro is gonna become a great artist if only the art school will let him in?
>>
>>52611419
anon, who told you that macs are the optimal platform for programming and virtualization?
>>
>>52611388
this sounds like a construction worker who insists a hammer and nails is all he needs. i'm sure you find ways to get around using screws and shit, but the rest of us just learn how to use them and exercise good judgment.
>>
>>52611443
>iphone app development
>>
>>52611441
if you're already good, why the hell do you need art school?
>>
>>52611441
At least he'll know that he's a failure if it doesn't work out.
>>
>>52611448
it was hyperbole

but most of the time you shouldn't use anything besides arrays depending on what you're doing

don't overuse lists and dicts like a python retard
>>
>>52611429
k tard
http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
>>
>>52611419
Forget apps. Almost everything you want to do in a app, you can now do in a browser. Make a responsive single web page instead.

Use Ionic framework or just Cordova. If you must port the page to a app.
>>
>>52611443
thanks for your reply, i agree i specifically abstain from mac products in general. out of my 6 machines, 2 are linux and 4 are windows based. i am just wondering if to make iphone apps, i need to pony up and get a mac OS machine, or if anyone here can report their experiences if they have stable development from non-mac devices?
>>
>>52611456
you need at least some degree of talent and competence to get in

same with any other field. if you don't know enough math then any decent college shouldn't allow you into STEM
>>
>>52611418
>>52611420
In the span of 30 years, CS went from an "information science" to job training for codemonkeys.

CS at this point needs to be abolished and split into Information Science and Software Engineering as distinct fields.
>>
>>52611478
refer to >>52611420
times change, people don't.
You're assuming that people somehow became stupid because the schools aren't preparing them properly.
Again, go fuck yourself.
>>
>>52611210
>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.
This is the code you posted:
        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;
}
}


You are not creating the list in a separate thread.
>>
>>52611384

Linus Torvalds and Ken Thompson both have CS degrees, and both are excellent programmers. Your argument is invalid.

>>52611409

Yes, but most idiots are lazy and won't google it. So why not bring the knowledge to them?

>>52611419

If you want to do iOS development without Mac OS X, you're going to have a bad time. That said, you don't need a Mac to run Mac OS X. You just need one to run it legally, and even that's debatable if you slap an Apple sticker on it (because then, by definition, it carries Apple's branding).

Of course, whether or not you use a Mac to make the application, you still have to pay Apple $99 a year just to develop for their platform, and they reserve the right to not distribute your program in their App Store, effectively making it useless on any device that isn't yours (unlike on Android, where you are fully at liberty to ship an .apk to people without going through the Play Store).
>>
>>52611487
americans are stupid as hell and it's getting worse and worse each generation
>>
>>52611484
>same with any other field. if you don't know enough math then any decent college shouldn't allow you into STEM

Most CS students these days are gamer faggots who think that they'll like computers because they spent their whole childhood in front of one.
>>
>>52611497
Communication is getting better. All you're seeing is light shining on stupidity that was always there.
>>
>>52611494
I am now.
        private async void txtSearch_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
{
List<MovieObject> tempList = new List<MovieObject>();
if (txtSearch.Text != "")
{
string searchText = txtSearch.Text;
await Task.Run(() => { tempList = MovieList.Where(x => x.MovieName.Contains(searchText, StringComparison.OrdinalIgnoreCase)).Select(MovieObject => MovieObject).ToList(); });
lstMoviesView.ItemsSource = tempList;
}
else
{
lstMoviesView.ItemsSource = MovieList;
}
}
>>
File: cs.jpg (1 MB, 1904x4706) Image search: [iqdb] [SauceNao] [Google]
cs.jpg
1 MB, 1904x4706
Why are you not a programming literate, anon ?
>>
>tfw you want to study CS so bad
>calculus is a prerequisite

whyyyy
>>
>>52611471
you're walking a very fine line given that the other posts were clearly in earnest (or they were someone else, in which case you should really clarify that because you just melted in with a retard).

Python has only a small handful of container types built into the default namespace. trying to simplify them to simplify your decision-making process is mind-boggling. like i said, just have a vague sense of this fucking shit. stop fucking fighting it like a lazy kid with special needs.

the "don't overuse ____" advice is like saying "hey, do the right thing" - it's meaningless absent a clearer criteria. given sufficiently varied tasks, a programmer writing code in python will have some occasion to use lists, dictionaries, sets, counters, deques, tuples, etc...

you don't need to know all of this stuff inside and out right now, but you should have a vague sense that lists are somewhat inefficient and that, given a number of requirements, other containers might be better fits.
>>
>>52611517
>await
I don't think this code does what you think it does.
>>
>>52611520
and its always the hard calculus too
>>
>>52611419
it'll probably be tolerable to run a vm if you have 16+ GB ram

if you're going to do professional work you're probably better off buying an actual mac
>>
>>52611496
thank you, looks like i will have to pick up a cheap mac for this project
>>
>>52611532
I'm pretty sure it does, It dumps that task onto a new thread, completes it asynchronously before stepping down to the next line.
It's fast enough to not need to be an async operation but it is anyway to prove that it isn't causing the issue.
>>
>>52611530
yeah that was someone else lol
>>
NEW THREAD!

>>52611552
>>
>>52611496
>why not bring the knowledge to them?
because like i said before, understanding the most basic framing of the topic is *almost* worthless. the complexity class issue is a perfect example; i certainly expect someone to be able to give me a short explanation of what this is (i don't need a perfect answer, just a vaguely working definition), but the next question is invariably going to be about implementation and stuff.

giving someone this extremely superficial explanation is akin to helping someone fill in the bubbles corresponding to the spelling of their name on a standardized test scantron sheet. you've gotten them through the door, but they're clearly in the wrong place entirely if they needed you to explain that at all.
>>
>>52611548
Yeah, but it waits, it waits in the same function where you are assigning to lstMoviesView.ItemsSource, making it pretty much the same thing as
string searchText = txtSearch.Text;
tempList = MovieList.Where(x => x.MovieName.Contains(searchText, StringComparison.OrdinalIgnoreCase)).Select(MovieObject => MovieObject).ToList();
lstMoviesView.ItemsSource = tempList;
>>
>>52611534
aside from 3D programming and physics simulation, what else requires heavy math?
>>
>>52611556
Fuck off, holy shit the thread isn't even at 300 yet
>>
>>52611520
>grad school in CS
>never took calculus
¯\_(ツ)_/¯
>>
>>52611567
anything involving statistics
http://research.microsoft.com/pubs/70092/tr-2004-92.pdf
link related: Half linear algebra, half statistics.
>>
>>52611520

You will likely never make much (of any) use of Calculus in CS, but the idea is to keep the people who can't handle math from joining the major. Best of luck to you though. Calculus isn't really that hard.
>>
>>52611567
Well, 2D programming.
AI related stuff.
Clustering and classification stuff.
>>
>>52611567

Cryptography and Natural Language Processing both are fairly heavily math-oriented... although the former is more number theory focused, and the latter is more focused on statistics. Neither of them really focuses on Calculus.
>>
>>52611567
music/sound programming
>>
>>52611565
Well no, that's wrong.

That task is entirely alone, everything contained within that line is run on a seperate thread, and the next line of code isn't run until that task is completed.

So it only sets the "MovieList.ItemsSource" when the list has finished being built.
>>
>>52611520
https://www.quora.com/What-topics-in-Computer-Science-make-use-of-Calculus
>>
>>52611611
>next line of code isn't run until that task is completed.
Exactly. The execution is halted until the list is created -- both in your snippet, because you use await to halt execution until thread finished, and in my code, because I don't use a separate thread at all.
>>
>>52611633
Ah so it keeps treading over itself?

What would a better way to implement live-updating the list from the contents of the textbox?
>>
>>52611633
>>52611611
>>52611650
> An await expression does not block the thread on which it is executing. Instead, it causes the compiler to sign up the rest of the async method as a continuation on the awaited task. Control then returns to the caller of the async method. When the task completes, it invokes its continuation, and execution of the async method resumes where it left off.

Okay, looks like I am mistaken here. Await does work exactly as you describe it, or at least that's what docs say.

Try adding OrderBy and limiting result count to 10, just to see which part is producing slowdowns - assigning to ui or producing the list.
>>
>>52611661
>>52611650

No I think you might well be semi-correct.

Because each time I press a key I could well be creating the list still.

(Even though it really doesn't hang at all when entering text, but when I start removing letters it becomes more of a problem, and clearing the box entirely causes the biggest hang)
            else
{
lstMoviesView.ItemsSource = MovieList;
}
>>
>Cshart
>>
mods deleted the trap thread
new thread

>>52611684
>>52611684
>>
File: wanted-wizard.jpg (98 KB, 600x480) Image search: [iqdb] [SauceNao] [Google]
wanted-wizard.jpg
98 KB, 600x480
>>52608260
time to switch to superior GNU/Software
https://gnu.org/s/gmp
>>
>>52611680
Oh. Well, that's simple. You need to apply the filter not when the user changes contents of list, but about 300 milliseconds later. And if during that period user changes contents again, you postpone filtering to 300 ms from current time again.
>>
>>52611680
Because you're querying every time there's a change.
In reality, text fields don't remove assloads of characters at the same time.
They remove them one at a time. Very quickly.
So if your query was ABCD..XYZ, and you cleared it, you'd perform the query about 26 more times.
>>
>>52611704
Simple enough to do using a dispatch timer, but on the other hand it won't fix the issue of loading more data than is currently displayed being a big hang-fest.
>>
>>52611739
So the hang is reproducible when there's one character in text box and you delete that character?
Again, try limiting result count manually, see if that helps.
>>
>>52611179
You only need to control the stupid to control everyone because the stupid are the majority and the majority rules what is and isn't accepted in a society.
>>
>>52611760
It seems to be purely based on the number of items it returns, the more items, the more of a hang.

going from 1 result to the full list is easily a second and a half lockup.
>>
>>52611784
Well, do paging manually then. Don't show more than 50 results at a time.
>>
>>52611784
>>52611804
lmfao kill yourselves Csharts
>>
>>52611839
is there a problem
>>
>>52611843
Csharts are the real codemonkeys, not first-world java devs
>>
>>52611894
You seem upset.
>>
>>52611784
Okay, here's something that might be very relevant to your problem: http://stackoverflow.com/questions/9584547/datagrid-sorting-very-slow-when-itemscontrol-also-binding-to-the-same-itemssourc
>>
File: american.png (208 KB, 1280x616) Image search: [iqdb] [SauceNao] [Google]
american.png
208 KB, 1280x616
>>52611894
>codemonkeys fighting about who is the bigger codemonkey
>>
File: That font.jpg (18 KB, 300x257) Image search: [iqdb] [SauceNao] [Google]
That font.jpg
18 KB, 300x257
Does anyone know what kind of font this is, or where I could find a similar one?
I want it for my IDE bad.
>>
>>52612084
http://laemeur.sdf.org/fonts/

it's pretty shit tbqh fampai
>>
>>52612084
I think it's called fixedsys.
>>
>>52608260
You need to use a bigdecimal class.
This is why everyone thinks calculators are shit easy, actually try to implement decimal entry properly and find out that even double precision is useless.
>>
>>52611192
Literally first result for "hacking balaclava"

https://www.youtube.com/watch?v=sUtoxEZvPyY
Thread replies: 336
Thread images: 28
Thread DB ID: 475533



[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | 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.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.