• 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: 534 users

The Big Programming Thread - Page 754

Forum Index > General Forum
Post a Reply
Prev 1 752 753 754 755 756 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.
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
Spain17970 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 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 608
League of Legends
JimRising 745
Counter-Strike
Stewie2K1027
Heroes of the Storm
Khaldor237
Other Games
WinterStarcraft650
SortOf103
kaitlyn77
ProTech53
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH367
• Hupsaiya 91
• Sammyuel 42
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• lizZardDota2175
League of Legends
• Lourlo1363
• masondota2816
• Stunt507
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.