• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:45
CEST 21:45
KST 04:45
  • 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
[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244ByuL, and the Limitations of Standard Play3
Community News
Stellar Fest TWO the Moon (Dec 16-20)6Weekly Cups (August 24-30): Patches' balance mod takes over2New 3v3 BGH Ladder (and more) on ShieldBattery!38Weekly Cups (August 17-23): Zerg dominate the week6Weekly Cups (August 10-16): SHIN doubles3
StarCraft 2
General
SC4ALL II: SC2 Player Announcement 6/8 - Maru Weekly Cups (August 10-16): SHIN doubles Weekly Cups (August 24-30): Patches' balance mod takes over How would you feel about frequent/monthly balance patches for SC2? Weekly Cups (August 17-23): Zerg dominate the week
Tourneys
2026 GSTL Announcement Stellar Fest TWO the Moon (Dec 16-20) PIG STY FESTIVAL 8.0! (13 - 23 August) Sparkling Tuna Cup - Weekly Open Tournament IntoTheTV X SOOP SC2 League : Weekly & Monthly
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This Mutation # 539 Thunder Dome
Brood War
General
[Personal Project Share] Terran Defense v0.60 Which box art did your first copy of StarCraft 1 have? BW General Discussion ASL22 General Discussion New 3v3 BGH Ladder (and more) on ShieldBattery!
Tourneys
[ASL22] Ro24 Group F [Megathread] Daily Proleagues Small VOD Thread 2.0 Escore Tournament - Season 3
Strategy
Replay Review Process - What do you do? Game Theory for Starcraft Odyssey Mineral Stack Saturation Fighting Spirit mining rates
Other Games
General Games
General RTS Discussion Thread Nintendo Switch Thread Stormgate/Frost Giant Megathread Anyone here play Quakeworld back in the day? EVE Corporation
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Canadian Politics Mega-thread European Politico-economics QA Mega-thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! Anime Discussion Thread
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Regacy Esports: The Bh…
regacyesports
Violent Games and Crime Rate…
TrAiDoS
LOCKPICKING NOOB
LUCKY_NOOB
Cathedral Of CS And NY pizza a…
FuDDx
Please support my new stand…
Peanutsc
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7288 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
Portugal2397 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
Poland17835 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
Poland17835 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
Poland17835 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
Spain18425 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
Spain18425 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
Poland17835 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
Bisutopia19383 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
Spain18425 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
Spain18425 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
Bisutopia19383 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 4h 15m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 423
BRAT_OK 145
Railgan 47
JuggernautJason41
MindelVK 20
StarCraft: Brood War
Britney 17293
Shuttle 1075
Horang2 165
Sexy 43
Light 20
Dota 2
420jenkins626
Pyrionflax140
Counter-Strike
edward34
Other Games
Liquid`RaSZi2090
Grubby1733
mouzStarbuck310
Mlord293
TKL 224
IndyStarCraft 208
XaKoH 175
C9.Mang0161
ArmadaUGS147
Trikslyr68
QueenE43
Mew2King38
Organizations
Other Games
WardiTV507
BasetradeTV51
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• Pr0nogo 1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV1412
• masondota2910
League of Legends
• TFBlade999
Other Games
• imaqtpie1227
• Shiphtur346
Upcoming Events
PiGosaur Cup
4h 15m
Kung Fu Cup
15h 15m
Replay Cast
1d 4h
The PondCast
1d 14h
IntoTheTV X SOOP
2 days
CranKy Ducklings
3 days
Sparkling Tuna Cup
4 days
OSC
4 days
Afreeca Starleague
5 days
Soma vs Shuttle
BeSt vs Rush
WardiTV Weekly
5 days
[ Show More ]
Afreeca Starleague
6 days
Leta vs ggaemo
Jaedong vs Queen
GSL
6 days
Liquipedia Results

Completed

BSL 2026 LAN: Kraków
PiG Sty Festival 8.0
Light Tournament 2026

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Proleague 2026-09-01
RSL Revival: Season 6
Big Dog Cup 2026 Div 1
BLAST Open Fall 2026
Esports World Cup 2026
Esports World Cup 2026: LCQ
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026

Upcoming

Acropolis #5
Acropolis #5 - TRS
Escore Tournament S3: King of Kings
Blizzard Classic Cup 2026
Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Calamity Invitational
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
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.