Leigh Flix

1

votes
1

answer
2.1k

views

React Navigation - How to use this.state in Header navigationOptions?

I have spent a couple hours to find a code to handle the state in navigationOptions, but I don't get it till now, I have a code : static navigationOptions = ({ navigation }) => { const { params = {} } = navigation.state return { headerLeft: navigation.navigate('Home')} style={{margin: DeviceWidth*0...
flix
1

votes
0

answer
45

views

How to handling asynchronous in Service to execute task synchronous in Android?

My Question is not duplicated as this question! my case is about AsyncTask not just about Runnable, and even so, I've 2 AsyncTask inside runnable that needed to handling! I'm new in Android, I've an app created by React Native. but the problem is I want to upload any data (image [jpg] & video [mp4])...
flix
1

votes
1

answer
644

views

Ionic 2 calendar eventsource property binding doesn't update the view

I'm new to ionic/angular/TS and I'm trying to create a calendar with the ability to set appointments (events) and edit/delete them. I'm using a modal to edit the selected event and this modal has the delete event button. for now I'm storing the added events in an object array in a provider. Adding,...
Zilly Flix
1

votes
2

answer
953

views

React Native - How to handle TextInput onChangeText event to wait before execute function?

I have a search function using Text Input in React native, but the search need to call an API, so I want to hold the onChangeText to run when user finish typing for 2 second, I've tried to use setInterval nor setTimeout but none of these works, here's the code I've tried: { setTimeout(() => { consol...
flix
1

votes
1

answer
90

views

React Native - How to list suggestions of my own component props?

I want to show all of my props when calling the component from parent, I have a component called Loader.js and the list of props is like below: static propTypes = { nameLoader: PropTypes.string, typeSpinner: PropTypes.string } static defaultProps={ typeSpinner:'ThreeBounce' } and when I called the c...
flix
1

votes
0

answer
1.3k

views

Can i convert HTML+CSS animation to .gif extension?

I have a sample loader from my web, but the loader is made with HTML + CSS animation, and I want to convert the web loader to gif, so I can use the loader to my mobile apps. Here is the link: https://jsfiddle.net/6uedrb89/ Here's the demo: .se-pre-con { position: fixed; left: 0px; top: 0px; widt...
flix
1

votes
2

answer
38

views

How to setState() depend on which component func is called?

I want to set dynamic state depending on which function is called, I know if we can't setstate in render, but still i need to do that to set dynamic state, there's some way to make it possible? export default class Foo extends Component { constructor(props) { super(props); this.state={ dynamicView:...
flix
0

votes
0

answer
5

views

How to handle TabBar with ListView in Flutter?

I have spent a couple hours just to find how to change the tint of tab while scrolling the listView until (x) item/header, I'm start to learn flutter from here and the UI look's like: I wonder how to dealing with ListView and tabBar just in case i'm scrolling until Flutter is awesome 51 the tabBar i...
flix
1

votes
1

answer
387

views

Import existing class diagram into modeling project

I got a class diagram created with VS 2010 whose modeling project got lost somehow. So I am left with the foo.classdiagram and foo.classdiagram.layout files. When I try to open it in another modeling project, I just get a blank class diagram. Is theres any way to import existing class diagrams into...
flix
1

votes
2

answer
202

views

json_decode returns NULL over $_POST

I'm having trouble working out things with json_decode. I got a valid json that's being sent over $_POST. Here's the JSON object that is being passed, the inventory variable: [{'item_name':'Screw Driver','item_desc':'asdasd','item_type':'weapon'}, {'item_name':'Brown Shoes','item_desc':'asdasd','ite...
flix
1

votes
1

answer
149

views

Relation between TPM Command Reference and TSS

The TCG offers two different specifications of commands/interfaces for developers of a middleware that communicates with a TPM. There is on the one hand the TPM Command Reference as described in http://www.trustedcomputinggroup.org/files/static_page_files/72C33D71-1A4B-B294-D02C7DF86630BE7C/TPM%20Ma...
fliX
1

votes
2

answer
838

views

How to display JSONObject into TextView on android

I've set up a php script to create json here, but when i try to display the JSONobject i got some error like this on my Android Monitor.. Value (html)(body)(script of type java.lang.String cannot be converted to JSONObject can someone tell me how to fix it? below my code to try my MainActivity.java...
Flix
1

votes
1

answer
55

views

How to handle web design form to center page and copyright to bottom-center using bootstrap.css

I've tried a couple hours to find how to do that, but not yet how to do I've a form like this that i though it's not good-looking: then I try how to set a form to center page and footer.php to bottom-center form.php Tambah Nilai Preferensi Keterangan Nilai Jumlah Nilai Simpan Kembali footer.php © 2...
Flix
1

votes
1

answer
101

views

xamarin forms start nativ uwp page

any idea how I can start a native UWP page from a Xamarin Forms page? The reason why I'm asking: I have a XF application that needs to start a UWP library after a click event. This library provides a special ORC reader. Therefore I created a dependency service to run the platform specific functio...
flix
1

votes
2

answer
225

views

How to create custom native module android for react native app?

I've build simple service in android studio to run a service every second in console log, and I want to implement my android studio code in react native there's a way to do that? let say I've a code : myService.class public class myService extends Service { private Handler handler= new Handler(); pr...
flix
1

votes
1

answer
390

views

ajax - send json to rest api not work

I've looking for hours but still don't know how to fix it, I've a json data like this { 'salutation' : 'tes', 'location' : 'tes', 'reference_code' : 'tes', 'isCustomer' : 1, 'email_to' : '[email protected]', 'phone' : '089999999', 'front_name' : 'Adhitya', 'name' : 'Adhitya', 'age' : 13, 'marital_st...
flix
1

votes
1

answer
1.2k

views

React Navigation - How to switch Tab Navigation to handle Login Screen?

I want to know if it's possible to handle login screen after the button login pressed, I have a router.js: export const TabLoged= TabNavigator({ Home: { screen: HomeStack, }, MyPatient:{ screen: MyPatientStack }, MyAccount: { screen: MyAccount, } }); export const Tab = TabNavigator({ Home: { screen...
flix
1

votes
2

answer
64

views

React Native - get value of json depending on dynamic state

I have a json getting from API and store it into this.state.data like : [ { 'name': 'Primary Category', 'value': [ { 'value': 'Fracture', 'Diagnosis_Code': ['DIAG003'], 'name': 'Primary Category', 'FK_Diagnosis_Content_ID': 3, 'FK_Diagnosis_Category_ID': 1 }, { 'value': 'Osteoarthritis', 'Diagnosis_...
Flix
1

votes
1

answer
160

views

React Native - can I set dynamic initial state?

let say I have a state like this: constructor(props) { super(props); this.state = { FirstTime: { foo: 'ex1' } } } and then I setState the FirstTime to add another key/value: this.setState({FirstTime: {...this.state.FirstTime, bar: 'ex2'}}) there's a way to change the initial state to be like this: c...
flix
1

votes
1

answer
234

views

React Native - How to detect view screen is scrollable?

Main Question : how to keep scrollbar of ScrollView visible? and this question isn't answered my question similar question : How can i detect if a content of view height is higher than device height? so i can setState if the screen is scrollable I have tried using onLayout with this code: {var {x, y...
flix
1

votes
2

answer
0

views

How to implement Context API in React Native

I just start looking for changing theme globally, and found Context can do that, but I've a problem to implement the example code to my react native project, I've tried this code: //themeContext.js const themes = { light: { foreground: '#000000', background: '#eeeeee', }, dark: { foreground: '#fffff...
flix
1

votes
3

answer
3.2k

views

mysql insert with value, with selected data from another table

I have a MySQL problem I can not get to solve. I have a mysql to manage a virtual user dovecot installation, that uses two tables (one for the aliases, another for the domains). The table aliases has these fields: domain_id(INT), source(VARCHAR), destination(VARCHAR), whereas table domains has only...
flix
1

votes
2

answer
326

views

Generate 4-digit token via php which extends

Hello to this great community, I have written the following lines of code. mysql_query('DELETE FROM token_db WHERE date < '.strtotime('-1 day')); $token = mt_rand(1000, 9999); $result = mysql_query('SELECT token FROM token_db WHER...
flix
1

votes
3

answer
1.4k

views

How to handle checkbox fetching from json using react-native-element checbox with FlatList React Native?

I'm trying to create dynamic checkbox with the name fetching from json, this issue looks same as I need, but without the code explaining, I can't archieve my goal, I have a json example like this : this.state = { data : [ { 'name': 'ALL', }, { 'name': 'Android', }, { 'name': 'iOS', }, { 'name': 'Rea...
flix
1

votes
1

answer
86

views

Equal height flexboxes with equal height children of variable content, without JS

Making the gray boxes have equal height is trivial: .blue-box { display: flex } The images have the same height by design. The white boxes contain variable amounts of text, so they're all different heights. Is there a way to make the white boxes of equal height, without JavaScript? Thank you.
Flix
1

votes
2

answer
603

views

Changing y axis on multiple subplots in matplotlib

I am fairly new to python and matplotlib. I have the following problem: I want to plot six climatic drivers over 2000 years. Since each plot represents a different driver, I want to give each y-axis a different label, but am not able to index each subplot. Please see the following code and subseque...
flix
1

votes
3

answer
74

views

Make web service not accessible by browser?

I wrote a web service because I wanted my javascript to access methods in it throughout the website using ajax. I'm new to this. However I just realised that the asmx is accessible via browser and it shows a test page and xml output of data from the methods. is there a way to disable this UI for the...
Zilly Flix
1

votes
4

answer
97

views

is it posssible to push json into another json inside function

I have a problem to inserting new json into old json, have been tried to find it but I don't know the right keyword, let say I have a json on foo1.js: function jsonapi(){ var ItemJSON = { 'salutation':'foo1' ,'location':'foo2' ,'reference_code':'foo3' } } and on foo2.js : jsonapi(); var json = { ,'i...
flix
1

votes
1

answer
77

views

Strict weak ordering on pointer values

Consider the following struct: struct Foo { const Bar* x; const Bar* y; Foo(const Bar* _x, const Bar* _y = nullptr) : x(_x), y(_y) { assert(x); } } How do we define a strict weak ordering on x and y so that the object can be used within a std::set? Note that y can be a null pointer. As mentioned in...
fliX
1

votes
2

answer
3k

views

Extract Public Key of a DER encoded Certificate in C

I am getting a DER encoded certificate (after base64 decode) from an ldap search request and need to parse the public key from it. I am pretty sure that its possible with the openssl library. Unfortunately the API documentation is not very well-kept. Is there any example or other library to extract...
fliX
0

votes
0

answer
8

views

How to use console.time without installing 3rd lib in react native?

I have a recursive function, so i need to know how much the fn() finishing process there's some way to use console.time since it's base of javascript console? I've tried below code: {import class} function foo(data){ //recursive function } export default class App extends Component { componentWillMo...
flix
1

votes
2

answer
358

views

No undefined references when compiling shared library

Im wondering why Im getting no undefined references when compiling as a shared library using -shared as an option for gcc. Consider the following case: #include int main(int argc, char **argv) { cfg_opt_t opts[1]; cfg_t *cfg = cfg_init(opts, CFGF_NOCASE); return 0; } libconfuse is needed here in or...
fliX
3

votes
1

answer
31

views

Pandas merge two dataframes by date, ending up with entire NaN column

I've gone through a number of examples of similar queries unfortunately to no avail. I have two dataframes that I need to combine. df1 . DATE HIGH LOW OPEN CLOSE 0 2013-01-04 10734.23 10602.24 10604.50 10688.11 1 2013-01-07 10743.69 10589.70 10743.69 10599.01 2 2013-01-...
F-Flix
5

votes
4

answer
890

views

Value of 'this' in Javascript

Could someone please explain why 'this' in the following points to the DOM Object and not to Window? $('a').click(function() { console.log(this); }); This yields to: Consider the following which should be the same scenario: function Foo() { this.click = function(f) { f(); } } var obj = new Foo(); ob...
fliX
4

votes
2

answer
45

views

Why does padding effectively create a min-width and min-height, even with box-sizing set to border-box, and how to deal with it?

A div with padding can't be made smaller than its padding will allow. Is this expected behaviour? If so, how can we deal with it? div { display: inline-block; height: 50px; width: 1px; /* Why won't it? */ padding: 10px; box-sizing: border-box; background: grey; animation: animate-width 4s eas...
Flix
3

votes
1

answer
1.4k

views

What exactly is NVIDIA Tesla and CUDA? [closed]

I'm doing some research on GPGPU and currently struggle with the question what Tesla and CUDA really are. In the paper 'NVIDIA Tesla: A unified Graphics and Computing Architecture' it says that the Tesla architecture was introduced with the GeForce 8800. With further reading I was convinced that it...
fliX
3

votes
5

answer
60

views

is it possible to handle 2 variable to changing if/else condition is true on ES6?

Let say I have a code like this var a, b; b = 1; var c = b > 0 ? a = 1 /*and c = 2*/ : a = 0 /*and c = 1*/; console.log(a + c); Is there any way to make c = 2 and a = 1 with above code?
flix
2

votes
2

answer
842

views

How to limit number of the many in a one-to-many relationships between two tables?

I have a MySQL database with two MySql tables. First is with The first table (table A) has a column with unique values(from values (from 1 to n). In the second table 2 (table B), I have two columns: in the first I have a name and in the second i have values from 1 to n(if i ad an value in the . The...
flix
1

votes
2

answer
40

views

What's a good way to find and mark paragraphs or other HTML tags that contain a string, with PHP?

Context: WordPress development sites with lorem ipsum in random places. Would like to present these content areas in red, so they're not missed and they're prominent during review. Example: This is real content and has no dummy words. This has words like lorem and ipsum. It should be highlighted. De...
Flix
1

votes
2

answer
1k

views

ANDROID - how to display JSONArray into textview

I've set up a php script to create json here, but when i try to display the JSONArray i got some error like this on my Android Monitor.. Value (html)(body)(script of type java.lang.String cannot be converted to JSONArray can someone tell me how to fix it? MainActivity.java package flix.yudi.okhttp1;...
Flix

View additional