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
1.create google app (google console) | |
Example: | |
Client ID xxx.apps.googleusercontent.com | |
Email address [email protected] | |
Client secret xxx | |
Redirect URIs | |
https://localhost/oauth2callback | |
Javascript Origins | |
https://localhost |
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.content.Context; | |
import android.graphics.Matrix; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
public class TopCropImageView extends ImageView { | |
public TopCropImageView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
setScaleType(ScaleType.MATRIX); |
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.content.Context; | |
import android.graphics.drawable.Drawable; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
public class ScalableImageView extends ImageView { | |
public boolean isMeasured = true; | |
public ScalableImageView(Context context) { | |
super(context); |
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
PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory | |
1.Delete composer cache: | |
sudo rm -R ~/.composer | |
2.Delete vendor folder: | |
sudo rm -R vendor | |
3.Rebuild the vendor packages: | |
composer update |
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
.text { | |
overflow: hidden; | |
text-overflow: ellipsis; | |
display: -webkit-box; | |
line-height: 16px; | |
max-height: 32px; | |
-webkit-line-clamp: 2; /* number of lines to show */ | |
-webkit-box-orient: vertical; | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item> | |
<shape | |
android:shape="rectangle"> | |
<stroke android:width="1dp" android:color="#FF000000" /> | |
<solid android:color="#FFFFFF" /> | |
</shape> | |
</item> |
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
./compile-ffmpeg.sh all | |
==================== | |
[*] check archs | |
==================== | |
FF_ALL_ARCHS = armv5 armv7a x86 | |
==================== | |
[*] check env armv5 | |
==================== | |
NDKr10c (64-bit) detected |
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
apt-get install nginx php5-fpm php5-cli php5-mcrypt git | |
mkdir /var/www | |
mkdir /var/www/laravel | |
nano /etc/nginx/sites-available/default | |
------------------------------------------------------------------------ | |
server { | |
listen 80 default_server; |
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
InputStream is =getResources().openRawResource(R.raw.r4_reference); //arff | |
BufferedReader datafile = new BufferedReader(new InputStreamReader(is)); | |
try { | |
Instances m_Training = new Instances(datafile); | |
m_Training.setClassIndex(m_Training.numAttributes() - 1); | |
Filter m_Filter = ((Filter)Class.forName("weka.filters.unsupervised.instance.Randomize").newInstance()); | |
m_Filter.setInputFormat(m_Training); | |
Instances localInstances = Filter.useFilter(m_Training, m_Filter); | |
Classifier m_Classifier = Classifier.forName("weka.classifiers.trees.RandomForest", null); | |
m_Classifier.buildClassifier(localInstances); |
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 java.io.File; | |
import weka.core.Attribute; | |
import weka.core.FastVector; | |
import weka.core.Instance; | |
import weka.core.Instances; | |
import weka.core.converters.ArffSaver; | |
import weka.filters.Filter; | |
import weka.filters.unsupervised.instance.NonSparseToSparse; |
OlderNewer