Skip to content

Instantly share code, notes, and snippets.

queries += RawDatabase::Query(QString("INSERT INTO history (timestamp, chat_id, message, sender_alias) "
"VALUES (%1, %2, ?, ("
" CASE WHEN changes() IS 0 THEN ("
" SELECT id FROM aliases WHERE owner=%3 AND display_name=?)"
" ELSE last_insert_rowid() END"
"));")
.arg(time.toMSecsSinceEpoch()).arg(peerId).arg(senderId),
{message.toUtf8(), dispName.toUtf8()}, insertIdCallback);
public static File createDataBase(String dir, String name, String ext){
File file;
do{
file = new File(String.format("%s%s%s.%s", dir, name, RandomStringUtils.randomAlphanumeric(3), ext));
} while(file.isFile());
file.getParentFile().mkdirs();
try() {
file.createNewFile();
} catch (IOException e){
e.printStackTrace();
try {
//LoLRTMPSClient and TypedObject are from gvayneyck's library.
LoLRTMPSClient client = new LoLRTMPSClient(ServerInfo.NA, "6.12.XX", "username", "password"); //Change the 6.12 whenever the patch changes to something like 6.13.XX. You can leave the XX, you only have to update once a patch.
TypedObject summoner = null;
client.connectAndLogin();
System.out.println("Logged into login server!");
int id = client.invoke("clientFacadeService",
"getLoginDataPacketForUser", new Object[]{});
summoner = client.getResult(id).getTO("data").getTO("body");
getDouble("rpBalance").intValue()); //RP Value
Installed /usr/lib/python2.7/site-packages/jsonrpc-1.2-py2.7.egg
Searching for lbryum
Best match: lbryum [unknown version]
Downloading https://github.com/lbryio/lbryum/tarball/master/#egg=lbryum
Processing __downloaded__
Writing /tmp/easy_install-5_y0bj/lbryio-lbryum-9e9c2f6/setup.cfg
Running lbryio-lbryum-9e9c2f6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5_y0bj/lbryio-lbryum-9e9c2f6/egg-dist-tmp-AYldmd
warning: no files found matching 'electrum'
warning: no files found matching '*.py' under directory 'packages'
warning: no files found matching 'cacert.pem' under directory 'packages'
@abueide
abueide / C
Created September 18, 2016 16:53
cpp-ethereum-build-error
[ 60%] Linking CXX executable ethvm
../libethash/libethash.so: error: undefined reference to 'ceil'
collect2: error: ld returned 1 exit status
make[2]: *** [ethvm/CMakeFiles/ethvm.dir/build.make:118: ethvm/ethvm] Error 1
make[1]: *** [CMakeFiles/Makefile2:1586: ethvm/CMakeFiles/ethvm.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 60%] Building CXX object test/libtestutils/CMakeFiles/testutils.dir/Common.cpp.o
[ 61%] Linking CXX executable ethminer
../libethash/libethash.so: error: undefined reference to 'ceil'
import eth.abueide.math2d.geometry.Point
object Demonstration {
var entities = List(new Player(), new Player, new Bunny, new AnyEntityThatExists)
def updateEntities(entities: List[Entity]): List[Entity] = {
val updatedState = MovementSystem(entities)
//Draw game state as side affect
return updatedState
}
Due to the way that assets are packaged into your application at compile time, there is no real "file system" that lets you
iterate over all directories and files as if it was a file system. This solution is intended to fix that problem by generating
an index of all of your assets at compile time so the LibGDX API can gain the functionality that it couldn't have before such as
calling Gdx.files.internal("somedirectory").list() which would normally return an empty list.
Add this task into your root build.gradle's allprojects block.
ANDROID VERSION
task indexAssets(){
def output = ""
@abueide
abueide / lbry-communities
Last active April 16, 2019 10:15
LBRY Communities Proposal
*** This is a WORK IN PROGRESS proposal. Better formatting to come. It roughly sketches out the beginnings of ideas, any feedback is welcome!
This proposal describes an implementation that will allow communities with content curation models to organically grow on top of the LBRY platform that are decentralized, Sybil resistant, and can match the utility of their centralized counterparts, in particular using moderation to uphold healthy community policies.
The formation of communities is built around the idea of a decentralized Publish/Subscribe model. See IPFS’ PubSub for an example. This allows for any node to publish a message to any topic and every node in the network that is subscribed to that topic will receive the message. With LBRY’s content tagging system we will be able to use those tags as topics. When a client posts a piece content it could automatically be sent as a message over the PubSub network to every topic that its tagged in. As an example if a content creator posts a gaming podcast, the

Keybase proof

I hereby claim:

  • I am abueide on github.
  • I am abueide (https://keybase.io/abueide) on keybase.
  • I have a public key ASCVF7nDDeuAri8YTAUPOdfhFlU1HNQ5LOlea-KwEZNspwo

To claim this, I am signing this object:

package com.abyssalrealms
import com.abyssalrealms.ecs.components.MovementComponent
import com.abyssalrealms.ecs.components.PlayerComponent
import com.abyssalrealms.ecs.components.PositionComponent
import com.abyssalrealms.ecs.components.RenderComponent
import com.abyssalrealms.ecs.systems.InputSystem
import com.abyssalrealms.ecs.systems.MovementSystem
import com.abyssalrealms.ecs.systems.RenderSystem
import com.artemis.World