variables outside of snapshot firebase Angular

Uncategorized
Question: this may come across as simple but I've ran into this problem a lot with Angular and I need a little explanation. All I'm trying to do is get a variable value outside of the snapshot function. If I could do something like this let testVariable : string; var testCount = firebase.database().ref('users/' + userName + '/userName'); testCount.on('value', function (snapshot) { testVariable = snapshot.val(); }); alert(testVariable); //comes out undefined Thank you Answer: The problem is your code is running asynchronously. This means that javascript will make the call to firebase and immediately call the alert function, without waiting for any response. Your alert must either be placed in a callback or called after the variable has been set. If you are using "this" you might have problems accessing this within…
Read More

Disable scroll animation in RecyclerView

Uncategorized
Question: I have a RecyclerView which basically does nothing other than scroll programmatically. The problem is I need this RecyclerView to scroll to position with no animation. This is the code I'm using. ((LinearLayoutManager)recyclerView.getLayoutManager()).scrollToPositionWithOffset(position, offset); Thanks in advance. Answer: You can animate itemView yourself, use two variable startPosition and endPosition for starting position and end position and animate(viewHolder, false) is a function where you can add or remove animation public void onBindViewHolder(ViewHolder viewHolder, int position) { final DataModel dataModel = dataList.get(position); viewHolder.textTittle.setText(dataModel .getTitle()); if (startPosition
Read More

How to set outgoing mail settings with a specific mail server for JIRA on a Google Cloud Virtual Machine?

Uncategorized
Question: I have a JIRA software on a Google VM (with Ubuntu 16.04) and I have a domain and a hosting (let's say mydomain.com). Luckily, my website hosting provides me email hosting too. But, I can't send emails from my specific email host (which is email.mydomain.com) using JIRA on Google VM because I keep getting this error; SocketTimeoutException: connect timed out. I have checked the settings for JIRA Outgoing emails lots of time. However, I can't find the solution.. Here is the configuration I made on my JIRA software for outgoing emails; Name: Example Mail Server From adress: mail.mydomain.com SMTP port: 587 Timeout: 10000 TLS: Unchecked Username: jira@mydomain.com Password: ******* By the way, I already checked jira@mydomain.com to sent a couple of emails from the internal system of "mail.mydomain.com". In…
Read More

Cannot save Security Item to Keychain

Uncategorized
Question: I am trying to save SecIdentity item into the keychain using Swift 3. After saving status of operation is alway 0 (Successful), but when I try to retrieve the saved one, status is -25300 (which means that object does not exist) What I'm doing wrong? func saveIdentity(identity: SecIdentity) -> Data? { let str = "identity" let saveQuery = [ kSecClass as String : kSecClassIdentity, kSecValueRef as String : identity, kSecAttrLabel as String : "identity", kSecAttrAccessible as String : kSecAttrAccessibleAlways ] as [String : Any] var item: CFTypeRef? = nil var status: OSStatus = SecItemAdd(saveQuery as CFDictionary, nil) // Status = 0 let loadQuery = [ kSecClass as String : kSecClassIdentity, kSecAttrLabel as String : "identity", kSecReturnRef as String : kCFBooleanTrue, kSecMatchLimit as String : kSecMatchLimitAll ] as [String :…
Read More

Glitches on Nav click

Uncategorized
Question: I have made this Portfolio and everything just look great but I have one issue with the nav, I have applied Javascript on it to switch the position between Fixed and absolute depends on the user scroll, whenever the position:fixed and the user click on link inside the nav there will be no issue, but when the position:absolute and a user click on any link, you will notice that the nav glitches. How could I remove this glitches I have tried so much things but nothing worked, anyone could help with this ? Answer: Read more
Read More

Configure Apache to point domain root on tomcat folder

Uncategorized
Question: i have to setup a webserver, but i'm a total noob. Currently on my Server (Windows Server 2012R2) i have a tomcat 8.5.15. If i start the tomcat i can open "localhost:8080/[folder]" on the server and from extern i can open "[domain]:8080/[folder]". I want that "[domain]" from extern directly points on the folder. So i installed apache httpd-2.4.27-ossl11-x64 if i start apache i can open "localhost" for the apache site on the server. I can't open "[domain]" from extern to see the apche site. Can somebody explain to me or give me a link to an how-to for configuring apache? Answer: Read more
Read More

netbeans error on running android projects

android
Question: I have installed java 8 and netbeans 8.2. I added android support on netbeans using https://bitbucket.org/nbandroid/nbandroid/wiki/Installation . I pointed sdk location created by android studio. I have created AVD. I created my first android project on netbeans. But when I am running or cleaning and building that app I am getting error message "build.xml:1: Premature end of file." What could be the cause of this problem. I am able to create and run android apps on android studio successfully so I think there is no problem with android sdk. I tried netbeans 8.1 also but same problem is happenning. Answer: Read more
Read More