Brute force: value = "00:15:47" # taken from csv if value < "00:16:00": # handle smaller values else: # handle bigger values ...
You can extend, you don't need to iterate over payload: final_payload.extend(payload) Not sure you want final_payload.append(len(payload)) either....
c#,asp.net-mvc,exception,format
this format works: "{0:hh:mm:ss}" https://msdn.microsoft.com/en-us/library/ee372287%28v=vs.110%29.aspx public class Test { [Display(Name = "Time")] [Required(ErrorMessage = "Is required field. Format hh:mm (24 hour time)")] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = @"{0:hh\:mm\:ss}")] public Nullable<System.TimeSpan> EventPerformance_Time { get; set; } } <div> @Html.LabelFor(m => m.EventPerformance_Time) <div> @Html.EditorFor(m => m.EventPerformance_Time) </div> ...
sql-server,format,check-constraint
No it is because you missed full_name in your insert statement: insert into HLV values ('HLV0001',GETDATE(), 'michael jordan' ,10,5,6) ...
Use a calculated property. get-psdrive -psprovider FileSystem | select-object Name,@{Name="Used" Expression={$_.Used/1GB}} See help for Select-Object....
ruby-on-rails,json,postgresql,heroku,format
I just used this and it went just fine def index render json: @employees = Employee.all end providing that gem 'jbuilder', '~> 2.0' is in the gemfile...
Here is an implementation that works: to.week <- function(x) as.integer(format(x, "%W")) The reason strtoi fails is by default it tries to interpret numbers as if they were octal when they are preceeded by a "0". Since "%W" returns "08", and 8 doesn't exist in octal, you get the NA. From...
If you're outputting it in a browser, yeah that would be likely the case. If you want the formatting following inside the browser showing it, you'll need to add a <pre> pre format tag: echo '<pre>'; echo fread($myfile,filesize("baliwag_04162015.txt")); echo '</pre>'; Hint: You can also check out the view source and...
java,string,url,format,coordinates
In your getCoordsLists() method you are joining the collectors with ", " thats why, after building the url it is adding spaces after every coordinate. so just replace the ", " with "," in the following line: String list = "( " + alternative.coords.stream().map(item -> String.format("%.4f , %.4f", item.x, item.y))...
sql,sql-server,date,casting,format
If you cannot implement all the of good advice in the comments, you can get around this using ISDATE to test if a string can be cast as a date. EDIT: Just noticed how you are storing your date. Before using is date, execute this line: SET DATEFORMAT DMY; select...
We could create a grouping variable ('indx'), split the 'V1' column using the grouping index after removing the parentheses part in the beginning as well as the quotes within the string ". Assuming that we need the first column as the numeric element, and the second column as the non-numeric...
You are missing column name while selecting data from Data Table. You can either use column name or column index. int Credits = Convert.ToInt32(dt.Rows[0]["columnname"].ToString()); Please make sure that value of that column value should not be null or empty.If thats the case you have to check that before assigning to...
python,variables,python-3.x,printing,format
weight = "%.2f"%(mass * conversion_const) print('The mass of the load is %s Newtons, which is too heavy'%(weight)) print('The mass of the load is %s Newtons, which is too light'%(weight)) print('The mass of the load is %s Newtons, which is just right'%(weight)) print('The mass of the load is %s Newtons, which...
You should try with String.PadLeft(): using System; class Program { static void Main() { string s = "cat".PadRight(10); string s2 = "poodle".PadRight(10); Console.Write(s); Console.WriteLine("feline"); Console.Write(s2); Console.WriteLine("canine"); } } which will output: cat feline poodle canine ...
The format argument you give should reflect the format that the data is currently in, not the format that you want to convert it to, so you would have to set format = "%Y-%m-%d". Read the documentation on strptime again and it should make sense.
You could try this: '$' || Cast((select avg(retail) from cars where brand = 'FORD' or brand = 'TOYOTA') as decimal(4,2)) as AVG_BRAND_PRICE_01 If you want more than $XX.XX e.g $XXXXXXX.XX then you will need to set the decimal higher e.g. decimal(9,2) Example SQL Fiddle: http://www.sqlfiddle.com/#!4/9f684/2/0...
replace dtTime.ToShortTimeString(); with dtTime.ToString("hh:mm tt"); ...
Try this: date_format(str_to_date(datecolumn, '%Y%m%d'),'%Y/%m/%d') ...
java,methods,arraylist,static,format
The <> syntax is called generics - it allows you to limit what type of elements a collection holds, and refer to them by this type. It's not required, it's just more convenient. For instance, you could write the second method without any generics specified, but you'd have to handle...
arrays,perl,printing,count,format
You probably have a header line in your input file that contains gender as a column title and that is read and counted once. Skip the first line by reading a single line from the filehandle into void. <>; To insert a space between every pair (but not after the...
You can get the currency symbol by using the .Text property rather than the .Value property: Sub MoneyCheck() Dim st As String st = ActiveCell.Text ch = Left(st, 1) If ch = "$" Then MsgBox "Dollars" ElseIf ch = "€" Then MsgBox "Not Dollars" End If End Sub ...
ruby-on-rails,ruby,json,format
What you will want to do is name the entire object you wish to receive in return. Square brackets indicate an array, but JSON always returns a HASH (curly braces)... the trick is that this hash may CONTAIN an array. So instead of: render :json=> [{:status=>'Failure',:message=>'Invalid Credentials'}], :status=>422 Do this:...
java,format,return,duplicates,string.format
If you store usernames using %03d, i.e. with leading zeros, you also should use this when you compare the string in your userNameList: userNameList.get(i).equals(String.format("%s%s%03d", p1, p2, p3)) ...
c#,string,visual-studio-2010,format
It depends on the font. Some fonts do not have the same width for all letters. If you try Consolas it will work fine.
You can use a function like strrep or regexprep to get rid of the colon in the string. For example: t = {'"8:59"', '"9:00"', '"9:01"', '"9:02"'}; newt = strrep(t, ':', ''); newt = strrep(newt, '"', ''); newt = strrep(newt, ''', ''); Or the slightly bizarre regexprep call: newt = regexprep(t,...
Use Calendar instead, which is not deprecated: Calendar systimeNowA = Calendar.getInstance(); int hour = systimeNowA .get(Calendar.HOUR_OF_DAY); How to get the format: SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy/MM/dd HH:mm"); String formattedOutput= dateFormat.format(systimeNowA .getTime()); ...
Change w1.Range("H" & result.Row) = w1.Range("F" & result.Row) + " Available - PAM/Edit to Advise " & w1.Range("H" & result.Row) to w1.Range("H" & result.Row) = w1.Range("F" & result.Row) & " Available - PAM/Edit to Advise " & w1.Range("H" & result.Row) & " " & format(now, "DD/MM") This will add a...
osx,format,osx-mavericks,intel
Firstly write this command in the terminal: diskutil list Then it will show a list of disks. Find the one which caused the problem and use this command for it: sudo diskutil unmountDisk /dev/disk4 Now it should be erased successfully if you get back to the Disk Utilities program....
java,date,format,runtime-error,simpledateformat
I think you will find that in Italian, May is "Maggio". Note that it says "offset 3" in the exception, which is the fourth character (we are counting from zero). That is the month string. Also, you have "dd" as the year format instead of "yyyy"....
The issue lies in the fact that you're printing a list. You want to be printing elements of the list. So instead of print(s[2:16]) you can do: for i in range(2:17): print(s[i]) Because the sonnets seem to be evenly spaced I would also recommend removing the ifs and making a...
c#,asp.net-mvc-5,format,cultureinfo,bootstrap-datetimepicker
The Bootstrap datetimepicker internally uses Moment.js for formatting, and Moment's formatting codes differ to .NET's. For example, .NET uses dd for day of month with leading digit (01...31), but Moment uses DD for the same thing. So the code you posted above will not work as intended. You will need...
The scanf family of functions are good for simple parsing, but not for more complicated things like you seem to do. You could probably solve it by using e.g. strstr to find the comment starter "//", terminate the string there, and then remove trailing space....
Use array_values, it keeps the order (first index is 0): $bytes = fread($handle,"32"); $un = unpack("La/fb/fc/fd/fe/ff/fg/fh",$bytes); print_r(array_values($un)); Edit (if you want first index 1): $bytes = fread($handle,"32"); $un = unpack("La/fb/fc/fd/fe/ff/fg/fh",$bytes); array_unshift($un, NULL); $array = array_values($un); unset($array[0]); print_r($array); ...
c++,format,long-integer,c-strings
If this is MFC, it should be like this: CString cstr; cstr.Format("SELECT 123=%ld, 456=%ld AND type = '%s' ", 123, 456, "'type'"); It's like printf. ...
It is cause by default, WPF uses en-US as the culture, regardless of the system settings. From two SO answers: first and second. And this is the code to fix it: FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name))); In the answers above is CultureInfo.CurrentCulture.IetfLanguageTag recommended, but this is deprecated as for today and CultureInfo.CurrentCulture.Name...
The best way to calculate age is to use the SAS built-in function yrdif(). data dat2; set dat1; curage = yrdif(birth_date, today(), 'AGE'); run; The function today() returns today's date. If you want the age as of a certain date, e.g. 2011-01-01 like in your example, you can replace today()...
Change the h to a big H, since the small one is 12-hours format and the big one is 24-hours format. You can see all formats in the manual. And a quote from there: h 12-hour format of an hour with leading zeros 01 through 12 H 24-hour format of...
c#,.net,format,percentage,string.format
Ok thanks, so that's not possible with string.Format() And what do you think of this ? bool hasDecimal = !percentage.Value.ToString("P1", CultureInfo.InvariantCulture).EndsWith(".0 %"); string percentageMask = hasDecimal ? "{0:P1}" : "{0:P0}"; string percentageValue = string.Format(CultureInfo.CurrentCulture, percentageMask, percentage); ...
This works... function humanDateRanges($start, $end){ $startTime=strtotime($start); $endTime=strtotime($end); if(date('Y',$startTime)!=date('Y',$endTime)){ echo date('F j, Y',$startTime) . " to " . date('F j, Y',$endTime); }else{ if((date('j',$startTime)==1)&&(date('j',$endTime)==date('t',$endTime))){ echo date('F',$startTime) . " to " . date('F, Y',$endTime); }else{ if(date('m',$startTime)!=date('m',$endTime)){ echo date('F j',$startTime) . " to " . date('F j, Y',$endTime); }else{ echo date('F j',$startTime) . "...
The solution is pretty simple, I used get_absolute_urlinstead of get_absolute_url(). Sorry to bother you.
from this comment on the question: i want all the names to be in a column of width 20, and all the fnames to be on the very left of that column of width 20, all the ids to be in a column of width 10, with all the ids...
python,django,format,datefield
In settings.py set DATE_INPUT_FORMATS as below: DATE_INPUT_FORMATS = ('%d-%m-%Y') And in your form you could do something like below: class ClientDetailsForm(ModelForm): date_of_birth = DateField(input_formats=settings.DATE_INPUT_FORMATS) class Meta: model = ModelA ...
python,list,dictionary,printing,format
First, you're missing a ' in the addressBook literal after 'James Roberts. Second, the issue was that you were doing addressBook[i][key] instead of i[key]. i already refers to a dictionary contained in addressBook, so your code was trying to use a list's element as an index to itself. def listAll(addressBook,...
javascript,jquery,numbers,format
Looking through the docs, .number(true, ...) is described as such the 'true' signals we should read and replace the text It looks like the first parameter of number() can also be a number itself. So when evaluating the number of <span format='float'>-50</span>, let's just try to pass the elements own...
Simple: > "10 Jan 2015".split(/\b/g) < ["10", " ", "Jan", " ", "2015"] This will split on a word boundary....
java,swing,jtable,format,number-formatting
You need a custom TableCellRenderer which can format the value the way you need it. See Using Custom Renderers for more details import java.awt.BorderLayout; import java.awt.Component; import java.awt.EventQueue; import java.text.NumberFormat; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.table.DefaultTableCellRenderer; import...
There are two informats that can read the text "06/25/2015 03:02:01" and convert it to correct SAS datetime value: ANYDTDTM and MDYAMPM
You can set custom format for different languages. In settings: FORMAT_MODULE_PATH = [ 'mysite.formats', 'some_app.formats', ] Then create the files like this: mysite/ formats/ __init__.py en/ __init__.py formats.py See complete ref here: https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#creating-custom-format-files Then in formats.py, you set it as you want. For english: import datetime DATETIME_FORMAT = 'm/d/Y h:i'...
You try something simple like this Option Explicit Sub DateFormat() Dim rng As Range Dim rngArea As Range '// set your range Set rng = Range("I1:I10, K1:K10, Q1:Q10, R1:R10") For Each rngArea In rng.Areas With rngArea .NumberFormat = "MM/DD/YYYY" End With Next rngArea End Sub Example 2 Sub DateFormat() '//...
Try data$zip_code <- sub('-.*', '', data$zip_code) data$zip_code #[1] "40965" "33411" "40701" ...
This should work for you: Here I just converted the first date into a DateTime object and the second date I converted into a DateInterval object, which I then can add() to the first date. <?php $var1 = "12:23:01"; $var2 = "05:22:45"; $date = new DateTime($var1); list($hours, $minutes, $seconds) =...
Nothing Special about this previously i was using this which convert the locale date into a string. document.getElementById(lblClock).innerHTML = nd.toLocaleString(); Just give your specific format in which you want to see your date just like this. document.getElementById(lblClock).innerHTML = nd.format('dddd,MMM dd,yyyy,HH:mm:ss'); It will work on any browser or any version....
Here is a proof of concept using 2 rather different data frames: DF1 <- data.frame(x = rnorm(10), person = rep(LETTERS[1:2], 5)) DF2 <- data.frame(y = 1:10L, result = rep(LETTERS[3:4], 5), alt = rep(letters[3:4], 5)) write.table(DF1, file = "example.csv", sep = ",") write.table(DF2, file = "example.csv", sep = ",", append =...
Yes. You could do String s = String.format("We can just go out at %d pm and go to %s.", 5, "Bob's Burgers"); ...
something like: let unformattedDateString = "Mon, 27 Apr 2015 20:00:00 +0000" let dateFormatter = NSDateFormatter() // input format dateFormatter.dateFormat = "E, dd MMM yyyy HH:mm:ss Z" // create NSDate from String let date = dateFormatter.dateFromString(unformattedDateString)! // output format dateFormatter.dateFormat = "E, dd MMM" // create String from NSDate let formattedDateString...
c#,radio-button,format,converter
If you are using Winforms or ASP then you need to do String rad1 = radioButton1.Text; If you are using WPF then you need to do String rad1 = Convert.ToString(radioButton1.Content); ...
java,string,format,output,inline-if
Thanks for your input. I managed to solve my problem this way. package vaja13; import java.util.*; class Vaja13 { public static void main(String[] args) { System.out.print("Vnesi besedilo: "); Scanner sc = new Scanner(System.in); String besedilo = sc.nextLine(); char [] tabela = besedilo.toCharArray(); int crke = 0, stevke = 0, presledki...
c++,variables,input,format,tab-delimited
You've solved the issue with spaces in the fields in an elegant manner. Unfortunately, operator>> will skip consecutive tabs, as if they were one single separator. So, good bye the empty fields ? One easy way to do it is to use getline() to read individual string fields: getline (ss,...
javascript,jquery,date,datetime,format
Please check the below solutions: http://jsfiddle.net/ub942s6y/14/ You need to change data.addColumn('datetime', 'Date'); to 'string' as we are changing time It will work fine. :) ...
Basically, you need a different strategy (code) for each file format. A file with extension .txt usually contains ASCII data and is simple to read. A file with extension .doc contains binary data for MS Word and is virtually impossible to read with something other than MS Word. All other...
javascript,node.js,path,format
var output = js.map(function(i){return i + " => " + i.replace(/\\/g, '/').replace(/^dist\//,'');}); ...
I was able to programmatically access the top guide by following this answer. I was using XIBs for my custom class and thus could not access the topLayoutGuide through the graphical interface builder as seen below. Instead topLayoutGuide can be accessed through [self topLayoutGuide], where self is the UIViewController. Documentation...
Use String Sub dural() Dim lastdaylastmonth As String lastdaylastmonth = Format(DateSerial(Year(Date), Month(Date), 0), "dd/mm/yyyy") MsgBox lastdaylastmonth End Sub ...
python,sorting,pandas,format,dataframes
You will need a custom mode function because pandas.Series.mode does not work if nothing occurs at least twice; though the one below is not the most efficient one, it does the job: >>> mode = lambda ts: ts.value_counts(sort=True).index[0] >>> cols = df['X'].value_counts().index >>> df.groupby('X')[['Y', 'Z']].agg(mode).T.reindex(columns=cols) X3 X1 X2 Y Y1...
javascript,string,numbers,format,match
You need to call the method test on the regex, not match on the string. expect(reg.test(text)).toBe(true); .match() with a regular expression returns null...
excel,vba,excel-vba,outlook,format
HTML tags do work. I don't know why you say they don't. sBody = "All,<br /><br />Please Approve attached request for " & rType & ".<br /><br /><strong>Customer:</strong> " & customer & "<br />" then instead of the .Body property, use .HTMLBody .HTMLBody = sBody ...
This is because floating points don't have enough bits and hence your output data is soured. You can use a Double. import java.text.DecimalFormat; public class Solution { public static void main(String[] args) { Double f = new Double("52.2815"); DecimalFormat decfo = new DecimalFormat("#.000000"); String k = decfo.format(f); System.out.println(k); } }...
python,datetime,pandas,format,dataframes
import datetime as dt # convert strings to datetimes df['recvd_dttm'] = pd.to_datetime(df['recvd_dttm']) # get first and last datetime for final week of data range_max = df['recvd_dttm'].max() range_min = range_max - dt.timedelta(days=7) # take slice with final week of data sliced_df = df[(df['recvd_dttm'] >= range_min) & (df['recvd_dttm'] <= range_max)] ...
Try (replacing CellRow and CellColumn with the desired row and column for the cell): If Cells(CellRow,CellColumn).Value >= -1 and Cells(CellRow,CellColumn).Value <= 1 then Cells(CellRow,CellColumn).NumberFormat = "[$€-2] #,##0.000" Else Cells(CellRow,CellColumn).NumberFormat = "[$€-2] #,##0.0" End If ...
perl,file,format,alter,phylogeny
Some guidelines on your own code The problem is almost certainly that you are opening the same file $ARGV[0] twice. Presumably one should be `$ARGV[1] You must always use strict and use warnings at the top of every Perl program you write (there is very little point in declaring your...
date,datepicker,windows-phone-8.1,format
The DatePicker format is using user's preferred language and region. This control will automatically look different, for my region it's day/month/year like you wish it to be. I've tried to force the control to use other language, but it seems to be taking it directly from phone settings. Some information...
Use the MySQL format function to do this: MySQL> SELECT FORMAT(12332.2,0); 12,332 ...
This is the prefect use-case for wordwrap(), just use it like this: $code = "771731"; echo wordwrap($code, 2, "-", TRUE); output: 77-17-31 ...
ruby-on-rails-3,url,pagination,format,kaminari
Find the problem. It's actually not included in the question. $.ajax({ url: '<%= user_product_index_url %>.json', success: function(data) { // not important...... }); remove ".json" here solve the problem......
c#,datetime,format,data-type-conversion
If you assume that all the letters inserted in your format are either separators or letters that should be converted to a DatePart, you can check if after converting the date you still have non separator chars that were not converted, as follows: public static class DateTimeExtension { public static...
This question is off-topic, but IMHO Excel 2002/2003 XML Format would be the best choice in your circumstances. The reason for this is that the data in this format is typed - so you will not see numbers misinterpreted as dates, or phone numbers with leading zeros stripped. I am...
sql-server,file,csv,format,bulkinsert
Here are few things which I noticed are wrong in your code above. Id is an INT type however data in csv is A1,A2... for this column In your format file, The database column ordering starts from 2 and not from 1. You don't need a format file, you can...
This should work for you: Just replace the space and the comma in your number with str_replace() echo (float) str_replace([" ", ","], ["", "."], $str); output: 3320.17 To get your float number now in your expected format just use number_format(). $str = "3 320,17"; $floatNumber = (float)str_replace([" ", ","], ["",...
Those numbers are the CRC checksum for the previous chunk. See in the official specification: 5 Datastream structure for a general overview, and in particular 5.3 Chunk layout. A CRC is calculated for, and appended to each separate chunk: A four-byte CRC (Cyclic Redundancy Code) calculated on the preceding bytes...
Try it like this: foreach($html->find('div#resultscontainer') as $data) { $titlesAndDescriptions = array(); // for each title foreach($data->find('h3') as $key => $title) { $titlesAndDescriptions[$key] = array('title' => $title); } // for each description foreach($data->find('span.st') as $key => $desc) { $titlesAndDescriptions[$key]['description'] = $desc; } foreach ($titlesAndDescriptions as $titleAndDescription) { echo "<div class='result'>"; echo...
date,elasticsearch,format,elastic
You're almost there. You just need to specify the date format using the correct formatting pattern like this: "aggregations":{ "timestamp_max":{ "max":{ "field":"timestamp", "format" : "yyyy-MM-dd'T'HH:mm:ss.SSSZ" } } } Please note that this is only working from ES 1.5.0 onwards. See the related issue on the ES github....
Use a named style. They're on the Home tab, hiding under the colourful section where "Normal", "Bad", "Neutral" and so on can be seen. Click the drop-down belonging to this section of the ribbon. I'll assume that in this case we'll change the format named Currency down at the bottom,...
You can define your own format consisting only of the full hash, and pipe the output of git log to awk (edit: or sed, as proposed by jthill in his comment) in order to replace newlines by spaces where needed (see this): git log --pretty=tformat:"%H" --shortstat | awk 'ORS=NR%3?" ":"\n"'...
You can add spaces by making a calculation of how many spaces should be added in between station and eta : >>> line = ['8', '45', '1'] >>> station = ['station A', 'long station', 'great station'] >>> eta = ['8','10', '25'] >>> MAX = 20 >>> for i in range(3):...
Your problem comes from the vertical margin and padding rules in your css. This is a little counterintuitive but this rules, when defined with percentage, doesn't take as reference the height, but instead they take the width as reference, so all 4 margins are equal. Example: If you have: margin:...
The problem is that Process.Start does not take command line arguments in the first parameter. Use the overload that allows command line arguments. For example: Process.Start("format.com", "H:"); ...
Try this: data new; set old; /* Parse character date components */ array dt[*] month day year; do i = 1 to 3; dt[i] = input(scan(var1, i, "/"), best.); end; /* Recontruct date */ date_new = mdy(month, day, year); format date_new mmddyy10.; run; Documentation links: mdy scan SAS dates Arrays...
From the documentation (emphasis mine): The wave module provides a convenient interface to the WAV sound format. It does not support compression/decompression, but it does support mono/stereo. You will need to find a module that actually supports decompressing audio....
I use CSSComb http://csscomb.com/. This one is a npm module but there are plugins for it. Especially I use it with Sublime Text. It works with less too although there might me some edge case not (yet) properly handled. But it's good for me. You can order rules however you...
php,date,format,multilingual,jquery-validation-engine
I know that Zend has some of this logic in there zend_date (requires Zend Framework ^^), but I would just use a simple solution like this: (where you get the format from a switch statement) $date = $_POST['date']; $toConvert = DateTime::createFromFormat('d-m-Y', $date); switch($lang){ case 'de': $format = 'Y-m-d'; break; default:...
The W and A names are going to be introduced in PDF 2.0: [...]Beginning with PDF 2.0, the possible values also include A (annotations array order) and W (widget order). Annotations array order refers to the order of the annotation enumerated in the Annots entry of the Page dictionary [...]....
That is a strange way to store a time and perhaps you should think about using the number of milliseconds instead. If that is not an option, you can "dissect" the integer with let time = 15344 let minutes = time / 10000 let seconds = (time / 100) %...
The obvious approach would be to manipulate your data in a first pass, then call the chron function. You could pass every date through something like this: date = re.sub(r'^(\d+:\d+)$', r'00:\1', date) or if date.count(':') == 1: date = '00:'+date EDIT: How did I get here? I don't even know...
regex,networking,format,wpa,bssid
Its OK and more precise you can use : ([0-9A-F]{2}([:-]|$)){6} ...
android,exception,exception-handling,format
Check that the string in R.string.ad_data_similar_plural contains a valid placeholder for an integer. It should be something like "Here is my number: %d". String format specification As an aside, one-liner like these are harder to understand, and make debugging more difficult. A more readable approach would have given the erroneous...
psutil.disk_partitinos() gives you a list of partitions on your systme. Each element in that list is instance of sdiskpart which is a namedtuple with the following properties: ['count', 'device', 'fstype', 'index', 'mountpoint', 'opts'] You will have to process this list and format and display it the way you want using...