• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:51
CEST 03:51
KST 10:51
  • 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
Team Liquid Map Contest #22 - The Finalists8[ASL21] Ro16 Preview Pt1: Fresh Flow9[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy21
Community News
2026 GSL Season 1 Qualifiers5Maestros of the Game 2 announced22026 GSL Tour plans announced3Weekly Cups (April 6-12): herO doubles, "Villains" prevail0MaNa leaves Team Liquid18
StarCraft 2
General
Team Liquid Map Contest #22 - The Finalists 2026 GSL Tour plans announced Maestros of the Game 2 announced Weekly Cups (April 6-12): herO doubles, "Villains" prevail MaNa leaves Team Liquid
Tourneys
2026 GSL Season 1 Qualifiers Master Swan Open (Global Bronze-Master 2) SEL Doubles (SC Evo Bimonthly) Sparkling Tuna Cup - Weekly Open Tournament $5,000 WardiTV TLMC tournament - Presented by Monster Energy
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 521 Memorable Boss The PondCast: SC2 News & Results Mutation # 520 Moving Fees Mutation # 519 Inner Power
Brood War
General
ASL21 General Discussion BGH Auto Balance -> http://bghmmr.eu/ Data needed A cwal.gg Extension - Easily keep track of anyone [ASL21] Ro16 Preview Pt1: Fresh Flow
Tourneys
[ASL21] Ro16 Group B [ASL21] Ro16 Group A [ASL21] Ro24 Group F [Megathread] Daily Proleagues
Strategy
What's the deal with APM & what's its true value Any training maps people recommend? Fighting Spirit mining rates Muta micro map competition
Other Games
General Games
Nintendo Switch Thread Battle Aces/David Kim RTS Megathread Stormgate/Frost Giant Megathread General RTS Discussion Thread Starcraft Tabletop Miniature Game
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
League of Legends
G2 just beat GenG in First stand
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 TL Mafia Community Thread Five o'clock TL Mafia
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Canadian Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion Cricket [SPORT] Tokyo Olympics 2021 Thread
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Reappraising The Situation T…
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 3988 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
Spain18262 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
PiGosaur Cup
00:00
#77
PiGStarcraft421
CranKy Ducklings76
EnkiAlexander 47
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft421
RuFF_SC2 172
PattyMac 12
StarCraft: Brood War
GuemChi 5767
Artosis 578
Terrorterran 14
Dota 2
febbydoto1
Counter-Strike
taco 468
minikerr4
Super Smash Bros
hungrybox661
Other Games
summit1g12170
tarik_tv5383
Day[9].tv816
shahzam379
C9.Mang0296
ViBE134
Maynarde92
Mew2King28
Organizations
Other Games
gamesdonequick604
Counter-Strike
PGL129
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Hupsaiya 93
• CranKy Ducklings SOOP5
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Azhi_Dahaki33
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Other Games
• Scarra1130
• Day9tv816
Upcoming Events
Replay Cast
7h 9m
Kung Fu Cup
10h 9m
Replay Cast
22h 9m
The PondCast
1d 8h
WardiTV Map Contest Tou…
1d 9h
CranKy Ducklings
1d 22h
Escore
2 days
WardiTV Map Contest Tou…
2 days
OSC
2 days
Korean StarCraft League
3 days
[ Show More ]
CranKy Ducklings
3 days
WardiTV Map Contest Tou…
3 days
IPSL
3 days
WolFix vs nOmaD
dxtr13 vs Razz
BSL
3 days
Sparkling Tuna Cup
4 days
WardiTV Map Contest Tou…
4 days
Ladder Legends
4 days
BSL
4 days
IPSL
4 days
JDConan vs TBD
Aegong vs rasowy
Replay Cast
4 days
Replay Cast
5 days
Wardi Open
5 days
Afreeca Starleague
5 days
Bisu vs Ample
Jaedong vs Flash
Monday Night Weeklies
5 days
RSL Revival
6 days
Afreeca Starleague
6 days
Barracks vs Leta
Royal vs Light
WardiTV Map Contest Tou…
6 days
Liquipedia Results

Completed

Proleague 2026-04-13
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
StarCraft2 Community Team League 2026 Spring
Nations Cup 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026

Upcoming

Escore Tournament S2: W3
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
RSL Revival: Season 5
2026 GSL S1
WardiTV TLMC #16
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
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.