Posts

Showing posts from July 30, 2018

How to Display a Desirable Result of Looping Array in RecycleView

Image
Clash Royale CLAN TAG #URR8PPP How to Display a Desirable Result of Looping Array in RecycleView today I get result of two array, which is this result is undesirable. For example, I have a data like this: <string-array name="player"> <item>CR7</item> <item>Sergio Ramos</item> <item>Ozil</item> </string-array> <string-array name="posisi"> <item>Stricker</item> <item>Defender</item> <item>Winger</item> </string-array> and when I try to fetch data using looping array, the result is like this: undesirable result I wish, I can fetch the data, and display them like this: Desirable result Can you fix this problem? ModelDoa.java public class ModelDoa { public static final int DOA_PAGI = 0; public static final int DOA_SORE = 1; private String mName; private String bName; private int mType; public ModelDoa(String name, String butong, int type) { this.mName = name; this.bNam...

Amcharts: the last day of the period is not accessible for cursor

Image
Clash Royale CLAN TAG #URR8PPP Amcharts: the last day of the period is not accessible for cursor I think have some troubles understanding the use of usePeriod property in chartScrollbarSettings usePeriod chartScrollbarSettings When I specify the period I can't access the last day (or even the nearest one if there is no data for particular day) As far as I understand for the large datasets AmCharts downsample the lager daily data to weeks to speed up renedering. But the last day of the period is crucial day - and the data must be shown on the graph. AmCharts These are my settings. this.chart = window.AmCharts.makeChart("chartdiv", { "path": AmCharts_path, "type": "stock", "theme": "light", "dataSets": this.$store.getters.getPortfolio.map(function (port, idx) { return { "title": port.name, "fieldMappings": [{ "fromField...

How to return value from a Closure in Swift?

Image
Clash Royale CLAN TAG #URR8PPP How to return value from a Closure in Swift? So I am using fabric plugin/Twitter-kit to use twitter api in my application. I want to get the image URL of profile picture of a celebrity. here is my code below. func getImageURL(celebrity :String) -> String{ var imageURL = "" let client = TWTRAPIClient() let statusesShowEndpoint = userSearch let params = ["q": celebrity, "page" : "1", "count" : "1" ] var clientError : NSError? let request = client.URLRequestWithMethod("GET", URL: statusesShowEndpoint, parameters: params, error: &clientError) client.sendTwitterRequest(request) { (response, data, connectionError) -> Void in if connectionError != nil { print("Error: (connectionError)") } do { let json = try NSJSONSerialization.JSONObjectWithDat...

Python Cantera MassFlowController won't extract mass from reactor

Image
Clash Royale CLAN TAG #URR8PPP Python Cantera MassFlowController won't extract mass from reactor I am trying to build a hydrogen tank model (liquid-vapour) that includes heat addition over time through the tank walls, a venting valve that is activated at a given pressure and a constant fuel cell supply that is activated after a dormancy time. When I run the time integration, after some time (18000 sec in the code below), the MassFlowController mass flow is changed automatically, but it won't export any mass from the tank. Cantera is throwing an error shortly after that. This is a sample code: import cantera as ct """ Variables """ Tint = 20.24 #K Tamb = 293.0 #K Rho = 44.623 #kg/m3 TankVolume = 7.04 #m3 TankArea = 20.0 # m2 TankU = 0.36 Pvent = 7.0 #bar Psupply = 2.0 #bar msupply = 0.005 #kg/s DormTime = 5.0 #hrs TotTime = 10.0 #hrs """ Tank Reactor """ LH2 = ct.Hydrogen() LH2.TD = Tint, Rho LR = ct.Reactor(contents=L...

Squid not making request correctly

Image
Clash Royale CLAN TAG #URR8PPP Squid not making request correctly I'm trying to set up a Squid cache in front of a docker registry. When I try to pull through the cache it gives an error saying that it can't connect to the backend ("The following error was encountered while trying to retrieve the URL: ") meaning that its not prepending it with the backend url (seen below as ). I cant seem to figure out where im going wrong with this http_port 3128 accel defaultsite=localhost no-vhost cert=/cert.pem key=/key.pem cache_peer <registry_url> parent 443 0 no-query originserver name=myAccel acl our_sites dstdomain localhost http_access allow our_sites cache_peer_access myAccel allow our_sites cache_peer_access myAccel deny all by "not prepending the backend url" i mean its trying to request just /v2/... instead of someregistry.com/v2/... – Tom Hadlaw just now ...

how to fetch 1 row only without using loop for php oracle

Image
Clash Royale CLAN TAG #URR8PPP how to fetch 1 row only without using loop for php oracle $stid = oci_parse($conn, ' SELECT def_usr,status,subject,type,site,def_date,VER_DATE,VER_USR,closed_date,problem,hd_no,solution,attachment FROM hdr_web where hd_no=:num2'); oci_bind_by_name($stid, ":num2",$no); oci_execute($stid); $count = 0; while (($row = oci_fetch_row($stid)) != false) { $def_usr=$row[0]; $status=$row[1]; $subject=$row[2]; $type=$row[3]; $site=$row[4]; $def_date=$row[5]; $ver_date=$row[6]; $VER_USR=$row[7]; $closed_date=$row[8]; $problem=$row[9]; $hd_no=$row[10]; $soluti...

How to set Icon to the Alert Dialog Programatically in Android

Image
Clash Royale CLAN TAG #URR8PPP How to set Icon to the Alert Dialog Programatically in Android Em using these statements for creating an Alert Dialog and set icon to it, AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setIcon(this.getDrawable(R.drawable.video_downloader)); builder.setTitle("Congratulations !!!"); builder.show(); But it is crashing at setIcon, when I checked in drawable folder, the video_downloader icon is there already. AndroidRuntime: FATAL EXCEPTION: main java.lang.IllegalStateException: Could not execute method of the activity at android.view.View$1.onClick(View.java:3607) at android.view.View.performClick(View.java:4212) at android.view.View$PerformClick.run(View.java:17476) at android.os.Handler.handleCallback(Handler.java:800) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:...

what is the difference if we run qt inside docker and outside docker( without using docker)?

Image
Clash Royale CLAN TAG #URR8PPP what is the difference if we run qt inside docker and outside docker( without using docker)? I would like to know what is the difference if we run OpenGl programs using qt creator which is running inside and outside docker. 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.

Regex - replace space in string that has '.com Capital letter' with new line

Image
Clash Royale CLAN TAG #URR8PPP Regex - replace space in string that has '.com Capital letter' with new line I have a string with a space that I need to replace. The pattern is .com followed by a space and then any capital letter. An example would be: ".com T" The space between the .com and T needs to be replaced by a new line. Have you made any attempt to write such a regular expression yourself yet? Post what you've tried – CertainPerformance 12 mins ago Construct your regex here: regex101.com - make sure to switch to pythons syntax. After finishing it use re.sub from the re - module and code the python prog to do it. – Patrick Artner 9 mins ago ...

jQuery multiple click handling

Image
Clash Royale CLAN TAG #URR8PPP jQuery multiple click handling I have the code below working to handle clicking a link from a list , showing a screen, and then hiding it when the .back button is pressed. link list .back Is there a cleaner way to handle the click function for any x number of list items? x list $(".container").on("click", ".dog-btn", function() { $(".screen1").css("display","flex") }); $(".container").on("click", "#back", function() { $(".screen1").css("display","none") }); $(".container").on("click", ".cat-btn", function() { $(".screen2").css("display","flex") }); $(".container").on("click", "#back", function() { $(".screen2").css("display","none") }); $(".container").on("click", ".bird-btn", f...

Service Reference error upon creation

Image
Clash Royale CLAN TAG #URR8PPP Service Reference error upon creation I'm currently having an issue with adding an OData service in a C# project. The service looks like this. My step by step process looks like this: STEP 1: Entering the OData URL STEP 2: After hitting OK, the following error pops up. STEP 3: Trying to update the service ----> Which results in following error. I can't seem to figure out what causes these issues. If anyone has any suggestions, please let me know. It would be greatly appreciated! 1 Answer 1 Instead of using the service reference with UWP. I used Ajax calls to get the data. Some of them weren't allowed in a Unity build. This is why I used tags to exclude scripts like this: #if (UNITY_EDITOR) ... your class/code ... #endif More information about this can be found by following this url. https://support.unity3d.com/hc/en-us/articles/208456906-Excluding-Script...

Find & Replace functionality automatically formats cells to dates

Image
Clash Royale CLAN TAG #URR8PPP Find & Replace functionality automatically formats cells to dates Oftentimes when converting PDFs to excel documents, some values are distorted and inaccurate. Precisely, some cells within my "Date" Column do not contain the correct month, grammatically. For example, instead of " XX Jun ", it is " XX Iun ", where "XX" represents a day (number). XX Jun XX Iun I've resorted to use the Find & Replace functionality and it almost works perfectly, with the only caveat being that, after replacing, my cells are formatted to dates when I want them to remain as texts. What I'd therefore like resolved, if possible, is to use the Find & Replace functionality without it formatting my cells to dates after replacing, by modifying my VBA code. Sub Macro2() Dim rng As Range Set rng = Application.InputBox("Select Date Column", "Obtain Range", Type:=8) rng.Replace What:="ian", Replace...

How to getValues() with Google Script from Sheets so the date values matches

Image
Clash Royale CLAN TAG #URR8PPP How to getValues() with Google Script from Sheets so the date values matches I have a range of cells which contain dates in the following format: 7/27/2018 17:03:46 When I use: var range = spreadsheet.getRange(1, 1, 20).getValues(); Logger.log(range[1][0]); I get Sat Jul 28 02:03:46 GMT+02:00 2018 instead of 7/27/2018 17:03:46 How do I get the correct value? My Timezone is GMT +02:00 I've tried using new Date(). The link below will take you to the Spreadsheet: https://docs.google.com/spreadsheets/d/1H7MAEfr0QbFuNwA8N_bm-08f_Phs8G2NNOQDYG-IA4E/edit?usp=sharing How about using getDisplayValues() instead of getValues() like var range = spreadsheet.getRange(1, 1, 20).getDisplayValues(); ? By this, the displayed values can be retrieved. The document is here. If this was not useful for your situation, I'm sorry. – Tanaike 14 mins ago ...

Flask Rest Plus: How to change Parameter values dynamically

Image
Clash Royale CLAN TAG #URR8PPP Flask Rest Plus: How to change Parameter values dynamically I have an endpoint and it's arguments are added in api.parser() object and it's validation is happening in @api.expect decorator on the endpoint. But I have a need to change the values that I mentioned in the argument dynamically based on the change of value of another argument. I do not see the expect getting called on every load of the endpoint in the UI. Is there a way to change the values that are listed in the arguments? 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.

Examine C pointers with GDB

Image
Clash Royale CLAN TAG #URR8PPP Examine C pointers with GDB I am readying a book currently, and I am learning to examine pointers in C with GDB. In the book, when you examine the pointer, the output is as follow: (gdb) x/xw pointer 0xbffff7e0: 0x6c6c6548 (gdb) x/s pointer 0xbffff7e0: "Hello, world!n" (gdb) But when I do it myself I get the following output: (gdb) x/xw pointer 0x7ffff7de59a0 <_dl_fini>: 0xe5894855 (gdb) x/s pointer 0x7ffff7de59a0 <_dl_fini>: "UH211345AWAVAUATSH203354(L213%250177!" My question is: Why do I get such a different output. I know I am doing something wrong, but, what is it? Thanks everyone. Please add the source code. – klutt 8 hours ago why is this downvoted? it's a genuine question, sure, it's lacking the source code, but that's a minor edi...