format

Hadoop - Formatting dates when creating tables

三世轮回 提交于 2019-12-13 10:24:26
问题 How to format dates during the process of creating Hive tables? I've currently been dumping some data into a discovery environment at work and storing dates as string, because if I format them as a DATE or TIMESTAMP the values are null. Here's what the raw data looks like: 12/07/2016 05:07:28 PM My understanding is that Hive accepts dates in this format yyyy-mm-dd hh:mm:ss I can format these using a select statement: select id, receipt_dt, from_unixtime(unix_timestamp(receipt_dt ,'MM/dd/yyyy'

excel: time sequence is not unified

微笑、不失礼 提交于 2019-12-13 10:19:00
问题 dear as you can see in uploaded picture it is an excel sheet downloaded from data logger to record in wind speed every hour the problem that time sequence not change () in row 87 to 108 it is data from 12/November/2014 2:00 Am to 12/November/2014 11:pm the row 109 suppose to be 13/November/2014 12:00 AM (13/11/2014 12:00 AM )but it is change to 11/13/2014 12:00 AM so any have solution to this matter 回答1: "no the data is downloaded not imported" <--- what they mean is.. when you have the

How are doubles represented when written to text files?

拟墨画扇 提交于 2019-12-13 10:09:58
问题 When you write a number of doubles to a file, in which format are they stored? Is it in byte format or string format? E.g. given 0.00083231. Is it stored with 10 bytes, where each byte represents one digit? Or is it stored as only 8 bytes, since the size of a double is 8 bytes? Assume that the language used is C++. 回答1: If you choose to write text, e.g. with formatted output like file << x , you get text. If you choose to write bytes, e.g. with unformatted output like file.write(&x, sizeof x)

How can I format string for float number on Delphi correctly?

不想你离开。 提交于 2019-12-13 08:42:39
问题 I need to call Format function to return the following strings: 1.0 -> "1 or 1.0" 1.01 - > "1.01" 1.001 - > "1.001" 1.0000001 -> "1.0000001" It it possible? The standard format string %0:f returns only two digits after the point (for example, "1.01" ). 回答1: Use the %g general format string: {$APPTYPE CONSOLE} uses System.SysUtils; begin Writeln(Format('%g', [1.0])); Writeln(Format('%g', [1.01])); Writeln(Format('%g', [1.001])); Writeln(Format('%g', [1.0000001])); end. Output 1 1.01 1.001 1

Python - Write matrix to txt file, keep formatting

限于喜欢 提交于 2019-12-13 08:17:45
问题 I am struggeling in writing the output of my code to a txt file while keeping the format. Here is the code: import os # Compute matrix titles = ['Filename', 'Date'] matrix = [titles] for directory, __, files in os.walk('MY_DIRECTORY'): # replace with actual directory path for filename in files: with open(os.path.join(directory, filename)) as f: name, date = f.readline().strip().split() print(name) row = [name, date.split('.')[-1]] for line in f: header, value = line.strip().split(':') if len

Conditional formatting from another cell

冷暖自知 提交于 2019-12-13 08:04:01
问题 I would like to know how to conditionally control formats as below: Cell "A" can have several different inputs. Depending on what, it gets colored formatted. Cell "B" can have a value or not. If it doesn't have it it should stay unformatted. If it has a value it should have the same color format as cell "A". If cell "A" changes it should change the color format in cell "B" also, without changing the value in cell "B". Can someone help me? 回答1: I'm not entirely sure I understand your question

Does WebGL support color formats with more than 32bit?

我的未来我决定 提交于 2019-12-13 07:35:47
问题 I can't seem to find any texture format with more than 32 bit (GL.RGBA). Is this not supported by WebGL ? 回答1: By 32bit you mean where each element is 32bit itself or each element is 8bits and in sum they are 32 bits (8 bits of red, 8 bits of green, 8 bits of blue, 8 bits of alpha)? In any case there are extensions for 32bit float formats in WebGL so 32bits of red, 32bits of green, 32bits of blue, 32bits of alpha which is 128bit texture format. Those extensions are OES_texture_float. Let's

How do I check if the uploaded file has the right format? [duplicate]

情到浓时终转凉″ 提交于 2019-12-13 07:21:13
问题 This question already has answers here : Determine if uploaded file is image (any format) on MVC (10 answers) Closed 3 years ago . I work with c# and asp.net I created a webpage with a web form where you enter your information in order to submit it. There is also a file upload on my page: <asp:FileUpload ID="FileUploadPassfoto" runat="server"/> In my c# code behind i coded a IF-Loop which checks if something got uploaded. Like this: if (FileUploadPassfoto.HasFile == true) { HttpPostedFile

AttributeError: 'str' object has no attribute 'toInteger'

徘徊边缘 提交于 2019-12-13 07:09:13
问题 I'm writing a code using python to generate a point shapefile within ArcMAP. I have a 1000 random possibilities (in FileA), and I need to try all of them. The FileA is the index of the position of FileB. In addition, for each sequence generated I'm looking at the evolution of the area of the Voronoi polygon from 3 points to 50 points in each sequence that contains a total of 50 points. When I run the code, I have this message which confuse me: tempXYFile.writerow('{0},{1}'.format(coordinates

Assistance with classes in this python program?

放肆的年华 提交于 2019-12-13 07:04:48
问题 i have a program like this: To reserve hotel room according to user requirements. class Customer: def __init__(self,customer_id,customer_fname,customer_lname,customer_address,customer_contactno,customer_noofdays): self.customer_id=customer_id self.customer_fname=customer_fname self.customer_lname=customer_lname self.customer_address=customer_address self.customer_contactno=customer_contactno self.cost=0 self.noofdays=customer_noofdays self.reservation_id=[] self.customer_record={'c_name':self