This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Animate(bool isDown, bool useDelay=true) | |
{ | |
Storyboard storyboard = new Storyboard(); | |
storyboard.SpeedRatio = useDelay ? 4 : 100000; | |
// translate the children | |
int i = 0; | |
foreach (Image image in rotationContainer.Children) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void SetImages(String[] Images) | |
{ | |
if (visibleItems > itemsAmount) | |
return; | |
// cleaning up | |
if (rotationContainer!=null) | |
rotationContainer.Children.Clear(); | |
positions.Clear(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Launch in WSL", | |
"useWSL": true, | |
"program": "${workspaceFolder}/app.js" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "WSL fix remoteRoot", | |
"type": "node", | |
"request": "attach", | |
"address": "localhost", | |
"port": 5858, | |
"sourceMaps": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//run this on default background thread | |
runOnDefaultThread({ | |
firstNote = NoteRepository.getOrCreateFirstNote(applicationContext) | |
firstNoteLive = NoteRepository.getLiveDataNoteById(applicationContext, firstNote.id) | |
//run on main thread | |
runOnUiThread { | |
firstNoteLive.observe(this, Observer<Note> { | |
Log.v(TAG, "First note is changed, value: ${it.content}") | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.os.Handler | |
import android.os.HandlerThread | |
import android.os.Looper | |
import android.util.Log | |
object CommonUtils { | |
private const val TAG = "CommonUtils" | |
private val handler: Handler by lazy { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
register: (req, res) => { | |
if (!req.param("username")) { | |
return res.status(400).send({ | |
code: 1, | |
message: `'username' parameter is needed` | |
}) | |
} | |
... continue processing registration | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
handleError: (req) => { | |
if (!req.param("username")) { | |
return { | |
code: 1, | |
message: `'username' parameter is needed` | |
} | |
} | |
return null | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
register: (req, res) => { | |
const error = UserService.handleError(req) | |
if (error) { | |
return res.status(400).send(error) | |
} | |
... continue processing registration | |
}, | |
login: (req, res) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
register: (req, res) => { | |
... continue processing registration | |
}, | |
login: (req, res) => { | |
... continue processing login | |
} | |
... | |
} |
OlderNewer