Search found 278 matches

by Ben-oni
Tue Sep 26, 2017 5:01 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1894: "Real Estate"
Replies: 28
Views: 4968

Re: 1894: "Real Estate"

So, I take it things have been looking up since the drill incident?
by Ben-oni
Fri Sep 15, 2017 9:53 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1890: "What to Bring"
Replies: 70
Views: 16761

Re: 1890: "What to Bring"

All JNF matrices must be upper triangular. Please fix. Your test will not be graded until this is remedied. Thank you. Also, not quite sure what your eigenvalues are. Please clarify.
by Ben-oni
Mon Sep 23, 2013 7:18 pm UTC
Forum: Coding
Topic: Light-weight library for generating images (C++ or python)
Replies: 12
Views: 4943

Re: Light-weight library for generating images (C++ or pytho

As 2Ring mentioned, SVG is a fairly straightforward XML format for vector graphics. Since you don't need a gui, I'd suggest using that as it has the shortest learning curve. No need to learn a library/language/etc to get going. Learn the basics by writing text files and opening them as images, then ...
by Ben-oni
Fri Sep 20, 2013 8:46 pm UTC
Forum: Coding
Topic: Safely executing unkown code
Replies: 23
Views: 5303

Re: Safely executing unkown code

A language with integer variables, an addition operator and a while loop is already turing complete (apart from having limited memory which applies to all programming languages in the real world). I don't know where you're getting your information, but this is not the case. The language must also h...
by Ben-oni
Thu Aug 01, 2013 10:01 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010834

Re: Coding: Fleeting Thoughts

and that's not something that you likely want your optimizer doing for you in the general case IMO. Unless, as I said, you turn it on. Besides, in terms of what's a buzzword, "dynamic programming" is an older term than "memoization." It would be more accurate to say that "m...
by Ben-oni
Thu Aug 01, 2013 7:58 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010834

Re: Coding: Fleeting Thoughts

Dynamic programming in python how-to: ⋅ Step 1: write a recursive function ⋅ Step 2: @memoize it ⋅ Step 3: profit Correct. Dynamic programming is a "buzz word" for memoization. When I was first reading about this fancy "dynamic programming" some yea...
by Ben-oni
Fri Jul 26, 2013 6:26 pm UTC
Forum: Coding
Topic: What is a model?
Replies: 25
Views: 7115

Re: What is a model?

Have you even used Objective-C? It's a strict superset of C, meaning that there are no compatibility sacrifices whatsoever. C programs run just fine under Objective-C without any modification. (The same cannot be said of C++, which did sacrifice compatibility). No, I haven't used objective-C. Since...
by Ben-oni
Fri Jul 19, 2013 4:16 pm UTC
Forum: Coding
Topic: Synchronising floppy drives for audio
Replies: 4
Views: 4719

Re: Synchronising floppy drives for audio

As korona said, don't block. In general, threading is a bad idea for this sort of real-time problem because you can't control the timing of the threads. Unless you also controlled the scheduler, which is a lot of extra work. Fibers are a much better solution, and won't require much reworking of your...
by Ben-oni
Thu Jun 13, 2013 9:12 pm UTC
Forum: Coding
Topic: Question about Chrome extensions
Replies: 6
Views: 3591

Re: Question about Chrome extensions

Xeio wrote:The main tick would be figuring out how to tell chrome what you want the window name to be when unfocused.

That's easy. Check to see if the active page has been bookmarked within a group. When out of focus, the window's name should be the name of the parent.
by Ben-oni
Sun May 26, 2013 4:17 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1216: "Sticks and Stones"
Replies: 73
Views: 18488

Re: 1216: "Sticks and Stones"

It feels like Randall is trying to make an argument for criminalizing speech. It also looks like he's trying to say verbal abuse is worse than physical abuse. This is not so. I won't speak for emotional abuse, but I defy anyone to present a case of physical abuse that isn't also emotional abuse. The...
by Ben-oni
Fri Apr 19, 2013 5:18 pm UTC
Forum: Coding
Topic: Understanding Haskell.Maybe
Replies: 5
Views: 7910

Re: Understanding Haskell.Maybe

This is the error-checking function, so the appropriate level should probably be here. Thanks for the case suggestion; that takes care of it quite neatly. (The missing "Just" in the other function was a copying error; it wouldn't have compiled that way.) *facepalm* The Maybe monad is the ...
by Ben-oni
Thu Apr 18, 2013 7:19 pm UTC
Forum: Coding
Topic: Understanding Haskell.Maybe
Replies: 5
Views: 7910

Re: Understanding Haskell.Maybe

I need to "de-Maybe" a value. -- return the first duplicate found in a sorted list. firstDuplicate [] = Nothing firstDuplicate [x] = Nothing firstDuplicate (x:y:z) | x == y = x | otherwise = firstDuplicate (y:z) -- return y if there are no duplicates in x, otherwise print an error. noDupl...
by Ben-oni
Wed Apr 17, 2013 4:34 am UTC
Forum: News & Articles
Topic: Kermit Gosnell - aka why abortion clinics need oversight
Replies: 39
Views: 6095

Re: Kermit Gosnell - aka why abortion clinics need oversight

As I said, this is Serious Business. I'll try to avoid devolving into arguing abortion in general, but stick to how this case impacts that debate. Undoubtedly my opinions on that matter inform those on this, but it would be impossible to understand this case while taking a neutral stance. Furthermor...
by Ben-oni
Wed Apr 17, 2013 1:51 am UTC
Forum: News & Articles
Topic: Kermit Gosnell - aka why abortion clinics need oversight
Replies: 39
Views: 6095

Re: Kermit Gosnell - aka why abortion clinics need oversight

I don't see any particular reason to believe this case will be terribly important. I have difficulty imagining that this case will set any precedents or significantly change current laws. It will perhaps convince governments to cough up some money for more inspections of facilities, but I have a ha...
by Ben-oni
Tue Apr 16, 2013 11:15 pm UTC
Forum: Coding
Topic: New to C: Please help!
Replies: 5
Views: 8047

Re: New to C: Please help!

I wrote a 32-bit multiply function for you, but it was too long and the forums wouldn't let me upload it. So here it is implemented with macros (you can pre-process the macros before submission with gcc -E): int multiply(int x, int y) { #define ADD_1(C, X, Y) ((C^X^Y)&0x1) #define ADD_1_C(C, X, ...
by Ben-oni
Tue Apr 16, 2013 3:31 pm UTC
Forum: News & Articles
Topic: Kermit Gosnell - aka why abortion clinics need oversight
Replies: 39
Views: 6095

Re: Kermit Gosnell - aka why abortion clinics need oversight

This trial has little to do with oversight. The issue is culture. Perhaps this was the worst of clinics in the state. If the Department of Health wouldn't shut it down, then what does it take for them to act? Are the regulators and inspectors so unwilling to act against any abortionist that it takes...
by Ben-oni
Thu Apr 11, 2013 5:08 pm UTC
Forum: Coding
Topic: Daft Punk - experiment in efficiency
Replies: 34
Views: 16790

Re: Daft Punk - experiment in efficiency

Oooh, are we playing golf? Slight optimization: #include <stdio.h> char* w[] = {"", "", "Do", "Over", "After", "Faster", "Hour", "Stronger", "Makes", "Is", "Never", "Harder", "...
by Ben-oni
Wed Apr 10, 2013 7:14 pm UTC
Forum: Coding
Topic: List searching Java
Replies: 6
Views: 7655

Re: List searching Java

It's generally not advisable to cache a database locally. Either a) it's large, and you should only query what you need at the moment, or b) it's small, and you can query all you want. On occasion, it may be desirable to cache certain result sets. But remember, "Only optimize after the program ...
by Ben-oni
Tue Apr 09, 2013 8:48 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010834

Re: Coding: Fleeting Thoughts

Probably not.It's closer to "Technical Writing". Then again, legal writing is a field unto itself... There are patterns and idioms you have to understand first, but it's usually not too bad.

Imagine trying to describe laws in a formal side-effect free language...
by Ben-oni
Thu Mar 21, 2013 11:26 pm UTC
Forum: Coding
Topic: Scripts for Websites
Replies: 4
Views: 8437

Re: Scripts for Websites

And if you want to run your script every day, look into setting up a cron job.
by Ben-oni
Wed Mar 20, 2013 7:05 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010834

Re: Coding: Fleeting Thoughts

Because there is an upper bound on the storage capacity of the (observable) universe. While 2^2^15 is well within that bound, there's still a bound. No it isn't. At least, not from the numbers I find from Google, which estimate it the information capacity of the observable universe to be around the...
by Ben-oni
Tue Mar 19, 2013 4:49 pm UTC
Forum: Coding
Topic: How to use Python to control computer?
Replies: 13
Views: 14533

Re: How to use Python to control computer?

First, learn how the interwebs work. You don't want to automate a browser. [b]Do not do this[/i]. You want to download html from a url, which is easy to do in just about any language with the right library. Inserting data into Excel is likewise a terrible idea. You'd be better off adding rows to a C...
by Ben-oni
Tue Mar 19, 2013 4:40 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010834

Re: Coding: Fleeting Thoughts

More complicated examples can occur too; e.g. in Python x = input() if x: y = 5 else: y = [1,2,3] if x: y += 6 else: y.append(7) Same sorts of things would apply to typed assembly languages. I see no problem here. y is a union of integral and list types. Why would this be rejected? Nobody needs mor...
by Ben-oni
Mon Mar 11, 2013 10:16 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010834

Re: Coding: Fleeting Thoughts

Wait, is that Python you're implemented in? ( I wish I was implemented in Python, I could do with some monkey patching. ) Stresses never overload in Python: it transparently switches to arbitrary precision stresses. So you don't have to worry about an exception, you'll just eventually fill up your ...
by Ben-oni
Mon Mar 11, 2013 10:03 pm UTC
Forum: Coding
Topic: Which programming language do you recommend ?
Replies: 12
Views: 9409

Re: Which programming language do you recommend ?

Java is ideal for only a very small subset of problems. The language is semantically poor, though the libraries are nice. It is not suitable for desktop application programming. Is it really necessary to pollute the thread with blatant disinformation? Look at all those unsolved problems! There are ...
by Ben-oni
Fri Mar 08, 2013 5:44 am UTC
Forum: Coding
Topic: Which programming language do you recommend ?
Replies: 12
Views: 9409

Re: Which programming language do you recommend ?

Java is ideal for only a very small subset of problems. The language is semantically poor, though the libraries are nice. It is not suitable for desktop application programming. "High operating speed" is not a requirement. "High" in relation to what? "Must be responsive"...
by Ben-oni
Wed Feb 27, 2013 5:05 pm UTC
Forum: Coding
Topic: Dealing with complexity in excel spreadsheets
Replies: 5
Views: 3015

Re: Dealing with complexity in excel spreadsheets

If data integrity is truly important, use a database. You might consider linking a spreadsheet to a database, so it automatically populates. This would give you good tools for data-management, and also give end users good flexibility in how they can use the data and crunch numbers.
by Ben-oni
Tue Feb 26, 2013 11:43 pm UTC
Forum: Coding
Topic: Blog & Photo Integration on Website
Replies: 22
Views: 14964

Re: Blog & Photo Integration on Website

Just take it piece by piece. Do you have any idea how to do a slide show? If not, find out how it might be done. Ask for help if you've tried a few things and are stuck. See if you can get a simple cart going. Don't worry about how it links with the rest of the site yet, just get it working. Then li...
by Ben-oni
Tue Feb 26, 2013 2:56 am UTC
Forum: Coding
Topic: Implementing a Linked List in the Heap
Replies: 19
Views: 21340

Re: Implementing a Linked List in the Heap

heap is pretty much the default. it would be more interesting, if useless, to know how to implement a linked list on the stack ... If you can't use the heap, that leaves you with static memory and the stack, and you probably have to allocate your stack statically anyways. So, push most of the memor...
by Ben-oni
Mon Feb 25, 2013 4:28 pm UTC
Forum: Coding
Topic: Dealing with complexity in excel spreadsheets
Replies: 5
Views: 3015

Re: Dealing with complexity in excel spreadsheets

My own opinion is that excel is suitable for small data-driven tools that don't need to do much. Data and logic are tightly coupled. If you start to encounter complexity, jump up a step and use Access. I would recommend doing this instead of pushing all the logic into macros. That at least eliminate...
by Ben-oni
Tue Feb 19, 2013 7:21 pm UTC
Forum: Coding
Topic: BUT WHO WAS PIXELS
Replies: 5
Views: 8505

Re: BUT WHO WAS PIXELS

cemper93 wrote:Also note that without getting a (much) deeper understanding of Mathematics first, you will not be able to understand the JPG format

FTFY
by Ben-oni
Mon Feb 18, 2013 9:57 pm UTC
Forum: Coding
Topic: Dear Coders *user request*
Replies: 8
Views: 3326

Re: Dear Coders *user request*

Please understand, software development is more complex than you make it out to be. User interfaces are not designed by programmers, but by committees and bureaucracies. A single programmer working on a project will usually develop a simple and easy to use interface. Then a committee appears, and yo...
by Ben-oni
Thu Feb 14, 2013 7:15 pm UTC
Forum: Coding
Topic: Named operators in C++
Replies: 18
Views: 4864

Re: Named operators in C++

I think it's cute. It's looking more and more like Haskell. Next thing you know he'll have full blown typeclasses and monads in C++.
by Ben-oni
Fri Feb 08, 2013 11:37 pm UTC
Forum: Coding
Topic: Writing My Own Logic Gates in Python
Replies: 32
Views: 8930

Re: Writing My Own Logic Gates in Python

Carlington wrote:

Code: Select all

    gatelist = {0: exit(), 1: LogicGateAND(), 2: LogicGateOR(), 3: LogicGateNOT()}

Python doesn't do lazy evaluation, so each value entered into the dictionary is completely evaluated at this moment. I bet you can guess what happens.
by Ben-oni
Tue Feb 05, 2013 5:54 pm UTC
Forum: Coding
Topic: Comp lang for real time, distributed, fault-tollerant app
Replies: 5
Views: 2062

Re: Comp lang for real time, distributed, fault-tollerant ap

A significant part of choosing a language in which to program depends on the system specifications. Will this run on an RTOS, or a PC? How much memory is available? What response times are acceptable, and how fast will the processor be going?
by Ben-oni
Tue Feb 05, 2013 1:28 am UTC
Forum: Coding
Topic: Writing My Own Logic Gates in Python
Replies: 32
Views: 8930

Re: Writing My Own Logic Gates in Python

As far as exceptions go, disregarding overhead (which is implementation dependent), they need not be exceptional. As Java so verbosely explains, exceptions are merely part of the return type of a function. When used as such, it's quite safe to use them ubiquitously. To the problem at hand, however, ...
by Ben-oni
Tue Jan 29, 2013 9:53 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010834

Re: Coding: Fleeting Thoughts

Visual Studio, why you no do C? #define X(A) A #define Y(A) X A Y((double)val); => doubleval; // should be "double val;" #define W(A, ...) A(__VA_ARGS__) #define Z(...) W(__VA_ARGS__) Z(printf, "Hello, Microsoft!"); => printf, "Hello, Microsoft!"(); // should be "p...
by Ben-oni
Thu Nov 01, 2012 2:33 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1118: "Microsoft"
Replies: 134
Views: 39021

Re: 1118: "Microsoft"

This comic has bothered me since I first read it. I think now I can put my thoughts together coherently. "Imagine the future we'd live in..." Randall thought he was being snarky by showing that had events been otherwise, we might have looked with dread upon the world we have today. This mo...
by Ben-oni
Sat Sep 22, 2012 11:29 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010834

Re: Coding: Fleeting Thoughts

What about an object that could be used in lieu of a float/integer, and behaved in a particular way for equality tests--always returning true, for example? Sticking the object inside of a vector's component would then allow you to define something like 'V(3,OBJ,8)' (obj is the equality object), whi...
by Ben-oni
Mon Sep 10, 2012 2:36 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2010834

Re: Coding: Fleeting Thoughts

[disclaimer: It's probably obvious, but I don't know anything about graphics] So they use "degenerate" 4-vectors so they can translate 3D points by rotating/reflecting them through 4D space? That's interesting and kind of elegant, but what's the gain exactly that's great enough to justify...

Go to advanced search