Search found 1330 matches

by hotaru
Wed Jun 03, 2015 3:14 am UTC
Forum: The Help Desk
Topic: Linux equivalent of Windows's calc?
Replies: 6
Views: 6416

Re: Linux equivalent of Windows's calc?

"obase=16;-256" produces -100. (And yes, I could do the 2's complement arithmetic manually. The point of this is to avoid that.) of course it does. if you really want a signed, fixed-size integer reinterpreted as an unsigned integer and printed in hexadecimal, why not just do 'printf &quo...
by hotaru
Tue Jun 02, 2015 11:27 pm UTC
Forum: The Help Desk
Topic: Linux equivalent of Windows's calc?
Replies: 6
Views: 6416

Re: Linux equivalent of Windows's calc?

bc? it doesn't have a way to limit the width of calculations, but you can just do something like "(...)%2^16". for more advanced calculations, gp is really nice.

also gnome-calculator does let you change bases if you switch it to "Programming Mode".
by hotaru
Tue Jun 02, 2015 11:03 pm UTC
Forum: Computer Science
Topic: Deliberately bad algorithms
Replies: 120
Views: 65566

Re: Deliberately bad algorithms

Code: Select all

factorial = product . enumFromTo 1
isPrime n = factorial (n - 1) `mod` n == n - 1
by hotaru
Sun May 31, 2015 11:57 pm UTC
Forum: Coding
Topic: Tipps for Android app server communication?
Replies: 15
Views: 3955

Re: Tipps for Android app server communication?

on a 32-bit system: type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes sha384 600.59k 2398.31k 4809.95k 7637.73k 9310.36k sha256 3955.27k 9181.52k 16110.99k 19816.35k 21257.83k NIST P-256 verification is faster than 4096-bit (nowhere close to 7680-bit) RSA verification: sign verify sign/s verify...
by hotaru
Sun May 31, 2015 10:21 pm UTC
Forum: Coding
Topic: Tipps for Android app server communication?
Replies: 15
Views: 3955

Re: Tipps for Android app server communication?

I'd disagree, there is no security advantage to using AES-128 over AES-256, nor SHA-256 over SHA-384. For AES, the performance difference is minor, but comes with more rounds so to better protect against future attacks, and on 64-bit systems SHA-384 is faster and more secure than SHA-256. Both RSA ...
by hotaru
Sun May 31, 2015 9:27 pm UTC
Forum: Coding
Topic: Useful applications of recursion?
Replies: 19
Views: 5674

Re: Useful applications of recursion?

And in certain imperative cases, TCO is legit? Why would it ever not be legit? TCO has no effect on result, side effects, or order of execution of a function. It's an entirely safe optimization. The main argument against it (the only one that I'm aware of) is that by optimizing out the call stack i...
by hotaru
Sun May 31, 2015 9:16 pm UTC
Forum: Coding
Topic: Tipps for Android app server communication?
Replies: 15
Views: 3955

Re: Tipps for Android app server communication?

You should look into severely restricting available cipher suites and TLS version. For example, only allow TLS v1.2 with TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 as the cipher suite. This should be done with both the client and the server to make sure that no one can downgrade security (see the recent...
by hotaru
Sat May 30, 2015 7:26 am UTC
Forum: Coding
Topic: Useful applications of recursion?
Replies: 19
Views: 5674

Re: Useful applications of recursion?

these seem like pretty good uses of recursion to me... makeFibs :: (Integer, Integer) -> [Integer] makeFibs (a, b) = let f@(_:t) = makeFibs (a, b) in a : b : zipWith (+) f t twoFibs :: Integer -> (Integer, Integer) twoFibs 0 = (1, 0) twoFibs n = let (q, r) = divMod n 2 (a, b) = twoFibs q x = a * a +...
by hotaru
Fri May 22, 2015 6:47 pm UTC
Forum: Coding
Topic: Single Sign-on Shenanigans
Replies: 20
Views: 5796

Re: Single Sign-on Shenanigans

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E) maybe updating IE would help, but i wouldn't count on it. unless [CCSID] => 819 means more than I think it d...
by hotaru
Thu May 21, 2015 2:15 am UTC
Forum: The Help Desk
Topic: Windows 7 starting to run crappy.
Replies: 11
Views: 5395

Re: Windows 7 starting to run crappy.

did you install McAfee antivirus? if not, it's probably time to reformat and reinstall. Nope. I looked at the folder it (McCHSvc.exe) was in and it was created today. it's probably malware of McAfee wasn't intentionally installed. the "legitimate" McAfee software (which is just as likely ...
by hotaru
Thu May 21, 2015 12:38 am UTC
Forum: The Help Desk
Topic: Windows 7 starting to run crappy.
Replies: 11
Views: 5395

Re: Windows 7 starting to run crappy.

It started with longer boot times, but once it got booted, everything ran great. I only noticed today (wasn't here yesterday) that everything takes forever to do anything. Hell I just spent five minutes waiting on a paper to print. I made sure no huge programs loaded on boot; antivirus, STEAM, MySQ...
by hotaru
Sat May 16, 2015 8:51 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031484

Re: Coding: Fleeting Thoughts

signed integers have always seemed a bit weird to me. I've never encountered a situation where I've actually wanted to use one. when I do want to use negative numbers, I always want some sort of rational or floating point type instead of an integer type.
by hotaru
Wed May 13, 2015 6:36 pm UTC
Forum: Coding
Topic: Array of variable length arrays in C
Replies: 11
Views: 3631

Re: Array of variable length arrays in C

if ncols never changes once it's set, why not put the declaration after ncols is set?
by hotaru
Sat May 09, 2015 11:27 am UTC
Forum: Religious Wars
Topic: Tablets - iPad vs. MS Surface vs. Asus Transformer Prime
Replies: 26
Views: 38629

Re: Tablets - iPad vs. MS Surface vs. Asus Transformer Prime

The Surface is also the only one with handwriting recognition. I've written posts using a stylus before, and it works out pretty well. Not as good as a real keyboard of course, but I'd say its much better than anything iPad or Android has to offer. android has had handwriting input for a while... n...
by hotaru
Thu Apr 30, 2015 1:21 am UTC
Forum: Coding
Topic: Uniformly random doubles from [0, 1) in C
Replies: 11
Views: 4825

Re: Uniformly random doubles from [0, 1) in C

However, Hotaru’s version of the 32-bits-at-a-time approach ended up slightly slower than mine because it had to increment (and test!) an extra variable even when fewer than 12 coin-flips were required. My version has a single test to short-circuit the entire “difficult” branch when it’s not needed...
by hotaru
Wed Apr 29, 2015 11:07 am UTC
Forum: Coding
Topic: Uniformly random doubles from [0, 1) in C
Replies: 11
Views: 4825

Re: Uniformly random doubles from [0, 1) in C

Your method is quite clever, and appears to make every double in [0, 1) possible with probability proportional to the length of the interval from it to the next double. However, it does so at the cost of additional calls to arc4random for every entry. The first up-to-12 of those calls could be avoi...
by hotaru
Wed Apr 29, 2015 12:13 am UTC
Forum: Coding
Topic: Uniformly random doubles from [0, 1) in C
Replies: 11
Views: 4825

Re: Uniformly random doubles from [0, 1) in C

i see one thing that might be an issue... there are 2 62 doubles in [0, 1), but only 2 52 in [1, 2). I'd probably do something like this, but I'm not sure if it's actually better: void randomDoubleArray(double *v, const int n){ assert(sizeof(double) * CHAR_BIT == 64);  arc4random_buf(v, n * sizeof(d...
by hotaru
Tue Apr 14, 2015 4:03 am UTC
Forum: Religious Wars
Topic: Subject/Object/Verb ordering in code
Replies: 23
Views: 9874

Re: Subject/Object/Verb ordering in code

ahammel wrote:"Long" in the sense of "longer than two"

in that case, you might might need (flip .) in addition to flip... far from what i'd call unreadable.
by hotaru
Tue Apr 14, 2015 3:49 am UTC
Forum: Religious Wars
Topic: Free-for-all free font brawl [now with pictures!]
Replies: 18
Views: 15393

Re: Free-for-all free font brawl [now with pictures!]

Thanks. It’s tough to compare fine details when JPEG compression is used, but I don’t see any glaring differences. What jumped out at you in the first place? i've replaced the jpg with a png, but it doesn't look any different. they're all blurry, and junicode and freemono are sort of gray in places...
by hotaru
Tue Apr 14, 2015 3:43 am UTC
Forum: Religious Wars
Topic: Subject/Object/Verb ordering in code
Replies: 23
Views: 9874

Re: Subject/Object/Verb ordering in code

ahammel wrote:Eh... rearranging a long parameter list using only flip is a good way to make your code unreadable.

if you're using long parameter lists in haskell, you're doing something very wrong. wrong enough that searching for a->b->c->d->e->f->g->h->i on hoogle doesn't work.
by hotaru
Tue Apr 14, 2015 2:45 am UTC
Forum: Religious Wars
Topic: Free-for-all free font brawl [now with pictures!]
Replies: 18
Views: 15393

Re: Free-for-all free font brawl [now with pictures!]

Qaanol wrote:Screenshot so I can see how my SVGs look to you?

Spoiler:
Image
by hotaru
Tue Apr 14, 2015 2:13 am UTC
Forum: Religious Wars
Topic: Free-for-all free font brawl [now with pictures!]
Replies: 18
Views: 15393

Re: Free-for-all free font brawl [now with pictures!]

(and/or in case anyone wants to see how the native font rendering on OS X looks) oh, so that's why people who use OS X always prefer such hideous fonts! i always wondered why that was... in your SVGs, DejaVu looks like the clear winner, but Quivira and Everson Mono are better with decent font rende...
by hotaru
Tue Apr 14, 2015 2:06 am UTC
Forum: Religious Wars
Topic: Subject/Object/Verb ordering in code
Replies: 23
Views: 9874

Re: Subject/Object/Verb ordering in code

Derek wrote:What I would like to see is a language that allows arbitrary currying. For all the praise that functional programming wankers give currying, I find it remarkable that none of them have ever wanted to curry parameters in the reverse order.

isn't that exactly what flip is for in haskell?
by hotaru
Mon Apr 06, 2015 6:40 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031484

Re: technomancy: Fleeting Thoughtth

Well, depends on whether you want to make your code as difficult to read as possible. i suppose, but there are tools that can automate that . it's also possible to do it with just one (vector) multiply per loop iteration: #include <limits.h> #include <stdio.h> #include <stdlib.h> #if ULONG_MAX == 0...
by hotaru
Sun Apr 05, 2015 10:41 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031484

Re: technomancy: Fleeting Thoughts

You know, if you are trying to find the multiplicative inverse modulo 2^n, I think the extended euclidean algorithm is just too much work. surely this would be less work than all that bit twiddling? #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[argc]) { if(argc == 2) { unsign...
by hotaru
Fri Mar 13, 2015 4:32 pm UTC
Forum: The Help Desk
Topic: Network issue with strange symptoms [resolved]
Replies: 3
Views: 2709

Re: Network issue with strange symptoms

It's a distinctly suboptimal situation for wifi - the cable termination is in the room diagonally opposite from my computer, and downstairs, so the only place I can put my computer and the only place I can put my router are separated by the single longest straight line you can draw while remaining ...
by hotaru
Wed Mar 04, 2015 1:31 am UTC
Forum: The Help Desk
Topic: I broke my debian
Replies: 2
Views: 2881

Re: I broke my debian

a good first step would be to try booting some sort of linux live cd (or usb) and seeing if you can mount the drive from that. if you can, try reinstalling the bootloader on the drive and see if that gets it booting.
by hotaru
Fri Feb 27, 2015 5:12 pm UTC
Forum: Coding
Topic: Learning HTML and CSS
Replies: 76
Views: 34498

Re: Learning HTML and CSS

Edit : I found a weird quirk. If you use <h> instead of <h1> for a header, when you assign thingies to it in CSS, some will assign and some won't. For example... h { background-color: red; font-size: 24px; } ...works just fine, however... h { background-color: red; font-size: 24px; text-align: cent...
by hotaru
Fri Feb 27, 2015 5:02 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031484

Re: Coding: Fleeting Thoughts

I guess perceptions of what constitutes a large download depends on regional availabilty of high speed internet connectivity? it also probably depends on what you're downloading it to. if you're downloading to a desktop computer with 2TB of hard drive space, 1.5GB isn't much, but if you're download...
by hotaru
Wed Dec 10, 2014 7:36 pm UTC
Forum: The Help Desk
Topic: Crazy high firewall access count
Replies: 6
Views: 5842

Re: Crazy high firewall access count

does the target port change, or does it stay the same? if it stays the same, what is it? is anything listening on that port on your computer?
by hotaru
Sun Dec 07, 2014 4:01 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1963
Views: 571584

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

What are you seeing that's incorrect? It looks OK to me... I mean, usually on a clock that's set out like that you'd have the 12 be the right way up and the 6 be upside down, but still... the actual positioning seems to be working for me (looking at it in Firefox and Chrome at least). here's what I...
by hotaru
Sun Dec 07, 2014 2:29 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1963
Views: 571584

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

I'm trying to position symbols on an svg clock face, and I'm wondering if there's a way to get my initial approach of putting all the symbols in the same place and then using "transform" to rotate them around the center of the clock to work correctly. the solution I came up with was to jus...
by hotaru
Mon Dec 01, 2014 8:08 am UTC
Forum: Religious Wars
Topic: Tablets - iPad vs. MS Surface vs. Asus Transformer Prime
Replies: 26
Views: 38629

Re: Tablets - iPad vs. MS Surface vs. Asus Transformer Prime

eternalfrost wrote:For casual web browsing on your couch, its hard to beat an ipad. It is a shame it costs so much and can't easily hook into a non-itunes sanctioned media center though...

for web browsing? the iPad is the only tablet you can't run a decent web browser on.
by hotaru
Sat Nov 29, 2014 6:52 am UTC
Forum: The Help Desk
Topic: Recovering Administrator Account password
Replies: 5
Views: 6182

Re: Recovering Administrator Account password

there's even a very easy to use live CD (or USB) for exactly that situation: http://pogostick.net/~pnh/ntpasswd/
by hotaru
Tue Nov 18, 2014 2:59 am UTC
Forum: Religious Wars
Topic: Engineering Typesetting
Replies: 8
Views: 8763

Re: Engineering Typesetting

no troff?
by hotaru
Thu Oct 16, 2014 9:01 am UTC
Forum: Coding
Topic: Funniest/Most Annoying Code Comments
Replies: 662
Views: 145925

Re: Funniest/Most Annoying Code Comments

In function translating file sizes to human-readable format-- //fails with files larger than 2^90 bytes Hah, just wait till I get that brontobyte hard drive. they really ought to have made it work all the way up to 2 396 bytes. I'll be really surprised if anyone actually realizes what I did there...
by hotaru
Sat Oct 11, 2014 3:25 pm UTC
Forum: Religious Wars
Topic: stop walking on the escalators
Replies: 109
Views: 48377

Re: stop walking on the escalators

Grimbal wrote:You can't ask all escalatonauts to walk. Some people carry luggage. Escalators were made for these people.

no, that's elevators. elevators were made for those people who aren't capable of walking up stairs.
by hotaru
Wed Jul 30, 2014 4:59 pm UTC
Forum: Coding
Topic: Funniest/Most Annoying Code Comments
Replies: 662
Views: 145925

Re: Funniest/Most Annoying Code Comments

// On Android < 4.2, the libkeystore.so ENGINE uses CRYPTO_EX_DATA and is not // added to the global engine list. If all references to it are dropped, OpenSSL // will dlclose the module, leaving a dangling function pointer in the RSA // CRYPTO_EX_DATA class. To work around this, leak an extra refer...
by hotaru
Sun Jul 27, 2014 4:27 pm UTC
Forum: The Help Desk
Topic: Text message "sent time": Can it still be seen these days?
Replies: 2
Views: 3045

Re: Text message "sent time": Can it still be seen these day

For as long as I can remember, my current Sprint phone has had a problem with text messages and SMS: I only see a timestamp for the message's receipt, not when it was sent. That means if my phone was off for a while and I turn it on at noon, I soon see several messages with the times 12:00 and 12:0...

Go to advanced search