Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2024-04-22 00:00:00Z and 2024-04-23 00:00:00Z
Avatar
idk chiller
00:42
but have u ever tried to do substitution in an associative array subscript
00:42
it's not working for me
Avatar
ws-client BOT 2024-04-22 00:42:57Z
<ChillerDragon> in bash?
00:43
<ChillerDragon> @Ewan send ur code
00:43
<ChillerDragon> Dude matricks code is nuts he is just too cool to use the modulo operator like anyone else
00:43
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
Avatar
echo ${!argv[$arg]} bad array subscript error
Avatar
ws-client BOT 2024-04-22 00:43:46Z
<ChillerDragon> while(Size & 3)
00:43
<ChillerDragon> how is argv defined?
Avatar
declare -A argv for i in $#; do argv["$@[$i]"]=$i done
00:44
i store arg names as keys and their indices as values
00:44
so i don't have to reiterate to find index
Avatar
ws-client BOT 2024-04-22 00:44:50Z
<ChillerDragon> why do you need the index?
Avatar
positional argument
00:45
--output whatever
00:45
need to get next
Avatar
ws-client BOT 2024-04-22 00:45:09Z
<ChillerDragon> so you can do +1
00:45
<ChillerDragon> i see
Avatar
ws-client BOT 2024-04-22 00:45:21Z
<ChillerDragon> i use shift for that but lets look at ur code first
00:45
<ChillerDragon> what do you want echo ${!argv[$arg]} to print?
00:45
<ChillerDragon> and whats in arg
Avatar
arg should be the regex match of my requested expression ('--output'.*|'-o'.*) if defined as --output=whatever it would be --output=whatever if defined as --output whatever it would be --output
00:46
i am not trying this subscript if defined w/ equals obviously
00:48
if [[ ${!argv[*]} =~ '--output'.*|'-o'.* ]]; then arg="${BASH_REMATCH[1]}" # -o=x if [[ $arg == *'='* ]]; then # this line does not work outpath="${arg#*=}" # -o x else next=$(expr ${!argv["$arg"]} + 1) outpath="${argv[$next]}" fi fi
00:48
it'd be like that
Avatar
ws-client BOT 2024-04-22 00:48:46Z
<ChillerDragon> I don't think this line does what you think it does argv["$@[$i]"]=$i
Avatar
it should do like $@[1]=1
00:49
and so on
Avatar
ws-client BOT 2024-04-22 00:50:01Z
<ChillerDragon> for i in 3
00:50
<ChillerDragon> you cant for loop a integer like that
00:50
xddd
00:50
.. (edited)
00:51
that's not even something i didn't know i just neglected to change it from stuff i was doing earlier
Avatar
ws-client BOT 2024-04-22 00:51:02Z
<ChillerDragon> for((i=0;i<$#;i++)); do
Avatar
ws-client BOT 2024-04-22 00:53:32Z
<ChillerDragon> But i still don't think you can index @ like that
00:54
sad
Avatar
ws-client BOT 2024-04-22 00:55:04Z
<ChillerDragon> $ bash -c 'echo "${@[0]}"'
00:55
<ChillerDragon> bash: line 1: ${@[0]}: bad substitution
00:55
<ChillerDragon> i would read it with mapfile
00:55
<ChillerDragon> into a regular array
00:55
<ChillerDragon> then it should work
00:58
i can do like $@[${!i}]
Avatar
ws-client BOT 2024-04-22 00:58:44Z
<ChillerDragon> wtf that works?
00:59
<ChillerDragon> is this what you want?
Avatar
or so i thought
00:59
yeah
Avatar
extra array kills me
Avatar
ws-client BOT 2024-04-22 01:01:29Z
<ChillerDragon> ye @ is a bit magic not a regular array
Avatar
i think it would be faster to iterate over arguments themselves
01:02
add them and then keep my own index
01:03
can i have it behave like multimap?
Avatar
ws-client BOT 2024-04-22 01:04:04Z
<ChillerDragon> Multeasymap
Avatar
ws-client BOT 2024-04-22 01:04:11Z
<ChillerDragon> bro uses bash and thinks about speed
Avatar
std::multimap like
Avatar
ws-client BOT 2024-04-22 01:04:14Z
<ChillerDragon> i do it like this btw
Avatar
ws-client BOT 2024-04-22 01:05:13Z
<ChillerDragon> there are also libs for that
01:06
<ChillerDragon> i never tried it because i never ran into limits with my self rolled approach but just you know there is https://argbash.readthedocs.io/en/stable/
Avatar
interesting
01:07
libraries defeat the purpose of bash imo
Avatar
ws-client BOT 2024-04-22 01:08:18Z
<ChillerDragon> ye ikr xd
01:08
<ChillerDragon> but then if you also want opt= you need to write more code like for example
01:08
<ChillerDragon> aa without shift
Avatar
6c801ed update czech translations for 18.2 - dobrykafe 7bd5bef update slovak translations for 18.2 - dobrykafe 49ad920 Merge pull request #8244 from dobrykafe/pr-18.2-translations - def-
Avatar
ws-client BOT 2024-04-22 01:17:23Z
<ChillerDragon> you can also have positional options and flags all together in 60 lines of bash xd
Avatar
yeah chiller i just ended up refactoring the argument parsing stuff
02:00
to iterate at the beginning instead of finding as needed
02:00
elif [[ "$arg" =~ '--output'.*|'-o'.* ]]; then if [[ "$arg" == *'='* ]]; then output_directory="${1#*=}" else output_directory="${2}" shift fi shift
02:00
this works for me
Avatar
ws-client BOT 2024-04-22 02:01:34Z
<ChillerDragon> ah that looks neat
Avatar
thx for ur help man
Avatar
ws-client BOT 2024-04-22 02:03:18Z
<ChillerDragon> you do not need .* in your regex btw
02:03
<ChillerDragon> even without the regex you already match --outputtinger
Avatar
script complete
02:48
git "sparse clone"
02:51
ewan@machine ~/git-sparse-clone> git-sparse-clone https://github.com/DDNet/DDNet /README.md -o DDNet-Readme Cloning into 'DDNet-Readme'... ... ewan@machine ~/git-sparse-clone> cd DDNet-Readme/ ewan@machine ~/g/DDNet-Readme (master)> ls README.md (edited)
Avatar
i heard gists are bad for networking so im just gonna start putting shit like this in their own repos https://github.com/ewancg/git-sparse-clone
03:01
hi
03:01
it is 9 pm for me but i hope u enjoy ur morning
Avatar
not really, it's 6 am and i didn't even try to get myself sleeping
Avatar
i'll start smoking at that point xd
Avatar
at what point
Avatar
efdaa39 Faster rsync by not removing - def-
Avatar
8e0909e Don't transmit useless parts - def-
Avatar
morning 🍵
Avatar
ws-client BOT 2024-04-22 06:05:10Z
<ChillerDragon> @Ewan you dont need to printf a string to compare it to another one https://github.com/ewancg/git-sparse-clone/blob/1a1df6916fbeddf48407cdf96c1ca61e2ac4e26b/git-sparse-clone.sh#L62
Retrieve only specified files and directories from a Git repository - ewancg/git-sparse-clone
06:05
<ChillerDragon> [ "$(printf "foo")" = "foo" ] is the same as [ "foo" = "foo" ]
06:06
i think that was residual from a formatted printf i switched over from
Avatar
ws-client BOT 2024-04-22 06:12:54Z
<ChillerDragon> @Ewan wat dis do if [ -z "$GIT" ]; then
Avatar
git envvar
06:13
if not in path
06:13
specify directly
06:13
<ChillerDragon> did you forget to use it here?
Avatar
ws-client BOT 2024-04-22 06:14:07Z
<ChillerDragon> you wrote almost 100 lines of bash to wrap one git clone command? :D
06:14
<ChillerDragon> average bash dev
Avatar
it's a few
06:14
but yeah
06:14
argument parsing is the pain
06:14
would have been 50 lines of rust or smth
Avatar
ws-client BOT 2024-04-22 06:14:42Z
<ChillerDragon> xd
06:14
<ChillerDragon> rewrite in rust
Avatar
but not script
06:15
would have to provide binaries n shit
06:15
defeats the point
Avatar
ws-client BOT 2024-04-22 06:15:29Z
<ChillerDragon> i think it is time i switch my terminal shell
06:15
<ChillerDragon> from bash to rust
Avatar
fwiw, it's probably easier to think about in terms of bitwise and here since we are aligning an address
Avatar
Avatar
Ewan
would have to provide binaries n shit
Python would have been a good candidate for this if it wasn't so shit, maybe Perl?
08:29
it's just intended to be as easy as possible
08:29
and if ur seeking out bash scripts there are no extra prerequisites for running bash scripts
08:29
so it's just nice like that. it's kinda why i've always gravitated towards it
Avatar
Yeah, bash scripts are solid
08:32
If you only use short options, getopts is POSIX
08:33
eventually i will use something like that
Avatar
Tbf it looks good as is. I'm just yapping
Avatar
i've written like 15 different fucking arg parsing systems
08:34
im sick of it
Avatar
Avatar
Learath2
Tbf it looks good as is. I'm just yapping
😃
Avatar
btw live frezze it is tile where u cant move, but can hook shoot and etc. it is weird but why u skip usual live frezze and add instand deep and undeep live frezze? maybe u will add new tile where u cant move 3 seconds and then autounfreeze? (this tile will perfect for my new map)
Avatar
can we close this issue
👍 5
Avatar
как создать комнату чтобы с друзьями грать
🫡 1
Avatar
Avatar
Nitka
как создать комнату чтобы с друзьями грать
Use /Team [1-63] /Lock and /invite [Name]
Avatar
176.9.114.238:8330 is an official DDNet server. https://ddnet.org/connect-to/?addr=176.9.114.238:8330/
Avatar
The iconic IC device, developed by Federico Faggin, will soon be phased out, and interested parties only have a few months left to place their orders before...
FernShock 2
Avatar
i wonder what casio will use now in their calculator
Avatar
idk but it had a pretty good run
Avatar
Avatar
Chairn
i wonder what casio will use now in their calculator
ez80
14:17
Probably And I'm sure it won't be hard to find clones
Avatar
it's not even hard to make clones either with fpga or just complete silicium clones if you have some engineers dedicated to it
Avatar
fpga much pricier no?
14:47
they probably switch to another processor
14:47
not hard to write a calculator
Avatar
Avatar
Chairn
it's not even hard to make clones either with fpga or just complete silicium clones if you have some engineers dedicated to it
I'm curious. Do modern fpgas have enough gates to simulate these older chips?
Avatar
way more than necessary
15:47
a z80 probably has around 2k gates
15:48
smallest fpga we use at university have around 6k LUTs (not same as gates, but similar in number for the same function)
Avatar
That's so cool. I really should learn some fpga programming one day
Avatar
there is not such thing as fpga programming
15:48
only hardware description
Avatar
Well, it's in the name, they are field programmable gate arrays. I meant programming in that sense, not in the regular sense
Avatar
there are some fpga z80 in github, but they don't say how much ressource they use https://github.com/Obijuan/Z80-FPGA https://github.com/gdevic/A-Z80
Avatar
FPGA 8-Bit TV80 SoC for Lattice iCE40 with complete open-source toolchain flow using yosys and SDCC - abnoname/iceZ0mb1e
Avatar
@Chairn that's what I was about to ask next. As you said LUTs I was curious how their power consumption compares to gates in the regular sense, say cmos logic
Avatar
more consumption because they are small memories, not just gates with 6 or 8 transistors
Avatar
Heh, I have another question to follow that up. How do they differ in function to just a block of sram? You can use the address bits for input and data bits as the output to emulate a lot of things
Avatar
they don't differ in functional way. They can differ in technology as some fpga use flash lut and some uses fused luts
15:56
nowadays, it's mostly sram luts
Avatar
Avatar
Chairn
nowadays, it's mostly sram luts
So is it more a tooling sort of thing that separates an fpga from just any random sram chip? I also remember you can configure pins to have different electrical characteristics
Avatar
fpga is luts, registers and routing
16:03
a sram chip is just memory
Avatar
Ah, registers and routing is what is different?
Avatar
registers are also memories but clocked ones, routing is what allows you to connect everything to do what you want
Avatar
Upload still seems to work but our settings may be outdated: ``` Warning: Unexpected input(s) 'gcov', 'gcov_include', valid inputs are ['token', 'codecov_yml_path', 'commit_parent', 'directory', 'disable_file_fixes', 'disable_search', 'disable_safe_directory', 'dry_run', 'env_vars', 'exclude', 'fail_ci_if_error', 'file', 'files', 'flags', 'git_service', 'handle_no_reports_found', 'job_code', 'name', 'network_filter', 'network_prefix', 'os', 'override_branch', 'override_build', 'override_b...
18:03
See commit messages.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet...
Avatar
Update Turkish translations (by Gokturk)

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memche...
Avatar
@Gokturk delete the repository only after it has been merged please :P it autocloses the PR (edited)
Avatar
Update Turkish translations for 18.2

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](...
Exported 188 message(s)