[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: 36
File: prog2.jpg (117 KB, 850x602) Image search: [Google]
prog2.jpg
117 KB, 850x602
Daily Programming Thread

What are you working on, anonymous ?

# New & Revised /dpt/ Code of Conduct #
We want to ensure that the /dpt/ community, while large and diverse, remains
welcoming and respectful to all participants. To that end, we have a few
ground rules that we ask people to adhere to.

- *Be friendly and patient.*

- *Be welcoming.* We strive to be a community that welcomes and supports
people of all backgrounds and identities. This includes, but is not limited
to members of any race, ethnicity, culture, national origin, colour,
immigration status, social and economic class, educational level, sex,
sexual orientation, gender identity and expression, age, size, family
status, political belief, religion, and mental and physical ability.

- *Be respectful.* Not all of us will agree all the time, but disagreement
is no excuse for poor behavior and poor manners. We might all experience
some frustration now and then, but we cannot allow that frustration to turn
into a personal attack. It’s important to remember that a community where
people feel uncomfortable or threatened is not a productive one. Members of
the /dpt/ community should be respectful when dealing with other members as
well as with people outside the /dpt/ community.

- *When we disagree, try to understand why.* Disagreements, both social and
technical, happen all the time and /dpt/ is no exception. It is important
that we resolve disagreements and differing views constructively. Remember
that we’re different. The strength of /dpt/ comes from its varied community,
people from a wide range of backgrounds. Different people have different
perspectives on issues. Being unable to understand why someone holds a
viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to
err and blaming each other doesn’t get us anywhere. Instead, focus on
helping to resolve issues and learning from mistakes.
>>
>>54358814
This (You) was paid for by the hard efforts of the users of 4chan.
>>
I was making a program to read an html file and break it up into words. But the algorithm I made failed because Im not sure about the formatting of html files. Never worked with them before.
What I tried to was to find every instance of
> > </span>
but that pretty much missed everything.
I was gonna tailor the algorithm to find every instance of
> </span> <span
as well but before I do that I figured Id ask here since I could be taking the wrong approach to solving this.
>>
File: numbers.png (16 KB, 599x450) Image search: [Google]
numbers.png
16 KB, 599x450
>>54358763
>>54358763

THREAD CHALLENGE

Replace this class structure and implement the compare function in C.
compare a b must return true if a and b are mathematically the same number. For example

integer a = 7;
fixed b = 7.000;
float c = 7.001;

compare(a, b); // must return true
compare(a, c); // must return false


number is the interface of the class hierarchy
>>
File: time to stop.jpg (27 KB, 320x320) Image search: [Google]
time to stop.jpg
27 KB, 320x320
Let's hope this thread won't have any OOP/anti-OOP shitters.
>>
>>54358814
NIGGERS
>>
>>54358915
>shitters
>retro meme
Lets hope this thread won't have any more newbies
>>
>>54358915
Go's OOP model is pretty much perfect (except for missing parametric polymorphism)
>>
>>54358780
>super global variables
>global variables for every possible type
>union of all possible types despite possible consuming different amount of memory

Are
You
Even
Trying
>>
>>54358906
bool compare(...) {
return false; // integer 7 != fixed 7
}
>>
>>54358935
I don't care. I just want you fags to stop screaming at each other and do something useful for once.
>>
Can anyone who's using spring here point me to a good resource to learn the framework ?
>>
>>54358906
>language restriction
>interface name restriction
Do your homework yourself
>>
>>54358954
lurk more
>>
>>54358951
Why would you be browse /g/ then?
>>
>>54358970
Do us all a favour and lurk less
>>
>>54358970
Fuck off
>>
>>54358990
thats a good way to get people to help you
>>
>>54358986
>>54358990
Salty C fags detected. Enjoy your sour imperative grapes.
>>
>>54359047
I'm a functional/procedural C++ (straight) fag actually
>>
>>54358970
this

it's what spergs have been yapping about all day
>>
>>54359060
>sperg
>>54358970
>>
>>54359053
>C++
>straight

Your sexual orientation doesn't matter if you haven't gotten any in the past 10 years.
>>
>>54359094
It's easy to get fat chicks.
And if he likes C++ he must be chubby chaser.
>>
>>54359094
better dead than pegged
>>
You can tell she's doing hard, technical work because there is a trend line and a pie chart.
>>
>>54359141
Does the trend line penetrate her pie chart?
>>
>>54359141
Don't talk shit about pie charts.
If I could include useless pie charts in a man page I would.
>>
File: 1462239283456.png (22 KB, 291x246) Image search: [Google]
1462239283456.png
22 KB, 291x246
>>54358915
Let's see.

A.
>talking about programming
>discussion various paradigms
>posting code examples
>arguing over implementations

B.
>>54359178
>>54359153
>>54359141
>>54359123
>>54359119
>>54359094

Tough choice.
>>
File: this article is real and true.png (329 KB, 711x610) Image search: [Google]
this article is real and true.png
329 KB, 711x610
>>54359186
Normie get out gnnuuuuuuuu
>>
>>54359186
Fair point.
>>
>>54359186
>bawww OOP is slow
>bawww OOP is not slow

I'd put that into B
>>
File: thirsZ.jpg (61 KB, 1280x720) Image search: [Google]
thirsZ.jpg
61 KB, 1280x720
>>54359233
>OOP
>not programming related
You're right. Lets go back to talking about anime like we used to.
>>
>>54359266
hey ASM is the fastest guize
you all dumb for not using it for everything
#yolo

programming related =/= not a shitpost
>>
>>54358947
>here you failed to do these things that weren't relevant to your example

http://pastebin.com/ESHuDPJh

There, better ?
>>
>>54359304
Anime isn't shitposting you heathen
>>
>>54359304
asm has the (developer, time) overhead of calling the assembler to produce machine code, just skip that step
>>
>>54359329
general purpose processors have huge overheads, just make asics
>>
>>54359365
Writing code is too slow. Just define it in your head and pretend it's been run.
>>
>>54359413
pretending is too slow, just let someone else do it
>>
>>54359431
always asking someone to pretend for you is too slow
write a python script that keeps asking people to pretend shit
>>
>>54359448
python is for babies, let's write that in Rust. I heard it's fast.
>>
>>54359458
until you try to compile it, you need a faster compiler
>>
Check out my first Java program.
public class First {
public static void main(String []args) {
System.out.println("Hello World");
}
}
>>
>>54359511
>it's not just >print "Hello World"
Verbose as shit
>>
>>54359511
What is it supposed to do?
>>
>>54359524
Well I'm paid per LOC, and daddy's gotta eat.

>>54359533
Haven't figured out yet.
>>
>>54359511
check out mine:
http://stackoverflow.com/search?q=how+to+make+hello+world+in+java
>>
>your application is broken today for some reason
ree

I don't want to fuck with it
>>
File: WVkEAPo.png (40 KB, 777x703) Image search: [Google]
WVkEAPo.png
40 KB, 777x703
>>54359585
kek

stylized quotation marks
>>
Is it hard to learn programming? I really want to start but I don't know how ;_;
>>
>>54359636
What do you want to do with it?
>>
>>54359636
No
>>
>>54359511
nice, keep going

just one thing to note:
>String []args
the usual syntax in java is
>String[] args
sometimes the C++ style is used instead:
>String args[]
>>
>>54359636
It's too hard.
Give up.
>>
>>54359636
it's not hard but if you want to make games or movies you should be good at math or else your shit will suck donkey balls
>>
>>54359643
I always wanted to use it on industrial stuff. I know it's silly at this point but I think it's cool. I'm going to give my summer to it.
>>
>>54359655
Huh, interesting. I'll use C++ style since I'm more familiar with it.
>>
>>54359637
Actual attachments?

Make a MailMessage object.

Make an Attachment object with a filepath to the file you want to attach.

MailMessage has an enumerable property called Attachments.

You can call the enumerable method Add() to add a an Attachment object that references a filepath.
>>
I thought it was a stupid question because it was about making something in VBA that's pretty entry level but I've been directed otherwise >>54358714
>>
>>54359686
I suck at math but I'm decent when it comes to program intermediate stuff. If what you are trying to do isn't strictly math-related, you can find pretty much everything with a quick search. Even if you plan to do low level C stuff with pointers, where you have to understand how bit/bytes work, it should be pretty easy.
>>
>>54359713
>>54359717
>>
>>54359713
>>54359727
Well, it's not that I can't add attachments (here's the full thing if it helps: https://ghostbin.com/paste/3nuj8), I just need to add specific attachments from a filepath based on the selected items in a listbox.

(I spaghetti'd all over my post when I copy-pasted it from the tail end of the last thread and got the (You)(Cross-thread) parts all over it was so embarrassing I deleted the post)
>>
>C++
How do I see if two references/pointers are the same object (just different base classes of said object)?
>>
https://isocpp.org/files/papers/PO4116_emoticons.html
>>
>>54359851
What do you mean?
>>
>>54359851
save initial values and compare those
set a new value on one of them
check if the new values are the same on both
>>
>>54359806
I'm too spoiled by LINQ at this point, not sure if VB has an equivalent.

5 second hack example:
foreach(var x in listBox.Items.Where(x => x.IsSelected))
{
mail.Attachments.Add(new Attachment($@"C:\temp\{x}.txt"));
}


Basically, you just want to say:
"For each item in this list that's selected, look for the accompanying file and add it to the email as an attachment."

Sorry, I'm not too familiar with VB.
>>
>>54359892
[x|x.IsSelected]
>>
>>54358814
I know that dog from somewhere
>>
>>54359932
Did that dog go to the same highschool as you?
>>
>>54359939
No you retard, dogs don't go to highschool
>>
>>54359947
Fucking racist
>>
>>54359874
bool reference_compare(Foo *foo, Bar*bar) {
return foo == bar;
}

This doesn't work. If you have a class Baz that inherits from both Foo and Bar, pointer-to-foo-in-baz is not equal to pointer-to-bar-in-baz.
>>
>>54359892
Yeah, that's it, where each item in the listbox has an associated attachment filepath. Like I said in the /sqt/ post, if I had [item 1] and [item 2] out of the listbox selected, I want the loop to grab the attachments that correspond with [item 1] and [item 2].

>Sorry, I'm not too familiar with VB.
It's fine, I'll either stumble on the answer on my own or someone will end up pointing out how easy the solution is to me.
>>
File: 1301237254532.gif (7 KB, 150x141) Image search: [Google]
1301237254532.gif
7 KB, 150x141
>mfw my virtual file system crashes when I try to use it to open a file in a directory that has about 45000 files

At least it's a reproducible crash. Seems to always fail identically.
>>
>>54359967
They're different bases, they can never have the same offset. Why would they ever have the same address? What are you actually trying to do?
>>
>>54360000
What's the virtual file system for?
>>
>>54360007
See if they are bases of the same object.
>>
>>54359997
Well, it's pretty simple.

Just do a FOR statement through the list of items like you already did in your code, use an IF statement to check for an associated file, and if the if is true, create an Attachment and add it to the message.
>>
File: 1410354072907.jpg (9 KB, 250x237) Image search: [Google]
1410354072907.jpg
9 KB, 250x237
Perl 6 will be the new meme
https://youtu.be/hR9UdvxMAbo
>>
>>54360016
return foo && bar && dynamic_cast<Foo *>(bar) == foo;
>>
>>54360043
would never work
>>
File: pepe_smug.jpg (110 KB, 800x800) Image search: [Google]
pepe_smug.jpg
110 KB, 800x800
dumb question:
does programming gets easier with time? do you just "get it" at some point?
>>
>>54360023
>why people are so excited
literally who
>>
>>54360054
only if you're not retarded
>>
>>54360047
Why not faggot?
>>
>>54360074
foo and bar are base classes, he wants to know if they're base classes of the same object, presumably without care for what object they're both base classes of
>>
File: smilee.jpg (26 KB, 245x241) Image search: [Google]
smilee.jpg
26 KB, 245x241
I sometimes hear people saying that Ruby is functional, but whenever I open a tutorial for it, they start talking about OOP concepts right out of the gate.

I might have to learn Ruby for a job, but if I am going to be writing OOP code, I won't even bother.

Just how functional (or at least un-object-oriented) is Ruby in general practice?
>>
>>54360054
>do you just "get it" at some point?

At some point you may think you've "got it" but a couple years down the road from there you'll realize you were about as retarded as it gets/
>>
template<typename T, typename U>
bool dynamic_compare(T *t, U *u) {
return t && u && dynamic_cast<U *>(t) == u;
}

class Foo {virtual void foo(){}};
class Bar {virtual void bar(){}};
class Baz : public Foo, public Bar {};

int main() {
Baz baz;
return dynamic_compare(static_cast<Foo *>(&baz), static_cast<Bar *>(&baz));
}

You're fucking retarded.
>>
>>54360130
>Using C++

You're the one who's "fucking retarded," anon.
>>
>>54360130
This doesn't work and never will
>>
>>54360194
Yes it does work.
Why the fuck do you think it wouldn't?
>>
>write a function in C that convert a string into lowercase

how can i do this in C?

my solution so far

char convert_string(char string)
{
int i ;
for (i = 0; i < strlen(string); i++) {
//what now ??
}
}


halp
>>
>>54360223
Foo does not derive Bar, and it makes assumptions and is restrictive
Try it with 3 base classes
>>
>>54360237
void convert_string(char* string, size_t len)
{
size_t i ;
for (i = 0; i < len; i++) {
//what now ??
}
}

fixed it for you
>>
>>54360237
string[i] = string[i] - 65;


You also need to check if string[i] is a letter, your 'string' needs to actually be a string (so its type would be char *) and you should stop the for loop at strlen(string) - 1.
>>
>>54360329
>- 65
I assume you mean tolower(...)
>>
>>54360250
in c++ how does one read the whole file into 1 string.
str+=str concept isnt working.
>>
>>54358891
Use split(), explode(), or whatever the equivalent is in your language to get an array of strings from the html file. Look for for "<span>" and "</span>" in the array then extract the array elements and rebuild the content from the strings in between those two locations using implode() or whatever is the equivalent in your language.
>>
>>54360363
std::ifstream filestream(filename);
std::string line, file = "";
while (filestream >> line)
file += line;
>>
Question:

imagine i have this global structure:

typedef struct stuff {

struct stuff *next;
struct stuff *test;
} stuff;


Do i need to initialize the elements inside like:
stuff *new_struct;
new_struct->next = new_struct->test = 0

?

the strucure is global so all elements are initialized to zero already
>>
>>54360355
no, I actually meant +32. It's the offset between uppercase and lowercase letters
>>
for(int i=0;i <strlen(string)-1;i++){
if(string[i]>='A' && string[i]<='Z'){
string[i]=string[i]+32;
}
}
>>
>>54360417
   P
N O T
R
T
A
B
L
E
>>
>>54360441
>>54360237
forget to quote.
>>54360417
right. wondered about the +65
>>
>>54360458
Really? Why?

>>54360459
65 is just uppercase 'A', was me brainlagging
>>
>>54358906
Lol, just compare their string representations.
>>
>>54360492
"7" != "7.0000"
>>
File: sicp.jpg (95 KB, 500x492) Image search: [Google]
sicp.jpg
95 KB, 500x492
>>54359636 It's super easy.
Here's /the/ best starting point:
>https://mitpress.mit.edu/sicp/full-text/book/book.html
That book is intended for complete beginners and teaches you most of the important concepts.
There are some other resources to use alongside it here:
>https://mitpress.mit.edu/sicp/

It uses the Scheme language, which is a dialect of Lisp.
Lisp generally isn't really worth using[citation needed], but it is worth learning.
>>
>>54360507
Ignore this guy.
>>
>>54360507
>SICP
That's like recommending Horowitz to people asking how to make a led light up.
>>
File: 1461592347388.png (154 KB, 320x308) Image search: [Google]
1461592347388.png
154 KB, 320x308
>>54360507
>Giving the guy who wouldn't know a line of code from a hole in the wall SICP
>>
File: Microcontroller.gif (57 KB, 420x225) Image search: [Google]
Microcontroller.gif
57 KB, 420x225
>>54359688
>I always wanted to use it on industrial stuff.
So ... embedded systems?

You'll need to learn Assembly for that.
And you /do not/ want to start with Assembly.

If you really, really want to start with Assembly,
do some circuit building first then buy a few microcontrollers.
Be sure to download and read the documentation for them.

But even then, learn some other programming first.

>>54360524
No you.
>>
>>54360524
>>54360552
>>54360610
samefag
>>
>>54360716
I only got one (You) from this
>>
>>54360727
me too!
We really must be the same!
>>
>>54360716
samefag
>>
File: samefag.webm (3 MB, 900x488) Image search: [Google]
samefag.webm
3 MB, 900x488
>>54360716
>>54360727
>>54360734
>>54360736

samefag
>>
>>54360645
>360645▶
Mate what the hell, if you want to do embedded stuff, start with an arduino or something, not with fucking assembly.

Even in embedded, we barely use assembly anymore, it's mostly C/C++
>>
>>54359688
>>54360645
Embedded systems != Having to program in assembly
Most of the time it will be C. Very few modern micro controllers don't have a C compiler for the platform.
>>
File: fragezeichen yui.png (94 KB, 396x395) Image search: [Google]
fragezeichen yui.png
94 KB, 396x395
I'm trying to learn a language that will get me a job.

Are any of the following employable:

- Clojure
- Scala
- Go
- Ocaml

Clojure seems the most appealing because I like Lisp
>>
>>54360798
>Are any of the following employable:
no
>>
>>54360798
Why are you going straight for memelangs if you're trying to get a job?
>>
Fuck it. I will just learn C++.
>>
>>54360798
>language to get a job
>chooses obscure languages the industry doesn't cares about it

Just learn shit like C# or Java.
>>
>>54360808
I'm employed in an entirely different sector.
I'd only consider switching over if I can write in a good language.
If it's just Java or C++, then I won't even bother.
>>
Friendly reminder that F# is factually one of the most employable languages
>>
What kind of projects could I do on my own / with one or two other people if I want to get deeper into databases / business intelligence?
>>
>>54360820
see
>>54360838
>>
>>54360798
OCaml matters a (very) small bit in academia.
Everything else on that list is irredeemable shit.

>I'm trying to learn a language that will get me a job.
Learn C++, Java, and Python. Preferably in that order.
Beyond that, just pick things up when your job needs you to.
>>
>>54360838
You haven't even learned the languages yet!
How can you tell they are "good" languages?

Don't just buy into the HackerJews memes.
>>
>>54360798
Scala is somewhat employable. Clojure is almost 0 jobs tier. Go and ocaml - no.
>>
>>54360838
C# is employable as fuck and actually enjoyable to right in.

Don't fall for the memes.
>>
>>54360863
>>54360874
>ocaml - no
>OCaml matters a (very) small bit in academia.
right, I forgot - ocaml is used quite a bit in program analysis research
>>
>>54360888
>right
write

drunk at work
>>
>>54360866
They could suck, true.

All I know so far is that I hate OOP and prefer functional. What should I learn in that case?
>>
>>54360888
>actually enjoyable to right in
Typical Micro$haft C# """programmer""", everyone
>>
>>54360839
if only
>>
Which programming languages will get me hired instantly and are sought after?
>>
>>54360919
hired instantly = you are commodity and thus are not sought after
>>
>>54360919
Thue
>>
>>54360919
Any of the big 5 + SQL
>>
>>54360911
To never listen to /g/.

Functional languages tend to be awful in an actual job outside academia where you have to work with more than 2 people.
>>
>>54360940
Yeah but I have written enough Lisp and Scheme to know that I like it.

It's pretty simple:
if I can write in something *approximating* that kind of experience, I'll compromise and learn a new language and give development a shot

If there are no job prospects out there that aren't C++ and Java, I'll just stick to what I'm currently doing.
>>
>>54360967
How much LISP code from other people did you try to understand and maintain?

I bet it's zero.
>>
>>54360967
Have you actually worked on a large Lisp project?

How much experience do you have with non-one-man projects?
>>
>>54360917
https://stackoverflow.com/research/developer-survey-2016
cant find the other source
>>
>>54360996
redpill me on where I can work on a large Lisp project
>>
>>54360998
That doesn't back up your claim at all.
>>
>>54361033
It's one of the highest paid
>>
>>54360815
>just
>>
>>54361041
That also doesn't back up your claim at all.
>>
>>54360998
>Full-Stack Web Developers
>28%
Jesus
>>
>>54361044
Just inc my C up senpai
>>
>>54361055
Btw, check the highest paying worldwide
>>
>>54360645
industrial stuff could be factory machines or something, then it would be C or C++ or java
>>
>>54361079
That has nothing to do with your claim that F# is one of the most employable langugaes. Cobal is highly paid too.
>>
>>54361060
stack overflow was built for web devs man
>>
>>54360998
>>54361079
Employable != high average pay

Fucking idiot.
>>
>>54360441
Pls learn how to format your code, that looks repulsive
>>
File: dsgraph.gif (2 KB, 300x197) Image search: [Google]
dsgraph.gif
2 KB, 300x197
>>54361100
>>
>>54360998
>curryniggerflow currynigger survey
it's not even in the "top tech", "trending tech", "top tech stacks" lists

>>54361041
it needs to be popular too
>>
>>54361100
>>54361110
also note I said I forgot the other source which was explicitly about employability
>>
>>54360998
>0.1% BI and Data Warehousing

>tfw you have no competition for the jobs you want

Feels good.
>>
>>54361120
so F# has a low quantity of jobs available and is not very employable
>>
>>54361129
>also note I said I forgot the other source
Yes, i did notice that. Convenient.
>>
File: retard.jpg (411 KB, 1124x900) Image search: [Google]
retard.jpg
411 KB, 1124x900
>>54360798
here

I am going to try Scala. It seems like my best bet.
I'll remember you nerds when I'm making 125K starting
>>
File: mike love.jpg (41 KB, 500x389) Image search: [Google]
mike love.jpg
41 KB, 500x389
>>54360023
>>54360055

More like, Perl 6? Why, are people excited?
>>
>>54361190
I'll remember you when I masturbate at noon and enjoying the neet life.
>>
>>54361190
enjoy your living hell https://www.youtube.com/watch?v=uiJycy6dFSQ
>>
>>54361135
How can I get into those fields? I'm doing a masters in information systems and enterprise systems, but what can I do meanwhile outside of univ?
>>
>>54360888
>Windows
>Microsoft
>enjoyable
>>
Reminder that rust is literally the best language ever made.
>>
File: golden_hammer.png (77 KB, 740x280) Image search: [Google]
golden_hammer.png
77 KB, 740x280
>>54361088
>>
File: flamboyant_cuttlefish.webm (2 MB, 720x404) Image search: [Google]
flamboyant_cuttlefish.webm
2 MB, 720x404
Ask your favorite programming literate anything (IAMA)

>>54361190
http://jimplush.com/talk/2015/12/19/moving-a-team-from-scala-to-golang/

>>54360798
All of them.

>>54359636
https://code.org/
>>
>>54361251
F# is really enjoyable, which is something that is covered in the survey (3rd most loved)
>>
>Nothing to do for the next few weeks
>Want to code
>No projects I want to get into
I wish doing simple 2d rendering wasnt such an unbelievably massive pain in the cock in C#
>>
>>54358814
So I'm planning on making a ceaser shift tool but it has two alphabets one if the word has even number of letters a different one if it has odd, how would I go about doing this and what language should I learn to do it? any help is appreciated
>>
say I'm interested in computers but not necessarily because i want to be a programmer

are there any books that explain well how computers/programming/networking works? sort of a layman's introduction
>>
Why is there a code of conduct.
>>
>>54361372
Only works if you shift from the smaller alphabet to the larger one, otherwise you'll be mapping multiple plaintext symbols to the same encoded symbols, and losing data.

>>54361402
Because OP is being
I R O N I C
R
O
N
I
C
>>
>>54361281
Java ME is great for mobile and embedded devices

This comic is retarded senpai
>>
File: turtling.png (126 KB, 795x717) Image search: [Google]
turtling.png
126 KB, 795x717
Has programming gone too far?
>>
File: 99656cac1a.png (47 KB, 994x603) Image search: [Google]
99656cac1a.png
47 KB, 994x603
>>54353124
Finally I have found a solution for that.
Basically I pass a class that wraps an exception and a bool to check if the exception was raised. Then in the method that runs async I manage the exception and save it in the class. Then in the caller method I just check the bool and manage accordingly.
>>
>>54361418
>retroactive
>
>>
>>54361418
No
>>
>>54361372
>what language should I learn to do it?
Literally any.
>how would I go about doing this
Have a subroutine for each type of ceaser shift. Then scan in some text and tokenize it by word.
Run through the tokens while checking their size modulo 2, apply the appropriate subroutine.
>>
>>54361372
Rust.
>>
>>54361281
6 quintillion devices
>>
>>54361489
>letting SJWs run your language

No thanks nigger

>If you feel you have been or are being harassed or made uncomfortable by a community member, please contact any of the Rust Moderation Team immediately. Whether you are a regular contributor or a newcomer, we care about making the community a safe space for you.
>>
>>54360888
C# is only useful for top pleb CRUD webshit

C++ and Java is where it's at
>>
>>54361512
The language is independent from the CoC. All this means is to stay the fuck away from any mozilla-related rust community.
>>
>>54361297
>cuttlefish walking and resembling some kind of nudibranchia
>uses tentacles and rear lumps as legs
I'm genuinely impressed
>>
>>54361535
>The language is independent from the CoC.

False

The harassment domain is rust-lang, aka the official language admins

Admit defeat you fucking white male.
>>
>>54361560
ARE YOU KIDDING ME????
A community is not a software.
>>
>>54361560
So we'll fork it and call it IronOxide or something, and remove the CoC.
>>
FizzBuzz in Assembly is a pain
>>
File: 1453751841926.jpg (13 KB, 215x250) Image search: [Google]
1453751841926.jpg
13 KB, 215x250
>>54361512
>safe space
>for you
>>
>>54361580
Just ignore him.
>>
>>54361580
>>54361589

In this moment, I am triggered. Not because of some phony Code of Conduct, but because I am oppressed by these white males.
>>
>>54361560
the language is code, not the github repo and the community. The future of language is tied to its community though, but you can always fork if you think you know better how the language should be developed.
>>
>>54361603
>white males
Guess again, shitlord. Check your privilege-checking privilege
>>
>>54361372
Caesar isn't a mapping cipher, it's just offsetting, so you don't need two alphabets, just two offsets.

Direct tokenizing is probably a bad idea because you should be passing not alphabetic characters through untouched, not removing them.
Go through the string, store the start position, check if a char is valid, if so increment a counter.
Once you've reached an "invalid" character, apply the offset according to the counter i.e. length (odd or even), starting from the stored start point of course.

Then carry on, resetting the start position with the next char.
>>
>>54361592
everything in asm is a pain senpai
>>
>>54361620
RAAAAAAAAAAAAAAAAAAAPE
>>
>>54361589
>So we'll fork it and call it IronOxide or something, and remove the CoC.

I don't think you can do that.
>>
>>54361651
Why not, tard?
>>
>>54361680
Both Apache and MIT licenses don't allow that.
>>
>>54361694
Both apache and mit license explicitly allow that.
FTFY.
>>
File: Nautilus_Palau.jpg (2 MB, 4000x3000) Image search: [Google]
Nautilus_Palau.jpg
2 MB, 4000x3000
>>54361542
it's really cool check this out

http://news.nationalgeographic.com/news/2011/06/pictures/110601-cuttlefish-camouflage-science-gestures-arms-mimic-nature/

and holy shit pic related looks fucking intense like a pokemon

they don't show you this in school

does the outline of the shell approximate a golden spiral?
>The nautilus shell presents one of the finest natural examples of a logarithmic spiral, although it is not a golden spiral. The use of nautilus shells in art and literature is covered at nautilus shell.
oh that's still fucking cool
>>
>>54361706
Oh, I was thinking strip the license.

Is the COC even in the source code?
>>
>>54360408
>>54360408
>>54360408

BUMP
>>
>>54361744
Maybe try renaming stuff so you're not reusing the same identifier in 3 different places, and people can actually work out what the fuck you are doing.
>>
>>54360408
you have to malloc it senpai, but if it's global i wouldn't do that, instead just make it on the stack:
struct new_struct;
new_struct.next = newstruct.test = NULL;
>>
>>54361796
You're retarded if you can't understand that.
>>
>>54361820
this is /dpt/, not /mods-are-mad-that-we-think-this-is-/a//
>>
>>54361817
>struct new_stuff
meant "stuff" inseat of struct, mb
>>
>>54361820
>a mod put d e s ktop th r e ads on auto sage
good
>>
>>54361817
If you calloc it, all the fields will be initialized to 0 (aka NULL).

Seriously tho, just put it in a an init function.
>>
>>54361820
Is desktop thread / desktop threads filtered or what?
>>
what are the primary languages used for web applications?
>>
>>54361817
yes thank for replying.
i know that i have to malloc.

my question was if i had to assign the value NULL or 0, since its already global, hence zero initialized
>>
>>54361887
I'd rather he not have a pointer to memory on the heap be global, but yeah, calloc in an init is best.
>>
>>54361828
Welp not only is the struct self-referential, but initialising those nested structs to 0 is also nonsensical.

So I can understand perfectly well how retarded it is, I'm just giving them a chance to make it sensible.
>>
>>54361899
js (node, angular, whatever), ruby (on rails), python (+django, flask, whatever)

>>54361900
You know that you'd have to malloc it between those two lines, yes? Just making sure
>>
>>54361887
calloc is a performance smell
>>
>>54361820
Where the fuck do you think you are exactly?

Fuck off back to >>>/v/
>>
File: 4.png (4 KB, 313x35) Image search: [Google]
4.png
4 KB, 313x35
>>54361915
>when you don't know what pointers are
>>
>>54361820
>>>/v/
>>>/w/
>>>/wg/
>>>/reddit/
Good.
>>
>>54361902
If you're modularizing your code in .c files, just keep it local to that file only using a static global.

>>54361923
fuck off with your cargo cult programming terminology
>>
>>54361973
Says the guy who unironically posts
>modularizing your code
>static global
>>
>>54361973
>>54361922
all i am saying is instead of code A i would code B

Code A

stuff *create_node()
{
stuff *new_struct = malloc(sizeof(stuff));
new_struct->next = NULL;
new_struct->test = NULL;
return new_struct;
}


Code B


stuff *create_node()
{
stuff *new_struct = malloc(sizeof(stuff));
return new_struct;
}
>>
>>54362048
modular is a proper word that means something
pretentious terms like "code smell" don't mean anything
>>
>>54362055
that's not global then famalam
Code A is correct
if you have anywhere in your code something like
void fun(stuff *s) {
if (s->next == NULL) ...

then it's not going to work as expected if you use code B
>>
>>54362055
You'll get better performance by doing

(long long int)new_struct->next = 0;
>>
>>54362055
Nodes of a linked list should only be created by list_push or pop function.
>>
>>54362087
"performance smell" means something
>>
>>54362110
No it doesn't, you just made it up.
>>
>>54362128
That guy isn't me.
>>
>>54362128
I'm not him famalam
it's a big worry if you can't realize "performance smell" means "it'll hamper performance"
>>
>>54361820
mods pls no bully
>>
>>54362100
>long long int
D E S I G N A T E D
>>
File: 1456767032817.jpg (1 MB, 3264x2448) Image search: [Google]
1456767032817.jpg
1 MB, 3264x2448
Hey ya'll I'm super new to programming and I'm trying to write a converter for decimal to hexadecimal

I'm having a fuckload of trouble visualizing how this is going to work.

This is practice for me so I'd really like a tip or two but outright telling me how to do it isn't much help

thanks for any and all advice
>>
>Qualifications:
> Minimum Bachelors degree in Computer Science, Computer Engineering or related discipline
> Minimum 2 years of Software Development experience, mainly developing in Microsoft Visual Studio environment. College course work can substitute for experience.
> Proficient in Microsoft Visual Studio development environment: C#, VB.NET, MS/SQL,..
> Knowledge and experience on the SDLC
> Excellent communication skills both written and verbal

what do they mean by college course work can substitute for experience? do they mean if i took a class that used microsoft visual studio? everyone "develops software" getting a csci degree. how proficient do i need to be in visual studio and sql? what do they mean knowledge and experience on the SDLC?
>>
>>54362100
>
long long int
>>
What programming languages are growing in demand lately?
>>
>>54362244
logo, perl and ada
>>
>>54362244
just learn java if you want a job, it's the only language used in industry
>>
>>54362228
>what do they mean by college course work can substitute for experience?
They mean if you have a course that uses the same languages and methodologies that the company uses, you can substitute it for experience
>>
>>54362228
They mean if you've done interesting projects, contributed to research, or done internships.
Nobody gives a shit about your reverse-trawling B-tree program or that one course of C you took.

>Visual Studio
Enough to know the useful hotkeys and compiler settings.

>SQL
Big company? A reasonable enough amount that you can interface with the databases programmatically without issue.

Small company? Enough that you can create tables yourself in an organized and efficient manner and traverse them programmatically without causing huge performance issues.
>>
>>54362225
First, learn how to convert decimal to hexidecimal by hand. You should know this already.
Second, write a program to do it.
>>
>>54362232
>int 16bits
>long int 32bits
>long long int 64bits
>>
>>54362288
<3 thanks /g/
>>
>>54362274
Java, Python, C#, and SQL are all in high demand but I'm really concerned about future growth.

My mom basically spent most of my life unemployable because she didn't adapt to industry-wide changes and now no matter what programming job I get I'm going to be earning at least 4 times what she does
Thread replies: 255
Thread images: 36

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.