• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:46
CET 01:46
KST 09:46
  • 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 Book16Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8herO wins SC2 All-Star Invitational14
Community News
ACS replaced by "ASL Season Open" - Starts 21/0224LiuLi Cup: 2025 Grand Finals (Feb 10-16)43Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2Nexon's StarCraft game could be FPS, led by UMS maker13PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar)17
StarCraft 2
General
Nexon's StarCraft game could be FPS, led by UMS maker How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? StarCraft 1 & 2 Added to Xbox Game Pass Behind the Blue - Team Liquid History Book Terran Scanner Sweep
Tourneys
LiuLi Cup: 2025 Grand Finals (Feb 10-16) WardiTV Team League Season 10 PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) $5,000 WardiTV Winter Championship 2026 StarCraft Evolution League (SC Evo Biweekly)
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
Mutation # 513 Attrition Warfare The PondCast: SC2 News & Results Mutation # 512 Overclocked Mutation # 511 Temple of Rebirth
Brood War
General
Gypsy to Korea TvZ is the most complete match up Which units you wish saw more use in the game? Ladder maps - how we can make blizz update them? BW General Discussion
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 1 Small VOD Thread 2.0 KCM Race Survival 2026 Season 1
Strategy
Fighting Spirit mining rates Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta
Other Games
General Games
Nintendo Switch Thread ZeroSpace Megathread Diablo 2 thread Path of Exile Battle Aces/David Kim RTS Megathread
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
TL Mafia Community Thread Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Ask and answer stupid questions here! Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread
Fan Clubs
The IdrA Fan Club The herO Fan Club!
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
The Search For Meaning in Vi…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2487 users

The Big Programming Thread - Page 754

Forum Index > General Forum
Post a Reply
Prev 1 752 753 754 755 756 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.
loginn
Profile Blog Joined January 2011
France815 Posts
Last Edited: 2016-08-15 21:17:25
August 15 2016 21:16 GMT
#15061
On August 14 2016 22:53 graNite wrote:
I am trying to code a builder for table tennis exercise graphics. I want it to show a table for each rally of the exercise, with arrows on it that show the movement path of the ball and rectangles of areas where to play.

Right now it looks like this: https://codepen.io/graNite/pen/grqXOo

You can add new tables, remove the last one, and draw two fixed arrows on the same canvas layer on the first table.

What I want to enable is to draw arrows* on each table via click-and-drag and delete them with right-click on them.

*(like they are drawn in the drawArrows function)

What is the best way to do this?

I already implemented a canvas layer for the arrows and could even do so for every single arrow on each table, but how can I access an arrow that is in a middle layer if I right click on it to delete it?



The easiest way in my opinion is to somehow register the arrows so you can make them listen to a mouseclick event. If you want it to be the right click, you'll need to listen to the event 'oncontextmenu'. So in your drawArrow function, register them as an object so you can listen to the oncontextmenu event and delete the arrow.

Something like this :

arrow.addEventListener('oncontextmenu', function () {
//delete your arrow
return false; // return false so the menu doesn't pop up
}, false)

However to do this you are probably going to need to refactor your code to make sure you can put a listener on those arrows.

I am no JS expert so take this with a grain of salt.
Stephano, Taking skill to the bank since IPL3. Also Lucifron and FBH
mantequilla
Profile Blog Joined June 2012
Turkey781 Posts
August 15 2016 23:52 GMT
#15062
On August 15 2016 04:07 Djagulingu wrote:
Show nested quote +
On August 13 2016 19:39 norlock wrote:
http://www.teamliquid.net/forum/tech-support/512785-creating-a-teamliquid-app If anyone is interested in helping me out. First of all I still need to wait for docs of the API (hopefully they can provide me with that).

I'm down for this shit.


and I want to make a windows phone app. just to see the environment. I don't like to make unusable-unnecessary things just to learn sth.
Age of Mythology forever!
ShoCkeyy
Profile Blog Joined July 2008
7815 Posts
August 16 2016 01:21 GMT
#15063
On August 14 2016 22:53 graNite wrote:
I am trying to code a builder for table tennis exercise graphics. I want it to show a table for each rally of the exercise, with arrows on it that show the movement path of the ball and rectangles of areas where to play.

Right now it looks like this: https://codepen.io/graNite/pen/grqXOo

You can add new tables, remove the last one, and draw two fixed arrows on the same canvas layer on the first table.

What I want to enable is to draw arrows* on each table via click-and-drag and delete them with right-click on them.

*(like they are drawn in the drawArrows function)

What is the best way to do this?

I already implemented a canvas layer for the arrows and could even do so for every single arrow on each table, but how can I access an arrow that is in a middle layer if I right click on it to delete it?


Did you see my post to you? I gave you an example of being able to draw lines based on canvas, and mouse click events.
Life?
graNite
Profile Blog Joined December 2010
Germany4434 Posts
August 16 2016 04:22 GMT
#15064
On August 16 2016 06:16 loginn wrote:

The easiest way in my opinion is to somehow register the arrows so you can make them listen to a mouseclick event. If you want it to be the right click, you'll need to listen to the event 'oncontextmenu'. So in your drawArrow function, register them as an object so you can listen to the oncontextmenu event and delete the arrow.

Something like this :

arrow.addEventListener('oncontextmenu', function () {
//delete your arrow
return false; // return false so the menu doesn't pop up
}, false)

However to do this you are probably going to need to refactor your code to make sure you can put a listener on those arrows.

I am no JS expert so take this with a grain of salt.


I will try to do this, thanks.

On August 16 2016 10:21 ShoCkeyy wrote:
Did you see my post to you? I gave you an example of being able to draw lines based on canvas, and mouse click events.


No, sorry, can you link the post? I dont know what you mean.




Could it maybe be better to switch from canvas to svg for this?
"Oink oink, bitches" - Tasteless on Pigbaby winning a map against Flash
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
August 16 2016 04:42 GMT
#15065
Hey folks, I'm going to try to work through this weekly challenge for a little bit of time each night this week. Would anyone like to collaborate with me on it? We would have different code(I guess hosted on GitHub so we could view it) but we would talk about problems and solutions.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
ShoCkeyy
Profile Blog Joined July 2008
7815 Posts
Last Edited: 2016-08-16 10:56:13
August 16 2016 10:53 GMT
#15066
On August 16 2016 13:22 graNite wrote:
Show nested quote +
On August 16 2016 06:16 loginn wrote:

The easiest way in my opinion is to somehow register the arrows so you can make them listen to a mouseclick event. If you want it to be the right click, you'll need to listen to the event 'oncontextmenu'. So in your drawArrow function, register them as an object so you can listen to the oncontextmenu event and delete the arrow.

Something like this :

arrow.addEventListener('oncontextmenu', function () {
//delete your arrow
return false; // return false so the menu doesn't pop up
}, false)

However to do this you are probably going to need to refactor your code to make sure you can put a listener on those arrows.

I am no JS expert so take this with a grain of salt.


I will try to do this, thanks.

Show nested quote +
On August 16 2016 10:21 ShoCkeyy wrote:
Did you see my post to you? I gave you an example of being able to draw lines based on canvas, and mouse click events.


No, sorry, can you link the post? I dont know what you mean.




Could it maybe be better to switch from canvas to svg for this?


http://www.teamliquid.net/forum/general/134491-the-big-programming-thread?page=750#14990

This post really shows how a user and multiuser can draw a line, I would probably switch it from drawing a line to on click from point A to point B.
Life?
graNite
Profile Blog Joined December 2010
Germany4434 Posts
August 16 2016 11:55 GMT
#15067
Thanks, but I dont really get how this can help me with the layer issues.
"Oink oink, bitches" - Tasteless on Pigbaby winning a map against Flash
Hhanh00
Profile Joined May 2016
34 Posts
August 16 2016 16:18 GMT
#15068
On August 16 2016 20:55 graNite wrote:
Thanks, but I dont really get how this can help me with the layer issues.


Have you looked at the library paper.js? It has shapes, mouse/keyboard interaction and layers. Create 2 layers and make sure that arrows are on the top layer.
Djagulingu
Profile Blog Joined December 2010
Germany3605 Posts
August 16 2016 19:39 GMT
#15069
On August 16 2016 08:52 mantequilla wrote:
Show nested quote +
On August 15 2016 04:07 Djagulingu wrote:
On August 13 2016 19:39 norlock wrote:
http://www.teamliquid.net/forum/tech-support/512785-creating-a-teamliquid-app If anyone is interested in helping me out. First of all I still need to wait for docs of the API (hopefully they can provide me with that).

I'm down for this shit.


and I want to make a windows phone app. just to see the environment. I don't like to make unusable-unnecessary things just to learn sth.

Making a windows phone app and not liking to make unusable-unnecessary things just to learn something isn't too much consistent, at least according to me.
"windows bash is a steaming heap of shit" tofucake
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-08-16 23:46:48
August 16 2016 23:42 GMT
#15070
--- Nuked ---
Nyxisto
Profile Joined August 2010
Germany6287 Posts
Last Edited: 2016-08-17 02:32:37
August 17 2016 02:29 GMT
#15071
On August 16 2016 13:42 WarSame wrote:
Hey folks, I'm going to try to work through this weekly challenge for a little bit of time each night this week. Would anyone like to collaborate with me on it? We would have different code(I guess hosted on GitHub so we could view it) but we would talk about problems and solutions.


I actually did that challenge and create a little graphical version, haven't put it on github yet, but here you go

requires pygame, the trolls are stupid as hell though

mantequilla
Profile Blog Joined June 2012
Turkey781 Posts
August 17 2016 09:57 GMT
#15072
what's a good chunk number when reading a binary file with read(integer) in python?
Age of Mythology forever!
Prillan
Profile Joined August 2011
Sweden350 Posts
August 17 2016 19:55 GMT
#15073
On August 17 2016 18:57 mantequilla wrote:
what's a good chunk number when reading a binary file with read(integer) in python?

That depends on your use case, doesn't it?
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
August 18 2016 00:48 GMT
#15074
On August 16 2016 08:52 mantequilla wrote:
Show nested quote +
On August 15 2016 04:07 Djagulingu wrote:
On August 13 2016 19:39 norlock wrote:
http://www.teamliquid.net/forum/tech-support/512785-creating-a-teamliquid-app If anyone is interested in helping me out. First of all I still need to wait for docs of the API (hopefully they can provide me with that).

I'm down for this shit.


and I want to make a windows phone app. just to see the environment. I don't like to make unusable-unnecessary things just to learn sth.


WP is basically dead, but in my opinion Windows development is still preferable to Android and iOS development, so learning how C# does things differently can be useful.

On August 17 2016 08:42 Nesserev wrote:
Microsoft is shutting down Windows Phone iirc; don't bother lol.

That said, maybe it's better if you don't work on an app for TeamLiquid. There is no available API, and webscraping the whole site is against the TOS. Those are your first problems... Then there's the problem of trust, accountability, support, etc.


Didn't someone make an Android app a while back? Not sure happened to it, but it webscraped the site. Probably too difficult to maintain.
There is no one like you in the universe.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2016-08-18 01:15:53
August 18 2016 01:10 GMT
#15075
On August 18 2016 09:48 Blisse wrote:
Show nested quote +
On August 16 2016 08:52 mantequilla wrote:
On August 15 2016 04:07 Djagulingu wrote:
On August 13 2016 19:39 norlock wrote:
http://www.teamliquid.net/forum/tech-support/512785-creating-a-teamliquid-app If anyone is interested in helping me out. First of all I still need to wait for docs of the API (hopefully they can provide me with that).

I'm down for this shit.


and I want to make a windows phone app. just to see the environment. I don't like to make unusable-unnecessary things just to learn sth.


WP is basically dead, but in my opinion Windows development is still preferable to Android and iOS development, so learning how C# does things differently can be useful.

Show nested quote +
On August 17 2016 08:42 Nesserev wrote:
Microsoft is shutting down Windows Phone iirc; don't bother lol.

That said, maybe it's better if you don't work on an app for TeamLiquid. There is no available API, and webscraping the whole site is against the TOS. Those are your first problems... Then there's the problem of trust, accountability, support, etc.


Didn't someone make an Android app a while back? Not sure happened to it, but it webscraped the site. Probably too difficult to maintain.


The app uses Cordova to render the app so it isn't platform specific. The code is on the liquipedia github page.

Although writing this I wonder if more than one app has been created.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Merany
Profile Blog Joined February 2011
France890 Posts
August 18 2016 07:08 GMT
#15076
I'm toying with Xamarin for cross plateform dev in my free time and so far, it's pretty cool to use and pretty strong also, albeit lacking maturity.
Probably does help that I've been a C# / Visual Studio proponent for years :D
mantequilla
Profile Blog Joined June 2012
Turkey781 Posts
August 18 2016 08:56 GMT
#15077
On August 18 2016 04:55 Prillan wrote:
Show nested quote +
On August 17 2016 18:57 mantequilla wrote:
what's a good chunk number when reading a binary file with read(integer) in python?

That depends on your use case, doesn't it?



on a regular 8gb ram pc, read a big binary file from a regular hdd, do something with data and write it back to disk Don't know if I'm supposed to read a large amount that can fit into ram such as 500mb, or read in smaller chunks.
Age of Mythology forever!
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-08-19 01:29:23
August 18 2016 23:21 GMT
#15078
--- Nuked ---
Isualin
Profile Joined March 2011
Germany1903 Posts
August 19 2016 12:53 GMT
#15079
Anyone here used crate.io? Any good or bad experience to share? We are thinking of using it for our project because it looks cool
| INnoVation | The literal god TY | ByuNjwa | LRSL when? |
Acrofales
Profile Joined August 2010
Spain18216 Posts
August 19 2016 13:47 GMT
#15080
Yup. Looking cool is my first criteria for selecting a DB system in serious projects.

It does look interesting if your main criteria is that it works well with docker, but to be honest, I've used both mysql and postgresql in docker and they worked just fine too, so not quite sure what crate's added value is.
Prev 1 752 753 754 755 756 1032 Next
Please log in or register to reply.
Live Events Refresh
OSC
00:00
OSC Elite Rising Star #17.5
CranKy Ducklings76
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SteadfastSC 186
SpeCial 50
Nathanias 37
RuFF_SC2 23
StarCraft: Brood War
Artosis 799
NaDa 15
Dota 2
monkeys_forever426
420jenkins365
NeuroSwarm137
League of Legends
Reynor278
Counter-Strike
shahzam667
Foxcn402
taco 310
adren_tv84
Other Games
summit1g10896
Maynarde140
KnowMe96
Trikslyr74
JuggernautJason19
minikerr5
Organizations
Other Games
BasetradeTV169
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21591
League of Legends
• Scarra1290
Other Games
• imaqtpie1655
• Shiphtur231
Upcoming Events
WardiTV Winter Champion…
11h 14m
PiGosaur Cup
1d
Replay Cast
1d 8h
WardiTV Winter Champion…
1d 11h
Replay Cast
1d 23h
PiG Sty Festival
2 days
Maru vs Bunny
Classic vs SHIN
The PondCast
2 days
KCM Race Survival
2 days
WardiTV Winter Champion…
2 days
OSC
2 days
[ Show More ]
Replay Cast
2 days
PiG Sty Festival
3 days
Clem vs Percival
Zoun vs Solar
Epic.LAN
3 days
Replay Cast
3 days
PiG Sty Festival
4 days
herO vs NightMare
Reynor vs Cure
CranKy Ducklings
4 days
Epic.LAN
4 days
Replay Cast
4 days
PiG Sty Festival
5 days
Serral vs YoungYakov
ByuN vs ShoWTimE
Sparkling Tuna Cup
5 days
Replay Cast
5 days
Replay Cast
6 days
Wardi Open
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-02-16
LiuLi Cup: 2025 Grand Finals
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Nations Cup 2026
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025

Upcoming

Escore Tournament S1: King of Kings
[S:21] ASL SEASON OPEN 1st Round
[S:21] ASL SEASON OPEN 1st Round Qualifier
[S:21] ASL SEASON OPEN 2nd Round
[S:21] ASL SEASON OPEN 2nd Round Qualifier
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
BLAST Rivals Spring 2026
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
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.