Align buttons so that only 3 buttons are in a row

Uncategorized
Question: I need to add 3 buttons per row. Since there are many device sizes I fear that my code will return different number of buttons per row. How can I sort this ? So what ever the device width it is, the code should always return only 3 buttons per row. The width of the button should auto-shrink based on the width to accommodate 3 buttons per row. My code, at the moment returns 3-buttons per row, but the number changes when the width of the screen changes. ... mygetButtons = () => { const buttons = []; for( let i = 0; i < 9; i++) { buttons.push( Hi ) } return buttons; } ... {this.mygetButtons ()} ... frame: { flex: 0.5, flexDirection: 'row', flexWrap: 'wrap', width: window.width…
Read More

akka remote error ! the server app in Cloud server

Uncategorized
Question: the application.conf is:MyRemoteServerSideActor { akka { actor { provider = "akka.remote.RemoteActorRefProvider" } remote { enabled-transports = ["akka.remote.netty.tcp"] netty.tcp { hostname = "0.0.0.0" port = 2551 } } } } MyRemoteClientSideActor { akka { actor { provider = "akka.remote.RemoteActorRefProvider" } } } I run the serverapp in could server, it send message to client , this path val path = "akka.tcp://remote-system@139.159.212.35:2551/user/remoteActor" startup .server app show message [error]: [ERROR] [08/15/2017 14:54:08.442] [remote-system-akka.remote.default-remote-dispatcher-6] [akka.tcp://remote-system@0.0.0.0:2551/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fclient-system%40192.168.247.1%3A2552-0/endpointWriter] dropping message [class akka.actor.ActorSelectionMessage] for non-local recipient [Actor[akka.tcp://remote-system@139.159.212.35:2551/]] arriving at [akka.tcp://remote-system@139.159.212.35:2551] inbound addresses are [akka.tcp://remote-system@0.0.0.0:2551] what's wrong? Answer: Read more
Read More

Safely combine two ILists, accounting for nulls

Uncategorized
Question: I want to combine two IList's into one, either of which, or both, could be null. If both are null I want the result to be null. I have this but I want something more elegant but still easy to read. private IList CombineFilters(IList first, IList second) { IList result = null; if(first != null) if (second != null) result = first.Concat(second) as IList; else result = first; else if (second != null) result = second; return result; } Answer: I would think it’s a bit of a weird behavior if I call your CombineFilters with two lists (one possibly null) and get back a list which is not a copy. That would result in the following behavior:List filters1 = new List() { new Filter() }; List filters2 =…
Read More

dspace create-administrator fails

Uncategorized
Question: I am working on installing the dspace 6.1 src release. I am on Suse 12.2. I have followed the installation instructions carefully, followed the ideas in this post, and cleaned-reinstalled-retried the create-administrator script and the user script numerous times yesterday and today. I always get the same error:dspace@mycomputer:~/dspace_install> bin/dspace create-administrator Exception: The schema validator returned: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor] org.dspace.core.exception.DatabaseSchemaValidationException: The schema validator returned: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor] at org.dspace.core.Context.init(Context.java:170) at org.dspace.core.Context.(Context.java:126) at org.dspace.administer.CreateAdministrator. (CreateAdministrator.java:101) at (org.dspace.administer.CreateAdministrator.main(CreateAdministrator.java:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81) I have not found this error anywhere online. The closest is that posting from 2015 above. My database did not have default entries in the epersongroup table, so I added the entries suggested the post…
Read More

Dijkstra’s Algorithm With Negative Weights (But No Negative Cycles)

algorithm
Question: I believe that the implementation of Dijkstra's Algorithm below works for all graphs with negative weights but no cycles with a negative sum. However, I have seen many people say that Dijkstra's doesn't work for graphs with negative weights, so I am believing that either the algorithm is wrong or the execution time is far slower than Dijkstra's Algorithm. I was just wondering if someone could please help me with this code? Thank you very much for all your help! (Edit: This question is different from others since I am also wondering if the execution time of this algorithm is far longer than Dijkstra's Algorithm since nodes may be visited multiple times) #include using namespace std; vector G[N]; int cost[N]; int main() { queue q; q.push(0); cost[0] = 0;…
Read More

Modeling a Lamp Heat source to heat up a specimen

Uncategorized
Question: I am trying to model two bodies in comsol, one is the heat source and the other body represents a specimen. The heat source is going to heat up the specimen. The model is explained in the attached image file. I am using Heat Transfer in solid module. I have two Questions: 1) As I am transferring heat from one body to another, so I have to take into account surface to surface radiation but I tried different options and am unable to heat up the top surface of the specimen. And how I have to define in Comsol that in the surrounding we have air. 2) Once I am able to heat up the specimen top surface using the heat source, my next step is to move the…
Read More

How to host Android app on cloud?

Uncategorized
Question: I am a newbie and have no experience with hosting apps on cloud. Therefore I need your help to host my app on cloud. I have an Android app which uses a database (PostgreSQL). The app will be used simultaneously by 1,000,000 (1 million) users. I want my app to be shown on Google Playstore so that users can see and download my app. I want to know the followings:Which cloud should I use to host my app? AWS, Google Cloud etc? How to setup and configure the cloud account, database, security, etc. Within the cloud solution what all components/services should I keep track of? How to scale cloud resources based on number of requests. Can someone provide me with a step by step guide of how to go…
Read More