• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:49
CET 01:49
KST 09:49
  • 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
TL.net Map Contest #21: Winners10Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7[BSL21] RO32 Group Stage4Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly2Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win10
StarCraft 2
General
Mech is the composition that needs teleportation t StarCraft, SC2, HotS, WC3, Returning to Blizzcon! RotterdaM "Serral is the GOAT, and it's not close" TL.net Map Contest #21: Winners Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win
Tourneys
Constellation Cup - Main Event - Stellar Fest Sparkling Tuna Cup - Weekly Open Tournament $5,000+ WardiTV 2025 Championship Merivale 8 Open - LAN - Stellar Fest Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle [ASL20] Ask the mapmakers — Drop your questions BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Where's CardinalAllin/Jukado the mapmaker?
Tourneys
[ASL20] Grand Finals [BSL21] RO32 Group A - Saturday 21:00 CET [Megathread] Daily Proleagues [BSL21] RO32 Group B - Sunday 21:00 CET
Strategy
PvZ map balance Current Meta How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile Should offensive tower rushing be viable in RTS games? Dawn of War IV
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 SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine The Games Industry And ATVI US Politics Mega-thread Russo-Ukrainian War Thread YouTube Thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
Formula 1 Discussion 2024 - 2026 Football Thread NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Learning my new SC2 hotkey…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Our Last Hope in th…
KrillinFromwales
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1017 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
Turkey779 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
Turkey779 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
Turkey779 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
Spain18112 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
23:00
OSC Elite Rising Star #17
ReBellioN vs HiGhDrA
Shameless vs Demi
LetaleX vs Mute
Percival vs TBD
CranKy Ducklings100
Liquipedia
BSL 21
20:00
ProLeague - RO32 Group B
spx vs rasowy
HBO vs KameZerg
Cross vs Razz
dxtr13 vs ZZZero
ZZZero.O108
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
White-Ra 328
ProTech122
UpATreeSC 67
Ketroc 21
StarCraft: Brood War
Artosis 740
ZZZero.O 108
NaDa 25
Super Smash Bros
hungrybox1476
Other Games
Grubby2922
summit1g1787
fl0m587
Maynarde128
JuggernautJason11
Organizations
Other Games
gamesdonequick1485
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Hupsaiya 93
• RyuSc2 50
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• blackmanpl 20
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21130
League of Legends
• imaqtpie3228
Other Games
• Scarra779
Upcoming Events
OSC
8h 12m
Wardi Open
11h 12m
Wardi Open
15h 12m
Replay Cast
22h 12m
WardiTV Korean Royale
1d 11h
Replay Cast
2 days
Kung Fu Cup
2 days
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
2 days
The PondCast
3 days
RSL Revival
3 days
Solar vs Zoun
MaxPax vs Bunny
[ Show More ]
Kung Fu Cup
3 days
WardiTV Korean Royale
3 days
Replay Cast
3 days
RSL Revival
4 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
4 days
CranKy Ducklings
5 days
RSL Revival
5 days
herO vs Gerald
ByuN vs SHIN
Kung Fu Cup
5 days
BSL 21
5 days
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
6 days
RSL Revival
6 days
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
6 days
WardiTV Korean Royale
6 days
BSL 21
6 days
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
Liquipedia Results

Completed

Proleague 2025-11-07
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
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.