mFeinstein

1

votes
0

answer
170

views

How to Convert a Jackson JavaTimeModule to Java Instant

in Jackson JavaTimeModule java time objects are converted to timestamps in the for of 1421261297.356000000, where the integer part is the number of seconds and the decimal part the number of nanoseconds of an Instant. I want to convert this back to a ZonedDateTime, so the first step would be to conv...
mFeinstein
1

votes
0

answer
307

views

Connect to MySQL in RDS using Java Connector/J and SSL

I am struggling to get my java code (that uses HikariCP) to connect with my database on AWS RDS using SSL. I can connect with the database using MySQL Workbench, I just can't find out how to configure the MySQL Connector/J 5.1.45 driver to access the database using SSL. Currently this is my HikariCP...
mFeinstein
1

votes
0

answer
356

views

ConstraintLayout Group vs Layer

What's the difference between ConstraintLayout Group and Layer? I understand we can control the visibility of a Group, but can we control its alpha transparency as well? I want to change some of my Views transparency as a user drags a SeekBar, proportionately of the SeekBar value.
mFeinstein
1

votes
2

answer
306

views

How to remove Padding from DrawerHeader

Here's my DrawerHeader : class MyDrawerHeader extends StatefulWidget { @override _MyDrawerHeaderState createState() => _MyDrawerHeaderState(); } class _MyDrawerHeaderState extends State { @override Widget build(BuildContext context) { return DrawerHeader( padding: EdgeInsets.all(0), margin: EdgeInse...
mFeinstein
1

votes
0

answer
126

views

FAB gets in front of expanding Bottom Sheet

I have a FloatingActionButton on the top left of my layout and a BottomSheetBehavior on the bottom of the CoordinatorLayout. The BottomSheetBehavior is actually inside aNavigationFragment` destination. If my FloatingActionButton has any android:elevation different then 0, then when the BottomSheetBe...
mFeinstein
1

votes
1

answer
47

views

Handling JDBC closed Connections

I want to automatically reconnect and resend the last SQL Query if a connection closed (e.g. on the db server, not because I will close it). I know I could do connection.isValid() (which is just SELECT 1 in most driver implementations) before sending each query, but this is wasteful. I will add a ro...
mFeinstein
1

votes
1

answer
211

views

Visual Studio 2010 doesn't indent C code

Does anyone knows why Visual Studio 2010 does not indent C code and how may I make it indent automatically, i.e. while I type (I already know the keyboard shortcuts) the C code?
mFeinstein
1

votes
1

answer
98

views

Wake QThread from Windows event

I wanted to have a sleeping thread that will be waked when a specifc USB device is inserted (VID and PID matches the ones I am expecting). How may I connect QThreads to Windows native notifications and make this work?
mFeinstein
1

votes
1

answer
1.6k

views

OpenCV findContours Stack Overflow

I have a C++ project using Qt 5.1.1 and OpenCV 2.4.6. The image processing algorithm runs in a separate thread. All works fine but if I call OpenCV function findContours() the program crashes with a stack overflow message (right in the first time this function is called, not like it was already call...
mFeinstein
1

votes
3

answer
385

views

Android - How to align a TextView text

I have the following layout for a ListView item: And this is the rendered result: As you can see there is a gap between the real text and the bottom of the image... I was expecting to have the bottom of the text matching exactly with the bottom of the image...so question is: How can I align the text...
mFeinstein
1

votes
1

answer
872

views

Noda Time Date Comparison

I am new to Noda Time and I basically want to compare if a date has expired or not. In my case I have an object with the date it was created, represented by a LocalDate and the amount of months it's valid as an int, so I wanted to do a simple: if ( Now > (dateCreated + validMonths) ) expired = true...
mFeinstein
1

votes
1

answer
712

views

Fill a BGR Frame Data in FFMPEG

I am following the FFmpeg video enconding example here, but it makes some dummy YUV420P frames and I have a BGR image already captured from a camera. I am not sure how to use frame->data[] and frame->linesize[] for filling them with my BGR image instead, so I can encode an H264 video. EDIT: I have t...
mFeinstein
1

votes
1

answer
348

views

Find “?android:attr/textAppearanceSmall”

I am setting some default styles for my app, and I wanted to have the ?android:attr/textAppearanceMedium as a parent of a style...but I can't, Android Studio complains about that reference, so I have to instead make the parent as parent='@android:style/TextAppearance.Medium'. The problem is that @an...
mFeinstein
1

votes
1

answer
1.4k

views

Send Windows 10 Notification from Windows Service

I can find code on how to fire a Windows 10 notification from an Universal Windows App, or a remote notification from a cloud server, but I can't see how to make one from a background Windows Service. Is this possible to be made?
mFeinstein
1

votes
1

answer
172

views

Xceed DataGrid Error

I just upgraded my project to version 3.0 of the Extended WPF Toolkit™ Community Edition and now my DataGrid shows an error at design time saying: The specified view type must derive from ViewBase. Parameter name: TargetViewType Is this a new bug in the new version?
mFeinstein
1

votes
1

answer
808

views

Moshi Custom Adapter isn't being called

TL;DR: My questions are: 1 - How can I make an Adapter for the 'timestamp': 1515375392.225 to ZonedDateTime. 2 - How can I register the List adapter in the moshi object Builder if I need the moshi object to get this adapter, according to the documentation? My JSON string has the following structure:...
mFeinstein
1

votes
1

answer
332

views

trustCertificateKeyStoreUrl vs clientCertificateKeyStoreUrl

What's the difference between trustCertificateKeyStoreUrl and clientCertificateKeyStoreUrl in MySQL Connector/J? When should I provide one or the other? I have a client app that connects with AWS RDS using SLL, which one of those should I be using?
mFeinstein
1

votes
1

answer
113

views

IntentService and Activity Lifecycle

I followed this tutorial on how to reverse geocode in Android, but I can't understand how this IntentService will deal nicely with the Activity lifecycle. I am following this code sample. As far as I understand, the Activity will hold an instance of the AddressResultReceiver, named mResultReceiver....
mFeinstein
1

votes
2

answer
313

views

Error trying to render MaterialButton from Material Components

I followed the getting started guide here, I don't want to migrate to androidx at this time so I did: Made sure I have the correct repositories Added com.android.support:design:28.0.0-rc01 to my dependencies, since the Getting Started tutorial states this is the only thing needed if I don't want to...
mFeinstein
1

votes
1

answer
0

views

How to show a Snackbar from a Stream in Flutter?

I want to show a SnackBar once a Stream of String sends a new String. I tried to place a StreamBuilder inside a StatefulWidget, in order to be able to call Scaffold.of() (since it's another context now). but then I get this error: The following assertion was thrown building StreamBuilder(dirty, stat...
mFeinstein
1

votes
1

answer
72

views

Android Maps API 2 SHA-1 Key usage

I am reading the google maps android API v2 setup document and it says I need to provide my app's SHA-1 fingerprint in order to get a key to access the API. This sounds really cumbersome, because some times I just enjoy to make some quick tests in the code, to test some ideas and see if everything...
mFeinstein
1

votes
1

answer
93

views

Entity Framework 6 CF: Remove One-to-Many

My classes are something like: public class Contact { public string Name { get; set; } public virtual ICollection Persons { get; set; } [Key] public int Id { get; set; } } public class Person { public string Name { get; set; } public virtual Contact Contact { get; set; } public int? ContactId { get;...
mFeinstein
1

votes
1

answer
178

views

How C# returns Structs

Structs are value types and thus are fully copied every time there is a manipulation on the struct. Since they are value types, structs are allocated in the stack and not in the heap. I can see how structs can degrade the performance of methods when structs are passed as parameters, since they will...
mFeinstein
1

votes
2

answer
3k

views

Correctly Allocate And Fill Frame In FFmpeg

I am filling a Frame with a BGR image for encoding, and I am getting a memory leak. I think I got to the source of the problem but it appears to be a library issue instead. Since FFmpeg is such a mature library, I think I am misusing it and I would like to be instructed on how to do it correctly. I...
mFeinstein
1

votes
1

answer
78

views

Can Dart generate code at compile time?

In Java we can use annotations to generate code automatically at compile time, this feature is amazing for reducing bioler plate code. Many great libraries such as Retrofit, Room and AutoValue use it. Does Dart have similar features?
mFeinstein
1

votes
1

answer
62

views

When to use num in Dart

I am new to Dart and I can see Dart has num which is the superclass of int and double (and only those two, since it's a compile time error to subclass num to anything else). So far I can't see any benefits of using num instead of int or double, are there any cases where num is better or even recomme...
mFeinstein
1

votes
2

answer
48

views

Understanding Maven dependencies and assembly

I am not very much experienced with Maven and it's compilation and packaging logic gets me confused. I have some dependencies declares as : com.dependency_group dependency_1 1.0.0 com.dependency_group dependency_2 1.0.0 provided So as far as I understand, dependency_1 will be added to the classpath...
mFeinstein
0

votes
0

answer
5

views

How to deal with Sessions in the new Places API Billing?

The new Places API Billing defines Sessions for merging Autocomplete and Place details requests, but the docs just say the API will merge requests with the same Session Token, made within some minutes. I find this very vague! Do we have to generate new Session Tokens or can we reuse the same and the...
mFeinstein
1

votes
1

answer
147

views

Noda Time Unit Testing XML Error

I am trying to setup a simple unit test using Noda Time. My code is: public void ValidityPassedDate() { FakeClock fakeClock = new FakeClock(SystemClock.Instance.Now); fakeClock.AdvanceDays(60); MyClass myObj = new MyClass(fakeClock); myObj.Validity = '1'; myObj.Date = SystemClock.Instance.Now.InZon...
mFeinstein
1

votes
3

answer
1.9k

views

MVVM - Reuse Views with multiple ViewModels

I believe one of the main benefits of MVVM is decoupling, the binding and lack of references makes things a lot more reusable. All MVVM examples I find have some kind of View with a ViewModel with the same naming like ExampleView has a ExampleViewModel. And always a one to one relationship, one Vie...
mFeinstein
0

votes
0

answer
2

views

IntelliJ IDEA shows error for Jersey quick start in web.xml

I created a webapp using the maven archetype for Jersey 2.27 quick start, but IntelliJ IDEA show the following error: Error:(7, 24) 'org.glassfish.jersey.servlet.ServletContainer' is not assignable to 'javax.servlet.Servlet' This is the generated web.xml: Jersey Web Application org.glassfish.jersey....
mFeinstein
2

votes
2

answer
103

views

Auto adjust limits in ConstraintLayout

I have a form as a ConstraintLayout, like this: 'Full Name' and 'Password' are aligned on their right edge, and 'Full Name' is providing the margin from the ConstraintLayout: So far all is fine, but I wonder about how to properly handle the case where I need to change those texts programmatically. I...
mFeinstein
2

votes
2

answer
56

views

What's with the final/const craze in Flutter?

Java have final as well as Dart, but as far as I have seen, most Java people avoid using it all the time, since it can make your code less readable. For example, final is used all the time in class constants such as public static final int, but most people avoid using it in a method variable, since...
mFeinstein
4

votes
1

answer
953

views

MVVM Call Command from CommandBinding

I wanted to bind a CommandBinding to a ViewModel ICommand, this way, when the user hits Delete I can trigger my ViewModel's delete logic. The only way I know how to do it is in code behind, with this: Any MVVM ways of achieving the same?
mFeinstein
21

votes
7

answer
6.5k

views

How to Compress Slot Calls When Using Queued Connection in Qt?

After reading some articles like this about Qt Signal-Slot communications I still have a question concerning the queued connection. If I have some threads sending signals all the time to each other and lets say one thread_slowis running a slow method in it's event loop and another thread_fast is run...
mFeinstein
1

votes
2

answer
468

views

Entity Framework Primary Key Exception

I have a very simple C# class, which contains one primary key. I am using EF 6 with code-first and I have two questions: How do I make a primary key as an Identity in code-first (and how to not make it an identity)? Some of my classes need the PK to be an identity (auto increment on addition) and so...
mFeinstein
2

votes
2

answer
2k

views

Visual Studio - Source Control

I am pretty new in source control installation and inner workings, although I already had worked with TFS, I have no clue about how to make it work from scratch. Basically I want to have some source control in my personal VS2010 projects, so I may see the code evolution, rollback and etc. but I am a...
mFeinstein
2

votes
3

answer
1.5k

views

SSL Exception on Java: Path does not chain with any of the trust anchors

I am trying to establish a SSL connection with my MySQL database in Java using MySQL Connector/J (version 5.1.45) and this AWS RDS certificate here: https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem But I am getting the following Exception: java.security.cert.CertPathValidatorExcepti...
mFeinstein
2

votes
2

answer
353

views

C# INotifyPropertyChanged handler

I am starting to read about MVVM and one pattern I see a lot is: public event PropertyChangedEventHandler PropertyChanged; //..... PropertyChangedEventHandler handler = this.PropertyChanged; if (handler != null) { var e = new PropertyChangedEventArgs(propertyName); handler(this, e); } Why to bother...
mFeinstein
22

votes
3

answer
73.8k

views

Android - Image Button Scale

I am trying to fit an image inside an ImageButton for testing but the way the ImageButtonbehaves is not as expected. initially, I made a 988x89 pixels PNG image and placed it inside an ImageButton, which is in a 7inches 1024x600 pixels emulated screen. The ImageButtonis 988dp x 89dp, I know dp is no...
mFeinstein

View additional