Categories
Development

How can I add a thick bottom border to a range of rows when the cell value changes?

I have code that will insert a blank row when a cell value changes. How can I modify this to instead add a thick bottom border? The border would go from column A to column AB every time the value in column B changes Sub InsertRows() Dim lastRow As Long Dim rowPtr As Long lastRow […]

Categories
Development Linux

AWK – print certain lines but without being processed

If I had a file in the following format: line1 column1 line2 columnA line3 column1A exclude this line5 column2 line6 columnB line7 column2B I want to swap a columns, so the coumn* comes before line* I use a simple awk command like this: awk ‘{print $2 ” ” $1}’ and get an output like this: […]

Categories
Development Linux

Use bash variable in python

How can I call use a variable in bash and use the same variable in python. There are two separate file .bash and .py .bash file while read -r x do printf “%s\n” ${x} “Found” done < path/to/file.txt .py file print(${x}+”something here”) I want to establish some connection between the two file so the variable […]

Categories
Development Linux

How may I emulate the -R feature of “zip”, but in gzip and xz?

The program “zip” has a -R feature which allows one to zip all files with a certain name in a directory tree: zip -r v/s zip -R For example: zip -R “bigfile” Will zip all of the following: ./bigfile ./a/bigfile ./a/b/bigfile ./a/b/c/bigfile ……. The -R feature doesn’t seem to be in gzip or xz though. […]

Categories
Development

Creating and Checking cookies value with javascript/jquery

I’m setting up a new pop up and would like to create cookie. The basic function is to add classes into the wrapper if a cookie exists (or depending on value if that’s possible). This is what I got so far: HTML: <div id=”new-popup” class=”active “> <span class=”collapse-popup”>X</span> <form> <input class=”tnp-email” type=”email” placeholder=”Email Address” name=”ne” […]

Categories
Development

Can compose functions be used in places fragments shined? [closed]

I have been playing with Compose functions, and I am at a dilema. Will the new Jetpack Compose Api replace Fragments? Exhibit A: Android Fragments where introduced to break up the UI into small components for reuse and further separation of concerns. Exhibit B: Jetpack Compose brings exactly what fragments promised to deliver but in […]

Categories
Development

How to align text with Alignment package in Sublime 3 with spaces around ‘=’?

I want to use the Alignment package in Sublime Text 3 in order to align some variable assignments and I want to have spaces around the = character. This is an example: bar = ‘cherry’ bar_baz = ‘tomato’ f = ‘carrot’ This is how it turns out: bar = ‘cherry’ bar_baz= ‘tomato’ f = ‘carrot’ […]

Categories
Development

Shell script to find file and copy file from other location

I’m puzzeling with a shell script. What am I trying to achieve? In my ‘upload2website’-folder on my Mac I have numerous files that have the following AA_bestandsnaam-xx.jpg or AA_bestandsnaam – xx.jpg (Watch the spaces). xx is a filenumber, could be any number. Below the ‘upload2website’-folder there a several subfolders. In the subfolder below upload2website there […]

Categories
Development

Swap json array index

{“data”: [ { “id”: “X12”, “from”: { “name”: “test1”, “id”: “1458633” } }, { “id”: “X45”, “from”: { “name”: “test2”, “id”: “12587521” } }, { “id”: “X46”, “from”: { “name”: “test3”, “id”: “12587521” } } I want to swap the array index of the json file using C#. Ex. data[2] swap with data[3] -> {“data”: […]

Categories
Development

How to stop chrome launched by selenium remote driver?

First, I’m using Django, and I’m building an API. For example, I’ve route like api/get-some-element. browser_url = cache.get(‘user_%d.browser_url’ % user_id) is_browser_queued = cache.get(‘user_%d.browser_queued’ % user_id) if browser_url: capabilities = DesiredCapabilities.CHROME.copy() return webdriver.Remote( command_executor=browser_url, desired_capabilities=capabilities, options=options, ) if not is_browser_queued: run_browser.delay(user_id) # launch main chrome cache.set(‘user_%d.browser_queued’ % user_id, True, None) On the first access to that […]