Condition can be rewritten to: `&&  pos.non_pawn_material(pos.side_to_move()) > (beta == 0) * BishopValueMg)`


Arin @ruoat kanssa juttelimme alussa, että DTO-luokat pidetään puhtaina. Näihin luokkiin ei tule mitään toString tai vastaavia metodeja. Tätä varten on tehty LogEntryUtil-luokka, jolla voi muuntaa minkä tahansa LogEntry-luokan perillisen merkkijonoksi kutsulla LogEntryUtil.getJson(olio) tai jopa LogEntryUtil.getString(olio). Anteeksi, että en tajunnut mainita tästä aiemmin! Nämä toString ja equals -metodit tulisi poista DTO-luokista.  Vai tarvitaanko näitä koska Spring Bootin toimesta jossakin?


package com.example.anshul.deliverapp.utility;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.SystemClock;
import android.provider.MediaStore;
import android.provider.Settings;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;
import android.text.format.DateFormat;
import android.util.Base64;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.Toast;

import com.example.anshul.deliverapp.R;
import com.example.anshul.deliverapp.application.AppController;
import com.example.anshul.deliverapp.services.GPSTracker;
import com.example.anshul.deliverapp.services.GpsScheduler;
import com.example.anshul.deliverapp.services.GpsService;
import com.example.anshul.deliverapp.sharedprefs.PreferenceManager;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;

/**
 * Created by GJS280 on 10/4/2015.
 */
public class Utility {

    private static  ProgressDialog progressDialog;
    public static final int REQUEST_IMAGE_CAPTURE = 1;

//    private static AmazonS3Client sS3Client;
//    private static CognitoCachingCredentialsProvider sCredentialProvider;
//    private static TransferUtility sTransferUtility;

    /**
     * Amazon
     * Gets an instance of CognitoCachingCredentialsProvider which is
     * constructed using the given Context.
     *
     * @param context An Context instance.
     * @return A default credential provider.
     */
//    private static CognitoCachingCredentialsProvider getCredentialProvider(Context context) {
//        if (sCredentialProvider == null) {
//            sCredentialProvider = new CognitoCachingCredentialsProvider(
//                    context.getApplicationContext(),
//                    Constants.COGNITO_POOL_ID,
//                    Regions.US_EAST_1);
//        }
//
//        return sCredentialProvider;
//    }

    /**
     * Amazon
     * Gets an instance of a S3 client which is constructed using the given
     * Context.
     *
     * @param context An Context instance.
     * @return A default S3 client.
     */
//    public static AmazonS3Client getS3Client(Context context) {
//        if (sS3Client == null) {
//            sS3Client = new AmazonS3Client(getCredentialProvider(context.getApplicationContext()));
//            // Set the region of your S3 bucket
//            sS3Client.setRegion(Region.getRegion(Regions.US_EAST_1));
//        }
//        return sS3Client;
//    }

    /**
     * Amazon
     * Gets an instance of the TransferUtility which is constructed using the
     * given Context
     *
     * @param context
     * @return a TransferUtility instance
     */
//    public static TransferUtility getTransferUtility(Context context) {
//        if (sTransferUtility == null) {
//            sTransferUtility = new TransferUtility(getS3Client(context.getApplicationContext()),
//                    context.getApplicationContext());
//        }
//
//        return sTransferUtility;
//    }

    /**
     * Save data in shared preferences
     * @param mContext
     * @param key
     * @param data
     */
    public static void saveToSharedPrefs(Context mContext, String key, String data) {
        final String PREFS_NAME = "com.gojavas.taskforce.preferences";
        final SharedPreferences taskForceData = mContext.getSharedPreferences(PREFS_NAME, 0);
        SharedPreferences.Editor editor = taskForceData.edit();
        editor.putString(key, data);
        editor.commit();
    }

    public static String getDateFromMilliseconds(long time) {
        Calendar cal = Calendar.getInstance(Locale.ENGLISH);
        cal.setTimeInMillis(time);
        String date = DateFormat.format("dd-MM-yyyy HH:mm:ss", cal).toString();
        return date;
    }

    /**
     * Get data from shared preferences
     * @param mContext
     * @param key
     * @return saved value
     */
    public static String getFromSharedPrefs(Context mContext, String key) {
        final String PREFS_NAME = "com.gojavas.taskforce.preferences";
        final SharedPreferences taskForceData = mContext.getSharedPreferences(PREFS_NAME, 0);
        final String preData = taskForceData.getString(key, "");
        return preData;
    }

    /**
     * Delete data from shared preference based on key
     * @param mContext
     * @param key
     */

    public static void deleteFromSharedPrefs(Context mContext, String key){
        final String PREFS_NAME = "com.gojavas.taskforce.preferences";
        final SharedPreferences taskForceData = mContext.getSharedPreferences(PREFS_NAME, 0);
        taskForceData.edit().remove(key).commit();
    }

    /**
     * Hide keyboard
     * @param activity
     */
    public static void hideKeyboard(Activity activity) {
        InputMethodManager inputMethodManager = (InputMethodManager)  activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
        inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
    }

    /**
     * Get device id
     * @return
     */
    public static String getDeviceId() {
        Context context = AppController.getInstance();
        TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
        return telephonyManager.getDeviceId();
    }

    /**
     * Get screen width
     * @return
     */
    public static int getScreenWidth(Context context) {
        DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
        int screenWidth = (int) (displayMetrics.widthPixels / displayMetrics.density);
        return screenWidth;
    }

    /**
     * Get screen metrics width
     * @param activity
     * @return
     */
    public static int getMetricsWidth(Activity activity) {
        DisplayMetrics displayMetrics = new DisplayMetrics();
        activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
        return  displayMetrics.widthPixels;
    }

    /**
     * Get screen height
     * @param context
     * @return
     */
    public static int getScreenHeight(Context context) {
        DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
        int screenHeight = (int) (displayMetrics.heightPixels / displayMetrics.density);
        return screenHeight;
    }

    /**
     * Get screen metrics height
     * @param activity
     * @return
     */
    public static int getMetricsHeight(Activity activity) {
        DisplayMetrics displayMetrics = new DisplayMetrics();
        activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
        return  displayMetrics.heightPixels;
    }

    /**
     * Show toast message
     * @param mContext
     * @param string
     */
    public static void showToast(Context mContext, String string) {
        Toast toast = Toast.makeText(mContext, string, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.TOP, 10, 100);
        toast.show();
    }

    /**
     * Show toast message
     * @param mContext
     * @param string
     */
    public static void showShortToast(Context mContext, String string) {
        Toast toast = Toast.makeText(mContext, string, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.TOP, 10, 100);
        toast.show();
    }

    public static void showProgrss(String message,Context context) {

        progressDialog = new ProgressDialog(context);
        if (progressDialog != null && !progressDialog.isShowing()) {
            progressDialog.show();
            progressDialog.setMessage(message);
            progressDialog.setCancelable(false);
        }
    }

    public static void hideProgrss() {
        if (progressDialog != null && progressDialog.isShowing()) {
            progressDialog.dismiss();
        }
    }
    /**
     * Show alert dialog
     * @param context
     * @param title
     * @param message
     */
    public static void showAlertDialog(final Context context, String title, String message) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle(title);
        builder.setMessage(message);
        builder.setCancelable(false);

        builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                ((Activity) context).finish();
                dialog.dismiss();
            }
        });

        final AlertDialog alertDialog = builder.create();
        alertDialog.show();
    }

    /**
     * Show alert dialog
     * @param context
     * @param title
     * @param message
     */
    public static void showNormalAlertDialog(final Context context, String title, String message) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle(title);
        builder.setMessage(message);

        builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });

        final AlertDialog alertDialog = builder.create();
        alertDialog.show();
    }

    public static String getApplicationPath(String directory) {
        return Environment.getExternalStorageDirectory() + "/GoDelivery/Current/" + directory;
    }

    public static String getApplicationBackupPath() {
        String path =  Environment.getExternalStorageDirectory() + "/GoDelivery/Backup/";
        File file = new File(path);
        if(!file.exists()) {
            file.mkdirs();
        }
        return path;
    }

    /**
     * Check whether internet is connected or not
     * @param mContext
     * @return
     */
    public static boolean isInternetConnected(Context mContext) {
        final ConnectivityManager connection = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
        if (connection != null&& (connection.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED)|| (connection.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED)) {
            return true;
        }
        return false;
    }

    public static HashMap<String,String> getLocationScheduler(Context context){

        GPSTracker gps = new GPSTracker(context);
        HashMap<String,String> map=new HashMap<>();

        // check if GPS enablred
        if(gps.canGetLocation()) {
            double latitude = gps.getLatitude();
            double longitude = gps.getLongitude();
            String network_type=gps.getNetworkType();

            map.put(Constants.LATITUDE, latitude + "");
            map.put(Constants.LONGITUDE,longitude+"");
            map.put(Constants.PROVIDER,network_type);

            // \n is for new line
            // Toast.makeText(getApplicationContext(), "Your Location is - \nLat: " + latitude + "\nLong: " + longitude, Toast.LENGTH_LONG).show();
        }
        return map;
    }

    /**
     * Scheduler for send tracking details
     *
     * @param context
     */
    public static void startTrackScheduler(Context context) {
        Intent intent = new Intent(context, GpsScheduler.class);
        PendingIntent pintent = PendingIntent.getService(context, Constants.ALARM_TRACK_KEY, intent, 0);
        AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
        long repeatingTime = 1 * 60 * 1000; // 1 minute
//        long repeatingTime = 30*1000;
        alarm.setRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), repeatingTime, pintent);
    }

    public static void cancelAlarm(Context context){

        Intent intent = new Intent(context, GpsScheduler.class);
        PendingIntent pendingIntent = PendingIntent.getService(context,Constants.ALARM_TRACK_KEY, intent, 0);
        AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
        alarmManager.cancel(pendingIntent);

    }
    /**
     * Extract the sqlite database from device
     * @param context
     */
    public static void extractDatabaseFromDevice(Context context) {
        File sd = Environment.getExternalStorageDirectory();
        String DB_PATH;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            DB_PATH = context.getFilesDir().getAbsolutePath().replace("files", "databases") + File.separator;
        }
        else {
            DB_PATH = context.getFilesDir().getPath() + context.getPackageName() + "/databases/";
        }
        if (sd.canWrite()) {
            //TaskForce DB
            String currentDBPath = "TaskForce.db";
            String backupDBPath = "TaskForce_backup.db";
            File currentDB = new File(DB_PATH, currentDBPath);
            File backupDB = new File(sd, backupDBPath);

            if (currentDB.exists()) {
                try {
                    FileChannel src = new FileInputStream(currentDB).getChannel();
                    FileChannel dst = new FileOutputStream(backupDB).getChannel();
                    dst.transferFrom(src, 0, src.size());
                    src.close();
                    dst.close();
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }

        String PATH;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            PATH = context.getFilesDir().getAbsolutePath() + File.separator;
        }
        else {
            PATH = context.getFilesDir().getPath() + context.getPackageName() + "/files/";
        }
        if (sd.canWrite()) {
            //TaskForce DB
            String currentPath = "Design.txt";
            String backupPath = "Design_backup.txt";
            File current = new File(PATH, currentPath);
            File backup = new File(sd, backupPath);

            if (current.exists()) {
                try {
                    FileChannel src = new FileInputStream(current).getChannel();
                    FileChannel dst = new FileOutputStream(backup).getChannel();
                    dst.transferFrom(src, 0, src.size());
                    src.close();
                    dst.close();
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
    }

    // Check dates are equal or not
    public static boolean areEqual(long logintime, long currentTimeMillis) {
        try {
            Calendar c1 = Calendar.getInstance();
            c1.setTime(new Date(logintime));

            Calendar c2 = Calendar.getInstance();
            c2.setTime(new Date(currentTimeMillis));

            return ((c1.get(Calendar.DAY_OF_YEAR) == c2.get(Calendar.DAY_OF_YEAR))
                    &&
                    (c1.get(Calendar.YEAR) == c2.get(Calendar.YEAR)));

        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

    /**
     * Copy bitmap to a location
     * @param bitmap
     * @param destinationPath
     * @param fileName
     * @return
     */
    public static boolean copyBitmap(Bitmap bitmap, String destinationPath, String fileName) {
        boolean isok = true;
        FileOutputStream fos = null;
        File dir = new File(destinationPath);
        if(!dir.exists())
            dir.mkdirs();
        File file = new File(dir, fileName);
        if (file.exists ()) file.delete ();
        try {
            fos = new FileOutputStream(file);
            bitmap.setHasAlpha(true);
            bitmap.compress(Bitmap.CompressFormat.PNG, 90, fos);
            fos.flush();
            fos.close();
        } catch (Exception e) {
            isok = false;
            e.printStackTrace();
        } finally {
            try {
                fos.close();
            } catch (Exception e) {
                isok = false;
                e.printStackTrace();
            }
        }
        return isok;
    }

    /**
     * Send sms to customer
     * @param phoneNo
     * @param sms
     * @param mContext
     */
    public static void sendSms(String phoneNo, String sms, Context mContext) {
        SmsManager smsManager = SmsManager.getDefault();
        ArrayList<String> parts = smsManager.divideMessage(sms);
        smsManager.sendMultipartTextMessage(phoneNo, null, parts, null, null);

//        CallLogEntity callLogEntity = new CallLogEntity();
//        callLogEntity.setusername(Utility.getFromSharedPrefs(mContext, Constants.USERNAME_KEY));
//        callLogEntity.setname(phoneNo);
//        callLogEntity.setnumber(phoneNo);
//        callLogEntity.setduration("0");
//        callLogEntity.setsync("0");
//        callLogEntity.settype(Constants.PROFESSIONAL);
//        callLogEntity.setdate(System.currentTimeMillis() + "");
//        callLogEntity.setcall_sms(Constants.SMS);
//
//        CallLogHelper.getInstance().insertCallLog(callLogEntity);
    }

    /**
     * Show dialog
     */
    public static void showDialog(Context context, String title, String message) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle(title);
        builder.setMessage(message);

        builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });

        final AlertDialog alertDialog = builder.create();
        alertDialog.show();
    }

    /**
     * Get the actual bitmap from path
     * @return
     */
    public static Bitmap getBitmap() {
        File image = new File("/storage/emulated/0/DCIM/Screenshots/Screenshot_2015-05-21-01-39-53.png");
        BitmapFactory.Options bmOptions = new BitmapFactory.Options();
        Bitmap bitmap = BitmapFactory.decodeFile(image.getAbsolutePath(), bmOptions);
        return  bitmap;
    }

    public static void saveBitmap() {
        Bitmap bitmap = getBitmap();
        FileOutputStream fos = null;
        try {
            fos = AppController.getInstance().openFileOutput("screenshot.png", Context.MODE_PRIVATE);
//            fos.write(jsonObject.toString().getBytes());
            bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
            fos.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void getBitmapFromData() {
        File sd = Environment.getExternalStorageDirectory();
        Context context = AppController.getInstance();
        String PATH;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            PATH = context.getFilesDir().getAbsolutePath() + File.separator;
        }
        else {
            PATH = context.getFilesDir().getPath() + context.getPackageName() + "/files/";
        }
        if (sd.canWrite()) {
            //TaskForce DB
            String currentPath = "screenshot.png";
            String backupPath = "screenshot_backup.png";
            File current = new File(PATH, currentPath);
            File backup = new File(sd, backupPath);

            if (current.exists()) {
                try {
                    FileChannel src = new FileInputStream(current).getChannel();
                    FileChannel dst = new FileOutputStream(backup).getChannel();
                    dst.transferFrom(src, 0, src.size());
                    src.close();
                    dst.close();
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
    }

    /**
     * Decode bitmap and scale it to required size
     * @param file
     * @return
     */
    public static Bitmap decodeFile(File file) {
        Context context = AppController.getInstance();
        int mSize = getScreenWidth(context) / 2;
        try {
            // Decode image size
            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inJustDecodeBounds = true;
            BitmapFactory.decodeStream(new FileInputStream(file), null, options);

            // Find the correct scale value. It should be the power of 2.
            int width_tmp = options.outWidth, height_tmp = options.outHeight;
            int scale = 1;
            while(true) {
                if(width_tmp/2 < mSize || height_tmp/2 < mSize)
                    break;
                width_tmp /= 2;
                height_tmp /= 2;
                scale *= 2;
            }

            // Decode with inSampleSize
            BitmapFactory.Options options2 = new BitmapFactory.Options();
            options2.inSampleSize = scale;
            return BitmapFactory.decodeStream(new FileInputStream(file), null, options2);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }

    /**
     * Get file name from its path
     * @param filePath
     * @return
     */
    public static String getFileNameFromPath(String filePath) {
        String name = "";
        if(filePath.contains("/")) {
            name = filePath.substring(filePath.lastIndexOf("/")+1, filePath.length());
        }
        return name;
    }

    public static String getDate(long time) {
        Calendar cal = Calendar.getInstance(Locale.ENGLISH);
        cal.setTimeInMillis(time);
        String date = DateFormat.format("dd-MM-yyyy", cal).toString();
        return date;
    }

    /**
     * Get scaled bitmap from bytes array
     * @param data
     * @param reqWidth
     * @param reqHeight
     * @return
     */
    public static Bitmap getScaledBitmap(byte[] data, int reqWidth, int reqHeight) {
        // First decode with inJustDecodeBounds=true to check dimensions
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeByteArray(data, 0, data.length, options);

        // Calculate inSampleSize
        options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);

        // Decode bitmap with inSampleSize set
        options.inJustDecodeBounds = false;
        return BitmapFactory.decodeByteArray(data, 0, data.length, options);
    }

    /**
     * Get scaled bitmap from file path
     * @param path
     * @param reqWidth
     * @param reqHeight
     * @return
     */
    public static Bitmap getScaledBitmap(String path, int reqWidth, int reqHeight) {
        // First decode with inJustDecodeBounds=true to check dimensions
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(path, options);

        // Calculate inSampleSize
        options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);

        // Decode bitmap with inSampleSize set
        options.inJustDecodeBounds = false;
        return BitmapFactory.decodeFile(path, options);
    }

    /**
     * Calculate bitmap insample size
     * @param options
     * @param reqWidth
     * @param reqHeight
     * @return
     */
    public static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) {
        final int height = options.outHeight;
        final int width = options.outWidth;
        int inSampleSize = 1;

        if (height > reqHeight || width > reqWidth) {
            if (width > height) {
                inSampleSize = Math.round((float) height / (float) reqHeight);
            } else {
                inSampleSize = Math.round((float) width / (float) reqWidth);
            }
        }
        return inSampleSize;
    }

    // get current date and time for free recharge
    public static String getDateForFR(){

        // get current date and time
        Calendar cal = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("ddMMyyyyHHmmss");
        String strDate = sdf.format(cal.getTime());
        System.out.println("Current date in String Format: "+strDate);

        return strDate;

    }

    public  static boolean   getDaysDiff(Context context){
        Calendar today = Calendar.getInstance();
        long difference = today.getTimeInMillis() - PreferenceManager.getLongInPref(context,AppConstants.LOGIN_TIME,0);
        int days = (int) (difference/ (1000*60*60*24));

        if (days>10){
            PreferenceManager.saveStringInPref(context,AppConstants.App_CLOSE,"true");

            return true;
        }

        return false;
    }
    public static  void getLocationOnOff(final Context context){
        LocationManager lm = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
        boolean gps_enabled = false;
        boolean network_enabled = false;

        try {
            gps_enabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
        } catch(Exception ex) {}

        try {
            network_enabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
        } catch(Exception ex) {}

        if(!gps_enabled && !network_enabled) {
            // notify user
            AlertDialog.Builder dialog = new AlertDialog.Builder(context);
            dialog.setMessage("GPS Network Not Enabled");
            dialog.setPositiveButton("Open Setting", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface paramDialogInterface, int paramInt) {
                    // TODO Auto-generated method stub
                    Intent myIntent = new Intent( Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                    context.startActivity(myIntent);
                    ((Activity)context).finish();
                    //get gps
                }
            });
            dialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface paramDialogInterface, int paramInt) {
                    // TODO Auto-generated method stub
                    ((Activity)context).finish();
                }
            });
            dialog.setCancelable(false);
            dialog.show();
        }else {
            context.startService(new Intent(context, GpsService.class));
        }

    }

    public static File dispatchTakePictureIntent(Context context) {

        Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        // Ensure that there's a camera activity to handle the intent
        if (takePictureIntent.resolveActivity(context.getPackageManager()) != null) {
            // Create the File where the photo should go
            File photoFile = null;
            try {
                photoFile = createImageFile();
            } catch (IOException ex) {
                // Error occurred while creating the File
                Utility.showToast(context,"Problem with Creating a File");
            }
            return photoFile;
        }else {
            Utility.showToast(context,"Problem with Camera");
        }
        return null;
    }

    public static void startCamera(Context context ,File photoFile,int requestCode){

        Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
        ((Activity)context).startActivityForResult(takePictureIntent, requestCode);
    }

    private static File createImageFile() throws IOException {
        // Create an image file name
        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
        String imageFileName = "JPG" + timeStamp + "_";

        File albumF = getAlbumDir();
        File imageF = File.createTempFile(imageFileName, ".jpg", albumF);
        return imageF;
    }

    private static File getAlbumDir() {

        File storageDir = null;

        if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {

            storageDir =new File (Environment.getExternalStorageDirectory()
                    + "/DeliveryImages");

            if (storageDir != null) {
                if (! storageDir.mkdirs()) {
                    if (! storageDir.exists()){
                        Log.d("DeliveryImages", "failed to create directory");
                        return null;
                    }
                }
            }
        } else {
            Log.v("camera", "External storage is not mounted READ/WRITE.");
        }

        return storageDir;
    }

    public static Bitmap setPic(String mCurrentPhotoPath, ImageView mImageView) {
        // Get the dimensions of the View
        int targetW = mImageView.getWidth();
        int targetH = mImageView.getHeight();

        // Get the dimensions of the bitmap
        BitmapFactory.Options bmOptions = new BitmapFactory.Options();
        bmOptions.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);
        int photoW = bmOptions.outWidth;
        int photoH = bmOptions.outHeight;

        // Determine how much to scale down the image
        int scaleFactor = Math.min(photoW/targetW, photoH/targetH);

        // Decode the image file into a Bitmap sized to fill the View
        bmOptions.inJustDecodeBounds = false;
        bmOptions.inSampleSize = scaleFactor;
        bmOptions.inPurgeable = true;

        Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);
        mImageView.setImageBitmap(bitmap);
        return bitmap;
//
    }

    public static String encodeToBase64(Bitmap image)
    {
        ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream();
        image.compress(Bitmap.CompressFormat.JPEG, 70, byteArrayOS);
        return Base64.encodeToString(byteArrayOS.toByteArray(), Base64.DEFAULT);
    }
}


ok


Hi Thomas, I see you merging my branch  :)

One thing to be careful about with concat_strs/concat_bytes: concat_bytes([...]) does not work ! you need concat_bytes(*[...]).

There are a few cases above that have this issue.


[R/alignment_to_beast_posterior.R:5:1:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/alignment_to_beast_posterior.R#L5) *style:* **Lines should not be more than 80 characters.**
```r
#' @param base_filename The base of the filename (the part without the extension)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/are_identical_trees_posteriors.R:17:12:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/are_identical_trees_posteriors.R#L17) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
    return (FALSE)
           ^
```
[R/are_identical_trees_posteriors.R:22:14:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/are_identical_trees_posteriors.R#L22) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
      return (FALSE)
             ^
```
[R/are_identical_trees_posteriors.R:26:10:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/are_identical_trees_posteriors.R#L26) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  return (TRUE)
         ^
```
[R/convert_indices.R:34:25:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/convert_indices.R#L34) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  i <- 1 + (sti - 1) + ( (ai - 1) * nstpist)
                        ^
```
[R/convert_indices.R:35:10:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/convert_indices.R#L35) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  return (i)
         ^
```
[R/convert_indices.R:64:6:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/convert_indices.R#L64) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    ( (ai - 1) * nstpist        ) +
     ^
```
[R/convert_indices.R:64:32:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/convert_indices.R#L64) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    ( (ai - 1) * nstpist        ) +
                               ^
```
[R/convert_indices.R:65:6:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/convert_indices.R#L65) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    ( (pi - 1) * nstpist * napst)
     ^
```
[R/convert_indices.R:66:10:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/convert_indices.R#L66) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  return (i)
         ^
```
[R/find_paths.R:3:1:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/find_paths.R#L3) *style:* **Lines should not be more than 80 characters.**
```r
#' @return the full path of the filename if an existing file could be found, stops otherwise
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/find_paths.R:28:1:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/find_paths.R#L28) *style:* **Lines should not be more than 80 characters.**
```r
#' @return the full path of the filenames if an existing file could be found, stops otherwise
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/find_paths.R:30:1:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/find_paths.R#L30) *style:* **Lines should not be more than 80 characters.**
```r
#'   filenames <- wiritttes::find_paths(c("toy_example_1.RDa", "toy_example_2.RDa"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/get_alignment.R:66:10:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/get_alignment.R#L66) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  return (alignment)
         ^
```
[R/get_pbd_output.R:8:5:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/get_pbd_output.R#L8) *style:* **Commented code should be removed.**
```r
  # file <- wiritttes::read_file(filename)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/get_posterior.R:92:10:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/get_posterior.R#L92) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  return (posterior)
         ^
```
[R/has_beast2.R:14:10:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/has_beast2.R#L14) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  return (!is.na(beast_path))
         ^
```
[R/is_valid_file.R:46:30:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/is_valid_file.R#L46) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  if (is.na(success)) return (FALSE)
                             ^
```
[R/is_valid_file.R:51:30:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/is_valid_file.R#L51) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  if (is.na(success)) return (FALSE)
                             ^
```
[R/is_valid_file.R:56:30:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/is_valid_file.R#L56) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  if (is.na(success)) return (FALSE)
                             ^
```
[R/is_valid_file.R:61:30:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/is_valid_file.R#L61) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  if (is.na(success)) return (FALSE)
                             ^
```
[R/is_valid_file.R:66:30:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/is_valid_file.R#L66) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  if (is.na(success)) return (FALSE)
                             ^
```
[R/nrbs.R:12:1:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/nrbs.R#L12) *style:* **Lines should not be more than 80 characters.**
```r
#'   Heled, Joseph, and Alexei J. Drummond. "Bayesian inference of species trees from multilocus data." Molecular biology and evolution 27.3 (2010): 570-580.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nrbs.R:13:1:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/nrbs.R#L13) *style:* **Lines should not be more than 80 characters.**
```r
#'   Kuhner, Mary K., and Joseph Felsenstein. "A simulation comparison of phylogeny algorithms under equal and unequal evolutionary rates." Molecular Biology and Evolution 11.3 (1994): 459-468.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/read_files.R:6:1:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/read_files.R#L6) *style:* **Lines should not be more than 80 characters.**
```r
#'   files <- read_files(find_paths(c("toy_example_1.RDa", "toy_example_2.RDa")))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/save_parameters_to_file.R:9:1:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/save_parameters_to_file.R#L9) *style:* **Lines should not be more than 80 characters.**
```r
#' @param mutation_rate the probability per nucleotide to mutate at a DNA replication
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/save_parameters_to_file.R:14:1:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/save_parameters_to_file.R#L14) *style:* **Lines should not be more than 80 characters.**
```r
#' @param filename the name of the parameter file that will be created by this function
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/save_parameters_to_file.R:51:26:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/save_parameters_to_file.R#L51) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  my_table <- data.frame( row.names = c("Description", "Value"))
                         ^
```
[R/set_alignment.R:56:10:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/set_alignment.R#L56) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  return (
         ^
```
[R/set_posterior.R:63:10:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/R/set_posterior.R#L63) *style:* **Remove spaces before the left parenthesis in a function call.**
```r
  return (
         ^
```
[tests/testthat/test-nrbs.R:14:35:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/tests/testthat/test-nrbs.R#L14) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  expect_true(difference >= 0.0    )
                                  ^
```
[tests/testthat/test-nrbs.R:35:5:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/tests/testthat/test-nrbs.R#L35) *style:* **Variable or function name should be snake_case.**
```r
  p$tip.label <- paste0("s", 1:5)
    ^~~~~~~~~
```
[tests/testthat/test-nrbs.R:45:5:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/tests/testthat/test-nrbs.R#L45) *style:* **Variable or function name should be snake_case.**
```r
  p$tip.label <- new_labels
    ^~~~~~~~~
```
[tests/testthat/test-nrbs.R:46:5:](https://github.com/richelbilderbeek/wiritttes/blob/2c2384a711315c693ed2d0422969909529bc75d6/tests/testthat/test-nrbs.R#L46) *style:* **Variable or function name should be snake_case.**
```r
  q$tip.label <- new_labels
    ^~~~~~~~~
```


package com.example.anshul.deliverapp.services;

import android.app.IntentService;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.location.Location;
import android.os.IBinder;

import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.example.anshul.deliverapp.application.AppController;
import com.example.anshul.deliverapp.sharedprefs.PreferenceManager;
import com.example.anshul.deliverapp.utility.AppApi;
import com.example.anshul.deliverapp.utility.AppConstants;
import com.example.anshul.deliverapp.utility.Constants;
import com.example.anshul.deliverapp.utility.Utility;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.Calendar;
import java.util.HashMap;

/**
 * Created by gjs331 on 5/20/2015.
 */
public class GpsScheduler extends IntentService {

    GpsService mLocalService;
    private boolean mBound;

   public GpsScheduler(){
        super("GpsScheduler");
    }
    public GpsScheduler(String name) {

        super(name);
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;

    }

    ServiceConnection mServiceConnection=new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName componentName, IBinder iBinder) {

            GpsService.LocalBinder localService=(GpsService.LocalBinder) iBinder;
            mLocalService=localService.getService();
            mBound=true;
        }

        @Override
        public void onServiceDisconnected(ComponentName componentName) {
            mBound=false;

        }
    };

    @Override
    public void onStart(Intent intent, int startId) {
        super.onStart(intent, startId);

        Intent intent1=new Intent(this, GpsService.class);
        bindService(intent1,mServiceConnection, Context.BIND_AUTO_CREATE);
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        HashMap<String,String> map = Utility.getLocationScheduler(AppController.getInstance());

        String longitude=map.get(Constants.LONGITUDE);
        Location location=mLocalService.getmCurrentLocation();

        if (mBound && location!=null/*map.size()!=0 && longitude!=null && !longitude.equalsIgnoreCase("0.0")*/) {
            Calendar cal = Calendar.getInstance();

            JSONObject finalRequestJson = new JSONObject();

            try {

                finalRequestJson.put("lat",location.getLatitude()/*map.get(Constants.LATITUDE)*/);
                finalRequestJson.put("long",location.getLongitude()/*map.get(Constants.LONGITUDE)*/);
                finalRequestJson.put("rider_id", PreferenceManager.getStringInPref(this, AppConstants.USER_ID,""));

                System.out.println("track: " + finalRequestJson.toString());

                JsonObjectRequest pushRequest = new JsonObjectRequest(Request.Method.POST, AppApi.BASE_URL+"latlongpush.php", finalRequestJson, new Response.Listener<JSONObject>() {
                    @Override
                    public void onResponse(JSONObject jsonObject) {
                        System.out.println("track log response: " + jsonObject.toString());

                        // Start call log scheduler

                    }
                }, new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError volleyError) {
                        volleyError.printStackTrace();

                        // Start call log scheduler
                    }
                });
                AppController.getInstance().addToRequestQueue(pushRequest);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }

        }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mBound){
            unbindService(mServiceConnection);
            mBound=false;
        }

    }

    //        Toast.makeText(this, map.get(Constants.PROVIDER), Toast.LENGTH_LONG).show();

//        Log.i("provoider",map.get(Constants.PROVIDER)+" "+map.get(Constants.LONGITUDE));

    }


package com.example.anshul.deliverapp.activity;

import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.VolleyLog;
import com.android.volley.toolbox.JsonObjectRequest;
import com.example.anshul.deliverapp.R;
import com.example.anshul.deliverapp.application.AppController;
import com.example.anshul.deliverapp.model.PushModel;
import com.example.anshul.deliverapp.model.pickup.Contact;
import com.example.anshul.deliverapp.services.GpsService;
import com.example.anshul.deliverapp.sharedprefs.PreferenceManager;
import com.example.anshul.deliverapp.utility.AppApi;
import com.example.anshul.deliverapp.utility.AppConstants;
import com.example.anshul.deliverapp.utility.Utility;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Anshul on 3/5/2017.
 */

public class JobDetailsActivity extends AppCompatActivity implements View.OnClickListener{
    String strReasonName;
    TextView tv_custname,tv_custno,tv_custaddr,tv_itemdesc,tv_specialinstrn,tv_cod,tv_jobtype;
    Button btn_success,btn_fail;
    Contact contact;
    EditText et_remarks;
    GpsService mLocalService;
    private boolean mBound;
    private int count=0;
    private ImageView ivPic1,ivPic2;
    private String imageName1,imageName2,image1Base64="",image2Base64="";
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_jobdetails);

      /*  Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);*/

        tv_custname=(TextView)findViewById(R.id.detail_custname);
        tv_custno=(TextView)findViewById(R.id.detail_custNo);
        tv_custaddr=(TextView)findViewById(R.id.detail_custaddress);
        tv_itemdesc=(TextView)findViewById(R.id.detail_itemdesc);
        tv_specialinstrn=(TextView)findViewById(R.id.detail_specialinstn);
        tv_cod=(TextView)findViewById(R.id.detail_cod);
        tv_jobtype=(TextView)findViewById(R.id.detail_jobtype);
        btn_success=(Button)findViewById(R.id.button_sucess);
        btn_fail=(Button)findViewById(R.id.button_fail);
        btn_fail=(Button)findViewById(R.id.button_fail);
        et_remarks=(EditText)findViewById(R.id.remarks);
        ivPic1=(ImageView)findViewById(R.id.iv_pic1);
        ivPic2=(ImageView)findViewById(R.id.iv_pic2);

        Intent i = getIntent();
        contact = (Contact) i.getSerializableExtra(AppConstants.DATA);

        tv_custname.setText(contact.getPickupCustName());
        tv_custno.setText(contact.getPickupCustNo());
        tv_custaddr.setText(contact.getPickupAddress());
        tv_itemdesc.setText(contact.getItemDescription());
        tv_specialinstrn.setText(contact.getSpacialInstruction());
        tv_jobtype.setText(contact.getJobType());

        if (contact.getJobType().equalsIgnoreCase("Drop")){
            tv_cod.setText(contact.getDropCod());
        }else {
            tv_cod.setText("0");
        }

        Log.i("ss",contact.toString());

        btn_success.setOnClickListener(this);
        btn_fail.setOnClickListener(this);
        ivPic1.setOnClickListener(this);
        ivPic2.setOnClickListener(this);

     /*   btn_success.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (Utility.isInternetConnected(JobDetailsActivity.this)){
                    strReasonName="";
                    makeJsonObjReq("1");
                }else {
                    Utility.showToast(JobDetailsActivity.this,"No Internet Connection");
                }

//                showAlert("1");
            }
        });*/
//{"rider_id":"1001","job_id":"101","job_status":"1","job_type":"D","job_failed_reason":""}
     /*   btn_fail.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Toast.makeText(JobDetailsActivity.this,mLocalService.getmCurrentLocation()+"",Toast.LENGTH_SHORT).show();

            AppController.getOnserver().notifyObservers();
                if (Utility.isInternetConnected(JobDetailsActivity.this)){
                    showAlert("0");
                }else {
                    Utility.showToast(JobDetailsActivity.this,"No Internet Connection");
                }

//                makeJsonObjReq("0");
            }
        });
*/

    }

    @Override
    protected void onStart() {
        super.onStart();
        Intent intent=new Intent(this, GpsService.class);
        bindService(intent,mServiceConnection, Context.BIND_AUTO_CREATE);
    }

    @Override
    protected void onStop() {
        super.onStop();
        if (mBound){
            unbindService(mServiceConnection);
            mBound=false;
        }
    }

    ServiceConnection mServiceConnection=new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName componentName, IBinder iBinder) {

            GpsService.LocalBinder localService=(GpsService.LocalBinder) iBinder;
            mLocalService=localService.getService();
            mBound=true;
        }

        @Override
        public void onServiceDisconnected(ComponentName componentName) {
            mBound=false;

        }
    };

    /**
     * Making json object request
     * */
    private void makeJsonObjReq(String status) {
        Utility.showProgrss("Please wait...",this);
        JSONObject jsonObject=new JSONObject();

        try {
            jsonObject.put("rider_id", PreferenceManager.getStringInPref(JobDetailsActivity.this,AppConstants.USER_ID,""));
            jsonObject.put("job_id",contact.getJobId());
            jsonObject.put("job_status",status);
            jsonObject.put("job_type",contact.getJobType());
            jsonObject.put("job_failed_reason",strReasonName);
            jsonObject.put("job_comment",et_remarks.getText().toString().trim());
            jsonObject.put("lat_long",mLocalService.getmCurrentLocation().getLatitude()+","+mLocalService.getmCurrentLocation().getLongitude());

        } catch (JSONException e) {
            e.printStackTrace();
        }
        JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.POST,
                AppApi.BASE_URL+"pushstatus.php", jsonObject,
                new Response.Listener<JSONObject>() {

                    @Override
                    public void onResponse(JSONObject response) {
                        Log.d("Login", response.toString());
                        Utility.hideProgrss();

                        ObjectMapper mapper = new ObjectMapper();
                        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
                        try {
                            PushModel pushModel = mapper.readValue(response.toString(), PushModel.class);

                            if (pushModel.getSuccess()){

                               Utility.showToast(JobDetailsActivity.this,"Sucess");
                                finish();
                            }else {
                                Utility.showToast(JobDetailsActivity.this,"Failes to sync");

                            }
                        } catch (IOException e) {
                            e.printStackTrace();
                        }

                    }
                }, new Response.ErrorListener() {

            @Override
            public void onErrorResponse(VolleyError error) {
                VolleyLog.d("Login", "Error: " + error.getMessage());
                Utility.hideProgrss();
            }
        }) {

            /**
             * Passing some request headers
             * */
            @Override
            public Map<String, String> getHeaders() throws AuthFailureError {
                HashMap<String, String> headers = new HashMap<String, String>();
                headers.put("Content-Type", "application/json");
                return headers;
            }

        };

        // Adding request to request queue
        AppController.getInstance().addToRequestQueue(jsonObjReq);

        // Cancelling request
        // ApplicationController.getInstance().getRequestQueue().cancelAll(tag_json_obj);
    }

    public void showAlert(final String status){

        AlertDialog.Builder builderSingle = new AlertDialog.Builder(JobDetailsActivity.this);

        builderSingle.setTitle("Select One Reason:-");

        final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(JobDetailsActivity.this, android.R.layout.select_dialog_singlechoice);
        arrayAdapter.add("Did not pick up the call");
        arrayAdapter.add("Refused");
        arrayAdapter.add("Not At Home");
        arrayAdapter.add("Location Not found");

        builderSingle.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });

       /* builderSingle.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
//                String strName = arrayAdapter.getItem(which);
                Utility.showToast(JobDetailsActivity.this,strName);
                dialog.dismiss();
            }
        });*/

        builderSingle.setAdapter(arrayAdapter, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                strReasonName = arrayAdapter.getItem(which);
                if (Utility.isInternetConnected(JobDetailsActivity.this)){
                    makeJsonObjReq(status);

                }else {
                    Utility.showToast(JobDetailsActivity.this,"No Internet Connection");
                }
             /*   AlertDialog.Builder builderInner = new AlertDialog.Builder(JobDetailsActivity.this);
                builderInner.setMessage(strName);
                builderInner.setTitle("Your Selected Item is");
                builderInner.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog,int which) {
                        dialog.dismiss();
                    }
                });
                builderInner.show();*/
            }
        });
        builderSingle.create().show();
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()){
            case R.id.button_sucess:

                if (Utility.isInternetConnected(JobDetailsActivity.this)){
                    strReasonName="";
                    makeJsonObjReq("1");
                }else {
                    Utility.showToast(JobDetailsActivity.this,"No Internet Connection");
                }

                break;

            case R.id.button_fail:
                Toast.makeText(JobDetailsActivity.this,mLocalService.getmCurrentLocation()+"",Toast.LENGTH_SHORT).show();

                AppController.getOnserver().notifyObservers();
                if (Utility.isInternetConnected(JobDetailsActivity.this)){
                    showAlert("0");
                }else {
                    Utility.showToast(JobDetailsActivity.this,"No Internet Connection");
                }

                break;

            case R.id.iv_pic1:
                if (count>=1) {
                    Utility.showToast(this,"Photo already taken");
                }else {
//                    count=1;
                    getFileAndStartCamera(R.id.iv_pic1);
                }
                break;
            case R.id.iv_pic2:

                if (image1Base64.equals("")){
                    Utility.showToast(this,"Please select 1st image");
                    return;
                }
                if (count>=2) {
                    Utility.showToast(this,"Photo already taken");
                }else {
//                    count=2;
                    getFileAndStartCamera(R.id.iv_pic2);
                }
                break;
        }
    }

    private void getFileAndStartCamera(int id){

            File f=Utility.dispatchTakePictureIntent(JobDetailsActivity.this);
            if (f!=null){

                switch (id){
                    case R.id.iv_pic1:
                        imageName1 = f.getAbsolutePath();
                        break;
                    case R.id.iv_pic2:
                        imageName2=f.getAbsolutePath();
                        break;
                }

                Utility.startCamera(this,f,Utility.REQUEST_IMAGE_CAPTURE);
            }

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode==RESULT_OK){
            if (requestCode==Utility.REQUEST_IMAGE_CAPTURE){

//                    Bundle extras = data.getExtras();
//                    Bitmap imageBitmap = (Bitmap) extras.get("data");
                switch (count){
                    case 0:
                        image1Base64=Utility.encodeToBase64(Utility.setPic(imageName1,ivPic1));
                        count++;
//                        ivPic1.setImageBitmap(imageBitmap);
//                        isPic1Uploaded=true;
                        break;
                    case 1:
                        image2Base64=Utility.encodeToBase64(Utility.setPic(imageName2,ivPic2));
                        count++;
//                        isPic2Uploaded=true;
//                        ivPic2.setImageBitmap(imageBitmap);
                        break;
                }

            }
        }

    }
}


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?android:attr/actionBarSize"
        android:background="@color/colorPrimary"
        app:layout_scrollFlags="scroll|enterAlways"
        app:popupTheme="@style/AppTheme.PopupOverlay">

        <TextView
            android:textColor="@android:color/white"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Job Details"/>
    </android.support.v7.widget.Toolbar>
    <ScrollView
        android:layout_below="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
<LinearLayout
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="10dp">
    <TextView
        android:layout_width="120dp"
        android:layout_height="wrap_content"
        android:textStyle="bold"
        android:text="Cust. Name:- "/>

        <TextView
            android:id="@+id/detail_custname"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:orientation="horizontal">
        <TextView
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            android:text="Cust. No:-"/>

        <TextView
            android:id="@+id/detail_custNo"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:orientation="horizontal">
        <TextView
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:text="Cust. Address:-"
            android:textStyle="bold"/>

        <TextView
            android:id="@+id/detail_custaddress"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:orientation="horizontal">
        <TextView
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            android:text="Item Desc:-"/>

        <TextView
            android:id="@+id/detail_itemdesc"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:orientation="horizontal">
        <TextView
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            android:text="Instruction:-"/>

        <TextView
            android:id="@+id/detail_specialinstn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:orientation="horizontal">
        <TextView
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            android:text="Job Type:-"/>

        <TextView
            android:id="@+id/detail_jobtype"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:orientation="horizontal">
        <TextView
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            android:text="Cod:-"/>

        <TextView
            android:id="@+id/detail_cod"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>
    <LinearLayout
        android:layout_marginTop="86dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:layout_below="@+id/sku_header"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">

        <ImageView
            android:id="@+id/iv_pic1"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:src="@android:drawable/ic_menu_camera" />

        <ImageView android:id="@+id/iv_pic2"
            android:layout_marginLeft="150dp"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:src="@android:drawable/ic_menu_camera"
            />
    </LinearLayout>
    <EditText
        android:id="@+id/remarks"
        android:hint="Remarks"
        android:layout_width="match_parent"
        android:layout_height="150dp" />

</LinearLayout>
    </ScrollView>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_alignParentBottom="true">

        <Button

            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@android:color/holo_red_light"
            android:text="Failed"
            android:textSize="18sp"
            android:gravity="center"
            android:textColor="@android:color/white"
            android:layout_weight="0.5"
            android:id="@+id/button_fail" />

        <Button
            android:id="@+id/button_sucess"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:text="Success"
            android:textSize="18sp"
            android:gravity="center"
            android:textColor="@android:color/white"
            android:layout_weight="0.5"
            android:background="@android:color/holo_green_light"/>
    </LinearLayout>
</RelativeLayout>


Sorry about the delay here - will make sure this is included in the next version I upload.


This is CTSRD-CHERI/llvm#211 and not an issue in clang.


Sehr schöne Einleitung!
Gerade der Teil mit der Skizze verdeutlicht die Notwendigkeit hervorragend!
Zu den Punkten die noch fehlen kann ich folgendes sagen:
Bei der Hardware müsste doch lediglich der Pi und die Funkmöglichkeiten aufgezeigt werden, wenn ich das richtig verstanden habe. Eventuell noch Sensoren und Aktoren, die aber austauschbar sind, sofern einer der angebotenen Funknetze benutzt wird.
Die Mensch-Maschinen-Schnittstelle soll doch bei uns entweder über eine App oder eine Weboberfläche ablaufen. Diese stellen dann drei verschiedene Funktionalitäten bereit: das Anmelden (und Einrichten) von Sensoren/Aktoren, die Erstellung von Regeln und Reaktionen und zuletzt die Möglichkeit den Alarm zu aktivieren (was ebenfalls in den Regeln mit eingebaut werden könnte). Generell funktioniert das Regelsystem dann doch nach dem "If - Then" Prinzip.
Und die Firmware ist demnach in 2 Komponenten aufgeteilt. Der Software auf dem Pi und dem UI - ob App oder Webseite ist dabei erstmal irrelevant. Die Software auf dem Pi läuft dort dann Standardmäßig und speichert und überwacht die Regeln. Außerdem muss sie über jegliche Sensoren und Aktoren bescheid wissen bzw. diese Ansprechen können/angesprochen werden können. Der Zustand des Alarms ist ebenfalls auf dem Pi gespeichert. Das UI bietet demnach lediglich einen Zugriff auf die Daten der Software auf dem Pi. Darüber sollen die Regeln einstellbar sein, der Alarm aktivierbar sein und der Suchmodus für die Sensoren aktiviert werden können (sofern das jetzt so umgesetzt wird).

Das wäre jetzt mein aktuelles Verständnis von unserem Projekt. Wenn daran etwas nicht stimmt, verbessert mich gerne bzw. ergänzt, was noch fehlt :)
Sofern das so schon alles passt, kann ich es auch einfach ins Dokument schreiben. @HomeSecurity/homesecurity-team


Ah no, I was wrong...

Renaming now ord_/chr_/concat_strs, will be a bit of a pain for me to rebase my py3 branch... :-/

Couldn't we merge it first, then rename perhaps ?


OK, fair enough. In normal scenarios that stream should get closed. I reverted this change in fe22b3f.


commit


И тук идва момента, в който можеш да подкараш проекта локално bootstrap от repo-to:
https://github.com/twbs/bootstrap/tree/v4-dev/

clone repo
run commands, в този ред:
npm install
gem install bundler
bundle install
bundle exec jekyll serve
http://localhost:9001/ движи

ако нещо някъде ти изреве ще го видим на лекцията


It looks like you're building some other package that relies on `gcc`, not `g++`, so just add `gcc-4.8` to `addons.apt.packages` along with `g++-4.8`.

To fix clang builds you need a more recent installation of libstdc++, installing g++ should be enough, so you can try adding the same `addons` block to those builds as well.

It should look like this

```
      addons:
        apt:
          packages:
            - gcc-<VERSION HERE>
            - g++-<VERSION HERE>
          sources:
            - ubuntu-toolchain-r-test


woo


Имах предвид, че няма от къде да гепим готов html :D Но да, видях, че в
локалното репо ги има components в някакъв .md файл, който Sublime го
отваря. Пълен кеф!

On 9 May 2017 at 14:49, s2501 <notifications@github.com> wrote:

> И тук идва момента, в който можеш да подкараш проекта локално bootstrap от
> repo-to:
> https://github.com/twbs/bootstrap/tree/v4-dev/
>
> clone repo
> run commands, в този ред:
> npm install
> gem install bundler
> bundle install
> bundle exec jekyll serve
> http://localhost:9001/ движи
>
> ако нещо някъде ти изреве ще го видим на лекцията
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/s2501/fe-team-work/commit/2936a927eed4b3f35bb464b9883e87d11904239c#commitcomment-22069392>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AXc1CzDyiPr8HUa_qinGwHR760wvy6PNks5r4FLVgaJpZM4NTrvu>
> .
>


Travis CI [build 309](https://travis-ci.org/per1234/arduino-ci-script/builds/230317021) has started. Once completed the job reports will be found at:
https://gist.github.com/per1234/2eb6ef47b55f794dd2141a0fd5706219#file-travis_ci_job_report_309-3-tsv
(build ID: 230317021)


It seems that you have reverted my changes though and that has been published to npm :( @ManuCutillas


Не задал высоту, поэтому тянется картинка в высоту
И ширину задавай не в процентах


这个。。。


Poistin tuon, kun testit ei suostuneet ajamaan, kun versionhallinnasta ei löydy logback.xml:ää application.yml:n määrittämästä paikasta. Nyt testit käyttää /src/main/resources/logback.xml:ää. Jos tarvitaan omat lokiasetukset testeille, niin testilokikonfin voi lisätä /src/test/resources/logback.xml:ään


# QingStor SDK for C#

[![Build Status](https://travis-ci.org/yunify/qingstor-sdk-csharp.svg?branch=master)]()
[![API Reference](http://img.shields.io/badge/api-reference-green.svg)](http://docs.qingcloud.com)
[![License](http://img.shields.io/badge/license-apache%20v2-blue.svg)](https://github.com/yunify/qingstor-sdk-csharp/blob/master/LICENSE)

The official QingStor SDK for the C# programming language.

## Getting Started

### Installation

Refer to the [Installation Guide](docs/installation.md), and have this SDK installed.

### Preparation

Before your start, please login [QingCloud Console](https://console.qingcloud.com/access_keys/) to create a pair of QingCloud API AccessKey.

___API AccessKey Example:___

``` yaml
access_key_id: ACCESS_KEY_ID_EXAMPLE
secret_access_key: SECRET_ACCESS_KEY_EXAMPLE
```

### Usage

Now you are ready to code. You can read the detailed guides in the list below to have a clear understanding.

- [Configuration Guide](docs/configuration.md)
- [QingStor Service Usage Guide](docs/qingstor_service_usage.md)

Checkout our [releases](https://github.com/yunify/qingstor-sdk-csharp/releases) and [change logs](https://github.com/yunify/qingstor-sdk-csharp/blob/master/CHANGELOGS) for information about the latest features, bug fixes and new ideas.

## Reference Documentations

- [QingCloud Documentation Overview](https://docs.qingcloud.com)
- [QingStor APIs](https://docs.qingcloud.com/qingstor/api/index.html)

## Contributing

1. Fork it ( https://github.com/yunify/qingstor-sdk-csharp/fork )
2. Create your feature branch (`git checkout -b new-feature`)
3. Commit your changes (`git commit -asm 'Add some feature'`)
4. Push to the branch (`git push origin new-feature`)
5. Create a new Pull Request

## LICENSE

The Apache License (Version 1.0, May 2017).


@tmarkzcons - Futtatáskor kapok egy ilyen hibát, amire még nem tudtam rájönni, hogy micsoda:

```
fatal: [default]: FAILED! => {"changed": true, "cmd": "/vagrant/glassfish4/bin/asadmin start-domain", "delta": "0:00:00.166542", "end": "2017-05-09 11:50:59.922629", "failed": true, "rc": 1, "start": "2017-05-09 11:50:59.756087", "stderr": "Exception in thread \"main\" java.lang.UnsupportedClassVersionError: org/glassfish/admin/cli/AsadminMain : Unsupported major.minor version 51.0\n\tat java.lang.ClassLoader.defineClass1(Native Method)\n\tat java.lang.ClassLoader.defineClass(ClassLoader.java:648)\n\tat java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)\n\tat java.net.URLClassLoader.defineClass(URLClassLoader.java:272)\n\tat java.net.URLClassLoader.access$000(URLClassLoader.java:68)\n\tat java.net.URLClassLoader$1.run(URLClassLoader.java:207)\n\tat java.net.URLClassLoader$1.run(URLClassLoader.java:201)\n\tat java.security.AccessController.doPrivileged(Native Method)\n\tat java.net.URLClassLoader.findClass(URLClassLoader.java:200)\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:325)\n\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:296)\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:270)\n\tat sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:406)", "stdout": "", "stdout_lines": [], "warnings": []}
```


ако следваш това, което ти писах, можеш да си пуснеш локално копие на
https://v4-alpha.getbootstrap.com/ всичко е в repo-то
тези md file-ове се ползват от jekyl, който се подкарва с горе изписаните команди


Also: language settings is moved to "localization".


Aivan! Tämä on hyvä tietää!


Имам го локално репото още откакто ни показа как да го дръпнем. :) Подкарал
съм си го в development environment, която си направих. Всичко е точно!

2017-05-09 14:58 GMT+03:00 s2501 <notifications@github.com>:

> ако следваш това, което ти писах, можеш да си пуснеш локално копие на
> https://v4-alpha.getbootstrap.com/ всичко е в repo-то
> тези md file-ове се ползват от jekyl, който се подкарва с горе изписаните
> команди
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/s2501/fe-team-work/commit/2936a927eed4b3f35bb464b9883e87d11904239c#commitcomment-22069462>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AXc1C6IajTKasNqamCZFP5B2xza7D36gks5r4FTPgaJpZM4NTrvu>
> .
>


TeamCity OTA+ :: rvi_sota_server :: migrations container [Build 175](http://teamcity.prod01.internal.advancedtelematic.com:8111/viewLog.html?buildId=31303&buildTypeId=ota_plus_RviSotaServer_MigrationsContainer) is now running


This is so familiar ;-;


На этом кейсе падает, потому что countryKeys недоступен, например, в this-or-that разделе.


@fieldOfView Turns out not just this one... All dialogs with the ratio are way too big on @Appesteijn 's Mac.


TeamCity OTA+ :: rvi_sota_server :: migrations container [Build 175](http://teamcity.prod01.internal.advancedtelematic.com:8111/viewLog.html?buildId=31303&buildTypeId=ota_plus_RviSotaServer_MigrationsContainer) outcome was **SUCCESS**
Summary: Running Build time: 00:01:13


Lately I was getting quite a few of those… so while updating the:
```
==================
= Initialization =
==================
```

I decided to add that too :)


Looks like our 3.8.2 version links to libwebp 0.5.0 (hash 37f049490d573f8c153e1b2c74c3a5bcca3a3d8b)


You could not find a way not to  absolutely position the footer? The vertical flexbox was meant to make it nicely aligned and spaced regardless of the vertical size...


@vmassol This should probably be Apache Commons IO's `NullOutputStream` rather than Apache Tika's (they're identical, except that Tika's is an implementation detail rather than an intended API, I suspect), but other than that, LGTM. :)


fixes #16


Не вижу отдельного файла для этого блока


I also have some issues with this layout (I think it is only in fedora). The footer text is cut at the top.


флекс блокам нужно задавать ширину так же как и для флоутов


typo?


fdgfdgfdg


I recall the old conditional working for me. Under what condition was there a problem?

I like the idea of making the property conditional on the existence of the PETSC obj but with this change the property is always visible under shift+tabtab. I think the previous implementation didn't do this. I'm happy either way.


Happy to take your patch and manually port them if required ... but oops ...


Aha fixed in https://github.com/NixOS/nixops/commit/324e1be9427ded1403022fb00530546363d4279c


Hola, buenas tardes;

     He seguido el manual y todo ha ido bien hasta que he realizado el "make". Me ha dado este error:

""" ls
fakemouse.c  lsadrv-ioctl.c  lsadrv-main.c  lsadrv-vkey.h
fakemouse.h  lsadrv-ioctl.h  lsadrv-sub.c   Makefile
lsadrv.h     lsadrv-isoc.c   lsadrv-vkey.c
usuario@abalar6:~/hitachi/starboard-lsadrv/lsadrv$ sudo make
mkdir -p 3.16.0-4-686-pae
make -C  M=/home/usuario/hitachi/starboard-lsadrv/lsadrv V=1 modules
make -C  M=`pwd` V=1 modules
make[1]: *** M=/home/usuario/hitachi/starboard-lsadrv/lsadrv: Non hai tal ficheiro ou directorio. Detido.
Makefile:40: recipe for target '3.16.0-4-686-pae/lsadrv.ko' failed
make: *** [3.16.0-4-686-pae/lsadrv.ko] Error 2
usuario@abalar6:~/hitachi/starboard-lsadrv/lsadrv$ """

Puedes decirme cómo solucionarlo, por favor?

Saludos.


Buttons: (size: to be defined)

-X:257 Y:401
-X:257 Y:498
-X:461 Y:401
-X:461 Y:498
-X:666 Y:401
-X:666 Y:498


These are not security *issues*, they're possible security weaknesses that might arise in the future for some instances. The commit that switches to HIGH makes maintenance of this page easier and allows us to make sure every admin automatically switches to better ciphers as they are being released and automatically switches off problematic ciphers as they are deprecated.

That being said, I agree we should add a note to tell people to create the dh params.


hi Larry What approach do you propose to determine the PID parameters??


It's very helpful thnque..


github manages to turn a single change in one line into 3746 addition/deletions

change is on line 1140
value 70000 changing to 55000

https://github.com/bumbacoin/Nobtcoin/blob/3998c86f9511cb9b4539a7693b1cd554e7b3294a/src/main.cpp#L1140


@pb00068 infect it is a regression (test was going to fail). A pity that was was not waited until the end...now it will start an useless discussion.


if `MetaTables` is called more than once `$this->metaTablesSQL` gets longer and longer ?


It beeped?!? :o


@cmodijk does this really work for you? RabbitMQ doc https://www.rabbitmq.com/dlx.html says:

> It is possible to form a cycle of message dead-lettering. For instance, this can happen when a queue dead-letters messages to the default exchange without specifiying a dead-letter routing key. Messages in such cycles (i.e. messages that reach the same queue twice) will be dropped if there was no rejections in the entire cycle.

And that's exactly what I'm seeing. Messages from dead letter exchange never go back to original queue and just drop off.


Apparently not on mac, but for me it beeped every time I saved a file :|


@jbduncan Grrr.... thanks again, I'm glad I have you watching over my shoulder :)


I am assuming that by `fail over` you did understand that the software should not crash if cache fails.

But that is not the case, the objective of the task was to create a cache service that should not cause any problem to the application if it`s down, in order to achieve that the most obvious solution was to try to hit the cache and if anything were wrong in this process ignore any error and perform the same task on the database

This way the cache will act only as a performance improvement but would not create a single point of failure nor a bottleneck on the application


You`re hitting the cache twice to perform the same operation in a single line of code, this will duplicate the connections with cache service on all request to get the consumers, this could be avoid only by saving the result of the first attempt on a variable and performing the check on that variable


The same way is responsibility of the repository to decode things to a forma that ins understandable by the application is also the responsibility of the repository to encode things to the format that the storage needs, so here you should pass an Array or an instance of customers and the repository should handle the extract behavior


Same


Nice 👍

You cleaned the cache when a new customer is inserted on the database, so the next time someone retrieve the customer list it will hit the database and populate cache with the more updated data


You`re returning distinct result Types on a single method (A Boolean and a String) depending on what happen with the process, this will make that every other single piece of code consulting this interface to have to check for the result in order to know what to do with it.

Besides that if everything goes right you`re returning a non-formatted Json String, it should be the responsibility of the Repository to Hydrate this response in a way the is understandable by the rest of application. An Array will be valid, but it would be better if would return an instance of a `Customer` Object


You`re catching the Exception just to return the same Exception again, so those three lines of code are doing exactly nothing besides than making the code more difficult to read, understand and with less performance


Nice 👍

You're creating a way to retrieve the connection and not only exposing the property as a public one, but you can improve this by creating a Lazy Loading


Awesome :D


Again:

1. Why did you split the controller?
2. This was even on the requirements of the task?

Your commit message should tell a history, every other developer that was reading it should be able to find out all the decision process that leads to this implementation and what were the upsides and downsides of every options considered.

And besides that you need to do atomic commits, in this commit you are performing at least 2 tasks

1. Spiting the controller
2. Creating and Implement the Repository

The first one was not even on the `backlog`, but that`s is not a real problem if you explain why are you doing it and what improvements this will bring to the second one if it was done before.

Even so this should be handle in a separated commit because it makes it easy to other developers perform code review, it makes the commit atomic, helps making the commit tree a single line of history that may tell the life of the application and also make it simple to understanding the reasons behind every line of code


Okay, that helped me get farther:
https://travis-ci.org/vinniefalco/Beast/jobs/230318330

But now I need gdb. And then binutils-gold (for backtraces).  And subversion, automake, autotools-dev, and libc6-dbg (for valgrind). I will just end up listing all the packages for each matrix item that I was previously listing in just the one place. What's the benefit of all this again?


5/9(화) Git 공부 완료(V)


This fixes the problem that we can no longer send email from a fixed user


add: DOI


this thing is do nothing, this isn't a code at all


@flying-sheep Why weren't you happy with the `use_cython` option? Now people need to have Cython installed in order to run it. That's of course not a big problem. But still it simply gives you an error if you want to run `pip install .` and you don't have it. Any idea how to work around this case? It seems that a few people don't have Cython by default.


mklkj;jmlk;j;


We found out, that this part differs from the original implementation which was based on "add" and was not blocking the client: https://github.com/spring-cloud/spring-cloud-aws/pull/98/commits/c9ee4b13500dbbb6d0060202cb9591324bdad4a8#diff-ebf7119c9566b72f9fc0e572338774b8R107

This implementation might block calls to the clients of the `MetricWriter` interface.


Is clobber build required here because of uuid change?


This is clearly a functional test but it is only checking the end response (If it is a 200 OK) it should test a lot of other things like

1. Making the request with cache enabled and populated
 - Will return the value from cache
 - Will not change cache value
 - Will not hit database
2. Making the request with cache enabled and not populated
 - Will return the value from database
 - Will populate Cache
3. Making the request with cache disabled:
 - Will return value from database without any problem (this would fail showing the problem with the fail over on your code that i talked about on another comment)


Move to vendor, these files are "Qualcomm Technologies Proprietary and Confidential."


@denpatin
Обновил контроллеры и вьюхи, ща все ок?


Unused


Not needed anymore


Give it a try @sneridagh  :)


The name of the test is wrong


@mcostalba Sorry, did not intend to start an useless discussion. To prevent that, couldn't we simply resume the test, like it was done on this [one](http://tests.stockfishchess.org/tests/view/590c23780ebc59035df342ef)?


Test comment


@fee1good
Nope 😿

`get 'users/create'` в рутах — это немного бредово, т.к. подобные методы — это `POST`.
Кажется, может и вправду стоит начать со скаффолдов...

Сохрани себе куда-нибудь уже имеющиеся наши миграции и модели.
Сделать скаффолды на три модели (поля можешь там особо не указывать, не стараться).
Когда скаффолды пройдут, заменишь модели своими имеющимися и миграции тоже.
Когда заменишь, сделаешь `db:migrate`. И должно быть всё ок :)


Hasn't been working for me.

It's not supposed to work according to the way python class attributes are defined.

Feel free to revert if you can sort it out.

Sent from my iPhone

On 9 May 2017, at 22:08, julesghub <notifications@github.com<mailto:notifications@github.com>> wrote:

I recall the old conditional working for me. Under what condition was there a problem?

I like the idea of making the property conditional on the existence of the PETSC obj but with this change the property is always visible under shift+tabtab. I think the previous implementation didn't do this. I'm happy either way.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://github.com/underworldcode/underworld2/commit/1329bb310c1fef9796210c0b77c53b085a58f7f8#commitcomment-22069566>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AMAXo4h38d8KtsWbXO0n-9cHF56VGVhpks5r4FcqgaJpZM4NVIlr>.


fine


Fail Why?

You're checking only for failure but you're not explaining on the test why it should fail, and you`re not assuring that no changes will be made on database nor on cache


@denpatin
Что интересно, я руты вообще не трогал (создал только контроллеры и вьюхи), я понимаю, что `create` это `POST`. Они как-то автоматически генерятся. Я могу сейчас сам попробовать их поправить, но лучше с тобой, а то с роутами нагорожу ща.


@fee1good
Ты их не создавал, да :) Это делается `rails g controller`. Просто обычно `GET`, но не везде. CRUD на то и CRUD, чтобы были разные HTTP-методы. В общем, как я написал выше, лучше скаффолды :) Кажется, этот не самый лучший-в-продакшне способ сейчас будет как никогда полезен.


I see the new setters set the provided function on the class attribute, but is this change actually propagated to the assembly terms?

I lean towards removing the setters altogether, and instead having users create a new system.  While it's cute to be able to change these things dynamically, it does actually involve a bit of work to make sure it all comes together. On the other hand, create a new Stokes system is relatively cheap.. perhaps as long as it's not happening every step.

Happy either way, but we prob should at least consistent be (provide setters everywhere, or nowhere).


This should be an unit tests and you should not use real connections on unit tests ever, the cache service here should be mocked, otherwise you wouldn't be testing only the repository you would be testing the service as a side effect, and this will make a lot harder to find out which one is failing if something goes wrong


Same


Tests should be on the same commit as code, doing tests on different commits means either:

1. The tests were done first and the CI will fail because there is no code
2. The code were done first and the CI will give you a false positive allowing untested code to be deployed

Also there is a lot of different responsibilities on this commit, the commit header tell me about tests, but this commit change developing environment, instructions to run the application and change code (that was wrong and therefore prove my point above)


<!doctype html>

<meta charset="utf-8">
<title>html练习</title>

网站的一级标题

导航链接一

导航链接二

导航链接三

导航链接四

文章一级标题

文章二级标题

文章作者 文章发表时间

这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，
这是一个很长很长的段落，这是一个很长很长的段落，换行了

这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，换行了

这是一个很长很长的段落，这是一个很长很长的段落，这里有一个链接连接到http://ife.baidu.com这是一个很长很长的段落，这是一个很长很长的段落，这里有个粗体字这是一个很长很长的段落，
这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，

这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，
这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，换行了
这是一个很长很长的段落，
这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这里有个粗体字这是一个很长很长的段落，
这是一个很长很长的段落，这是一个很长很长的段落，这里有个链接点击后打开新窗口连接到http://ife.baidu.com
这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，
这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，

另一篇文章一级标题

文章二级标题

文章作者 文章发表时间

这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，
这是一个很长很长的段落，这是一个很长很长的段落，换行了

这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，换行了

这是一个很长很长的段落，这是一个很长很长的段落，这里有一个链接连接到http://ife.baidu.com这是一个很长很长的段落，这是一个很长很长的段落，这里有个粗体字这是一个很长很长的段落，
这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，这是一个很长很长的段落，

项目列表一

项目列表二

项目列表二

图片

  好看的图片

    好看的图片

最后一篇文章一级标题

文章作者 文章发表时间

排名1

排名2

排名3

下面是一个表格，个表格加一个border=“1”好让你看出是一个表格

表头
表头
表头

表内容单元格
表内容单元格
操作</a

表内容单元格
表内容单元格
操作</a

表内容单元格
表内容单元格
操作</a

总计
1000

这里以后是一个侧栏，这是侧栏的标题

侧栏注册窗口标题

<form action="" method="post">
请输入邮箱地址:
<input type="text" name="address" id="address" value="这是一个文本输入框"/ >

邮箱地址请按要求格式输入

请输入密码:
<input type="password" name="password" id="password"/ >
请重复输入密码:
<input type="password" name="password" id="password1"/ >

密码请为6-16位英文数字

性别：<input type="radio" name="sex" value="male">男 <input type="radio" name="sex" value="female">女
爱好：<input type="checkbox" name="interest" value="sport" id="sport"/>运动
 <input type="checkbox" name="interest" value="art" id="art"/>艺术
 <input type="checkbox" name="interest" value="science" id="science"/>科学
 个人描述：<textarea cols="15" rows="3"></textarea>  <input type="submit" value="确认提交"/>
</form>


I will pull and test to see if I can reproduce.

> On May 8, 2017, at 10:11 AM, H.Merijn Brand <notifications@github.com> wrote:
>
> On Mon, 08 May 2017 09:31:12 -0700, Todd Zervas
> <notifications@github.com> wrote:
>
> > I care. "" means the test failed.
>
> Do you have a suggestion to fix it?
>
> only ->state failed for me: the contents are correct
>
> FWIW, I now run Unify DS-9.1B on OpenSUSE
>
> --
> H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
> using perl5.00307 .. 5.25 porting perl5 on HP-UX, AIX, and openSUSE
> http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
> http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
>


Equip Preview system works perfectly, but when I go to view the items in the vending stores, the client crash, look:

Normal: http://imgur.com/bNDaYvi

Vending: http://imgur.com/8HrY4Y8


@denpatin
Эм, я, конечно, могу скаффолд сделать и посмотреть, как он мне все зависимости создал, но не лучше будет самому написать этот скаффолд, заодно разобравшись что к чему? Мы ж тогда с тобой посмотрели скаффолд на примере Pets, там все понятно было. Имхо, давай просто отдельно HTTP-методы разберем и тогда все на свои места встанет.


This commit has been reverted after discussion in the architecture meeting.
The solution is addressed by CURA-3782


Travis CI [build 310](https://travis-ci.org/per1234/arduino-ci-script/builds/230331512) has started. Once completed the job reports will be found at:
https://gist.github.com/per1234/2eb6ef47b55f794dd2141a0fd5706219#file-travis_ci_job_report_310-4-tsv
(build ID: 230331512)


Should fix #408


C'est plus la 1.5.0 en vrai, non ? Parce que la la 1.2 date de Ferus.


Он тебе в routes сделает `resources category` и т.д. :) Казалось бы, не надо даже знать ни о каких GET-POST'ах.

А что именно в HTTP-методах тебе не понятно? Давай разберём :) Но лучше конкретные вопросы.


Hola, buenas tardes;
       He seguido el manual y me da un error haciendo el "make":
usuario@abalar6:~/hitachi/starboard-lsadrv/lsadrv$ sudo make
[sudo] password for usuario:
mkdir -p 3.16.0-4-686-pae
make -C  M=/home/usuario/hitachi/starboard-lsadrv/lsadrv V=1 modules
make -C  M=`pwd` V=1 modules
make[1]: *** M=/home/usuario/hitachi/starboard-lsadrv/lsadrv: Non hai tal ficheiro ou directorio. Detido.
Makefile:40: recipe for target '3.16.0-4-686-pae/lsadrv.ko' failed
make: *** [3.16.0-4-686-pae/lsadrv.ko] Error 2
usuario@abalar6:~/hitachi/starboard-lsadrv/lsadrv$ """

Puedes decirme a qué puede deberse el error?. Hasta este paso todo ha ido bien.
Gracias.


![](https://github.trello.services/images/mini-trello-icon.png) [Improve MusicBrainz search mechanism](https://trello.com/c/fSaVDZDr/31-improve-musicbrainz-search-mechanism)


Could also be
```java
if (lockable.lock())
    throw new IllegalStateException("Cannot modify " + name + ". Old changes have not been applied by event yet!");
```
because lock() returns the old state. If that is `true` it would mean it was already locked.


Travis CI [build 43](https://travis-ci.org/per1234/test/builds/230332708) has started. Once completed the job reports will be found at:
https://gist.github.com/per1234/5c871fa4db91afea5b8f740c6e62377e#file-travis_ci_job_report_43-1-tsv
(build ID: 230332708)


please rewrite this tag again please


Do not comment out code instead add @Profile("disabled")  at class level or bean level to disable the spring bean creation.


CI job has failed for environment `gcc:7_1_0/boost:1.63.0`: https://ci.reaver-project.org/viewLog.html?buildId=5089&buildTypeId=reaverlib_Tests&guest=1.


CI job has failed for environment `gcc:7_1_0/boost:1.62.0`: https://ci.reaver-project.org/viewLog.html?buildId=5085&buildTypeId=reaverlib_Tests&guest=1.


from switching to 1.0.4 to 1.0.5 , my server sends me two lines of cookies ...

Set-Cookie:i18next=fr; path=/; expires=Wed, 09 May 2018 12:43:34 GMT
Set-Cookie:i18next=fr; path=/; expires=Wed, 09 May 2018 12:43:34 GMT

... :s


更改为close后在overlay层能调用，才能关闭侧边栏


选用性能更高的api


Duplicated, my bad :/


更改为局部管理，减少store的臃肿度


my client won't crash. however it just the headgear is not previewed it heagear preview window. see the screenshot below.

![screen1asiaro034](https://cloud.githubusercontent.com/assets/16514357/25851561/cece78ba-34f8-11e7-9fd2-41f316e3b4d1.jpg)


Should be `TRIM()` really as I think `RTRIM(LTRIM())` has teeth..


Предполагалось, что мы разместим на карточке с комментарием какой-нибудь крестик, при нажатии на который будем отправлять AJAX-запрос, удалять комментарий из базы и удалять элемент ДОМа. Тогда редирект не нужен. Но, в принципе, можно и так.


can you update please ?


CI job has failed for environment `gcc:7_1_0/boost:1.61.0`: https://ci.reaver-project.org/viewLog.html?buildId=5093&buildTypeId=reaverlib_Tests&guest=1.


missing space before {


notification not working


test


missing space: `$base-unit * 2`


jučer i danas je jedna velika švicarska firma u posjetu pa je bila prezentacija aplikacije. jučer smo ju testirali i našli hrpetinu bagova ali sam ispravil i danas je bila prezentacija. ok je prešlo ali još ima puno posla da to bude gotova aplikacija.


Why don't you use system.prop? I think it's just meant for it, props setting?


make private? `_generate_key`


should these be private too?


jajajaja perdoooon... bastante bien igual


not if its called by tests?