Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks.
Manit0u thanks a lot for the reply. One thing that had scared me about Bootstrap is how all-encompassing it seems to be. I'm still trying out a lot of these different frameworks and trying to figure out what fits best for me. I'm quite interested in Material Design, and I've found out that there are tons of frameworks using it already, including one for Bootstrap. In case it might interest anyone, the ones I've been looking at have are: - http://fezvrasta.github.io/bootstrap-material-design/ (Material Design for Bootstrap) - material.angularjs.org/ (Angular Material) - getmdl.io - materializecss.com
Then there's Polymer with Paper elements and I think at least 3 or 4 other implementations of material design in other frameworks. It's kind of insane how many versions of this there are.
You shouldn't be scared by Bootstrap. Even though it might seem all-encompassing it's actually very easy to use and doesn't intrude too much on your work.
I don't think there's anything wrong with K&R. I'm just surprised anyone would use C for anything else than system-level stuff, embedded stuff, micro controllers etc.
On July 17 2015 01:19 ZenithM wrote: Computability 101, yeah! TFW when they meet the inverse of Ackermann in their data structure course.
Is "when when" in your sentence part of the recursion reference?
Also, did you know there's a "math overflow" website?
I don't think there's anything wrong with K&R. I'm just surprised anyone would use C for anything else than system-level stuff, embedded stuff, micro controllers etc.
The stuff you find when there's just too much work and your mind goes blank...
Judging by his age, I think C was already a big step forward. He is probably more used to doing stuff like that in Fortran. C is a pretty neat language for showing stuff like that, though. Can easily write for loops and recursive programs (unlike crap like java, where recursion is pretty much banned by design, because any time you think you might want to do something recursively your code gets so ugly and long that you give up and decide to write the program in python (or better still, haskell).
On July 15 2015 01:25 FFGenerations wrote: and what the hell is a load balancer anyway
It seems like you either clicked on too many buttons and contracted a number of services you didn't want or need (by mistake). Probably what you did when switching servers was, instead of actually switching servers, got some magic load balancing service to do magic for you, balancing your (nonexistent) load between Ireland and the US. This is probably not included in the free service (I don't see any reason why it should be: your application is quite serious by the time it needs this kind of load balancing).
Contact Amazon support, explain (politely, and in a less inflammatory way than most of your posts here) what you were trying to do, how something must have gone wrong, and ask them to fix it. Generally their customer support is pretty good, but I haven't dealt with billing, so it might be different.
I'm not sure you're eligible for a refund if you say something along the lines of "I created an account, clicked some random stuff without checking what it does and now I get charged for leaving it like that for 2 months".
Lesson to be learned here: Don't set up servers yourself if you don't know what you're doing or are willing to pay the price of errors.
Servers are complicated things, not something every person can set up properly (even with wizards).
For example, I'm sure that when I was setting up stuff over at Amazon AWS it has clearly (maybe not so clearly, but it did none the less) shown me if my desired EC2 and RDS instances were eligible for a free tier. The first time I set them up they weren't so I made sure to change them and set them up accordingly before launching said instances.
lol something like this happened to me, I was refunded, pretty sure people screw up and get charged all the time. Took me like 3 tries to actually turn it off completely.
Eh... "judging by his age" is weird to think. There's at least Lisp being super old. The group photo of the 1990s Haskell design committee has a lot of old people (that were already old at that time), and they did crazy stuff with Haskell (though perhaps the language wasn't supposed to be actually useful so it all was a bit of an accident).
I don't think there's anything wrong with K&R. I'm just surprised anyone would use C for anything else than system-level stuff, embedded stuff, micro controllers etc.
On July 17 2015 01:19 ZenithM wrote: Computability 101, yeah! TFW when they meet the inverse of Ackermann in their data structure course.
Is "when when" in your sentence part of the recursion reference?
Also, did you know there's a "math overflow" website?
The stuff you find when there's just too much work and your mind goes blank...
Judging by his age, I think C was already a big step forward. He is probably more used to doing stuff like that in Fortran. C is a pretty neat language for showing stuff like that, though. Can easily write for loops and recursive programs (unlike crap like java, where recursion is pretty much banned by design, because any time you think you might want to do something recursively your code gets so ugly and long that you give up and decide to write the program in python (or better still, haskell).
Not saying that Java isn't ugly, but recursion isn't particularly bad, afaik? Especially not banned by design of the language (as far as recursion goes, it's probably very similar to C). More banned by design of the JVM :D.
On July 17 2015 06:53 Manit0u wrote: I don't think there's anything wrong with K&R. I'm just surprised anyone would use C for anything else than system-level stuff, embedded stuff, micro controllers etc.
I beg to differ. Programs I am running right now:
dwm, a window manager - C
dstatus, my own status bar program - C
dmenu, an application launcher - C
lxterminal, a terminal emulator - C
zsh, a shell - C
tmux, a terminal multiplexer - C
irssi, an IRC client - C
feh, an image viewer - C
mpv, an audio/video player - C
chromium - C++ (I think)
evince, a PDF viewer - C/C++
virtualbox - don’t know
teamspeak - C++
skype - don’t know
steam - probably C++
battle.net app - probably C++ (running through wine which is written in C)
balsa, an email client - C
vim, a text editor - C I cheated here. The next ones are currently not runnig but are often needed:
clang, a compiler - C++
make - C
Yeah, mostly C. Objectively (huehuehue) the language of the gods.
Steam is C/C++ with Trident as browser engine (maybe WebKit now).
And most of the stuff you mentioned I counted as "system-level stuff" (definitely shells, compilers and such). Obviously, most of the OS things will be written in C (less in Linux than others since Torvalds hates C++ with passion).
Okay math and programming nerds. I need some help here. I have a gauge and need the needle to move base on this info.
MinValue = 0; //UP = 0 on the gauge MaxValue = 40; // 40 is at 270 degress
This would be a simple problem if the gauge didn't increment 1,2,5,10,15,25,30,45. I need an equation that can get me the correct degree of the needle base on the gauge value. For example: gaugeValue = 3; //should put me at 90 degrees gaugeValue = 15; //should put me at 180 degrees
If this isn't possible I can hard code results but it would be far less elegant. I found the degree range between each need location so 1,2, 2-5, 5-10, 10-15 etc. and then scaled the value input based on the range of degrees. Sample Solution:
Almost fits: 149.49 * log(x + 1). The problem is that it increases slightly too fast, and 45 isn't at 225. However, looking at your picture, you don't want 45 at 225 anyway, but slightly over 270, in which case the log increases too slow. A curve fitter should be able to fit this, though, even with so few points. I'd chug it through scipy's curve fitter for you, but I don't have time. Here's the general function:
a + b*log(c*x + d). Give it the following points: f(0) = 0, f(3) = 90, f(15) = 180, f(40) = 270.
Edit: if there is no way of scaling the log to fit these points properly, try a root:
Wouldn't it be easiest to go to excel, enter a few points with an angle for all of them. Do a regression to get a line of best fit, and use that function?
On July 17 2015 22:47 FiWiFaKi wrote: Wouldn't it be easiest to go to excel, enter a few points with an angle for all of them. Do a regression to get a line of best fit, and use that function?
Not too clued up on the capabilities of excel, but does excel fit anything other than linear models? It's clearly not linear, so a linear (or any polynomial) would be a pretty bad idea.
On July 17 2015 22:14 Acrofales wrote: Almost fits: 149.49 * log(x + 1). The problem is that it increases slightly too fast, and 45 isn't at 225. However, looking at your picture, you don't want 45 at 225 anyway, but slightly over 270, in which case the log increases too slow. A curve fitter should be able to fit this, though, even with so few points. I'd chug it through scipy's curve fitter for you, but I don't have time. Here's the general function:
a + b*log(c*x + d). Give it the following points: f(0) = 0, f(3) = 90, f(15) = 180, f(40) = 270.
Edit: if there is no way of scaling the log to fit these points properly, try a root:
a + b*x^(1/c)
You are correct, I had to edit my post to show 40 @ 270 degrees. I am going to check out scipy's curve fitter. Never heard of it before now.
On July 17 2015 22:16 ZenithM wrote: AngleInDegrees = 10 * (gaugeValue * 50)^0.44 - (something) with something being between 0 and 4, which ever looks better ;D
I'd try a root in any case.
What I have trouble wrapping my head around is a formula that tackles the whole range at once. Because between 2-5 the difference is 3, 10-15 the difference is 5, 15 to 25 the difference is 10, but then it descales 25-30 a difference of 5, and then 30-40 a difference of 10 lol. If it scaled where the difference was 1,2,3,5,5,10,10,10 that'd be a little be easier to work with.
Anyway, the code I wrote was easily cleaned up. That was written long form just for me to visual see what was happening. Now it is relatively clean and now I see I could even do better but I already committed it and moved on lol.
On July 17 2015 22:47 FiWiFaKi wrote: Wouldn't it be easiest to go to excel, enter a few points with an angle for all of them. Do a regression to get a line of best fit, and use that function?
Not too clued up on the capabilities of excel, but does excel fit anything other than linear models? It's clearly not linear, so a linear (or any polynomial) would be a pretty bad idea.
It does powers, logs, and a few other things, as well as polynomials. I'd use Matlab, but I figure everyone has Excel, hence why I suggested it.
Your other option is to use a piece-wise function, and fit two different curves to make it work, to account for the scaling being kind of weird. I stay away from comp sci stuff, but that's how I'd deal with something like that as a Mech Engg.