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
if (!Environment.isExternalStorageManager()) { | |
Intent intent = new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION); | |
intent.setData(Uri.parse("package:" + getPackageName())); | |
startActivity(intent); // directs user to settings screen | |
} |
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
Write a c++ class that rotates an object in 3d space. The camera is orthographic and a fixed distance away, you can only rotate the object. | |
Rotation should have smooth interpolation, giving it a mobile friendly feel. | |
smooth interpolation (even while draggin) is a must! The y axis should not be inverted. | |
This is NOT an arcball it needs to work anywhere the screen is touched. Go with a physics approach like a spring model rather than an arcball. | |
Take things like large or fast inputs, as well as suddent stops in input into account, and keep rotation smooth always. DAMPEN | |
This is the class you are implementing: | |
class ObjectRotator { | |
public: |
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
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <ShellScalingAPI.h> // Shcore.lib | |
#include "glad.h" // OpenGL32.lib | |
#pragma comment(lib, "OpenGL32.lib") | |
#pragma comment(linker, "/SUBSYSTEM:WINDOWS") | |
#define WINDOW_WIDTH 800 |
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
if (document.GenUUID === undefined) { | |
document.GenUUID = () => { | |
const guid = "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c => | |
(+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16) | |
); | |
return guid; | |
}; | |
} |
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
namespace Compiler { | |
public delegate void PrintErrorFunction(string message); | |
public class Location { | |
public string File { get; protected set; } | |
public int Line { get; protected set; } | |
public int Column { get; protected set; } | |
public Location(string file, int line, int column) { | |
File = file; | |
Line = line; |
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
// Trig approximations from: http://www.ganssle.com/approx.htm | |
#include <windows.h> | |
#include <cmath> | |
#include <iostream> | |
#include <iomanip> | |
#define WINDOW_WIDTH 800 | |
#define WINDOW_HEIGHT 600 |
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
/////////////////////////////////////////////////////////////////////////// | |
// | |
// MODULE: MOUSINFO.C | |
// | |
// DESCRIPTION: SDK sample for handling the WM_MOUSEWHEEL message and | |
// the TrackMouseEvent() API. | |
// | |
// Applet displays MouseButton, MouseWheel, MouseMovement, and | |
// any mouse messages in the title bar. | |
// |
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 "memory.h" | |
#if defined(MEM_PLATFORM_WINDOWS) | |
#include <windows.h> | |
mem_cfunc void PrintDebugString(const char* str) { | |
OutputDebugStringA(str); | |
} | |
#ifdef _DEBUG | |
#define MemInternal_Assert(cond) if (!(cond)) {*(u8*)0 = 0;} |
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 "SimpleSound.h" | |
#include <windows.h> | |
#include <atomic> | |
#include <dsound.h> | |
#include <iostream> | |
#undef PlaySound | |
#define SIMPLE_SOUND_MAX_CHANNELS 6 | |
#define SIMPLE_SOUND_NUM_COMMANDS 512 |
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
function UpdateMetaData(WebFS, info) { | |
let infoDiv = document.getElementById('size'); | |
//let location = window.location.href; | |
let location = (new URL(window.location.href)); | |
let target = "filesystem:" + location.protocol; | |
if (target.endsWith(":")) { | |
target += "//"; | |
} | |
else { |
NewerOlder