[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 23
File: 1334682645405.jpg (475 KB, 1024x1076) Image search: [Google]
1334682645405.jpg
475 KB, 1024x1076
Old /dpt/ at >>51230807

What are you working on?
>>
First for Visual Studio
>>
File: web haskell 2.webm (125 KB, 1122x440) Image search: [Google]
web haskell 2.webm
125 KB, 1122x440
A haskell backend for a website. Now I can parse an input and call different javascript functions.
>>
first for X#
>>
>>51234802
D!
>>
>>51234802
daily reminder not to help plebs with noob questions
>>
File: animer.gif (393 KB, 500x332) Image search: [Google]
animer.gif
393 KB, 500x332
Ask your beloved programming literate anything.

>>51234802
>What are you working on?
A general utility C library for /dpt/
>>
>>51234853
X# looks interesting, too bad there's literally no information on it out there
>>
Implemented all opcodes for my Gameboy emulator except the interrupt ones because I'm not sure how that'll work yet.
>>
>>51234849
why
>>
>>51234874
Why does malloc sometimes returns a null pointer?
>>
>>51234874
Why are all the pages in that book the same?
>>
vector<int> a (vector<int> b){
//
return b;
};


Is this okay?
>>
>>51234914
Why Haskell? Because contrary to popular opinion, once you get used to its syntax it becomes really fast to work with.
>>
>>51234922
returns NULL on failure
http://www.cplusplus.com/reference/cstdlib/malloc/

as for why it failed, that's something else..
>>
File: 1434138902151.jpg (288 KB, 709x709) Image search: [Google]
1434138902151.jpg
288 KB, 709x709
>>51234922
Because errno.

>>51234935
It's a loop.
>>
>>51234959
do you need to check it? what do if it returns null?
>>
I'll try to make some experiment with setter-only C# properties just to see how quickly something can be turned into a clusterfuck of side effects.
>>
Why does this just print "nil"?
{code} local arr = {"Test1", "Test2"}
for i=0, #arr do
print(arr[i])
end{code}

Lua 5.3 btw
>>
>>51235022

local arr = {"Test1", "Test2"}
for i=0, #arr do
print(arr[i])
end
>>
>>51235003
https://en.wikipedia.org/wiki/Errno.h
http://www.ioplex.com/~miallen/errcmp.html
>>
>>51235022
lua arrays are 1-indexed.
>>
>>51235053
Lua start at index 1.
>>
>>51234951
Looks like a normal get method.
Don't be surprised when shit breaks down the line though, you're just giving them the reference to the vector b so any modifications done will be done to the original as well.
>>
>>51235119
What? That's actually a copy.
>>
>>51234951
No.
>triple copy
Absolutely disgusting.
>>
>>51235119
I hope this is bait
>>
>>51235022
>>51235053
local arr = {"Test1", "Test2"}

for _,a in ipairs(arr) do
print(a)
end
>>
>>51235172
Slower.
>>
>>51235142
What should I do instead? I need to return a vector
>>
Upgrading all my autism-network. logs TLS certificates and cfengine policies to 3.6.6, wiping all my old 3.4 rules to take profit of the new features. Adding some kibana daemon.
moving gitolite and lsyncd from old server to new server.
writing manops of the involved processes.
>>
>>51234951
>>51235182
What do you actually want?
>>
>>51235180
Yes, iterators have a tiny bit of overhead to them, but in this example it would be trivially small. Also the index example has to compute the length of the array before it begins (and possibly each iteration), which may actually be worse than using the iterator.
>>
>>51234849
Hey, I got a quick question for you:
I'm new to haskell and I don't get it at all.
I want to write a function, with a list of lists and (x,y) coordinates as input and it's supossed to get the y element of the x list (the list of lists are coordinates of a field). How do I write this? I honestly have no clue.
I know that this is fairly easy, but I don't get shit right now.
>>
>>51235182
There's nothing wrong with what you're doing.
>>
>>51235202
I just want, from main, to call a function that creates a certain vector.
>>
>>51235182
const* or const& or *const or const*const.
>>
>>51235248
You can't because haskell is pure and purity cannot be violated like this. Get out, imperative imperialist, you disgust me!
>>
>>51235248
[code=haskell]
dicks lst (x,y) = lst !! x !! y
[/code]
>>
>>51235248
>buy a dress you like ...
> ???
> profit?
>>
>>51235172
Thanks anon.
>>
Why doesn't this work properly? [spoiler]Visual Basic btw.[/spoiler]

 Public Class Form1
Dim Cost As Double
Dim Bagel As Double
Dim BagelDozen As String
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub btnPrice_Click(sender As Object, e As EventArgs) Handles btnPrice.Click
Bagel = txtBagels.Text
Cost = 0.75 * Bagel
txtCost.Text = ("$" & Cost)
Select Case BagelDozen
Case "Dozen"

If txtBagels.Text > 5 Then
Cost = 0.6 * Bagel

End If


End Select

End Sub


No doubt some of you have seen this question if you've taken an intro programmer class. The thing works just fine, but I can't get it to give a discount of 60 cents per bagel when It's half dozen or more. Any help?
>>
>>51235463
Fuck, I keep forgetting /g/ doesn't use spoiler tags. My /v/ness is showing, oh no.
>>
Should I use C++ with Qt, GTK#, or Tcl/Tk for my GUI development? So far I only really have experience with GTK# and while I like it, I'm thinking of branching out a bit.

>inb4 gtk2hs
>>
Hey fellas, I'm trying to learn Scala and improve my functional skills.

This function should return true for matched parentheses, can you tell me if it looks right?

  def balance(chars: List[Char]): Boolean = {

def checkParen(chars: List[Char], count: Int): Boolean =
if(chars.isEmpty)
count == 0
else if(count < 0)
false
else if('(' == chars.head)
checkParen(chars.tail, count + 1)
else if(')' == chars.head)
checkParen(chars.tail, count - 1)
else
checkParen(chars.tail, count)

checkParen(chars, 0)
}
>>
File: 1441684460338.jpg (92 KB, 1280x720) Image search: [Google]
1441684460338.jpg
92 KB, 1280x720
>>51235463
>Visual Basic
>>
>>51235463
>visual basic
>Windows Forms

>>>/trash/
>>
>>51235463
If you want a real answer, it's that you're a retard and you put the if statement AFTER you print the value to your text box.
>>
I don't do much programming.
Anyone know of a way I could make (or an existing program that does the same thing) a program that responds to objects on screen?
For example, if it sees a green rectangle on the screen in a specific place, it clicks in another specific place.
Help would be greatly appreciated.
>>
>>51235487
I don't know much about the meme language you're using, but it's usually just easier to match brackets (especially if there is more than one kind) with a stack.
>>
>>51235539
This wouldn't be a trivial program.
You'd need to have a program that does the following:
1: Gets a copy of the current frame on the screen
2: Is capable of identifying figures within the picture it took
3: Can send mouse movements
4: Can do all of this fast enough so that the screen hasn't significantly moved since step 1

I wouldn't know where to start with something like this, but this's a basic algorithm you can think about how to implement.
>>
>>51235549

the count variable is working as a stack:

( -> increment count (push onto stack)
) -> decrement count (pop off stack, balanced)

I'm just not sure If I covered every possiblity
>>
>>51235549
He's using callstack implicitly, really neat.
>>
>>51235593
I suppose, but it would be hard to add {} or [] with that setup. It also relies on the language having TCO.
If you know you won't need other brackets and Scala has TCO, I suppose it works fine.
>>
File: 1421383708892.jpg (97 KB, 720x960) Image search: [Google]
1421383708892.jpg
97 KB, 720x960
>>51235502
>>51235489

Why do I even try

>>51235519
Ohhhh, thanks. Bless your round tummy and bald head anon.
>>
>>51234802
What is a good book for learning C++ for beginners, also do you have a video series I could watch on Youtube for learning C++?
>>
>>51235691
cppreference.com
cplusplus.com
gigamonkeys.com/book
>>
>>51235311
Thanks, though I just found it online as well.
(If it's not too much to ask, I'm gonna continue) How do I replace said element? Do I have to split the list, so my element is at the beginning of a list and I can delete it/add a new one?

>>51235310
>>51235351
Thanks for trying.
>>
>>51235691
>video series I could watch on Youtube for learning C++
They are all fucking shit. Read a book.
I'm not a Meme++ programmer so I don't know which ones are good.
>>
>>51235583
Thanks anon. The thing is, I have no idea where to start with it either. Im quite lacking in programming knowledge and have no idea how to do any of that.
>>
>>51235718
>>51235706
Thanks dude but is cplusplus.com outdated or any good? I was really looking into books
>>
>>51235757
cplusplus.com is pretty good, and it has a tutorial section, but I actually prefer the last link.
>>
>>51234874
Are you a girl?
>>
>>51235712
"Replacing" things in a pure functional language is a really shitty idea. You can choose between ST monad and its STRef references or you can purely rebuild the whole structure with a new element instead of the old one.
>>
>Windows Visual C++ error while installing python packages

Fuck you Windows, I'm installing gentoo
>>
Any recommendations on a decent book that teaches compiler design?
>>
>>51235915
SICP
>>
>>51234874
>A general utility C library for /dpt/
It's probably shit, stop developing it and fuck off.
>>
>>51235487
Looks good, but try pattern-matching instead of manually calling isEmpy/head/tail

Avoid partial functions in general
>>
>>51235915
Actually, the original K&R was heavily oriented towards compiler creation and may help you out.
>>
>>51235873
>get linux or osx
>comes with python ootb
>it just werks
>try on windows
>get blue screens for days
>>
>>51235915
Le dragon book
>>
>>51234874
how can you make a utility library when you don't know c?
>>
>>51235949
Does anyone really do any serious development on Linux? I have Windows 8 installed and I want to learn C++. I plan to enroll into a computer science course should I bother learning Linux, will it help with me getting a job?
>>
>>51236043
everyone is running linux at my job (backend stuff)
>>
>>51236043
I do
>>
>>51236043
Depending on your school they might even force you to use Linux/Unix-based for some classes.
Might as well get into it.
>>
File: JZB0U0Y.jpg (120 KB, 612x612) Image search: [Google]
JZB0U0Y.jpg
120 KB, 612x612
>>51235931
>>51235975
Please, don't bully
>>
>>51235945
>>51235929
>>51235963
Thanks guys.

Out of curiosity, do you guys listen to anything while you work? I used to hate music while working but recently i've had a ton of family shit affecting me and i've begun to listen to music to help calm me down and focus.
>>
>>51236086
>>51236073
>>51236105
Autism aside in the development world what Linux distro do you guys use? Fedora, Ubuntu?

Also to >>51236105 what do you recommend?
>>
>>51236138
free choice, but pretty much everyone runs some ubuntu variant (mainly with kde)
>>
>>51236157
Whats wrong with Unity? What makes KDE so good?
>>
>>51236138
We had a civil war in my office between a staunch defender of OpenSUSE, a group of Microsoft converts who swayed between OpenSUSE and Mint, and I who swayed between Debian and FreeBSD.
>>
>>51236180
you can do whatever you want with it in a few clicks, no need to install patches or weird shit
>>
>>51236043
I'm doing C++ development on Linux right now.
>>
>>51236192
But in the end it doesn't matter since aren't they are inter-compatible?

>>51236201
KDE guy what kind of development do you do?
>>
>>51235142
it's not a triple copy, RVO will take care of it
>>
>>51236043
The great majority of people don't develop on windows. The only areas that do are hardware and gamesfags.
>>
>>51236138
Arch
>>
>>51236227
>KDE guy what kind of development do you do?
j2ee for server stuff
>>
>>51235691
if you're already an experienced programmer, 'A Tour of C++' by our god stroustrup is an awesome start. it's really short, concise, and well written.
>>
>>51236229
FUCKING C++!
>>
>>51236227
In the end it didn't matter because horribru management butchered my office and gave our development, sysadmin, and network administration tasks of our entire university branch to the team that managed the academic information system.

Now it's just Mr. OpenSUSE and me, with me running Debian.
>>
>>51236216
Looks pretty ugly but nonetheless cool.

I hate to be a raging autist but I have a high end PC at home (I am using it right now) what laptop can u guys recommend that also works well with laynuks
>>
>>51236239
there's tons of C++ development on windows
>>51236257
mad that you don't have to manually optimize every single memory movement?
>>
>>51236138
Gentoo.

Gentoo and arch are the best for development because of their huge repositories of niche and mainstream software and libraries.
Gentoo has the advantage that it makes operations like patching packages with modularity based on version at the level you want extremely easy and automatic as well as compiling from source by default, which is extremely good for development because you often want more features than what's available by default, or otherwise some specific config that isn't easy to get on other systems.
>>
>>51236216
You're "developing" rock paper scissors?
>>
>>51236269
>OpenSUSE
isn't that shit terrible? from my old memories, RPM based distros are all shit
>>
>>51236216
hilarious
>>
>>51236301
It's what moved the rest of the team from OpenSUSE to Mint after trying both, but my old PM managed to keep his working somehow.
>>
>>51236216
not a bad way to learn anon

use a std::unique_ptr for that 'ui' member. any naked new/delete in C++ is asking for a memory leak or other issue
>>
>>51236337
Unfortunately, std::*_ptr don't have transitive polymorphism so you have to manually perform casts which is ridiculously verbose and annoying.
>>
>>51236354
can you give an example of what you mean by that?
>>
>>51236292
Yeah. Not to used to Qt so just making a dumb program to play around with it. Very different from GTK# or WPF.
>>
>>51236216
>arch
>anime
>shitposting in trash
it all makes sense
>>
>>51236337
Qt hates std::

If you like std:: you should hate Qt too
>>
>>51236362
class A {};
class B: public A {};
class C: public A {};

void do(std::unique_ptr<A> x) {;}

void main() {
auto x = std::unique_ptr<B>(new B);
do(x); // NNNNNNNOPE!
}
>>
>>51236393
...what anime have I posted?
>>
where do you get ideas for projects for?

I want to learn python, started with lpthw but it got boring 40 chapters in, I would enjoy working on something and actually using the language

currently somewhat working on a zero player game (like progressquest) but that doesn't seem to be too fullfilling, so how do you decide on what you work on (besides having to program a specific thing for a job)
>>
>>51236406
i see, that makes sense. i'm used to a smart ptr library at work that takes care of that.

that being said unless you're transferring ownership shouldn't you be passing a ptr or ref of A to that method anyways? so you'd *x or x.get()
>>
File: ideas.png (305 KB, 1920x1080) Image search: [Google]
ideas.png
305 KB, 1920x1080
>>51236432
>>
>>51236043
It really depends on the need of the studio.
Some companies don't use windows/visual studio since that's just extra money they have to spend.
I'd learn the basics of command line and the text editor of your choice (aka vi/emacs) at the very least.
>>
Is SICP only good if you're learning lisp?
>>
>>51236460
SICP is good reading even if you aren't a programmer.
>>
>>51236460
it's good, and you learn lisp
>>
>>51236452
thanks, but surely people don't do some challenges all the time?

does it come with experience to actually have ideas for stuff to create?
>>
>>51236416
oh, I assumed so, since you were in trash. assumed too much, I guess
>>
>>51236490
Some of those "challenges" are remarkably advanced programs that you can't really finish without having a mastery of your programing language of choice. I mean, #89 "Basic HTML Web Browser" isn't really something you can just whip up in a few minutes' work.
>>
>>51236460
You should learn lisp anyways
>>
>>51236216
in the rightmost screen, is that corruption? you should report it to the devs
>>
Implementing filesystem shit for my homework. I have open() working with everything except for creating new files (a can of worms I'm going to wait on for a bit, since I've got two weeks for this assignment), and close() working. My fork() now copies over file descriptors, and ProcessFinish (a function called by exit()) now closes files and removes shit from the file descriptor table.
>>
>>51236444
Normally I'd want to pass a std::shared_ptr or smart_ptr or whatever the favored multiuser pointer is these days (or a reference to one), so that ownership can follow (e.g. the function could init a struct with the shared pointer as a parameter, and the pointer would be freed only when the struct dies and the function returns and main ends - though it wouldn't be main which calls the function in real life).

Of course, the only way to work with smart_ptr et al is by passing the contained pointer instead, which I feel defeats the whole purpose.
>>
>>51236521
I didn't mean to shittalk the challenges, I'm fully aware that most of these are way out of my league at the moment

but people do come up with their own ideas on what they want to work on, don't they? That's something I can't really grasp at the moment, so I was just asking
>>
>>51236460
It's good eitherway but learning lisp is good too.
>>
>>51236579
just do codeeval challenges
>>
File: logosqr1.jpg (14 KB, 259x362) Image search: [Google]
logosqr1.jpg
14 KB, 259x362
>>51236490
Find a need then solve it
>Play Monster Hunter (or similar crafting-based game)
>Writing down ingredients you need on notepad is a pain in the ass
>write a program to let you add ingredients and what those ingredients need, then display the total list of needed ingredients (and how much it'll cost)
Or think of something interesting you'd like to do
>program that lets you create a flow chart (or a visual representation of code like Scratch) then visually step through each part
>program that mimics Logo (pic related)
>program that simulates cars at a traffic light
etc.
>>
>>51236529
The two leftmost screens have a vertical resolution of 1080, but the rightmost screen only has a vertical resolution of 768. Because the remaining pixels can't be nonexistent the screenshot program ends up reading garbage data from the buffer as if it was actually part of the screen.
It's a neat effect, honestly.
>>
>I mean, #89 "Basic HTML Web Browser" isn't really something you can just whip up in a few minutes' work.
It is, though. Especially in e.g. java or C++.
>>
Does anyone have a guide on converting MSVC C++ templates -> standard conforming C++ templates?

Seen lots of verbose shit that's really not useful.
>>
>>51236579
If you get an idea for a big project, sure.

But considering how long computers have been around, most small-to-medium sized programs have already been written, so it's kinda hard to make something new but also simple enough to not require a whole dev team.
>>
>>51236490
You need to have a good grasp as to what can and cannot be done, and also grasp the scope and complexity of other programs before you can come up with ideas easily.
>>
>>51236609
No, not really. C++/CLI is not compatible with any formal ISO C++ standard. Iirc C++/CLI was actually a fork off C++98 so it'd be insane to try and port MS's bloat into the newer standards.
>>
>>51236521
Actually, creating a web browser's surprisingly simple.
>>
I'm trying to make a etch-a-sketch type program in Java but the end of the line just moves with the start staying still.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.shape.Line;
import javafx.stage.Stage;

public class MoveLine extends Application {
public void start(Stage primaryStage) {
Pane pane = new Pane();
Line line = new Line();
line.setStartX(125.0f);
line.setStartY(125.0f);
line.setEndX(125.0f);
line.setEndY(125.0f);

pane.getChildren().add(line);
line.setOnKeyPressed(e -> {
switch (e.getCode()) {
case DOWN: line.setStartY(line.getStartY() + 10); break;
case UP: line.setStartY(line.getStartY() - 10); break;
case LEFT: line.setStartX(line.getStartX() - 10); break;
case RIGHT: line.setStartX(line.getStartX() + 10); break;
default:
break;
}
});
Scene scene = new Scene(pane, 250, 250);
primaryStage.setTitle("MoveLine");
primaryStage.setScene(scene);
primaryStage.show();

line.requestFocus();
}
public static void main(String[] args) {
launch(args);
}
}
>>
>>51236658
Not C++/CLI

MSCV's templates aren't standard conformant
Normally you need a shit ton of ::template and typename shit everywhere
>>
Made this hash table for class. What do you think?

#include "HashTable.h"
#include <iostream>

//public functions
HashTable::HashTable(){
tableSize = 87221;
hashTable = new string[tableSize];
indexStatus = new int[tableSize];
for(int i =0; i < tableSize; i ++){
indexStatus[i] = 0;
}
}

HashTable::~HashTable(){
delete[] hashTable;
delete[] indexStatus;
}

void HashTable::insert(string data){
if(find(data) > 0){
return;
}

int k = 0;
int index = hash(data);

while(indexStatus[index] != 0){
k++;
index = (hash(data) + probe(k))%tableSize;
}

hashTable[index] = data;
indexStatus[index] = 1;
}

int HashTable::find(string data){
int k = 0;
int index = hash(data);

while(indexStatus[index] != 0 && hashTable[index] != data){
k++;
index = (hash(data) + probe(k))%tableSize;

if(indexStatus[index] == 0){
return ((k+1)*(-1));
}

}

if(indexStatus[index] == 0){
return ((k+1)*(-1));
}

return k+1;
}

void HashTable::printTest(){
for(int i = 0; i < tableSize; i++){
cout << "Index " << i << ": " << hashTable[i] << endl;
}
}

//private functions
int HashTable::hash(string data){
int hashValue = 0;

for(int i = 0; i < data.length(); i++){
hashValue += (i+1) * data[i];
}

return (hashValue % tableSize);
}

int HashTable::probe(int k){
return (k*k);
}
>>
how do you program when you're depressed, /g/?
>>
>>51236697
I wasn't aware that MSVC even supported any version of the language other than C++/CLI.
>>
>>51236301
>>51236336
https://en.opensuse.org/openSUSE:RPM_sucks
>>
>>51236716
very carefully
>>
>>51236597
>>51236618
>>51236650

okay thanks guys

I'll play around for now, trying to reconstruct anything that looks fun
>>
>>51236716
>if srs {

It's fucking hard to stay motivated, actually.

}
>>
File: FeelBro8Bit.png (54 KB, 673x625) Image search: [Google]
FeelBro8Bit.png
54 KB, 673x625
>>51236716

i know that feel 8 bit bro
>>
>>51235739
If you might be able to use Java, check out the java.awt.Robot class. Simple screen capture, and mouse control. From there you can read RGB values from the captured image, check for values within a tolerance, and use Robot to move the mouse and click. How easy it will be depends on how specific your feature recognition needs to be.
>>
>>51236771
your pseudocode sucks
have some real mancode
if(!trolling) {
std::cout << "It's fucking hard to stay motivated, actually." << std::endl;
}
>>
Favorite/preferred IDEs?
>>
Working on a HTML 5 chatroom...

http://raskie.com:85

Let me know what you think.
>>
>>51234802
What languages should I learn if I just wanna get by being a programming drone.
>>
File: nt.png (22 KB, 1191x324) Image search: [Google]
nt.png
22 KB, 1191x324
>>51236723
This is what I've been working on
>>
Can anybody point me toward a python mysql connector package?
>>
>>51236811
Java
>>
>>51236799
Vim + slimv
>>
>>51236803
why is every message so fucking big

>>51236811
C#, Java, and Python.
>>
>>51236811
java

Is there a better hashing function I could use for >>51236709 ?
>>
>>51236799
eclipse for java/android dev
>>
>>51236811
java
>>
File: Untitled.png (6 KB, 785x342) Image search: [Google]
Untitled.png
6 KB, 785x342
>>51236803
>>
>>51236839
>>51236847
>>51236852
>>51236875


I'll learn java thanks
>>
>>51236811
C with whatever snippets of C++ you need
>>
>>51236858
Have you tried intelliJ? I've been enjoying it for my Java and Android shenanigans
>>
Hi /g/ I'm looking for a good tutorial that explains web scraping. I'm wanting to grab a few books from Amazon to use on my site. If the user searches or clicks a genre category, it would load the books using Amazons books. I have used javascript and python but never done this before. Thanks.
>>
>>51236891
>What languages should I learn if I just wanna get by being a programming drone.
>I just wanna get by being a programming drone


nigga, you're exactly what's wrong in the software industry
>>
>>51236731
true, I sometimes mix RPM and their package managers. but still, last time I use yum, it was SLOW as HELL and truly shit. afaik, RPM-based package managers have improved lately... but I don't know how much.

> Command-line apt package search using apt-cache is a little awkward — it returns results that do not have the search string in it at all (perhaps because it searches in the longer package descriptions too). In most cases, one wants to pipe it into grep to yield `zypper search` semantics.
how is this bad? you may also want to search for related packages... also, sometimes, just out of luck, you find something interesting :)

>>51236716
have a list of features/bugs/..., and do it without even thinking. also, ALWAYS remind yourself: depression is an illness, you have to defeat it.
>>
>>51236891

should have chosen python my friend, unless you wanna be a lagdroid dev
>>
>>51236803
Autoscroll is annoying
>>
Cowsay in PHP. Fuck knows why
>>
Could anyone into C++ explain how to make this standard conformant? Works on MSVC++ which has different lookup rules


template <typename func, size_t it, typename ... t>
struct tuple_for_helper
{
static inline constexpr auto helper(std::tuple<t...>&& tuple, func& fn)
{
using func_return = decltype(fn(std::declval<std::tuple_element<it, std::tuple<t...>>::type>()));
using next = tuple_for_helper<func, it - 1, t...>;

if (std::is_void<func_return>::value)
fn(std::get<it>(tuple)), next::helper(std::forward<std::tuple<t...>>(tuple), (fn));
else
return std::tuple_cat(next::helper(std::forward<std::tuple<t...>>(tuple), (fn)), std::make_tuple(fn(std::get<it>(tuple))));
}
};

Can extrapolate this to the rest of my thing, just really need to learn when typename and template are needed for dependent names
>>
>>51236963
If it's not standard you probably shouldn't be doing it in the first place.
>>
>>51236986
MSVC++ hasn't got the same requirements. I never realised because I used it the whole time.

What I need to know is where to specify typename and template for dependent types
>>
>>51236606
How exactly? Not being a smartass just curious
>>
>>51236909

forgot to mention im using python. Anyone?
>>
>>51236665
How exactly?
>>
>>51236933
It's better being a lagdroid dev than a nodev.
>>
>>51237023
I guess they would just use webkit...

>>51236936
nice idea. will you make a website with this?
>>
>>51237023
Building a browser is easy. All you need is a rendering engine and a GUI.

I could easily make a featured web browser with a URL bar in C# WPF with three minutes of opening up a blank IDE.


Making a rendering engine from scratch is hard, though.
>>
>>51237049
>programming drone
>dev
>>
>>51237086
>excel
>insert web browser
>insert button
>insert text box
>on button click
>webbrowser.navigate(textbox.text)

10/10
>>
>>51237128
Pretty much. Hell most languages have this.
The .NET Framework has the WebBrowser module, which is basically an embedded, stripped down version of IE. Qt has the WebView or something like that as part of the Designer. GTK has something similar. Hell even Android's UI SDK has a web browser baked into it.
>>
What is a good IDE to do Java that isn't a clusterfuck as Eclipse?
>>
>>51237175
>"Making" a web brower is just taking an existing web browser and slapping some buttons on it
That's fucking retarded. Web browsers are very complicated things.
>>
Is it wrong to hate python because plebs love it?
>>
>>51237175
Not complaining tbf.
If only I used those languages.

Do Microsoft have anything similar for C++? (but not CLI)
>>
>>51237086
>parsing javascript
Have fun
>>
>>51237212
GNU Emacs
>>
>>51237226
No. A community is one of the most important parts of programming languages. Which is why I will never use Rust.
>>
>>51237230
using [java script parser];
>>
>>51237222
You misunderstand.
A web browser is a program that lets you browse the web.

You can make a web browser by embedding a web engine within a UI. Web engines aren't web browsers because they're just backends, similar to how chess engines aren't chess programs, just backends.

>>51237228
C++/CLI is the only version of the language that Microsoft supports.
>>
>>51236909

is this even possible?
>>
>>51237023
In java or C# you literally have access to a webview form which allows you to get a webbrowser in a dozen lines of code (webview + address bar + actualizing). In C++, you can use e.g. qtwebkit.

Even then, webbrowsers are easy to make without that. You essentially wget the page, then parse and render the elements. Actually writing your own js engine is another matter, but you can just use e.g. spidermonkey otherwise.
>>
>>51237252
emacs is a pretty good operating system, although it's lacking a decent editor
>>
>>51237230
That's writing a compiler (or interpreter), not making a web browser. Notice that nobody does that.
>>
>>51237295
nice meme
>>
File: 3c2f.png (147 KB, 1366x768) Image search: [Google]
3c2f.png
147 KB, 1366x768
>>51237295
Personally my favorite part of GNU/Emacs (or as I've recently taken to calling it, GNU+Emacs) is the shell.

Being able to just send commands to the underlying system from within the OS environment is a neat feature, and it's way better than COMMAND.COM. Pic related - isn't that just beautiful?
>>
what physical programming books do you own /g/? Which ones are worth getting actual books of?
>>
What's the difference between a ``frob'' and a ※-terminated monad array?
>>
>>51237346
MEME INCOMING
>>
>>51236891
here's a good place to start

https://docs.oracle.com/javase/tutorial/

you can search for individual things on google too, stackoverflow tends to have good answers for most basic things
>>
>>51237346
I kind of want TAOCP, if only because it'll allow me to read it on paper rather than a screen.
>>
>>51237346
SICP
SICP
>>
>>51237360
whew lad
>>
>>51237360
A ~frob~ is implemented as a list, if I remember correctly.
>>
>>51237336
god that for... collect macro is fucking disgusting. So glad scheme cleaned up common lisp and made a good language again.
>>
>>51237396
why would a <<frob>> be implemented with anything but an endophasor group?
>>
>>51237396
A }frob{ is an already-sorted doubly-linked list.
>>
File: IMG_20151107_192532357.jpg (3 MB, 4160x2340) Image search: [Google]
IMG_20151107_192532357.jpg
3 MB, 4160x2340
>>51237346
The watch is there to hold down the cover, but yeah
>>
>>51237396
How can a ※※frob※※ be a list if it contains lists?

Can you have ※※frobs※※ of ※※frobs※※?
>>
>>51237410
I dunno, ask the professor who named it

>tfw you will never be a part of the "-frob-\ assignment
>>
>>51237336
It's neat that screenfetch recognizes eshell. It's too bad that eshell doesn't support things like htop too or else I might use it as a primary shell.

Also what's that bird thing at the top right?
>>
>>51237438
When did "The {0} Programming Language" become a meme?
>>
>>51237346
sicp
>>
>>51236803
Why do you attach the poster's IP to every message?
>>
>>51237336
>>51237449
not my pic, sadly
>>
>>51237038
http://www.crummy.com/software/BeautifulSoup/
>>
>>51237465
Between {1} and {2}
>>
>>51237498
...what?
>>
File: IMG_20151107_192843832.jpg (3 MB, 4160x2340) Image search: [Google]
IMG_20151107_192843832.jpg
3 MB, 4160x2340
>>51237438
Part 2
Haven't had a chance to read the assembly much, but I plan on getting to it at some point
>>
>>51237465
>When did "The {0} Programming Language" become a meme?
>"The {0} Programming Language"
>{0}

back when {0} was %s
>>
>>51237508
He's saying in year $f
>>
>>51237465
>{0}
u wot
>>
>>51237511
>having to specify the type of your intrastring values

actually this is a pretty useful feature for debugging so i'll stop memeing now
>>
>>51237520
What's the matter, young man? Never seen a formatted string before?
>>
>>51237521
>$s $s $s $s $t $s $s $s $s $s
>>
So is it bad practice to just use {} when I'm only using one variable in the .format()
>>
Show me your haskell
http://codeshare.io/Ig7Ja
>>
>>51237534
Nope, not that way
>>
>>51236668
Yeah thanks for the help guys.
>>
>>51237521
Well, I rather prefer ~a, but there was "On ~a", "Practical Common ~a", and a nicer variety
>>
>>51236889

Oh. I've deliberately set a minimum height in the test stylesheet, and may keep it.
>>
>>51236935

Heard that more than once now. Thanks for testing!
>>
>>51237616
>may keep it
please don't
it looks horribru
also, make the textbox for typing and the message log use the same font and font size
>>
>>51237638
autoscroll may be necessary
i'd say enable it if the user is at the bottom
>>
>>51237048
>google "c# how to make a web browser"
>click first youtube vid
>it's 15 minutes
That's how
>it's an indian
Every time.

Also, was taught in a class, it really took no more than 30 minutes to go through and explain everything in a decent amount of detail.
>>
>>51237687
Wait, I thought only Java could catch Indians?
How are they transmitting?
>>
>>51237336
>emacs with a menu bar
psssh
>>
>>51237705
The menu bar isn't nearly as bad as the tool bar.
>>
>>51237701
>How are they transmitting?
Very badly, as always.
>>
>>51237701
C#, like J++ before it, was designed to be familiar to Java developers.
>>
File: gravisim.webm (324 KB, 544x440) Image search: [Google]
gravisim.webm
324 KB, 544x440
im bored
>>
>>51237750
Do they still have designated exception catching streets, or do they properly dispose of them now?
>>
>>51237765
EXCEPT
IN
LOO
>>
>>51236709
Nice, now how about making it templated?

As far as hashing functions to use, there are lots of them out there. Just search or check out any good algorithms textbook.
>>
//-- Let's write something in the language of the gods, X# [citation needed]
//Plebs still using high-level languages like Assembly instead of real system languages like Go
//Muh abstraction
-- muh bit-twidling
a:
goto a; //memes
return false; break; /* SIGNIFICANT*/

using System;
using System.IO;
using System.Threading.Tasks;

foreach(Lisp<List<String> in new List<List<List<String>>>) {
Console.WriteLine("Optimizing!");
sleep(rand() % 5); // have to make it seem like it actually is
}//This codeshare will expire in 14 days

for (auto&& each : {1,2,3,4,5,6,7,8,9,0}
return each;

using System.FinishedProduct;

switch (true)
case 1:
case 2:{
#include <iostream> //this looks like as good a place as any to drop this
#include <stdlib.h>
#include <stdio.h>
#include <tuple>
#i/*SIGNIFICANT*/nclude <algorithm>
#include <vector>
#include <iostream> // backup
# include <cmath.h>
#include <math.h>
#include <math>
#include <functional> //might need this at some point
return true;
case false:
break;
}

mov mydick,yourmom;

//your own mom?



auto operator+(auto a, auto b) { return a - b; }

for(int i = 1; i <= 100; ++i)
{
writeln(i % 15 ? "FizzBuzz" : i % 5 ? "Buzz" : i % 3 ? "Fizz" : i);
}

>/dpt/ writes code part 1
>>
>>51237784
while (constipated)
catch (hands) {}
>>
>>51237763
You bored me.
>>
>>51237789
public static const unsigned size_t Memes = -1; //TODO: make explicit
//SIGNIFICANT WHITESPACE :^))))))))))))))))))))))))
template <typename T>
class Maybe // lol muh haskell features in C++
{
//yall fuckers need to read a style guide
Maybe(T x) : value(x),
empty(false) {}
Maybe( /*VOID*/ void /* VOID */) : empty(true) {}
//void parameter
//requires no parameters
template <typename S, typename L>
Maybe<S> invoke(L& fn) { return (empty ? Maybe<S>() : Maybe<S>(fn(value))); }

/* SIGNIFICANT */ bool empty;
T value;
}

class y {}; // needs class

int main(int argc, char** argv)
{
char *str[5] = {":^(((", "XDDDDDDDDD"}; //Null is already included lad

a:
goto a;
return 0;
}

(define (main)
(define (loop n)
(display "Hello world")
(newline)
(loop (1- n)))
(loop 100))

//Union scum pls go, Confederacy strong
union niggers
{
struct
{
uint8_t b0;
uint8_t b1;
uint8_t b2;
uint8_t b3;
} bytes;
uint32_t addr;
};
>>
>>51237802
ok
>>
>>51237763
Is this a grav sim for ants?
>>
>>51237816
reddit.org
>>
File: 1440213581060.jpg (255 KB, 1200x900) Image search: [Google]
1440213581060.jpg
255 KB, 1200x900
>>51236114
I was going to tell you to fuck off and kill yourself but your image strangely made me feel bad about doing that.
>>
>>51237765
throw new Poo();
>>
>>51236114
>>51237837
REMEMBER
THE CODE
OF CONDUCT
>>
>>51237853
There's none in this thread, i can do whatever i want.
>>
>>51237295
http://www.emacswiki.org/emacs/Evil
>>
>>51237867
https://www.youtube.com/watch?v=zUuylPvvTPo
>>
>>51237816
>>>/trash/
>>
>>51237816
I thought it was funny
Thread replies: 255
Thread images: 23

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

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.