My first iPhone app – Part 3
Waveform of Audio File Installing I’ve tried a component FDWaveformView. It uses CocoaPods, a dependecy management tool like Python’s pip or Rust’s cargo. sudo gem install cocoapods
Waveform of Audio File Installing I’ve tried a component FDWaveformView. It uses CocoaPods, a dependecy management tool like Python’s pip or Rust’s cargo. sudo gem install cocoapods
Toast Toasts are simple message dialogs val text = “Hello toast!” val duration = Toast.LENGTH_SHORT val toast = Toast.makeText(applicationContext, text, duration) toast.show() Toast.makeText(this@MainActivity, “Hello Toast!”, Toast.LENGTH_SHORT).show()
In the last article we looked at functions in Kotlin. But there is more to functions: Multiple return values All you Pythonistas already know the concept of multiple return values. Kotlin as a strongly typed language uses the Pair class to enable functions to return two values or Triple to return three. fun nextTwo(num: Int)…
Calculator for 4 rings 1. Ring 2. Ring 3. Ring 4. Ring Value Tolerance brownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegoldsilver brownredgreenbluepurplegoldsilver 0Ω 0% Calculator for 5 rings 1. Ring 2. Ring 3. Ring 4. Ring 5. Ring Value Tolerance brownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegoldsilver brownredgreenbluepurplegoldsilver 0Ω 0%
I got an “Invalid Host Header” error when running a VueJs app on a linux machine with npm run serve To work around this you can put the following code into you vue.config.js file: module.exports = { // options… devServer: { disableHostCheck: true, } }
From the flask release notes: Returning a dict from a view function will produce a JSON response. This makes it even easier to get started building an API. To get a minimal REST-Api all you have to do is: from flask import Flask app = Flask(__name__) @app.route(‘/return_dict’, methods=[‘GET’]) def return_dict(): return {“x”: “1”} if __name__…
When using PyInstaller to package an application to a self-containing bundle you might run into some pitfalls: Pitfall 1: PyInstaller overwrites spec file The first time you run pyinstaller you run it with pyi-makespec my_module.py instead of pyinstaller my_module.py pyi-makespec will generate a my_module.spec which you can alter. Afterwards you just ran pyinstaller my_module.spec to…
Let’s say you have a project with the following top level dependencies: xlrd money babel pyinstaller jinja2 pywin32 After installing them you have the following packages:
This time we look at functions. Let’s take a simple function from Java: public int mult(int num1, int num2){ return num1 * num2; } In Kotlin it would look like this: fun mult(num1: Int, num2: Int): Int{ return num1 * num2 } A function definition always starts with the keyword fun. That’s fun isn’t it?…
This time we deal with loops Loops Kotlin has two types of loops: for and while. For-loop for(x in 1..10){ println(“Loop: $x”) } We can count backwards as well for (x in 10 downTo 1) { println(“Loop: $x”) } While-loop var i = 10 while(i > 0) { println(“$i”) i– } Break & Continue for(x…