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

>make 4chan picture downloader in C# >application is 'not

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

Thread replies: 19
Thread images: 1

File: 1477060164617.jpg (61KB, 1000x800px) Image search: [Google]
1477060164617.jpg
61KB, 1000x800px
>make 4chan picture downloader in C#
>application is 'not responding' while downloading the pictures
how do I make it that the application stays responsive at all times /g/?
>>
Have the downloading be done in another thread
>>
>>59427375
>One process, several threads
>>
Download on something other than the UI thread.

https://www.google.com/search?q=C%23+threading
>>
>>59427388
>>59427392
>>59427393
thanks /g/uys, will try it out.
>>
>>59427375
Didn't you pass 1st year CS?
>>
>>59427375
Task.WhenAll() is your friend
>>
Async.
>>
>>59427375

Another thread you dumb Pajeet
>>
>>59427375
How the fuck is it possible that you dont know about threads?
>>
dumb winbabby

4dl() {
board="$(printf -- '%s' "${1:?}" | cut -d '/' -f4)"
thread="$(printf -- '%s' "${1:?}" | cut -d '/' -f6)"
wget -qO- "https://a.4cdn.org/${board}/thread/${thread}.json" | jq -r '
.posts
| map(select(.tim != null))
| map((.tim | tostring) + .ext)
| map("https://i.4cdn.org/'"${board}"'/"+.)[]
' | xargs wget -U 'Mozilla/5.0' -nv
}

requires jq as a small dependency
>>
>>59427375
... why? for the challenge?
Firefox + img2tab does the job just fine
>>
>>59428490
>>59428603
I didn't study CS, I'm just doing it for the fun.

>>59428638
I don't care about your shit using the 4chan api
>>59428661
yes I wanted to see how hard it was to make a little gui application in C# that would download the pictures in a thread
>>
>>59428603
I'm a 4th year "CS" student and 9/10 of my classes were beginners courses in various languages. C, Cpp, Java, Javascript, Python, C#. I simply only know basics and they give me a degree next month.

I wouldn't have fallen for the uni meme if I didn't get a full ride.
>>
>>59427375
If you have 4chan x this is already possible. You just need to expand all images in the thread and then press ctrl+s to save the webpage. All images will appear in the webpage folder
>>
>>59428686
>not using the api
>being a contrarian fag just because
fuck off
>>
>>59429012
modern programmers are faggots. too lazy or stupid to do their own so they use frameworks and paste from stackoverflow
>>
>>59427375
>uses C#
>doesn't even know about async await
>>
>>59429012
I asked for advice on howto improve my C# program, not some shitty bash trash so you can fuck off to your own thread.
Thread posts: 19
Thread images: 1


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

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


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