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

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
File: 1.95 MB, 1618x1308, hidamari_dpt_waifu2x_traps.png [View same] [iqdb] [saucenao] [google] [report]
65850737 No.65850737 [Reply] [Original] [archived.moe] [rbt]

Old thread: >>65844787

What are you working on, /g/?

>> No.65850765

i disagree, OP!
traps ARE programming related.
they have been programmed to go against their nature. not just in mind, but in physical forms as well. deviant behavior.
some 7331 hAx0R$ have won.

>> No.65850771
File: 147 KB, 500x281, average dpt poster.png [View same] [iqdb] [saucenao] [google] [report]

*hacks you*
you're trap now

>> No.65850776

you and i BOTH wish

>> No.65850780

anon in old thread
yeah, i'm wrapping everything in classes at the moment. so using classes as my data structures for storing the rings and points will be fine. already tried and approach with arrays and it got really messy, since i'm not the best programmer right now.

here's some incomplete code, missing some features. how shit is it?

>> No.65850784
File: 164 KB, 1280x720, 1525444236947.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.65850793
File: 21 KB, 221x246, 1472362242684.jpg [View same] [iqdb] [saucenao] [google] [report]

public static String makePolygons(String lat_a, String lon_a, String lat_b, String lon_b, Double alt_a, Double alt_b, Integer steps_in_circles) {

/* How many degrees are in a meter? */
double lat_meter = 1 / (Constants.EARTH_CIRCUMFERENCE_IN_M / 360);
double lon_meter = (1 / Math.cos(Math.toRadians(Double.valueOf(lat_a))) * lat_meter);
/* $steps_in_path is an array of values between 0 (at $from) and 1 (at $to)

First we do that at some fixed fractions of path

//List<Double> pathSteps = new ArrayList<Double>();
List<Double> steps_in_path = new ArrayList<Double>();

//{0, 0.25, 0.4};
double[] taper_steps = new double[]{0.3,1,2,4,7,10,20,40,70,100};
List<Double> temp = new ArrayList<Double> ();

double fromLat = Double.valueOf(lat_a);
double fromLon = Double.valueOf(lon_a);
double toLat = Double.valueOf(lat_b);
double toLon = Double.valueOf(lon_b);
double fromAlt = alt_a;
double toAlt = alt_b;

double dis = PtPMath.distanceUsingGPS(fromLat, fromLon, toLat, toLon, fromAlt, toAlt);
double bear = PtPMath.bearingBetweenTwoPoints(fromLat, fromLon, toLat, toLon);
double wavel = wavelen;

// Then we add some steps set in meters because that looks better at
// the ends of the beam

for (double step : taper_steps) {
steps_in_path.add( step / dis );

// Add the reverse of these steps on other side of beam
for (double step : temp) {
steps_in_path.add( 1 - step );

// Sort and remove duplicates
List<Double> pathStepsNoDupes = new ArrayList<Double>(new LinkedHashSet<>(steps_in_path));

return polygons.toString();

>> No.65850798

dumb frogposter

>> No.65850860

>/* How many degrees are in a meter? */

I don't even.

>> No.65850889

it's some GIS shit. how many lat/lon degrees are in a meter? it's a valid question

>> No.65850907

But wouldn't that be constant?

>> No.65850972
File: 330 KB, 782x1021, 1525392298109.png [View same] [iqdb] [saucenao] [google] [report]

>his language doesn't have an IDE with AI intellisense.

>> No.65850983
File: 64 KB, 180x236, 1453656893901.png [View same] [iqdb] [saucenao] [google] [report]

>she needs someeone else to program for her

>> No.65850987

>return polygons.toString();
So basically, the function is completely useless?

>> No.65850996

so much samefagging.
not even gonna get a (You) from me.

>> No.65851010


if any of you feel like helping a guy out

>> No.65851045
File: 290 KB, 498x710, 1513153372009.png [View same] [iqdb] [saucenao] [google] [report]

>she writes her own programs

>> No.65851054

where do you live and are you willing to move to get a job?

>> No.65851059
File: 54 KB, 311x311, 1462665702455.png [View same] [iqdb] [saucenao] [google] [report]

>she has programs written

>> No.65851066

London and yeah. I'm with parents at the moment, the only reason I'm not moving is money.

>> No.65851080

people who knit, can knit with red yard or green yarn, thin or fluffy, hell, the same yard can be used for crocheting. you can even use yarn in a loom.

people who fish can catch bass, blue gill, sturgeon, catfish, etc... they can use various rods, reels, line, hooks.

people who drive can drive a BMW, Tesla, Ford, Chevy, Mistubishi, etc...

pick a language and get comfortable with it. once you get a feel for thinking logically and in order of operation, you should be able to pick up every language you feel like.

advice: buy 15 week course. or get the government to pay for it. git gud and start making useful stuff. when you feel ready, apply for jobs.

>> No.65851088


>> No.65851093

Nice spacing, you fucking faggot.

>> No.65851102

thanks, cocksucker! :)

>> No.65851107

Don't post a smiley face when you're not smiling.

>> No.65851112

grinning ear-to-ear, m8

>> No.65851123

function makeFresnelPolygons($from, $to, $freq, $steps_in_circles) {

// How many degrees is a meter?
$lat_meter = 1 / ( CIRCUMFERENCE_OF_EARTH / 360 );
$lon_meter = (1 / cos(deg2rad($from['lat']))) * $lat_meter;

$distance = distance($from, $to);
$bearing = bearing($from, $to);
$wavelen = SPEED_OF_LIGHT / $freq; // Speed of light

// $steps_in_path is an array of values between 0 (at $from) and 1 (at $to)
// These are the distances where new polygons are started to show elipse

// First we do that at some fixed fractions of path
$steps_in_path = array(0,0.25,0.4);

// Then we add some steps set in meters because that looks better at
// the ends of the beam
foreach (array(0.3,1,2,4,7,10,20,40,70,100) as $meters) {
// calculate fraction of path
$steps_in_path[] = $meters / $distance;

// Add the reverse of these steps on other side of beam
$temp = $steps_in_path;
foreach ($temp as $step) {
$steps_in_path[] = 1 - $step;


>> No.65851125

Heya I'm having a weird problem here. I reinstalled Ubuntu on my laptop today, to upgrade to the new release, and now I'm noticing an odd problem with elixir, more specifically mix. I can't seem to be able to create new projects with mix, when I try to run 'mix new foo' it just prints an error:

** (Mix) Application name must start with a letter and have only lowercase letters, numbers and underscore, got: "foo". The application name is inferred from the path, if you'd like to explicitly name the application then use the "--app APP" option.

And nothing else seems to be working with mix either, so far I haven't found a single thing that would work. I've tried reinstalling it too. Anyone here have an idea of what I'm doing wrong?

>> No.65851128

No. You aren't.

>> No.65851136

ok... i'm sure you know better than me.

>> No.65851139
File: 1.54 MB, 2448x3264, 1476929733307.jpg [View same] [iqdb] [saucenao] [google] [report]


// Sort and remove duplicates
sort($steps_in_path, SORT_NUMERIC);
$steps_in_path = array_unique($steps_in_path);

// Fill array $rings with arrays that each hold a ring of points surrounding the beam
foreach ($steps_in_path as $step) {

$centerpoint['lat'] = $from['lat'] + ( ($to['lat'] - $from['lat']) * $step );
$centerpoint['lon'] = $from['lon'] + ( ($to['lon'] - $from['lon']) * $step );
$centerpoint['alt'] = $from['alt'] + ( ($to['alt'] - $from['alt']) * $step );

// Fresnel radius calculation
$d1 = $distance * $step;
$d2 = $distance - $d1;
$radius = sqrt( ($wavelen * $d1 * $d2) / $distance );

// Bearing of line perpendicular to bearing of line of sight.
$ring_bearing = $bearing + 90 % 360;

unset ($ring); // clear rings

for ($n=0; $n<$steps_in_circles; $n++) {

$angle = $n * ( 360 / $steps_in_circles );
$vertical_factor = cos(deg2rad($angle));
$horizontal_factor = sin(deg2rad($angle));
$lat_factor = cos(deg2rad($ring_bearing)) * $horizontal_factor;
$lon_factor = sin(deg2rad($ring_bearing)) * $horizontal_factor;

$new_point['lat'] = $centerpoint['lat'] + ($lat_factor * $lat_meter * $radius);
$new_point['lon'] = $centerpoint['lon'] + ($lon_factor * $lon_meter * $radius);
$new_point['alt'] = $centerpoint['alt'] + ($vertical_factor * $radius);

$ring[] = $new_point;

$rings[] = $ring;



>> No.65851148

I do. Good job on taking notice of that.

>> No.65851151
File: 97 KB, 577x704, 1483767974338.jpg [View same] [iqdb] [saucenao] [google] [report]


// Make the polygons

// since polygons connect this ring with next, skip last one.
for ($ring_nr = 0; $ring_nr < count($rings) - 1; $ring_nr++) {

$next_ring_nr = $ring_nr + 1;

for ($point_nr = 0; $point_nr < $steps_in_circles; $point_nr++) {

$next_point_nr = $point_nr + 1;

if ($point_nr == $steps_in_circles - 1) {
$next_point_nr = 0;

unset ($polygon);
$polygon[] = $rings[$ring_nr][$point_nr];
$polygon[] = $rings[$next_ring_nr][$point_nr];
$polygon[] = $rings[$next_ring_nr][$next_point_nr];
$polygon[] = $rings[$ring_nr][$next_point_nr];

$polygons[] = $polygon;


$ret = '';

foreach ($polygons as $polygon) {
$ret .= '<Polygon><altitudeMode>absolute</altitudeMode><outerBoundaryIs><LinearRing><coordinates>';

foreach ($polygon as $point) {
$ret .= $point['lon'] . ',' . $point['lat'] . ',' . $point['alt'] . " ";

$ret .= '</coordinates></LinearRing></outerBoundaryIs></Polygon>';

return $ret;



help port to java pls

>> No.65851160

got to freelancer, or fiverr.
you can pay someone to do you work/homework for you.

>> No.65851162
File: 29 KB, 826x392, 1449361855035.png [View same] [iqdb] [saucenao] [google] [report]

>updating your dev environment

>> No.65851166

Why do you have so many nonsensical spaces?

>> No.65851175

it's from here


>> No.65851178

I realize it was a mistake now

>> No.65851190

well you live and learn

>> No.65851204

come on, we are creating a free second internet. look up freifunk. help us out

>> No.65851207

I'm not from the UK but if you want a job in the city (finance) then learn python and they take people with all kinds of degrees. I wouldn't go for a purely technical role. I'd also recommend you do some sort of program because they like fancy pieces of paper.

>> No.65851263
File: 61 KB, 573x619, le smug.jpg [View same] [iqdb] [saucenao] [google] [report]

>she programs

>> No.65851266
File: 2.73 MB, 1976x1352, Fblosv-2.png [View same] [iqdb] [saucenao] [google] [report]

it's supposed to do this

>> No.65851268
File: 139 KB, 270x360, 1463064892991.png [View same] [iqdb] [saucenao] [google] [report]

>she is even vaguely associated with the sort of nerds who program

>> No.65851275

fucker master smug

>> No.65851341

What do you guys think of Guice for Java?
Why does someone need a DI framework rather than doing it manually?
Why do other languages not seem to have these DI frameworks?
Why use Guice over e.g. Spring?

>> No.65851365

Why would use java for anything other than being a wagecuck using spring boot and nhibernate?

>> No.65851371

That is another poolang. I meant hibernate

>> No.65851421

if (trim($location['Koordinaten'])) {


>> No.65851490
File: 190 KB, 555x516, g.png [View same] [iqdb] [saucenao] [google] [report]

found typical /g/ programmer on live stream

>> No.65851525

Le funny trap meme xD
It's just as funny as the last 400 million times you've brought it up.

>> No.65851617 [DELETED] 
File: 1.30 MB, 360x252, 1479510851679.gif [View same] [iqdb] [saucenao] [google] [report]

I don't get it.

>The algorithm and, hence, the program, works whether m is bigger than n or not. Using the
example above, if m is 24 and n is 42, when the loop is executed the first time, it will set m
to 42 and n to 24. In general, if m is smaller than n, the first thing the algorithm does is
swap their values.

while (n != 0) {
r = m % n;
m = n;
n = r;
printf(“\nTheir HCF is %d\n”, m);

>> No.65851692

thank you, seems like a fair roadmap for someone in my position

Okay. I understand that the first the language is more about grasping programming concepts rather than learning it to mastery, which was why I was worried about building bad habits. A government-paid course may be perfect though.

So I should just continue to sit on my ass like a lemon? I'm asking if it's reasonable to think about a job within a year, which should show I don't think I'll be job-ready after a 12-week course. Plus, I'm not in it just for the money.

>> No.65851807
File: 243 KB, 1078x1412, Screen Shot 2018-05-08 at 9.01.56 AM.png [View same] [iqdb] [saucenao] [google] [report]

wonder if this counts as shitposting in code form

>> No.65851814
File: 957 KB, 500x418, 1525522080204.gif [View same] [iqdb] [saucenao] [google] [report]

>want to keep learning programming
>always tired and can't concentrate

>> No.65851820

Oh i get it nvm

>> No.65851840

why not have a null document be an empty map document

>> No.65851842
File: 104 KB, 327x300, sigtrap.png [View same] [iqdb] [saucenao] [google] [report]

Fresh OC

>be a candid thread of code
>wander around unknowingly in the spaghetti written by Pajeet
>suddenly, a Qt slot appears
>you branch into it
>you're caught by GDB, the GNU debugger
>"Wanna share your code under GPL, anon thread?"
>the Qt slot was actually Stallman in polymorphic disguise

>> No.65851853

because anon that's not null, that's en empty map

>> No.65851868

what should a null document be? a non-document? better use std::optional

>> No.65851872

It counts as fucking abomination.

>> No.65851934

no, that means it's a maybe-document
the document itself can have a null value which is distinct from the document itself being optional

>> No.65851938

Anyone here use LLVM? I've been trying to learn it here recently but I'd really like a good tutorial. I've got a basic "hello word" situation going but it seems every tutorial I run across is a different version from mine and subtly doesn't work.
I don't even know how to check my LLVM version outside of Clang.

>> No.65851949

What is the null document, conceptually?
why does it differ from an empty map document?

>> No.65852048

It's a class I'm writing to hold the parsed contents of HTTP request bodies (and similar stuff) in some standard way. So the data the document holds can be null (e.g. parsed from the JSON string null) or the document itself can be optional (e.g. returned from a caching function where a cached document may or may not exist).

>> No.65852078

So you are using your "null document" in the way that you WOULD be using an optional<document>?

>> No.65852128

ok so how can I define a generic (==) operator overloading for ValueTuples ?

>> No.65852286

null_document = document exists, contents null
otpional<document> = document may or may not exist

>> No.65852358

you aren't understanding
how is your null document different from an empty map document?
should an empty map document any different from a regular document without any contents?

>> No.65852377

Or a document with an empty string

>> No.65852397

yeah that too

>> No.65852414

actually that might be different
because document is also being used as a value
so if you have e.g.
but with an empty map i don't see a difference

>> No.65852426

Just look at the JSON data model anon, null != {}. (And it's also distinct from no-such-value) What anon is doing makes total sense in this context. It depends on the model.

>> No.65852437

Can you insert keys into an empty map?
Can you insert keys into null?

>> No.65852484

You can insert a key into an empty document to produce a singleton document
I guess it makes sense for JSON, but JSON is retarded

>> No.65852486

Because a string is a different type than a mapping, which is a different type from an explicit null value, regardless of what data they actually contain. This is a representation of a data abstraction, not C strings.

Well you can in Niels Lohmann's JSON library that I'm also using, but I don't have the time to re-implement a 17,000-line header file library just to add some MIME type metadata.

>> No.65852514

>I guess it makes sense for JSON, but JSON is retarded
This is for standardizing the parsed content of JSON, YAML, multipart/*, application/x-www-form-urlencoded, and eventually maybe XML requests & responses.

>> No.65852528

god damn my dick is so hard

>> No.65852612

me too anon

>> No.65852622
File: 60 KB, 1294x478, sBJG8sT.jpg [View same] [iqdb] [saucenao] [google] [report]

A wild Terry Davis appears. What do you do?

>> No.65852648

>no statically typed and type inferred common lisp with manual memory management
why even live

>> No.65852680

U8 *p = NULL; *p = 0;

>> No.65852686

Lisp existed before garbage collection. Garbage collection was invented FOR lisp anon. There's a reason why.

>> No.65852707

Literally nobody wants this language.
But here's something like it:

>> No.65852727
File: 163 KB, 500x530, question.png [View same] [iqdb] [saucenao] [google] [report]

how do i get into programming? are the socks mandatory?

>> No.65852747

why is daniel day lewis so racist?

>> No.65852749

I wonder what psychosis causes people who design languages without garbage collectors to try to shorten all the keyword names beyond what is reasonable.

>> No.65852786

Nothing wrong with making common keywords short, anon. If that's your biggest concern in a programming language's design then you're just an idiot.

>> No.65852794

I think there are also Trap functions in Assembly programming.

>> No.65852806


>> No.65852834

highly recommended.

>> No.65852849

It's a good thing it isn't my biggest concern, which in this case is writing a lisp with manual memory managment. But there is reason to value aesthetics. fn, chosen to be the start of fnord, is just plain ugly. Clouds your code in an aura of hideousness.

>> No.65852859

There are good reasons why Lisp is garbage-collected and dynamically-typed. Writing your own dialect of Lisp isn't hard and neither are simple algorithms for type inference like Algorithm W. Try implementing your ideas. I guarantee you that you'll run into problems that will either make you to give up on them or end up with something that can't really be called Lisp.

>> No.65852941
File: 11 KB, 348x260, 1519543111544.jpg [View same] [iqdb] [saucenao] [google] [report]

#include <stdio.h>
int main() {
int n;



makes me think

>> No.65852962

is a no-op

>> No.65853005

>int n;
undefined behavior notwithstanding, what's your problem with this?

>> No.65853007

What kind of type discipline would your perfect language have?
The reason most languages don't have manual memory management, especially typed ones, is that use-after-free breaks all type safety guaruntees so it makes all of the theoretical results of the type system useless.

>> No.65853018


>> No.65853028

That's how those operators are supposed to work and it's perfectly fine. If you have a problem with it go write Go, it only has post-increment operator and it's a statement, not an expression.

>> No.65853055

thanks big brother that's exactly what im going to do

>> No.65853061

>the reason languages don't have manual memory management is because MUH TYPES
I'm pretty sure it's actually because about 90% of the time writing free() is a waste of time and raii is an abortion. strong dynamic if you're wondering. unless I'm specifying memory layout, types are also a waste of time. I'm writing software not proving theorems, and I don't need to pretend to be a mathematician because I am one.

>> No.65853064

Why might a static build produce a segfault, where another does not? The failure is immediate, no output occurs. Most programs are fine, the one that isn't has no obvious distinguishing features other than using cmake for a build system.

Using MSYS2, gcc C++.

>> No.65853090

Makes sense to me, though I don't know in what situations you'd make use of the distinction. It won't make for intuitively readable code. I'd actually start putting increments on their own line to make sure I never have to fix a bug caused by using the wrong one.

>> No.65853138

>registers and memory alignment doesn't exist
>cache is infinite enough to just let a program do whatever
>I mask my dislike for thought and work by claiming nothing is as it seems and that I simply have a better way because I am better
>Computers are magic math machines, not signal manipulators and processors. I justify this perspective with the philosophical standpoint that math and logic are the same, despite the nature of computational machinery in this universe mapping very poorly to human conceptions of "math", both in silicon and biology.
>I prefer to think what feels good, is good. I am not a realist and believe I define the universe, rather than admit my slavery to laws I have no control over. This is what my brittle idea of beauty is dependent on.
You just do that, then.

>> No.65853148

>unless I'm specifying memory layout
see me after class anon.

>> No.65853177

I am God.

>> No.65853241

I have a question about C best practice.
I want to make a function that computes the pseudo inverse of a matrix (defined as a struct).
let's call A the input matrix and B its pseudo inverse.

The pseudo inverse uses the a transpose matrix of A, a copy of A, an inverse matrix and two tmp matrices to store some multiplications.

Should I better pass pointers to these temporary matrices as argument to the function, or should I instead malloc and free the temporary every time I call the function (the function is called very often)

>> No.65853266

Because you're perfect doesn't mean you're free of blame.

>> No.65853286

why would you need to call malloc tho

>> No.65853302

I like /wdg/ better because people there are actually working on profitable and useful projects. Nobody cares about your binary tree made in C.

>> No.65853319

typedef struct {
int rows;
int cols;
double *data;
} matrix;

void new_matrix(matrix *output, int rows, int cols) {
/* Creates a new matrix of a given dimensions
// sanity check
if (rows <= 0 || cols <= 0) {
output->rows = 0;// NULL;
output->cols = 0;
output->data = NULL;
// Set the dimensions and allocate data space accordingly
output->rows = rows;
output->cols = cols;
output->data = malloc(rows * cols * sizeof(double));

void initialize_zero_matrix(matrix *output) {
// initialize with zero
for (int i = 0; i < output->rows * output->cols ; i++) {
output->data[i] = 0.0;

So every time I create a matrix, I am calling malloc

>> No.65853379

You could make use of static variables:
static struct matrix *tmp1, *tmp2;

void some_func_i_call_often(struct matrix *m)
if (!tmp1 || some_condition_for_reallocation) {
tmp1 = allocate_matrix(...);
tmp2 = allocate_matrix(...);

>> No.65853402

is there a reason your matrices aren't just double[][]s?

>> No.65853439

Note: you could even pass tmp1/tmp2 to allocate_matrix() and use realloc() inside allocate_matrix() so you wouldn't even need to free() them in case of reallocation.

>> No.65853452

double**s, you mean? Don't use [] syntax. If you make it a flat array you can expect a certain cache performance. If you use double** you have to malloc each one of them separately and that can result in high amount of cache misses if two double*s end up being far apart in memory.

>> No.65853480

As global variables? I don't mind actually. Is there any performance difference as using pointers to the temporary matrices?
What's the difference with calling malloc, using the matrices as temporary values holders and calling free before exiting the program?
I want to have the dimensions if the matrix embedded within it rather than having to do it manually.
I am not gud enough to use double[][] within a struct so I use this convoluted way .

>> No.65853482

> Which node modules do I download in order to sum these two integers?
Nah, mate.

>> No.65853492


>> No.65853499

>double**s, you mean?
Don't put words in my mouth. A variable declared as double[x][y]; is sequential in memory just like a double[x * y];

>> No.65853516
File: 217 KB, 1600x1304, Erlang Community Engagement.png [View same] [iqdb] [saucenao] [google] [report]

Say something nice about Erlang, NOW!

>> No.65853564

Its not C.
God I hate C.

>> No.65853568
File: 148 KB, 1920x1080, 2018-05-08-175052_1920x1080_scrot.png [View same] [iqdb] [saucenao] [google] [report]

You have 30 seconds to explain why you still use obscure and boring programming languages in comparison to emojicode (pic related), you can finally code with your fruit toy smartphone without having to use a computer.
Joke aside, i will maybe try to implement this programming language to android, at least the emojis are already on the keyboard...

>> No.65853584

kek. everyone is moving to slack or discord.

>> No.65853589

Elixir is lovely.

>> No.65853591

>As global variables? I don't mind actually. Is there any performance difference as using pointers to the temporary matrices?
>What's the difference with calling malloc, using the matrices as temporary values holders and calling free before exiting the program?
The main idea is to keep pointers to temporary matrices out of the function arguments. Performance-wise, it's practically the same as passing pointers at every call, except you have to manage your temporary matrices yourself if you pass pointers.

>> No.65853595

But then you can't have variable-sized matrices.

>> No.65853601

Only SJW are moving to it though. The real programmers are still using Freenode.

>> No.65853622

no. freenode is mostly bots as of now.

>> No.65853652

define real programmers

>> No.65853789

The self-employed gun owner kind.

>> No.65853803

Kernel, free software, complicated software not for brainlet (haskell, C, lisp)...
Developers on slack or discord are java/python/javascript "programmers" using ton of library to forks a bloated software using Electron for shinny animations.

>> No.65853811

I see. So I should also consider adding a function free_tmp_matrix that I would call before exiting the program

>> No.65853830

Are you trying to make us fight? I don't program in javascript you fucking fagloid.

>> No.65853848

You are a meme.

>> No.65853886

His point is that double[][] is like double*, not double**.

>> No.65853888

>shit brackets [] for parameters
>@ instead of *
it's shit

>> No.65853917

In the static vs. dynamic sense, not the parameter decay sense.

>> No.65854074
File: 1.17 MB, 1194x768, birdiecig.png [View same] [iqdb] [saucenao] [google] [report]

I'm working on a "hyperreality" network that combines ideas from 4chan, forum software, and social features of (((Facebook))) without tracking. And it's completely free software. Live streaming at https://youtu.be/QK8ofS75M9w
Basedhub at https://github.com/kennymalac/mediacenter

>> No.65854298

Yeah, I need a little help here deciding.

I've been using ThinkJava to learn java programming for about a month nearly got to the end and then dropped it cos some life issues popped up.

I've picked it up again to continue and realised that I've forgotten a chunk of it and thought I might as well start again maybe with a different source to learn from i.e. lynda/udemy but while going through them (and maybe it's just the particular course I chose) they seem to be less in-depth, like they seem to take shortcuts. Thinkjava had an exercise where I had to make a method to work out x to the power n and the lynda/udemy course just tells you straight up to use Math.pow.

Should I just start from scratch on Thinkjava?

>> No.65854323

Working on an EML validator in PHP.
$email_file = "message.eml";

$eml = file( $email_file );

// Divide file into heading and contents sections
$size = sizeof( $eml );
for( $i = 0; $i < $size; $i++ ){
if( trim( $eml[$i] ) == '' ){
$heading = array_slice( $eml, 0, $i );
$contents = array_slice( $eml, $i+1, $size-$i );

// Strip newlines from ends of fields
$size = sizeof( $heading );
for( $i = 0; $i < $size; $i++ ){
$heading[$i][strlen( $heading[$i] ) - 1] = "\000";

// Unfold header fields
$unfolded = array();
$ui = -1; // Index in unfolded array
for( $i = 0; $i < $size; $i++ ){
if( $ui == -1 && $heading[$i][0] == ' ' ){
die( "Parse error: Leading whitespace characters.\n" );
if( $heading[$i][0] != ' ' ){
$unfolded[++$ui] = $heading[$i];
$unfolded[$ui] .= $heading[$i];

// Validate header fields
foreach( $unfolded as $field ){
if( ereg( '^[^:]+:[^:]*$', $field ) == false ){
die( "Parse error: Header fields in wrong format.\n$field\n" );

printf( "Parsing complete. File is valid EML.\n" );

>> No.65854332


>> No.65854343

the type of a 2D array decays to double * foo[x] where x is a fixed number. The program needs to have the second dimension be fixed at compile time so it knows the pointer arithmetic for the first dimension.

I've never heard of no thinkjava but whatever. You can't just expect to read from a book to learn something. You have to practice it too or of course you will forget. Udemy is low quality though.

>> No.65854431

>You can't just expect to read from a book to learn something.
ThinkJava came with examples and exercises to do.

>Udemy is low quality though.
Any other source you suggest to learn java (so I can get a job?)

>> No.65854464

if you're using gcc you could use the a destructor function to clean up all static temporaries you have for your various functions, so you don't have to remember to call a function
but since the program terminates anyway at that point you might not need to free them at all

>> No.65854478

It's preferable to use C++ destructors than GCC extensions desu. At least C++ is portable.

>> No.65854488

No, it's preferable to not use C++.

>> No.65854536

That's what atexit() is for in C. But unfreed heap memory is still freed by the OS when the program exits anyway. You only need to free memory for short-lived objects.

>> No.65854552

>But unfreed heap memory is still freed by the OS when the program exits anyway.
Only if there's an operating system, and even then, sometimes not. It's bad practice not to free your allocations.

>> No.65854610
File: 342 KB, 714x738, 1421164417027.png [View same] [iqdb] [saucenao] [google] [report]

Employed Haskell programmer here

>> No.65854632

You may be a Haskell programmer, but how's that ebin J2EE subcontractor project going? :^)

>> No.65854665

"Have you written a compiler? Have you written an interrupt routine? Do you even know what an interrupt routine is?" as said by Terry Davis

>> No.65854754

A continuous-time functional reactive language for real-time systems. The trick is that a reactive program cannot actually have continuous semantics on real hardware, so there must always be sampling involved. How do you get real-time? With a real-time sample scheduler, of course. It's really for soft real-time, because there will be no guarantees about meeting deadlines, but the schedulers can choose to recover in different ways. One might be able to adjust sample precision, increasing throughput at the cost of quality. Another might be able to vary the sample rate, increasing throughput at the cost of latency. The most basic scheduler would be for when you can tolerate the slowdown. These strategies can be swapped out easily (or even on the fly) without modifying the rest of the application.

>> No.65854814

i'm having so much trouble naming variables and functions. like what would you call a process that takes class objects in RAM and converts them to JSON/binary/etc so they can be easily serialized and stored to disk? this is why being self-taught sucks, i don't know any terms for processes like these. i literally have the code written out but my function is still called "foo"

>> No.65854845

>like what would you call a process that takes class objects in RAM and converts them to JSON/binary/etc so they can be easily serialized and stored to disk?
You used the exact word in that sentence

>> No.65854849

I am working on appending a header to the top of text submitted via a web form and displaying the past history below it.

Right now I can append my header with no issues, but it keeps overwriting my past data. Any suggestions?


Add Text
<textarea name="txtnotes"></textarea>

Text History
<?php echo $result["notes"];?>


//Append to Notes
$ipaddress = $_SERVER['REMOTE_ADDR'];
$header = "----- Updated by " . $ipaddress . " on " . date("Y-m-d") . " at " . date("h:i:sa") . " ----- <br>";
$newnotes = $_POST["txtnotes"];
$oldnotes = ["notes"];
$appendednotes = $header . $newnotes . $oldnotes;

notes = '$appendednotes'

>> No.65854857

This probably gets asked every thread but what book should I use to learn C?

Also there really needs to be a pastebin or some kind of resource in the OP for FAQs and general guidance.

>> No.65854886


>> No.65854900
File: 161 KB, 1024x768, 2018-05-08-192232_1024x768_scrot.png [View same] [iqdb] [saucenao] [google] [report]


>> No.65854914
File: 32 KB, 716x717, retard anime.jpg [View same] [iqdb] [saucenao] [google] [report]


i see

>> No.65854960

ey help me out

I've just finished python programming for the absolute beginner, what do now?

what's the best next book/tut to follow?

>> No.65854973


You've gone too far this time /dpt/

>> No.65854988

I figured that'd be the answer, is it really still good even after all this time?

I guess I'll try it, thanks.

>> No.65855009

Can you make an array of List<Integer>s in Java? comparisons on various SAT solvers and the DPLL approach requires removal of elements so I can't just use arrays; I want to minimize the overhead and avoid using a List of Lists by having the row-list be an array

>> No.65855014

The style is a bit out of date, but in terms of the concepts you need to grok C it's unmatched.

>> No.65855016

No name for it. The naming conventions available to you:
C: memserial, memdump
Java: ObjectSerializer and derived FooObjectSerializer
C++: obj_serializer<M>

>> No.65855046
File: 31 KB, 1179x1041, gui.png [View same] [iqdb] [saucenao] [google] [report]

I made a simple gui library with buttons, menus, text fields, and some other features for Richard Russell's BBC BASIC for Windows/SDL, and then I used it to make a simple paint program and some other simple things

>> No.65855159

That's kind of rad, anon

>> No.65855162

Why wouldnt you be able to. Just do List<int>[] like you would normally do to create an array. At least you can do that in other oop langs like c#

>> No.65855258

List<Integer>[] cause Java is caca but that's correct what you wrote.

>> No.65855283

The row list might as well be an ArrayList tho the overhead will be basically the same

>> No.65855297

Meant at >>65855009

>> No.65855312
File: 866 KB, 500x259, scold.gif [View same] [iqdb] [saucenao] [google] [report]


>> No.65855345

> >she

>> No.65855590
File: 6 KB, 225x225, 1525783305255s.jpg [View same] [iqdb] [saucenao] [google] [report]

>doing Pattern Recognition/Machine Learning project
>professor gives us a data set with more than 5GB of data
>this data set describes the image's features
>each image has a (17000x1) related vector
>there are more than 39000 images

what the fuck

>> No.65855627

this creates a list of arrays not an array of lists
I don't think you can make an array of lists

>> No.65855652

Isn't it just List<Integer[]>?

>> No.65855811

this is really dank. what resources are you using as a reference?

>> No.65856309
File: 4 KB, 654x76, 5.png [View same] [iqdb] [saucenao] [google] [report]

Hey, I'm playing around with python today because the teacher gave us a python task and I have never done anything in Python before so I am clueless, I appreciate any help.

Basically I'm supposed to implement a turing machine in Python and I've managed to initialize it with any given input but I'm not sure how to access the states and apply them to the input. From what I've seen it's a python dictionary type that does not support indexing, which makes my initial idea not work. Basically I seem to only be able to access the dictionary keys using their string names (q1, q2) which wouldn't make it too hard implementing this specific example, but I have no idea how I could generalize it for all possible functions. Can anyone give me a tip?

>> No.65856363

List<Integer>[] is an array of list you mongoloid fuckface

>> No.65856388

>what resources are you using as a reference?
You mean, for learning BBC BASIC?
I use this site: http://www.riscos.com/support/developers/bbcbasic/
And also this site: http://www.bbcbasic.co.uk/bbcwin/manual/

>> No.65856402

this is a nested dictionary, it maps states to dictionaries which in turn map tape symbols to (nextState, newSymbol, direction)
I guess you could also write this as a function that takes a state and a symbol and returns the triple

>> No.65856450
File: 42 KB, 386x269, Gooby_car_suspicious.png [View same] [iqdb] [saucenao] [google] [report]

>Segmentation fault

>> No.65856486

Reminder that, this is the smallest C program that causes segmentation fault.

Try to compile it.

>> No.65856492

>he didn't restore the program to valid state with sigsetjmp
dumb shitter

>> No.65856507

you fault for using an unsafe programming language.

>> No.65856523

what to use instead?


>> No.65856531

not a valid program at all, tard.

>> No.65856545


>> No.65856550

>not a valid program at all, tard.
Wrong Rajesh.

>that reading comprehension

>> No.65856556


>> No.65856560

>it compiles therefore it is valid
only rustlets and hasklets believe that.

>> No.65856578

>no native thread support
>no unsigned types
>boxed types
>shitty FFI
>no macros, have to use external tool
Ocaml is shit
consider SML, SML# or actually good programming language

>> No.65856589

Yea it being a nested dictionary is kind of the problem. I have no way of accessing it other than the strings right? That's the example given so I'm not allowed to change it and I'm not sure how I could turn it into a function.

>> No.65856605


>> No.65856607
File: 23 KB, 645x773, 1523386635027.png [View same] [iqdb] [saucenao] [google] [report]

Thanks Sherlock.

>> No.65856621

how else would you want to access it? you probably have a string that represents the current state, a list of strings that represents the tape and an integer to represent the head

>> No.65856637

then it is not a C program.

>> No.65856660

yes we know you read an ebin blog post. the idea of doing that has been floating around the tubes for about 30 years. main is supposed to be a function so it still isn't valid.

>> No.65856669

It is.

Sorry sweetheart.

>> No.65856673
File: 49 KB, 481x523, 1522280161860.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.65856682

(core dumped)

>> No.65856701

if you compile with -nostartfiles, gcc will happily compile an empty file into a segfaulting executable

>> No.65856702

the standard is explicit: a program either has main() or another procedure as entry point. a conforming implementation would not compile that program. blame gcc, not c.

>> No.65856711

Well what I'm thinking is that I need to implement this no matter how many states there are. Now it seems the nested dictionary doesn't do indexing, what I was thinking is that I can determine the length of the dictionary and then somehow define all the states in variables that I can easily access. I think this could work if we assume the states are always called q<number> and e but I have no idea how to do it.

I didn't really understand your tip anyway, I thought you meant I should drop the nested dictionary. I don't really understand how I can access these through a function.

>> No.65856803

nah if you're stuck with the dict you'll have to do it as it is.
You don't need to know what states there are, all you need to know is the start state, and the dictionary will give you new states as your machine transitions into them. if you want to look at all the states, there should be a function you can call on your dict, I think its something like delta.keys()

>> No.65856872

Ah you're right!
Now I just need to think of a way to actually do that, thanks for the help.

>> No.65856926

( ˙-˙ )
way too much carb and sugar. prepare for diabetus.

>> No.65856931
File: 910 KB, 1920x1080, bb647f1c017320c6b0991e00b58be02f5486e4ce.webm [View same] [iqdb] [saucenao] [google] [report]

Still working on my simple space 2D game to play with my son. Next step is to implement collision.

>> No.65856950

Since he is your wife son why not just play God of War?

>> No.65856958

Not interested by GoW.

>> No.65856975

Then play LABO.

>> No.65857097

You're inspired today.

>> No.65857126

w/e cuck

>> No.65857164
File: 18 KB, 402x383, 2018-05-08-214928_404x385_scrot.png [View same] [iqdb] [saucenao] [google] [report]

uhhh honey, no
I will have cereal for supper

>> No.65857169

What are some of these bullets doing? What happens if you touch a static bullet? Or since you didn't implement collision yet, what do you intend to happen when a player touches a static bullet?

>> No.65857275

sugar lowering mental capacities is a scientific truth. please have a look at the keto diet before it's too late.

>> No.65857321

Which one should I choose for C++ GUI library and what is each advantage / disadvantage:

>> No.65857329


>> No.65857333

>What are some of these bullets doing?
The bullets have the inertia of the shooting vessel.
>what do you intend to happen when a player touches a static bullet?
Probably a life system.

>> No.65857419

GTK works well on Linux (usually), not so much on other OSes. Qt is "native" cross-platform but also has it's own weird ecosystem on top of C++ and requires a pre-compile step. Don't know anything about FLTK.
>disclaimer: never used any of these

>> No.65857822

You do realise people spend 4 years at uni constantly learning relevant information to get a high-paying job in CS (that's after taking maths & FM at A-level), right?

You can "learn" to code to business standard in 6 months if you work your ass off, but good luck a) getting a job offer b) getting a decent wage c) enjoying it.

That being said, it's entirely possible gl

>> No.65857915


>> No.65857922

How do I adequately push my limits for effective learning?
I learned the basics of Java but I find it hard to find projects for myself that either aren't out of reach or aren't so simple that don'tforce me to think outside of what I can do.

Perhaps any recommendations for some fun third party websites or programs?

>> No.65857939

Hahaha, enjoy working at google

>> No.65858060
File: 46 KB, 778x512, gib.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.65858077

I've been learning C for about a week, now it seems the default C library isn't that huge and naturally you have to write lots of helper functions (like strlen, searching through arrays etc), is there some kind of standard practice of including helper functions? Like putting them them in a helper.c and including helper.h?

>> No.65858113

dumb frogposter

>> No.65858145

uhm strlen is part of the standard library (string.h) but that would work. Better would be to put it where it makes the most sense.
>stuff for arrays -> arrayutil.h
>stuff for strings -> stringutil.h

>> No.65858183

oh and how do you plan on doing that?
I'd use GJK

>> No.65858241

lads, which one of these is faster?
let promises = [promise1, promise2, promise3]
Promise.all(promises).then( results => results.forEach( r => process(r) ) )


let promises = [promise1, promise2, promise3]
for await (let p of promises) process(p)

Does 'for await' yield on every iteration of the loop, thereby running the promises in sequence?

>> No.65858283

It's OK, I know my math.Any object is just a collection of triangles.

>> No.65858319

am I a scheme master now?
(define (rember a L)
(if (null? L)
'() ;'
(if (eq? (car L) a)
(cdr L)
(cons (car L) (rember a (cdr L))))))

(define (Nth list index)
(if (<= index 1) (car list) (Nth (cdr list) (- index 1))))

(define (QuicSrt L)
(define (inSort List Pivot)
(define List-No-Pivot (rember Pivot List))
(QuicSrt (filter (λ (x) (>= Pivot x)) List-No-Pivot))
(cons Pivot
(QuicSrt (filter (λ (x) (< Pivot x)) List-No-Pivot)))))
(if (or (null? L) (null? (cdr L)) (not (pair? L)))
(inSort L (Nth L (/ (length L) 2)))))

>> No.65858406

define (rember a L)
(if (null? L)
'() ;'
(if (eq? (car L) a)
(cdr L)
(cons (car L) (rember a (cdr L))))))

(cond [(null? L) '()]
[(eq? (car L) a) (cdr L)]
[else (cons (car L) (rember a (cdr L)))])

>> No.65858422

yeah, that part was older code
only included it in the post because it's used in the main function

>> No.65858426

enjoy your std::visit

>> No.65858445

report him for hate speech and ban him. obviously.

>> No.65858513

Is that deepin?

>> No.65858559
File: 10 KB, 238x212, 1523164484744.jpg [View same] [iqdb] [saucenao] [google] [report]

What happened to Eli the /dpt/ guy? He seems to be slowly going crazy.

>traps quietly in bedroom with locked door so roommates don't walk in to a huge shock
OwO teehee.

The socks are 100% mandatory.

>> No.65858562

>quicksort on lists
Absolutely not. I feel sick thinking about your code. Convert it to a vector, sort the vector, then convert the vector to a list if you insist on quicksort.

>> No.65858582

>The socks are 100% mandatory.
do they make me a better programmer? can i see yours, for inspiration?

>> No.65858606
File: 301 KB, 615x597, 1524516983754.png [View same] [iqdb] [saucenao] [google] [report]

what's deeping

>> No.65858622

So i've installed two of my most used libraries

in my system in CMake install prefix. Should I have to recompile/reinstall each time there's a GCC update?

Reminder that Rust does not have this problem

>> No.65858632

if i were him I'd just calculate barycentric coordinates. gjk is for convex sets, so it would only be good for a rough pass, which in this case radius is perfectly suitable for.

>> No.65858645

The common use cases for this won't require pattern matching at all. A request body will be parsed into a document, then the request handler checks to see if it's in an acceptable form, which will most often be a mapping/"object" (aka "user" or "product" object). If it isn't acceptable, 400.

>> No.65858653

Please help I'm retarded, I need to make a makefile for a simple piece of shit C file that uses pthreads.

All I have is this
line: shit.c
gcc shit.c -o FuckYou -pthread

It says pthread doesn't exist

>> No.65858685

look up a gcc flag reference

>> No.65858698

Anyone have experience with Entity Framework (Core)?

How do you even write tests for this pile of counter-intuitive mess? Let's say I have a deck of cards. But I want real cards and mock cards, so that I can unit test my deck. So obviously I want to make an interface ICard, and then let Card and MockCard inherit from that, right? But my Deck can't have an ICollection<ICard> property because EF doesn't support interfaces in code-first design or something.

Why is doing such a simple and basic thing so difficult in this framework? I feel like I must be missing something...

>> No.65858703

Hello, so I'm new to shell scripting. How can I add options to my script? So it could be executed like script.sh -o , or script.sh -p. and each option doing something different? Use switch statements?

>> No.65858769

They're called arguments.


>> No.65858779

Thankyou, I'm retarded

>> No.65858789

Getopt for anything with a lot of options https://www.gnu.org/software/libc/manual/html_node/Getopt.html

>> No.65858836
File: 2.25 MB, 1992x700, gurly.png [View same] [iqdb] [saucenao] [google] [report]

>do they make me a better programmer
Yes they do and you can't forget about those /diversity quotas/ that need filling.

Well... If it's for inspiration... I guess... But I need to keep this technology related so uhh.. How about that RGB guys...? It's basically killing the technology profession, very sad, very sad indeed, in 2005 computers were hideous, beige with no colour coordination now they are these spectacular displays of customizable colour, and what about bezel sizes who cares about that what a waste of resources amirite?

>> No.65859003

alright, I'm taking your advice, most translates directly without any real changes, but it seems scheme has no native vector-filter so I'm trying to make a filter that works on vectors
so far I have something roughly like
(vector-map (λ (i x) (if (> x 3) x '())) '#(5 6 3 2 1 4))
which would return
#(5 6 () () () 4)
is there any way to get rid of those empty bits?
or at least make a new vector without the ()s
can't seem to find a way to do it

>> No.65859021

Patches::Events::OnEvent([this](auto player, auto event, auto definition) -> void { OnEvent(player, event, definition); });

how do i simplify this lambda expression?
OnEvent is a member function so i cant just directly pass a function pointer

in java this is just this::OnEvent

>> No.65859106

Not thicc enough to be considered girlish

>> No.65859153

forgot to mention that Patches::Events::OnEvent takes std::function

>> No.65859178

Never heard of no vector map. You aren't making the mistake of using racket are you? Anyway your code is still gonna be pretty bad if you just use list procedures that are ever so slightly to be vector procedures.

You should be quicksorting in-place, i.e. swapping elements around the pivot. Reuse that vector. Quicksort's a distinctively non-functional sorting algorithm.

>> No.65859197

>Never heard of no vector map
it's an SRFI addition

>You should be quicksorting in-place, i.e. swapping elements around the pivot. Reuse that vector.
sure, i'll do that

>> No.65859360

#include <iostream>
#include <string>

int main()
// ask for the person's name
std::cout << "Please enter your first name: ";
// read the name
std::string name; // define name
std::cin >> name; // read into
// write a greeting
std::cout << "Hello, " << name << "!" << std::endl;
return 0;

When I compile this set of code on vs the "application" closes after I inserted a name, while on code::blocks with gcc it works perfectly fine. A similar problem also occurs when compiling this:

int main()
std::cout << "Enter two numbers:\n";
int v1 = 0, v2 = 0;
std::cin >> v1 >> v2;
std::cout << "The sum of " << v1 << " and " << v2 << " is " << v1 + v2;

Is it my compiler settings on VS or VS' compiler simply shit?

>> No.65859531

Beginner here, trying to make some basic things in Unity with c#.
Does a script have to be attached to a gameobject in order for other scripts to be able to reference or change variables in it?
Right now I have a piece of code that kinda looks like

public LampVar hasX;

void Start()
hasX = GetComponent<LampVar>();

void OnTriggerEnter(Collider other)
if(other.gameObject.name == "Player" && hasX.playerHas == true)

In this case, playerHas is a bool set to false that changes when I pick up an object ingame.
I get that the problem is that this script doesn't access the other script (LampVar), but I don't know why it's not able to do so.
Am I wrong in my way of thinking how variables are accessed across scripts?

>> No.65859664

>You aren't making the mistake of using racket are you?
What's wrong with racket?

>> No.65859726

I'm a bit unclear on what I would put into my switch statement for my getDaysInYear statement if I really only want to account for what the month is. I just want to know what the year is to account for the leap year function I have.
public static boolean isLeapYear (int year){
if (year < 1 || year > 9999) {
return false;
}else if ( year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
return true;
return false;

public static int getDaysInMonth (int month, int year) {
if (month < 1 || month > 12 || year < 1 || year > 9999) {
return -1;
switch (getDaysInMonth(month)){
case 1:
return 31;
case 2:
if (isLeapYear(year)) {
return 29;
return 28;
case 3:
return 31;
case 4:
return 30;
case 5:
return 31;
case 6:
return 30;
case 7:
return 31;
case 8:
return 31;
case 9:
return 30;
case 10:
return 31;
case 11:
return 30;
case 12:
return 31;
return -1;

>> No.65859750

What's the hot marketable meme language now? I use java and JavaScript at my job and I'm looking to move and get a new job not sure what languages I should test out and look for in the future

>> No.65859784
File: 69 KB, 788x298, file.png [View same] [iqdb] [saucenao] [google] [report]


>> No.65859793

Nevermind, I'm a fucking moron, just realized I'm calling my method in my switch statement.

>> No.65859808

rust probably

>> No.65859881

You won't ever get employed if you use Rust

>> No.65859938

Just go back to Java. You don't know how to use C++ properly.

>> No.65859944

Yeah I dont think so.
Ive seen people making mad cash from doing rust.
This is happening at scandinavian oil niggers currently.

>> No.65859957

Proof or you are making shit up

>> No.65859969

you want me to pull out their bank statements?
fucking idiot

>> No.65859970

dont blame me

>> No.65860001

If you can't pull out their bank statements, then how do you know they earn a lot of money? I think you are the fucking idiot.

>> No.65860148

missed it by that much ><

>> No.65860169

dat color scheme!

kill it!

>> No.65860171

Can someone explain to me why we always do stuff to the power of 2? I know base 2 is obviously binary but why the 2^x?
Why use groups of 8 as a popular method?
Like we see to the power of 7 quite frequently

>> No.65860193

go back 2 reddit please

>> No.65860194

^2 BECAUSE it is binary
its inherently obvious.
base 10 uses ^10
base 12 uses ^12

>> No.65860206

go back to colors that are't shit, please.

>> No.65860221
File: 54 KB, 540x511, sweating pepe.jpg [View same] [iqdb] [saucenao] [google] [report]

you have two (2) minutes to write a binary adder

>> No.65860245

I mean in cases like 2^7 for 128kb for example why choose it. That does answer the 8 bit vs whatever other bit part

>> No.65860321

back before IBM made binary the standard, many computers ran on words. - clunky, not even worth understanding today.
the bit is a single 1 or 0, standardizing keystrokes to be uniquely identified within a set size led to the 8-bit byte. (look at braille, it's 6-bits per character).

128kb should = 128,000 b
but usually it's jargon for 131,072 b

>> No.65860430

Literally a XOR and an AND

>> No.65860458

So 8 bits to a byte is just sort of arbitrary? Ive wondered why systems seemed to increase by double each time (8bit, 16, 32 etc) yet stuff like color space seems minimal growth from 8 to 10bit

>> No.65860476

>Ive wondered why systems seemed to increase by double each time (8bit, 16, 32 etc)
Backward compatibility.

>> No.65860489

But if we made a 10 bit system it would still have space for 8 bit programs to run wouldnt it?

>> No.65860529

8-bit died in the 90s as far as comsumer PCs go.
32-bit vs 64-bit for example.
it's how much data can pass at once to be processed.
it's a different standard.
its why they had to rewrite Super Mario Bros in Super Mario All-Stars on the SNES (16-bit) cuz the 8-bit NES is a diffferent standard.

>> No.65860688

C is the future.

>> No.65860703

how many of you have actual programming jobs?
What kind of things do you have to do in your job?

>> No.65860704

feelio when too brainlet for latex ;_;

>> No.65860708


LaTeX is easy though.

>> No.65860722

fuck sepples

>> No.65860724

I understand the basics but can't seem to wrap my head around "best practice".

Everyone online says to install a new third party package for every little thing I want to do
>want to make have smaller margins? install the "geometry" package!
>want text to not justify by default? install the "ragged2e" package!
>can't get something formatted right? insert a 5mm vspace here!

Latex is supposed to be powerful, right? Surely there's a better way. I just can't figure out this "better way".

>> No.65860758
File: 94 KB, 813x384, rdcman[1].png [View same] [iqdb] [saucenao] [google] [report]

I have an idea for a program that is able to launch several instances of a particular game client (.exe), automatically log you into the game via credentials you create and save in the program. Up to this point, my idea is basically RDCMan (Remote Desktop Connection Manager; pic related) or MRemoteNG, but for a video game (a game where it's not uncommon to be running multiple game clients at once).

What makes my idea special is that I want it to leave a lot of control to the user over how the game clients are shown on the screen. And this is what I'm stuck on, especially as I consider the possibility of making this program cross-platform.

I basically want to let the user decide whether to show or hide the titlebar/border for their windows, arrange their windows however they please, even overlap their windows.

Aside from using the win32 api directly, which would limit this idea to Windows, is what I'm asking possible in any way? I really have no idea how to even research my options here or if there is a way to find best practices for this scenario.

>> No.65860779

Nothing because I can never come up with project ideas. Pls help I just want to program but there are no problems bothering me to solve

>> No.65860807

I do

Implement boring business logic in the ordained language

>> No.65860829

Just because you use Win32 directly doesn't mean you can't alternatively use X11 directly, Wayland directly, Cocoa directly, etc. depending on platform.

>> No.65860851


The "correct" way to do things in LaTeX really is to use different packages for basically everything. You're not making a program, you're making a PDF. You shouldn't worry about bloat here.

>> No.65860913
File: 18 KB, 569x855, killrf_by_esk.png [View same] [iqdb] [saucenao] [google] [report]


i had to make a script to accept options and a numb from the command line and print out the numbers up to the number enter from the cmd line, how can i add a way to check that no invalid option is input? so that if -x is put it prints error message, thanks for the help

>> No.65860914

GR15 should be extended.

>> No.65860938
File: 9 KB, 400x500, drago.jpg [View same] [iqdb] [saucenao] [google] [report]

I've been working on a chatbot in python.
I took a bunch of 4chan posts, put them in a txt file, and trained a program to respond to questions. It didn't work well though.

I had a weird dicussion with it.

>>Me: What's your name?
>>Bot: Okay...
>>Me: Are you fucking stupid?
>>Bot: What's your favorite color?
>>Me: Green.
>>Bot: So am I.

It knows Shrek jokes. I'm fucked...

>> No.65860945

alright, here we go
(define (Quic-Vect V) ;sets things up
(define (theSort Vect Low High) ;does the main bit
(define (Part) ;returns the pivot index
(define (Swapper Current Ind) ;does the swapping
(cond [(= Current High)
[(< (vector-ref Vect Current) (vector-ref Vect High))
(vector-swap! Vect Current Ind)
(Swapper (+ Current 1) (+ Ind 1)))]
(Swapper (+ Current 1) Ind)])) ;;end Swapper
((λ (point)
(vector-swap! Vect point High)
(Swapper Low Low))) ;; end Part
(if (< Low High)
((λ (p)
(theSort Vect Low (- p 1))
(theSort Vect (+ p 1) High )
(Part)))) ;; end theSort
(if (vector-empty? V)
(theSort V 0 (- (vector-length V) 1) ))) ;;end Quic-Vect

>> No.65861063


elif [ -z $1] ; then
echo "All Numbers"
echo "Error"

>> No.65861098

> variables in the initializer list are not initialized in the order that they are specified in the initializer list. Instead, they are initialized in the order in which they are declared in the class.

What if this ordering is altered by the compiler to reduce padding? Consider I have this:

#include <iostream>

struct Seq
float a;
bool b;
double c;

Seq(int i)
: a{ i++ }
, b{ i++ }
, c{ i++ }
operator std::string() const
return "a = " + std::to_string(a) + " b = " + std::to_string(b) +
"c = " + std::to_string(c);

Also, what could the std::string() operator look like in C++11 trailing return type form?

>> No.65861104

i get what you mean, but that's real fucking gay

>> No.65861105


reminder that you are not an uber leet haxor for being "too cool to use a namespace" now go to hell

>> No.65861120


>> No.65861123


LaTeX is a real pain to do anything complex in, so we just got a bunch of people to write packages for it that we use without knowing how to write said packages ourselves.

>> No.65861137

brainlet here, can someone tell me why my if statement breaks when i call it from a Boolean method, even though the method I am calling is true? In this case, I know that two numbers, say 1 and 3, are odd because they pass through my isOdd method just fine, but when I pass those arguments through the sumOdd parameters, the if statement breaks and it just goes straight to -1.
public static Boolean isOdd(int number) {
if (number > 0) {
if (number % 2 != 0) {
return true;
return false;

public static int sumOdd (int start, int end) {
int sum = 0;
if (isOdd(start) && isOdd(end)) {
if ((start > 0) && (end > 0) && (end >= start)) {
for (int n = start; n < end; n ++) {
if (n % 2 != 0) {
sum += n;
}if (n == end) {
return sum;
return -1;

>> No.65861155

what are you talking about retard

>> No.65861280

So basically, separate codebases for each display server. Yeah, I think I'll stick to Windows only.

>> No.65861354

"bad habits" is a fucking meme. Python is good to understand the basics but if you want to have a job quick you should learn Web tech first

>> No.65861409

pls respond
I need feedback
I don't want to form bad habits

>> No.65861415

please never post in this general ever again

>> No.65861484
File: 51 KB, 999x798, 2759311207617009770.png [View same] [iqdb] [saucenao] [google] [report]

what do you guys think of the Google's new AI? PRETTY HORRIFYING DESU

>> No.65861511
File: 77 KB, 1440x810, 1517504385343.jpg [View same] [iqdb] [saucenao] [google] [report]

b-but they are pretty thicc compared to the rest of me

>> No.65862530

wheres this from

>> No.65862778

dumb frogposter

Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.