• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:36
CEST 03:36
KST 10:36
  • 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: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12TL.net Map Contest #22 - Voting & Ladder Map Selection7Code S Season 2 (2026) - RO8 Preview8[ASL21] Finals Preview: Two Legacies21
Community News
ZeroSpace at Steam NextFest - Last free demo20Weekly Cups (June 8-14): Clem and Solar double, PTR tested0RSL: S6 Finals played at BlizzCon 202611Douyu Cup 2026: $20,000 Legends Event (June 26-28)10[BSL22] Non-Korean Championship from 13 to 28 June4
StarCraft 2
General
Is the larve respawn broken? Yamato Cup Series What kind of tool would you be interested in? StarCraft II 5.0.16 PTR Patch Notes may 26th Daily SC2 Player Grid - feedback wanted
Tourneys
GSL CK #4 20-21th June Sparkling Tuna Cup - Weekly Open Tournament Master Swan Open (Global Bronze-Master 2) Crank Gathers Season 4: BW vs SC2 Team League Douyu Cup 2026: $20,000 Legends Event (June 26-28)
Strategy
[G] Having the right mentality to improve
Custom Maps
Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 531 Experimental Artillery Mutation # 530 One For All Mutation # 529 Opportunities Unleashed
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ STARCRAFT MOVIE - Last Night at the Command center BW General Discussion Battle cruiser feet vs Carrier fleet Fact based Zerg Upgrade Tier List
Tourneys
CSLAN 4 is Coming! [Megathread] Daily Proleagues Small VOD Thread 2.0 The Casual Games of the Week Thread
Strategy
Why doesn't anyone use restoration? Simple Questions, Simple Answers Relatively freeroll strategies Creating a full chart of Zerg builds
Other Games
General Games
ZeroSpace at Steam NextFest - Last free demo Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile ZeroSpace Megathread
Dota 2
Looking for a Dota Mentor 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
TL Mafia
Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread [H]Internet/Gaming Cafe Tips and Tricks The Games Industry And ATVI UK Politics Mega-thread
Fan Clubs
The HerO Fan Club! The herO Fan Club!
Media & Entertainment
Movie Discussion! [Req][Books] Good Fantasy/SciFi books [TV/BOOK] *SPOILERS* Game of Thrones Discussion
Sports
2024 - 2026 Football Thread McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion Cricket [SPORT]
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Facing Challenges in Mobile App Development
TL Community
The Automated Ban List
Blogs
How To Predict Tilt in Espor…
TrAiDoS
An Exploration of th…
waywardstrategy
I'm an arrogant trash talke…
FlaShFTW
Gauntlet SC2: A Retrospectiv…
Ctone23
Why RTS gamers make better f…
gosubay
Customize Sidebar...

Website Feedback

Closed Threads



Active: 22935 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
Spain18320 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
Replay Cast
00:00
GSL CK #4 - Day 2
CranKy Ducklings105
EnkiAlexander 66
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech103
StarCraft: Brood War
Rain 3686
GuemChi 3497
NaDa 21
Terrorterran 8
Dota 2
NeuroSwarm107
League of Legends
Doublelift6530
JimRising 559
Counter-Strike
summit1g13376
Other Games
Grubby2648
PiGStarcraft810
C9.Mang0751
Artosis592
Maynarde135
Livibee126
RuFF_SC216
ViBE6
Organizations
Other Games
gamesdonequick4705
BasetradeTV290
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 13 non-featured ]
StarCraft 2
• Hupsaiya 57
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Pr0nogo 7
• RayReign 6
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Upcoming Events
WardiTV Weekly
9h 24m
Monday Night Weeklies
14h 24m
Sparkling Tuna Cup
1d 8h
The PondCast
2 days
Douyu Cup 2020
3 days
Oliveira vs Trap
Jieshi vs XY
soO vs FanTaSy
TY vs Coffee
Douyu Cup 2020
4 days
Neeb vs Impact
MacSed vs Cyan
Scarlett vs Kelazhur
INnoVation vs Dear
Douyu Cup 2020
5 days
Maestros of the Game
5 days
herO vs Classic
Maru vs Serral
BSL22 NKC (BSL vs China)
5 days
Douyu Cup 2020
6 days
[ Show More ]
BSL22 NKC (BSL vs China)
6 days
Online Event
6 days
Liquipedia Results

Completed

Acropolis #4
WardiTV Spring 2026
Heroes Pulsing #2

Ongoing

IPSL Spring 2026
CSCL: Masked Kings S4
YSL S3
BSL 22 Non-Korean Championship
CSL Season 21: Qualifier 1
SCTL 2026 Spring
Maestros of the Game 2
Murky Cup 2026
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
IEM Rio 2026
PGL Bucharest 2026

Upcoming

CSL Season 21: Qualifier 2
CSL 2026 Summer (S21)
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
HSC XXIX
Douyu Cup 2026
BCC 2026
Light HT
Heroes Pulsing #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 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.