Skip to content

Instantly share code, notes, and snippets.

devflow devflow

Block or report user

Report or block devflow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@devflow
devflow / tsn.rs
Last active Jan 18, 2020
369game (three six nine game) with RUST!
View tsn.rs
//three six nine. 369 game
fn main() {
for n in 1..100 {
let mut cur_num: u32 = n;
let mut clap_cnt: u32 = 0;
while cur_num > 0 {
let cur_x:u32 = cur_num % 10;
clap_cnt += match cur_x {
@devflow
devflow / here.php
Created Jun 17, 2016
php. get max or min in array except zero(or something)
View here.php
<?php
$myArray = array(1,0,2,3,0,4,5,99,6,7,8,9,0);
$except = array(0);
$value = min(array_values(array_diff($myArray, $except)));
// $value == 1
@devflow
devflow / example.java
Created Jun 8, 2016
android-async-http file array.
View example.java
Map<String, ArrayList<File>> fileMaps = new HashMap<>();
for (QueryParam queryParam : queryParams) {
if(queryParam == null) continue;
String type = queryParam.type;
if (type.equalsIgnoreCase("string")) {
requestParams.add(queryParam.key, queryParam.val);
} else if (type.equalsIgnoreCase("file")) {
try {
if(!fileMaps.containsKey(queryParam.key)){
View XE, center crop for createImageFile()
function createImageFile($source_file, $target_file, $resize_width = 0, $resize_height = 0, $target_type = '', $thumbnail_type = 'crop')
{
// check params
if (($source_file = FileHandler::exists($source_file)) === FALSE)
{
return;
}
$target_file = FileHandler::getRealPath($target_file);
if(!$resize_width)
@devflow
devflow / IndexedFragmentPagerAdapter.java
Created Nov 27, 2015
IndexedFragmentPagerAdapter.java
View IndexedFragmentPagerAdapter.java
public class IndexedFragmentPagerAdapter extends FragmentPagerAdapter {
public SparseArray<Fragment> fragments = new SparseArray<>();
public IndexedFragmentPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
return null;
You can’t perform that action at this time.