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
#include "vectordoublevalidator.h" | |
// VectorDoubleValidator Constructor | |
VectorDoubleValidator::VectorDoubleValidator ( double bottom, double top, int decimals, | |
QObject* parent = 0 ) | |
: QDoubleValidator ( bottom, top, decimals, parent ) { | |
} | |
// Custom validate function to allow comma seperated values |
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
#!/usr/bin/python | |
with open('/sys/class/power_supply/BAT0/status') as f: | |
if 'Charging' in f.read(): | |
print('The battery is currently charging') | |
exit(0) | |
scale = 1000000000000.000 | |
voltage = 0 | |
current = 0 |
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
extern crate ui; | |
use ui::{Area, AreaDrawParams, AreaHandler}; | |
use ui::draw::{Brush, FillMode, Path, SolidBrush, StrokeParams, LineCap, LineJoin}; | |
use ui::draw::text::{Layout, Font, FontDescriptor, Weight, Italic, Stretch}; | |
pub struct LineChart { | |
pub title: String, | |
pub x_axis_label: String, | |
pub y_axis_label: String, |
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
Options +ExecCGI | |
AddHandler cgi-script .py | |
DirectoryIndex code.py/ | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{REQUEST_URI} !^/static/favicon.ico$ | |
RewriteCond %{REQUEST_URI} !^/static/(.*)$ | |
RewriteCond %{REQUEST_URI} !^(/.*)+code.py/ | |
RewriteRule ^(.*)$ code.py/$1 [PT] |
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
package main | |
func InspectSlice(slice []string) { | |
// Capture the address to the slice structure | |
address := unsafe.Pointer(&slice) | |
// Capture the address where the length and cap size is stored | |
lenAddr := uintptr(address) + uintptr(8) | |
capAddr := uintptr(address) + uintptr(16) |
NewerOlder