This file contains hidden or 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
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := cpuid | |
LOCAL_SRC_FILES := cpuid.c com_example_cpuid_CPUIdApp.c | |
include $(BUILD_SHARED_LIBRARY) |
This file contains hidden or 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 "com_example_cpuid_CPUIdApp.h" | |
extern void cpuid_parse(char *buf); | |
JNIEXPORT jstring JNICALL Java_com_example_cpuid_CPUIdApp_cpuid_1get(JNIEnv *env, jclass jc) | |
{ | |
char buf[1024]; | |
cpuid_parse(buf); | |
return (*env)->NewStringUTF(env, buf); | |
} |
This file contains hidden or 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 com.example.cpuid; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.widget.TextView; | |
public class CPUIdApp extends Activity | |
{ | |
/** Called when the activity is first created. */ | |
@Override |
This file contains hidden or 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 <stdio.h> | |
#define HT_FLAG 0x10000000 | |
#define SSE_FLAG 0x02000000 | |
#define SSE2_FLAG 0x04000000 | |
#define SSSE3_FLAG 0x00000200 | |
#define SSE4_1_FLAG 0x00080000 | |
#define SSE4_2_FLAG 0x00100000 | |
void cpuid(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx) | |
{ |
This file contains hidden or 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 com.example.cpuid; | |
import android.app.Activity; | |
import android.os.Bundle; | |
public class CPUIdApp extends Activity | |
{ | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); |
This file contains hidden or 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
from unittest import main, TestCase | |
class TestPrimeFactors(TestCase): | |
def testPrimesOf0to1(self): | |
self.assertEquals([], factorsOf(0)) | |
self.assertEquals([], factorsOf(1)) | |
def testPrimesOf2to4(self): | |
self.assertEquals([2], factorsOf(2)) | |
self.assertEquals([3], factorsOf(3)) | |
self.assertEquals([2,2], factorsOf(4)) |
NewerOlder