Ok, so the golang language does not exactly have the word “while” in it. Anyway, the do-while and while-do loops can be easily implemented with a for loop. The main difference between the do-while and while-do is that in the…
Same article, but for VBA is here – https://www.vitoshacademy.com/vba-split-worksheet-to-worksheets-save-excel-worksheets-to-csv/ This article does 2 things: Splits one worksheet to multiple worksheets Then goes through the worksheets and saves them as *.CSV files So what is the idea? Having this excel file,…
Inserting into string in Excel should be a trivial task, but it always makes sense to have something prepared in the boilerplate, before you start working. Ok, why is it important to have a nice function, if something like this…
Same article, but for Python is here – https://www.vitoshacademy.com/python-split-worksheet-to-worksheets-save-excel-worksheets-to-csv/ This article does 2 things: Splits one worksheet to multiple worksheets Then goes through the worksheets and saves them as *.CSV files I hope that is enough for you. Ok, so…
Option Compare in VBA is the thing, that will save you ugly stuff like this one:
1 2 3 4 5 6 7 8 9 10 |
Sub Testing() Dim userInput As String userInput = InputBox("What is decimal 4094 in hex?") If UCase(userInput) = UCase("ffe") Then Debug.Print "You have correctly written " + userInput + "!" End If End Sub |
Yup, it is a bit ugly, using UCase to compare all the time, between small letter text and big letter text. So, if you…
Getting N-th string between two substrings might sound a bad idea, until you do not need it. And with VBA, you better have something prepared. So, imagine the following XML (from this article here):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<FootballInfo> <row> <ID>1</ID> <FirstName>Peter</FirstName> <LastName>The Keeper</LastName> <Club name ="NorthClub"> <ClubCoach>Pesho</ClubCoach> <ClubManager>Partan</ClubManager> <ClubEstablishedOn>1994</ClubEstablishedOn> </Club> <CityID>1</CityID> </row> <row name="Row2"> <ID>2</ID> <FirstName>Ivan</FirstName> <LastName>Mitov</LastName> <Club name = "EastClub"> <ClubCoach>Gosho</ClubCoach> <ClubManager>Goshan</ClubManager> <ClubEstablishedOn>1889</ClubEstablishedOn> </Club> <CityID>2</CityID> </row> </FootballInfo> |
Your task is to get…
Reading from a pdf is actually quite an easy task with Python. If the PDF is of course “readable”, e.g. made from a word processor. The first thing to do is to install Tika and Java:
1 2 3 |
pip install tika <em>conda install</em> -c conda-forge <em>tika # as alternative</em> java --version #this one checks the installed java version in the command prompt |
Having this, the…
Ok, the title became too lengthy, but the idea is to try to duplicate the beauty of what this formula does:
1 2 3 4 |
=INDEX(myTable[#All],MATCH(1, (myTable[[#All],[Profit]]=C9)* (myTable[[#All],[Currency]]=D9)* (myTable[[#All],[Value]]=B9),0),1) |
And this is the cell of the formula above: Anyway, the strange thing was that we have beautiful…
Bash Commands
1 2 3 4 |
yarn add vue@next yarn add vuex@next yarn add vue-router@next yarn add -D @vue/compiler-sfc |
Changes in src/main.js Additionally, change main.js from this:
1 2 3 4 5 6 7 8 9 10 11 12 |
import Vue from 'vue' import App from './App.vue' import router from './router' import store from './store' Vue.config.productionTip = false new Vue({ router, store, render: h => h(App) }).$mount('#app') |
To this:
1 2 3 4 5 6 7 8 9 |
import {createApp} from 'vue' import App from './App.vue' import router from './router' import store from './store' createApp(App) .use(router) .use(store) .mount('#app') |
Changes in src/router/index.js After changes the code should be looking like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import { createRouter, createWebHistory } from 'vue-router' import Home from '../views/Home.vue' const routes = [ { path: '/', name: 'Home', component: Home }, { path: '/about', name: 'About', // route level code-splitting // this generates a separate chunk (about.[hash].js) for this route // which is lazy-loaded when the route is visited. component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') } ] const router = createRouter({ routes, history: createWebHistory, }) export default router |
Changes in src/store/index.js This is how it should be looking:
1 2 3 4 5 6 7 8 |
import {createStore} from 'vuex' export default createStore({ state: {}, mutations: {}, actions: {}, modules: {} }) |
If you have ever dreamed that it will be possible to fill out an Excel cell with a picture, using Python, then you should probably reevaluate your dreams. Seriously, who dreams of something like that? Without further dreaming, the code…
Have you seen the error below?
1 2 3 4 5 6 |
Traceback (most recent call last): File "C:/Users/foo/PycharmProjects/pythonProject3/main.py", line 29, in <module> main() File "C:/Users/foo/PycharmProjects/pythonProject3/main.py", line 19, in main a['foo'] += 5 KeyError: 'foo' |
Of course you have. And you know, that it is because you have written something extremely unwise like this:
1 2 |
a = dict() a['foo'] += 5 |
Yeah. You cannot increment the value of a non-existent key. Unless… Unless you…
Python – Docstring – Help and Comments
Docstrings in Python are actually quite simple – the are 3 times this """ and the code between opening and closing them can be formatted in any possible way. The reason I have decided to dedicate a whole article to…