Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Maintenance is complete! We got more disk space.
Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 389 KB, 934x1000, fd.png [View same] [iqdb] [saucenao] [google] [report]
54052326 No.54052326 [Reply] [Original] [archived.moe] [rbt]

What are you working on, /g/?

>> No.54052419
File: 2.95 MB, 1280x720, ca.webm [View same] [iqdb] [saucenao] [google] [report]
54052419

Ask your much beloved programming literate anything (IAMIA).

>>54052143
Nothing to do with strong typing.

>>54052288
static typing: when typing is done in the static environment
dynamic typing: when typing is done in the dynamic environment.

>> No.54052440

>>54051262
Pls answer /g/

>> No.54052488

>>54052440
read the OS book by the minix developer
after that you should be able to read linux docs

>> No.54052512

>>54052488
I'd rather not read a book.

>> No.54052535
File: 447 KB, 900x506, cake.webm [View same] [iqdb] [saucenao] [google] [report]
54052535

>>54052440
https://www.kernel.org/doc/gorman/pdf/understand.pdf

>> No.54052552

>>54052512
then go fuck yourself

>> No.54052578

>>54052552
Fuck you you cuck

>> No.54052638

Just doing simple exercises so I too can one day become a programmer-pro.
And learning a bit about controlling my computer with the terminal, which is lots of fun.

All low-tier stuff, I guess.

>> No.54052716

>>54052512
hahaha what is this

>> No.54052724

>>54052638
i remember when I was this cute once

>> No.54052743

>>54052512
the average python "programmer" ladies and gentlemen

>> No.54052774

Writing a brainfuck REPL in Rust, I don't even know why.

>> No.54052855
File: 20 KB, 230x300, sweat.jpg [View same] [iqdb] [saucenao] [google] [report]
54052855

>>54052664
Well I knew about that I joined them like
LEFT JOIN forum_database_users u ON (u.UId = t.TAuthorId)
to get the author of the thread but I have really no idea how to get the lastpost author

>> No.54052923

>>54052855
Question:
What is 'LastPostFake'?

>> No.54052958

>>54052923
Everything with Fake is what the website reports, not what I have indexed, I barely ever use it

>> No.54052959

fizz buzz

>> No.54053079

So I'm on GNU/LINUX and want to compile C into 16-bit MZ executable for DOS and launch it in dosbox.
Any recommended compilers?

>> No.54053236

New thread >>54037326

>> No.54053425

>>54053236
fuck off, let that one die already.

>> No.54053464

>>54052958
Well...it's not a good idea to join from a date.

Just so we're clear:
We want the thread information, as well as the latest post you've indexed, and the name of the Author of that particular post.

I'm tinkering, give me a bit.

>> No.54053609

>>54053464
>Well...it's not a good idea to join from a date.
What do you mean? I don't think I was joining from a date

>We want the thread information, as well as the latest post you've indexed, and the name of the Author of that particular post.
Yes, maybe including the id of that particular post would be a good idea. Keep in mind that I only fetch user data when they create a thread in the website so some posts won't have user data while every thread owner will have user data, that's why I used so many ifnulls


On a unrelated note, do you think I should bother with "foreign keys"

>> No.54053623

>>54053236
fuck off retard

>> No.54053655
File: 25 KB, 543x463, System Overview.png [View same] [iqdb] [saucenao] [google] [report]
54053655

I've finished designing my system and making sure all the building blocks work, now I just have to implement the damn thing.

>> No.54053734

>>54053609
You already are using foreign keys, sort of.

To put it simply, "TId" in forum_database_users is a foreign key from forum_database_threads.

Is this a schema of your own creation?

There are some changes I could immediately make if I were administrating this database.

First an foremost, I would redo ALL of the column names to NOT use the P, U, or T prefix. That is pretty bad design and just makes life difficult.

Here's how a query could look:
SELECT
t.ThreadID,
t.Name AS ThreadName,
t.AuthorID AS Author,
u.Name AS AuthorName,
t.LastPostDateUnixFake,
COUNT(p.ID) AS PostCount,
FROM_UNIXTIME(MAX(p.DateEntered/1000)) AS LastPostIndexed
FROM
threads t
LEFT JOIN posts p ON p.ThreadID = t.ThreadID
LEFT JOIN users u ON u.UserID = p.UserID
GROUP BY
t.ThreadID,
t.Name,
t.UserID,
u.Name,
t.LastPostDateFake
ORDER BY MAX(p.DateEntered) DESC

>> No.54053867

>>54053734
Yes I made this schema from scratch

I kinda added the foreign keys just by try trial and error but I don't really know the benefits or what I could do with them, just heard it increased performance. maybe I'll remove them.

As for your suggestion I really like the prefixes because they make my life easier when I'm working on the indexer itself but I would love to hear some other suggestions you might have

>> No.54054350

One of my co-workers was apparently under the impression that even half a beer was enough to get you a DUI.

Poor guy. He wasn't partaking in Free Beer Fridays because he was afraid it was illegal to drive after drinking a single beer.

Python is worst language.

>> No.54054378

>>54054350
>Python is worst language.
Blasphemy

>> No.54054386

The answer is better compilers.
>The answer is better compilers.

THE ANSWER IS BETTER COMPILERS.

>> No.54054391

>>54054378
Okay, maybe not worst, but in the same sense that the ugliest chick at the party isn't the ugliest girl in the world.

>> No.54054399
File: 42 KB, 600x476, sd.jpg [View same] [iqdb] [saucenao] [google] [report]
54054399

>/dpt/ has never made anything that is used by 1,000+ users.

>> No.54054407

>>54054399
Well, aren't you Sherlock fucking Holmes?

>> No.54054409
File: 66 KB, 369x379, truth-at-harvard12.jpg [View same] [iqdb] [saucenao] [google] [report]
54054409

I'm implementing IEEE754 as bit lists in Python

>> No.54054424

>>54054391
>ugliest chick at the party isn't the ugliest girl in the world.
Nah man Python is that cool stoner chick who might not be the nicest to look at but is damn fun to hang around with.

>> No.54054446
File: 868 KB, 812x620, dfghfghfghfgh.png [View same] [iqdb] [saucenao] [google] [report]
54054446

So I almost got my firmware working.

I have one last problem.

Pic related is my switch matrix around the arrow keys, as you can see there are five rows and 16 columns.

>> No.54054468

>>54054424
And if you brought her to a business lunch, she'll embarrass the fuck out of you.

My programming language is metaphor form is a cute librarian that knows how to enjoy the little things, but is also extremely knowledgeable when necessary. She also knows how to talk to literally anyone, with a universally compatible personality type.

Guess my language-fu.

>> No.54054484

>>54054399
But I have, anon.

>1,000

Small time.

>> No.54054495
File: 33 KB, 471x355, why nigga, shit nigga.jpg [View same] [iqdb] [saucenao] [google] [report]
54054495

>>54054409

>> No.54054505

>>54054468
C?

>> No.54054507

>>54054468
Haskell?

>> No.54054509

>>54054446
What's this.

>> No.54054512

>>54054468
Common Lisp

>> No.54054524
File: 2.23 MB, 4592x3448, P1060546.jpg [View same] [iqdb] [saucenao] [google] [report]
54054524

>>54054446
This is the array which represents the switch matrix. KC_NO stands for an empty space, such as a column which doesn't extend all the way to the bottom. The 15th column, where those two arrow keys are attached would basically be sixth row since there's two switches in one column.

How do I put two keys in one column? Making a sixth row for the last arrow key is not an option.

>>54054509
A keyboard

>> No.54054526

>>54054505
>>54054507
>>54054512
Additional hint:
She's very low-maintenance, and doesn't need much coercion to do exactly as I tell here. I also never have to worry about her misunderstanding what I'm telling her, as she'll ask for clarification if I'm not explicit.

...which frankly rules all of these out.

>> No.54054535

>>54054495
I'm thinking of maybe making a programmer's calculator, and you should be able to change rounding rules, bases, toggle individual bits and shit

>> No.54054540
File: 60 KB, 1829x130, sdfsdfsdf.png [View same] [iqdb] [saucenao] [google] [report]
54054540

>>54054524
Well, thanks to anon I forgot that I wanted to attach a picture of the array

{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0G }, \
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1G }, \
{ KC_##K20, KC_NO, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_NO, KC_NO }, \
{ KC_##K30, KC_NO, KC_NO, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C }, \
{ KC_##K40, KC_NO, KC_NO, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \

>> No.54054560

>>54054526
I dunno, Ruby?

>> No.54054570

>>54052326

> tfw I'm gonna take the AP computer science course without taking the class just because I can

>> No.54054573

man xinput doesnt tell me much
can i use xinput to remap keyboard keys?

>> No.54054576

>>54054526
Java
C++


...Perl ?

>> No.54054592

>>54054524
Is that a diy keyboard from scratch ?

>> No.54054641

Any tips on getting familiar with Eclipse?

I've only coded Java using notepad but I need to be familiar with Eclipse asap.

>> No.54054675

>>54054641
>I've only coded Java using notepad
Jesus christ. Why?

Using an IDE like Eclipse or IntelliJ gives you lots of quality-of-life things, and the sooner you learn them, the better.

I can't remember which book I used for Java back in the day, or I'd recommend stuff. I'm sure Eclipse has decent 'Getting Started' documentation.

>> No.54054679
File: 2.07 MB, 4592x3448, P1060519.jpg [View same] [iqdb] [saucenao] [google] [report]
54054679

>>54054592
not entirely from scratch.

It's a magicforce, I wanted to replace the switches and ended up bricking parts of the PCB when trying to desolder them. I decided that it'd be easier to just handwire it and have a fully programmable keyboard (it was anyway about time that I'd learn how to use the TMK firmware) than it'd be to try to repair the PCB (which I spent an afternoon trying).

I took the casing and the gateron switches I wanted to replace the stock outemu blues with and wired them up to a teensy. Then I spent a good twelve hours configuring the firmware and subsequently fixing shit.

>> No.54054712

>>54054526
Scratch

>> No.54054719

>>54054641
>Any tips on getting familiar with Eclipse?
Ctr+Shift+O, Ctr+Shift+F, Alt+Shift+S, Alt+Shift+R, Ctr+Shift+T and Ctr+H

>> No.54054740

>>54054719
oh, I forgot the most useful one: Ctr+Shift+C

>> No.54054749

>>54054675
because my professor was a cunt who told us that's the only way to code with java until the last day of class

>> No.54054759

Do I have to find programming interesting enough to research/do it in my free time to get a job in it? I've recently started getting a CS degree and it seems like everyone else in my classes is more motivated than me.
Half the class asks questions that are beyond what the teacher has taught.

I mean, don't get me wrong, I like programming. My programming classes are the only ones I actually enjoy doing work for. At the same time, I don't feel any particular desire to write my own code unless I need to.
Should I just quit CS while I'm ahead?

>> No.54054775

>>54054759
Probably.

If you're not hungry to know more about particular things, ESPECIALLY in programming, you're going to be stuck in a single-class code monkey position.

>> No.54054784

can you help me finish my monty hall simulation?
https://en.wikipedia.org/wiki/Monty_Hall_problem

i'm trying to prove to /pol/ that it's not jewish tricks that switching is the best choice most of the time
>>>/pol/71040918

here's what i got so far

package montyHall;

import java.util.Random;

public class Simulate {

public static int generateNumber(int x){ // returns a random value between 1 and x
Random rand = new Random();
int y = rand.nextInt(x);
return (y + 1); // add 1 to change it from 0 inclusive to x exclusive, to 1 inclusive to x inclusive
}

public static void main(String[] args){
boolean[] doors = new boolean[3];
for(int i = 0; i < doors.length; i++){
doors[i] = false;
}
doors[generateNumber(3)] = true;

int selectedDoor = generateNumber(3);
}

}


i should be working on my algorithms homework instead of this crap but these 12 year olds are pissing me off

>> No.54054787

>>54054759
>At the same time, I don't feel any particular desire to write my own code unless I need to.

If you're just doing it for the money, you won't be happy.

>> No.54054796

>>54054740
Ctrl+Shift+R, Ctrl+O ?

>> No.54054812
File: 10 KB, 388x231, ss (2016-04-15 at 09.20.53).png [View same] [iqdb] [saucenao] [google] [report]
54054812

>>54054399
>not writing software that is being used by literally thousands of people at THIS VERY moment
Are you even trying?

>> No.54054816

>>54054784
ignore the random blooper with adding 1, you get what i'm going for in general though. i had copied and pasted that function from a different project i'm working on

>> No.54054818

anyone have any interesting ideas for side projects?
i have no imagination

>> No.54054824

If the end goal was make scheme like language compiler with easy interface to c++, how should I go on about it?
Code example could be something like
(c-include "foo.h")
(c-link "foo")
(let ((x (new Foo)))
(print Foo::static_var)
(print (x.fn)))

>> No.54054838

>>54054784
If they literally cannot understand the Wikipedia article, then what makes you think your shitty python script will convince them?

What if Python was created by a jew?

The wiki explains it in-depth already.

>> No.54054840

>>54054818
Try to make a QR code detection mobile app, preferably without usings libs

>> No.54054850

>>54054749
>not googling it
>not reading any books

>> No.54054862

>>54054840
>preferably without usings libs
Why?

>> No.54054884

>>54054775
To be honest, being a code monkey doesn't sound too bad. If I got paid a livable wage, I would be fine writing mostly monotonous code.

>>54054787
>If you're just doing it for the money, you won't be happy.
Like I said, I enjoy it well enough. So far, I think programming might be a good middle-ground between soulless high-paying work and penniless creative work. But if every programming job requires people who are super motivated, I fear I might not make the cut.

>> No.54054885

>>54054862
To learn shit. What else is there?

>> No.54054886

>>54054840
i would rather it be something that hasn't been done ad nauseum
but thanks for the idea

>> No.54054887

>>54054838
because i'll run ten thousand trials and they won't be able to beat me in arguments with their sheer level of retardation and lack of understanding

>> No.54054900
File: 234 KB, 700x624, shitposting.png [View same] [iqdb] [saucenao] [google] [report]
54054900

>>54054887
>arguing with /pol/
I think you're the one who's retarded.

>> No.54054958

>>54054759
Not at all. I'm a comp eng student who's just doing thing because I'm mildly interested in it and I'm pretty good at it. I've already worked a year placement doing one random language and various internship with others and I can tell you it's easy shit if you're not a complete social outcast and can nail interviews.

>> No.54054979

>>54054818
If you haven't automated your house yet get on it

>> No.54054996
File: 66 KB, 445x414, sweating man.jpg [View same] [iqdb] [saucenao] [google] [report]
54054996

>>54054958
>it's easy shit if you're not a complete social outcast

>> No.54055064

>>54053734
Did you manage to get the stuff working?

>> No.54055150
File: 1.81 MB, 1752x1166, repl.jpg [View same] [iqdb] [saucenao] [google] [report]
54055150

How many Libre Software LISP-descended systems with a REPL must a true Gentooman have installed on their system, /g/?

>> No.54055154

>>54052419

What's an environment?

>> No.54055158 [DELETED] 

>>54052326
Alright /g/, pic related is a code in Swift, what would be the Java equivalent of it?

>> No.54055172
File: 97 KB, 1860x636, wew.png [View same] [iqdb] [saucenao] [google] [report]
54055172

Alright /g/, pic related is a code in Swift, what would be the Java equivalent of it??

>> No.54055214

>>54055172
I started writing it down, but it doesn't fit into this textarea.

>> No.54055272

>>54055214
kek

>> No.54055274

>>54055172

What text editor/theme?

>> No.54055335

>>54055274
Xcode/Dusk

>> No.54055391

I wrote a small tic tac toe game.
Want to make something else to learn a bit of python. but not sure what

>> No.54055465

>>54055150
REPL is an acronym for "REEEEE poo in loo"

>> No.54055570
File: 171 KB, 800x600, buttserver.png [View same] [iqdb] [saucenao] [google] [report]
54055570

>>54055465

How many Rajeets do you know that do REPL based development?

>> No.54055597

Professional Java programmer here willing to help any of you with your assignments or homework

Here at /dpt/ we care about our programming members we are all a family

>> No.54055624

>>54055597
Fag

>> No.54055643

>>54055624
Liking 2d traps is not gay Anon...

>> No.54055647

>>54055597
Doing good work there anon, don't let douchebags deter you.

>> No.54055677

>>54055647
Thank you lets make /dpt/ great again by one real programming post at a time

>> No.54055692

>>54055172
so is Swift just an even shittier clone of JS?

>> No.54055695

>>54055647
We don't want Pajeet or any of his friends here.

>> No.54055701

>>54055692
No.

>> No.54055743

>>54055692
It's a worse Java

>> No.54055828

Is there a way to use php to hide a button for a set amount of time after it's pressed? All of the things I've seen on google for php timers are about execution time. I know it runs somewhat parallel on webpages so I don't think I can just you sleep to wait and then change a check variable back to 1.

>> No.54055831

found this on pol

if(car == 1){
status[0] = true;
}
if(car == 2){
status[1] = true;
}
if(car == 3){
status[2] = true;
}

>> No.54055878

>>54055692
Except it's just as powerful as C++ and Java, but faster.

>> No.54055886

>>54055828

<script>
<?php
$current_time = time();
//connect to db
// check if there is no expire timestamp in db
if($thereIsNoTimestampInDB){
$expire_time = $current_time + (24 * 60 * 60 * 3); // increase 3 days to timestamp
//save timestamp to database
}else{
//get Timestamp from DB and save it to $expire_time
if($expire_time > $current_time){
echo "var expired=true;\n";
}else{
echo "var expired=false;\n";
}
}
?>
</script>

>> No.54055902

>>54055172
looks like javascript, does it perform better than nodejs?

>> No.54055934

>>54055886
Thanks man, I'll give a go at implementing it.

>> No.54055962

>>54055934
You are welcome my main programming language is Java though. I haven't done php in awhile.

>> No.54056058
File: 222 KB, 1600x1920, 1459111126188.jpg [View same] [iqdb] [saucenao] [google] [report]
54056058

>>54055878
>faster than C++

>> No.54056084

I like pegging.

>> No.54056159

>>54056084
whats that?

>> No.54056170

>>54055878
>faster than C++ and Java
http://benchmarksgame.alioth.debian.org/u64q/swift.html
considering Objective-C is generally slower than C++ how would you even think Swift (which has been known to be slower than Objective-C from the beginning) would be faster?

>> No.54056208
File: 70 KB, 1476x222, fast.png [View same] [iqdb] [saucenao] [google] [report]
54056208

>>54055902
>>54055692
https://swift.org/about/

>> No.54056255
File: 102 KB, 1112x896, kys.png [View same] [iqdb] [saucenao] [google] [report]
54056255

>>54056170

>> No.54056308

>>54056255
maybe for small benchmarks
idiomatic Swift is going to be slower and performance in full programs will most likely suffer
https://blog.sudeium.com/2015/02/10/swift-1-dot-2-performance-pretty-much-fine/

>> No.54056491

>>54056308
> feb 2015 news
lad, we're on 2.2 now, update your shit man.

>> No.54056498

>>54056491
let's see some real world statistics then
there's a reason apple wrote "Up to"

>> No.54056712

>>54053655
>Webportal as a home automation interface

The pajeet is too strong

>> No.54056727

I'm building a GCC cross compiler, is it possible to specify the target triplet to produce a flat 16 or 32 bit binary? if not, is writing an ELF loader in a second stage bootloader a good idea? or too much work?
I absolutely will not use GRUB.

>> No.54056997
File: 58 KB, 246x162, 1383858664.png [View same] [iqdb] [saucenao] [google] [report]
54056997

>>54056727
>I'm building a GCC cross compiler
you're fucked m8.

>> No.54057012

>>54056727

The problem with building flat binaries is that you don't really have clear distinction between data and code segments. To my knowledge, no currently supported GCC target triplet supports flat binary formats, so if you really wanted to make your own binary format for everything, you'd have to port GCC to your system.

Also, it is perfectly acceptable to make your own ELF loader in your bootloader. You could also make a PE loader if you'd prefer to use that instead. Although if you plan on using PE, you're pretty much limited to x86 and... well, ARM support for PE files is pretty shitty, and PE on any other architecture is dead (even if Win NT supported MIPS or PowerPC at one point). So yeah, just make your own ELF loader. It's not THAT complicated of a format.

>> No.54057098

>>54057012
Alright, thanks. I'll write an ELF loader.
Btw, do I need to have two cross compilers, one for 32bit protected mode and another for long mode? or can x86_64-elf produce 32bit protected mode code using -m32?
Should I be building an x86_64 cross compiler instead of i686 regardless if I'm using long mode? I do plan on going into long mode at some point in time however.

>> No.54057150
File: 8 KB, 205x246, 1456382262546.jpg [View same] [iqdb] [saucenao] [google] [report]
54057150

> tfw developers who literally do nothing but write to spec

The bane of my existence. If your write your shit to spec and all text on the website becomes purple, fucking talk to someone about it. You don't sit alone in your own little bubble, there rest of your team and any other team that you interact with (sysadmins, product managers, app support, etc) have to deal with the consequences of your laziness. "Oh but I wrote it to spec!" Go fuck yourself.

>> No.54057182

>>54057150
I like to write a spec for large hobby projects, and then get onto the programming and use the spec as a reference, so I don't forget any ideas I might have come up with.
But of course, I modify the spec where due.
Anything wrong with that? or is it just stupid?

>> No.54057255
File: 36 KB, 381x499, beyondfizzbuzz.jpg [View same] [iqdb] [saucenao] [google] [report]
54057255

who here ludum dare?

>> No.54057308

>>54057182
That's fine because you're flexible. The spec isn't law, it's just a representation of the goal.

>> No.54057319

/* grab the sprite offset */
lua_getfield( L, -1, "sprite" );
lua_getfield( L, -1, "offset" );
lua_getfield( L, -1, "x" );
offset.x = floor( lua_tonumber(L, -1) );
lua_getfield( L, -2, "y" );
offset.y = floor( lua_tonumber(L, -1) );
lua_getfield( L, -3, "w" );
offset.w = floor( lua_tonumber(L, -1) );
lua_getfield( L, -4, "h" );
offset.h = floor( lua_tonumber(L, -1) );
/* grab the sprite frame */
lua_getfield( L, -7, "sprite" );
lua_getfield( L, -1, "frame" );
int frame = floor( lua_tonumber( L, -1 ) );
/* grab the sprite clip */
lua_getfield( L, -2, "sprite" );
lua_getfield( L, -3, "clip" );
lua_rawgeti( L, -1, frame );
lua_getfield( L, -1, "x" );
clip.x = floor( lua_tonumber(L, -1) );
lua_getfield( L, -2, "y" );
clip.y = floor( lua_tonumber(L, -1) );
lua_getfield( L, -3, "w" );
clip.w = floor( lua_tonumber(L, -1) );
lua_getfield( L, -4, "h" );
clip.h = floor( lua_tonumber(L, -1) );
/* grab the sprite texture */
lua_getfield( L, -5, "sprite" );
lua_getfield( L, -6, "texture" );
int texture = floor( lua_tonumber( L, -1 ) );

My lua script is holding an entity table, which has a sprite table inside it. It's not my intention to throw everything on the script side, I just want the script side to hold "metadata". I'm experimenting, and right now I need a little clarification on something. What can I do to easily go back to the sprite table, and go to the next field in it with -1? I tried settable and insert but those didn't seem to work. Thanks

>> No.54057422
File: 39 KB, 494x724, browser #112.png [View same] [iqdb] [saucenao] [google] [report]
54057422

same shit; different day

>> No.54057585

>>54057098

>or can x86_64-elf produce 32 bit protected mode code using -m32?

Maybe? Fucking try it. I'm too lazy to turn on my shitty ass build box in the living room to see if it'll work.

>>54057150

If the spec is flawed, the programmer can't be blamed.

>> No.54057667

>>54052326
CS50x

Anyone else doing CS50?

>> No.54057771

OK /dpt/, I want your opinion on something.
I am studying a new pattern of development that I never saw before (MVP).
To study it, I downloaded an example source code and I am creating my own App, but taking a look on that source code to make sure I am doing the right thing.
Am I a bad programmer for doing this?

>> No.54057832

>>54057771
Yes.

>> No.54057833

>>54057771
for using mvp instead of mvc? yes

listening to fowler when you're starting out is a recipe for self-loathing and underproduction

>> No.54057916

>>54057832
What would be the right way to learn a new pattern or concept if I never saw or used before?

>>54057833
Care to elaborate?
MVP seems to be pretty solid way to deal with Android development.

>> No.54057979
File: 4 KB, 640x400, tc_000.png [View same] [iqdb] [saucenao] [google] [report]
54057979

I'm trying to get Borland Turbo C to work under dosbox.
Linking shits itself, pic related.

>> No.54057981
File: 31 KB, 225x272, Fun.jpg [View same] [iqdb] [saucenao] [google] [report]
54057981

>>54057585

There's a difference between following a flawed spec and not giving a fuck when things are clearly wrong.

>> No.54058045

>>54057979
Ok, got it. Wrong /lib folder

>> No.54058262

>>54057979
>obsolete compiler in an emulated obsolete os

Why torture yourself? What good could come from it?

>> No.54058324

>>54058262
Displaying meme images using 320x200 256 color mode

>> No.54058399

>>54058262
>obsolete compiler in an emulated obsolete os
Agreed, he should be using DJGPP like a sane person.

>> No.54058466

>>54058399
Oh, ther's also Open Watcom which is faster but more of a pain in the ass to deal with than DJGPP.

>> No.54058540

>>54055831
Looks like a keyboard status map, also:

status[car] = true;


will register when 'car' key is pressed.

>> No.54058581

>>54057319
nevermind, I forgot lua_pop lol

>> No.54058592
File: 8 KB, 177x238, manly_tears.jpg [View same] [iqdb] [saucenao] [google] [report]
54058592

>>54058324
>13h mode
>Best mode

>> No.54058595

Is it possible to make a regexp that can match either characters or strings?
"[,=()] | wew" doesn't work as expected.

>> No.54058623

Hey /g/ got a question for you.

I am trying to implement when a user inputs a number after trying choose an account to work with to be able to stay on that account with that specific information and not other ones. Any idea on how one would implement something like this? Here's what I got so far.

int main()
{
Account acc0, acc1, acc2, acc3, acc4, acc5, acc6, acc7, acc8, acc9;
Account list[10] = { acc0, acc1, acc2, acc3, acc4, acc5, acc6, acc7, acc8, acc9 };

acc0.setAccountId(0), acc1.setAccountId(1), acc2.setAccountId(2), acc3.setAccountId(3),
acc4.setAccountId(4), acc5.setAccountId(5), acc6.setAccountId(6), acc7.setAccountId(7),
acc8.setAccountId(8), acc9.setAccountId(9);

int inputaccnum;
cout << "Please enter an account number from 0-9: " << endl;
cin >> inputaccnum;
acc0.setBalance(rand() % 20000 + 10000);
acc0.setInterest(1.5 + ((double)rand() / RAND_MAX) * (5.0 - 1.5));

int menuchoice;
do
{
cout << endl << "Enter 1 to make a deposit" << endl;
cout << "Enter 2 to make a withdraw" << endl;
cout << "Enter 3 to check balance" << endl;
cout << "Enter 4 to check interest rate" << endl;
cout << "Enter 5 to display account summary" << endl;
cout << "Enter -1 to return to the main menu" << endl;
cin >> menuchoice;

if (menuchoice = 1)
{
int deposit;
cout << "Enter the amount you'd like you to deposit: ";
cin >> deposit;
acc0.deposit(deposit);
}
else if (menuchoice = 2)
{
int withdraw;
cout << "enter the amount you'd like to withdraw: ";
cin >> withdraw;
acc0.withdraw(withdraw);
}
else if (menuchoice = 3)
{
cout << "Current Balance: " << acc0.getBalance;
}
else if (menuchoice = 4)
{
cout << "Monthly interest rate: " << acc0.getMonthlyInterestRate << endl;
cout << "Yearly interest rate: " << acc0.getInterest;
}
return 0;
}

>> No.54058757

C++ bros, i need help again.

Is there a color/class container that can store rgb values kind of like

CONTAINER rgb;
rgb.red = GetRValue(color);
rgb.green = GetGValue(color);
rgb.blue = GetBValue(color);

I was using int variables but its not efficient.

>> No.54058774

>>54057979
> autism

>> No.54058808

>>54058595
I'm no regex wizard, but what about
([,=()] | wew)

>> No.54058821
File: 72 KB, 320x200, dosbox_009.webm [View same] [iqdb] [saucenao] [google] [report]
54058821

>>54058592
It works.

My converter is in C#. Now I have to learn how to do the work using backgroundWorker, in order to get a progressbar and to prevent UI from freezing.

>> No.54058984

>>54055743
It's a better C#

>> No.54059005
File: 1.66 MB, 1680x1010, Untitled.png [View same] [iqdb] [saucenao] [google] [report]
54059005

I just changed the mouse behavior in browser #112 so it doesn't instantly switch to a different thread when the tile's thread changes and the mouse moves. I used to think that was a desirable feature, but it's annoying when accidentally bumping the mouse and losing the thread I'm reading.

this image gives a hint at what I mean. this thread moved to a different tile while I was reading it. now when I bump the mouse I stay in the same thread. and all is right in the world.

/end blog post

>> No.54059056

>>54059005
what happens if the web devs change something, will the browser break?

>> No.54059065

>>54058757
make one? tf
and it would be more pythonic do do 'color.getRValue()' etc

>> No.54059122

>>54059056
it's a possibility. #110 had trouble after the last major site change (apr/may 2014?).

#111 fixed things, but was unreleased.

and now #112 is nearing release. I anticipate much whining when people see it's just the exe and not the code.

>> No.54059226

>>54059005
well shit. spoke too soon.
changing that behavior introduced a new (old, and annoying) problem where the mouse enters the grid and displays the wrong thread. had to revert.

>> No.54059238

So lets say you're using curl on a page.

3/5ths of the time it returns a link
1/5th of the time it returns a link to the link you want
1/5th it returns a page that just says please wait... and then redirects to a page that has the link when in browser

When you use curl and it happens to be that 1/5th what can be done so it redirects to the second page to get the link

>> No.54059259
File: 47 KB, 579x300, ..jpg [View same] [iqdb] [saucenao] [google] [report]
54059259

>>54059238

>> No.54059272

Just in case you had forgotten:

http://www.bbc.co.uk/news/technology-35559439

>> No.54059300

I'm not familiar with the codebase, but I'm looking into contributing to Visual Studio Code. It really needs an option to change the syntax of the current file.

>> No.54059304

>>54059272
yeah, and male birth control is coming any day now (they said that 50 years ago).

basically, news articles don't always amount to much.

>> No.54059318

>>54059300
>change the syntax of the current file.
What does that even mean?

>> No.54059330

>>54059259
Can you please explain your post

>> No.54059335

>>54059065
Rate my code

int class container
{
int red(int redvalue)
{
int redcontainer;
redcontainer = GetRValue(redvalue);
return redcontainer;
}
};

>> No.54059352

>>54059335
no

>> No.54059355

>>54059318
Oops, I meant syntax highlighting.

>> No.54059370

>>54059318
>>54059355
Fuck, I meant syntax highlighting mode. Like set to use C++/Python/CSS style highlighting for a file type it might not be familiar with.

>> No.54059378

>>54059330
It means, Rephrase the question.
But I don't use CURL so I doubt I can help.

>> No.54059405

>>54059378
So you curl a page

1/3rd of the time it returns a "Please wait..." page
This page, on a normal browser would redirect to a second page that has the link that I am trying to get

however, due to this being curl it only downloads the page with the "Please wait..." and has no information which would allow me to get to the second page that has the link that I need.

How can I get a workaround with this

>> No.54059418

>>54059370
You want Visual Studio (the IDE?) to do syntax highlighting for foreign file types? What's the point? I haven't used it in years.

>> No.54059431

>>54059418
Visual Studio Code
https://en.wikipedia.org/wiki/Visual_Studio_Code
It's free software and cross platform. I have no idea why it has "Visual Studio" in the name though.

>> No.54059438

>>54059405
sounds like a "recursive" thing.
I know how to code for it, but don't know curl.

>> No.54059450
File: 274 KB, 600x480, himelewd.jpg [View same] [iqdb] [saucenao] [google] [report]
54059450

So I'm putting some of the finishing touches on my C++ backend and looking to begin development of the frontend. The frontend will get data through a tcp/ip connection with the backend, data will be serialized with ProtoBuf. the GUI on the frontend will be pretty simplisitc, think tables and graphs, mainly trying to display data in a neat manner with few added frills needed.

What language does friday night /dpt/ recommend I use? choices are C++, C#, GO and Python. what GUI library does /dpt/ recommend with that? I only have minimal experience with C#/VS GUI development.

thanks lads.

>> No.54059457

Which term do you prefer, 'nipple brackets' or 'curly braces'?

>> No.54059466
File: 2.65 MB, 1280x720, 1460598916863.webm [View same] [iqdb] [saucenao] [google] [report]
54059466

>>54059457
Doesn't matter what you call them. They SUCK. Only shitty parsers need them.

>> No.54059469

>>54058821
Now I'm trying to read files containing image data. I want to use int 21h, but somehow I fail.

>> No.54059477

>>54059450
Protobuf with node is amazing. Seriously way better than the others but I'd probably go with Go from your choices. Idk about gui

>> No.54059493

>>54059477
Go kicks ass. It has wrappers to create GUI applications, but I've never worked with that.

>> No.54059549

>>54058757
>>54059335
Shit.
struct Color {
unsigned int red : 8;
unsigned int green : 8;
unsigned int blue : 8;
};

>> No.54059567

>>54059549
>unsigned int red : 8;
Use uint8_t, turbonerd.

>> No.54059598

>>54059567
>not using uint_fast8_t typedef'd as u8
pls fgt, I'm trying to make things ez for the newbie, plus it's not like it has any difference in code generation when you're using bitfields.

>> No.54059781

>>54059549
Thanks anon, im a noob programmer.

Also, isnt that what structs are, just containers for information in a more structured way?

>> No.54059827

>>54058623
Anyone willing to do my c++ homework from this code I posted as long as they delivar within 24 hours? Totally willing to pay the dude $10 and it's probably more than half done at this point.

>> No.54060022

>>54059450

As a Python dev (specifically Flask and Django) making GUIs in Python is kind of a pain in the ass unless you're doing web stuff.

I'd say C# because GUIs in VS are easy peasy.

>> No.54060050

Will VR headsets make it easier to code GUIs?

>> No.54060075

>>54060050
Maybe "code" wasn't the best word.
Will VR (and hand-tracking) make it easier to layout/design GUIs?

>> No.54060086

haskell is fucking nutty

>> No.54060113
File: 28 KB, 320x200, dosbox_010.webm [View same] [iqdb] [saucenao] [google] [report]
54060113

>>54059469
File opening works.
Now I need to make some kind of loop system. I need an array of pointers to filenames.

>> No.54060132

>>54060113
I forget, which prog does the screencap webms?

>> No.54060197

>>54060132
dosbox has built-in support for capturing avi, and then I simply convert it to webm

>> No.54060209

>>54060197
Why do people still use AVI?

>> No.54060252

>>54054399
tox already accomplished that

>> No.54060260

>>54060209
its an extremely simple container to implement,

you could stuff h265/aac streams in it if you wanted

>> No.54060341

>>54060260
But as a result, don't the files tend to be pretty large, even with lower quality?

>> No.54060394

>>54060197
oh
well, I googled for my own, and will try this to record the screen:
https://technet.microsoft.com/en-us/magazine/2009.03.utilityspotlight2.aspx

>> No.54060466

>>54060341
sure, but its easier for software (dosbox in this instance) to record the screen context and put it in an AVI for outside programs to consume.

getting mp4 or mkv or what have you working would require far more time/resources than
stuff this in an AVI container, with no sound:
>The video portion of the movie is encoded with the 32bit ZMBV (Zip Motion Block Video) CODEC, which allows for reasonably fast encoding of low color content.

>> No.54060577
File: 22 KB, 396x155, Untitled.png [View same] [iqdb] [saucenao] [google] [report]
54060577

>>54060394
RIP system32

>> No.54060598

hello lads

>> No.54060629
File: 45 KB, 1078x851, FUCK THIS.png [View same] [iqdb] [saucenao] [google] [report]
54060629

Anyone here knows boostrap/css? This shit is driving me nuts

My structure goes basically like this

div.row
div.col-sm-12
div.row.data-container
div.col-md-4.data-panel
h2
div.well
my shit here



well seems to be fucking shit up with it's padding, how do I fix this?

>> No.54060652

>>54060629
>front-end
Found the faggot.

>> No.54060669

>>54060652
If I worked with this I would've solved it by now

>> No.54060678

>>54060086
just becaues your dumb doesnt mean you should be so nasty to other languages. haskell is fun, challenging and a much smarter language then whatever you use

>> No.54060689

>>54059549
Why on earth would you use bit-fields for this?

>> No.54060703

>>54059598
Sounds to me like you're the newbie here. Go back to C 101.

>> No.54060709
File: 156 KB, 579x971, Untitled.png [View same] [iqdb] [saucenao] [google] [report]
54060709

>>54060577
I'm getting my anus prepared.
that ugly orange text isn't very encouraging.

>> No.54060719

>>54059493
Go is a badly designed language. All it has going for it is speed.

>> No.54060723

>>54057012
>To my knowledge, no currently supported GCC target triplet supports flat binary formats, so if you really wanted to make your own binary format for everything, you'd have to port GCC to your system.

AVR supported that, I used it. Anyway, how do they build flash images for openwrt routers then? There surely is a way.

>> No.54060737

>>54059466
Enjoy your inferior, slow-as-heck toy language.

>> No.54060741

has anyone ever used PostgreSQL with C++? It looks like there's a C library called libpq and then libpqxx with questionable maintenance/upkeep. what would be the recommendation?

>>54060598
hello GTP, good to see your social life is still active and exciting.

>> No.54060745

>>54060741
>hello GTP, good to see your social life is still active and exciting.

Well, I did just get home from being out all day. I'd say my social life is just fine.

>> No.54060749

I am making $3000 a week doing web dev but I hate it and it's so boring and not real programming what it do?

>> No.54060751

>>54052774
Nice.

>> No.54060763

>>54060749
keep doing it, its 3k a week

>> No.54060776

>>54060763
But I want to do real programming and all the places nearby are web development javascript and php no C++ or C feels bad man hell I'd even take Java

>> No.54060782

>>54060749

What web dev are you doing and where?

>> No.54060785

>>54060737
Actually, it's obscure, fast-as-hell language.

>> No.54060820

>>54060785

which language is that?

>> No.54060848

>>54060820
PowerBASIC

>> No.54060874

>>54060848

Lad...

>> No.54060885

>>54060874
>Tfw you, Ruby, and OSGTP will never be in a wild interracial orgy with black shemales all programming in the same room afterwards

>> No.54060894

>>54060874
Pretty much the response I expected. Those who have never used it almost always thumb their nose at it (most likely because they see "BASIC")

>> No.54060903

I have to do it guys. I'm going to learn Java.

I'm taking the mandatory course in it over this summer and I want to go in knowing it already.

I want that easy Google Play Store money too, so I'm probably going to make some shitty game at some point.

How should I learn Java? I pretty much know the basics (i.e. its OOP), I know some C++ etc, but nothing really about the standard library and whatnot.

Any recommended books/resources? Thanks.

>> No.54060910

>>54060903
>He thinks it's easy to make money on Google Play store

LaughingSystems.exe

>> No.54060922

>>54060903
Something I've found works well for getting the feel of a new language is to take code from a language you already know and translate it into the new language. Once you do a basic translation go back and optimize it for that current language.

>> No.54060923

>>54060910
Not loads obviously. One of my acquaintances has some shitty apps up and makes some change from it.

>> No.54060938

>>54060922
Good idea, I'll try that out, thanks.

>> No.54060945

>>54060923
What apps are they and how much change?

>> No.54060950

>>54060894

I don't hate BASICs, I just don't think I've heard anything positive about PowerBASIC. I don't think I've ever heard anything about PowerBASIC.

>>54060885
>wild interracial orgy

Yes!

>black shemales

No, damn it!

>> No.54060958

Java is the language of aristocrats and noblemen.

public static void main (String[] args){

int n = 10;
System.out.println(fibonacci(n));

}

private static long fibonacci (int n){

if(n == 0)

return 0;

else if(n == 1)

return 1;

else

return fibonacci(n - 1) + fibonacci(n - 2);

}

>> No.54060995

>>54060958
>all of those extra blank lines
>recursive fibonacci in java
gf

>> No.54061033

>>54060950
>I don't think I've ever heard anything about PowerBASIC.
Like I said -- obscure. It doesn't help that there's no free demo for it, and the only/main creator died ahwile back. But his creation lives on.

>> No.54061042

>>54061033

Gimme the deets, nigga. I want to hear about how fast it is.

>> No.54061082

>$200 compiler for PowerBASIC

It's like I'm back in the 1980s before free compilers were a thing.

>> No.54061083

I know neither Objective-C nor Swift. Should I bother learning Obj-C, or just focus on Swift?

>> No.54061116

>>54061083

By learning one you'll largely be learning the other.

>> No.54061122

>>54061083

Considering Swift is the new hotness meant to replace the aging Obj-C, learn Swift.

>> No.54061138

>>54060958

If you say so, bit writing an O(2^n) Fibonacci is unacceptable.

>> No.54061148
File: 1.26 MB, 840x668, browser.webm [View same] [iqdb] [saucenao] [google] [report]
54061148

>>54060709
ok, that screen recorder program was shit and had no way to control the video quality. but here's the result after converting to webm.
this webm makes browser look like shit, but here it is anyway.

>> No.54061157

http://www.cplusplus.com/reference/cstdlib/atoi/
For something like this would it be possible to pass parts of an array with pointers? (i.e. I want atio to convert the first and second half of an array into separate ints)

>> No.54061171

>>54061138

Right? Everybody knows to use the closed form equation.

>> No.54061186

>>54061042
It's can be as fast as C (if you don't write crappy code), and let's you use inline assembly.

>> No.54061203

>>54058623
you already have your array of accounts declared. In your menu choices, rather than setting the values of acc0, set the value of the account at the index inputaccnum

list[inputaccnum].deposit(deposit);//etc

>> No.54061207

>>54061186

Interdasting. Since you use it, any sample code?

>> No.54061305

I'm reading the C# Players Guide and just got to the section on reference and value types. I understand the difference between the two but when I got to the 'Test Yourself" section I incorrectly thought that value types live on the stack and not the heap. In what situations are value types stored on the heap?

>> No.54061356

>>54061083
swift

not that it matters since obj-c is easy anyway and you can pickup both

>> No.54061359

>>54061207
What, like "Hello, world?"

>> No.54061367

>>54060629
pls

>> No.54061391

>>54061359

I mean real things that you've actually used it for.

>> No.54061430

>>54061305
value types are stored on the stack. what was the example you got wrong?

>> No.54061456

>>54061391
It would be a wall of text.

Just imagine a mixture C/C++/BASIC, along with winapi calls, but WITHOUT the annoying braces {
and the semi-colons;
}

To me, PowerBASIC is like taking C/C++ and making it easier to understand and nicer to look at. The ALL CAPS default for the language's keywords took some getting use to, but I don't mind it now.

>> No.54061503

>>54061456
He was asking for a wall of text you twit.

>> No.54061507
File: 260 KB, 1921x1075, proyecto2.png [View same] [iqdb] [saucenao] [google] [report]
54061507

I'm interested in c# gui's for sql

can you suggest me any books or tutorials about oledb or anything db related?

>> No.54061531

>>54061430

That's what I thought. It was a series of true/false questions. This was the specific question:

The contents of a value type can be placed in the heap.

Answer:
True

>> No.54061542

>>54061305
value types can be either in the stack or heap depending on how you do them

reference is always on the heap

a value type member of a class is on the heap for example

>> No.54061565

I hate this fucking job search. I don't want any of these jobs but I have to beg for every single one.

I just want to make games even though I have no goddamn experience, but I'm not going to be able to do that if I'm working full hours on something else

>> No.54061597

>>54061305
https://blogs.msdn.microsoft.com/ericlippert/2010/09/30/the-truth-about-value-types/

>> No.54061601

>>54061391
OK, say you have a bunch of text (a string; a file; a webpage; whatever).
This pulls out some text based on its surroundings:
FUNCTION IsolateText (BYREF sourceText AS WSTRING, BYREF startText AS WSTRING, BYREF endText AS WSTRING, OPTIONAL BYREF initialPos AS LONG) AS WSTRING
LOCAL startPos, endPos AS LONG

startPos = IIF(ISMISSING(initialPos), 1, initialPos)
startPos = INSTR(startPos, sourceText, startText)
IF startPos = 0 THEN
IF ISFALSE(ISMISSING(initialPos)) THEN initialPos = 0 'return 0 if not found
EXIT FUNCTION
END IF
startPos += LEN(startText)
IF ISFALSE(ISMISSING(initialPos)) THEN initialPos = startPos
endPos = INSTR(startPos, sourceText, endText)
FUNCTION = MID$(sourceText, startPos TO endPos - 1)

END FUNCTION


It's called like this:
tempStr = IsolateText(hugeStr, "starting text", "ending text")

>> No.54061616

>>54061565

As a person who works full time but also does filmmaking for a hobby (which is a very time consuming process) you have time to work on your game in your free time. It's about prioritizing what you do with your free time. This means less time gaming and posting on g and more time spent working.

>> No.54061619

I really wish 4chan had a preview option before posting.

>> No.54061633

>>54060678
simmer down my fellow haskellfag, he didn't even say anything insulting, haskell is kind of nutty, it's what makes it so fun

>> No.54061636

>>54061601

I don't think I like it. If you do, more power to you, though.

>> No.54061637

>>54061503
Yes, but the wall of text doesn't have proper syntax highlighting, as seen here:
>>54061601
I realize now that I should have just posted a screenshot.

>> No.54061660

>>54061619
Make one

>> No.54061670

>>54061636
Posting code here doesn't do it justice.

I don't understand how someone could NOT like simplicity though. PB is such a nice language to type.

>> No.54061684

>>54061660
It should be built-in, ass. I shouldn't have to muck around with my own css script or whatever.

>> No.54061686

>>54061597

That was a very interesting article. Thanks for the post. That definitely cleared up some of my confusion. I think the rest of it will make more sense as I get more familiar with C#.

>> No.54061705
File: 19 KB, 1369x293, IsolateText.png [View same] [iqdb] [saucenao] [google] [report]
54061705

>>54061601
Here's the screenshot of the IDE.

>> No.54061722

How do I make a topdown shooter not look like shit without ripping off bubble tanks?

>> No.54061740

>>54061722

Look for a graphic designer to help you.

>> No.54061742

>>54061670
>I don't understand how someone could NOT like simplicity though.

Everything is in caps and it's more wordy when you have the specify the type using "varname AS TYPENAME" rather than "typename varname".

Just my useless $0.02

>> No.54061745

>>54061722
cool effects go a long way

>> No.54061761

>>54061180


anyone got any reccomendations?

I'm currently finishing up java, and was thinking about going into python specifically for game development, but i also wouldn't mind learing about some advanced stuff in other languages like c# or visual basic.

>> No.54061776

Also, while we're on the subject, did you actually pay $200 for the compiler, or did you pirate it?

>> No.54061777

>>54061705

So instead of brackets you just have giant ugly END FUNCTION and END IF lines. Python does important white space right, that's still ugly as hell.

>> No.54061853
File: 32 KB, 506x478, case.png [View same] [iqdb] [saucenao] [google] [report]
54061853

>>54061742
>caps
The IDE allows for changing the case.
And vars don't have to be specified at all (if you wanna keep it simple). Or, it let's you make macros which makes the powerbasic language look like another language.

>> No.54061892

>>54061776
I acquired it in the usual way.

>> No.54061940

>>54061777
I don't see how a discreet bracket is better than "end function"

Either way, it's going to take up a line, right?

Brackets can appear many times within a function, but only END FUNCTION can appear at the ends of functions in powerbasic. Seems easier to read to me.

>> No.54061964

>>54061940
What I mean is, as I'm looking down the code, do I think "oh, there's a bracket. I'm at the end of the function! No wait, that's just the end of the if or select block, nevermind.

In any case, no matter the language, indention is important. That's the key to readable code.

>> No.54061977

>>54061940

I'm a Python developer. I don't like brackets or END FUNCTION lines. It's all ugly and unnecessary to me. It's a bunch of stuff that adds unnecessary lines and unnecessary effort to sift through.

An OO language with important white space and static typing is the best of the best if you ask me.

>> No.54061989
File: 31 KB, 526x295, 3242623234.jpg [View same] [iqdb] [saucenao] [google] [report]
54061989

need some help /dpt/. I am this fellow >>54060741

if you've never used postgreSql/libpq you may still have some insight, it's more of a linux question, I'm still pretty new to my ubuntu install.

I installed this C++ connection library called libpqxx that comes in the apt-cache with postgreSQL. I used dpkg to find where the fuck it went, but only found doc files which includes a README and a .so file. the README says to install I simply need to configure, make and make install. but I have no idea which dir I need to get to so I can run the configure and makefile.

any thoughts lads?

>> No.54062028

Red pill me on this 5 yr old code
http://www.fssnip.net/2X

>> No.54062069

Why isn't my code work?

http://pastebin.com/wtPfgg90

>> No.54062098

>>54062069
use some bloody loops faggot

>> No.54062112

>>54062028
that would be a F# implementation of a generic Top-Down-Operator-Precedence Parser as described in this paper http://portal.acm.org/citation.cfm?id=512931

>>54062069
you really expect anyone to read through all that garbage? what exactly isn't working?

>> No.54062132

>>54062098
So I was just playing with some kid by the name "IuseGoto" on Rocket League. I called him out on "considered harmful" and he started telling me how it was bullshit. Which one of you fuckers was that?

>> No.54062137

>>54062132
WHY THE FUCK DO I ALWAYS FORGET TO REMOVE THE QUOTE FUCK ME.

>> No.54062149
File: 381 KB, 528x528, required reading for (You).png [View same] [iqdb] [saucenao] [google] [report]
54062149

>>54062132
>/dpt/ prefers to program imperatively

>> No.54062162

>>54057667
dafuq is cs50

You know the numbering system is different for pretty much every school right

>> No.54062169

>>54061989
needed to install the -dev package as well lads.

linux sure can get your panties in a bundle over silly things sometimes...

>> No.54062190

>>54062149
>imperatively
>SICP
ok

>> No.54062202

>>54062162

It's assumable that in these situations the poster is talking about the CS50 class offered by EdX (largely because of the x at the tail end of when they first said CS50).

Not everyone is familiar with EdX though obviously.

>> No.54062203

>>54062162
You could Google it. It's Intro to Programming at most schools.

>> No.54062284

I thought I would be able to make a CFG to CNF or GNF program in python but it's way over my head. Any tips to get me started?...

>> No.54062358
File: 3 KB, 125x122, smug moss.jpg [View same] [iqdb] [saucenao] [google] [report]
54062358

>>54062284
>meme to meme or meme program in meme language

>> No.54062489

>>54062358
your autism is showing

>> No.54062517

>>54062489
you can't serialise my autism, I'll Show You => (You)

>> No.54062523
File: 79 KB, 307x400, 1452403462016.png [View same] [iqdb] [saucenao] [google] [report]
54062523

>>54062358
>meme meme meme meme meme meme meme meme meme

>> No.54062535
File: 68 KB, 1280x720, (ME).jpg [View same] [iqdb] [saucenao] [google] [report]
54062535

>>54062523
what would you have preferred

>> No.54062681

Hey guys, just started my foray into Java, copying an ancient Conway's game of life I had done in C. Part of the program takes a text file like so:

....0...00.000.00.....
...0..0.00.0..........
.....00...0..........0
...000............00.0
.00.....00000.......00
.....00.......0000...0


From this, I create a 2D array of Booleans. The way I did it back then was retarded but it worked: I read through the file to get a width and height, then read essentially read through it again, entering the data into the 2D array that was made.
For some reason, I'm getting a crash when trying to print the array. It happens when trying to print the second row, the first prints fine. In my test file, I have a 50x150 grid.

while ((c = input.read()) != -1) {
if (c == '0') {
alive++;
}
if (c == '\n') {
height++;
widthFound = true;
} else if (!widthFound){
width++;
}
characterGrid[i++] = c;
}
input.close();
characterGrid[i] = 0; // sentinel
grid = new Boolean[height][width];

//...

for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
System.out.println("i: " + i + ", j: " + j);
if (grid[i][j]) { // Crashes here on i = 1, j = 25, giving null pointer exception ********
System.out.printf("█");
} else {
System.out.printf(" ");
}
}
System.out.printf("\n");
}

Any ideas? Thanks.

>> No.54062703

Website almost ready..

But deploying it.. haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


._.

>> No.54062853
File: 655 KB, 500x657, W9WTcKSC.png [View same] [iqdb] [saucenao] [google] [report]
54062853

>What are you working on, /g/?

Thinking of doing simple game programming in C++.

>> No.54062871

>>54062853
tips:
1) use SDL
2) don't follow lazyfoo

>> No.54062881

>>54062853
3) Climate Change is a hoax
4) Autism is bad parenting

>> No.54062919

>>54062681
You have a Boolean [] []instead of a boolean [] [] it is expecting an object

>> No.54062935

>>54062919
Didn't know 'boolean' existed, thank you so much anon! Works like a charm.

>> No.54062949

>>54062919
>Java

>> No.54062952

>>54055154
put another way

static typing: type-safety is enforced during compilation, before you actually run the program.

dynamic typing: type-safety is enforced as you are running the program.

>> No.54062976

>>54062935
Np anon. Just remember . boolean is the primitive. Boolean is the object. Same with int and Integer. double and Double

>> No.54063008

Question for DBA's or those handy with databases:

given an SQL database, what's a good way to implement tagging?
E.G. I've got a table with a bunch of token images, each with a respective ID, to prevent having to run multiple lookups to get multiples of the same token. What's an efficient way to store tags for any given token? Just put them in CSV format in a single column and have the webserver or SQL server parse them out?
That seems like the wrong way to do it but it's the first that pops into me head

>> No.54063045

>>54062881
If you're stupid enough to deny science you shouldn't be a programming thread.

>> No.54063054

>>54063045
when you're 15 and take every opportunity to proclaim your support for science even in the case of very obvious jokes

>> No.54063055

>>54063045
If you're stupid enough to deny science, you shouldn't be in a programming thread.

>> No.54063057

>>54063054
wot

>> No.54063066

new thread >>54063063

>> No.54063076

>>54063054
>even in the case of very obvious jokes
When you're dealing with Trump supporters it's hard to know if people are just stupid or actual joking. Poe's Law and all.

>> No.54063103

>>54063076
Some of us have less faith in religious organisations than others

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
reCAPTCHA
Action