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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Button btn = (Button)findViewById(R.id.button); | |
btn.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
// new IntentIntegrator(MainActivity.this).initiateScan(IntentIntegrator.ONE_D_CODE_TYPES); |
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.support.test.rule.ActivityTestRule; | |
import android.support.test.runner.AndroidJUnit4; | |
import android.test.suitebuilder.annotation.LargeTest; | |
import org.junit.Rule; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import static android.support.test.espresso.Espresso.onView; | |
import static android.support.test.espresso.assertion.ViewAssertions.matches; |
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 static class MyPasswordInputDialog extends DialogFragment { | |
private SharedPreferences mPref; | |
private EditText mPasswd1; | |
private EditText mPasswd2; | |
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
mPref = PreferenceManager.getDefaultSharedPreferences(MyPasswordInputDialog.this.getActivity()); | |
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
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
require 'fileutils' | |
require 'rake/clean' | |
def use_bundler() | |
if system("bundle > /dev/null 2>&1") | |
"bundle exec " | |
else | |
"" | |
end | |
end |
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
# Makefile - build script */ | |
# build environment | |
PREFIX ?= /usr/local/cross/rpi/arm-unknown-eabi | |
ARMGNU ?= $(PREFIX)/bin/arm-unknown-eabi | |
# source files | |
SOURCES_ASM := $(wildcard *.S) | |
SOURCES_C := $(wildcard *.c) | |
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
class Mock | |
def extract_template(options={}) | |
Fog.credentials[:cloudstack_zone_id] = 1105 | |
template_id = options['id'] | |
template_mode = options['mode'] | |
zoneid = self.data[:zones].keys[0] | |
zone = self.data[:zones][zoneid] |
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
Shindo.tests('Fog::Compute[:cloudstack] | extract template requests', ['cloudstack']) do | |
@extract_template_format = { | |
'extracttemplateresponse' => { | |
'jobid' => Integer }} | |
@queary_async_job_result_format = { | |
'queryasyncjobresultresponse' => { | |
'jobid' => Integer, | |
'jobstatus' => Integer, |
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
/* main.c - the entry point for the kernel */ | |
#include <stdint.h> | |
#include "rpi_lib/rpi.h" | |
#define UNUSED(x) (void)(x) | |
// kernel main function, it all begins here | |
void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags) { | |
init_gpio(); |
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
void init_gpio(void){ | |
int i; | |
// pullup all | |
*GPPUD = 0x02; | |
// wait 150 cycle | |
for(i=0;i<150;i++){ | |
// nop | |
asm("mov r0,r0"); | |
} | |
*GPPUDCLK0 = 0xffffffff; |
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
// initialize gpio | |
bl init_gpio | |
// pinMode(22 ,ALT4) | |
ldr r3, .L2 | |
ldr r2, .L2 | |
ldr r2, [r2] | |
orr r2, r2, #192 | |
str r2, [r3] |
OlderNewer