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

/dpt/ - Daily Programming Thread

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

Thread replies: 316
Thread images: 33

File: 1481234393653.png (102KB, 1000x1071px) Image search: [Google]
1481234393653.png
102KB, 1000x1071px
What are you working on, /g/?

Old thread: >>58036933
>>
File: problem.png (39KB, 905x499px) Image search: [Google]
problem.png
39KB, 905x499px
ive got a problem

im trying to make a java text area where when i press enter in the textbox it lets me write in new row or whatever. the problem is when i try to print the text it prints it out as if it were all in a single row.

i cant for the life of me figure out what to do. i would really appreciate some help here.

im using netbeans, btw.
>>
Stop re-using the same fucking image every time you lazy shit.
Make something new
>>
File: opt.png (39KB, 1000x1071px) Image search: [Google]
opt.png
39KB, 1000x1071px
>>58042656
your png is now optimized
>>
>>58042837
There was something I realised about "lossless" png optimisers the other day, how they save space
>>
where do I learn how to optimize my pngs
>>
>>58042907
that's the whole point, yeah
>>
>>58042933
No, I mean I realise how they do it
>>
>>58042921
Download a program that does it for you
>>
>>58042942
and how's that?
e.g.

AAAAAAAA (eigth A's here)

can be written as

A8

like this?
>>
>>58042921
Use something like optipng. If you're interested in the tech behind it, check this out:
http://optipng.sourceforge.net/pngtech/optipng.html
>>
>>58042952
No, they take the soul out of the image.
>>
>>58042677
why not add a listener for the enter key pressed that inserts a '\n' senpai
>>
>>58042983
that only accounts for 21 bytes though
>>
sex before marriage is a sin
also, haskell or common lisp?
>>
>>58043068
>sex before marriage is a sin
Sin increases pleasure.
>also, haskell or common lisp?
OCaml.
>>
>>58043068
In Haskell you can encode sex such that it can only take place in the Marriage monad
>>
>>58043081
>ocaml
syntax kills me
>>
>>58043097
example please?
I think common lisp can do that with CLOS
>>
>>58043068
Haskell. I find the syntax to be a lot more legible than LISP's endless seas of parens
>>
>>58043101
>syntax kills me
Why? OCaml syntax is love.
>>
>>58043105

haveSex :: (MonadMarried m) => m Baby
>>
>>58043108
post example code and I'll tell you the part that kills me.
>>
>>58043114
birthControl :: MonadMarried m => m ()
birthControl = void haveSex
>>
>>58043128
example/
let escape_by_number c =
c <= '\007'
|| '\011' <= c && c <= '\031' && c <> '\013'
|| c = '\127'
;;

let escape_by_escape c = c = '\'' || c = '\"' || c = '\\';;

let print_raw_char ppf = function
| c when escape_by_number c ->
Format.fprintf ppf "\\%03d" (int_of_char c)
| c when escape_by_escape c -> Format.fprintf ppf "\\%c" c
| '\b' -> Format.fprintf ppf "\\b"
| '\t' -> Format.fprintf ppf "\\t"
| '\n' -> Format.fprintf ppf "\\n"
| '\r' -> Format.fprintf ppf "\\r"
| c -> Format.fprintf ppf "%c" c
;;

let print_char ppf c = Format.fprintf ppf "\'%a\'" print_raw_char c;;

let print_string ppf s =
let lim = String.length s in
let rec loop ppf i =
if i < lim then
Format.fprintf ppf "%a%a" print_raw_char s.[i] loop (succ i) in
Format.fprintf ppf "\"%a\"" loop 0
;;
>>
>>58043146
everything is a let
>Format.fprintf
>String.length

but, I do dig that you can do imperative stuff
>>
>>58043146
>succ
>>
>>58043106
parenthesis make it look better
reminds me of jews, and jews are superior anyways
>>
>>58043138
You mean m (Maybe Baby)
Whether or not it there was a baby is information that should not escape the monad
>>
>>58043192
>everything is a let
That's the way for defining variable.
>but, I do dig that you can do imperative stuff
The present code do imperative stuff.

>>58043200
>>succ
succ and pred are love
>>
>>58043202
if you re-arrange the letters in the word "jews" what do you get?
>>
>>58043207
> permutations "jews"
["jews","ejws","wejs","ewjs","wjes","jwes","swej","wsej","wesj","sewj","eswj","ewsj","sjew","jsew","jesw","sejw","esjw","ejsw","sjwe","jswe","jwse","swje","wsje","wjse"]
it :: [[Char]]
>>
>>58043240
>sjwe
>sjw
>>
>>58043240
meant for>>58043219
>>
File: 1481889001790.png (3MB, 1080x1920px) Image search: [Google]
1481889001790.png
3MB, 1080x1920px
If haskell is so good, why aren't big companies using it?
>>
>>58043255
because companies don't understand functional programming
>>
>>58043255
Haskell pro took 20 years to understand the complexity of their sort algorithm.
>>
File: CONSPIRACY ALERT THE INTERNET.png (36KB, 400x400px) Image search: [Google]
CONSPIRACY ALERT THE INTERNET.png
36KB, 400x400px
Oh shit if you rearrange the letters in "Jews" you get "Jews". JEWS ARE SECRETLY RUN BY JEWS! It's so obvious now!
>>
File: 2675067.png (384KB, 1918x1078px) Image search: [Google]
2675067.png
384KB, 1918x1078px
How do i type 'Hello world' efficiently in assembly?
>>
File: israel.jpg (64KB, 500x678px) Image search: [Google]
israel.jpg
64KB, 500x678px
>>58043268
>>
>>58043242
>>58043268

>wjse
>World Jrade Senter
>>
>>58043267
dumbass, equational reasoning makes it more obsfucated
one could, theoretically, rearrenge to more simpler to understand versions, which makes the code actually trivial, its when you try to directly understand different version of some code that its harder
>>
>>58043296
>a = b means a = b
>this makes programs harder to understand
>>
>>58043296
No. You don't get it. Lazy evaluation is fucking hard to predict.
>>
>>58043321
Which is why you can enforce strictness when you, the programmer, knows it is beneficial.
>>
>>58043255
Facebook uses it
>>
>>58043314
>omg its easy to see that
foldr (:) [] . reverse . foldl (flip (:)) [] . map succ . map pred 
is equal to id at first sight
>>
>>58043387
Yes, when you see
id = foldr (:) [] . reverse . foldl (flip (:)) [] . map succ . map pred

it IS obvious that they're equal.
Unlike in C, where
x = f()
y = f()

if (x == y)
>>
>>58043255
Because Haskell isn't that good outside of a very few specific domains and most companies don't specialize in those.
>>
>>58043460
what domains?
>>
>>58043460
Haskell is a great general-purpose programming language. Right now it is only surpassed by Idris, IMO.
>>
>>58043387
Is the dot used for chaining statements/expressions in Haskell?
In which case wouldn't map succ . map pred have no effect at all because it'd get the successive element then get the predicate element to the successive element being back at the square one?
>>
>>58043480
That's the joke.
>>
>>58043255
Because Pajeet doesn't understand it.
>>
>>58043466
Monad tutorials
>>
>>58043255
>implying Java is good
>>
File: stewie griffin.jpg (48KB, 800x1274px) Image search: [Google]
stewie griffin.jpg
48KB, 800x1274px
>>58043514
>>
>>58043469
what can idris do
>>
>>58043541
act
>>
>>58043541
Idris has dependent types. So basically, if you have a function like head you can enforce at the type-level that it be given a non-empty vector (compared to a language like Haskell where by default it shits the bed if you give it an empty list or using a safe version where it wraps the output in a Maybe).
>>
>>58043597
>force dependency
>give shit type to head
>it shits

>don't force dependency
>give shit type
>it shits

yeah, wow, what a great feature
>>
>>58043643
You misunderstand. The compiler will give you a type error if you can't guarantee that the vector is non-empty just as if you tried to give it an integer.
>>
File: 645645.png (362KB, 700x700px) Image search: [Google]
645645.png
362KB, 700x700px
How do I include and execute functions from different files in C++?
>>
>>58043726
#include
>>
>>58043726
>Using other people's code without explicit written permission
That's stealing.
>>
>>58043726
You provide the file with a function prototype and the linker will take care of it later.
>>
>>58043280
assembly for dos using int 0x21 or raw real mode assembly using int 0x10?
>>
An album image scraper for a certain website in c#
Figuring out how to get it to work with multiple tab pages much like mkvtoolnix
>>
>>58043744
I knew this much. Right now I've got a main.cpp, and another .cpp for all my functions. I've also got a header.h in which I mention all those said functions once.
>>58043777
I'm going to have to try and explain this code of mine later on so I'd rather do everything myself
>>58043781
I think that's something I've already done. I wouldn't know though, I'm a retard and ended up removing some features because I got some linker errors I couldn't solve.
>>
>>58043643
>this is the level of intelligence of the typical anti-FP poster
>>
FP is the same as regressiveness.
>>
>>58043921
explain this statement
>>
>>58043942
It takes a well established paradigm and removes good features while making an echo chamber bubble for it's users.

No progress is ever made and FP users are stuck in a limbo of trying to be a little girl.
>>
>>58043978
>removes good features
Like?
>>
>>58043982
Objects.
They simplify the building and structuring of a program. While FP just makes doing the same a hassle not worth building in large projects.
>>
>>58043978
you're being vague.
how can I take you seriously, when you don't explain yourself properly.
>>
>>58044035
Even if objects were as good as you people say they are, FP doesn't mean no objects.
>>
>>58043921
>>58043978
>>58044035
That's why multi-paradigm programming languages exist, dumbass
>>
Reminder that you cannot program an ai gf in an OOP language because women are not objects
>>
F# is the best FP and the rest are just plebian tier.
>>
File: 5345634.jpg (22KB, 704x400px) Image search: [Google]
5345634.jpg
22KB, 704x400px
I'm too dumb to make a properly working Tic-Tac-Toe game with a main menu and high scores.
>>
Why this PHP function doesn't work?

I'm trying to make a dynamic category list to be displayed on the right sidebar for my website

function obtenerCategorias(){

global $conectar;

$obtener_categorias = "SELECT * FROM categorias";

$run_categorias = mysqli_query ($conectar, $obtener_categorias);

while ($row_cats = mysqli_fetch_array($run_categorias)){

$cat_id = $row_cats ['cat_id'];
$cat_titulo = $row_cats ['cat_titulo'];

echo "<li><a href='#'>$cat_titulo</a></li>";
}

}


It is included in the html file
>>
>>58044150
*imports the entire vb library for basic funcionality*
>>
I have $25 on amazon. What book should I get? I'm thinking something on compilers or functional.
>>
>>58044215
i believe in you anon, you can do it! what part of it is hard for you?
>>
How easy is MIPS assembly to learn?
>>
>>58044215
In WPF this is just drag n drop and set up logic
>>
What's the tl;dr of this thread by now?
>>
>>58044215
>Tic-Tac-Toe high scores
It will always be a tie, what's the point?
>>
>>58044463
*if you and your AI are not retarded
>>
>>58044221
function BuildWall() {
while (mexicans -= pay){
return add_brick()
}
}
>>
>>58044543
uhh...
>>
>>58044221
Maybe it does work but categorias is empty?
>>
File: 1481676430605.jpg (38KB, 466x663px) Image search: [Google]
1481676430605.jpg
38KB, 466x663px
>>58044543
Bait?
>>
>>58043980
If only. I wanted to remove a button created in another file, so I removed it's creation function. That blocked the whole application from starting up, because some linked list was reliant on the buttons being in a certain order in this massive button array.
Now sure, could refactor it given the time, but we need to be ready by Tuesday and I'm the only person who can develop this stuff at home during the weekend.
>>
Can your language do this? The errors happen at compile time.

> val a = attribute"a"; val b = attribute"b"; val c = attribute"c"
a: Attribute
b: Attribute
c: Attribute

> val res1 = query(withAttributes(a, b))
res1: List[Row[a.type :: b.type :: HNil]]

> val as = res1.map(_.attribute(a))
as: List[String]

> val bs = res1.map(_.attribute(b))
bs: List[String]

> val cs = res1.map(_.attribute(c))
<error>: row does not contain attribute 'c'

> val res2 = query(withAttributes(a, c))
res2: List[Row[a.type :: c.type :: HNil]

> val cs = res2.map(_.attribute(c))
cs: List[String]

> val bs2 = res2.map(_.attribute(b))
<error>: row does not contain attribute 'b'
>>
>>58044664
>implying heterogeneous lists are impressive at this point
>>
>>58044697
They are to the vast majority of programmers who use crippled languages.
>>
>>58044712
Hopefully you know that Scala is also quite crippled.
>>
>>58044718
Yes, so it's impressive that it can do them.
>>
>>58044664
CPP can do anything
>>
why would this terminate due to timeout? only does it on one case of many, rest it works, so i suspect it's a very particular special case

https://www.hackerrank.com/challenges/kangaroo

import System.IO ()

main :: IO ()
main = do
x1_temp <- getLine
let x1_t = words x1_temp
let x1 = read $ x1_t!!0 :: Int
let v1 = read $ x1_t!!1 :: Int
let x2 = read $ x1_t!!2 :: Int
let v2 = read $ x1_t!!3 :: Int
putStr $ analyze x1 v1 x2 v2

analyze :: Int -> Int -> Int -> Int -> String
analyze leftStart leftRate rightStart rightRate
| leftStart == rightStart = "YES"
| rightRate > leftRate = "NO"
| otherwise = if newLeftStart < newRightStart
then analyze newLeftStart leftRate newRightStart rightRate
else analyze newRightStart rightRate newLeftStart leftRate
where
newLeftStart = leftStart + leftRate
newRightStart = rightStart + rightRate
>>
>>58042656
I made a basic Discord bot with some node.js and ran it on my old unused phone with termux because why not use old shit. It was really pretty fun, I've forgotten how much fun I've had programming. Reading a book on basic webdev now.
>>
>>58044861
What happenss if I type:
0 1 1 2
>>
>>58044928
it prints "NO" because the right rate is greater than the left rate. it works for 29 of the 30 test cases, there's just one it times out on and idk why
>>
on a laravel 5 app, and some api requests are killing me
>>
I'm having an issue parsing a file using c. Each line contains an arbitrary number of points in the format:

(x,y) (x,y)
(x,y) (x,y) (x,y)

while(!feof(fp)) {



// scans coordinates from text file
fscanf(fp, "(%d, %d)", &Vx, &Vy);

obstacles[obstacle_count].vertices[vertex_count].x = Vx;
obstacles[obstacle_count].vertices[vertex_count].y = Vy;
vertex_count++;

c = fgetc(fp);

if (c == '\n') {
// place first vertex at the end, helps when computing edges
obstacles[obstacle_count].vertices[vertex_count+1].x = obstacles[obstacle_count].vertices[0].x;
obstacles[obstacle_count].vertices[vertex_count+1].y = obstacles[obstacle_count].vertices[0].y;
obstacles[obstacle_count].point_count = vertex_count+2;

//next line
obstacle_count++;
vertex_count = 0;

vertex_count = 0;
}

}


It is almost working but when I reach the last point on a line it gets added to the vertex list multiple times for some reason. Any tips?
>>
>>58044963
OK and with
1 1 2 1
?
>>
>zero, 0, NULL experience with C
>trying to setup a C web server
>with mongoose
>need a DB engine
>thinking of libbson

what am I even doing? I understand the very basics to try and run this example

https://github.com/cesanta/mongoose/blob/master/examples/simplest_web_server/simplest_web_server.c

Now I've gotta figure out

>how to write the http routing logic
>how to use libbson for a database

what else? Am I doomed?
>>
>>58045061
how about you just use something else ya big dumb bitch?
>>
>>58045035
ty

there was a simple equation one of the pajeets found and then posted on the discussion board and all the other pajeets copied but i'm glad i got my way working
>>
>>58045061
Stop programming anything that involve HTTP
>>
>>58045105

What else is an option? The goal is to have a server that just werks.

No dependencies, no modules, no imports, just the base server compiled and usable.
>>
>>58045162
What.
>>
>>58045061
found something, bout to rtfm

https://docs.cesanta.com/mongoose/master/#/http/
>>
i have a .zip file with 500 photos, encrypted with 7Zip with a strong password.

is it possible to break it?
>>
>>58045162
This. And don't use fucking C for it
>>
>>58045214
probably aes 256 so no
>>
I'm trying to use threads in a program I'm writing in C, for Windows.

I think if I use the function WaitForMultipleObjects, with nWaitAll == TRUE, the main loop should wait until each of the threads returns. However this is not happening?
>>
File: intellectual-feels.jpg (6KB, 164x196px) Image search: [Google]
intellectual-feels.jpg
6KB, 164x196px
tfw to intelligent to use anything other than C for webdev
>>
>>58045367
Why don't you use pthreads?
>>
>>58045401
>tfw to intelligent to use anything other than magic-1 assembly
>>
>>58045434
There's no pthread on Windows unless you're using the MinGW implementation, which is just a wrapper for Windows threads.
>>
>>58045354

What else is there, assembly?
>>
File: 1455432402780.png (312KB, 506x662px) Image search: [Google]
1455432402780.png
312KB, 506x662px
>>58045539
>>
File: 1394028874167.jpg (580KB, 1200x800px) Image search: [Google]
1394028874167.jpg
580KB, 1200x800px
>>58043255
>language based on recursion
>sort algorithm

What are call stacks haskellheads ?
>>
>>58045650
Haskell is lazy so it's inherently trampolined.
>>
File: 500px-DFAexample.svg.png (19KB, 500x299px) Image search: [Google]
500px-DFAexample.svg.png
19KB, 500x299px
>>58045027
Build your finite-state machine of acceptance on paper, then implement it using the switch statement.
>>
>>58045061
it sounds like you shouldn't be doing this anon
you're going to introduce a vulnerability. there's no way you don't
>>
>>58045687
>not using indexed GADTs
it's like you don't even care about eliminating invalid state transitions
>>
what should I name my meme event sourcing database project?
>>
>>58045705

Except I have to, since nothing else is an option.
>>
>>58045735
I don't know, did you make a logo yet? Don't forget to make one. And a theme song. You'll need all of those before writing a line of code (or abandoning the project.)
>>
>>58045719
newtype Foo = Foo
newtype Bar = Bar

baz :: Foo -> Bar
qux :: Bar -> Foo
>>
>>58045719
>>not using indexed GADTs
Anon is using C
>>
>>58045814
that's his own fault
>>
>>58045650
Quicksort uses recursion you reprobate.
>>
File: last.png (59KB, 1258x883px) Image search: [Google]
last.png
59KB, 1258x883px
Working on my terminal emulator, trying to improve performance for sixel support, which isn't being easy.

Also about to start another round of american fuzzy lop to see if there are any crashers in the new code.
>>
>>58045860
terminal cancer?
>>
>>58045913
Yes.
>>
>>58045925
post github
>>
>>58045937
Just search for "github terminal cancer".
>>
>>58043863
Honestly, this is a pretty basic C++ concept. Google will most likely help you lots here.
>>
File: 111.png (40KB, 804x520px) Image search: [Google]
111.png
40KB, 804x520px
>>58045956
are you this guy?

holy kek

never suspected a thing
>>
>>58044903
That actually seems pretty neat. What are you doing in webdev?
>>
>>58046006
Yeah, I am, hi.
>>
>>58045956
I made the mistake of Googling 'cancer terminal'.
>>
>>58045539
Just strike up a quick Python or JS based server. Not sure why you're so adverse to the idea of libraries, there are plenty of good ones that make your life way easier. Bottle/Flask for Python is nice and easy to learn, as well as Express for JS
>>
>>58046021
badass dude

you look like you can program some things

how did you found /g/?
>>
int main()
{
std::list<const char*> l{ "dpt", "posters", "are", "pedos" };
std::vector<std::string> v;
v.assign(l.cbegin(), l.cend());

for (const auto& ch : v) {
std::cout << ch.c_str() << " ";
}std::cout << std::endl;

return 0;
}

How come this won't compile without converting ch?
ch.c_str()


"ch" should be a string? No?
>>
>>58046046
I've always been here.
>>
File: 1.gif (532KB, 400x374px) Image search: [Google]
1.gif
532KB, 400x374px
>>58046110
>>
>>58046110
took a look at opal and the project seems to have some issues (94).

how do you deal with this?

do you fix it immediately or ?
>>
>>58046054
it does compile
>>
opinions on talloc?
>>
>>58046045
>Just strike up a quick Python or JS based server

Not an option.

>>58046045
>Not sure why you're so adverse to the idea of libraries

because I want a fucking server that just starts up and runs - and not spend 30 minutes tracking all the dependencies, libraries, and frameworks that it depends on - every time I have to port the thing.
>>
>>58046218
>because I want a fucking server that just starts up and runs
Just use Apache or nginx then
>>
File: 1482001172.png (11KB, 389x143px) Image search: [Google]
1482001172.png
11KB, 389x143px
>>58045354
>nginx is written in C
>with little comments
>>
>>58046165
Depends on the issues, these days I mostly just respond to things that are strictly related to stuff I did.

There have been a lot of new contributors so I haven't been writing anything new myself.
>>
>>58046325
are you schizo?
>>
>>58046197
>>58046197
It's a compiler specific thing, then? msvc gives an error.
Which compiler did you use?
>>
>>58046339
I g++'d that bitch
>>
>>58046362
I'd Make her
>>
>>58046254
>shit breaks
>anything happens

your case: setup the server again
>install an OS
>install the server software
>install the CGI software
>install the DB engine
>setup the site code
>start it up

what I actually need: setup the server again
>install an OS
>copy server executables and db files
>start it up

see the difference?
>>
>>58045367
Followup:
I reduced the number of simultaneous threads from 100 to 60 and it now works as I expected.

I don't think my threads use much memory? Any idea why having too many threads would cause WaitForMultipleObjects to fail?
>>
>>58046339
I waffed her
>>
How are you suppose to seed a random num generator in c++?
srand(time(current))
srand(time(null))

I remember there was one that gave real randomness. Also what does putting null into the time function do?
>>
>>58046412
60 threads? What are you doing anon?
>>
>>58046456
you ccan google this shit nigga
>>
If you can't do side effects in Haskell then how do you make a program that ever does anything?

If Haskell is so pure then why does it have exceptions?

If purity is so great then why does it have unsafePerformIO?

If laziness is so great then why does it have seq?

What is the point of the monomorphism restriction?
>>
>>58046458
60 threads is fine if you have 64 cores
>>
>>58046532
I agree.
>>
File: not-an-argument-2.png (76KB, 216x196px) Image search: [Google]
not-an-argument-2.png
76KB, 216x196px
>>58046511
monads
>>
Recommend me some programming music please!

Youtubes recommendation algorithm has been broken since their last update, and I hate all the music they auto play me.
>>
>>58046458
Port scanner
>>
>>58046655
Neophyte
>>
>>58046660
You don't really need many threads for that. You can use many sockets and do a big poll on them.
>>
>>58046511
>What is the point of the monomorphism restriction?
It actually has to do with applying optimizations. They were talking about replacing it with a warning at one point, so instead of just refusing to compile it explains what the actual problem is and gives you the opportunity to ignore it. I don't know if it ever happened.
>>
>>58046456
Don't use rand or srand.

std::random_device rd;
std::default_random_engine eng(rd());
std::uniform_int_distribution<int> rng(0, 10); // Or whatever bounds.

std::cout << rng(eng) << std::endl;
>>
>>58046707
OK, thanks for the advice.

Still, any idea why the threads won't work properly? I'm obviously missing something...
>>
File: 546456.jpg (685KB, 2335x2507px) Image search: [Google]
546456.jpg
685KB, 2335x2507px
I suppose my issue is something super simple but I've been stuck on it for hours so I might as well post it here.

My code won't compile and I'm guessing it's because I fail to understand includes and functions properly (or there's a typo)

Header.h:
#ifndef ALI
#define ALI
#pragma once
void Menu();
#endif


main.cpp:
#include "Header.h"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
AlkuRuutu();
return 0;
}


ali.cpp
#include "Header.h"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

void Menu()
{
cout << "Menu";
}
>>
>>58046313
nginx isn't a standalone web framework though
>>
>>58046864
oops, the AlkuRuutu(); in main.cpp is supposed to be Menu();
it still doesn't work after changing that
>>
>>58046398
>what is incremental image backup

if shit breaks you just load up a system image and reboot
>>
>>58046864
You haven't linked main and ali?
Create a header for ali and include it in main
>>
>>58046864
#pragma once and include guards are redundant, you should stick to using one of them.

AlkuRuutu() is not declared or defined, did you make a typo when pasting your code?

Did you link to ali.o?

Post your compilation error.
>>
>>58046864
Did you compile ali.cpp so that the linker can find the Menu definition?
>>
>>58046907
>>58046911
>>58046916
Oh, I thought just only a single header was required. I don't know what to stuff inside the next header though, considering that there's only one function which is used in both main.cpp and ali.cpp

The compiler errors are LNK2005 and LNK1169, so it has something to do with me linking them in the wrong way.
>>
>>58046898
>back up the whole computer instead of just the critical data

That's a solution. If you consider duct taping a water tank a solution as well.
>>
Sup, /dpt/.

Need you advice. I made a simple app in vs2015 (dont ask, it should be done there)


Heres code of mainactivity.cs

using Android.App;
using Android.Widget;
using Android.OS;
using Android.Views;

namespace App1
{
[Activity(Label = "App1", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
Button button1;
TextView textView1;
EditText editText1;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

SetContentView(Resource.Layout.Main);
button1 = (Button)FindViewById(Resource.Id.button1);
textView1 = (TextView)FindViewById(Resource.Id.textView1);
editText1 = (EditText)FindViewById(Resource.Id.editText1);


button1.Click += delegate
{
textView1.Text = editText1.Text;
};
}
}
}


in Android emulator it wroks fine, text changes on click and all. But when i install signed apk on my note 3 (android 5.0) app crashes without even starting. i dont have any experience with android deploying so any advice will do.
>>
>>58047338
Stop coding. Coding is far more difficult than using [ code ]. So you won't succeed.
>>
Guys, my interview as Java intern is due on Monday.

I'm so scared. They could ask ANYTHING, Java is a fucking ocean of topics.

>Dude, do you even Spring
>Dude, do you even Maven
>Dude, do you even lift
>Dude, do you even multi-threading?
>Dude, do you even JavaFX?
>Dude, do you even <obscure framework this particular company adores>?

Help ;_____;
>>
>>58047442
Thanks for pressing buttons.

Any real advice?
>>
>>58047338
In Build, did you run Build->Archive->Distribute?

Did you try debugging from your phone?

In your project properties, did you disable shared run-time?, added sdk assemblies?

Is your minimum target API set to one that would work on your phone?
>>
>>58047501
In Build, did you run Build->Archive->Distribute?
yup
>Did you try debugging from your phone?
yup. passed
>In your project properties, did you disable shared run-time?, added sdk assemblies?
yes, one of the first things i did.
>Is your minimum target API set to one that would work on your phone?
yup, set it from 4.0 to 7.0


but thats a start. ill double check. thanks
>>
>>58047451
>Interviewing for an internship
Literally just memorize the basic data structures, talk excitedly about a project you've worked on and don't be a sperg, not hard.
>>
>>58047553
Well damn.

What about disabling everything on the packaging tab with no debugging enabled, setting up for only armeabi-v7a in Advanced and choosing "Internal Only" as install location?
>>
>>58046054
Namespaces were made for a reason you dolt.
>>
>>58047501
Well shit. Didnt pay attention to 'couldnt restart project automatically. save changes and reload manually'. It wroks fine.
Thanks a lot, bro.
>>
>>58047451
Just show them that you have an ability to learn and you suck dickies well
>>
Having a different .xml for the data for each level of my game is okay, right?
>>
Learning Django.
>>
>>58047843
Using XML is bad in general.
>>
>>58047843
Why use XML when you can use JSON?
>>
>>58047843
Why use XML when you can use plain text?
>>
>>58047885
>why use shit when you can use this other shit instead
>>
nothing but thanks for asking
>>
>>58047913
>Not liking json
How do you like to transfer reasonable amounts of data with minimal overhead, eh, numnuts?
>>
>>58047957
Yaml is better than json.
>>
Did you just assume my favorite programming language?
>>
>>58047875
how come?

>>58047885
>>58047907
The files are only 0.5kb - 5kb in size
I also don't know how to read any other file format other than xml
>>
>>58048021
JSON is dead simple to learn and use
>>
>>58048021
Json is simpler m8. What language are you writing it in?

>>58047979
If you're using yaml, you might as well use xml. Disgusting heavy files.
>>
Is it closure if you bundle with a function f a scope that is only accessible to variables/functions declared in the body of f or as parameters of f.
>>
>>58048067
>>58048078
I'm using java
I'll google json, but I won't change over on this project as the xml is working well

I don't see how json could be much easier. xml is as easy as html
>>
>>58048021
It's verbose and ugly. It's hard to edit by hand and error prone.
>>
File: prettysimple.png (36KB, 988x625px) Image search: [Google]
prettysimple.png
36KB, 988x625px
>>58048168
maybe it's because i'm not using it for much

pic related
>>
>>58048122
Be more precise please.
>>
File: 1459454260368.jpg (11KB, 680x510px) Image search: [Google]
1459454260368.jpg
11KB, 680x510px
>>58048167
in b4 you switch to JSON
>>
File: 1.gif (3KB, 400x374px) Image search: [Google]
1.gif
3KB, 400x374px
Guys, who is this jason that i hear everyone talking about?

why is he famous?
>>
I'm not sure why this thread is filled with pajeets and webdevs but custom binary format is the way to go.
>>
>>58048250
Rajesh pls
>>
Dear /dpt/ what book should i start reading to begin with CLisp?
>>
>>58048167
Eurgh, try a proper programming language m8.
Haskell's nice.
>>
>>58048250
I prefer python + pickle myself :)
>>
>>58048191
Ok, so I have a map:

map: variable name -> expression

Each function I have contains it's own map for all expressions defined within this function.

so (+ a 1) is only a valid expression in the function if you can find a in the map contained in the function.

Is that closure? (Sorry for the verbose expalantion but I didnt' want to leave any details.
>>
>>58048306
I'm learning C# after my game is completed
>>
File: images.jpg (76KB, 885x1080px) Image search: [Google]
images.jpg
76KB, 885x1080px
Why aren't you reading an actually good book, for productive people, with practical knowledge, instead of your meme wizard book?
>>
>>58048405
That book looks like it was written by a joyless corporate stiff.
>>
>>58044664
(#\c '(1 "ass" 'penis) #(nigger 1/2))
>>
>>58048433
top fucking kek seriously?
not knowing who mcconnell is... for shame /g/ for shame
>>
I'm working on an assignment for school,website to sell a house, but It's a mess and I don't really know how to fix it.
>>
Hey, I'm making a video game. Can you maybe write me a program real quick that gives AI their own thoughts, like some sentient AI.
Oh, also make it so that they chase the player, take cover, melee, shoot and sneak around according to the situation. They should have an ammo counter that goes down the more they shoot. Thanks, guys.
>>
Nearly finished "my" first project, 250 lines so far - also is it normal to google for something then modify the code you found to suit your needs - I mean I understand the code I'm copying and modifying
>>
>>58048381
No, no!
C# is microsoft's bastardised version of Java. Learn something else please. Preferably Rust.
>>
>>58048487
well, we're here to help because /g/ is your personal homework solver ®.
>>
>>58048487
should've read code complete
you're obviously using a code-and-fix lifecycle for your project without knowing about it

god damn this book is the fucking redpill for software development
>>
>>58048487
I hope you're not just writing it in straight HTML, are you? Cause that would be a big mistake.
>>
>>58048499
sent :^)
>>
>>58048521
But I want to learn Unity3D :c
>>
>>58048540
>TFW there are fucking idiots on /g/ that reply to the wrong posts
>>
>>58048560
but i replied to the right one
he's using the wrong lifecycle model for his assignment, that's why it's a fucking mess right now
>>
>>58042677
i dont understand what you mean. Can you print out the answer your getting? I just did something similiar in java gui.
>>
why the FUCK would anyone use a binary tree structure, when skip lists are a much better solution?
>>
>>58048546
HAHAHA UNITY?
So you can jump into the cesspool that is the Unity community?
Seriously, you'll learn a lot more writing your own engine. I did and now I have a job at NASA coding software for rockets in pure haskell.
>>
till trying to decide what the best data structure is to implement my tic tac toe program
>>
>>58048520
That's how you're supposed to code unless you're programming in ASM anon.
>>
>>58048637
An AVL tree would be smart, that way you can check for completed rows and columns in O(1) time.
>>
>>58048621
sure you do retard

kys
>>
>>58048621
I have wanted to write my own engine for a while desu.

I'll be fine with all the physics and maths, forces and matrices etc, but I wouldn't know where to start with getting things to render in three dimensions.
>>
>>58048647
oh good, been learning all year and never managed to write anything worth uploading without using google, up until this point I thought programming wasn't for me
>>
>>58048637
Ternary tree.
>>
>>58048597
They're useful for different things. And skip lists happen to be worse than resizeable arrays in every situation they're allegedly good at in the real world anyway.
>>
>>58048667
3D rendering is just matrix multiplication to bring a point from object space to screen space
>>
What's a good and lightweight and mobile IDE/compiler for C?
>>
>>58048715
vim
>>
>>58048667
If you're fine with forces and matrices, you'll be fine with rendering in 3D. It's literally just very simple linear algebra to work out projection onto the screen surface. (Use opengl)
I'd warn you not do the physics yourself if you're wanting anything more complicated than a simple sphere/sphere sphere/plane collision system, unless you wanna dive into the deep sea of collision solvers.
>>
>>58048715
vim + gcc
>>
>>58048715
emacs
>>
>>58048715
Visual Studio is the only C IDE worth shit

Clion, qt creator etc. are all complete garbo in comparison, though the VC++ compiler is also shit. Basically if you're gonna be working on non-Windows platforms you better get ready to rice out Vim or Emacs.
>>
>>58048734
this

>built-in graphical gdb integration
>tons of packages for tagging and autocomplete
>the single most configurable software package in the recent history of computing

Emacs support falls short with many languages (such as Java and C#), but for C and C++, you can't get any better
>>
File: 1477836894134.png (194KB, 498x430px) Image search: [Google]
1477836894134.png
194KB, 498x430px
>>58042656
>tfw you try to refactor literally everything at once but get tired and stop, leaving it all a colossal non-functioning mess
Ship it I don't give a hoot.
>>
>>58048682
how is this the best?
>>
>>58048764
VERSION CONTROL
E
R
S
I
O
N

C
O
N
T
R
O
L

VERSION CONTROL
>>
>>58048762
>Implying anyone would want to develop java or c#
>>
>>58048720
>>58048726
Does it have code formatting text and stuff? I tried running a C compiler with Notepad++ but it won't show anything in the console.
>>
>>58048405
What is this book about?
Does it teach me anything useful or is it just a meme book?
>>
>>58048777
Try it and you'll see.
Thank me later.
>>
>>58048543
https://www.dropbox.com/sh/a5hhvvxyd1s22v6/AABQ8yLNO3G4KDSl9WhKwftDa?dl=0
>>
>>58048764
Just restart from scratch at every versions
>>
>>58048783
TOO LATE I ALREADY PUSHED TO THE REMOTE.
O
O

L
A
T
E
>>
>>58048858
PULL BACK
U
L
L

B
A
C
K
>>
Oh My God!
I realized I've fallen victim to lisp.
>buy several books
>try to do everything in lisp because people say its the language of god
>spend more time reading books than programmin in it
>>
File: meh.png (28KB, 486x493px) Image search: [Google]
meh.png
28KB, 486x493px
Trying to recreate Unknown Pleasures cover, but it's not really good so far
>>
>>58048867
I T ' S D O N E
I
T
'
S
D
O
N
E
>>
>>58048885
what language??
>>
>>58048844
>Not using github
>>
>>58048875
>Falling for lisp
top kek
>>
>>58048841
It's the complete opposite to a meme book. There's zero hype, just technique after technique that can be applied to any project, from an assignment, to a code competition, to a big enterprise.
Teaches you best practices, architecture, design, why lifecycles models are important even for trivial projects, lots of things.
Just pirate it and give it a try, you'll find it blows /g/'s meme books out of the water. It should be /dpt/'s standard book.
>>
>>58048924
but its the language of god
m-macros are the best, you can do god stuff with it
>>
>>58048919
English I think
>>
File: meh2.png (31KB, 471x476px) Image search: [Google]
meh2.png
31KB, 471x476px
>>58048919
Processing.

Made some adjustments, still not perfect though.
>>
>>58048946
it's just maimed higher level C
>>
>>58048984
>maimed
what?

but with lisp, you can do functional stuff, with lisp you can do the macro
>>
>>58048844
Oh, wow. It's pure html/css.
You're fucking gay mate.
>>
>>58048946
Who told you that? Some unemployed academic with a dildo up his ass and a pocked copy of SICP?
>>
>>58048844
>css.css
genius
>>
>>58048973
Thicker lines, greater amplitude in the middle. Almost there. You should use haskell though, not gay-java.
>>
>>58049010
well, I bought five books, I can't just not read them
>>
>>58049045
>ssc.css
>>
>>58049066
If you're a giant nerd, maybe
>>
>>58049092
but will I get a job?
>>
>>58042656

How does LibPNG work

I just want to get a 2d array of some "struct pixels" from a PNG file and I don't really want to have to read through the entire spec just to do this thing that has surely been done already.
>>
File: Collision.webm (404KB, 1120x700px) Image search: [Google]
Collision.webm
404KB, 1120x700px
I actually did it
>>
>>58049129
>java.
The fucking madman.
>>
>>58049129

> java babies
>>
I'm trying to compile C in NP++ using MinGW but whenever it compiles a program it doesn't display anything on the console. Why not?
>>
>>58049162
>i moved numbers to a register in assembly im so 1337
i remember being 13 too
>>
File: 1481149316342.jpg (132KB, 882x731px) Image search: [Google]
1481149316342.jpg
132KB, 882x731px
>>58049129
that looks like Box2d
>>
>>58049231
Kill yourself, frogposter.
>>
File: CollisionHandler.jpg (170KB, 1680x1013px) Image search: [Google]
CollisionHandler.jpg
170KB, 1680x1013px
>>58049231
Is that a compliment?
>>
>>58049210
>if you're not writing in java you must be writing in asm!

lols
>>
>>58049264
>using anything inbetween
lmao
>>
>>58049287
>the only thing as high level as java is java

rofl
>>
DEAD
>>
>>58049263
>No broadphase
Are you really that much of a faggot?
>>
>>58049532
Why would the broad phase be visible in the handling and not the detection LMAO
>>
Reminder:

If you want performance, use C.

If you want correctness, use Haskell.

If you want a job, use Java.
>>
>>58049579
But what if you want memes?
>>
>>58049579
>correctnes
what did he mean by this
>>
New thread:

>>58049620
>>58049620
>>58049620
>>
File: Untitled.png (2MB, 1920x1080px) Image search: [Google]
Untitled.png
2MB, 1920x1080px
C wins again
>>
>>58049642
Don't know about other design choices, but I'm sure as hell love this options dialog.
>>
>>58049720
it helps prevent feature creep.
if it doesn't fit in the dialog box, it doesn't get added. :D
>>
>>58048715
Emacs + GCC
>>
Hi guys so I'm in highschool in a country that has this system that makes all highschoolers take the same exams and I have been frustrated for two years becaus I can't pass this phase does anyone know a website where I can find leaked tests in arabic
Thread posts: 316
Thread images: 33


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

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


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