Vote count: 0In Visual Studio Code I am trying to write JSX inside of a .js file, which is fine. However, when I go to save the file VSC poorly formats the code in the file since it doesn't seem to understand there is JSX inside the file...
ادامه مطلبVote count: 0I have a bunch of code doing the same thing but with just a few changes... Sounds like a great option for building a method to do the work for all of them. I need to use a class name and couldn't find anything simular enough...
ادامه مطلبVote count: 0I have a Parent window from where I am opening a Popup using window.open(). Following is the code snippet:window.callParentFunction = (data, filesArr) => { this.onReceiveMessage({ data }, filesArr); } this.postEditorWindow = window.open('some url here'); // postEditorWindow I am using later to close popup window. I want to send the array of files from popup window t...
ادامه مطلبVote count: 0I have a date variable (coming from an exteal source):var date = '28/04/2017'; var time = '19:28'; It is possible to format these variables with moment.js (or without?) to variout formats? Example: 04.28 19:28, 2017.04.28 19:28 or even Today at 19:28 (with moment().calendar();)I tried moment(date+' '+time).format('MM.DD.YYYY'); ...but I am getting "Invalid date" error....
ادامه مطلبVote count: 0 I am currently developing a webapp using docker-compose and Docker. Currently, there is a front-end Nginx reverse proxy-server in one container and a Rails app in another container. Sometimes, the Rails app needs to make changes to the Nginx configuration files. I've implemented this by mounting the configuration directory as a shared volume in both containers. However, to force Nginx to reload its configuration files after the Rails app modifies it, it needs to send a HUP signal to the Nginx process. At the moment, I am implementing this by mounting the host's /var/run/docker.sock into the Rails app container and using a gem to ask the host Docker to send the signal to the rig...
ادامه مطلبVote count: 0 How can I have in the object retued by the method "signInWithEmailAndPassword" the information for Created or Signed In (last time coected) in Firebase? asked 10 secs agoAndre Evangelista Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I would like to create a simple page that would diplay a user information For instance if I reach ../profile.xhtml?id=10 I would like to get the page of the user with id=10. Thus I would like to have an instance of this User in my profile.xhtml page. I have tried : with @ManagedBean @RequestScoped public class UserConverter implements Converter { @EJB UserDAO userDao; @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { User u = userDao.findFromId(value); retu u; } @Override public String getAsString(FacesContext context, UIComponent component, Object obj) { User u = (User) obj; retu u.getId().toString(); } I expect to have my user as...
ادامه مطلبVote count: 0 I am using jQuery $.post to post some data to an ActionResult method inside my controller. When an error is thrown in the controller, it should retu the error message within the responseText of the response but it's not working. The callback function fail seems to be triggered. Just not getting the error message retued. Not sure what I am doing wrong? This is jQuery posting data: var postData = ["1","2","3"]; $.post('/MyController/GetSomething', $.param(postData, true)) .done(function (data) { alert('Done!'); }) .fail(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); //xhr.responseText is empty }); }); Controllers public class MyController : BaseController { pu...
ادامه مطلبVote count: 0 Trying to simply generate report ready tables JFT or monthly frequency summary tables in Word-2011 from Rstudio using knit from OSX. The archives suggest various solutions, such as HTML and asis, pandoc ( How to present a nice looking frequency table from R in MS Word), etc. All fail. For instance, the sample at the link above is nicely formatted with the variable names. The variable names are lost when I run the same code and the formatting is lost when knitted to in Word. Screenshots of the two cases are attached. The tables generated from the following code look respectable in fixed font on in Rstudio or R (look at output of jft.r if run on its own) but fail when knitted fro...
ادامه مطلبVote count: 0 I'm trying to find license information to use the open source code ColorPicker in my app. However, I can't seem to find any license file for the project. Does anyone know what kind of license they use or how to find them? Thanks. https://android.googlesource.com/platform/frameworks/opt/colorpicker asked 55 secs agoJulia Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am having trouble changing the date format of date column in the dataframe i created using Xlsxwriter. The current format is 3/31/2016 12:00:00 AM, which i thought python is reading a date and adding a time to it. I would like the format to simply be dd/mm/yyyy with know time associate with it for all of column A. Here is my code: date_format= workbook.add_format({'num_format': 'mmm d yyyy'}) date_time= dt.datetime.strftime("%m/%d/%Y") worksheet.write_datetime(0,0, date_time, date_format) The error message i get is : TypeError: descriptor 'strftime' requires a 'datetime.date' object but received a 'str' asked 12 secs agospacedinosaur10 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have plotted a 3-dimension figure which is the 3-D cloud water content from a Cloud Resolving Model. I would like to save it and preserve the image information that I can rotate it along different direction after I have saved it. I know it's possible to save it as format fig in Matlab and do what I want only using Matlab to open it. Is any other format of image that can do the same thing with open Matlab? Actually I am not familiar with this part and not sure what's key word is more about this question. asked 23 secs agoJen Let's block ads! بخوانید...
ادامه مطلبVote count: 0 The question is with regard to the printk formats. The documentation that I'm reading is located here Here is an excerpt that I'm asking about: Physical addresses types phys_addr_t: %pa[p] 0x01234567 or 0x0123456789abcdef For printing a phys_addr_t type (and its derivatives, such as resource_size_t) which can vary based on build options, regardless of the width of the CPU data path. Passed by reference. What does [p] in %pa[p] stand for? What does it mean? asked 27 secs agoflashbu Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am reading an excel file using xlrd. Doing some macro replacing and then writing thru xlsxwriter. Without reading and copying formatting info the code works but when I add formatting info I get an error (at the bottom) The code snippet is below..I read a xls file, for each data row I replace token macros with the values and write back. when I try to close the output_workbook I get an error filePath = os.path.realpath(os.path.join(inputPath,filename)) input_workbook = open_workbook(filePath, formatting_info=True) input_DataSheet = input_workbook.sheet_by_index(0) data = [[input_DataSheet.cell_value(r,c) for c in range(input_DataSheet.ncols)] for r in range(input_DataSheet.nrow...
ادامه مطلبVote count: 0 I can't figure out why Django retus Exception when I try to set time format in template. This is a column in Django-tables2 table. time_arrival = tables.TemplateColumn('{{record.time_arrival|time: "H:i"}}',verbose_name=u'Čas príchodu') The time_arrival is an attribute of Reservation model which is a record in this table. When there is just {{ record.time_arrival }} it shows time in this format: 1 p.m. but I want to show 13:00 for example so I have to change the format. This exception is being raised: Exception Value: Could not parse the remainder: ': "H:i"' from 'record.time_arrival|time: "H:i"' This is a time_arrival attribute in Reservation model: time_arrival = models.TimeFi...
ادامه مطلبVote count: 0 Hi can someone please assist. I wish to modify Column A, on Sheet 3 of an Excel Work book to change the Date Format from: Sep-15 to 2016-09-15. In Excel this the format is mmm-yy I wish to change it to yyyy-mm-dd. Trying to get my head around it, I know you could use a module like pandas, or xlsxwriter but the example are not making sense. Thanks asked 39 secs agoGavin Jones Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Good Moing Together, I´m dveloping a Quality Management software to show Errors of a Provisioning tool. therfore I read all errors from an XML and group them but there are errors like: "Forcedtime 1.08.2016 17:51:00 is in the past" is it possible to find Date-Values like this in a string and delete them ? I cant work witch a hardcoded replace cause there are many different values for the Date Time... Thanks for helping me asked 33 secs agoJonas Bon Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I'm making a space game, and to pitch a spaceship, you have to click on a UI 'dial' (circle) to set the desired 'pitch' angle (IE you click ~45degrees above the x axis on a circle to pitch upwards by 45 degrees etc) The same for rotating left and right, and rolling left and right. Rotating and rolling both work fine as intended. However, when I attempt to pitch (all using the same mathematics/code) it works fine for the first +89 and the first -89 degrees (89 degrees up and 89 degrees down), but after that, it seems to "lock" at +/-90 degrees. It works by deccrementing the .x value of a vector3 variable each frame. It appears (from what I can tell) that when the angle reaches +...
ادامه مطلبVote count: 0 I am having some problems writing to a text using the correct format. I am pulling some windows event logs and saving the output to a text file. When I issue the following 2 commands $event = get-winevent -filterhashtable @{logname='ForwardedEvents'; id=4688} $event | format-list >> C:scriptsfile01.txt I get something like this saved to the text file with a bunch of white space and the line broken up because it is too long: New Process Name: C:WindowsSystem32SearchFilterHost.exe Is there anyway to make the output look like this instead: New Process Name: C:WindowsSystem32SearchFilterHost.exe thanks asked 31 secs agoChris Topher Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am exporting a large DataTable to an Excel sheet (.xls) format. I call stored procedure here, which retus the DataTable. The stored procedure used to retu 7,50,000 rows with 93 columns. In back end, if I pass the parameters for the stored procedure, it takes 8 mins to complete the process, since it is a long process. But when I call the procedure from the front end, while assigning the records to the DataTable, "System Out Of Memory" exception occurring. So When I google it, I came to know it is because the size exceeds the server RAM size, so it throws this exception. What is the alteate way for this? Anyone suggest me. Below is my code, C#: DataTable dt = BindDatatable(); R...
ادامه مطلب