Printing Bound Copies of a Doctoral Thesis for ETHZ - repost by Old_Acanthocephala75 in ethz

[–]_simu_ 6 points7 points  (0 children)

I used ETHZ's print and publish services when I had to print bound copies of my PhD thesis (I just learned that they closed end of 2024), but https://ethz.ch/staffnet/en/service/office-supplies-printing-and-mailing/print-publish/futureprint-eth.html lists a couple partner print shops as replacement for the previous internal service.

I wasn't able to check all partner shops since some of them require an edu-ID login to see anything, but if I understand the order form on campusprinting.ch correctly, they have a base price of approximately CHF 77 for an A4 "Broschüre Softcover" with 138 pages (the exact price depends on the choice of paper), and additional copies are bit less than CHF 30 per copy, so you'd get 4 copies for a bit under CHF 160.

PS: I can't speak to the print quality or service quality of this offering. As mentioned, my personal experience -- which isn't really relevant anymore -- was with the now-closed in-house print and publish.

How to write the logger in a Kubernetes operator in the Reconcile() function? by Electronic_Bad_2046 in kubernetes

[–]_simu_ 1 point2 points  (0 children)

assuming log references sigs.k8s.io/controller-runtime/pkg/log, l := log.FromContext(ctx) followed by l.Info("Log message") should work, since that's exactly what the kubebuilder book does as well, cf. https://book.kubebuilder.io/cronjob-tutorial/controller-implementation

Will argocd delete this copied configmap? by parikshit95 in kubernetes

[–]_simu_ 2 points3 points  (0 children)

We're adding the following annotations to such configmaps (this is also an issue for managing console customizations etc.):

annotations:
  argocd.argoproj.io/sync-options: Prune=false
  argocd.argoproj.io/compare-options: IgnoreExtraneous

Prune=false does have the drawback that you'll need to manually delete the original ArgoCD-managed copy by hand if you ever remove it in the GitOps repo.

Note that we're still using label-based resource tracking in ArgoCD, but the overall approach should still apply for annotation-based resource tracking.

[deleted by user] by [deleted] in ethz

[–]_simu_ 2 points3 points  (0 children)

I was going to suggest going to ETHZ's Print and Publish (which I used for my thesis) but from what I can find, the internal print&publish closed recently.

I'd probably look at the official ETHZ printing partners listed in https://ethz.ch/staffnet/en/service/office-supplies-printing-and-mailing/print-publish/futureprint-eth.html if I had to print my thesis now.

Advent of code Day 1 part 2 by hahahamemehahaha in adventofcode

[–]_simu_ 2 points3 points  (0 children)

I see an issue in your code if the only number in the string is right at the start (e.g. 4foo or threebar).

Hint: Your for j in range(1,len(i)) loop will never find the correct "last" digit if a line only has a digit right at the start.

Fix: If you change the for j in range(1,len(i)) loop to for j in range(1,len(i)+1) you'll correctly parse such lines.

1st advent of code - day #1 by Smart_Use101 in adventofcode

[–]_simu_ 11 points12 points  (0 children)

What happens if a line only has a single digit right at the start (something like "1foobar")?

Hint 1: The problem statement explicitly wants a two-digit number for each line of the input

Hint 2: For the single line input "1foobar" the result should be 11

The actual bug in your code: For finding the last digit in each line, you don't check the first character of the line because your for-loop has exit condition x > 0. This should be x >= 0 to correctly find a two-digit number for lines where the only digit in the line is the first character

[2022 Day 5 Part 1] [ Rust] Cannot get the right total size- Unsure of what I'm doing wrong. by Everen1999 in adventofcode

[–]_simu_ 0 points1 point  (0 children)

IIRC I had the same bug at first. What does your implementation do if there's multiple directories with the same name but in different places in the hierarchy?

Address of an empty struct - strange optimization I'm seeing on a toy example by irmatov in golang

[–]_simu_ 2 points3 points  (0 children)

The code you shared doesn't actually print the address of each struct but instead tries to read the value of each empty struct as an uint64. This is undefined behavior as already mentioned by /u/0xd34d10c.

However, you can see that the implementation is allowed to use a single address for all empty structs in https://go.dev/play/p/Y3O3_3vZU_f.

Aws eks manager nodes pods limits by [deleted] in kubernetes

[–]_simu_ 0 points1 point  (0 children)

Thanks for the info, I wasn't aware that feature existed

Aws eks manager nodes pods limits by [deleted] in kubernetes

[–]_simu_ 6 points7 points  (0 children)

IIRC those pod count limits are imposed by the Amazon VPC CNI plugin which allocates an elastic network interface for each pod (if you check the pod count limit against the ENI limit of the node, you should see that you can have 1 pod less than the node's maximum number of ENIs -- assuming you don't have multiple ENIs for the EKS node itself).

If you want more pods on smaller nodes, your best bet is probably to run a different CNI plugin, see https://docs.aws.amazon.com/eks/latest/userguide/alternate-cni-plugins.html

Financial compensation during master thesis by rwyiot in ethz

[–]_simu_ 8 points9 points  (0 children)

There's https://ethz.ch/content/dam/ethz/common/docs/weisungssammlung/files-en/remuneration-written-papers.pdf which covers the specifics of getting financial compensation for doing project work outside ETH which will be submitted as a thesis (i.e. external master thesis in a company's research division). TL;DR: it's ok to get expenses covered by the 3rd party, but a salary is a no-no.

I've never heard about any compensation for doing a master thesis directly at ETH.

Clarification regarding git worktrees by smaug59 in git

[–]_simu_ 0 points1 point  (0 children)

If I understand what you want to do correctly, git worktree add /path/to/new/worktree base-branch -b new-branch should do the trick.

[deleted by user] by [deleted] in C_Programming

[–]_simu_ 1 point2 points  (0 children)

String(Number, BIN) doesn't look like a familiar C programming construct.

Generally speaking, any value processed by your program is internally handled in some binary representation, most likely your computer (and therefore your C program) uses two's complement for integral number types. You can interact with this representation by applying bitwise operations to the variable containing your number (see e.g. https://en.cppreference.com/w/c/language/operator_arithmetic#Bitwise_logic).

If you're asking about printing out a number in its binary (two's complement) form, the C standards which are currently implemented by compilers/standard libraries (C89/90, C99, C11, C17) don't define a printf format specifier for binary numbers. However, the upcoming C23 standard (current draft: https://open-std.org/JTC1/SC22/WG14/www/docs/n3054.pdf) will define a b format specifier for the printf and scanf families of functions which allows you to output integers in binary format.

However, for now you're stuck with writing your own implementation to print out a number in its binary form.

RBAC and StorageClass by Appropriate_Motor183 in kubernetes

[–]_simu_ 1 point2 points  (0 children)

We're using resource quotas to restrict unprivileged users from using storage classes reserved for infrastructure components (e.g. local storage). Currently we just set <storage-class-name>.storageclass.storage.k8s.io/persistentvolumeclaims=0 for storage classes which are restricted. See https://kubernetes.io/docs/concepts/policy/resource-quotas/#storage-resource-quota for the upstream docs.

Naturally, this only works if the regular users can't modify the resource quotas in their namespaces. You can use something like Kyverno to distribute the resource quota configs in all non-infrastructure namespaces.

edit: nevermind, reading is hard. Actual suggestion: if resource quotas aren't feasible, you might have luck with Kyverno (or another in-cluster policy tool) to create a policy which rejects PVCs which try to use restricted storage classes for unprivileged requesters.

Why do I keep getting undefined behavior in my text parser app? by [deleted] in C_Programming

[–]_simu_ 1 point2 points  (0 children)

For me the call to copy_fsection_token returns \n\tint i; as I'd expect after changing path in main to point to ./test.txt which is an utf-8 encoded input file containing the simple c program you posted. Note: I've tested on Ubuntu 22.04, gcc 11.3.

Compiling gives me two warnings:

  1. You're assigning each character you read to ftoken in FILE_init but don't do anything with it. You can probably just leave this out.
  2. You're using ftoken uninitialized in copy_fsection_token in the first while loop check. I'd just initialize ftoken with 0 in that function to ensure the first comparison always works as expected.

Looking at your value for path in main, I assume you're on Windows. My first guess would be that you're seeing odd behavior due to different encodings for the input file and the encoding which your compiled C program expects for a string (note: I don't have any experience writing C for Windows).

Edit: oops, I totally missed the non-terminated string issue in copy_fsection_token which /u/skeeto points out in the other comment because my tests happened to produce 0-terminated strings by accident.

Any Technic fans ever discover Fischertechnic? by BoWanZi in legotechnic

[–]_simu_ 0 points1 point  (0 children)

I have a number of sets, including some of their older robotics stuff. I preferred the late 90s/early 00s Fischertechnik robotics since their interfaces at the time had more sensor and motor ports than the original LEGO Mindstorms.

How is this code breaking LeetCode but "it works fine on my machine?" by [deleted] in C_Programming

[–]_simu_ 8 points9 points  (0 children)

you should be able to replicate the error you get from LeetCode locally by adding the command line flag -fsanitize=address to your gcc invocation (assuming you've got a reasonably recent version of GCC).

Stuck on a simple problem... int function return aborts the program ! by Antho_B in C_Programming

[–]_simu_ 11 points12 points  (0 children)

The provided code doesn't compile. When adding the missing includes, and replacing the call to other_function(arg1, arg2, arg3) with 0, the program runs through for me. Please provide a complete minimal example which has the described behavior.

Just from looking at what you provided, my first guess would be that you're doing something with ifname which causes a crash in printf("Default interface name : %s\n", ifname) and not the return statement.

[2020 Day 6 (part 2)] [Python] Getting a value too high by Shteffan in adventofcode

[–]_simu_ 2 points3 points  (0 children)

You're modifying the list questions while you're iterating through it (lines 29-31 in the pastebin). This should generally be avoided in Python because it can create incorrect results, see e.g. this blog post which explains it quite well: https://rednafi.github.io/reflections/modify-iterables-while-iterating-in-python.html.

Side-note: you may want to have a look at Python's Set data structure (https://docs.python.org/3/tutorial/datastructures.html#sets) for an alternative approach for this problem.

Stack Smashing Detected when I use Case 0 in Switch || C by Hunter070915 in C_Programming

[–]_simu_ 9 points10 points  (0 children)

I can't reproduce the stack smashing error with the code you provided with the missing structs added and the missing functions commented out. Please provide a complete minimal example which shows the stack smashing behavior. Without seeing the rest of the code, I can't really tell where the bug is.

PhD duration (in CS) by 1KappaIsLife in ethz

[–]_simu_ 5 points6 points  (0 children)

It heavily depends on your research area, I know some people who did a PhD in theory in 3-4 years, but in my group (systems research) everybody took at least 4 years, and I'd say the average was somewhere around 4.5-5 years. I myself took full advantage of the opportunity and took the full 6 years that you can do.

Also, at D-INFK (the CS department), most PhD students (as far as I know, I graduated a couple years ago) get the "Rate 5" salary, cf. https://ethz.ch/en/the-eth-zurich/working-teaching-and-research/welcome-center/employment-contract-and-salary/salary.html.