AnonAccount: What is it, and what does it do? - Q&A Thread
Leave these fields empty (spam trap):
Name
You can leave this blank to post anonymously, or you can create a Tripcode by using the float Name#Password
A subject is required when posting a new thread
Subject
Comment
[*]Italic Text[/*]
[**]Bold Text[/**]
[~]Taimapedia Article[/~]
[%]Spoiler Text[/%]
>Highlight/Quote Text
[pre]Preformatted & Monospace text[/pre]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists
File

Sandwich


How do I avoid this circular import? by Henry Pitthood - Thu, 30 Jan 2014 07:35:14 EST ID:V2gwkTy9 No.30843 Ignore Report Reply Quick Reply
1391085314655.jpg -(471529 B, 920x1200) Thumbnail displayed, click image for full size. 471529
I'm making an RPG. I have a class called Map, which has a 2d array of Tiles, and some tiles have a Warp. A warp points to a map (and a coordinate within that map). This makes sense when I think about it, but it won't compile because it's circular: Map needs Tile, which needs Warp, which needs Map, etc...

What am I doing wrong? What's the right way to design this?
>>
Fucking Sellywad - Thu, 30 Jan 2014 12:13:00 EST ID:D0GuSL2t No.30844 Ignore Report Quick Reply
>>30843
Could the warp just have a reference to the map it will warp you to?
Or some kind of identifier that uniquely defines the map?
>>
Henry Pitthood - Thu, 30 Jan 2014 18:25:36 EST ID:V2gwkTy9 No.30845 Ignore Report Quick Reply
1391124336655.jpg -(343177 B, 1920x1200) Thumbnail displayed, click image for full size. 343177
>>30844
I guess that would work. I could store all the maps in an array/list, and then have the warp hold just an index for it.
>>
Eliza Shakeford - Fri, 31 Jan 2014 02:04:19 EST ID:60jBojSU No.30846 Ignore Report Quick Reply
In some languages like ML this is actually not a problem. You could actually have the warp and map defined based on each other
>>
Barnaby Claywill - Fri, 31 Jan 2014 06:56:12 EST ID:QhBNOwJO No.30847 Ignore Report Quick Reply
1391169372398.png -(3039698 B, 2436x992) Thumbnail displayed, click image for full size. 3039698
>>30846
Well, it doesn't work in Haskell, even if you use "Maybe Warp". (This is how you make things nullable in Haskell. I want this because not every tile warps you somewhere.)

I just tried this in Java, and it half-works. You can define the classes fine, but you can't make a circular instance because it'll complain about referencing a field before it's defined.

How does ML do/allow this? What's the code look like?
>>
Reuben Nenningsuck - Sat, 01 Feb 2014 17:24:56 EST ID:QhBNOwJO No.30857 Ignore Report Quick Reply
>>30847
Btw, I just realized that you could do this in Java, but it'd take two steps. The first step is creating the instance and setting all the non-circular variables, and the second step is setting the circular variable with a destructive function. I'm not sure that I'd want to do this instead of the unique identifier way though.


ASP.NET (User Auth Problem) by John Cullernut - Fri, 31 Jan 2014 15:48:51 EST ID:6GeL5+RM No.30850 Ignore Report Reply Quick Reply
1391201331384.jpg -(144086 B, 450x295) Thumbnail displayed, click image for full size. 144086
Currently doing a college project that involves me having to create a login function and members portal. Basic stuff but it's all new to me.

I've created the index page, a login page and a members portal. I've changed the access rights so only logged-in users can access it and have created a user. Now, when I try to type in the username and password, it tells me the login details were incorrect even though they're not. Is it anything to do with session variables?
>>
Beatrice Tillingspear - Fri, 31 Jan 2014 20:21:48 EST ID:kv8bxsSs No.30852 Ignore Report Quick Reply
log files and debug printfs are your friend.
>>
Polly Hiblingman - Fri, 31 Jan 2014 21:33:01 EST ID:giwK3NGE No.30853 Ignore Report Quick Reply
What sort of password, comparing login details against a database value or wut?


Java Library, Eclipse by John Cullernut - Fri, 31 Jan 2014 09:57:22 EST ID:6GeL5+RM No.30848 Ignore Report Reply Quick Reply
1391180242384.jpg -(115019 B, 795x551) Thumbnail displayed, click image for full size. 115019
I'm aware this may be a stupid question but somebody please help me out. Entirely new to programming so if it's obvious, forgive me.

Won't recognise code like System.out.printn, .toString etc.

Although, it was working previously. I'm bewildered as to why it's just stopped working.
>>
Barnaby Claywill - Fri, 31 Jan 2014 11:59:19 EST ID:QhBNOwJO No.30849 Ignore Report Quick Reply
>>30848
What's the syntax error? Are you trying to one package use another package's code? What's your exact code? (Maybe post it to pastebin.com ? )
>>
John Cullernut - Fri, 31 Jan 2014 15:50:17 EST ID:6GeL5+RM No.30851 Ignore Report Quick Reply
>>30849

I ended up deleting the library and creating a new one from the JRE library. All was working, code was recognised etc but for some reason my college are working on an older version. Since I'm working on a new version, it doesn't even detect the MainController class, even though it is most definitely there.


Advanced webpage background images by Henry Clobberstere - Tue, 28 Jan 2014 07:28:00 EST ID:SU8tfDUG No.30834 Ignore Report Reply Quick Reply
1390912080024.jpg -(7436 B, 294x171) Thumbnail displayed, click image for full size. 7436
Is there a way to make a .gif the background of a webpage AND stretch it out so the image borders and touching the webpage borders WHILE staying in a the original ratio?

pic unrelated
>>
William Henkinlot - Tue, 28 Jan 2014 08:07:11 EST ID:V2gwkTy9 No.30835 Ignore Report Quick Reply
Set these attributes on the class:

background-repeat: no-repeat;
background-size: 100%;

Read this: http://www.w3schools.com/cssref/css3_pr_background-size.asp
And play around with this : http://www.w3schools.com/cssref/playit.asp?filename=playcss_background-size&preval=cover
>>
William Henkinlot - Tue, 28 Jan 2014 08:12:18 EST ID:V2gwkTy9 No.30836 Ignore Report Quick Reply
>>30835
This also works: background-size: cover;

I'm not sure if this is what you want; Your sentence is ungrammatical, and you didn't provide a picture of what you want.
>>
Cyril Wibberbanks - Wed, 29 Jan 2014 19:24:39 EST ID:TEB5/GbU No.30842 Ignore Report Quick Reply
>>30836
This is the correct answer. For posterity you'll want to add additional background-size properties with the -moz- and -wekbit- prefixes. There's a couple of polyfills available for older versions of IE (8 and below, I think) should you need them.

Also, Mozilla Developer Network > W3Schools.


JAR files and Eclipse by Phineas Tillingway - Tue, 28 Jan 2014 21:04:53 EST ID:NDFKFNiC No.30839 Ignore Report Reply Quick Reply
1390961093443.png -(215559 B, 500x357) Thumbnail displayed, click image for full size. 215559
my prof had us download a jar file, then create a eclipse java project to be based on the jar
i have created the java project
how do i put the the jar and src files into the java project directory?
>>
Nigel Bondledadge - Tue, 28 Jan 2014 23:30:03 EST ID:xtelIQ1k No.30840 Ignore Report Quick Reply
You can put the jar wherever you want, though I would recommend a dedicated /libs directory in the project if that's what it is. You're probably supposed to import the jar into the build path manually. Eclipse has a wizard for this.
>>
Nigel Bondledadge - Tue, 28 Jan 2014 23:31:02 EST ID:xtelIQ1k No.30841 Ignore Report Quick Reply
1390969862938.png -(17901 B, 500x420) Thumbnail displayed, click image for full size. 17901
>>30840
Sorry, not a wizard. But it's not hard.


Making a Client-Server Program by Fuck Dashstock - Mon, 27 Jan 2014 02:56:32 EST ID:V2gwkTy9 No.30823 Ignore Report Reply Quick Reply
1390809392038.jpg -(144095 B, 800x564) Thumbnail displayed, click image for full size. 144095
Let's pretend that I'm making a simple client-server program. The client connects to the server, sends it some data, the server receives it, computes something with it, and sends back the result. Writing code to do this, is simple, but tricky, because the server must be waiting to receive x when the client is sending it. This leads to writing code like this:

[code]clientActs():
connectToServer()
sendData()
receiveNewData()

serverActs():
waitForClientToConnect()
receiveData()
computeNewData()
sendNewData()[/code]

This is fine when the program is small, but gets unwieldy as the program gets larger, because you could accidentally mess up the order of the functions and then the program would then fail at run-time, because the client would be sending x, but the server isn't waiting to receive it, or is waiting for y instead, etc.
Comment too long. Click here to view the full text.
1 posts omitted. Click Reply to view.
>>
William Biblingmot - Mon, 27 Jan 2014 22:21:05 EST ID:kv8bxsSs No.30826 Ignore Report Quick Reply
1390879265074.jpg -(165050 B, 492x700) Thumbnail displayed, click image for full size. 165050
>You will want to use threads for your server.
or fork.

i recommend using a plain text, line based protocol. usually, upon connection, the server will send a CRLF terminated banner advertising the server name/version, and will then read/parse/process each command/line sent by the client. multi lines are terminated with a delimiter of some sort (e.g., '.' all alone on a line).

using CRLF terminated commands and responses makes it easy to use existing standard library functions to read/send/parse lines of text. it also makes it very easy to talk to your server and debug it using telnet or netcat.

for example, the SMTP email protocol: http://www.ietf.org/rfc/rfc0821.txt
or the text based interface to Freenet: https://wiki.freenetproject.org/FCPv2
>>
Lillian Gerrysedge - Mon, 27 Jan 2014 23:15:36 EST ID:JPqQ1rIF No.30828 Ignore Report Quick Reply
You want an app hosted somewhere that has an API/Json feeds the client uses. The client needs a TLS cert pinned, and double check inputs/sanitize. Done.

Client server would be any linux X program like Xorg with multiusers but sounds like you want API
>>
William Henkinlot - Tue, 28 Jan 2014 02:39:50 EST ID:V2gwkTy9 No.30832 Ignore Report Quick Reply
I think everybody is misunderstanding what I was asking, so I'll try to explain it better.

>>30824
>You will want to use threads for your server.
So your server is always waiting for a client to connect and when one does, the server creates a thread to deal with them and continues to wait for the next client
Okay, but how does that help me write the program? I mean, I want to be able to write something like this:

protocol():
..connect {client -> server}
..sendData {client -> server}
..computeNewData {server}
..sendNewData {server -> client}

And then the compiler would create/derive the code that I posted in the first post for both the client and the server.

If you must know, the project that I'm currently working on is a client/server game written in Haskell, but I've written client/server programs in Java before, and they suck in the same way.
>>
Polly Grandwill - Tue, 28 Jan 2014 06:57:16 EST ID:vhgZIlcV No.30833 Ignore Report Quick Reply
>>30832
In C (and ghc-haskell with CPP extension) you can do #ifdef's.
It's not clean, but as far as I know it's the only solution to get two different executables from one single source file.

protocol():
#ifdef CLIENT
..connect
#else
..acceptConnection
#end
#ifdef CLIENT
..sendData
#else
..receiveData
#end
Comment too long. Click here to view the full text.
>>
William Henkinlot - Tue, 28 Jan 2014 17:58:32 EST ID:V2gwkTy9 No.30838 Ignore Report Quick Reply
>>30833
This won't work if the program is supposed to talk to another instance of itself. (Like a p2p program, or a game where one person hosts and the other/s then join it.)

Also, you meant to use 'data', not 'type' in your Haskell code.


LITERATURE by tq - Wed, 15 Jan 2014 18:08:45 EST ID:gOMcofnz No.30749 Ignore Report Reply Quick Reply
1389827325395.jpg -(36128 B, 599x439) Thumbnail displayed, click image for full size. 36128
What the best or most useful programming/IT book you've encountered??? pic unrelated
5 posts and 2 images omitted. Click Reply to view.
>>
Barnaby Cishfoot - Sat, 18 Jan 2014 05:20:07 EST ID:wL/GHLf9 No.30761 Ignore Report Quick Reply
1390040407908.jpg -(182801 B, 501x648) Thumbnail displayed, click image for full size. 182801
Pretty much all of Andy Tanenbaum's books are a godsend if you're trying to teach yourself about operating systems or networking. "Operating Systems: Design and Implementation" is in its 3rd edition right now. Not only does it cover OS mechanics in excruciating detail, it uses MINIX 3 (open-source and fully POSIX compatible) as a usable reference for messing with all the concepts hands-on instead of just reciting vague theory. The back of the book even has the complete source code listing.

After that, pretty much anything written by Brian Kernighan and the OG Bell Labs crew responsible for UNIX. I'd especially recommend "The Elements of Programming Style" with Kernighan and P.J. Plauger.
>>
Charlotte Cullywill - Tue, 21 Jan 2014 22:54:54 EST ID:KMcHoWpo No.30771 Ignore Report Quick Reply
How much math/programming experience do I need to comprehend SICP?

I've heard all sorts of things about it, but what makes it so special?
>>
Caroline Fiddleweck - Sun, 26 Jan 2014 01:11:46 EST ID:+NhFDcub No.30817 Ignore Report Quick Reply
>>30757
Do the exercises, they are fun.
>>
Lillian Gerrysedge - Mon, 27 Jan 2014 23:26:01 EST ID:JPqQ1rIF No.30829 Ignore Report Quick Reply
>>30771

SICP is special because it teaches you how to functionally program, demystifies OOP so it doesn't seem like magic later when you do C++/Objective C or similar object oriented programming, teaches you complete theory like what recursion is, what concurrency is, what a garbage collector does ect. This will all come in handy later when you learn another language.

You don't need any math actually. There is some lambda calculus but it's not hard to figure out or just take Calculus single variable and go back and do the questions you didn't understand. I managed to do it with just a pre-calculus highschool education. There is actually a Lisp rebirth going on, the latest language du-jour is Julia, which is essentially common lisp. They go on and on how "amazing" it is you can decontruct functions in Julia but you've been able to do that in Lisp for 55 years. More companies are looking for scheme hackers or people who have done SICP to seperate from the hoards of java programmers, there's also D-wav and other quantum computer prototypes who are running full Lisp operating systems, so even the Lisp machine is back.
>>
Lillian Gerrysedge - Mon, 27 Jan 2014 23:34:46 EST ID:JPqQ1rIF No.30831 Ignore Report Quick Reply
MIT put this online yesterday, 45 free books
https://mitopencourseware.wordpress.com/ocw-bookshelf/


Python or Rails? by Basil Decklebeg - Wed, 01 Jan 2014 20:04:42 EST ID:1GEL4F5Q No.30665 Ignore Report Reply Quick Reply
1388624682476.jpg -(392977 B, 1400x1400) Thumbnail displayed, click image for full size. 392977
Looking to learn a language only with experience in HTML, very tiny tiny bit of VB. The two options that seem most appealing are Ruby on Rails or Python. I don't know which to choose though. Rails seems appealing for it's utilization in web apps, but I want to learn something that has practical use outside of the web. I don't think rails will give me that (I dont know, exactly, if it has that potential). That's what appeals to me about Python, which can be used in a number of ways. What do you guys think? Will me in.
>>
Betsy Chaggleridge - Wed, 01 Jan 2014 21:51:45 EST ID:PJBSN/AA No.30666 Ignore Report Quick Reply
Rails won't give you any experience outside the web, but Ruby will.
>>
Fuck Dashstock - Mon, 27 Jan 2014 02:03:23 EST ID:V2gwkTy9 No.30822 Ignore Report Quick Reply
>>30665
Ruby on Rails is not a language. Ruby is a language. Ruby on Rails is a web framework written in Ruby.

Likewise, Python is a language. Django is a web framework written in Python.

Either is a good language to learn as your first language, because it's easy get help because they're widely known/used and have good documentation.

Once you know your first language, learning another is already 90% done, unless you're switching to a completely new paradigm.


About not use frameworks by Angus Masslebury - Sun, 26 Jan 2014 14:43:49 EST ID:VznKjed0 No.30819 Ignore Report Reply Quick Reply
1390765429010.jpg -(101715 B, 450x406) Thumbnail displayed, click image for full size. 101715
Hi guys,
Im PHP web developer first of all
How dub m i for not use any webframework in php?
I like do write all the code, its so fun.
>>
George Demmerworth - Sun, 26 Jan 2014 18:22:39 EST ID:xtjaaXGq No.30820 Ignore Report Quick Reply
Whats with these shitty trollposts in /prog/ recently?

nb


Just a few words of my feel by Hedda Hundledock - Sat, 25 Jan 2014 11:18:06 EST ID:sI7IJaVy No.30811 Ignore Report Reply Quick Reply
1390666686012.jpg -(19415 B, 500x380) Thumbnail displayed, click image for full size. 19415
Comment hey guys,
i came here to talk how much i get proud when of my code when i finish an website project.
I love my 'job' (because i dont have to work none day of my life) i love programming, i love pussy.
Fuck yeah dudes!
I hate my life.
>>
Fanny Grimfield - Sat, 25 Jan 2014 13:38:27 EST ID:wL/GHLf9 No.30812 Ignore Report Quick Reply
1390675107353.png -(82496 B, 500x375) Thumbnail displayed, click image for full size. 82496
How high are you right now OP.
>>
Hedda Hundledock - Sat, 25 Jan 2014 18:39:43 EST ID:sI7IJaVy No.30814 Ignore Report Quick Reply
>>30812
i was so fucking hidg dude. You can't imagine how much.
>>
Hedda Hundledock - Sat, 25 Jan 2014 18:41:34 EST ID:sI7IJaVy No.30815 Ignore Report Quick Reply
>>30813
Dude, this curse is awesome! did u complete this shit?


<<Last Pages
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Report Post
Reason
Note
Please be descriptive with report notes,
this helps staff resolve issues quicker.