Posts

Showing posts from September 13, 2018

*ngIf based on another *ngIf

Image
Clash Royale CLAN TAG #URR8PPP *ngIf based on another *ngIf Using Angular, I have created the following code with two *ngFor s and two *ngIf s. *ngFor *ngIf <div *ngFor="let contact of contactList"> <span>contact.name.formatted</span> <div *ngFor="let number of contact.phoneNumbers"> <span *ngIf="number.type == 'mobile'">number.value</span> </div> </div> How can I hide the first span if the second is hidden? I know I can do this by using JavaScript loops but I'd like to do this in the template if possible. 1 Answer 1 You are going to use the same ngIf on the first span since you want to hide the 2nd and 1st span. So you should use the first span within the ngFor <div *ngFor="let number of contact.phoneNumbers"> <ng-container ngIf="number.type == 'mobile'"> <span>contact.name.formatted</span> <span>number.value</span> ...

Why does the date/time field in my handsontable not update my database?

Image
Clash Royale CLAN TAG #URR8PPP Why does the date/time field in my handsontable not update my database? I am working on a web application built in Django. I am using a handsontable in the browser to interact with the database. I have a field set up for date/time that is not updating the database. It seems to be a data type issue but I cannot figure out why. In models.py I have the following defined: sampled = models.DateTimeField(blank=True, null=True) And in my html file I am building the handsontable in the javascript with the following settings for this field: data: 'sampled', type: 'date', dateFormat: 'DD/MM/YYYY HH:mm', Any suggestions? By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Rotate image inside a button UWP

Image
Clash Royale CLAN TAG #URR8PPP Rotate image inside a button UWP I'm trying to rotate a font icon inside a button 90° in the first click and back to 0° on the second click. Currently I have: <Page.Resources> <Storyboard x:Name="RotateButton90Degrees"> <DoubleAnimation EnableDependentAnimation="True" Storyboard.TargetName="ShowSubTasks_ButtonRotateTransform" Storyboard.TargetProperty="Angle" From="0" To="90" Duration="350" /> </Storyboard> </Page.Resources> <Button x:Name="ShowSubTasks_Button" Background="Transparent"> <interactivity:Interaction.Behaviors> <core:EventTriggerBehavior EventName="Click"> <media:ControlStoryboardAction Storyboard="StaticResource RotateButton90Degrees" /> </core:EventTriggerBehavior> </interactivity:Interaction.Behaviors> <FontIcon FontFamily="Segoe MDL...

Crashlytics on iOS unable to update network info during initialization

Image
Clash Royale CLAN TAG #URR8PPP Crashlytics on iOS unable to update network info during initialization I'm running into a problem with Fabric Crashlytics on my React Native app on iOS. I recently refactored my project to use iOS schemes to manage the different build environments better (different app id, app names etc) as well as for some other customer related reasons. Ever since then, my iOS environment has not been able to log crashes. When I run the app in the simulator, I see this in the output: 2018-08-07 19:31:27.104036+0800 Appname[85185:5403735] [Crashlytics] Version 3.10.5 (130) 2018-08-07 19:31:27.159384+0800 Appname[85185:5403735] Could not successfully update network info during initialization. When I run the pre-schemes version, I don't see this in the output. I did a diff of the AppDelegate.m, and its identical Some minor changes to the info.Plist file for version number etc, but nothing there. How do I troubleshoot the cause of this problem? I'm using X...

Problems adding custom CSS to Vuetify component

Image
Clash Royale CLAN TAG #URR8PPP Problems adding custom CSS to Vuetify component I'm working with the Vuetify selector input component, v-select , and I want to custom style it. Since the component renders with only one v-select and no necessary children in the html, I turned to styling the component via inspecting in chrome and copying down the class there. For example, to change the font size of the active value, I used: v-select v-select .v-select__selections font-size: 20px; This worked fine, until I realized my styles in this manner did not work on any parts of the (normally hidden) navigation drawer. For example, .v-menu__content height: 500px; Would not impact the styles in any way. Bizarrely enough, it was not simply my styles getting overwritten by Vuetify styles (!important had no effect) - it appeared that my CSS didn't reach the components at all. There was no trace of any of my written styles upon inspect. How? I believe this is due to the active-based natur...

Workbox offline mode works only on root path

Image
Clash Royale CLAN TAG #URR8PPP Workbox offline mode works only on root path Im working on my PWA application. So I have one problem that I can't find any info how to fix. I use workbox with webpack InjectManifest ( but also tried webpack offline-plugin ). When I access my webpage at the root and go offline, I can see it's working perfectly. But when I change route to '/authorize' or basically any other route and go offline, it doesn't work. Is there any requirement that it will work only in case that we are on root path? I can't find anything about it except for this: https://github.com/quasarframework/quasar-cli/issues/131 1 Answer 1 Ok found it. So basically it all comes to routing. https://developers.google.com/web/tools/workbox/modules/workbox-routing#how_to_register_a_navigation_route https://developers.google.com/web/tools/workbox/modules/workbox-strategies In my case, I wanted to always serve content as for SPA so I had to add workbox.routing....

How do I pass GslHeader argument to clang-tidy while using -fix option?

Image
Clash Royale CLAN TAG #URR8PPP How do I pass GslHeader argument to clang-tidy while using -fix option? I couldn't find sample code for a clang-tidy command line for fixing the following error: [archlinux@thinkpad fizzbuzz]$ clang-tidy fizzbuzz2.cpp -checks=cppcoreguidelines-pro-bounds-constant-array-index 5 warnings generated. fizzbuzz2.cpp:21:18: warning: do not use array subscript when the index is not an integer constant expression; use gsl::at() instead [cppcoreguidelines-pro-bounds-constant-array-index] std::cout << arr[index] << std::endl; ^ Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. [archlinux@thinkpad fizzbuzz]$ I just want to find out how I can get clang-tidy to fix this automatically. If not, how should I use gsl::at() to fix this? The clang-tidy documentation says the following: gsl::at() cppcoreguidelines-pro-bounds-c...

Train a conv net with similar pictures?

Image
Clash Royale CLAN TAG #URR8PPP Train a conv net with similar pictures? I have data that have pictures that are very similar, I do not know if I have to delete images that are too similar. for example I want to train a conv net that recognizes people , I have an image of a person and other image of the same person but in this image the person moved the arms , I should delete this images that are similar to train or not? May be this could be helpful: Siamese Networks (cs.cmu.edu/~rsalakhu/papers/oneshot1.pdf). So, if you're working with Siamese networks, you don't have to delete the similar images. – thelogicalkoan Aug 10 at 3:26 Im not working with siamese networks just a simple conv net that I want to train to recognize people – Darom Aug 10 at 21:23 By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these pol...

JasperSoft Studio - How to make TextField's height dynamic(Stretch With Overflow) when it's inside a TABLE and the table is inside a DETAIL band

Image
Clash Royale CLAN TAG #URR8PPP JasperSoft Studio - How to make TextField's height dynamic(Stretch With Overflow) when it's inside a TABLE and the table is inside a DETAIL band Ok guys here's my problem. I have a jrxml template for reporting. It's very simple. The main report has DataSet and also SubDataSet. I'm using a TABLE to use the SubDataSet. Inside the table I have a detail band. In the detail band I have columns and each having one TextField. Now these TextField's value is number. From database of course. Now its money to be exact, and we can not know for sure how much it will be in the future. So i'm testing it to contain 10 digits. And this is where the problem begin. I know to do it is simply tick the "Stretch With Overflow". Yet I already done that and its not working. My report is in XLS format and the cell give me "###". The data is in the cell, it's just need to have a new line to print the whole data. I know how to...

How to remove spaces and newline in awk for string insertion?

Image
Clash Royale CLAN TAG #URR8PPP How to remove spaces and newline in awk for string insertion? So, I have my apache2 config file like this: <Proxy balancer://mycluster> BalancerMember "ajp://10.x.x.xxx:8009" route=node1 loadfactor=1 keepalive=on ttl=300 max=400 timeout=300 retry=60 BalancerMember "ajp://10.x.x.xx:8009" route=node2 loadfactor=1 keepalive=on ttl=300 max=400 timeout=300 retry=60 BalancerMember "ajp://10.x.x.xxx:8009" route=node3 loadfactor=1 keepalive=on ttl=300 max=400 timeout=300 retry=60 BalancerMember "ajp://10.x.x.xx:8009" route=node4 loadfactor=1 keepalive=on ttl=300 max=400 timeout=300 retry=60 BalancerMember "ajp://10.x.x.xx:8009" route=node5 loadfactor=1 keepalive=on ttl=300 max=400 timeout=300 retry=60 BalancerMember "ajp://10.x.x.xx:8009" route=node6 loadfactor=1 keepalive=on ttl=300 max=400 timeout=300 retry=60 BalancerMember "ajp://10.x.x.xxx:8009" route=node7 loadfactor=1 keep...

Read plain text from tcp endpoint in WSO2 ESB

Image
Clash Royale CLAN TAG #URR8PPP Read plain text from tcp endpoint in WSO2 ESB My environment is WSO2 EI 6.1.1 and a generic socket client/server application downloaded from sourceforge 1. I'm trying to write a TCP proxy that is going to do this: 1- Accept a connection from a client 2- Receive some packets from the client and based on content it should make calls to a tcp endpoint 3- Receive the responses from the tcp endpoint and mediate them 4- Do 2 and 3 until receive a specific packet 5- Respond to client 6- Close the very first connection The response from the tcp endpoint always comes in plain text. I have tried to read the response from the tcp endpoint but it seems to me that it is always expecting a SOAP message, crashing with an error. Here is my proxy service: <proxy xmlns="http://ws.apache.org/ns/synapse" name="TCP_Prx" startOnLoad="true" statistics="disable" trace="disable" transports="tcp"...

How to compose email in office 365 outlook using VBA?

Image
Clash Royale CLAN TAG #URR8PPP How to compose email in office 365 outlook using VBA? I am able to compose email in Desktop Microsoft outlook using the below mentioned code. But this code is not working for Microsoft office 365 web outlook . Please provide me Code/Suggestion for composing mail in Microsoft office 365 web outlook. Sub Mail_small_Text_Outlook() Dim OutApp As Object Dim OutMail As Object Dim strbody As String Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) strbody = "Hi there" & vbNewLine & vbNewLine & _ "This is line 1" & vbNewLine & _ "This is line 2" & vbNewLine & _ "This is line 3" & vbNewLine & _ "This is line 4" On Error Resume Next With OutMail .To = "ron@debruin.nl" .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = strbody 'You can add a file like this '.Attac...

ios defelopment calling url

Image
Clash Royale CLAN TAG #URR8PPP ios defelopment calling url I have an app but I cannot get an image linked up to a url when clicked. var object = AdObject() object.imageURL = "https://imageurl.com/images/jpg" object.url = "https://thisislink.php" self.objects.append(object) What am I doing wrong here? Provided code is ok, but I guess it's not related to the question. – Fahri Azimov Aug 10 at 4:07 By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

MongoLab/PyMongo connection error

Image
Clash Royale CLAN TAG #URR8PPP MongoLab/PyMongo connection error If I run in the shell: mongo ds0219xx.mlab.com:219xx/dbname -u user -p pass It works and allows me to connect to the database and pull information. But if I'm within my python application (Flask) and run this: import pymongo client = pymongo.MongoClient("mongodb://user:pass@ds0219xx.mlab.com:219xx/dbname") db = client["dbname"] db.users.insert_one( "user1": "hello" ) It gives me an: pymongo.errors.OperationFailure: Authentication failed. I'm pretty sure it's failing before it gets to the insert_one() call, but I'm not completely sure. Thanks! Edit: By request, here is the full callback: Traceback (most recent call last): File "run.py", line 1, in <module> from app import app File "/Users/Derek/Documents/programming/shenalum/app/__init__.py", line 6, in <module> from app import views File "/Users/Derek/Documents/programming...

Blazor CRUD Sample: HTTP Error 500 for the request on IIS Server

Image
Clash Royale CLAN TAG #URR8PPP Blazor CRUD Sample: HTTP Error 500 for the request on IIS Server I just published my Blazor CRUD example to the local server. Website is working well, but I get HTTP Error 500 when I go to the fetch data page. Everything works well when I run on the Visual Studio, but IIS server. I have the connection string in context file. I also edited the connection string on the Application Pool settings page, but still not working. This is the code piece I am using on the context file: optionsBuilder.UseSqlServer(@"Data Source=(LocalDb)MSSQLLocalDB;Initial Catalog=master;Trusted_Connection=True;"); I also use this connection string for the IIS: 1 Answer 1 The answer is that there are two different LocalDB instances here. Unlike SQL Server Express instances, which are running as Windows services, LocalDB instances are running as user processes. When different Windows users are connecting to LocalDB, they will end up with different LocalDB processe...

Running the client via IntelliJ

Image
Clash Royale CLAN TAG #URR8PPP Running the client via IntelliJ I am new to Corda and following this link. I am running from IntelliJ by selecting "Run Example RPC Client" from run configuration and click on green arrow. And I am getting the error on logs as below : Exception in thread "main" ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ119007: Cannot connect to server(s). Tried with all available servers.] at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:787) at net.corda.client.rpc.internal.RPCClientProxyHandler.start(RPCClientProxyHandler.kt:191) at net.corda.client.rpc.internal.RPCClient$start$1.invoke(RPCClient.kt:123) at net.corda.client.rpc.internal.RPCClient$start$1.invoke(RPCClient.kt:86) at net.corda.core.internal.InternalUtils.logElapsedTime(InternalUtils.kt:204) at net.corda.core.internal.InternalUtils.logElapsedTime(InternalUtils.kt:196) at net.corda.client.rpc.internal.RP...