728 Matching Annotations
  1. Last 7 days
    1. Use the Get-ChildItem cmdlet with the -Recurse switch: Get-ChildItem -Path V:\Myfolder -Filter CopyForbuild.bat -Recurse -ErrorAction SilentlyContinue -Force

      Useful PowerShell command to do recursive file search in Windows through PowerShell.

  2. Nov 2022
    1. dsmdavid commented Mar 8, 2021 @tchakabam if you right click on the status bar, do you get many options? Might be worth not showing some of the other options (in my case the line/column was not shown because there were too many options already there) and, after unselecting one:

      Post about status bar in VS Code (visible at bottom of window by default).

      I looked for this since I couldn't figure out the column numbers of where my cursor was in the editor.

      You can toggle this setting by opening command palette and searching "View: Toggle Status Bar Visibility"

      Displays Ln & Col numbers.

    1. You can also go to the Ruby OAuth Client Library to download the source code and run: 1gem build intuit-oauth.gemspec to build your own gem if you want to modify certain functions in the library.
    1. Louis Burki 6 months ago (edited) I have make some changes to make it work, because I had a similar error. First, I have add a ":" before the "=" in the Text variable at the beginning of the script. Now it looks like that: "Text:=". Then I have put double quotes around (**your snippets**) so now it looks like this "(***your snippets***)". Then, I also changed the sort line to make it look that: Text:= sort(Text). And now it works as intended. Also, be careful not to remove the pipe symbol in your snippets.

      Someone giving a troubleshooting solution to using Joe Glines' Auto Hotkey script that inserts text from a list of the user's choosing. The problem another user had was including it in their main script file, but this was resolved with Louis Burki's answer

    1. You can then edit files in that repository and commit and push them like this: cd 0a30d52feeb3ff60f7d8636b0bde296b # Edit files here git commit -m "Edited some files" -a git push
    2. But if you want to be able to make local edits and then push them back, you need to use this recipe instead: git clone git@gist.github.com:0a30d52feeb3ff60f7d8636b0bde296b.git You can find this in the "Embed" menu, as the "Clone via SSH" option.
    3. You can clone them anonymously (read-only) just using their URL: git clone https://gist.github.com/simonw/0a30d52feeb3ff60f7d8636b0bde296b
    1. Run in WSL to return current total "word count": find /mnt/c/path/to/obsidian -type f -name "*.md" -exec cat '{}' \+ | wcThis will also count words in syntax - like the word "query" in an embedded query. In fact it probably counts anything separated by whitespace as separate words. But you could do some preprocessing between the cat and the wc if you like.

      Linux command for WSL to count all lines, words count, & character count. OP states at end -wc restricts to word count only

    1. A second problem is that once your process has exited, Bash will proceed to exit as well. If you're not being careful, Bash might exit with exit code 0, whereas your process actually crashed (0 means "all fine"; this would cause Docker restart policies to not do what you expect). What you actually want is for Bash to return the same exit code your process had.
    1. 10 Best Low-Code Development Platforms To Use in 2023 Are you looking for a Top Low-code development platforms. Each platform has its own strengths and weaknesses, so make sure to choose the one that best suits your needs. In this article, we will present the 10 best low-code development platforms that are worth considering in 2023. https://bit.ly/3DFc1E6

  3. Oct 2022
    1. Several templates and tools are available to assist in formatting, such as Reflinks (documentation), reFill (documentation) and Citation bot (documentation)

      I clicked the link for reFill and thought it looked interesting. Would like to look into this further.

    1. You may need pathname2url

      (Author:: [[neurino on Stack Overflow]]) python from urllib.request import pathname2url pathname2url('dir/foo, bar.mp3')

    1. L'échelle des sanctions fixée à l'article R. 511-13 du code de l'Éducation est reproduite dans le règlement intérieur. Toutefois, le juge administratif (CE, 16 janvier 2008, MEN c/Mlle Ayse A, n° 295023) considère que, même en l'absence de toute mention dans le règlement intérieur, l'échelle des sanctions réglementaires est applicable de plein droit.
    1. Functions are much more flexible than aliases. The following would overload the usual ls with a version that always does ls -F (arguments are passed in $@, including any flags that you use), pretty much as the alias alias ls="ls -F" would do: ls () { command ls -F "$@" }
  4. Sep 2022
    1. First, to clarify - what is "code", what is "data"? In this article, when I say "code", I mean something a human has written, that will be read by a machine (another program or hardware). When I say "data", I mean something a machine has written, that may be read by a machine, a human, or both. Therefore, a configuration file where you set logging.level = DEBUG is code, while virtual machine instructions emitted by a compiler are data. Of course, code is data, but I think this over-simplified view (humans write code, machines write data) will serve us best for now...
    1. Writing Code for Humans — A Language-Agnostic Guide…because code which people can’t read and understand is easy to break and hard to maintain.
    1. I don't like the first syntax because then you have weird looking code due to all the leading whitespace, and you lose a lot of real estate.
    2. Aligning everything with however long the method name is makes every indention different. belongs_to :thing, class_name: 'ThisThing', foreign_key: :this_thing_id has_many :other_things, class_name: 'ThisOtherThing', foreign_key: :this_other_thing_id validates :field, presence: true Compared to the following, which all align nicely on the left. belongs_to :thing, class_name: 'ThisThing', foreign_key: :this_thing_id has_many :other_things, class_name: 'ThisOtherThing', foreign_key: :this_other_thing_id validates :field, presence: true
    3. This one bugs me a lot, but honestly, I don't like either style of the "normal method calls" above. I'm definitely voting to change the rule, but I'd also recommend trying to use the following syntax. In my opinion, it's the best of both worlds. a_relatively_long_method_call( :thing, :another_thing ) Or, if there are a lot or arguments, or the arguments are long: a_relatively_long_method_call( :a_long_argument, :another_long_argument, :a_third_long_argument )
    1. In collusion, writing good code not only require knowledge but also require compassion. To understand people's pain and mistakes, to think about your teammate and to help everyone achieve a better life.
    2. Think about how good it is if you can build a system at “2 half brain quality” and then people just need use 1 half of their brain to maintain it. You can fix bug in a blink of an eye, run tests and give it to tester, done. Everything will be done in a easiest way and fixing bug or refactoring can be easy like breathing. The most heavy task in programming is not about building application, but it’s about maintain them and if you wrote something you can’t understand, then you will suffer for the rest of your life.
    3. Write code for human, not for God
    1. your cognitive load increases with the level of indentation. 1 2 3 4 5 6 7 8 9 10 if r.Method == "GET" { if r.Header.Get("X-API-KEY") == key { // ok return nil }else{ return errors.New("Key is not valid") } } else { return errors.New("Invalid Method") }
    2. Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
    3. To see if you are writing good code, you can question yourself. how long it will take to fully transfer this project to another person? If the answer is uff, I don’t know… a few months… your code is like a magic scroll. most people can run it, but no body understand how it works. Strangely, I’ve seen several places where the IT department consist in dark wizards that craft scrolls to magically do things. The less people that understand your scroll, the more powerfully it is. Just like if life were a video game.
    4. Avoid indentation levels, If you find yourself with more than 3, you should create a function.
    5. Code explains what and how Documentation explains why.
    6. This is so clear that you don’t even need comments to explain it.
    7. Another type of comments are the ones trying to explain a spell.
    8. Do you really need those lines? Isn’t it clear enough? Well, I still find comments like this in a lot of cases and it gets funnier when the comment is obsolete and the code is doing other things. Following the example, let’s imagine that another developer adds support for PUT method. I think that this is what would happen.
    9. The rule of thumbs is, never use code that you do not understand.
    1. For example, whereas C programmers have argued for years about where to put their brackets, and whether code should be indented with tabs or spaces, both Rust and Go eliminate such issues completely by using a standard formatting tool (gofmt for Go, rustfmt for Rust) which rewrites your code automatically using the canonical style. It’s not that this particular style is so wonderful in itself: it’s the standardisation which Rust and Go programmers appreciate.
  5. Aug 2022
    1. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge.
    2. Each commit should meet the following criteria: Have a well-written commit message. Has all tests passing when used on its own (e.g. when using git checkout SHA). Can be reverted on its own without also requiring the revert of commit that came before it. Is small enough that it can be reviewed in isolation in under 30 minutes or so.
    1. Don’t make claims unless you can cite documentation, formalized guidelines, and coding examples to back those claims up. People need to know why they are being asked to make a change, and another developer’s personal preference isn’t a good enough argument.
    1. A recent study [25]of more than a million notebooks in public GitHub reposito-ries found many indicators of poor quality, some of whichsupport earlier criticisms of notebooks encouraging bad soft-ware engineering habits
    1. perhaps the mostfrequent motivation for adding dependencies in layer-3 soft-ware is the desire to write less code oneself
    1. This describes one of the most pleasing hacks I've ever come across. I just now tracked it down and added it to my bookmarks. (Not sure why it wasn't already there.)

      You could also conceive of going one step further. When your app (doesn't actually have to be a game, though admittedly it's much easier for you if it is) is compiled with tweak.h, it gives it the power to paint the source file on the screen—so you don't actually have to switch over to your text editor to save it, etc. Suppose you want to provide custom inputs like Bret Victor-style sliders for numeric values. You could edit it in your text editor, or you could derp around with it in-app. Tweaking the value in-app should of course both update it wrt the app runtime but also still write the file to disk, too, so if live reloading is turned on in your text editor, whatever changes you make inside the live process image gets synced out.

  6. Jul 2022
    1. because it only needs to engage a portion of the model to complete a task, as opposed to other architectures that have to activate an entire AI model to run every request.

      i don't really understand this: in z-code thre are tasks that other competitive softwares would need to restart all over again while z-code can do it without restarting...

    2. Z-code models to improve common language understanding tasks such as name entity recognition, text summarization, custom text classification and key phrase extraction across its Azure AI services. But this is the first time a company has publicly demonstrated that it can use this new class of Mixture of Experts models to power machine translation products.

      this model is what actually z-code is and what makes it special

    3. have developed called Z-code, which offer the kind of performance and quality benefits that other large-scale language models have but can be run much more efficiently.

      can do the same but much faster

    1. This opens the possibility of doing a design much better than Squeak's, both fundamentally and at the user-level, to create a model of an entire personal computer system that is extremely compact (under 20,000 lines of code)

      See: Oberon

    2. the Squeak system, which was derived from PARC Smalltalk, includes its own operating system, GUI, development tools, graphics, sound, Internet sockets, and many applications including Etoys and Croquet, yet is only about 230,000 lines of code. The executables are about 2.8MB and only half of this code is generally used.
  7. Jun 2022
    1. Difference between Map and HashMap The Map is an interface in Java used to map the key-pair values. It is used to insert, update, remove the elements. Whereas the HashMap is a class of Java collection framework. The Map interface can only be used with an implementing class. It allows to store the values in key-pair combination; it does not allow duplicate keys; however, we can store the duplicate values. Its implementing classes are as follows: HashMap Hashtable TreeMap ConcurrentHashMap LinkedHashMap HashMap is a powerful data structure in Java used to store the key-pair values. It maps a value by its associated key. It allows us to store the null values and null keys. It is a non-synchronized class of Java collection.
    1. Vous connaissez maintenant la différence entre conteneur et machine virtuelle ; vous avez ainsi pu voir les différences entre la virtualisation lourde et la virtualisation légère.Un conteneur doit être léger, il ne faut pas ajouter de contenu superflu dans celui-ci afin de le démarrer rapidement, mais il apporte une isolation moindre. À contrario, les machines virtuelles offrent une très bonne isolation, mais elle sont globalement plus lentes et bien plus lourdes.
  8. May 2022
    1. As you've probably already guessed, we've decided to replace the current Web IDE with one built on top of VS Code. In the coming milestones, we will build out custom support for the features not already available in the VS Code core, and validate that the workflows you already depend on in the Web IDE are handled in the new experience. We're working with the team that builds our amazing GitLab Workflow extension for VS Code to make it available in the browser so we can bundle it in the Web IDE, and bring all those great features along for the ride. That includes bringing merge request comments into the Web IDE for the first time ever!

      GitLab is planning to onboard VS Code web IDE

    1. Machine Tags

      A new kind of tags — machine tags — are supported now. A machine tag, e.g. meta:language=python consists of a namespace (meta), a key (language) and a value (python). Everyone can created machine tags, but the meta: namespace is protected and tags in there will be created by the site itself.

      The codesite itself uses machine tags to make various properties of recipes accessible to the search:

      • meta:language

        The programming language of the recipe, e.g. python, perl or tcl.

      • meta:min_$lang_$majorver

        Those tags describe the minimum language version. If a recipe requires Python 2.5 it would have the tag meta:min_python_2=5.

      • meta:license

        The license that was selected by the author, e.g. psf, mit or gpl.

      • meta:loc

        This tag contains a number describing the lines of code in a recipes. It counts only the number of lines in the code block but not any lines in the discussion of in comments. This makes it possible to search for short recipes with less than ten lines or very large ones.

      • meta:score

        The current score of the recipe. This is the same number that is displayed besides the recipe title and can only be influenced by voting on recipes. That way you could even search for down-voted recipes

      • meta:requires

        Stores information about additional requirements of the recipes, e.g. required python modules. You can find recipes using python's collections module that way.

      All those tags cannot be changed directly because they are generated from a recipe's properties.

    1. typeof v === "number"

      Using triple equals to check the results of typeof is totally unnecessary, and a sure sign that someone, somewhere has unthinkingly adopted some dubious advice; it's a code smell/red flag.

      A standard equality comparison (using ==) does exactly the right thing while also avoiding association with questions/doubts about the quality of the surrounding code.

  9. Apr 2022
    1. I sometimes wondered why the VS Code team put so much effort into the built-in terminal inside the editor. I tried it once on Linux and never touched it again, because the terminal window I had right next to my editor was just massively better in every way. Having used Windows terminals for a while, I now fully understand why it’s there.

      VS Code terminal is not as efficient on Linux

  10. Mar 2022
    1. If you want to organize said migrations in their purpose you'll probably have a folder for the struture ones and another for the data ones.
    2. not as good/useful as some other gem options/approaches, such as the one that adds a data method per migration, or that lets you tag with :post_deploy, etc.

    1. ○ This changes the format and structure of the code but preserves the semantics (what it does)○ Can change lots of details for optimization, as long as the overall effect is the same

      compiler 部分的流程是什么?

  11. people.csail.mit.edu people.csail.mit.edu
    1. Lesson: avoid use of this; work around by defining that

      No. Actual lesson: don't do crazy shit; if you're trying to code defensively against this, then your code is too hard to understand, anyway, and you've got bigger problems. (See also: overuse of triple equals and treating it like an amulet to ward off unwanted spirits.)

    1. tlrobinson interpreted right that codebase size should be measured in number of tokens

      Bob Nystrom is fond of avoiding LOC measurements in favor of number of semicolons.

  12. Feb 2022
    1. let zeta = getProcessControl.bind(this); Object.setPrototypeOf(zeta, Object.getPrototypeOf(this)); return zeta;

      useful pattern

        • Visual Studio Code 快捷键
      • 调出快捷键设置: Ctl + k Ctrl + s (这是代表联合一起的)

      • 当前行快速换行 : Ctrl + Enter
      • 快速删除某一行:Shift + Delete / Ctrl + Shift + K
      • 查找: Ctrl + F
      • 文件中查找: Ctrl + Shift + F
      • 替换:Ctrl + H
      • 文件中内容替换: Ctrl + Shift + H
    1. The %rip register on x86-64 is a special-purpose register that always holds the memory address of the next instruction to execute in the program's code segment.

      %rip 有什么作用?

    1. • %rax: return value• %rsp: stack pointer• %rdi: 1st argument• %rsi: 2nd argument• %rdx: 3rd argument• %rcx: 4th argument• %r8: 5th argument• %r9: 6th argument

      有那几个常用且重要的 register?

  13. Jan 2022
    1. En outre en juin 2020, l’article D. 131-3-1 du Code de l’éducation42, ajouté par le décret du 29 juin 2020, affirme que seuls les documents justifiant de l’identité de l’enfant, des personnes qui en sont responsables et de leur domicile peuvent être exigés pour appuyer leur demande d’inscription. Dans le cas où l’un de ces documents serait impossible à produire, il peut être justifié par tous moyens, y compris une attestation sur l’honneur43.