[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 | Extra juicy! | 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: 367
Thread images: 33

File: Homura_DPT_rust.jpg (128KB, 563x712px) Image search: [iqdb] [SauceNao] [Google]
Homura_DPT_rust.jpg
128KB, 563x712px
Old thread: >>46988402

What are you working on /g/?
>>
>>47002318
java is more concise than C#
>>
>>47002338
yooo rofl
>>
(trying again for better answers hopefully)

What's the right way to handle a lot of message-passing/concurrent users?

A message queue like ZeroMQ or to use a reverse-proxy server or something else? I'm more of a programmer, I'm shit at knowing where and when to use these different architectural things. Help me please /g/.
>>
>>47002338
Post some Java code and I'll post more concise C#.
>>
Reposting
Came up with a new programming language, I've just about finished writing up the spec and am about to get started either writing an interpreter or translating the Hello World I wrote from pseudocode to interpretable code. Could I get some help? I'd just like some other eyes to look over the spec and tell me what things are unclear and if anything I wrote is going to be completely broken.

http://pastebin.com/aePeLKzW
Until I can come up with a better title, I call the language Wordy. Any file consisting of period-separated sentences containing space-separated words is a valid program. For each sentence, the average word length is calculated (rounded to nearest int) and the ratio [words over avg]/[words below avg] is calculated. This ratio maps to various instructions.

There are 24 different instructions and I've tried to design it so that there is no runtime errors. One highlight of the language is how LABELs and GOTOs work so that the expression GOTO RAND INCHAR is completely valid and would input a character, compute a random integer from 0 to the unicode value of the character, and jump program execution to the label with that ID (if it exists, otherwise NOP). A GOTO or a LABEL as an argument to another instruction is also valid. (for example: MULTIPLY GOTO INNUM LITERAL 5)
>>
This is my first programming task for my CS class and I'm stuck.
Where would I put a java system exit statement in this?
That's the last thing I have to do before I can submit it and it keeps giving my an error no matter where I put in System.exit(0)

import java.util.Scanner;

public class MadLib
{
private static Scanner in = new Scanner (System.in);

public static void main(String[] args)
{
System.out.print("What's your name? > ");
String name = in.nextLine();
System.out.print("What's your favorite color? > ");
String color = in.nextLine();
System.out.print("Name an animal. > ");
String animal = in.nextLine();
System.out.print("Give a number > ");
int number = in.nextInt();

madlib(name, animal, color, number);
}
public static void madlib(String name, String animal, String color, int number)
{
System.out.println("\n");
System.out.println("Hi, my name is " + name + "! ");
System.out.println("Let me tell you a story: One day, when I was walking down the street, ");
System.out.println("I saw a wild " + animal + " on the sidewalk! It was an odd hue of " + color + ". ");
System.out.println("It was scary! There were " + number + " more, too. ");
}
}
>>
>>47002394
for (int i = 0; i < 100; ++i) System.out.println(i);
>>
>>47002318

I'm making a new app for the apple watch. I'm calling it

>Cuck me

Basically how it works is that instead of putting the apple watch on your wrist, you put it on the tip of your dick... then using the haptic feedback I created an app that lets someone stroke your tip from anywhere.

I'm going to make billions.

The challenge is that people might need a custom band if their dick is too small.
>>
>>47002421
it compiles just fine
>>
What is a good online class to learn C alongside a book?
>>
>>47002413
it looks about 40 years backwards in programming language research
>>
>>47002394
public class StubFactoryFactoryProxyImpl extends StubFactoryFactoryDynamicBase
{
public PresentationManager.StubFactory makeDynamicStubFactory(
PresentationManager pm, PresentationManager.ClassData classData,
ClassLoader classLoader )
{
return new StubFactoryProxyImpl( classData, classLoader ) ;
}
}
>>
>>47002421
You don't need to put an exit statement anywhere, it automatically exits at the end of the main method.
>>
>>47002435
Enumerable.Range(0, 100).ForEach(Console.WriteLine);
>>
>>47002487
IntStream.range(0,100).forEach(System.out::println);


this is also possible
range(0,100).forEach(out::println);
>>
>>47002467
That looks disgusting
>>
>>47002509
>>47002487
>>47002435
all 3 are 52 characters
>>
>>47002551
leek design tho
>>
>>47002467
public class HelloWorldPrintAndExitProgrammingIntroductin {
public static purple monkey dishwasher final dynamic void null theMainMethodOfHelloWorldPrintAndExitProgrammingIntroduction(VariableTypeForAContainerForAStringWhichIsASequenceOfBytes[] theArgumentsWhichHaveBeenPassedTotheMainMethodOfHelloWorldPrintAndExitProgrammingIntroduction) {
Hardware.OS.System.Java.Output.OutputToTheTerminal.TheTerminalTheProgramIsRunningIn.YesThatOne.NoReally.OhSorryTheOtherOne.OutputSomething.PrintItRealNiceNow("Greating and salutations human person running this Java application, good day to you on this fine day!");
}
}
>>
>>47001887
>Just read a book, and do the examples/exercises to break up the reading.

They all bore me to tears.
Little of the information sticks at all.
I have to be doing something else to consume mental processing power in order to pay attention to a subject as dry as coding.
>>
>>47002421
import java.util.Scanner;
import static java.lang.System.out;

public class MadLib
{
private static Scanner in = new Scanner (System.in);

public static void main(String[] args)
{
String name = prompt("What's your name? ");
String color = prompt("What's your favorite color? ");
String animal = prompt("Name an animal. ");
String number = prompt("Give a number: ");

madlib(name, animal, color, number);

in.close();
}

public static String prompt(String msg)
{
out.print(msg);
return in.nextLine();
}

public static void madlib(String name, String animal, String color, String number)
{
out.println();
out.printf("Hi, my name is %s!\n", name);
out.printf("Let me tell you a story: one day when I was walking down the street,\n");
out.printf("I saw a wild %s on the sidewalk! It was an odd hue of %s.\n", animal, color);
out.printf("It was scary! There were %s more, too.\n", number);
}
}
>>
>>47002679
Why do you even want to be a programmer then?
>>
for i in split(num):
for j in range(2**(len(i)-1)):
total = int(i[0])
for k in range(1,len(i)):
if j&2**(k-1):
total += int(i[k])
else:
total -= int(i[k])

What's the slowest part of this? How can I make it faster?
>>
File: Untitled-1.png (43KB, 555x478px) Image search: [iqdb] [SauceNao] [Google]
Untitled-1.png
43KB, 555x478px
I'm hunting my app for memory leaks.
As you can see on pic related, the amount of memory the app is taking from the OS is much higher than what it actually needs.

How do I reduce it?
>>
>>47002906
use valgrind
>>
>>47002744
Because when I'm doing something interesting it's consuming. When I was just learning Python as a kid you couldn't get me to stop. I spent 8 hours straight at the simplest shit like textual battleship or texas hold 'em poker without eating or drinking or even getting up to piss.

I've forgotten a lot of Python and want to move on to a better language anyhow and when I DO learn something new I can focus hard on it and play with it. But the rest of the time I get a few sentences into a page and zone out for a few minutes, snap to attention, then go back to reading, zone out, etc.

I'm currently ~200 pages into my current book after TWO WEEKS of spending 4 hours a day on it. And none of it was debugging or trial and error. It was all hand-holding bullshit where they tell you exactly what to type in while they explain what you're doing, which is honestly one of the worst possible ways to learn for me.

I just feel like i have too many parallel streams going in my head. If I try to read the part dedicated to reading gets immediately overpowered by the rest.

So I have to do something mindless that doesn't interfere with listening/reading/learning so I can truly focus on the new information.
So I need an audiobook or video guide or something.
>>
>>47002421
>System.exit(0)
You don't need it at all. Java programs exit when they reach the end of the main method. The only time you'd want to use System.exit(0) is if you wanted to kill the program sooner than the end of the main method.

If Java is actually giving you an error then post the error itself.
>>
>>47002870
cut down on str -> int conversions, that cut the time by 75%, anyone have other suggestions?
>>
Posted in old thread by accident. How do I take something like

MenuEntry item1 = new MenuEntry();
MenuEntry item2 = new MenuEntry();
List<MenuEntry> menuEntries = new List<MenuEntry>();
menuEntries.Add(item1);
menuEntries.Add(item2);
...

foreach(MenuEntry entry in menuEntries)
{
Console.WriteLine("Testing ");
}


but then instead of 'testing', have it write out 'item1', 'item2', etc. I expected it to do that just using 'entry' instead of testing, but it just prints out the type.
>>
Does anyone have experience with a microservices architecture?
I'm building a networking subsystem with several services (hardware/virtual interface control, kernel routing and netfilter, DHCP, DNS, web-based management).
Most coupling is based on data, which could be done through the PostgreSQL backend, but for some things (config reload, firewall events, DHCP leases, etc.) I would like to have events.
The languages that will be used are Python, Golang and C++, with maybe later Node.js.
I could use Redis eg for PubSub, PgSQL also has some events built-in, but most functionality is very limited.
Are message queues the solution? ZeroMQ seems quite suitible for this problem, as I don't want too much overhead from stuff like RabbitMQ.
Any ideas/hints/reading material on this?
>>
>>47003076
see >>47003083
This won't work.
In C++ you could print out the memory address, which would be different for each instance but not very userfriendly, I don't know if this is possible in Java..
>>
>>47003000
Explicit is better than implicit.
>>
>>47003152
Why aren't you using Erlang?
>>
>>47002318
I really really like that image.
>>
>>47003165
No it's not.
>>
>>47003165
Can you be more specific? The program is going to exit at the end of the main no matter what. I don't see how defining it explicitly at the end is going to do anything besides add another line of code.
>>
>>47002906
go to sampler > memory
>>
>>47002581

Now that is some enterprise level code.
>>
>>47003165
oh get over yourself
>>
>>47003201
>>47002963
I am asking how to dynamically decrease the heap size, not how to track down memory leaks. I already solved the leaks. I've just noticed this retarded behaviour of occupying unused memory.
>>
>>47003177
I hadn't considered it since it's very different from the languages mentioned and I'm totally not familiar with the ecosystem.
What advantages does it have? Can I use bindings to native libraries (like libnl for Netlink abstraction)?
>>
>>47002467
Are you retarded? The length of type/variable names has nothing to do with a particular language being concise.
>>
>>47003352
When it's part of the standard library, then yes it is.
>>
>>47003282
Runtime.getRuntime().gc();
>>
>>47002318
Thank you for using an anime image
>>
>>47003338
http://youtu.be/rRbY3TMUcgQ
http://learnyousomeerlang.com/

It's basically designed for what you are doing.
>>
>>47003393
Yes, It only reduces the used heap size, not the overall heap size.
>>
>>47002357

rabbitmq
>>
>>47003409
java -Xms128M -Xmx256M
>>
>>47003189
>>47003406
I've used that image twice now, and both times there have been less shitposting about animu OP's than you would normally get.
Maybe we just need to get some more non-shit anime OP images.
>>
I've been trying to understand the source for a unix shell.
I can't read C and have no idea how the shell actually runs the program with the arguments being passed to it.
Would someone explain the basics of how it's done?
>>
>>47003432
I don't want my program to have limited amount of memory. I want it to use as much as it needs, and then to give it back.
>>
>>47003464
fork() makes a copy of the shell process, and some form of exec() runs the program with arguments by replacing the copy of the shell process in memory
>>
>>47003389
Regardless, it still does not make a language concise/verbose in my books. I am talking about expressiveness, using different and fewer constructs to achieve the same thing. Think of it like algorithm complexity. You can change variable names, but that won't improve the complexity. Use a different approach and you can potentially dramatically decrease code length.
>>
>>47003464
>I can't read C
You should really make to effort to learn a C-like language. C is actually really simple to read.

>have no idea how the shell actually runs the program with the arguments being passed to it
man fork
man execv


>Would someone explain the basics of how it's done?
A program uses fork() to create another process, which is an exact copy of itself. The child process then calls execv() to tell the operating system to load some program into the current process, giving it some arguments.
>>
>>47003407
Seems very interesting. Thanks anon!
>>
>>47002462
>full unicode support
>computed goto
What's not to love?

Here's a cat program since I decided I should write something by hand before writing a tool to write these programs for me:
Honestly this is very easy, much more simple than some. It is named after the Unix command cat, although this command is actually more powerful. In the beginning there was no sense of heuristic algorithms with which they wrote. Weirdly thruvian melodics are not terribly complex. This is harder than I thought. Cats are fluffy but don't fuck with them unless you're ready for the consequences.
>>
I've been programming some small games in XNA and feel like I have enough game programming experience to take my training wheels off
what's the next step?
>>
>>47003588
make a big game
>>
>>47003547
>fork() makes a copy of the shell process
I was able to realize that much from what I could understand.
>and some form of exec() runs the program with arguments by replacing the copy of the shell process in memory
Thank you very much.
I can take it from here.

>>47003572
>You should really make to effort to learn a C-like language. C is actually really simple to read.
I knew more at one point, but I feel out of it. I just don't like C.
This isn't the only C project I'm studying though, so I really should get more familiar again.
I'll just use a GNU manual.
>
man fork
man execv

I feel silly for forgetting about execv. I remember reading a decent amount about it a while back. I'd completely forgotten about it.
>A program uses fork() to create another process, which is an exact copy of itself.
I got that far.
>The child process then calls execv() to tell the operating system to load some program into the current process, giving it some arguments.
Thanks to you too.
I'm no longer stumped.

I really feel silly for so easily forgetting about execv. It's all coming back to me now that I hear it.
>>
>>47003507
I don't think you can do it. Are you really memory-constrained?

You could do
Runtime.exec("java -jar myprogram.jar");
System.exit(0);

and pass the next desired state as an arugment

>>47003626
don't use the GNU manual for learning C
read C Programming: A Modern Approach
>>
>>47003603
in XNA?
I have plenty of ideas for larger games, but I don't want to be fighting against it or having to build things that should be included if there's a better system out there.
I know Java, C# and python and can probably learn any other object oriented language without much trouble
>>
>>47003684
>don't use the GNU manual for learning C
>read C Programming: A Modern Approach
I'm not interested in actually learning C. I only need to get familiar enough with the language to understand what's going on.
The project I'll be studying uses GNU C.
>>
>>47003684
I appreciate the advice though. I'll keep that in mind if I ever change my mind about learning C.

My problem isn't so much not understanding C however. Apparently, the call to exec was hidden a few levels of indirection in a different function and I just lost the patience to jump around looking for the right thing.
>>
>>47003684
>Are you really memory-constrained?
Yes, It's a LibGDX game for android. The quicker the heap size will reduce, the less background apps android will kill.
>>
>>47003703
>I don't want to be fighting against it

Then don't? If you're fighting against it you aren't using it right.
>>
>>47003778
want to post your code?
>>
I don't usually browse these threads but im curious: can you actually get hired for jobs learning programming by yourself?
>>
>>47003983
probably not a software job, but maybe something that deals with a little bit of programming
learning how to code can only help your market value
>>
>>47003983
Of course, wait, what? You don't learn commercial software development in college, computer science isn't about programming, It probably shouldn't even be called "computer science", perhaps "computer mathematics".
>>
>>47004071
There are software engineering programmes which are more like the kind of stuff you'd do "in reality"

And CS does (at least at the universities around here) include at least one course dedicated to teaching how programming in large groups works. I'm taking a course right now where we're working with a real customer to deliver an application in a 10 man group.
>>
>>47004071
computation science
>>
File: 1424366846751.png (18KB, 256x256px) Image search: [iqdb] [SauceNao] [Google]
1424366846751.png
18KB, 256x256px
>>47001080
Pls respond.
>>
>>47002338
I prefer working in C# to java. but Java performs better
>>
>>47004474
You have a
const char *name
, or a pointer to a const char. Because free is probably declared as
void free(void *p)
, and not
void free(const void *p)
, it's warning you that it can change the memory p points to.
>>
>>47004512
Oh that makes sense, I knew that a pointer to const shouldn't modify the underlying data but also freeing() that would also give me a warning. Thanks!
>>
I'm learning python, but uhhh... what exactly do I do with it after I've got the basics down? What's it generally used for?
>>
>>47004620
You would use it for anything that you would use a Turing Complete language for.
>>
>>47004630
No you wouldn't, a languages competency shouldn't be judged on Turing completeness, stop that.

>>47004620
Most things that don't require performance; internal tooling, scripting, most web applications.
>>
More Scala. Wiriting some unit tests with scalatest. It's pretty fantastic.
>>
>>47002338
Java doesn't even have variable type inference, so it's not.
>>
>>47004943
you can use http://projectlombok.org/
>>
>>47002413
This sounds interesting, but I can only just grasp the general idea because painkillers and ten kinds of dying right now.

Fleshing the description out a little might help a little though.
Even when on painkillers I am generally not a dribbling retard, but some parts sound really confusing, especially the ratio stuff. (can you code with that? What are the ratios for?)

I like the concept of being able to literally pass a label to commands and shit like that.
Making it as error-free as possible is very interesting.
I can only just barely remember one other language that tried to do that and it was used for graphical programming, it re-used its own code as well to dynamically change as it ticked. Wish I could remember the name, I forgot to bookmark it.
Keep it up, always good to make fun experimental languages and see what becomes of it.
Who knows, maybe in 5-10 years time, it will have a wikipedia page and a niche community using it.
If you are really lucky, it might even be the basis of other things.
>>
How do you write dank software?
>>
>>47005195
420 BLAZE IT
>>
>>47004620
anything you want to waste your computer's time with, but you don't want to waste your time with.

so, shit where how long it takes the computer to do it doesn't matter, but you really need to be doing something else/your time is valuable.
>>
>>47002980
i relate to this so hard, youtube tutorials suck major balls because they are low quality, and sometimes wrong, but reading any programming textbook for more than 5 minutes and my cursor finds its way onto that steam or league icon.
>inb4 fuck off back to /v/
>>
>>47005317
Hey man, I have a lot of trouble getting focused sometimes too. What helps for me is just to eliminate the temptation of slacking off. You gotta be motivated, I find a lot of motivation from looking at what others make in this thread.

>Steam or league

I'm assuming that you are on windows, make a separate user account and only the bare minimum for programming. Additionally you could set up a virtual machine an program in that

You have to be motivated, the rest will follow.

What type of text books have you tried?
>>
What is an oil spill game? (#69)
>>
>>47005573
If i'm not mistaken its one of those games where there is the falling sands and you can change what they are
>>
>>47005317
My biggest complaint is half the YT lectures/tutorials are in the harshest fucking accents. Pashtun, Hindi, Japanese, Chinese, you name it. It's like nobody that speaks clear English makes videos. And my "plain English" tolerance is wide. I can understand everything from Scotts to Bogan to Appalachian hick to Texan whiskeyslur to Bawstonian to CaliSurfer.
>>
>>47005415
I've considered taking it a step further and just installing visual studio on my windows 7 partition and use linux as my main operating system, forcing me to reboot if I want to play "muh games", but a lot of the work that I do is obviously done in visual studio, great idea with the seperate user account though. I'll give that a shot, and currently I'm on page 628 of C++ Primer Plus 5th edition, it's a slight step up from the dryness of "The C++ Programming Language" , but the author provides too many programs to illustrate overloading the << operator via a friend function for example, when realistically you will just be using a template for things like that or copy constructors.

Next month I have a class dedicated to Data Structures, where I have to implement all of the STL containers as well as search/sort algorithms, and i'm sweating bullets. Gotta man up I guess.
>>
>>47005317
One thing that might get you more interested in learning is by writing down what you read in to your own format.

A lot of the time, textbooks are fucking awful and waste about 5 pages telling you how to assign fucking variables or some stupidly simple crap like that.
So, read a section, condense it to a summary or draw a sketch, do some DFDs or whatever.

That is such a good way of learning things because it actually gets you involved in learning it, rather than just reading it word for word and hoping your brain soaks it up.
It is also far superior than generic code examples and executing them, or shitty sandboxes with JUST that code, not an actual production example, just the code itself. Worthless example is worthless.


And equally, taking up a flexi-schedule that you loosely stick to so you don't bore yourself out with too much of a task at once.
I generally stick to a schedule over a 4 hour period where I split tasks up in to 15-30-60 minute groups. (or 7-15-30 when on holiday for an hour usually)
I keep notes each time of what I did, what to do now, I will do that, then take notes for next time. (bugs, ideas, general related thoughts)
I do this with everything now. Even simple exercise to drawing.
But programming, so much better doing it like this. Takes so much stress and frustration out of it.
Programming for too long just bores the shit out of me unless I am really in the mood and have a lot of momentum that day.
Splitting things up like this and taking good, accurate notes keeps the flow moving, hassle free.
Just try not to write comments that refer to your general thinking at the time since you will almost always forget it and get annoyed and you already ruined your mood.
>>
>>47005170
>especially the ratio stuff. (can you code with that? What are the ratios for?)
I'll try to explain it better by example.

Say the first three sentences of the interjection that sets off the spam filter were being interpreted as Wordy code.
For each sentence, count the size of each word (ignore punctuation like ' / - " . so "I'd" is length two and "GNU/Linux" is length 8)
2 4 4 2 9 3 1 6.
4 5 9 2 2 5 2 2 4 8 2 2 3 8 5 2 7 2 3 4 5.
5 2 3 2 9 6 4 6 3 6 7 4 9 2 1 5 11 3 6 4 6 2 3 3 8 5 9 3 5 6 10 10 1 4 2 2 7 2 5.

Find the average word length (round to nearest integer), count the number of words with length above, below, and equal to the average.
avg 4, above 2, below 4, exact 2.
avg 4, above 8, below 10, exact 3.
avg 5, above 15, below 19, exact 5.

To translate this into instructions now, just find the ratio of above/below for each sentence.
2/4 8/10 15/19

2/4 maps to the ADD instruction (1/2). 8/10 and 15/19 both map to NOP since they don't map exactly to another instruction.
ADD NOP NOP

NOP results in 0 so this is ADD 0 0 which results in 0.

Using this method, any text could be interpreted in this language.

I'm considering doing some analysis on a ton of text mostly in english and remapping instructions based on that analysis instead of just assigning them randomly like I did. Maybe that way if you just interpreted random text it'd do more interesting things.
>>
>>47005644
My biggest problem in reading textbooks is so fucking stupid, it's because I don't have any desk space. I'm thinking about getting a thinkpad and moving to a table in another room just for the desk space to have a textbook on
>>
What's the least shit way to have cross-platform inter-process communication?
>>
>>47005673
You can find that particular book online via torrents, then you would only have to possibly add an additional monitor instead of forcing yourself to get a new desk or relocate, since you can have it side by side with adobe reader/foxit.

Having a workspace conducive to learning and productivity is certainly a step forward though!
>>
>>47005657
Thanks for the tips, I'll type up a concept summary for each topic covered in the book, that should help with retaining the information. As for the 15-30-60 minute for specific tasks that's a bit too OCD for me, but I can certainly see the benefit. Thanks.
>>
>>47005669
OHHHH, I see. Shit, that is actually really neat.

Yeah, definitely do the analysis stuff.
What to do is gather a shitload of stories off fanfiction or some shit like that, or general story sites, hell, /tg/ wiki, dwarf fort stories and such.
Make it automatically scan through each and make a program from it, run it, see what it does, then consider what changes you would make that would benefit.

You could keep a list of commonly used words and their positions in sentences on average, and try base it around that.
Of course, since English is pretty flexible in sentence structure, it will be fairly complex, but that is why averaging will help.

Then maybe later on as it advances, you might even fork the concept to a way of making more interesting programs by making the interpreter do a pre-scan of the text to see if it can dynamically assign an instruction-set to create something of interest.
Maybe even throw in some simple machine learning on top. That would be really cool.
Survival of the most varied text.
>>
Working through Chapter 1 on Practical Reverse Engineering by B. Dang, A. Gazet, and E. Bachaalany.

Anyone here read this book? Any advice/tips?
>>
>>47005738
Yeah, I only really did it to get myself out of a slump.
I sort of stick to it loosely. Depends how I feel.
I try to at least get that amount in.

One thing I tend to do is planning code for 30-60 minutes rather than actually code, and code for 30, or even 15.
Planning out code, near-dry-run style, is a really nice way of figuring out what the hell you actually need to do and what you will need compared to just diving in head first and hoping your neck can take the cruel hours of trial and error coding.

And I don't mean going full UML on that shit. Fuck UML, holy hell what a waste of time. UML, the same diagram by 7 artists. Fuck.
The most I do is a sequence diagram at each layer.
So, say a game, the main game loop sequence diagram, then each discrete section like AI, rendering and such.
Easiest way to tackle any project.
Then possibly some basic pseudo laying out your code in order to figure out if you missed something out. Oh hey, forgot to check if that exists, add that in. Woops, never checked if the user did that right.
Not enough arguments passed to that function, default values, and so on.
Algorithmic stuff, I will actually tackle with code. Dry-running algos is dickishly painful if they work with complex sets of data.

I've had a lot more success actually planning code out beforehand.
Plus, if you plan it out well enough, actually coding it and dealing with problems becomes insanely easier and less frustrating.
And those times where it works perfectly. Fuck yes. All the mental boners.
>>
>>47003177
>Why aren't you using Erlang?
you have to be an idiot to not use Elixir in place of Erlang
>>
>>47006067
What advantages are there to using Elixir?
>>
>>47005685
write variables to the registry
>>
>>47005685

Find a group of unused keys.

Encode messages in to hotkeys.
Program ID first few keys
then after that, every key that isn't the last hotkey is considered data.
Terminate with last hotkey.

Send hotkeys / Listen for hotkeys.


I did this shit in Autohotkey once.
Oh god it was a mess.
>>
>>47002318
I approve of this DPT image.
>>
How can I create an .exe program for python? Made the first thing I'm actually proud of (It's not GUI) and I want to share it.

Also thanks /dpt/, wouldn't have made it where I am now without you guys.
>>
>>47006989
look up the meaning of "interpreted programming language"
>>
File: jira-interface.png (262KB, 1500x679px) Image search: [iqdb] [SauceNao] [Google]
jira-interface.png
262KB, 1500x679px
Working on a customer front-end to Jira. Might even be able to github it, since it's 95% open source from github anyway.
>>
>>47006989
Upload the code to github and share it, it's less hassle than an exe.
>>
>>47007002
Interpreted programming languages are the languages that run one byte at a time, working it as it goes. As opposed to compiled which does all of it at once. I forgot about that :( No way to share this then? Wrong pic btw, earlier version of the program.
>>
Reading Head First Design Patterns
>>
>>47007032
You can share it; just let people download the .py file.
>>
File: 1347794786124.png (3KB, 168x141px) Image search: [iqdb] [SauceNao] [Google]
1347794786124.png
3KB, 168x141px
What would cause a C++ array of ints to suddenly go from 20 items to almost 400 million?
>>
>>47007131

Unsafe memory allocation
>>
I have no idea how to write an interpreter for a prefix notation language.

My thought is that I should be somehow building up an s-expression tree and interpreting that but I'm having trouble designing an algorithm that will do that in a language without parentheses and instead where each procedure has a set number of args so it's never ambiguous.
>>
>>47007141
Shiiiiiiiiiiiiiiiit
I'm getting this code from a book, you'd think the author might realize his mistake there.
>>
>>47007150

Prefix, like

5 x (((4 + 3) - 3) / 5)

to

* 5 / - + 4 3 3 5

? What would the programming language look like?

bind function ArgType returnType {} ?
>>
>>47007213
Like
print + 1 * 2 4

print defined as always taking one arg, + and * always two. resulting in
print(1 + (2 * 4))
>>
>>47005170
>Ten kinds of dying
And I thought my fractured fibula was bad...
>>
>>47007254

What if I only want to print one thing?
>>
File: 1421953130828.png (158KB, 1200x1600px) Image search: [iqdb] [SauceNao] [Google]
1421953130828.png
158KB, 1200x1600px
How long until we can program our brains?
I'm sick of simple calculations taking seconds to complete.
>>
>>47007273
That's what that code does. Print takes exactly one arg. That arg can be the result of some other expression like + though.
>>
>>47007201
>>47007141
I fixed it.
See if you can spot the problem, that took me hours to find:
for (int i = 0; i < numRows; i++){
for (int j = 0; j < numColumns; i++){
>>
>>47007341

You incremented the wrong iterator.
>>
>>47007341
static analysis would have spotted that.
>>
>>47007373
It's not as bad as the time I spent 2 days looking over my code, trying to figure out why enemies gave the wrong amount of points when you killed them.
It turns out I was calling
delete enemies[i]

BEFORE calling
score += enemies[i].scoreGiven
>>
How would I go about solving this problem, I have the following code:
void Player::update(float delta)
{
// TODO: Store in integers?
// Handle player movement
x = x + (accumulator[DirToInt(Direction::East)] * delta * Player::MoveSpeed);
x = x - (accumulator[DirToInt(Direction::West)] * delta * Player::MoveSpeed);
y = y + (accumulator[DirToInt(Direction::South)] * delta * Player::MoveSpeed);
y = y - (accumulator[DirToInt(Direction::North)] * delta * Player::MoveSpeed);

accumulator[DirToInt(Direction::East)] = 0;
accumulator[DirToInt(Direction::West)] = 0;
accumulator[DirToInt(Direction::South)] = 0;
accumulator[DirToInt(Direction::North)] = 0;

// Send the position update (only if we actually moved)
if(x != lx || y != ly)
{
lx = x;
ly = y;

m_protocol->sendPosition(x, y);
}
}


Now, x and y are floats, however, it sends position updates for every fraction of the number, even if the client only needs integers, the problem is that, I could make the client receive floats, but then there would be like a fuck ton of packets sent when moving around, but if I use integers here, the calculations will round themselves and there won't be any movement at all. Any suggestions?
>>
File: 1426218482098.jpg (43KB, 565x800px) Image search: [iqdb] [SauceNao] [Google]
1426218482098.jpg
43KB, 565x800px
I never got a proper answer last time.
What is a super lightweight cross-platform C library that ONLY opens a window for me and allows me to write directly to its framebuffer and update the screen?
SDL2 is way too bloated for what I'm doing.
If no such thing exists, how hard is it to abstract away X11 and Cocoa?
>>
>>47007616
Not as hard as you'd think, probably about 200 LoC for each platform and it's pretty straightforward.
>>
>>47007616
http://allegro.cc
>>
>>47007640
Too bloated.
>>
anyone have a good resource that explains Dijkstra's shortest path algorithm?
>>
Thank you for using an anime image.
>>
>>47007516
Actually, instead of sending the packets from the client whenever the key is down in each tick, and increasing the accumulator, I just send StartMove and StopMove events on KeyDown and KeyUp events. Then increase the positions based on the movement state, and send updates only if floor'd pos and lastpos are different, this way I should achieve way less packets and have it work the same way.
>>
what language do i learn if i want to make video game
>>
>>47007874
Whatever you like. I'm partial to either scheme or lua for making games.
>>
>>47007874
You can make a game in anything, C++ (SFML), C (SDL), Python (PyGame), Lua (Love2D) etc. So pick whatever you're comfortable with, you're not going to make an AAA title so you don't need to squeeze the most out of the hardware. I'm personally making a game in C++ right now (trying to implement decent networking movement here >>47007516), where both the client and the server are written in C++, however the server exposes a Lua interface where you can script features and callbacks, and the client uses SFML for rendering and handling the windows.
>>
does this make sense for reducing branching?

    private class Poop {
protected void doSomethingMaybe() {
//do diddly jack shit
}
}
private final class Diarrhea extends Poop {
@Override
protected final void doSomethingMaybe() {
//do something
}
}
private final Poop[] poops = { new Diarrhea(), new Poop() };
private int poopCounter;
private int poopThreshold;


and then instead of

        if(poopTimer > poopThreshold) {
poops[0].doSomethingMaybe();
}


you have

        poops[poopTimer - poopThreshold >>> 31].doSomethingMaybe();
>>
>>47003450
The image wars are all pretty much 1-2 guys orchestrating them.
>>
>>47003450
that image is actually good and i don't mind it. the really upsetting one is the one with the python logo and the unattractive anime character (still not sure if it's supposed to be a girl or a boy).
>>
>>47007936
>implying yuuki is unattractive
anon pls
>>
>>47007943
To be fair it's pretty questionable fan art.
>>
Can someone help me interpret the C standard? Regarding flexible array members:

>As a special case, the last element of a structure with more than one named member may have an incomplete array type; this is called a flexible array member. In most situations, the flexible array member is ignored. In particular, the size of the structure is as if the flexible array member were omitted except that it may have more trailing padding than the omission would imply.

My first thought is that the "trailing padding" refers to padding added so that the flexible array member is properly aligned for its type. So we should have the invariant
sizeof(obj_type) == (uintptr_t)&obj.flex[0] - (uintptr_t)&obj
. But I am able to make gcc report otherwise, so I'm wondering if this is a gcc bug, or if the standard is just braindead in this case.
>>
I'm trying to decide on which language to begin learning.

In high school I took a Java 1 class and learned a bit of Java.

Should I continue my knowledge on that?

What I'd really love to do in the future is contribute to open source projects. I guess as a hobby of sorts. And fiddle around in GNU/Linux. I want to learn bash. (could you learn multiple languages at the same time feasibly?) A job programming also seems like a pretty cool thing to aim for though, and I hear there's plenty of jobs with Java.
>>
>>47008162
Oh and I know basic HTMl and I don't know php and can't do any css off the top of my head
>>
>>47008081
does sizeof count padding?
>>
>>47007943
有希 is pronounced ゆき, not ゆうき.
>>
What language should I use to create apps for smartphones? As a first project I'm looking to create an app for a webpage, however I have never even programmed anything before.
>>
>>47008205
aiiLmao language
>>
>>47008205
batch
>>
>>47008205
this: >>47007906

i added two more classes extending Poop to remove another branch, and put those two objects in the poops array. poop performance does seem more consistent now. i also changed the method name to callMeMaybe()
>>
>>47007032
You can share it in exe form. There are many python to exe converters but the only problem is you'll get huge ass exe's. I use py2exe for my windows based python programs.
>>
>>47007032
The processor interprets opcodes too dumbfuck. It's a machine code interpreter.

Interpreters don't translate shit into a target language -- it executes it directly.
>>
>>47008205
You don't have a choice. It's either Java for Android or whatever Apple is using right now.
>>
>>47008258
you do have a choice. phonegap (barf) has html, css, javascript. java has JNI allowing you to use C, C++, asm and more. there's also robovm for porting to iOS. otherwise apple has objective c and swift.
>>
>>47007032
good news / bad news.

bad news:it wont run natively on windows
good news: it will run on any machine with python installed (which is pretty much everything else, and can include windows)
>>
>>47006096
Elixir gets rid of all the syntactic ugliness of Erlang and moves functional programming into something that is more familiar while maintaining all the functional purity of Erlang. It adds new features like lisp-like macros so its capable of metaprogramming
>>
>>47003177
If you arnt going to start in node you dont need to use it.
node's greatest asset is fast iteration and speed (compared to other scripting languages at least). Its very good for development and product testing, but not for large many-developer projects where things can get ambiguous.
If I were you I would write your C/C++ hooks and wrap them with a js/node API. then do all of your development there.

There is a framework out there for the JVM called vert.x (its polyglot, so you can write vert.x with python / java / javascript etc...) it's structured like node, but gives you the option to use the strict typing and error handling that you need for bigger projects (at least if you use java). There is also a module that allows you to run your node.js code / modules etc.. right inside of vert.x while still allowing you to write java, python, etc....

I've been messing around with it for a couple weeks and it seems like a very sensible development path and you might consider it.
>>
File: asdasd.png (205KB, 800x800px) Image search: [iqdb] [SauceNao] [Google]
asdasd.png
205KB, 800x800px
This takes ages. I also this there is something wrong with the rammification
>>
>>47007796
my dick
>>
>>47002487
>inb4 still coding in Java 7
I really love how lambda-like or function-as-variable work in C#. Java 8 support lambda, but C#'s lambda is far more beautiful and readable.
>>
>>47002906
What is that graphing tool?
>>
>>47008485
it's very similar in java 8 >>47002509

>>47008502
jvisualvm
>>
>>47008441
Looks cool. Fractals?
>>
>>47003076
Use Java's reflection.
>>
>>47002318
Working on an android app, does anyone have experience setting up a Facebook login? As the sole login system? I'm struggling and their documentation doesn't help.
>>
>>47008522
facebook login is an OpenID service, have you googled that already?
>>
>>47008517
http://en.wikipedia.org/wiki/Diffusion-limited_aggregation

I'm trying to use it for terrain generation
>>
Let's say you have a struct with multiple arrays of characters.

How do you print just one of the arrays instead of having the other arrays that come after it also printed.

For example, for the following code:
#include <iostream>
using namespace std;

typedef struct CharArrayStruct
{
char first[2];
char second[4];
} t_cas;

int main()
{
t_cas c;
c.first[0] = 'a';
c.first[1] = 'b';

c.second[0] = 'C';
c.second[1] = 'D';
c.second[2] = 'E';
c.second[3] = 'F';

cout << c.first << endl;

return 0;
}


The output is:

abCDEF

not

ab
.
>>
>>47008720
You could store the length of the arrays in the struct and iterate through the arrays with a loop.
>>
>>47008720
why not just use a string and print a substring of it
>>
>>47008775
The actual struct has floats and integers too.
>>
HURRR DUR RLOOK AT ME IM USING C+++ LOLOLOO MFERYSGYB
GEHA IM FUCKINGRETARD ELOLELELXDD1
>>
>>47008790
ok why wouldnt you use strings instead of those character arrays in the struct?
>>
HUR PYTON ATHE BEST PROGRAMAINLANGUEA LEOLOEL LOOK AT ME SUCKING GIGANTIC COCKS XD
>>
>>47008808
Are we being raided?
>>
>>47008826
No, i was just accurately imitating the typical C++/Python user.
>>
>>47008836
I bet you even go so far as to even use GNUNIX
>>
>>47008821
Some embedded shit where you can copy an entire block of memory and cast it as struct, and everything is in the right place.

The actual struct has bit paddings and shit like that.
>>
>>47008848
Never heard if it, sorry.
Could it be that you use C++ and or Python?
>>
>>47008857
try adding '\0' to the end of the array
>>
File: 1421554637897.jpg (87KB, 624x352px) Image search: [iqdb] [SauceNao] [Google]
1421554637897.jpg
87KB, 624x352px
>>47008808
I'm actually impressed you managed to shitpost so much in such a small space.
>>
>>47008879
I can't.

An external component is populating the data, and the array gets completely filled, so I can't go and put \0 in the last row.
>>
>>47008720

The last character in the char array has to be a null character. If cout sees an element of type char*, which is what that array is going to decay to, it's going to print every element from that address until it sees a 0. And since second is in an adjacent address, it's going to be printed as well.

Also, don't use typedef for structs in C++. It's entirely unnecessary. Just do this:
struct t_cas {
char first[2];
char second[4];
};
>>
>>47008720
#include <iostream>
using namespace std;

struct t_cas
{
char first[3];
char second[5];
};

int main()
{
t_cas c;
c.first[0] = 'a';
c.first[1] = 'b';
c.first[2] = '\0';

c.second[0] = 'C';
c.second[1] = 'D';
c.second[2] = 'E';
c.second[3] = 'F';
c.second[4] = '\0';

cout << c.first << endl;

}
just add null char to end of array
>>
>>47008907

Then your array is 1 element smaller than it needs to be.
>>
>>47007341
i like to use r and c instead of i and j when i do something like that. i and j look really similar
>>
>>47008907
then let the component populate the array first and you can use strlen function to get the size of the populated array. Then add null at the end.
You should allocate sufficient memory so the array never overflows
>>
>>47008720
why does this compile? i expected that it wouldn't because the struct hasn't overloaded operator<<
>>
File: mountains512.png (61KB, 512x512px) Image search: [iqdb] [SauceNao] [Google]
mountains512.png
61KB, 512x512px
I want cool shit like this
>>
>>47008989

He is printing c.first, not c. c.first is a char array, so cout will happily print it (and it's adjacent elements).
>>
>>47009041
right thanks
>>
>>47007897
>pick whatever you're comfortable with, you're not going to make an AAA title so you don't need to squeeze the most out of the hardware
>Python, Lua
I definitely agree. However, using an interpreted language (let alone one that uses dynamic typing) is going too far in my opinion.

>>47008521
It's C#... Secondly, reflection will not help you.

>>47002487
At least post something that compiles. ForEach is not an extension method of IEnumerable. If you really want to use it, you need to use ToList first.
>>
>>47008998
me too.
>>
>>47004978
I could also just use a better language altogether
>>
>>47008998
Nice.
>>
I wanted a replacement for my YT account so I made these bash functions

channel-archive(){
youtube-dl --download-archive ~/.tempfile http://youtube.com/$1 --skip-download | grep youtube | cut -d : -f 1 | cut -d [ -f 2 | cut --complement -c 8 > ~/Videos/youtube/channels/org$1
rm -f ~/.tempfile
cat ~/Videos/youtube/channels/org$1 | uniq > ~/Videos/youtube/channels/temp$1
sed 1d ~/Videos/youtube/channels/temp$1 > ~/Videos/youtube/channels/$1
rm ~/Videos/youtube/channels/org$1
rm ~/Videos/youtube/channels/temp$1
}


channel_update(){
cd ~/Videos/youtube/channels
for i in $( ls -a *) ; do
youtube-dl --download-archive $i http://youtube.com/$i
done
mv -f *.mp4 ../
cd -
}


suggestions?
>>
>>47002318
just got my first ssl cert signed and installed.
>>
Fuck.
Is there no .NET library to do simple 3D scatter (point) plot?
>>
>>47009456
its not like people use .net in academia
>>
Alright I've learned simple helloworld tier shit in quite a few languages

I want to make a vidya gaem, should I go with rust or lua?
>>
>>47009525
use a pre-existing engine unless you seriously want to be a game programmer
>>
>>47009525
probably neither?
how much work are you trying to do anyway?
>>
>>47009542
>>47009541
i wanna make a clone of one of the top down gta style games
>>
>>47009557
if you want to learn a lot of math and make a game from scratch you should use c/c++ otherwise it doesn't matter just pick an engine and use whatever it uses
>>
>>47009557
that's not enough information.

you need to decide whether you can do it in 2d 2.5d or 3d, then you may want to decide how much work you are willing to put into asset creation, (obviously 3d assets are MUCH more time consuming), 2d would probably work...

then you need to decide on how much work you want done for you. make some sketches for control flow of user input / menus / events. then pick an engine that give you the control you want.
>>
File: tileGrids101.png (2KB, 332x324px) Image search: [iqdb] [SauceNao] [Google]
tileGrids101.png
2KB, 332x324px
>>47009557
Easy enough to do. (ish)
Learn about making up tile grids and loading them in as you walk around.

tl;dr of it is make a grid x by y size.
Say, 10,10.
So you would have:
current grids ID, needed to hide and show it
current grids X and Y position in the space, this is what you will move, the game character will be in the middle.
the tilesize of every tile
tilesX and tilesY, how many tiles you have in each direction, 10,10 in this case.
Now you make a loop to generate these tiles, fetch whatever textures, setup collision detection, pathways, and finally entities (items, guns, people)

Now you need to make that grid scroll.
Only visible grids will be moved, once a grids boundaries come in to what you consider a reasonable distance off-screen, load the next grid.
In the case of something like a GTA clone, you would need to keep a reasonable amount of the off-screen tile grids loaded.
The black in pic is the actual viewport (screen), whereas the blue tile grids actually extend off screen for a bit. Keeping at least a couple grids loaded in each direction will make your life so much easier.
This makes it easier to deal with events off-screen, as opposed to attempting to simulate some of them. Since you will be using a modern machine, there is no reason not to have some grids loaded in memory off-screen, GTA 1 and 2 had way less memory to work with so simulated off-screen stuff for the most part.
I've been trying to emulate this, but I've all but given up, it's more work than it is worth when I can just load fucking grids of tiles with X and Y offsets far easier.
The red dot is where your character will be centered.
Don't try to do any of that fancy shit where camera stops scrolling and your character begins to move when you read the corners of game worlds.
Instead, make your game world boundaries end at a point, but still visually continue off-screen. This is more natural and considerably less of a pain in the dick.

Good luck.
>>
>>47009484
You'd be surprised. Some of the common uses of F# are statistics and machine learning.
>>
>>47009669
>Don't try to do any of that fancy shit where camera stops scrolling and your character begins to move when you read the corners of game worlds.Instead, make your game world boundaries end at a point, but still visually continue off-screen. This is more natural and considerably less of a pain in the dick.
You wot. I think it would be very easy to set up once you have the rest in place.
>>
Is there a market for game enginer programmers? Not the "let's use unity to make an ebin video game XDDDD" kind but the "let's make something better than unity" kind
>>
>>47009720
yes. They can't develop as fast as the other guys so they rarely make it to the news but they get compensated well.
>>
>>47009714
Admittedly I have never actually tried doing it myself.
But thinking about it just makes my dick cry.

More effort than it is worth to unhook the character from the viewport and stop camera movement.

Plus, looks less natural IMO.
Having the world continue off-screen just feels better.
Even more so if you actually handle it naturally, like with islands, or rivers, mountains and steep hills, broken bridges and the usual ideas.
>>
>>47009735
How taxing is it? Do you need any specific formation besides a Computer Science master's, or is that + willingness enough?
>>
>>47009541
>>47009588
for a 2D top down game there's hardly anything a game engine could do for you that you couldn't do yourself just as easily. not worth the bloat at all. a pre-made engine should only be used if you want to make something more specific and complex like a first-person shooter with advanced graphics, and only if you don't have the resources to make your own engine for what you need.
>>
>>47009758
you need to know about maths and matrices to actually make custom engines, for using game engines to their fullest a competent knowledge of programming is good
>>
>>47009898
I accidentally the quaternions, what do?
>>
>>47009768
not really if you want to make some 2d garbage just use gamemaker
>>
>>47009952
>gamemaker
barf

what's the point in making garbage? if you want to make something then make it good.
>>
File: whatcolorisit.png (2KB, 580x328px) Image search: [iqdb] [SauceNao] [Google]
whatcolorisit.png
2KB, 580x328px
Made this little script based on http://whatcolourisit.scn9a.org/.

 function whatcolorisit
{
while :;
do
clear
tput cup $(($(tput lines)/2)) $((($(tput cols)/2)-5))
local X=$(date +%H%M%S)
echo -ne "\033]11;#$X\a#$X"
sleep 1
done
}
>>
>>47009758
You need to know math (linear algebra, maybe calculus for physics and lighting), understand computer hardware cpu/gpu/memory and how they interact, and be skilled in c/c++ because most serious games use this.
>>
>>47009986
I wonder what it'd look like if every vertical line is was second and the middle line was the current time color, that way you can see what time color it has already been and what time color it's going to be.
>>
>>47002413
Went into this completely blind, I'm very happy with the fact that I managed to write an interpreter like this. Tomorrow I'll write the part that translates text into symbols that this can run.
https://github.com/iamevn/wordy

Going to get around to cleaning up the readme and rewriting the spec in markdown at some point.
>>
Can we ask questions regarding disassembly aka cracking or is it against the rules?
>>
>>47010241
Disassembles were banned in the geneva convention
>>
>>47010241
No illegal content.
But cracking itself isnt illegal as long as you're cracking your own stuff. Keep grey zoned, anon.
>>
>>47010241
I don't see why not. I miss the threads we had with Reverse teaching reverse engineering to us.

Is there some way to get a blank column in a markdown table on github?
>>
guys, is Java programming_Comprehensive version 10th edition a good book ?
I want to start learning today
>>
File: overthesun.png (3MB, 4961x3508px) Image search: [iqdb] [SauceNao] [Google]
overthesun.png
3MB, 4961x3508px
[- Python -]
> http://www.python.org/

Friendly reminder that python is the top notch programming language
and has been heavily adopted by the industry and the academics.

Python has events and conferences all around the world:
> http://www.pycon.org/

Python even has a video repository!!
> http://pyvideo.org/

Find your local pythonistas group
> http://wiki.python.org/moin/LocalUserGroups

Join python and become a true computer scientist.
>>
>>47010440
>Join python and become a true computer scientist.
import code
topkek
programming for babbys
>>
>>47010255
>>47010266
>>47010278
What if I post a piece of code and ask a question about it without making clear which software I'm editing?
>>
>>47010440
scripting != programming
>>
>>47010498
You are right:
scripting > programming
>>
File: 1399661257648.jpg (116KB, 375x476px) Image search: [iqdb] [SauceNao] [Google]
1399661257648.jpg
116KB, 375x476px
>>47010595
>>
>>47010595
Evaluates to 0.
>>
>>47010622
kek
>>
I want to be productive on the go.

What is the best way to develop on a mobile device?
>>
>>47010687
Buy a laptop
>>
>>47010493
Just say you wrote it yourself or it's a challengre from teh interwebs that is supposed to be cracked, faggot.
>>
>>47010622
> (not (not 0))
#t


:^)
>>
>>47010687
Surface Pro with the expensive keyboard or Ultrabook.
>>
File: 1371496385285.jpg (33KB, 250x233px) Image search: [iqdb] [SauceNao] [Google]
1371496385285.jpg
33KB, 250x233px
>>47010735
>Surface Pro
>Developing on Windows
>Using Windows at all
>>
>>47010687
Laptop, netbook, tablet with keyboard.

I went with tablet since I draw as well.
And it is handy to VNC PC in bed at night. Comfy remote computing general.

Although I also still have a netbook with me as well.
I use a netbook as a router using a wireless internet dongle for other devices as well as tablet.
>>
>>47010498
except that python is not a script language.
>>
File: 1422487821007.jpg (273KB, 800x800px) Image search: [iqdb] [SauceNao] [Google]
1422487821007.jpg
273KB, 800x800px
>>47010750
>>
File: Untitled.png (19KB, 703x508px) Image search: [iqdb] [SauceNao] [Google]
Untitled.png
19KB, 703x508px
>>47010696
Alright.

So if I want to prevent the code in the line highlighted in cyan from being executed, which line do I have to edit? Some tutorials say to change the nearest conditional jump above the line (B) while others say to change the code at the Offset given by the "Referenced by ....." line (B).
Is it simply a matter of whichever code you first encounter while scrolling up from the target location?
>>
>>47010778
>"Referenced by ....." line (A)*
>>
>>47010498
Python is a high level programming language.
>>
>>47006989
py2exe

But unless it's something major don't bother, either distribute the script or make it into a pip package.
>>
>>47010687
>I want to be productive on the go.
Call the Thompson.
>>
>>47003407
>http://youtu.be/rRbY3TMUcgQ
Original was much better
>>
>>47010778

Jesus christ I forgot how ugly win32dasm was.

To prevent 00415E64 from being executed you just need to remove any paths to it. There's the implied path at 00415E62 (if that jump isn't made execution goes to 00415E64), so to remove that you just make that jump non-conditional. Then you need to search for any other references to 00415E64 and NOP them if they're jumps.

Then just put a breakpoint on 00415E64 in a debugger and run it a few times to make sure you got them all.

Also get a copy of IDA Pro or Radare and learn to use it, it'll make your life a lot easier.
>>
File: gtranslate.png (7KB, 580x328px) Image search: [iqdb] [SauceNao] [Google]
gtranslate.png
7KB, 580x328px
Some botnet fun:
function gspeak
{
if [[ "$#" -lt 2 ]]; then
echo -e "Usage: ${FUNCNAME} [\"REQUEST\"] [LANGUAGE]\n"
echo "LANGUAGES:"
echo "af ar az be bn bg bs ca cub zh-CN zh-TW cs cy da de en en_us en_gb en_au"
echo "el es et eu fa fi fr ga gl gu ht hi hmn hr hu hy is id it iw ja jw ka km"
echo "kn ko la lv lt mk mr ms mt no nl pl pt ro ru sr sk sl sq sw sv ta te th "
echo "tl tr uk ur vi yi"
return 0
fi

mpv "http://translate.google.com/translate_tts?ie=UTF-8&oe=UTF-8&q=$(echo $1 | sed 's/\s/+/')&tl=$(echo $2)" &>/dev/null
}


function gtranslate
{
if [[ "$#" -lt 2 ]]; then
echo -e "Usage: ${FUNCNAME} [\"REQUEST\"] [LANGUAGE]\n"
echo "LANGUAGES:"
echo "af ar az be bn bg bs ca cub zh-CN zh-TW cs cy da de en en_us en_gb en_au"
echo "el es et eu fa fi fr ga gl gu ht hi hmn hr hu hy is id it iw ja jw ka km"
echo "kn ko la lv lt mk mr ms mt no nl pl pt ro ru sr sk sl sq sw sv ta te th "
echo "tl tr uk ur vi yi"
return 0
fi

wget -qO- -U "" "translate.google.com/translate_a/t?client=t&ie=UTF-8&oe=UTF-8&text="$(
echo "$1" | sed 's/\s/%20/g'
)"&sl=auto&tl="$2"" | awk -F '\"' '{ print $2 }'
}
>>
>>47010907
PHP isn't "Personal Home Page"
>>
>>47010927
I see. Thanks.
Also I'll check out those two programs you mentioned. I've looked into ollydbg so far but when I do a string search it won't find anything.
>>
>>47011006
https://en.wikipedia.org/wiki/PHP
>While PHP originally stood for Personal Home Page,[5] it now stands for PHP: Hypertext Preprocessor, which is a recursive backronym.[7]
>>
>>47008720
"cout <<" doesn't have an overload for every kind of array, it's interpreting c.first as a string (char pointer) and expects a '\0' as the last character.
So, your answer is:
If you're only using strings, the last element of each array needs to be '\0'
If you're using arrays of other types, cout << c.myarray won't work anyway. There's something called a "for loop".
>>
Opinions on Code Contracts in C#?

How useful is the static analysis stuff? Automatic test generation with Pex seems interesting too, not sure how useful it would be in real world scenarios...
>>
How do you check the last element on a dynamic list with a "while" loop? Do you just add a conditional sentence after it ends?

I need the program to work with static lists too, so I can't just write "while i<>NIL do things"

I'm working on Pascal btw.
>>
Somone got an idea for a small Android app for a portfolio?
>>
>>47011285
You could keep track of how many elements are in your list and change that that value every time you add/remove something from your list. That way you could just skip _ memory addresses to the end of your list.
>>
>>47010756
>>47010791
>Some examples of "scripting" languages (e.g., languages that are traditionally used without an explicit compilation step):
>Python

>Python script
>script

>Python is a dynamic, memory managed scripting language. It is used to write web applications, to build scientific and geographic information systems, and for everyday scripting.
>scripting language
>scripting
>>
>>47011356
>wikipedia
the page you cp from also says

The term "scripting language" is also used loosely to refer to dynamic high-level general-purpose language, such as Perl,[1] Tcl, and Python,[2] with the term "script" often used for small programs (up to a few thousand lines of code) in such languages, or in domain-specific languages such as the text-processing languages sed and AWK. Some of these languages were originally developed for use within a particular environment, and later developed into portable domain-specific or general-purpose languages. Conversely, many general-purpose languages have dialects that are used as scripting languages.
>>
>>47011337
I feel like that would take more resources than a simple if sentence.
thanks though
>>
File: test.png (67KB, 300x300px) Image search: [iqdb] [SauceNao] [Google]
test.png
67KB, 300x300px
Fuuck I don't understand what kind of "gaussian blur" is this guy using

http://voxels.blogspot.de/2014/01/procedural-terrain-heightmap-generation.html

I get shitty results like pic. AForge Gaussian Blur doesn't do what this guy shows, nor photoshop or gimp.
>>
What do you think about Julia?
>>
>>47003983
Of course you can, I taught myself and I'm doing just fine
>>
// p_name is an xmllib2 xmlChar*
char *name = (char*)malloc(32);
int len;

if (xmlStrcmp(p_name, _X("albumtitle")) == 0)
{
len = 11;
memcpy(name, "album title", len);
}
else
{
len = xmlStrlen(p_name);
memcpy(name, (char*)p_name, len);
}
name[len] = '\0';

// at this point, name is unusable (causes heap corrupted crash)


Am I just not made for C++?
>>
>>47012094
does your memcpy in the else write more to name than there are chars left?
You should check for that

>Am I just not made for C++?
your code example is plain C
>>
>>47012154
It doesn't.
>>
>>47012025
that description is fucking vague as fuck. might be worth sending the author an email and ask for clarification.
>>
I had to train on classes, so I did a script to reverse a writing and edit it like a square.

Like
CUCK
UCKC
CKCU
KCUC

class StringMatrix :
def __init__(self, string) :
self.string = string
self.outString = ''
self.matrixString = [[0]*len(string) for i in range(len(string))]
self.getMatrixString()
self.trimString()

def edit(self) :
if self.outString :
base = 0
for i in range(len(self.outString)) :
if i%len(self.string) == 0 :
print('{0}'.format(self.outString[base:i]))
base = i
elif i == len(self.outString)-1 :
print('{0}'.format(self.outString[base:i+1]))

else :
print('Nothing found!')
reverseString()

def getMatrixString(self) :
if self.string :
size = len(self.string)
for i in range(size) :
for j in range(size) :
if i+j < size : self.matrixString[i][j] = self.string[i+j].upper()
else : self.matrixString[i][j] = self.string[i+j-size].upper()

def trimString(self) :
temp = []
if self.matrixString :
for i in range(len(self.matrixString)) :
temp.append(''.join(self.matrixString[i]))
self.outString = ''.join(temp)

def reverseString() :
string = input('Word?\n')
get = StringMatrix(string)
get.edit()

reverseString()
>>
>>47012587
I have to say
you have like 50 lines of code, and it could probably done in 1 or 2
>>
>>47012587
Not really useful, but kinda fun.
SURPRISE MOTHERFUCKER
URPRISE MOTHERFUCKERS
RPRISE MOTHERFUCKERSU
PRISE MOTHERFUCKERSUR
RISE MOTHERFUCKERSURP
ISE MOTHERFUCKERSURPR
SE MOTHERFUCKERSURPRI
E MOTHERFUCKERSURPRIS
MOTHERFUCKERSURPRISE
MOTHERFUCKERSURPRISE
OTHERFUCKERSURPRISE M
THERFUCKERSURPRISE MO
HERFUCKERSURPRISE MOT
ERFUCKERSURPRISE MOTH
RFUCKERSURPRISE MOTHE
FUCKERSURPRISE MOTHER
UCKERSURPRISE MOTHERF
CKERSURPRISE MOTHERFU
KERSURPRISE MOTHERFUC
ERSURPRISE MOTHERFUCK
RSURPRISE MOTHERFUCKE
>>
>>47012610
Not training on shortness of the code.
Also, I'm a rookie at python, I suck at shortness of code.
>>
>>47011542

I don't understand why we make a huge deal re: scripting v. programming, since a lot of it uses the same concepts. It's all under the 'coding' umbrella.
>>
File: 6nexu.png (23KB, 241x379px) Image search: [iqdb] [SauceNao] [Google]
6nexu.png
23KB, 241x379px
>>47012638
my implementation in javascript:
function tornado(str) {
var arr = Array.prototype.slice.call(str);
console.log(str)
for(var i = 1; i < str.length; i++) {
arr.push(arr.shift());
console.log(arr.join(""));
}
}
>>
File: Untitled (1).png (621KB, 773x842px) Image search: [iqdb] [SauceNao] [Google]
Untitled (1).png
621KB, 773x842px
>>47012188
I kinda understand what he is doing, I just don't know what filter can I use to achieve these blurred pictures, because that's not gaussian blur.
>>
>>47012698
As we both use the join function, I wonder how long is the code for prototype, slice, shift and push functions :3
>>
>>47012717
Looks like perlin noise nigger.
>>
File: 1310001559048.jpg (31KB, 579x328px) Image search: [iqdb] [SauceNao] [Google]
1310001559048.jpg
31KB, 579x328px
I want to code shit for a living. Do i actually need a compsci/software engineer degree?
>>
>>47002338
x86_64 is more concise than Java.
>>
>>47012726
That's not perlin noise. Perlin noise doesn't give you veins like the pic
>>
>>47012724
you never reinvent something if you dont have to
>>
>>47002435
for(int i=0;i<100;printf("%d",i++));
>>
>>47012772
>printf
>C#
...
>>
>>47012759
I get that you have a good memory/experience of javascript, probably extended to many languages.

I just like doing things from scratch, especially when it doesn't take too much code to do it myself.
>>
>>47012785
>C#
But I don't use marketing languages, anon.
>>
I didn't like the design of std::thread in C++11, so I wrote a wrapper.

Also been learning PHP & Drupal because work, it's pretty fun.
>>
>>47012788
it's simply manageability. If you reinvent the wheel using shitty names that takes anyone else minutes to see what the fuck you're doing

you're doing it wrong
>>
>>47012797
>PHP
>fun
oh, anon
>>
>>47012717
From the description I read, you just use gaussian blur on the images and increase the blur radius to get more and more blurry results. This can be done in Photoshop. But to merge them with weights and then normalize the values to 0...1, I don't know if that can be done in PS. Try writing a little tool that loads all the blurred images, combines them and saves the output.

That DLA looks really awesome, I might give it a try later. Not for terrain generation, though.
>>
>>47012717
looks like he takes the initial image, then highers the diameter of the lines. He probably enhances contrast too.
Then he applies levels of gaussian blur, until he gets a correct amount of diffused white.
Then he probably merges the last blur with the enhanced lines, to get a "shape" pattern that will give the "volume" to the mountains, by reverse, bottom/top projection.
>>
int main(int i) { 
return printf("%d",i-1),((exit-main)/101+main)(1+i);
}


If you can't explain how this code works, you don't know C.
If nonstandard main makes you mad, you have autism.
>>
>>47007906
>>47008246
why isn't this a more commonly used pattern? branch misprediction is like only one tier below cache misses in performance severity so if some branches can be avoided like this then why isn't it used and taught more commonly? what are the drawbacks?
>>
>>47012698

Using shift functions is cheating, you have to reinvent the wheel and do the shift yourself.

        public String Rotate(String input)
{
Char[] userString = input.ToArray();
Char firstChar = userString[0];
for (int x = 0; x < input.Length - 1; x++)
{
userString[x] = userString[x + 1];
}
userString[input.Length - 1] = firstChar;
return new String(userString);
}


This is some C#, bloated, but strings are immutable.
>>
>>47012844
Branch mis-prediction is nothing, barely a tenth of a cache miss, at worst. The cost of the virtual dispatch completely overshadows it.
>>
>>47012834
Holy undefined behaviour batman!
Works on your machine(tm)!
>>
>>47012867
>Char
>String
anon
>>
>>47012867
>Char
>String
>>
>>47012877
>>47012879

Oh no, I set off the alarms.
>>
>>47012824
>you just use gaussian blur on the images and increase the blur radius to get more and more blurry results.

The only pic close to what gaussian blur does is the second blurred picture, the rest are becoming more and more white, photoshop and gimp gaussian blur only make the pic darker.
>>
>>47012873
>The cost of the virtual dispatch completely overshadows it.
do you have a source for that? from what i can find, the single dispatch in java (extending at most one superclass) is supposed to be efficient.

the copy-paste from the pdf messes up but see "introduction" here: http://www.research.ibm.com/people/d/dgrove/papers/hpcn01.pdf
>Single superclass inheritance makes efficient virtual method dispatch possible.
>>
For my edification, why is it that the aliases are considered best practice anyway?
>>
>>47013037
>edification
what a faggot
>>
>>47013012
By "efficient" they mean "not requiring a thunk".

It still needs two more loads than a normal function call (one for the vptr, one for the function pointer in the vtable)

The it does an indirect dispatch on a pointer, not a direct dispatch. This is a (near) guaranteed branch mispredict anyway.
>>
>>47012949
Maybe that's what the weighting is for, to equalize the brightness levels before summing and normalizing them?
>>
>>47013012
Reference Sauce for timings: http://www.eecs.berkeley.edu/~rcs/research/interactive_latency.html

>Branch mispredict: 3ns
>Main memory reference: 100ns

Of course the branch mispredict can do a bit more damage if you're in a really tight vectorized loop, but most of the time it's negligible when compared to a cache miss.
>>
>>47013053

Okily-dokily neighborino.
>>
>>47012949
I think he applies one level of gaussian blur many times.
Then he adds the different layers to create the final output, the most blurred having the lesser opacity, ect...
>>
>>47012887
Yes, I am the C# format gestapo.

>>47012867
public static IEnumerable<string> Rotations(string input)
{
for (int i = 0; i < input.Length; i++)
{
var indexes = Enumerable.Range(i, input.Length);
yield return new string(indexes.Select(x => input[x % input.Length]).ToArray());
}
}

Could be transformed into a one-liner, but would be a tad unreadable
>>
I just made my first git commit /g/ :3
>>
Reposting from SQT:

Let's say I have the following HTML:

<div class="test" style="background: url('http://example.com')"></div>


How do I get the background link with Jsoup?
>>
>>47003424
is that better than zeroMQ? As I mentioned I don't know a lot about message queues or the architectural stuff. I wish it was easier to learn how things are done 'right' these days.
>>
>clang
Is there any way to get *sensible* warnings about structure padding (i.e. only when it can be avoided). -Weverything has -Wpadded, but that warns on bullshit like unavoidable alignment padding.
>>
>>47013086
>Yes, I am the C# format gestapo.

I'll be sure to keep that in mind. I've only worked on my own shitty little C# projects, so 'best practices' aren't really ever on my mind.

As for the code snippet, I suck cock at linq. What's a good resource for becoming unretarded with it?
>>
Okay /g/, I'm working through the SICP and am dumb.

This returns the error that it expected a procedure that could be used on numbers, but didn't, but I can't figure out why, have been staring at it and fiddling for like twenty minutes now.

(define (find_f n)
(if (< n 3) n
(find_f
((+ (find_f (- n 1))
(* 2 (find_f (- n 2)))
(* 3 (find_f (- n 3))))))))


In my head this should be defining a function find_f that when ran tests if n < 3, and if it is returns n as a value, and otherwise calls itself with various n values until all n values are less than 3. Where's the wrong paren/syntax?
>>
File: West_Norway_TN.jpg (50KB, 900x300px) Image search: [iqdb] [SauceNao] [Google]
West_Norway_TN.jpg
50KB, 900x300px
>>47012949
I think I found out a trick I can use. Basically increasing dilatation + gaussian blur with increasing radius.

Pic related

This would be the 8 gaussian pass, first the original fractal, then the fractal dilated with a 3x3 structural elements, then apply gaussian blur in this case a huge radius.
>>
>>47013214
ate my pretty printing, reposting out of shame.

(define (find_f n)
(if (< n 3) n
(find_f ((+ (find_f (- n 1))
(* 2 (find_f (- n 2)))
(* 3 (find_f (- n 3))))))))
>>
>>47013244
the fractal is dilated eight times.*

>>47013125
congrats
>>
File: program.png (6KB, 323x172px) Image search: [iqdb] [SauceNao] [Google]
program.png
6KB, 323x172px
What layout manager should I be using if I want my java program to look like pic related?
Right now I'm using flow layout which obviously isn't very good.
>>
>>47012867
>>47012698
Best I can do if I want to be short.
string = input('Word?\n')
base = 0

matrixString = [string[i+j-len(string)].upper() if i+j < len(string) else string[i+j-len(string)].upper() for j in range(len(string)) for i in range(len(string))]
outString = ''.join(str(e) for el in matrixString for e in el)

for i in range(len(outString)) :
if i%len(string) == 0 :
print('{0}'.format(outString[base:i]))
base = i
elif i == len(outString)-1 : print('{0}'.format(outString[base:i+1]))
>>
>>47013245
Pretty sure you have too many parentheses. Try this.
(define (find_f n)
(if (< n 3) n
(find_f (+ (find_f (- n 1))
(* 2 (find_f (- n 2)))
(* 3 (find_f (- n 3))))))))
>>
>>47013264
>162 character line

How the fuck am I suppose to fit that on my teletype?
>>
File: AWT_FlowLayout.gif (18KB, 317x175px) Image search: [iqdb] [SauceNao] [Google]
AWT_FlowLayout.gif
18KB, 317x175px
>>47013263

FlowLayout might Just Werk™
>>
>>47013305
>Look at me, I'm being a trip fag and no one can stop me!
>>
>>47013086
And the F# version:
let rotations (input: string) =
[ 0 .. input.Length - 1 ]
|> Seq.map (fun r -> [ r .. r + input.Length - 1 ]
|> Seq.map (fun i -> input.[i % input.Length])
|> fun chars -> new string(chars |> Seq.toArray))


>>47013178
Simply practice to get the hang of it. If you want to go deeper, C# in Depth might be a good book to go through.
>>
>>47013303
Actually remove the final ).
>>
I fucking HATE programming UIs. Is there any way to make a good java UI by simply dragging and dropping THE LEAST AMOUNT OF THINGS POSSIBLE? I don't even want to look at the code, I just want to drag and drop pretty things that interact properly with my code.
>>
>>47013333
>C# in Depth might be a good book to go through.

That sounds good to me. I'm direly in need of some good books for C# (and for C, and for C++, and for Java, and for..)

>Simply practice to get the hang of it.

Aye aye, captain.
>>
>>47013322
Problem is I want to use system theme but if I use flow then it might look weird on some computers
[spoiler]Like mine[/spoiler]
>>
>>47013351

The NetBeans GUI builder is actual magic. IntelliJ's less so.
>>
>>47013333
Type inference to the max:
let rotations input =
[ 0 .. Seq.length input - 1 ]
|> Seq.map (fun r -> [ r .. r + Seq.length input - 1 ]
|> Seq.map (fun i -> Seq.nth (i % Seq.length input) input)
|> fun chars -> new string(chars |> Seq.toArray))
>>
>>47013303
Thank you based anon. Now it for values less than three but it hangs on values over than three. Is there anything obvious that would cause it to infinitely recurse?

I'm having a lot of trouble wrapping my head around recursive processes, sorry for the stupid questions.
>>
>>47013368
Any comparable plug-ins for eclipse?
I tried making a small swing UI and I actually wanted to shoot my fucking brains out
>>
var t = new Thread()
{
Link = >>47013506
};
t.Start();
>>
>>47013493

I refuse to use Eclipse. They do have WindowBuilder, but it's a shit, iirc.
>>
>>47013511
faggot
>>
Interesting beginner Python projects?
>>
>>47013303
>>47013427
Nevermind, think I figured it out, I had an extra find_f where I didn't need it so it was trying to reduce a growing output by making the output even bigger.
>>
>>47012735
no
>>
>>47013062
Monomorphic: 2.816 +- 0.056 ns/op
Bimorphic: 3.258 +- 0.195 ns/op
Megamorphic: 4.896 +- 0.017 ns/op
Inlinable Monomorphic: 1.555 +- 0.007 ns/op
Inlinable Bimorphic: 1.555 +- 0.004 ns/op
Inlinable Megamorphic: 4.278 +- 0.013 ns/op

http://insightfullogic.com/blog/2014/may/12/fast-and-megamorphic-what-influences-method-invoca/

seems to be no significant difference between monomorphic (a normal method call) and bimorphic (what i'm proposing).

>>47013067
but what if we have little to no cache misses?
>>
>>47013643
>but what if we have little to no cache misses?
Lol.
Then optimize your shit. Any barely optimized algorithm will be IO bound these days.
>>
>>47013305
>>47013264
You're right, that's not useful.

And I was wrong. Here's the version with three lines.
string = input('Word?\n')
matrixString = [[string[i+j-len(string)].upper() for j in range(len(string))] for i in range(len(string))]
for subMatrix in matrixString : print('{0}'.format(''.join(subMatrix)))
>>
>>47013663
right. i optimize my shit by removing branches.
>>
>>47013663
btw did you misread or wtf are you saying?
>little to NO cache misses
>IO bound
>>
>>47013749
And replacing them with memory lookups, great job.

I don't think you have any idea how to optimize, anon.
First, take care of the blatant issues: Bad design, awful algorithmic complexity, retarded algorithms. Then optimize the data layout and memory accesses to make the caches and predictors happy. And then you can worry about branche mispredictions.
>>
>>47013766
Exactly. If your program was optimized, you'd be IO bound, not CPU bound.

You seem to be really stupid. Not in a "I'm mad at you" sort of way. Just in a "bless your heart, you're helpless" fashion.

Good luck.
>>
>>47013776
>memory lookups
reading from RAM? no. just no. noooooooo.

>>47013804
you consider reading from L1 or L2 cache being IO bound? then you're just arguing semantics, and you're wrong.
>>
>>47013874
You're asking the wrong questions, have no clue what you're going on about.
>>
>>47013890
YOU have no clue what you're going on about. you think a method call takes as much time as reading from RAM. top kek. and you think an optimized program has to be IO bound. all i need is one boolean and two ints as input.
>>
>>47013926
two booleans but whatever
>>
fucking fuck
why dont you two fucks make a benchmark and test these fucking claims instead of shouting at each other
for fucks sake.
>>
>>47013926
> you think a method call takes as much time as reading from RAM. top kek
Again, what you're saying makes no sense.
Do I have to remind you that code is stored in RAM ?

But go on, keep "optimizing" your branches. What do I care.
>>
>>47013950
see >>47013643

also
>Further, I made two long-term runs of the search where the if-statement respectively the operation call was hit 1.840.306.311 times on a machine doing nothing else:

>The if version took 10h 6min 13sek (50.343 "hits" per second)
>The or version took 10h 9min 15sek (50.595 "hits" per second)
>I would say, this does not give a real answer, because the 0,5% difference is in the measuring tolerance.

>My conclusion: They more or less behave the same, but the overriding approach could be faster in the long-term as guessed by Kane in the answers.
http://stackoverflow.com/questions/7958108/performance-of-overriding-vs-if-statement

and as noted by john carmack it can be better to be consistently slow than to often be fast.
>>
>>47013960
main memory then. you know what i meant. you wrote
>memory lookups

>Do I have to remind you that code is stored in RAM ?
what the fucking fuck are you talking about? herpaderp
>>
>>47013960
>>47014030
and RAM is not the same as cache so you're wrong on that too. "IO bound" "code is stored in RAM"
>>
>>47014030
>>47014049
What the hell. I can't tell if you're trolling at this point.

Your RAM is your main memory, idiot. And congrats on at least knowing that a cache is not RAM, that's kinda the whole point of caches, not being RAM.

I'll just have to ignore you.
>>
>>47014078
you're the one who's trolling. doing it like >>47007906 is perfectly fine. quit wasting my time.
>>
>>47014078
>butt hurt
>>
>>47014103
Sure. I guess there's no cure for Dunning-Kruger.

>>47014121
More like bored and losing faith in humanity.
>>
File: projecting.jpg (46KB, 490x333px) Image search: [iqdb] [SauceNao] [Google]
projecting.jpg
46KB, 490x333px
>>47014131
>Sure. I guess there's no cure for Dunning-Kruger.
pic related

>More like bored
which must be why you write inane bullshit that literally doesn't make sense
>Any barely optimized algorithm will be IO bound these days
>And replacing them with memory lookups, great job.
>Do I have to remind you that code is stored in RAM ?
>>
btw totally underrated post >>47008246
>What language should I use to create apps for smartphones?
>this: >>47007906 (You)
>poop, poop everywhere
>i also changed the method name to callMeMaybe()
>>
Is there any way to make a constant in java (public static final TYPE NAME = INITIALISATION) where you call the constructor for that class? Analogous to doing something like

public enum Foo {
Const("PARAM");

String field;

Foo(String param) {
field = param;
}
}


but where the constant is inside a class.
>>
>>47014311
i'm not entirely sure what you mean but i don't think so. a final field needs to be initialized either where it's declared or in the constructor of the class it's declared in.

try asking in the new thread to make sure >>47013506

btw to buttmad troll http://stackoverflow.com/questions/7891466/poor-performance-of-many-if-else-statements-in-java?rq=1
>32 if-else statements
>it is really affecting the performance of my application
>>
>>47011035
IDA is the standard
Thread posts: 367
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]
Please support this website by donating Bitcoins to 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
If a post contains copyrighted or illegal content, please click on that post's [Report] button and fill out a post removal request
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 4Archive shows an archive of their content. If you need information for a Poster - contact them.