Skip to content

Instantly share code, notes, and snippets.

@mlem
mlem / BinarySpec.groovy
Last active December 17, 2015 14:49
Operations with binary literals in Java 7
import spock.lang.Specification
class BinarySpec extends Specification {
def "binary operations in java 7"() {
expect:
0b1000_0000 == 128 // binary literal
0b1000_0000 + 0b1 == 129 // binary addition
1025 + 0b100 == 1029 // addition of decimal and binary
1025 + 0b100 == 0b100_0000_0101 // comparing result to binary
@mlem
mlem / gradle version
Last active August 29, 2015 14:15
Kafka Stacktrace on Build
C:\development\git\kafka>gradlew --version
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
------------------------------------------------------------
Gradle 1.11
------------------------------------------------------------
Build time: 2014-02-11 11:34:39 UTC
Build number: none
Revision: a831fa866d46cbee94e61a09af15f9dd95987421
@mlem
mlem / yinyang.css
Last active August 26, 2015 09:38 — forked from felipecabargas/yinyang.css
Yin-Yang Pure CSS
#olaquehace {
width: 100px; height: 200px;
background: #F6020C;
border-color: #00F900;
border-style: solid;
border-width: 2px 100px 2px 2px;
border-radius: 100%;
position: relative;
}
@mlem
mlem / github_README.md_preview.html
Created August 26, 2015 11:27
Html to preview your readme file
<!-- single file version -->
<!DOCTYPE html>
<html>
<head>
<link href="http://a248.e.akamai.net/assets.github.com/stylesheets/bundle_github.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="site">
<div id="slider">
<div class="frames">
@mlem
mlem / README.md
Last active October 21, 2015 23:38 — forked from mbostock/.block
Hexagon Mesh

Click and drag above to paint red hexagons. A black outline will appear around contiguous clusters of red hexagons. This outline is constructed using topojson.mesh, part of the TopoJSON client API. A filter is specified so that the mesh only contains boundaries that separate filled hexagons from empty hexagons.

The hexagon grid itself is represented as TopoJSON, but is constructed on-the-fly in the browser. Since TopoJSON requires quantized coordinates, the hexagon grid is represented as integers, with each hexagon of dimensions 3×2. Then a custom projection is used to transform these irregular integer hexagons to normal hexagons of the desired size.

At the next meeting of the Coding Dojo Vienna we'll be focusing on refactoring and the I in SOLID principles of object oriented design: Interface Segregation Principle
For participation please add your name at the following Doodle link:
http://doodle.com/poll/4cuawtrq8tzkr6gv
/*******************
* Preperation *
*******************/
@mlem
mlem / android.log
Created May 14, 2022 09:17
Android sync problems
I/SyncAdapter-Contact-Proxy( 5539): onPerformSync - started.
W/ContextImpl( 5539): Implicit intents with startService are not safe: Intent { act=com.sec.android.sCloudSync.Contacts } android.content.ContextWrapper.bindService:529 com.samsung.android.scloud.proxy.contacts.SyncAdapter.onPerformSync:105 android.content.AbstractThreadedSyncAdapter$SyncThread.run:259
I/CalendarSyncAdapter( 5539): PERFORM SYNC : 5.1.5
I/SyncAdapter-Calendar-Proxy( 5539): onServiceConnected : Binded.
I/CalendarSyncAdapter( 5539): LastSyncTime : null
I/CalendarSyncAdapter( 5539): FIRST SYNC REQUEST..
I/SyncAdapter-Contact-Proxy( 5539): onServiceConnected : Binded.
I/ContactsSyncAdapter( 5539): PERFORM SYNC : 5.1.5
I/RelayProvider( 5589): getAuthInformation CTID : PE53962801
I/RelayProvider( 5589): DATA RELAY VERSION : 3.04.009