Caipivara

1

votes
1

answer
1.1k

views

problem Simple-cdd postinst modify a file

I'm using simple-cdd to create a pure blend debian installer. I want to add a log file to the script, ex: NAME.postinst contains: touch mylog echo 'Hello this works' >> mylog The results after instalation is the file but empty. why!!!!! thanks
Caipivara
1

votes
1

answer
193

views

Minimum Stable Linux Kernel

I need to compile a minimum Linux kernel, I mean, with the basic and generic modules to get it work on low resources machines. Is there any specification of the minimum modules that a kernel must have to accomplish my needs? The unique requirement is that it must be stable. Where can I find informa...
Caipivara
1

votes
3

answer
1.4k

views

Replace content of each HTML controls javascript jquery

I'm trying again to replace each text content of each control in a page using javascript and jquery. I need to search in each text content (WITHOUT MODIFING TAGS, ONLY THE TEXT) any word and replace it with another any word. One try is: jQuery.fn.replaceEachOne = function (objective, rep) { this.eac...
Caipivara
1

votes
1

answer
372

views

HyperLink in DataGrid: InvalidOperationException

I'm trying to add RichTextBoxes into the cells of a DataGrid. The RichTextBox contains a Hyperlink, but when I click it, it throws the following exception: 'Invalid Operation Exception - Reference is not a valid visual DependencyObject' Why is this happening?
Caipivara
1

votes
2

answer
579

views

TimePicker Minimum value Silverlight

I wan't to use a TimePicker but setting to it a minimum posible value, that the user can't choose other after that value. Like the DisplayDateStart in DatePicker.
Caipivara
1

votes
1

answer
319

views

Group_by Django list

I have a django model: class Person(models.Model): '''' Modelo criado com referencia ao modelo remoto ''' name = models.CharField(max_length=300) age = models.PositiveIntegerField() born = models.DateField() I want to group all the people by birthday (group by born date). I'm trying to get a diction...
Caipivara
1

votes
1

answer
936

views

Custom NSError weird behaviour Swift

In Swift, I have a custom NSError, I need to get the error userInfo dictionary and add things later, but it is nil in the assign line, but then error.userInfo have an object... With error.userInfo as nil: class MyError: NSError { init(error: NSError) { var newUserInfo = error.userInfo ...newUserInf...
Caipivara
1

votes
1

answer
215

views

findbugs, retrolambda and Android

I'm using Android studio 1.4.1 and I'm trying to setup findbugs but even setting the exclude xml with R and Manifest findbugs still analise them. I want to: Setup findbugs with android to avoid R and all of those generated things, like ViewBinder and Lambda. Gradle file: apply plugin: 'findbugs' app...
Caipivara
1

votes
1

answer
353

views

How to test DeepLinks with espresso

I want to add tests for all my deep links, to launch them and see if the needed activity is launched and assert over what is showed on that activity. How can I do it? Edit I ended up testing just the deep linking matching like https://medium.com/@singwai/testing-deep-linking-with-espresso-and-burst-...
Caipivara
1

votes
1

answer
229

views

Using DateFormatter with TimeZone to format dates in Swift

How can I parse a date that has only date information (without time), like 2018-07-24 Im trying with let dateFormatter = DateFormatter() dateFormat.dateFormat = 'yyyy-MM-dd' dateFormatter.dateFormat = dateFormat dateFormatter.timeZone = TimeZone(abbreviation: 'UTC') dateFormatter.date(from: '2018-0...
Caipivara
1

votes
2

answer
0

views

Unsafe JavaScript attept to access frame error in Chrome when replacing textNode

I'm trying to replace each textNode of the DOM tree using the following function: //Replace each word objective with reposition in each control of the actual jQuery object jQuery.fn.replaceEachOne = function (objective, reposition) { var regExp = new RegExp('([\\s]'+objective+'[\\s])', 'igm'); th...
Caipivara
1

votes
3

answer
0

views

Document XML data Sharepoint 2010 Silverlight

I have a document libraries where I save documents (je). (from silverlight too, but that problem is already solved) I want to use the object model of Sharepoint 2010 from a silverlight application to get the XML data of a document with ID=... First I serialize a class and upload to the document lib...
Caipivara
1

votes
1

answer
0

views

Autocomplete order Visual Studio 2010

Is there any way to change the order by of the autocomplete functionality for Visual Studio 2010? I want to see the autocomplete options ordered by type, I mean: Methods Variables etc... I dont wan't to get it ordered alphabetically, so what can I do?
Caipivara
1

votes
2

answer
396

views

Android how to emoji into Logcat prints?

I will like to see emojis on my logcat print, I think thay may help to see logs. Some example is github emoji that enabled emojis. Is there any way to do it?
Caipivara
1

votes
1

answer
472

views

Whats the optimal/less-error-prone cache size for OkHttp client (used with exoplayer)

Deps: Kotlin 1.0.3 Exoplayer r1.5.9 Retrofit 2.1.0 okhttp 3.4.1 Im trying to setup cache for my video playback project (list of videos of 20 secs per video) and Im wondering if theres any problem if I set the cache for OkHttp val cacheSize: Long = 1000 * 1024 * 1024 // 1000 MB
Caipivara
1

votes
1

answer
576

views

Generic function and attribute with Equatable and Printable as parameters in Swift

How to write a function that allow any objects but must be Printable and Equatable array of objects in Swift? class func withItems(items: [AnyObject]){ } I need items to be Printable and Equatable I need to declare that items array as attribute of my class Thanks
Caipivara
1

votes
1

answer
1k

views

Can´t see the actual crash in Fabric using Timber and a custom Reporting Tree

My Tree: private static class CrashlyticsReportingTree extends Timber.HollowTree { public CrashlyticsReportingTree(Context context) { Fabric.with(context, new Crashlytics()); } private static String maybeFormat(String message, Object... args) { // If no varargs are supplied, treat it as a request to...
Caipivara
1

votes
1

answer
710

views

TypedFile Retrofit and rename file

Using Retrofit 1.9. TypedFile typedFile = new TypedFile('image/jpg', new File(filePath)); I want to rename the file uploaded to the server. how can I do it?
Caipivara
1

votes
1

answer
61

views
1

votes
1

answer
346

views

Android - Assertj Android - Run error

I´m trying to run assertj-android but it send an error. (it runs fine with junit 4) My Dependencies: dependencies { testCompile 'junit:junit:4.12' androidTestCompile ('com.squareup.assertj:assertj-android:1.0.0'){ exclude group:'com.android.support', module:'support-annotations' } } My Build type:...
Caipivara
3

votes
3

answer
3.4k

views

support-v4.Fragment vs Fragment

If I support from SDK 15 should I use support-v4 Fragment instead of a Fragment? I´m trying to use FragmentSupport.shouldShowRequestPermissionRationale(this) and implement the new M permission model but it needs a Fragment. ex: import android.support.v4.app.Fragment; public class MyBaseFragment ext...
Caipivara
17

votes
5

answer
2.6k

views

How to disable the new Autofill feature from Android Oreo for espresso tests

Running tests on android devices with sdk 26 causes them to fail because of the new Autofill feature that hides the fields when espresso are trying to click them. Im running my tests on firebase test lab so I cannot disable them manually on my tests devices. Some images: 1. Password is visible befor...
Caipivara
3

votes
1

answer
1.5k

views

Android devices without google play services [closed]

There are any android device without google play services? It looks like amazon phones dont have google play on them. I want to use features like places and billing but I'm afraid of a phone without it, how can I be sure about that? how can I validate this programmatically?
Caipivara
19

votes
1

answer
5.8k

views

Espresso - withEffectiveVisibility vs isDisplayed

Whats´s the difference between isDisplayed and withEffectiveVisibility? onView(withText('Much Dagger')).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); onView(withText('Much Dagger')).check(matches(ViewMatchers.isDisplayed());
Caipivara
19

votes
3

answer
9.1k

views

Android Proguard warning: can't write resource (Duplicate zip entry)

I enabled proguard and got: Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-io-2.4.jar:META-INF/LICENSE.txt]) Warning:can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [commons-io-2.4.jar:META-INF/NOTICE.txt]) Warning:can't write resource [META-INF/LIC...
Caipivara
19

votes
3

answer
3.8k

views

openDrawer from espresso contrib is deprecated

Espresso contrib (com.android.support.test.espresso:espresso-contrib:2.2.1) openDrawer method is deprecated then how should I open a drawer?
Caipivara
6

votes
3

answer
4.2k

views

Android Tests - How to add Espresso Logs

I´m using androidTestCompile 'com.android.support.test:runner:0.3' androidTestCompile 'com.android.support.test:rules:0.3' androidTestCompile 'com.android.support:support-annotations:23.0.1' androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2' androidTestCompile('com.android.sup...
Caipivara
5

votes
2

answer
372

views

Junit4 Android TestField text test

My test is: @RunWith(AndroidJUnit4.class) @LargeTest public class TipActivityTests { @Rule public ActivityTestRule mActivityRule = new ActivityTestRule(TipActivity.class); @Test public void initialValues() { onView(withId(R.id.tip_label_base_price)).check(matches(ViewMatchers.withText('45''))); } }...
Caipivara
6

votes
1

answer
1.8k

views

Difference between XCTAssert and assert in Swift

What's the difference between XCTAssert() and assert() in Swift?
Caipivara
6

votes
3

answer
3.8k

views

UINavigationBar background color setted from storyboard differ from the color setted by code

My app will be available only for iOS 8 and I'm working with XCode 6.1.1. If I set the color through the storyboard (setting theBar Tint attribute on Navigation Bar section) The desired color is: 56 186 145 I used Core coding utilities to get the floating values of my color. By code: let backgroundC...
Caipivara
3

votes
1

answer
5.1k

views

Semaphore is not waiting swift

I'm trying to do 3 async requests and control the load with semaphores to know when all have loaded. I Init the semaphore in this way: let sem = dispatch_semaphore_create(2); Then send to background the waiting for semaphore code: let backgroundQueue = dispatch_get_global_queue(QOS_CLASS_BACKGROUND,...
Caipivara
3

votes
3

answer
312

views

Swift variable declaration meaning

What's the difference between these two declarations? Which one is better? Why? ... error = some NSError ... 1. var newUserInfo: [NSObject: NSObject] = [:] if let tempUserInfo = error.userInfo as? [NSObject: NSObject] { newUserInfo = tempUserInfo } 2. var newUserInfo: [NSObject: NSObject] if let tem...
Caipivara
1

votes
2

answer
337

views

Kotlin extension overhead for Android

It´s a good idea to use kotlin extensions all over the code? I miss a lot the extensions from iOS, but this is a good way to use those kind of things in android? Refering to http://antonioleiva.com/kotlin-android-extension-functions/ Is there a better solution for this?
Caipivara
5

votes
2

answer
1.5k

views

RXJava how to try to get next after x time

I wan to do a call to a web service using retrofit every x seconds until y condition is raised. I want to run OrderApi.get after x seconds until the response is null. public class OrderApi {} public static Observable get() { //... } } OrderApi.get(order.getId())) .subscribe(updatedOrder -> { mShoul...
Caipivara
11

votes
3

answer
11.4k

views

How to pause ExoPlayer 2 playback and resume (PlayerControl was removed)

In ExoPlayer < 2.x there was a class PlayerControl with pause() and resume() functions but it was removed. I can't find a way to do this on ExoPlayer 2. How can I pause and resume a playback?
Caipivara
5

votes
4

answer
4.2k

views

JUnit Scheduler that doesn't depend on Android

I´m trying to use MVP to enhance unit testing and run tests faster (because I'm testing logic not android code so I avoid using things like RobotElectric). But I´m using RXAndroid and it needs Looper to get Schedulers.io() and AndroidSchedulers.mainThread() and when I try to run sometime like clas...
Caipivara
1

votes
2

answer
88

views

Where is the smaller menu icon for material design?

I found but I need I cant find it here https://design.google.com/icons/#ic_menu. Where can I find this icon?
Caipivara
6

votes
3

answer
2.2k

views

Empty constructor for kotlin object to use Firebase

I'm trying to save an object inside Firebase database from Kotlin, I dont feel right providing a default empty constructor and put values as nullable, having to change all my code bc of this. My class: class Video(var id: String, var url: String, var owner: User) : { constructor() : this('', '', Us...
Caipivara
3

votes
3

answer
1.3k

views

Implement variable attribute property observer in Swift

I want to implement a didSet over a 'sub-attribute' of a variable. Example: @IBOutlet weak var myLabel: UILabel! var myLabel.hidden { didSet{ 'DO SOMETHING' } } I want to hide/show some other views when myLabel.hidden attribute change. How can I do it?
Caipivara
2

votes
1

answer
273

views

Difference between @objc, @class_protocol and :class in swift Swift

What's the difference between: @objc protocol name {} @class_protocol protocol name {} protocol name: class {}
Caipivara

View additional