[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: 29
File: 1449091772190.jpg (376 KB, 2500x1000) Image search: [Google]
1449091772190.jpg
376 KB, 2500x1000
Old thread >>51790693
>>
>>51793974
I just started using WPF after spending ages using WinForms like a moron might do.

I want to animate a transition that occurs when you press a button.

I want the controls currently on the window to fade out (which I can do) and then have another set of controls fade in (which I can also do).

However I want to animate a transition between two window sizes, with a vertical and horizontal change. This I have a problem with. Everything I find on StackOverflow seems to be a massively overcomplicated mess to achieve what I assume to be a relatively simple goal (because you're just doing a DoubleAnimate properties) but that doesn't seem to work.
>>
>>51793974

I'm learning C as a almost-complete-beginner to programming and computers. Just brushed up on memory systems and software to refresh my memory. Also messed around on CodeBlocks after learning stuff about statements, functions, conversion characters and arrays.

Chose C to begin with as it was what I was told as the best first language by several people.

My question is; any good complete beginner learning resources and any suggestions for a good active forum for learners?
>>
Local business might want to upgrade their site / get a new one to add eCommerce features and also maybe phone apps. Someone on here has to do freelance web related things, how much would you charge?

I googled and got some outrageously high numbers for these.
>>
>>51794056
>Learning Resources
>Active forum for learners

Have an idea for something, begin work on that thing in earnest, when you want to achieve something you don't think you can achieve on your own, Google it. If Google turns up no useful results (which it absolutely should 99 times out of 100, assuming you're know how to Google), then either post here or on stackoverflow.

>>51794067
How much is your time worth? Look at some local prices and adjust accordingly. Also get a contract of some kind written up before you start working, I'm sure there are some templates online that you can use.
>>
/g/ be straight with me

I've been having some personal issues at home and couldn't study a lot for the past month

I'm doing a java final with a bunch of stuff on GUI but I know jack about GUIs

What are the odds I can get an 80% on it if its an open book, open note, open internet exam?
>>
too early desu
>>
>>51794051
>Everything I find on StackOverflow seems to be a massively overcomplicated mess to achieve what I assume to be a relatively simple goal

Because WPF, like everything related to .NET, follows the paradigm of "have a gigantic pile of features and hope the programmer can figure out how to piece them all together into something usable".

Just use Tcl/Tk.
>>
If I were using Lambda-styled LINQ expressions, how might I iterate over a list of other objects within an object?
I.E. ObjectA has property List<ObjectB>
ObjectB has property string Name

How would I iterate through them to find whether or not the list in ObjectA contained an ObjectB with a Name of Richard Stallman?
>>
>>51794056
>C
Just a waste of time baka desu senpai. Go with Java or C++ if you're feeling like a faggot.
>>
>>51794051
I like WPF. After my foray into web dev, it is very similar to some web frameworks. My biggest issue with WPF is it'll never come to Mono, because Microsoft will never play ball with FOSS communities.
>>
>>51794056
http://www.catb.org/esr/faqs/hacker-howto.html#skills1
>>
>>51795467
>because Microsoft will never play ball with FOSS communities.
You know MS works really closely with mono right? They fix bugs regarding their frameworks to make them work better on mono.
Also CoreCLR is MIT licensed. ASP.NET is full open source.

The only reason WPF won't ever work on linux is because it's deeply ingrained with platform specific stuff on windows, and it would be a giant cluster fuck to port.

Moonlight exists though, which was made with MS's blessing.
>>
>>51795531
There's also always GTK#.
>>
I made a (shitty) battery monitor
I'm not very experienced (or good) at scripting

#!/bin/bash
isCharging (){
if [ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] ; then
echo "1"
fi
}

while true; do
bat=$(acpi | cut -d',' -f2 | grep -o '[0-9]\+')

if [ "$(isCharging)" != "1" ]; then
if (( "$bat" <= "15" )); then
notify-send -u critical "Battery Low" "Your battery is at $bat%. Please connect it to the charger."
sleep 2m
else
sleep 2m
fi
else
sleep 5m
fi
done
>>
>>51795441
You might need two for loops to do this.

>>51795531
Moonlight isn't being developed :(

And I want WPF, I like it, I just don't want to lock everything I write in it on Windows. ASP is on mono, yes, but importing projects written on Windows into monodevelop always fails, its as if it's both open source and available on multiple platforms, but its not really cross platform.

>>51795573
Eh.

GTK is notorious on Windows, I bet the GTK devs are on some level deliberately uncaring about GTK bugs on Windows (because lolwindows), but that kind of shit is why Windows kids don't consider libreoffice a suitable replacement for Microsoft office. Libreoffice is perfect on Linux, the bugs on Windows are clearly not from the Libreoffice devs.
>>
why isnt u writing a botnet in c++ rn /g/?
>>
>>51795888
well, /r9k/?
>>
>>51796148
too busy jerking off
>>
lol why did other thread get delete
>>
>>51797095
Because this thread was first, obviously.
>>
>>51795650
not even sure this should be here desu
>>
>>51794051
>after spending ages using WinForms like a moron might do.

Winforms is good, though.
>>
This thread was illegitimate to begin with. Nice one janny.
>>
>>51795840
I wouldn't say its perfect. It's UI is horrendous and that's something no Linux developer seems to know how to deal with.
>>
In python, how would I be able to subtract a number, say 5, from a byte, and if it's negative return its two's compliment value?
>>
>>51793974
what the fuck
the other thread had 106 posts
this has 25
this one was made way before the old thread even hit the fucking bump limit
whatever, janny knows best
>>
File: 1444589850059.jpg (74 KB, 640x640) Image search: [Google]
1444589850059.jpg
74 KB, 640x640
>anime /dpt/ - 105 replies
>this shitty thread - 20 replies

Thanks, hotpocket warriors, for deleting the actual /dpt/ with 4x more posts than this one.
>>
>>51797140
UI is highly subjective, I much prefer it over the bulky ribbon. The thing about UI design is that everyone has their opinion and everyone wants to pick on FOSS devs about aesthetics. It really just comes off either as pretentious or autistic.
>>
>[Deleted]
>>
File: 1446877033659.jpg (77 KB, 487x459) Image search: [Google]
1446877033659.jpg
77 KB, 487x459
Literally no fun allowed.

I don't even feel like programming anymore.
>>
Daily reminder that Julia is more elegant than any Lisp and runs much faster.
>>
Reminder to be referentially transparent!
>>
>>51797332
daily reminder that this will always be posted whenever julia is mentioned
http://danluu.com/julialang/
>>
>>51797348
>Update: this post was edited a bit to remove a sentence about how friendly the Julia community is since that no longer seemed appropriate in light of recent private and semi-private communications from one of the co-creators of Julia.
Every time
>>
>>51797332
Daily reminder that Julia is trying to match compiled language speeds to be an all-in-one language, which is stupid. We have compiled languages that can run in interpreted mode like Go, D, Swift, Haskell, Ocaml, these languages should be used as scripting languages
>>
>>51797300
janitors confirmed for radical luddites forcing people to be anti-/g/
>>
>>51797348
>http://danluu.com/julialang/

> Bugs from 2013
Wayyy out of date

> Whole blog post ranting about error handling
Pure trash.

> Doesn't like the APIs
%100 Retarded. Multiple dispatch makes the APIs LITERALLY the same across types.

> I couldn't get it to compile
Why even pay attention to this idiot in the first place. Did you actually read it?

If you read any of that guy's stuff you can see he is a whiny do nothing who only knows how to make a blog that looks like it is from 1995.
>>
The mod is incompetent and doesn't even know how to use the catalog search function. Great job.
>>
>>51797385
> Swift, Haskell,

Those don't actually run at the speed of C.

Also none of those languages are the same as Julia at all. Their interop with C, their package management, multiple dispatch etc.

You can't prototype image filters in haskell bro.
>>
Is there any benefit of Fortran over C/C++?

Some retarded idiot in /biz/ was talking about >muh Fortran muh best language
>>
File: Capture.jpg (35 KB, 1548x84) Image search: [Google]
Capture.jpg
35 KB, 1548x84
>parallel programming in c#
>can't even convert binary to ascii using parallel
jesus christ what a nightmare.

what does this even mean?
>>
>>51797498
no one would use C or C++ for serious scientific computing, all the screwball gotchas that are involved are only for systems programmers and not people who do precise calculations
>>
>>51797532
Can't you just use python or matlab or something then?
>>
>>51797498
No. People always say 'no aliasing' and that Fortran will be faster.

Cache locality matters 100x more than this. If you do your heavy stuff in linear memory chunks, it will be fast.
>>
>>51797517
>parallel programming exercise
>100% serial problem
What the fuck
>>
What can C++ do that C# and .net can't(and vice-versa)?

What are major differences, both positive and negative? I'm writing a 500 word essay on this topic.
>>
>>51797483
>> Swift, Haskell,
>Those don't actually run at the speed of C.
yeah, they actually do, there is nothing magical about C, its just another high level language, it has to use the same kind of compiling optimizations any language would use. Any languages speed depends on the skill of the compiler writer, any high level language can be made to run 'as fast as C', C is not the fastest compiled language, thats a meme
>>
File: 1444178594091.jpg (36 KB, 300x360) Image search: [Google]
1444178594091.jpg
36 KB, 300x360
>>51797556
kill me.

I really need this grade too, but i'm clueless.
>>
>>51794301
you will be fine, swing awt fx ?
>>
What could I be doing wrong?
my day 5 part 2 solution matches all the requirements yet my answers are too low.
>>
>>51797576
Pointer arithmetic
>>
>>51797544
not for heavy number crunching that is done on super computers
>>
>>51797498
Probably in the heavy maths area. Fortran is still unparalleled there..... but since it's good math functionality had gotten wrapped in easy to use c c++ c# python and ruby libraries.... you don't need to touch it yourself unless you're REALLY bored.

>>51797385
So, you know those languages you mentioned? Compiled vs interpreted is an implementation detail. Haskell can be compiled, or interpreted. C can be (not many interpreters out there exist, but since do). Lisp can be compiled or interpreted, often both in the same runtime. Even qbasic had a real compiler.
>>
>>51797589
Is that it?

Why is that important if it eliminates the need for pointers?
>>
In an excel table(.xls) where there are 3 rows and 5 columns, can I make an array where I can change values by pointing where I want them?

excelsheet[3][5];

testbook << excelsheet[0][3] << "0.432";

I tried to do that thinking that it will change the data to that, but it just creates a new excel sheet and it inserts it in the first row of the first column.
>>
>>51797576
C++: better theoretical efficiency (assuming the programmer even knows how to achieve this - most don't), better traceability, better function pointers

C#: garbage collection, elegant syntax including lambda expressions, faster overall development for almost any application.

Basically it's a question of what's more valuable: your computer's time or your programmer's time.
>>
>>51797611
C# hasn't found some clever way to get rid of pointers, it did so by sacrificing speed
>>
>>51797606
>Compiled vs interpreted is an implementation detail.
thats right, so why would you use a language like Julia that can only run interpreted when you have languages like Go, D, Swift which can run both interpreted and compiled?
>>
>>51797579
Undefined behaviour makes C inherently faster than most other languages.
Sure, other languages CAN be faster than C, but in practice, they're not. Most of the time when other languages benchmark faster than C, it's because some sort of computation was actually skipped or it's something that is very difficult to represent in C.
>>
>>51797579
> yeah, they actually do, there is nothing magical about C

No they actually fucking don't. There is nothing magical about C, but there is a lot of shitty overhead in both of those.

Haskell has garbage collection and allocates lots of memory on the heap as well as using linked lists for everything which destroys its potential performance.

The 'compiler writer' idea is CS101 kiddy stuff since it's irrelevant anyway. Haskell has been heavily optimised over 15 years and they still used linked lists.

Fucking failure.

> C is not the fastest compiled language, thats a meme

C++ and ISPC are the fastest compiled languages realistically because of function inlining in areas that C can't, like function pointers.

What language do you think is faster? Whatever shit you are using to avoid learning C++?
>>
>>51793974
Still working on porting my application framework to Cocoa.

>>51797611
Pointer arithmetic allows you to take shortcuts in your memory addressing that can't be done in languages that use references instead.
>>
>>51797579
You have no idea what you're talking about.
>>
>>51797640
Different tastes? Some people like it. Some people like getting fucked in the ass as well. Not my thing, but hey. More power to them.
>>
>>51794112
>>51794056
Thanks dude.

I meant more in the area of basic tutorials for absolute beginners. Any suggestions?
>>
>>51797623
>Basically it's a question of what's more valuable: your computer's time or your programmer's time

Seems pretty fine considering I don't need 2.34 seconds faster code execution with what the average modern computer is like nowadays. Plus it's not like I'll even get my code to that point as a beginner without what feels like 10 years of exp in C++.

>>51797630
>>51797663
What is more recommend for beginners? C# or C++?

I messed about with C and then C++ for a while but I'm growing to dislike it a bit now and wish for something a little easier, particularly for windows programming. Should I hop on over to C#?
>>
>>51795444
>Just a waste of time
>despite being the best first language to learn

M8 do u no wot ur even talkin about
>>
>>51797688
C++

its used widely by a lot of people so finding help is never an issue

but i wouldnt recommend Canything as a first language for an absolute beginner
>>
>>51797659
sry, but you are just spouting hearsay, there is nothing about the heap that slows down a compiled language, the fact that Haskell uses immutable abstractions like link lists doesnt slow it down either.
>>
>>51797707
I fucking love Haskell but you are seriously retarded
>>
>>51797688
>Seems pretty fine considering I don't need 2.34 seconds faster code execution with what the average modern computer is like nowadays
God damn I hate people with that fucking attitude. With slower execution time comes more power draw meaning shit like my cellphone gets worse battery life.
Also, why not run efficient programs on faster hardware? That way shit is even faster.
>>
>>51797700
>its used widely by a lot of people so finding help is never an issue

C# doesn't seem any less used... In fact it's easier to use because everything is built into the framework.
>>
>>51797688
It's really not difficult to write efficient code

You just can't take all the cushy shortcuts and sweep things under the rug to be garbage collected like modern languages encourage you to do, so there's a lot of unlearning involved for most people
>>
>>51797717
>>51797737
>Also, why not run efficient programs on faster hardware? That way shit is even faster.

Because it's unfun for new programmers to write code 10x longer and more frustratingly just for a slight few percent performance increase.
>>
>>51797743
This

In 2015 the last thing people learning programming want to do is handle strings in C,
>>
>>51797707
I'm apathetic about Haskell and you are seriously retarded.

Try actually trying to speed something up sometime. Try profiling.

Heap allocation is fucking slow when it is done frequently, not to mention that it blocks when allocating from the global heap.

Linked lists are fucking slow. Pointer chasing is fucking slow.

You have no idea what you are talking about.
>>
>>51797797
I mean C/C++ are great languages but for beginners it's pretty much "No fun allowed: the language" unless you have 10+ years of experience and know the complete inner workings of the libraries you're using and the language in its completeness.

Debugging shit for 2 weeks and wondering why some retarded thing won't work when you could be creating a cool new part of your program, or an entirely new project just plain isn't fun.
>>
>>51797836
Sure. Except when someone else actually uses the software you write. Then it's not fun for them.
>>
The comparison between language speeds seems dumb.

In my domain, most of the time spent is waiting for disk reads or slow network I/O. If you're waiting for disk, it doesn't matter which language is waiting for the disk.
>>
>>51797836
>college is focused on engineering and tech
>all engineers have to take intro to prog
>its only c++
>have to do a fucking final project in only c++
>have minimum line and complexity requirements
IT SUCK SO FUCKING MUCH
especially when we get to take java or python later if we want to
>>
>>51797858
Yes those half seconds extra are really important.
>>
Yes, it's horrible and not finished, but it's my like 5th website and I played around with javascript this time.
http://a.catgirlsare.sexy/tpki.html
>>
>>51797858
>Sure. Except when someone else actually uses the software you write. Then it's not fun for them.

A tiny amount of performance, that a newbie programmer wouldn't even be able to make use of most likely is irrelevant.

That also doesn't include the fact that they could easily fuck up their code in 100000 ways and cause memory leaks, buffer overflows and other shit.

So really you have more to lose using C/C++ than not using it, as a beginner anyway.
>>
>>51797859
>In my domain, most of the time spent is waiting for disk reads or slow network I/O

This.

the languages aren't that much slower in 99% of cases that it even matters, or is noticeable.
>>
>>51797859
What trivial domain is this and why don't you use a faster disk?
>>
>>51797870
>minimum line count

throw it in the fucking garbage.
>>
>>51797912
that really really depends on what youre working on

for hobbyists? definitely doesnt matter

professionals who have careers and work on critical software? yes it does, but in that case you'll usually have management dictate what language to use
>>
>>51797817
you have a fizzbuzz level understanding of what programming optimization are. the people who write Haskell compilers use permanent immutable data structures that happen to take up a lot of heap space. you making simplistic beginner level assumptions that Haskell has to make heap allocations all the time which it doesnt
>>
File: 1440049878650.gif (303 KB, 250x141) Image search: [Google]
1440049878650.gif
303 KB, 250x141
Never posted here before; I am going to take a "ANSI C" and a "Intro to Java" class at a community college to fulfill some CS credits for another degree that I can get with my main degree.

I used to make stuff as a kid in game maker and flash but I'd always stop working on them when they became too "duct-taped". I didn't like waiting then and I don't like waiting now lol.

I want to ooo and aaa the professors with a simple game that can be slightly customize-able. I know how to use expat, does XML work as a scripting language for a game? That's what Kero Blaster seems to have for its scripting. I don't know Lua or JS at all, but on a scale of 1/10, how hard would it be to learn one of them and put it into both/either an ansi c/java application?
>>
>>51797885
>>51797894
This is the reason we have computers that are 1000x as fast and software that is 1000x as slow. You think it is a second or two because all you've done is read a text file and parse it.

The truth is that the difference is orders of magnitude.
>>
>>51797922
i'm doing a text based game specifically just to fuck with that
>>
>>51797929
>that really really depends on what youre working on
>for hobbyists? definitely doesnt matter

That's my point though.

Most are hobbyists or will not go on to make highly specialized programs that are incredibly performance-dependent. For hobbyists it makes no sense really,

>professionals who have careers and work on critical software? yes it does, but in that case you'll usually have management dictate what language to use

Yup.
>>
>>51797952
*tips fedora**
>>
>>51797952
>This is the reason we have computers that are 1000x as fast and software that is 1000x as slow. You think it is a second or two because all you've done is read a text file and parse it

Sure but I'm saying for beginners it's a nobrainer.

Do you really want beginners to be writing easily vulnerable programs and missing a couple dozen overflows and memory leaks all over the place?
>>
>>51797935
Oh my god are you seriously going to keep at this?

I literally optimize things down to the level where 256 bit AVX instructions and fused multiply add make a huge difference.

Please go and actually run some real tests then come back here so you don't humiliate yourself.
>>
>>51797651
>Undefined behaviour makes C inherently faster than most other languages.
no it doesnt, the reason that C has so much undefined behavior is that makes C non-conformist to any kind of programming constructs which is what makes C always the default systems language and C the best language for writing compilers. safety rarely if ever costs anything except in rare occasions that bounds checking is done, and that can usually be turned off so that it will run as fast as any 'unsafe' language
>>
>>51797995
Shut up fag I literally write all my programs in machine code
>>
>>51798013
shut up retard i write all my programs using punch cards
>>
>>51798020
I literally write all my programs using those playground counting toys where you slide the rings.

Each ring represents one bit.
>>
File: cuck nigger c.png (63 KB, 449x498) Image search: [Google]
cuck nigger c.png
63 KB, 449x498
>people hate C now
this is what happens when you delete anime /dpt/s guys
>>
>>51798032
abacus
>>
tfw don't know how to write data onto an excel file
>>
>>51798032
>not using classrooms full of children that write either 1 or 0 on a piece of paper
get the fuck out of /g/
>>
File: vKCjFLN.jpg (46 KB, 580x342) Image search: [Google]
vKCjFLN.jpg
46 KB, 580x342
>>51798013
Oh you don't escalate the privileges of the processor and write in architecture specific microcode?
>>
>>51798032
It's called an abacus m8, and thats how people used to do calculations a long time ago.
>>
File: 1438771473501.jpg (12 KB, 251x242) Image search: [Google]
1438771473501.jpg
12 KB, 251x242
self.next_table_address(index)
.map(|t| unsafe { &*(t as *const _) })


>Rust syntax
>>
>>51798036
>Liking C

Anyone who has progressed beyond making fizzbuzzes and programs <100 LOC dislikes it.
>>
>>51798062
People still do, real well, there are competitions and whatnot.
>>
>>51798072
90% of my CS/CE professors fucking love it
>>
>>51798036
All of the C++ and D memers have really shit this place up.
>>
>>51798082
>90% of my CS/CE professors fucking love it

Because they worked in Academia their whole lives and are 70 years old.
>>
I don't understand why we all haven't switched to Rust yet.
>>
>>51798072
I don't know, not to toot my own (rather inadequate) horn but I've done a couple 5000+ loc projects in just C and I enjoyed it pretty well.
>>
>>51798104
>implying
most of them have had 30+ year careers
one of them spent like 25 years at bell labs from what i know
>>
>>51798109
because Brenden got fired so it was never used for what it was intended for
>>
>>51798124
Bell Labs is academia
>>
>>51798070
This is part of my advent day 2 solution
let cube: Vec<u64> = string.to_owned()
.split("x")
.map(|s| s.parse::<u64>().unwrap())
.collect();
>>
How easy/hard is it to make a python/c* program that grabs stock price and daily fluctuation by Ticker and inputs it into an Openoffice meme spreadsheet?
>>
>>51798097
Yeah, now there are people here who write actual software.
>>
>>51798141
He did fucking work on AI at bell labs and you're telling me his opinion on C is invalid
>>
>>51798036

Thank you. I've been waiting forever for someone to repost that OC.

Pass it on.
>>
Can I use a char like a boolean since it's only a single byte?
if i set a char ch to integer 1, would it evaluate to true?
>>
>>51798159
Your reply implies Bell Labs isn't academia
>>
>>51798151
Think of the two there are only C* libs for openoffice, I know stock prices in python is ezpz though
>>
>>51798151
well /fa/m?
>>
>>51798173
just like any other tripfag, it's important everyone knows HE made it
>>
>>51798182
>I know stock prices in python is ezpz though

How ez is it?

Do I have to use gay ass beautifulsoup?(i don't wish to)

And what libs for openoffice for c*
>>
how do I use c++ to edit .xml excel files?
>>
>>51798199
Super ez. Use Quandl.

Small project by a few friends:
https://github.com/will-cromar/needy/blob/master/price_parsing.py

>>51798217
google "C++ xml library"

Google for open office you pleb
>>
>>51798199
just write a csv, openoffice can read them
>>
>>51798196

It is important.
>>
File: 1425017046545s.jpg (5 KB, 250x248) Image search: [Google]
1425017046545s.jpg
5 KB, 250x248
>forced group work
>design a web application
>group agrees on me making a schedule
>nobody follows the schedule
>more than half doesn't even know sql
I swear to fuck if fail this project because these degenerates have no idea what they are doing.
>>
File: 1445311716435.jpg (95 KB, 724x720) Image search: [Google]
1445311716435.jpg
95 KB, 724x720
>>51798323
>Frogposting
>Webdev
>>
>>51798323
Don't forget:
>group assignment due in mere days
>they stop reporting in
>you track them down
>"oh we're just gonna drop the class, sorry"
>it's too late to do it all yourself
>>
>>51798357
And people are worried about not finding jobs when this is the next generation of programmers.
>>
>>51798357
>mfw they didn't drop the class
>they just stopped working on it
>it was due yesterday
FUCK.


>>51798353
it's asp.net, so not pure webdev. What do you take me for, a cis major?
>>
File: 1449623310442.jpg (720 KB, 2130x3576) Image search: [Google]
1449623310442.jpg
720 KB, 2130x3576
>>51798381
>it's asp.net, so not pure webdev
>>
>>51798381
So you're a Microkek AND a webdev?
God damn.
>>
>>51798381
>ASP.NET
>Not webdev

Huh?
>>
>>51798408
I mean, you could do the whole thing in xml...
>>
>>51798398
Asian women are seriously the pinnacle of beauty
>>
File: vomit.jpg (90 KB, 650x650) Image search: [Google]
vomit.jpg
90 KB, 650x650
>>51798435
>XML
>>
>>51798232
>>51798217

I meant through visual studio c++
>>
Question for C++ concurrency guys;

In Java, it is possible to unlock a lock using a finally clause to prevent deadlock in case of a thread crash
someLock.lock()
try{
//...
} finally {
someLock.unlock();
}


Since C++ does not have a finally clause, what functionality allows us to prevent deadlocks that occur through thread crashing?
>>
>>51797963
No you don't understand, if I end up writing code for a space probe or a cell phone then I need absolutely as much performance as possible, and since I'm on /g/ it simply cannot occur to me to ever learn more than 1 language.
>>
>>51798472
You open the file in Visual Studio. XML is a supported file type.
>>
>>51798501
cell phone programs are written in swift or java m8
>>
File: saturn.webm (2 MB, 688x690) Image search: [Google]
saturn.webm
2 MB, 688x690
Bored and can't come up with any project ideas, so revisiting some old projects for inspo I guess. I miss working on this lol
>>
>>51798472
Look up the Microsoft Office Open XML SDK.

Be warned, it is not for the faint of heart. The SDK lets you do pretty much anything you could do through Excel (want to create a conditional style that changes the color based on the current value returned from a web service? No problem!). The flip side of this is, creating even a simple document can require 45 metric shit tons of boilerplate code.

I actually wrote a 'generic DataTable to XLSX exporter routine' for someone a few weeks ago. Want to just dump all the data as strings/TEXT? No problem, 20 lines of code, done. Oh, you want to support DATE columns? Now you have to create the package, the workbook, the worksheet, the sheetdata, a numbering format, a cell format, a cell style...

There are probably some NuGet packages out there to try and tone it down.
>>
>>51798558
>command line

your next project is to use gooeys
>>
>>51798558
Here, have something actually difficult.

http://socalcontest.org/current/index.shtml

Can't help you if you enjoy software engineering over algorithms and math though.
>>
>>51798580
guis are lamo
only reasonable way to write a gui is webdev, which is also lamo
>>
File: 1428250039668.jpg (15 KB, 192x154) Image search: [Google]
1428250039668.jpg
15 KB, 192x154
>>51798599
yeah you are certainly correct! I wouldn't feel like a cool hacker typing lines into a black box like in the movies with a GUI!
>>
>>51798580
>>command line
noice
This project was done a few months ago, I've done some pleb gui shit.

>>51798583
I don't into competition stuff [yet]. I'm pretty noob when it comes to actual programming.
>>
>>51798583
> this website
Is this 1997?
>>
Nothing more satisfying than fixing a really tough bug. Just fixed one at work that had been plaguing me for weeks.
>>
File: 53093739_p0[1].png (286 KB, 800x600) Image search: [Google]
53093739_p0[1].png
286 KB, 800x600
>>51798577
>tfw C#
>tfw EPPlus
>tfw so easy

>>51798624
Get good then.
Each competition always has some dumb crap that basically translate to "do you know how to input/output and basic logic?"

Having said that they always have a really good distribution of difficulty in their questions.
>>
>>51798525

I meant .xls
>>
>>51798666
I'll get good later. Competition stuff doesn't really interest me that much at all.
>>
>>51798498
atomic<T> and pointers?
>>
>>51797471
not only the mod:
https://twitter.com/4chan/status/674859662236385280

looks like 4chan is fucked
>>
>>51798714
Haha

This guy is fucking based
>>
>>51798498
You can use scoped locks like unique_lock but as far as I know if a thread crashes you are out of luck.

I don't know how to handle thread crashes because of course, I never write a program that ever crashes...
>>
>>51793974
>be Network Sec
>people know me as computer guy in family
>rich uncle wants to start payday loaning business
>offers me to write the software for him to mange loans in a database
>could be neat
>offers me 300$ and 50$ a month

What do ? Its easy money but this is my second time writing a production level app
>>
>>51798729
Try multiplicating both numbers by 100.
>>
>>51798729
you better poo in loo
>>
>>51798729
What do you mean what do? Write the software for him to manage loans in a database.
It should be pretty easy.
>>
>>51798619
you cant programmatically run gui programs. sorry m8, cli is too convenient
>>
>>51798729
Your uncle is swindling you. He'll be making thousands off your software. Charge a reasonable fee.
>>
>>51798779
Except you can.
>>
>>51798729
This is a joke right? If you are writing software to manage money the shit is going to hit the fan.
>>
>>51798797
If you want to automate the usage of a GUI program, good luck lmao
Every gui program should have a CLI interface either way.
>>
>>51798797
teach me senpai
>>
>>51798729

>payday loans
>refusing to pay market rate for labor

tell him to drive off a bridge

or, more politely " I have a lot of things on my plate blah blah blah ". Some shit WILL go wrong and you'll get dragged into it, courts etc.
>>
>>51798816
xdotool
>>
tfw I don't know how to re-enter values for a .xls excel sheet, so I'm creating a new .csv excel sheet and re-inputting the new entry values through loops and arrays. Thanks, /g/ I'm gonna fail my final project.
>>
>>51798833
Don't be such a lazy fuck and put in the work next time
>>
>>51798833
No problem.
>>
>>51798816
> you simulate keyboard input and mouse activity
nope.
ive gone down this path and it is a dark road
>>
>>51798845

Professor never showed us how to work with excel and c++. We only dealt with file systems for one class period and they were for word documents.
>>
>>51798831
>move the user's mouse around, hoping that where you make their pointer click is the right spot
Nah.
Not every wm works the same.
>>
>>51798878

I mean .txt documents.
>>
>>51798891
What does wm have to do with this?
>>
>>51798798
Brother dont worry, I know about compliance.

No CC and Social Numbers are kept.
Also, will probably encrypt some Personal fields like DOB and stuff.

>>51798794
Forgot to add. He says I'll get a raise every year didnt specify though

>>51798765
It's easy but the cost for work... Plus it could be a good resume thing. Developed loan management system . wow.
>>
>>51798729
I'm crine rn. My sides didn't anticipate such hilarity
>>
>>51798878
>>51798899
>Rename .txt to .csv
>Import to excel

XDDDD
>>
>>51798908
Where a window pops up, maybe?
Are you going to get the user's monitor resolution and setup too?
>>
>>51798899
Can't you import text files to excel?
>>
>>51798916
T-thanks. Now help me.
>>
>>51798729
>>51798911
This smells fishier than Miley Cyrus' sock drawer.

Tell him to use a bound ledger until he actually has enough volume to justify development work.
>>
>>51798924
This is not an answer.
>>
>>51798728
>never write a program that ever crashes
Neither do I but there's no sense in turning a minor error into a major fault.
:^)
>>
else:
print ("You turn away from the Dragon and the lair. Perhaps this is not your task.")
time.sleep(1)
print ("You feel a strange presence. Something is following you...")
time.sleep(2)
complete = 0
return complete


SyntaxError: 'return' outside function


what'd i do wrong?
>>
>>51798982
You used return outside of a function.

Da fuq XBASIC variant language is this supposed to be?
>>
Has anyone here ever used Elixir? I'm getting into it now for an algorithmic trading project I've been working on and it's been quite different from other languages I've seen so far.

Has anyone here ever used it much or had experience developing in it?
>>
>>51798969
Where GUI windows pop up depend on the WM :^))))))
>>
>>51798949
Dont know what the fuck that is but he's accredited in Morocco and knows a lot of the judges there so he's cool.

Also, he says managing 50 clients on a excel is painful enough. And he's hiring workers for him to use this app.

Im thinking at least 3K for the app
>>
>>51798982
what in the fucking hell do you think you are doing wrong? have you tried understanding the shit you are doing?

>>51798729
>>offers me 300$ and 50$ a month
jej
>>
>>51798993
python3

>>51798982
reed the error nerd
>>
>>51798993
using python.
>>
>>51798982
you can only use return in functions
>>
File: 0b7.gif (2 MB, 290x188) Image search: [Google]
0b7.gif
2 MB, 290x188
>Non trap OP won
We did it guys
>>
Qt or GTK+
>>
>>51799019
bound ledger = fancy leather bound book

If he has enough revenue to justify extra staff, he should be coughing up more than that.
>>
>>51799013
So what?
You could resort to direct
XSendEvent()
if you know the inner workings of your program and don't like coordinate shit, after all.
>>
>>51799055
There's a quotation somewhere about "battles and wars", you probably shouldn't let your guard down if all of you retards (and this means everyone) still want to keep fighting over the OP image.
>>
>>51798498
>>51798498
actually, google says that it's because you have access to destructors which can be set to destroy any info, or which can be configured to act as a finally clause in the case of datastream rupture. Ultimately, I think you'd want to try that lock within the try block anyway so that you don't accidentally lock yourself out.

It's kind of like, why would you leave your car on, put up your windows and lock your doors when running back inside only because you hope you that upon closing your car doors would unlock themselves.

Stop being stupid for the sake of stupid and just put in the necessary effort instead of constantly trying to help technology "improve" by lowering the standard of conduct.

Come on man think!
>>
What is the best method in Haskell of combining two lists like this

[2,2,2] and [5,2] => [5,2,2,2]
>>
>>51798982
You can only use return inside a function. If you are trying to set the exit code, use sys.exit(value).

import time

print("You turn away from the Dragon and the lair. Perhaps this is not your task")
time.sleep(1)
print("You feel a strange presence. Something is following you...")
time.sleep(2)
complete = 0
sys.exit(complete)
>>
>>51799063
Qt

>>51799064
True

he says he'll take care of me though, so I kinda see it as "insurance". If I go, the app goes, and so does his clients and info. Uncle is cool too family and always at Christmas.

The software alone is not hard to write. But damn, this is gonna gurantee me passive income at the least.
>>
File: 1433222712923.png (13 KB, 418x359) Image search: [Google]
1433222712923.png
13 KB, 418x359
>>51798919
>>51798925

I'm creating a ofstream outputFile; to recreate the whole thing with the new values. tfw I have to present this to the class, and the class is gonna laugh at me.
>>
>>51799104
https://www.haskell.org/hoogle/?hoogle=%5Ba%5D+-%3E+%5Ba%5D+-%3E+%5Ba%5D
>>
>>51798869
This is literally how game playing bots for mmos are made...I think this is how actions work in photoshop...keyboards macros are first order versions of this.
>>
>>51799181
>This is literally how game playing bots for mmos are made

Not any good ones.
>>
File: 1445138163309.png (249 KB, 421x500) Image search: [Google]
1445138163309.png
249 KB, 421x500
>cs class
>assigned into groups
>in a group with a female
JUST

should I drop the class and take it again next time it's offered?
>>
>>51799270
dominate her
>>
>>51799270
just completely ignore everything she says
I was in the same situation except it was a dude
>>
>>51799203
>>51799181
As someone who has been through arguments with clients about this on several occasions...

Input simulators using recorded sessions = fragile as fuck
Input simulators using image interpretation = fragile as fuck

For any system a client needs to do something like this for, we either a) write a code injection attack to insert a DLL with a remote control setup into the program, and just have it call the internal functions that are needed, or b) just write a new program that provides the functionality of the existing one in a controllable manner. B is the first choice, and faster than making the other options work for probably 90% of the stuff I've seen.
>>
I'm trying to understand why this function refuses to work if len is initialized to 0 or 1.
unsigned get_linelength(FILE *fp, const char delimiter)
{
long pos = ftell(fp);
unsigned len = 0;
while (fgetc(fp) != delimiter)
{
len++;
}
fseek(fp, pos, SEEK_SET);
return len;
}


If len is initialized to 0 or 1, the while loop only goes through the loop once and exits, len always returns 1.
If it's greater than 1, the loop will work as intended, incrementing len until it encounters a specific delimiter character.
>>
>>51799167
So union seems like what I want but

[5,2] `union` [2,2,2] /= [2,2,2] `union` [5,2]


For my purposes it needs to always give [5,2,2,2] regardless of the order of the parameters. Is there a similar function that works like that I'm not seeing?
>>
>>51799309
explain what you want to do a little more clearly
>>
>>51799104
> What is the best method in Haskell of combining two lists like this
Define "combining".
>>
>>51799270
>>51799270

I know that feel. There's this hot girl in my c++ class who's hot as fuck, but has like an army of white knights. I try to stay away so that I don't agro her and her army. tfw she sometimes looks at me.
>>
Cool project ideas.
Anything.
Please.
>>
>>51799338
>tfw she sometimes looks at me.

Cringed
>>
So I have no experience coding sdl and glfw, yet Im going to make a choice, I started with glfw but then I felt to to lazy to have to deal with shaders since I'm only doing 2d stuff, so I switched to sdl2, I started looking up some sdl examples for just displaying a simple png image on the screen, all the examples I found were outdated.
What should I do/use?
>>
File: 1420099814802.jpg (13 KB, 250x239) Image search: [Google]
1420099814802.jpg
13 KB, 250x239
>>51799338
I don't think this feeling we have is the same feeling.

I want to avoid her because girls cant do computer science (or any stem, desu).
>>
>>51799338
>tfw she sometimes looks at me.
>>
>>51799342
>download 4chan image heavy thread
>use images from the thread to build a mosaic of the OP image (mosaic is not the right term, the shit were they make a pepe and when you zoom in it is made up of hundreds of different pepe images).
>>
>>51799326
>>51799334
I'm calculating the prime factors of several numbers and storing them in a list. I'd like to then use those lists to calculate a lowest common multiple. My issue is on how to take the lists for the individual numbers and combine them in to a single list that contains prime factors for the LCM.

So if I were to have 3 lists:
[7, 5, 5, 2]
[2, 2, 2]
[5, 3, 2]

and "combine" them the expected result would be: [7, 5, 5, 3, 2, 2, 2] (not necessarily sorted).
>>
>>51799305
The initial value of len can't have any effect upon the behaviour of that function. The return value is the initial value of len plus the number of times it gets incremented.

That is all.
>>
>>51798177
Assuming you're talking about C, yes. C doesn't really have a true boolean type. A zero evaluates to false in a boolean expression and a non-zero evaluates to true, regardless of the type.
>>
>>51799392
C99 does.
>>
Suppose I created my own programming language. What are the patterns that would make it perform well? If I wrote it in C, what optimizations and data structures would make it a viable general purpose language?

I'm curious because stuff like Python and Lua were probably slow as hell at first, but that didn't really hinder their widespread adoption. Now they're pretty fast.

If the 80/20 rule applies, what 20% of code will give a language 80% of the speed boost it needs to not be a toy anymore?
>>
>>51799375
nope. picture mosaic is indeed the right term for that...
>>
>>51799415
They're pretty fast but pretty slow in compared to C

They're known for readability and maintanablity
>>
>>51799417
Thankies, I guess I was thinking of a collage.
>>
File: 1377551313642.png (94 KB, 263x263) Image search: [Google]
1377551313642.png
94 KB, 263x263
>>51799415
>python
>fast
>>
>>51799415
If you want your language to perform well without having to put in a huge amount of effort, I'd say your best bet is to compile to LLVM IR.
>>
>>51799387
look dude all I know is that if len is set to less than 2, len doesn't get incremented more than once.
and i don't know why this is happening

it works perfectly fine otherwise
>>
>>51799454
From what you've shown, that's not possible. There must be something else that's causing it.
>>
>>51799454
There is absolutely no way the value of len should influence the behavior of that function. There is something else (possibly outside of this) messing it up.
>>
>>51799376
for every unique element a of the union of all input lists, you want the final list to contain n 'a's where n is the maximum number of times a appears in each of the input lists?
>>
>>51799502
Yes.
>>
>>51799484
>>51799480
alright here
http://pastebin.com/QaY9Bb91

Nothing else should be affecting the behavior of that function, i know.
>>
>>51797556
>>51797517
>>can't even convert binary to ascii using parallel

hey this might be obvious to you, but I'm pretty noobish: how is this a completely serial problem? Can't you read the file in pieces and process each piece individually and then have some kind of collector put the pieces all together? If you load the file and memory-map it so you can treat it like random access first. IDK much about c# though.
>>
>>51799430
Sure, but Python's considered "fast enough" by many, even for things like number crunching; the libs link to native fortran code and it seems to help.

How did Python get there, performance-wise? Or are you saying a language doesn't need to be fast in order to be generally useful and accepted by hackers?

>>51799449
I'm just having trouble identifying what that huge effort actually consists of. I'm reading source code of many virtual machines and I don't know what choices were the most significant performance-wise.

They introduced caching at various points like vtable lookup, made pointers and fixed-precision numbers a sum type, enabled compilation of code down to machine instructions at runtime so as to avoid interpretation... The list goes on.
>>
>>51799415
Python is not fast in any regard.
Lua is only fast for an interpreted language.
>>
>>51799376
conv = map (\x -> (head x, length x)) . group

join [] [] = []
join xs [] = xs
join [] ys = ys
join xs@((x,nx):xss) ys@((y,ny):yss)
| x == y = max nx ny : join xss yss
| x > y = (x,nx) : join xss ys
| x < y = (y,ny) : join xs yss

combine xs ys = join (conv xs) (conv ys)
>>
>>51799519
Nobody is going to be able to tell you that without deep knowledge of the system in question. Maybe you can find a talk on youtube from someone who worked on CPython or LuaJIT.
>>
>>51799561


http://stackoverflow.com/q/4911762
>>
>>51799519
A language doesn't need to be fast if the language itself is primarily a means to delegate to native code.

E.g. Python itself is about the slowest language in widespread use. If you were to take typical Fortran number-crunching code and translate it directly to Python, the result would typically be 100x slower or worse.

So you don't do that. You use NumPy to do the actual calculations so that the interpreter overhead is per array, not per array element.
>>
>>51799506
>>51799502
>list of unique elements from union of all input lists
nub . concat input
>number of times a appears a list
length . elemIndices a
>the maximum number of times a appears in each of the input lists
maximum $ map (length . elemIndices a) input
you can take it from here
>>
>>51799511
Maybe the file you are passing it has a delimeter at 0 or 1...?
>>
>>51799557
I appreciate this but I can't actually get it to build.

>>51799624
Thanks.
>>
>>51799640
That wouldn't matter, the value of len isn't used to seek in the file.
Thread replies: 255
Thread images: 29

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.