-  [WT]  [PS]  [Home] [Manage]

  1.   (new thread)
  2. [ No File]
  3. (for post and file deletion)
/pr/ - Programming
  • Supported file types are: C, CSS, DOC, DOCX, GIF, H, JAVA, JPG, PDF, PNG, SVG, SWF, TXT, WEBM
  • Maximum file size allowed is 10000 KB.
  • Images greater than 200x200 pixels will be thumbnailed.
  • Currently 389 unique user posts. View catalog

  • Blotter updated: 2018-08-24 Show/Hide Show All

There's a new /777/ up, it's /Moldy Memes/ Check it out. Suggest new /777/s here.

Movies & TV 24/7 via Channel7: Web Player, .m3u file. Music via Radio7: Web Player, .m3u file.

WebM is now available sitewide! Please check this thread for more info.

I need some help please Neckbearded Basement Dweller 16/08/13(Sat)22:54 No. 4924 [Reply]
4924

File 147112166375.png - (443.17KB , 2000x2000 , help.png )

Guys, I've literally tried everything and nothing works, maybe my level is basic but I really want to finish this project, the real problem is:

Exception in thread "AWT-EventQueue-0" org.hibernate.TransactionException: nested transactions not supported

So my save button can't send the data to mysql :s


>>
Neckbearded Basement Dweller 16/08/14(Sun)11:09 No. 4925

ask your instructor to teach you a real language.


>>
Neckbearded Basement Dweller 18/02/11(Sun)15:53 No. 5099

>>4924
From your comments you want to send data to a MySQL. From the exception, you seem to be using Hibernate. And, more important, the error says: "nested transactions not supported". Look up your code for said transactions. Maybe you are trying to send two queries at the same time and they are not committed to the database?

And the next time, read CAREFULLY the error message and contextualize it within your code. They are there for a reason.




Revealing your power level Neckbearded Basement Dweller 15/07/07(Tue)20:11 No. 4766 [Reply]
4766

File 14362927069.jpg - (38.29KB , 372x399 , To_the_idiots_with_love_45bdf1_4806225.jpg )

Today at work, in a code comment explaining the motivation for a design decision, I took a short jab at people calling themselves "webdevs" but who can't get right what I was doing. Fortunatelly, as I usually read and rethink what I write, I realized that was being a smug asshole so I removed that part of the comment and committed.

Tell me, /pr/, what's the worst thing you've written or seen someone else write in code comments?


5 posts omitted. Click Reply to view.
>>
Neckbearded Basement Dweller 17/06/29(Thu)12:07 No. 5048

>>5039
The main use for comments, imo, is not to make it obvious what the code is doing, but why it's doing it.

It helps readers follow along and see the logical steps being taken in code, and if you don't work on code for a while you might even forget your own code and how it worked back then..


>>
Neckbearded Basement Dweller 17/07/10(Mon)18:18 No. 5052

>>5048
That's the only reason I write comments, so 3 years later when it breaks on a Monday morning and I'm staring at it bleary-eyed without any coffee I can figure out what the hell is going on.


>>
Neckbearded Basement Dweller 18/02/11(Sun)15:44 No. 5098

I once was porting a file format parser that used unsigned integers for pointers to Java. For those who don't know, Java only have signed ints (in Java 7, which was the version I used at that time). I spent a whole morning writing code that converted the number to a long and preserved everything as intended. Before committing I wrote a large rant about Java in the comments above the code. If I'm not mistaken, that code and comments are still there for ~3 years and counting.




Request for comments Neckbearded Basement Dweller 18/01/02(Tue)02:39 No. 5091 [Reply]
5091

File 15148571617.jpg - (29.41KB , 331x400 , confused1.jpg )

I'm hacking up a dynamic class loader, and I have all of the easy stuff done (dlfcn, dirent, etc.).
So the manager needs to know which container to construct based off the extension of the file that needs to be passed to the containers constructor.

The question then is: should I have the container shared object advertise which file extensions are supported or should I have it advertise a mime type?

My concern with using the mime type is that I would need a mapping from file extensions to mime type.
And my concern with using just the file extension is that there may be extension collisions.


>>
Neckbearded Basement Dweller 18/01/06(Sat)01:24 No. 5092

Incase anyone is interested, I decided to implement the code analagous to the following pseudo-code:

for ( auto module : modules.equal_range( input ) ) {
try { auto module_class = module.second.constructor( input );
return std::unique_ptr< Module >( module_class );
} catch ( exception e ) { }
}

I let the modules advertise what inputs they support and use that do decide which loaded modules to attempt to create. In documentation I require that the module throw an exception if the input is not supported, or fails to load. I'll deal with the other issues related to that as I think of them.




How does one learn hacking? Lukas 17/03/15(Wed)23:34 No. 4999 [Reply]
4999

File 14896172853.jpg - (86.42KB , 600x1067 , dbd.jpg )

I have basically none experience with advanced usage of computer whatsoever and O have no idea where to begin. I want to become the ultimate neckbeard.


>>
Neckbearded Basement Dweller 17/11/14(Tue)06:47 No. 5086

I think it's kind of hard becoming a hacker. But mostly, the skills you need to train is knowing how computer network works in details.

Install a linux distribution. I really like Archlinux (hard to install, but you're going to learn a lot of stuff). Debian is also great.

Try to understand how computers interact with each other. What is actually happening when you browse the internet ? How does it work ? What is your browser actually doing when loading a website ?

Learn how to program. I recommend bash, C, python.

Understand what is a Network. Learn tools like NMAP and netcat.

Good luck.




Neckbearded Basement Dweller 16/11/28(Mon)20:50 No. 4970 [Reply]
4970

File 14803626017.png - (102.11KB , 800x600 , Untitled.png )

hey /pr/ here are some cool open source games i found.

https://play0ad.com/
http://www.xonotic.org/
https://www.wesnoth.org/

maybe you can use your programming skills to help develop and make these games better.


>>
Neckbearded Basement Dweller 16/12/22(Thu)13:27 No. 4976

+
AssaultCube
OpenArena
OpenRA


>>
Neckbearded Basement Dweller 17/06/27(Tue)10:05 No. 5047

>>4976

Adding on from AssaultCube:
Cube 2 engine / Sauerbraten (http://sauerbraten.org/)
Tesseract (forked from sauerbraten, http://sauerbraten.org/)
Red Eclipse (also forked from sauerbraten, https://redeclipse.net/)


>>
Neckbearded Basement Dweller 17/11/04(Sat)13:05 No. 5083

>>4970
http://pixeldungeon.watabou.ru/




Neckbearded Basement Dweller 17/07/19(Wed)00:36 No. 5054 [Reply]
5054

File 150041736958.jpg - (23.73KB , 450x300 , armie-hammer-the-social-network_cycgik.jpg )

Friend is learning JavaScript as her first language. Should I stop her?


>>
Neckbearded Basement Dweller 17/07/30(Sun)05:44 No. 5057

Unless she is specifically trying to learn Front-End Web Development with Front-End Frameworks, I'd recommend trying to get her to switch.

Python in general is a much easier more intuitive first language, and if we wants to do WebDev, the Flask framework makes it very easy. Once she is comfortable with Flask, HTML, and CSS, going into JavaScript, Front-End or Server End will be generally much easier.


>>
Neckbearded Basement Dweller 17/08/31(Thu)15:35 No. 5070

fuck no


>>
Neckbearded Basement Dweller 17/10/19(Thu)15:15 No. 5078

>>5054
No, let her be comfortable in C-syntax instead of using Python.




Neckbearded Basement Dweller 17/07/28(Fri)10:04 No. 5056 [Reply]
5056

File 150122907045.jpg - (2.47KB , 135x100 , pp.jpg )

Hi, /pr. I'm learning Scala and I want challenges to implement in this language. What do you guys suggest?


>>
Neckbearded Basement Dweller 17/10/15(Sun)17:52 No. 5076

Fuck, this board is dead.




Neckbearded Basement Dweller 17/08/16(Wed)05:58 No. 5061 [Reply]
5061

File 150285589835.jpg - (9.09MB , 3800x5244 , jasmine4.jpg )

results.Sort((g1, g2) => g2.depth.CompareTo(g1.depth));

Can someone explain to me what the hell this C# does?

results is a System.Collections.Generic.List

It's some kind of interface shortcut I guess? But what is => and why write it like that, does it save CPU cycles or just time for the coder himself?


1 post omitted. Click Reply to view.
>>
Neckbearded Basement Dweller 17/08/18(Fri)05:06 No. 5065

>>5064
Darn, the formatting got completely fucked. Oh, well.


>>
Nattack!upUGcHlgU2 17/08/18(Fri)10:55 No. 5066

>>5065
https://pastebin.com/8Qh9KEv9

Here bud

>>5061
Function currying and lambdas combine to make a thing called Streams (as my college puts it anyway), they are not quite the same as a filestream, however.

It's a great thing to learn, a bit tricky at first but can eliminate the need for complicated nested loops with slightly less complicated nested lambdas.


>>
Neckbearded Basement Dweller 17/09/04(Mon)00:29 No. 5071
5071

File 150447779632.jpg - (181.57KB , 650x922 , jasmine2.jpg )

Thanks for explaining! I think I'll need to do a bit more research on lambdas before I grasp them.




Neckbearded Basement Dweller 17/03/17(Fri)15:37 No. 5001 [Reply]
5001

File 148976143896.jpg - (140.76KB , 610x581 , coq-noir.jpg )

I just failed a job application over a bizzfuzz. Please tell me what I did wrong.

> First, I think, this dickhead wants me to just fart out a line of Haskell in two seconds. Well, no, that's not what this job is about
> Started with a specification in Atelier B just to show that I can make trains work
> After writing the specification in B-Method, I went into Coq for a nifty proof
> I wrote all this using Acme with a 20 year old 3-button that I only save for special interviews
> My Coq proof proves, I extract the proof to Haskell. Then for shits and giggles, I show this clown why dependent types are essential for string-out by rewriting it in Idris
> I try to run it and it crashes. Fucking Idris 0.99 whatever no problem
> Turns out one of my types was a character off. Quick save, I just started talking about how I would have done it in CML instead if I wasn't crunched for time, and that I did it in peano numbers over the fibonacci sequence
> It compiles. Success! Wait, but this needs a graph.
> An hour of MATLAB later and I have something truly beautiful... a 5d graph of fizz and buzz, and it's only like 3mb. I'm proud as shit, I've been working my ass off for the past three hours
> "Do you know fucking javascript? It's a porn ad you idiot"

Didn't get the job. What the hell is wrong wrong with people?


>>
Neckbearded Basement Dweller 17/03/20(Mon)18:48 No. 5007

Had a good laugh 6/10


>>
Neckbearded Basement Dweller 17/04/11(Tue)05:42 No. 5038

I'm sorry to hear that.

You'll do better next time.




Neckbearded Basement Dweller 17/04/08(Sat)10:39 No. 5036 [Reply]

Hey /pr/ first time getting into programming a debug mode for brogue and I'm gonna learn to do some miscellaneous programming, but I want to make brogue into a debug form, but when I try to do so, I get this:

||=== Build: Debug in Brogue (compiler: GNU GCC Compiler) ===|
C:\Users\Zenheart47981\Desktop\brogue debug folder\Brogue-windows-v1.7.4\Brogue-windows-v1.7.4\Brogue Source\PlatformCode\main.c||In function 'main':|
C:\Users\Zenheart47981\Desktop\brogue debug folder\Brogue-windows-v1.7.4\Brogue-windows-v1.7.4\Brogue Source\PlatformCode\main.c|77|error: 'cursesConsole' undeclared (first use in this function)|
C:\Users\Zenheart47981\Desktop\brogue debug folder\Brogue-windows-v1.7.4\Brogue-windows-v1.7.4\Brogue Source\PlatformCode\main.c|77|note: each undeclared identifier is reported only once for each function it appears in|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
||=== Run: Debug in Brogue (compiler: GNU GCC Compiler) ===|


The curses console is undeclared, but how do I declare it?


>>
Neckbearded Basement Dweller 17/04/09(Sun)06:20 No. 5037

>>5036

Have you looked specifically in all files you've imported?

When I first attempted to do this on my own I get a different error, cursesConsole is undeclared, you have to declare it in a specific file?

Have you found any references for cursesConsole in different files?

Add this in codeblocks:

extern struct brogueConsole cursesConsole; in file platform.h.




Delete post []
Password  
Report post
Reason