Thursday, August 31, 2017

rxjs - Discard future returning observables

Leave a Comment
So here is my observable code: var suggestions = Rx.Observable.fromEvent(textInput, 'keyup') .pluck('target','value') .filter( (text) => { text = text.trim(); if (!text.length) // empty input field { this.username_validation_display("empty"); } else if (!/^\w{1,20}$/.test(text)) { this.username_validation_display("invalid"); return false; ...
Read More

React-native image with headers

Leave a Comment
How to pass headers into Image element? This approach does not fit due to impossibility to cache images and base64 conversion will be hard with small RN Js-thread https://stackoverflow.com/a/36678631/6119618 This is not working at all on neither android nor ios https://stackoverflow.com/a/44713741/6119618 I don't want yet eject my project, so modules like FastImage and others using react-native link will not work UPD tried to launch the same app on ios and images aren't showing up. Android works 0 Answe...
Read More

SharePlum error : “Can't get User Info List”

Leave a Comment
I'm trying to use SharePlum which is a Python module for SharePoint but when I try to connect to my SharePoint, SharePlum raises me this error: Traceback (most recent call last): File "C:/Users/me/Desktop/Sharpoint/sharpoint.py", line 13, in site = Site(sharepoint_url, auth=auth) File "C:\Users\me\AppData\Local\Programs\Python\Python36\lib\site-packages\shareplum\shareplum.py", line 46, in init self.users = self.GetUsers() File "C:\Users\me\AppData\Local\Programs\Python\Python36\lib\site-packages\shareplum\shareplum.py",...
Read More

HTML: How to increase tables' overall height if they are side-by-side?

Leave a Comment
I have followed following guide (https://stackoverflow.com/a/45672648/2402577) to put tables side-by-side. As output tables' heights are not symmetric and I am not able to make change both tables' height (I prefer to increase tables' displayed row number hence having a longer table). My source code, please note that I am using Bootstrap: <div class="container" id="coverpage"> ...
Read More

Wednesday, August 30, 2017

ExpressJS router normalized/canonical urls

Leave a Comment
I'm after normalized/canonical urls for SPA with ExpressJS server. Although it is SPA that is backed up by server side router - templates can differ a bit for app urls. One of the differences is <link rel="canonical" href="https://example.com{{ originalPath }}"> tag. Not the relevant detail but explains the context of the question. I expect that there will be only one URL that responds with 200, its variations are redirected to it with 301/302 (works for living humans and search engines). I would like to make the...
Read More

Drag/Scroll canvas not smooth after zoom [android coloring book app]

Leave a Comment
I'm trying to implement zoom feature in my coloring book app, the zoom working perfectly but I have 3 main problems in canvas after zoom: Drag/scroll the canvas is not smooth and difficult after zoom. I can't detect the pinch motion in order to avoid coloring during zoom process. After zoom it is not filling the exact tapped point so I would like to keep filling the tapped point. Here is my code: public class MainActivity extends AppCompatActivity implements View.OnTouchListener, View.OnClickListener { private static...
Read More

ODATA - how to generate odata service from Edmx file

Leave a Comment
There is some Odata lib which I can use that from edmx file it generate an odata service? By providing only edmx file it create the service that can answer the metadata calls... I've found this library https://github.com/htammen/n-odata-server But it requires json not edmx/metadata.xml file... I see the Olingo lib but I didn't find any functionality that can do it ... https://olingo.apache.org Any direction if it possible? I prefer to use some nodejs lib if there is some combination that could work, but its not...
Read More

Loading Google Analytics after page load by appending script in head doesn't always work

Leave a Comment
In the EU, there's a cookie law that requires you to load third-party scripts after the user expresses consent, by clicking, scrolling or navigating for instance. So I load 3 scripts by executing a function that's called after document loads. This is the code: The problem is that it doesn't always work, nor always fail. I see sessions and activity but I also know for a fact that there are visits that don't trigger the scripts because...
Read More

Go To Controller shows “Unable to find a matching controller.” error

Leave a Comment
In VS 2015, for my Web.API project, I installed MVC 5 from nuget via npm. This installation added references and generated web.config file under Views folder. I added new Controller with generated CRUD functions. When I right click and go to View on action it goes with no problem. But reverse action does not work. If I navigate to view via browser it works as well. Web app compiles as well. Is there any way for me to fix this navigation...
Read More

Why does Android select AppCompat components when I don't declare them explicitly?

Leave a Comment
I was debugging my App and found while hovering on an ImageView reference that, it is an AppCompatImageView instead of an ImageView. The same happened with a TextView(with AppCompatTextView). While I don't particularly have a problem with this behavior because its AppCompat after all but when inspecting the code of fellow developers, I saw, extends Activity instead of AppCompatActivity and I almost marked it as a "bad practice"....
Read More

How can I change a <StackLayout> <Grid> screen to use <RelativeLayout>?

Leave a Comment
I have this code that's currently a combination of and I would like to move to a relative layout and have not seen so many examples of that. Would appreciate any suggestions on how this could be accomplished. Some points about the XAML. Either emptyGrid or phraseGrid appear on the screen Either buttonGrid or tapGrid appear on the screen The vertical center of the buttons and the tap label should be the same position. So that...
Read More

Android Annotation Working of @IdRes

Leave a Comment
I was using setId method of View class. According to this method public void setId(@IdRes int id) // This will accept resource id When I tried to use this method with some hardcoded int value(let say 100), then this method start throwing correct warning which is expected- actionButton.setId(100); Expected resource of type id. But when I converted this hardcoded value into a method and never defined that this method will return @IdRes, Warning gets silent. private int getViewId() { return 100; ...
Read More

Tuesday, August 29, 2017

Update Redux prop/state following div onclick

Leave a Comment
I have a table - let's call it table 1. When clicking on a row in table 1 another table is being displayed, let's call this one table 2. Table 2 displays data relevant to the clicked row in table 1. Sometimes a vertical scroll needs to be displayed in table 2 and sometimes not -depends on the number of rows.Need to solve: there is an unwanted transition of the border when the scroll is not being displayed: . The idea for the solution:...
Read More

Saving tf.trainable_variables() using convert_variables_to_constants

Leave a Comment
I have a Keras model that I would like to convert to a Tensorflow protobuf (e.g. saved_model.pb). This model comes from transfer learning on the vgg-19 network in which and the head was cut-off and trained with fully-connected+softmax layers while the rest of the vgg-19 network was frozen I can load the model in Keras, and then use keras.backend.get_session() to run the model in tensorflow, generating the correct predictions: frame = preprocess(cv2.imread("path/to/img.jpg") keras_model = keras.models.load_model("path/to/keras/model.h5")...
Read More