• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 02:59
CEST 08:59
KST 15:59
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL61Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event20Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
Statistics for vetoed/disliked maps Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series Korean Starcraft League Week 77 Master Swan Open (Global Bronze-Master 2) [GSL 2025] Code S: Season 2 - Semi Finals & Finals
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Flash Announces Hiatus From ASL Player “Jedi” cheat on CSL ASL20 Preliminary Maps SC uni coach streams logging into betting site BGH Mineral Boosts Tutorial Video
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Trading/Investing Thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 529 users

The Big Programming Thread - Page 649

Forum Index > General Forum
Post a Reply
Prev 1 647 648 649 650 651 1031 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
Poland17243 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
Poland17243 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
Poland17243 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
Spain17970 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
Spain17970 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
Poland17243 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
Bisutopia19229 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
Spain17970 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
Canada9858 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
Spain17970 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
Bisutopia19229 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
Canada9858 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 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 3h 1m
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Leta 594
Larva 324
Barracks 53
Dota 2
XaKoH 617
League of Legends
JimRising 745
Counter-Strike
Stewie2K1060
Heroes of the Storm
Khaldor237
Other Games
WinterStarcraft694
SortOf101
kaitlyn73
ProTech55
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH361
• Hupsaiya 92
• Sammyuel 41
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• lizZardDota2168
League of Legends
• Lourlo1348
• masondota2816
• Stunt496
Upcoming Events
RSL Revival
3h 1m
Clem vs Classic
SHIN vs Cure
FEL
5h 1m
WardiTV European League
5h 1m
BSL: ProLeague
11h 1m
Dewalt vs Bonyth
Replay Cast
1d 17h
Sparkling Tuna Cup
2 days
WardiTV European League
2 days
The PondCast
3 days
Replay Cast
3 days
RSL Revival
4 days
[ Show More ]
Replay Cast
4 days
RSL Revival
5 days
FEL
5 days
RSL Revival
6 days
FEL
6 days
FEL
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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 © 2025 TLnet. All Rights Reserved.