How to number files on github so that they occur in sequence? - github

When I try to upload my folder to github the numbering goes like :
10 comes straight after 1 but I want normal numbering like 1 , 2, 3 and so on ... Can you tell me how to number the files so that it occurs normally ?

Try adding an underscore (or some character) at the beginning. That works in NTFS.

Related

How can I force VS Code to be consistent for indentation?

I have two docker-compose.yml files in two different projects.
For one, VS Code uses 2 spaces as the indentation space, for the other it uses 4 spaces.
This happens for almost all of file types. .js files and .jsx files and .html files.
We want to make it deterministics for all files regardless of their types and extensions.
We want to force VS Code to indent each new line by 4 spaces, or a simple tab.
Is that possible?
We looked at Edior: Tab Size and it already says 4. So, where does 2 spaces come from?

Search in VS Code for occurrences of term greater than N

Here's an example:
My search term is myTermABC
I have 100 files in my project
10 files contain myTermABC
Only two of those files contain myTermABC more than once (the other 8 contain it only once)
I only want VS Code to return the two files that contain myTermABC more than once.
How to do this?
Is this even possible?
Maybe there's an extension that enables this functionality?
In vscode search across files you have to specifically tell it to include newlines. The dot doesn't do this in a search in vscode.
So this find should work: (myTermABC[.\n]*){2,}

Does the Source Control Feature have an option to include whitespace in template?

In the latest update of Visual Studio Code, I noticed that the source control git message feature started ignoring white space in my git template. Is there a way to revert to previous behavior?
Further Detail
In the past for git, I had a template commit message file similar to the following:
#
# Various Billing codes: I'd un-comment the one I need at the time
# Billed to Project 1
Billed to Project 2
#Billed to Project 3
With this, I would simply type my subject in place of the pound and continue from there. Visual studio Code used to include the two initial white spaces in its message box. I'd get this:
_
Billed to Project 2
Where the underscore is where I begin typing. Now it is simply:
Billed to Project 2
This is particularly frustrating since the billing codes exceed the 50 character subject limit, and it wants to display its warning each time. I personally like the 50 character subject limit and a 78 character line limit, so I don't want to disable that feature. And, I can't change the billing code as it is company standard. Any thoughts into getting my precious white spaces back?
Thanks in advance.
This was a bug in VS Code. It should be fixed in VS Code 1.38+

Netlogo transition, backwards compatibility

'd like to upgrade (if that's the word) a 100-150 of home-grown Netlogo 4.1.3 programs to Netlogo 6, preferably in batch by means of Perl or another scripting language, followed by a (necessary) manual inspection and finish.
To my dismay Netlogo 6 won't open Netlogo 4 files, so I've upgraded a few of them by opening them in Netlogo 5, save and reopen in Netlogo 6 and save. Not a particularly elegant way.
Any advice?.
It looks like the reason Netlogo 6 won't read the 4.1.3 files is that it expects 12 sections, whereas the 4.1.3 files have 10 or 11. As far as I can tell, sections are broken up by the string "##$###$##". Additionally, older .nlogo files had parameters for a "CC-WINDOW" that version 6 does not understand. Finally, buttons in Netlogo 6 also need to be parameterized with a value of 1 or 0 to determine whether that button is disabled until ticks start or not.
The following python 3 code takes all Netlogo files in the same folder and cuts out the "CC-WINDOW" lines. It also adds a 1 to the end of every "Button" block. As the code reads the file, it counts the number of "##$###$##" breaks. If at the end of the file, there are fewer than 11, it appends enough "##$###$##" breaks to make the total 11.
If you want to run this code, I would copy the old files you want to update into a new folder. Place the .py file with the following code into that same folder, and when you run it it will create new files for the 6.0 compatible versions (Note that it will not only update the 4.1.3 files, but any netlogo files in that folder). This doesn't work for every file- for example, one file did not update correctly because the original model's "GRAPHICS-WINDOW" was not properly parameterized. That said, this code worked for the majority of the 4.1.3 model library models that I tested. Also, I only know that it allows you to open the files in Netlogo 6, I don't know what will have to be done after that to make sure that the models actually run as you would expect.
Hopefully that helps! Let me know if I was not clear on some point.
import os
with open("files_updated.txt", "w") as files:
for filename in os.listdir("."):
if filename.endswith(".nlogo") and not filename.startswith("6"):
files.write(filename + '\n')
opened = open(filename, "r")
n = 0
printat = -1
cut_count = 0
count_breakers = 0
new_file_name = ("6_"+filename.strip(".txt") + ".nlogo")
print(new_file_name)
with open(new_file_name, "w") as out:
for line in opened:
n += 1
if line == "##$###$##\n":
count_breakers += 1
if line == "CC-WINDOW\n":
cut_count = 8
cut_count -= 1
if cut_count < 0:
out.write(line)
if line == "BUTTON\n" :
printat = n + 14
if printat == n:
out.write("1\n")
if count_breakers < 11:
out.write("##$###$##\n" * (11 - count_breakers))
Here is a simple conversion script. Feel free to suggest improvements.

Talend - delete files older then X days

How to delete contents of the folder older then x days in Talend job?
I have thought about retrieving that attribute from rFilesList (could not find) or passing unix command to a system (less preferable way as you have less control).
Thank you!
P.S. The issue solved
You can use a "tfilelist" coupled with a "tfileproperties".
The variable mtime or mtime_string can help you.
Here there is a page that explain a little bit (but it's in french so you can google trad if you want) :
HERE
My solution (based on a link above):
tFileList->iterate->tFileProperties (reads the file from previous step, ((String) globalMap.get ( "tFileList_1_CURRENT_FILEPATH")) )-> tMap has 2 outputs, based on mtime condition:
Files to delete: (TalendDate.getCurrentDate().getTime()-row3.mtime)/(24*60*60*1000) > 2
Files to keep: (TalendDate.getCurrentDate().getTime()-row3.mtime)/(24*60*60*1000) <=2
tFileDelete that deletes filesToDelete.filename
Write a script to remove files over X days. and call the script from tSystem component :
More about tSystem : https://help.talend.com/display/TalendOpenStudioComponentsReferenceGuide521EN/19.4+tSystem