This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@product = Product.new(product_params) | |
@product.save | |
respond_to do |format| | |
format.html { render :nothing => true } | |
format.js { } | |
end | |
end | |
def destroy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void AddNewImage() { | |
String baos = GetByteArray(); | |
MultipartTypedOutput multipartTypedOutput = new MultipartTypedOutput(); | |
multipartTypedOutput.addPart("login", new TypedString(credential.getUsername())); | |
multipartTypedOutput.addPart("mobile_upload_file", new TypedString("data:image/jpeg;base64,"+baos)); | |
SetNewImage(multipartTypedOutput); | |
} | |
public String GetByteArray() { | |
File f = getTempFile(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
// Override point for customization after application launch. | |
self.window = UIWindow(frame: UIScreen.mainScreen().bounds) | |
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) | |
var loginViewController:LoginVC = mainStoryboard.instantiateViewControllerWithIdentifier("loginVC") as! LoginVC | |
var timelineViewController:TimelineVC = mainStoryboard.instantiateViewControllerWithIdentifier("timeline") as! TimelineVC | |
let login = KeychainInfo.login | |
let auth_token = KeychainInfo.auth_token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bitmap myBitmap = BitmapFactory.decodeFile(picturePath); | |
Bitmap resized = Bitmap.createScaledBitmap(myBitmap, myBitmap.getWidth() / 2, myBitmap.getHeight() / 2, true); // TO AVOID OUT OF MEMORY FOR HIGH RESOLUTION PICTURE | |
rotated_photo = rotateBitmap(resized) | |
public static Bitmap rotateBitmap(Bitmap bitmap) { | |
ExifInterface exif = null; | |
try { | |
exif = new ExifInterface(bitmap); | |
} catch (IOException e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId, | |
int reqWidth) { | |
// First decode with inJustDecodeBounds=true to check dimensions | |
final BitmapFactory.Options options = new BitmapFactory.Options(); | |
options.inJustDecodeBounds = true; | |
BitmapFactory.decodeResource(res, resId, options); | |
// Calculate inSampleSize | |
options.inSampleSize = calculateInSampleSize(options, reqWidth); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.challfie.android/com.Challfie.android.challfiefragment.AddChallfieTakePictureActivity}: java.lang.RuntimeException: Fail to connect to camera service | |
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305) | |
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) | |
at android.app.ActivityThread.access$800(ActivityThread.java:148) | |
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) | |
at android.os.Handler.dispatchMessage(Handler.java:102) | |
at android.os.Looper.loop(Looper.java:135) | |
at android.app.ActivityThread.main(ActivityThread.java:5272) | |
at java.lang.reflect.Method.invoke(Native Method) | |
at java.lang.reflect.Method.invoke(Method.java:372) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"matchups" : [ | |
{ | |
"challenges" : [ | |
{ | |
"difficulty" : 1, | |
"id" : 168, | |
"complete_status" : 2, | |
"description" : "Prendre un selfie avec tes collègues ou camarades de classe" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MatchupsVC: UIViewController { | |
var pageMenu : CAPSPageMenu? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Hide on swipe & keboard Appears | |
self.navigationController?.hidesBarsOnSwipe = false | |
self.navigationController?.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: UIBarButtonItemStyle.Plain, target: nil, action: nil) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CAPSPageMenu.swift | |
// | |
// Niklas Fahl | |
// | |
// Copyright (c) 2014 The Board of Trustees of The University of Alabama All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
// | |
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.RuntimeException: retrofit.converter.ConversionException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ | |
at com.Challfie.android.challfiefragment.AddChallfieFinalActivity$7.failure(AddChallfieFinalActivity.java:415) | |
at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53) | |
at android.os.Handler.handleCallback(Handler.java:739) | |
at android.os.Handler.dispatchMessage(Handler.java:95) | |
at android.os.Looper.loop(Looper.java:135) | |
at android.app.ActivityThread.main(ActivityThread.java:5424) | |
at java.lang.reflect.Method.invoke(Native Method) | |
at java.lang.reflect.Method.invoke(Method.java:372) | |
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913) |
OlderNewer