Search found 50 matches

by Laguana
Tue Jul 03, 2012 4:35 am UTC
Forum: Coding
Topic: What Fun and Useful Programming Language Should I Learn?
Replies: 39
Views: 13791

Re: What Fun and Useful Programming Language Should I Learn?

Prolog isn't even that great of a logic language. It's pretty much just the the type level of Haskell, with even wonkier syntax. It's even Turing-complete, so using it as a basis for formal proof is out of the question. Why do you say that? There are even some very effective theorem provers written...
by Laguana
Mon Feb 20, 2012 1:01 pm UTC
Forum: Computer Science
Topic: Proving Correctness of Algorithm using Hoare
Replies: 5
Views: 2718

Re: Proving Algorithm using Hoare

You've been asked to prove anything at all? Sounds strange to me, unless it is more of a "Play around with this new idea to get used to it" type of question. Some thoughts: Pick something that is purely stack based. Hoare logic does not cope well with the heap/pointers. Pick something simp...
by Laguana
Fri Feb 17, 2012 8:48 am UTC
Forum: Computer Science
Topic: Lambda expressions and parentheses
Replies: 3
Views: 3645

Re: Lambda expressions and parentheses

The way I recall it being first presented, parentheses were separate. Really all they do is disambiguate a flattened parse tree. Once you have a parse tree, they add nothing to it. This is purely anecdotal, but in my experience it is common to treat application as left-associative (that is, "a ...
by Laguana
Sat Feb 04, 2012 7:17 am UTC
Forum: Computer Science
Topic: Would this be context free or regular
Replies: 22
Views: 5434

Re: Would this be context free or regular

a_1_a_5 wrote:whatt its...regular....??


I could also say "Of course it isn't regular, it's obvious", and be equally unhelpful. My point is without a proof (and you haven't said what proof tools you have available) then claims are useless.
by Laguana
Fri Feb 03, 2012 4:50 am UTC
Forum: Computer Science
Topic: Would this be context free or regular
Replies: 22
Views: 5434

Re: Would this be context free or regular

What things do you know about regular languages and context free languages? What theorems do you know? What ways of proving them do you know? Without knowing where you are working from, we can't really help you. I could say "Of course this language is regular, it is obvious", but that does...
by Laguana
Fri Feb 03, 2012 4:24 am UTC
Forum: Computer Science
Topic: Would this be context free or regular
Replies: 22
Views: 5434

Re: Would this be context free or regular

Something I always find helpful when working with grammars is to try to break them. For example, I can prove that the CFG you give there is incorrect, since it allows for this string: c e which obviously has 1 > 3*0 occurrences of c. What everyone was saying earlier is more important though: Constru...
by Laguana
Sat Jan 28, 2012 5:29 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010045

Re: Coding: Fleeting Thoughts

Anything which installs the JRE won't work, since the server deliberately doesn't have java on it for security reasons. I think that means that jsmooth won't work for me either (also jsmooth seems to be windows based, and the server runs linux).

Maybe I can poke at the source until gcj likes it...
by Laguana
Sat Jan 28, 2012 12:39 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010045

Re: Coding: Fleeting Thoughts

I don't suppose anyone here knows how to make a native executable from a java project? I'm updating a java program, and previously it had been made into a native 32bit executable for a server without the JRE, but the previous author can't remember how they did it. I've tried gcj, but it gives compil...
by Laguana
Sat Jan 28, 2012 12:36 am UTC
Forum: Coding
Topic: Halp how do I LaTeX?
Replies: 4
Views: 1635

Re: Halp how do I LaTeX?

Another option here is to use the array or table environments. That lets you explicitly left or right align things within the table, and you can space out the table either explicitly using things like \; or \hphantom{}, or using \hfill to make it left/right aligned on the whole page.
by Laguana
Fri Jan 27, 2012 2:38 am UTC
Forum: Mathematics
Topic: Open Problems in Logic?
Replies: 4
Views: 1678

Re: Open Problems in Logic?

What kind of problem do you want to solve? Practical problems, or theoretical ones? I've personally been looking at implementing practical theorem provers for temporal and modal logics for the past two years, and I wouldn't call it a solved problem since some "real" problems I've tried are...
by Laguana
Thu Jan 19, 2012 11:02 pm UTC
Forum: Coding
Topic: Prolog help
Replies: 6
Views: 2822

Re: Prolog help

It's been a while since I did any serious prolog, but the way I think about things is that some predicates are suitable for generating canditate values, while others are only useful for restricting/testing candidate values. Something like "integer(X)" can determine whether something is an ...
by Laguana
Wed Jan 18, 2012 12:07 am UTC
Forum: Computer Science
Topic: Pattern analysis
Replies: 5
Views: 2094

Re: Pattern analysis

From a purely theoretical perspective, this reminds me of a universal AI which makes use of Kolmogorov complexity and occam's razor to try to learn how best to predict events. Essentially, given a prefix of some input, say "a b a b a b", it guesses that the sequence was generated by the si...
by Laguana
Fri Dec 30, 2011 12:42 am UTC
Forum: Coding
Topic: C++: Undefined symbols for architecture x86_64:
Replies: 5
Views: 8809

Re: C++: Undefined symbols for architecture x86_64:

The solution here is that you need to have the definition of the templated function in the header file, not just the declaration. This is a limitation of C++'s templating system. My understanding is that templated code is compiled as-required at compilation time (not link-time), so your utility.o wo...
by Laguana
Sun Dec 18, 2011 11:00 pm UTC
Forum: Coding
Topic: Mathematical Exactness
Replies: 13
Views: 3060

Re: Mathematical Exactness

I've heard of this kind of thing being done in haskell before: http://www.haskell.org/haskellwiki/Exact_real_arithmetic Essentially rather than storing a bitstring of the number in some base (fixed point numbers) or scientific notation (floating point numbers), you essentially store a way to calcula...
by Laguana
Wed Nov 30, 2011 3:14 am UTC
Forum: Coding
Topic: C Programming Problem [EASY]
Replies: 12
Views: 2390

Re: C Programming [EASY]

Your main error is that you don't store the names correctly. First though, I'd like to point out that since struct fileListD1 and struct fileListD2 are identical except for names, you should probably consider having only one struct definition, and store two lists of that type. But regardless of that...
by Laguana
Mon Nov 21, 2011 11:12 pm UTC
Forum: Computer Science
Topic: Strongly connected directed graph
Replies: 8
Views: 3514

Re: Strongly connected directed graph

A few thoughts: Every vertex in a "barely strongly connected" digraph must either have exactly one ingoing edge or exactly one outgoing edge. Is this true? A 3 vertex graph with vertices A B C and edges AB BA BC CB has vertex B with 2 incoming and 2 outgoing edges, but none of those are r...
by Laguana
Mon Nov 14, 2011 2:54 am UTC
Forum: Science
Topic: Can we make our own set of physics homework questions?
Replies: 14
Views: 2752

Re: Can we make our own set of physics homework questions?

I had some enjoyable assignments in physics which involved taking what we had been taught and doing some further research to answer some problems. One situation was along the lines of "You've been tasked by the winter Olympics to set up the ski jumping event. Unfortunately there's not much snow...
by Laguana
Thu Nov 10, 2011 12:37 pm UTC
Forum: Serious Business
Topic: The Assumptions of Searle’s Chinese Room Thought Experiment
Replies: 349
Views: 43966

Re: The Assumptions of Searle’s Chinese Room Thought Experim

However if you can show the AI can attach meanings to words then Searle's premise fails on his assumption. What meanings should be attached to words? If we imagine a "german room machine" with an englishman inside it (so I can talk about specifics), what meaning should be given to the wor...
by Laguana
Thu Nov 10, 2011 1:03 am UTC
Forum: Serious Business
Topic: The Assumptions of Searle’s Chinese Room Thought Experiment
Replies: 349
Views: 43966

Re: The Assumptions of Searle’s Chinese Room Thought Experim

You gave the program the board which implicitly forms the limits of the game(knowledge), you told it what a legal move was(knowledge), you told it the pieces(knowledge)but its knowledge is incomplete. Without the goal(lack of knowledge) the machine couldn't play the game. You had to supply an umpir...
by Laguana
Thu Nov 10, 2011 12:11 am UTC
Forum: General
Topic: Hifaleetin' thoughts
Replies: 90216
Views: 9234664

Re: Screechings of the Great Unwashed (Meander to the Morgue

Surely "balance" doesn't mean "everything must be as good as everything else". Some strategies must be worse off than others, otherwise what is the point? "My cunning plan is finally ready after all this time! Oh wait, their strategy of "have a couple of guys or somethi...
by Laguana
Wed Nov 09, 2011 10:59 pm UTC
Forum: General
Topic: Hifaleetin' thoughts
Replies: 90216
Views: 9234664

Re: Screechings of the Great Unwashed (Meander to the Morgue

You, sir, name? wrote:Because Red Alert is quite unbalanced.



It's basically who has the more tanks.


Doesn't that mean that it is in fact balanced?
by Laguana
Fri Nov 04, 2011 7:40 am UTC
Forum: Logic Puzzles
Topic: How much money?
Replies: 13
Views: 3378

Re: How much money?

And what if he charges you $x to enter?

Personally I'd be inclined to pick x ~= 2, but I'm not much of a gambler.
by Laguana
Thu Nov 03, 2011 12:07 pm UTC
Forum: The Help Desk
Topic: Defragging a mac?
Replies: 12
Views: 6096

Re: Defragging a mac?

Why do you think you need to defragment? I'm no expert, but if you are using HFS+ as your file system, then according to this experimental analysis , it tends to keep itself reasonably defragmented where possible, and manual defragmentation isn't trivial. I also found a more recent piece from apple ...
by Laguana
Thu Oct 27, 2011 8:04 am UTC
Forum: Coding
Topic: This JavaScript is driving me -mad-.
Replies: 8
Views: 2202

Re: This JavaScript is driving me -mad-.

This might be obvious, but have you tried using firebug (a firefox extension) to see what your javascript is actually doing? It should also allow you to play with things on-the-fly so you can say "what _is_ x at this point here" and try to track down exactly where things break.
by Laguana
Sun Oct 16, 2011 9:23 pm UTC
Forum: Coding
Topic: Self-Modifying Code
Replies: 5
Views: 3541

Re: Self-Modifying Code

In my experience python has some checks to avoid re-importing the same source-file more than once, so as-written I don't think what you've said will work out. Self-modifying code is not terribly common since it becomes difficult to reason about (see Malbolge for an extreme example), but I think that...
by Laguana
Tue Sep 20, 2011 11:14 pm UTC
Forum: Coding
Topic: Clever Code Puzzle
Replies: 17
Views: 2898

Re: Clever Code Puzzle

Alternate answer: It doesn't compile, since commas rather than semicolons were used in the for loop. [edit] I should probably say, I thought there was going to be some cute trick relying on that that I wasn't aware of; like the loop never executes or something and just does the initialisation step. ...
by Laguana
Wed Sep 07, 2011 11:28 pm UTC
Forum: Coding
Topic: Printing PDFs lags printers
Replies: 5
Views: 1338

Re: Printing PDFs lags printers

Have you tried playing with printer settings? There are some PDFs I have which are about 10MB on a hard drive which result in something like 100MB and many minutes wait when sent to a postscript printer. If I send it to the same physical printer but without using postscript, I think it was PCL inste...
by Laguana
Wed Sep 07, 2011 11:24 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010045

Re: Coding: Fleeting Thoughts

FT: Valgrind is giving me this message in my OpenGL/SDL application. Does anyone know if this is normal, or is there a problem with my video driver? ==25700== 262,132 bytes in 1 blocks are definitely lost in loss record 320 of 321==25700==    at 0x4C28FAC: malloc (vg_replace_malloc.c:236)==25700== ...
by Laguana
Tue Aug 23, 2011 12:30 am UTC
Forum: Coding
Topic: Why is my program so fast?
Replies: 8
Views: 2126

Re: Why is my program so fast?

I'm not familiar with all the windows-specific stuff you're doing there, but just from your bit of code at the end, I'm not surprised at all that very little is happening. Your program will write to 1% of whatever size it gets, which I'm guessing is going to be one of the processor caches, each seco...
by Laguana
Tue Jun 28, 2011 1:56 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010045

Re: Coding: Fleeting Thoughts

Sure, depending on what you want it to do, fairly easily I think. Draw everything to a texture (which is both displayed to the screen and eventually saved out as the resulting image; probably through another library since openGL doesn't deal with filesystem interactions), and do whatever operations ...
by Laguana
Mon Jun 20, 2011 6:17 am UTC
Forum: Coding
Topic: OpenGL blending functions.
Replies: 2
Views: 2027

Re: OpenGL blending functions.

Been a while since I looked into this, but hopefully I can explain a bit. The idea of the blend function is to give you control over how things are drawn over each other. Given that you are drawing a source colour (Rs,Gs,Bs,As) to a destination pixel with colour (Rd, Gd, Bd, Ad), what should the res...
by Laguana
Fri May 06, 2011 1:22 am UTC
Forum: The Help Desk
Topic: LaTeX Help
Replies: 5
Views: 1487

Re: LaTeX Help

I'm not sure I understand what you want. Do you want to produce a pdf without using latex, or do you want to write latex and convert to a pdf without invoking latex itself, or do you want to produce a pdf which looks like you made it with latex when you actually didn't? I would personally recommend ...
by Laguana
Sat Apr 30, 2011 5:26 pm UTC
Forum: Computer Science
Topic: Algorithms to Pseudo-code
Replies: 45
Views: 7649

Re: Algorithms to Pseudo-code

I'm not sure what language that is (the type decoration makes me think perl?) but the answer is "If you treat it like one". If there are / you write functions to perform matrix operations on it, then you can call it a matrix. Otherwise it is just a collection of numbers. Also, I believe th...
by Laguana
Thu Apr 28, 2011 1:03 pm UTC
Forum: Computer Science
Topic: Algorithms to Pseudo-code
Replies: 45
Views: 7649

Re: Algorithms to Pseudo-code

Yes, especially if you want it to be robust and efficient. There can be a vast difference between a correct mathematical equation and code to calculate the same value. As an example, e^x = \sum_{i=0}^\inf \frac{x^i}{ i!} . This is a correct mathematical statement, and so we might decide to calculate...
by Laguana
Thu Apr 07, 2011 3:07 am UTC
Forum: Computer Science
Topic: Runtime
Replies: 11
Views: 2231

Re: Runtime

Exponential runtimes ( 2^n or even 2^{2^n}} ) can arise from exploring trees, as well. For example, a binary tree n layers deep will have 2^n nodes. Another possibility is from determinising some algorithms. For example, propositional logic is in NP meaning it can be polynomial if you make the "...
by Laguana
Thu Apr 07, 2011 12:38 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1963
Views: 565988

Re: The "IT DOESN'T WORK!" thread

Well, one problem is you haven't actually instantiated the virtual functions: They are const in eventListener but not in listener, and so they don't override it. Once you fix that, you'll probably also have to give a constructor for listener which takes a gui as well. Pre-post edit: Beaten, I see. I...
by Laguana
Sat Mar 26, 2011 2:24 am UTC
Forum: Coding
Topic: Hexidecimal translations
Replies: 6
Views: 1000

Re: Hexidecimal translations

Certainly a lookup is the best option for converting number->hex character, since it can be in one nice big chunk rather than scattered about

Code: Select all

inline char hexlookup(unsigned char hex){
  return "0123456789ABCDEF"[hex%0xF];
}
by Laguana
Wed Mar 23, 2011 2:56 am UTC
Forum: Coding
Topic: Prank Code
Replies: 40
Views: 6616

Re: Prank Code

If you reverse the order of the bytes, it is "BEEP!\n\a", or BEEP! (bell character -> audible beep) repeated forever
by Laguana
Mon Feb 28, 2011 5:43 am UTC
Forum: Coding
Topic: Python: Arithmetic Expression as Argument?
Replies: 5
Views: 2179

Re: Python: Arithmetic Expression as Argument?

I haven't done this kind of thing myself, but you could do something like input = raw_input() input = sanitise_and_check(input) funcstr = "lambda x, y, z:" + input result_function = eval(funcstr) This is not particularly safe, which is why I suggest you make a "sanitise_and_check"...
by Laguana
Thu Feb 10, 2011 9:35 pm UTC
Forum: Computer Science
Topic: Supercomputing basics
Replies: 2
Views: 2138

Re: Supercomputing basics

I haven't done any supercomputing myself, but my university has a few set up and I've heard a bit about what they do. This is all from memory, and may be wrong etc. The answer is basically "it depends". There are lots of kinds of supercomputers, some of which use a global address space (pr...

Go to advanced search