• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 05:44
CET 11:44
KST 19:44
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Behind the Blue - Team Liquid History Book6Clem wins HomeStory Cup 288HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info4herO wins SC2 All-Star Invitational14
Community News
Weekly Cups (Jan 26-Feb 1): herO, Clem, ByuN, Classic win2RSL Season 4 announced for March-April7Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win3Weekly Cups (Jan 12-18): herO, MaxPax, Solar win0BSL Season 2025 - Full Overview and Conclusion8
StarCraft 2
General
How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? Clem wins HomeStory Cup 28 Behind the Blue - Team Liquid History Book Rongyi Cup S3 - Preview & Info HomeStory Cup 28 - Info & Preview
Tourneys
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) WardiTV Mondays $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) Sparkling Tuna Cup - Weekly Open Tournament $5,000 WardiTV Winter Championship 2026
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
The PondCast: SC2 News & Results Mutation # 511 Temple of Rebirth Mutation # 510 Safety Violation Mutation # 509 Doomsday Report
Brood War
General
BW General Discussion Recent recommended BW games BGH Auto Balance -> http://bghmmr.eu/ Can someone share very abbreviated BW cliffnotes? StarCraft player reflex TE scores
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 1 Small VOD Thread 2.0 KCM Race Survival 2026 Season 1
Strategy
Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Diablo 2 thread Battle Aces/David Kim RTS Megathread EVE Corporation Nintendo Switch Thread Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread YouTube Thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
Play, Watch, Drink: Esports …
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2291 users

The Big Programming Thread - Page 649

Forum Index > General Forum
Post a Reply
Prev 1 647 648 649 650 651 1032 Next
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.
warding
Profile Joined August 2005
Portugal2394 Posts
July 16 2015 10:26 GMT
#12961
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.
Manit0u
Profile Blog Joined August 2004
Poland17654 Posts
Last Edited: 2015-07-16 11:36:47
July 16 2015 11:36 GMT
#12962
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.

Unrelated stuff now. I've found probably the most awesome programmer thing ever:
https://bugzilla.gnome.org/show_bug.cgi?id=78514#c19

My eyes are waterfalls now.
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17654 Posts
July 16 2015 14:24 GMT
#12963


[image loading]
Time is precious. Waste it wisely.
Biolunar
Profile Joined February 2012
Germany224 Posts
July 16 2015 15:49 GMT
#12964
On July 16 2015 23:24 Manit0u wrote:
https://www.youtube.com/watch?v=i7sm9dzFtEI

[image loading]

That K&R style C though…
What is best? To crush the Zerg, see them driven before you, and hear the lamentations of the Protoss.
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2015-07-16 16:21:56
July 16 2015 16:19 GMT
#12965
Computability 101, yeah!
TFW when they meet the inverse of Ackermann in their data structure course.
Manit0u
Profile Blog Joined August 2004
Poland17654 Posts
Last Edited: 2015-07-16 21:59:53
July 16 2015 21:53 GMT
#12966
On July 17 2015 00:49 Biolunar wrote:
Show nested quote +
On July 16 2015 23:24 Manit0u wrote:
https://www.youtube.com/watch?v=i7sm9dzFtEI

[image loading]

That K&R style C though…


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?

http://mathoverflow.net/questions/76037/inverse-ackermann-primitive-recursive-or-not

The stuff you find when there's just too much work and your mind goes blank...
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18211 Posts
July 17 2015 00:09 GMT
#12967
On July 17 2015 06:53 Manit0u wrote:
Show nested quote +
On July 17 2015 00:49 Biolunar wrote:
On July 16 2015 23:24 Manit0u wrote:
https://www.youtube.com/watch?v=i7sm9dzFtEI

[image loading]

That K&R style C though…


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.

Show nested quote +
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?

http://mathoverflow.net/questions/76037/inverse-ackermann-primitive-recursive-or-not

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).
Xyik
Profile Blog Joined November 2009
Canada728 Posts
July 17 2015 01:15 GMT
#12968
On July 15 2015 01:49 Manit0u wrote:
Show nested quote +
On July 15 2015 01:44 Acrofales wrote:
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.
Ropid
Profile Joined March 2009
Germany3557 Posts
July 17 2015 01:29 GMT
#12969
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).

+ Show Spoiler [found the picture I was thinking about] +
[image loading]
"My goal is to replace my soul with coffee and become immortal."
Acrofales
Profile Joined August 2010
Spain18211 Posts
July 17 2015 02:01 GMT
#12970
That was kinda my point? He's using C, rather than Fortran or Lisp...
ZenithM
Profile Joined February 2011
France15952 Posts
July 17 2015 08:46 GMT
#12971
On July 17 2015 09:09 Acrofales wrote:
Show nested quote +
On July 17 2015 06:53 Manit0u wrote:
On July 17 2015 00:49 Biolunar wrote:
On July 16 2015 23:24 Manit0u wrote:
https://www.youtube.com/watch?v=i7sm9dzFtEI

[image loading]

That K&R style C though…


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?

http://mathoverflow.net/questions/76037/inverse-ackermann-primitive-recursive-or-not

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.
Biolunar
Profile Joined February 2012
Germany224 Posts
July 17 2015 11:15 GMT
#12972
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.
What is best? To crush the Zerg, see them driven before you, and hear the lamentations of the Protoss.
Manit0u
Profile Blog Joined August 2004
Poland17654 Posts
July 17 2015 11:57 GMT
#12973
On July 17 2015 20:15 Biolunar wrote:
  • steam - probably C++



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).
Time is precious. Waste it wisely.
BisuDagger
Profile Blog Joined October 2009
Bisutopia19305 Posts
Last Edited: 2015-07-17 13:12:33
July 17 2015 12:32 GMT
#12974
*SOLVED*

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

[image loading]

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:

else if (TestVariable > 2 && TestVariable <= 5)
{
float baseMin = 2;
float baseMax = 5;
float limitMin = rotate2;
float limitMax = rotate5;
float scaleToMeter = (((limitMax - limitMin) * (TestVariable - baseMin) / (baseMax - baseMin))) + limitMin;
this.transform.Rotate(Vector3.right, scaleToMeter);
}
else if (TestVariable > 5 && TestVariable <= 10)
{
float baseMin = 5;
float baseMax = 10;
float limitMin = rotate5;
float limitMax = rotate10;
float scaleToMeter = (((limitMax - limitMin) * (TestVariable - baseMin) / (baseMax - baseMin))) + limitMin;
this.transform.Rotate(Vector3.right, scaleToMeter);
}
ModeratorFormer Afreeca Starleague Caster: http://afreeca.tv/ASL2ENG2
Acrofales
Profile Joined August 2010
Spain18211 Posts
Last Edited: 2015-07-17 13:16:40
July 17 2015 13:14 GMT
#12975
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)
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2015-07-17 13:22:37
July 17 2015 13:16 GMT
#12976
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.
FiWiFaKi
Profile Blog Joined February 2009
Canada9859 Posts
Last Edited: 2015-07-17 13:47:49
July 17 2015 13:47 GMT
#12977
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?
In life, the journey is more satisfying than the destination. || .::Entrepreneurship::. Living a few years of your life like most people won't, so that you can spend the rest of your life like most people can't || Mechanical Engineering & Economics Major
Acrofales
Profile Joined August 2010
Spain18211 Posts
July 17 2015 13:51 GMT
#12978
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.
BisuDagger
Profile Blog Joined October 2009
Bisutopia19305 Posts
July 17 2015 13:52 GMT
#12979
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.


else if (needlePosition > 25 && needlePosition <= 30)
{
float scaleToMeter = ScaleToDegrees(25, 30, rotate25, rotate30, needlePosition);
this.transform.Rotate(Vector3.right, scaleToMeter);
}
ModeratorFormer Afreeca Starleague Caster: http://afreeca.tv/ASL2ENG2
FiWiFaKi
Profile Blog Joined February 2009
Canada9859 Posts
Last Edited: 2015-07-17 14:00:50
July 17 2015 13:58 GMT
#12980
On July 17 2015 22:51 Acrofales wrote:
Show nested quote +
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.
In life, the journey is more satisfying than the destination. || .::Entrepreneurship::. Living a few years of your life like most people won't, so that you can spend the rest of your life like most people can't || Mechanical Engineering & Economics Major
Prev 1 647 648 649 650 651 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 16m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech170
StarCraft: Brood War
Rain 8470
Calm 6911
GuemChi 1654
Flash 1415
firebathero 1336
Horang2 815
Larva 469
Mini 257
actioN 239
Soma 234
[ Show more ]
Leta 202
Last 139
Hyun 127
ZerO 126
Mong 119
Pusan 88
Sharp 66
ggaemo 66
910 59
sorry 59
Mind 59
Shuttle 49
Backho 35
sSak 27
GoRush 27
zelot 21
Free 21
NaDa 19
Shine 16
Noble 16
Sacsri 12
Movie 11
Dota 2
Fuzer 222
XcaliburYe148
Super Smash Bros
Mew2King96
Westballz52
Heroes of the Storm
Khaldor319
Other Games
gofns19498
singsing1612
B2W.Neo1161
MindelVK25
ZerO(Twitch)21
Organizations
Other Games
gamesdonequick1231
BasetradeTV108
StarCraft: Brood War
lovetv 22
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• StrangeGG 65
• LUISG 40
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2657
Upcoming Events
uThermal 2v2 Circuit
1h 16m
WardiTV Winter Champion…
4h 16m
OSC
13h 16m
Replay Cast
22h 16m
Wardi Open
1d 1h
Monday Night Weeklies
1d 6h
Sparkling Tuna Cup
1d 23h
LiuLi Cup
2 days
Reynor vs Creator
Maru vs Lambo
PiGosaur Monday
2 days
LiuLi Cup
3 days
Clem vs Rogue
SHIN vs Cyan
[ Show More ]
The PondCast
3 days
KCM Race Survival
3 days
LiuLi Cup
4 days
Scarlett vs TriGGeR
ByuN vs herO
Online Event
4 days
LiuLi Cup
5 days
Serral vs Zoun
Cure vs Classic
LiuLi Cup
6 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

CSL 2025 WINTER (S19)
Rongyi Cup S3
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Nations Cup 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8

Upcoming

Escore Tournament S1: W8
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
WardiTV Winter 2026
LiuLi Cup: 2025 Grand Finals
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.