px = dp * (dpi / 160)
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
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | |
http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example.sandbox</groupId> | |
<artifactId>sandbox</artifactId> | |
<version>1.0</version> |
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
-- PL/SQL Debugging Setup | |
-- See [PL/SQL Debugging Setup](http://docs.oracle.com/html/B31355_01/plsql_debugging_setup.htm). Essentially, you just need to grant necessary privileges to the user for debugging | |
GRANT DEBUG CONNECT SESSION TO USER | |
GRANT DEBUG ANY PROCEDURE TO USER | |
-- Find PL/SQL Definition | |
-- The definition of PACKAGE, PROCEDURE, TRIGGER, FUNCTION can be found in USER_SOURCE table or ALL_SOURCE table. Here is an example. | |
SELECT name, LISTAGG(text) WITHIN GROUP (ORDER BY line) AS plsql | |
FROM ALL_SOURCE | |
WHERE type='PROCEDURE' AND name='<procedure name in upper case>' |
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
-- Setup EBS context | |
fnd_global.apps_initialize(user_id, responsibility_id, responsibility_application_id); |
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
Bitmap origBitmapOrig = BitmapFactory.decodeFile(imageFilePath); | |
//Resize the image | |
double width = origBitmapOrig.getWidth(); | |
double height = origBitmapOrig.getHeight(); | |
int newWidth = 1600 | |
int newHeight = (int)((newWidth/width)*height); | |
Bitmap newBitmap = Bitmap.createScaledBitmap(origBitmapOrig, newWidth, newHeight, true); | |
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
git config --global credential.helper store |
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
<?php | |
use Zend\Mail\Transport\Smtp as SmtpTransport; | |
use Zend\Mail\Transport\SmtpOptions; | |
use Zend\Mail\Message; | |
public function sendEmail($to, $subject, $body){ | |
$message = new Message(); | |
$message->addTo($to) | |
->addFrom('[email protected]') |
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
// Generate a private key | |
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 | |
// View generated key store | |
keytool -list -v -keystore release.keystore | |
// Sign the application | |
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name |
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
def todict(obj, classkey=None): | |
if isinstance(obj, dict): | |
data = {} | |
for (k, v) in obj.items(): | |
data[k] = todict(v, classkey) | |
return data | |
elif hasattr(obj, "_ast"): | |
return todict(obj._ast()) | |
elif hasattr(obj, "__iter__"): | |
return [todict(v, classkey) for v in obj] |
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
class ComplexEncoder(json.JSONEncoder): | |
def __init__(self, skipkeys=False, ensure_ascii=True, | |
check_circular=True, allow_nan=True, sort_keys=False, | |
indent=None, separators=None, encoding='utf-8', default=None, excluded=None): | |
super(ComplexEncoder, self).__init__(skipkeys, ensure_ascii, check_circular, allow_nan, sort_keys, indent, | |
separators, encoding, default) | |
self.excluded = excluded | |
def default(self, obj): | |
if hasattr(obj, "__dict__"): |
OlderNewer