search for: format_str

Displaying 20 results from an estimated 27 matches for "format_str".

Did you mean: format_sln
2016 Oct 12
15
RFC: General purpose type-safe formatting library
...been working on a library that will solve all of these problems and more. The high level design of my library is borrowed heavily from C#. But if you're not familiar with C#, I believe boost has something similar in spirit. The best way to show it off is with some examples: 1. os << format_string("Test"); // writes "test" 2. os << format_string("{0}", 7); // writes "7" Immediately we can see one big difference between this and llvm::format() / printf. You don't have to specify the type. If you pass in an int, it formats it as an int...
2016 Oct 12
2
RFC: General purpose type-safe formatting library
>> 1. os << format_string("Test"); // writes "test" >> 2. os << format_string("{0}", 7); // writes "7" > > > The "<< format_string(..." is ... really verbose for me. It also makes me > strongly feel like this produces a string rather than...
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...not sure that would work well. The implementation relies on being able > to index into the parameter pack. How would you do that if each parameter > is streamed in? > > "{0} {1}"_fs(1, 2) > > Could perhaps work, but it looks a little strange to me. > > Fwiw i agree format_string is long. Ideally it would be called format, but > that's taken. > > Another option is os.format("{0}", 7), and have format_string("{0}", 7) > return a std::string. > On Wed, Oct 12, 2016 at 6:43 AM Aaron Ballman <aaron at aaronballman.com> > wrote:...
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...as mentioning that we should do it :) > > > > The high level design of my library is borrowed heavily from C#. But if > you're not familiar with C#, I believe boost has something similar in > spirit. The best way to show it off is with some examples: > > 1. os << format_string("Test"); // writes "test" > 2. os << format_string("{0}", 7); // writes "7" > > Immediately we can see one big difference between this and llvm::format() > / printf. You don't have to specify the type. If you pass in an int, it &...
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...not sure that would work well. The implementation relies on being able > to index into the parameter pack. How would you do that if each parameter > is streamed in? > > "{0} {1}"_fs(1, 2) > > Could perhaps work, but it looks a little strange to me. > > Fwiw i agree format_string is long. Ideally it would be called format, but > that's taken. > > Another option is os.format("{0}", 7), and have format_string("{0}", 7) > return a std::string. > On Wed, Oct 12, 2016 at 6:43 AM Aaron Ballman <aaron at aaronballman.com> > wrote:...
2016 Oct 12
3
RFC: General purpose type-safe formatting library
...not sure that would work well. The implementation relies on being able > to index into the parameter pack. How would you do that if each parameter > is streamed in? > > "{0} {1}"_fs(1, 2) > > Could perhaps work, but it looks a little strange to me. > > Fwiw i agree format_string is long. Ideally it would be called format, but > that's taken. > > Another option is os.format("{0}", 7), and have format_string("{0}", 7) > return a std::string. > On Wed, Oct 12, 2016 at 6:43 AM Aaron Ballman <aaron at aaronballman.com> > wrote:...
2016 Nov 01
1
RFC: General purpose type-safe formatting library
...ly* prefer that this is accomplished with "normal" C++ > syntax, and that compile time checking is done with constexpr when > available. I think that will give the overwhelming majority of the benefit > with dramatically lower cost. > +1, the UDL seems a bit too automagical. `format_string("{0}", 1)` is not that much longer than `"{0}"_fmt.string(1)`, but significantly less magical. Simple example: what should I type into a search engine to find the LLVM doxygen for the UDL? I know to search "llvm format_string" for the format string, but just from l...
2016 Nov 02
4
RFC: General purpose type-safe formatting library
* UDL Syntax is removed in the latest version of the patch <https://reviews.llvm.org/D25587>. * Name changed to `formatv` since `format_string` is too much to type. * Added conversion operators for `std::string` and `llvm::SmallString`. I had some feedback offline (not on this thread, unfortunately) that it might be worth using a printf style syntax instead of this Python-esque syntax. FTR, I actually somewhat object to this, for a c...
2016 Oct 12
5
RFC: General purpose type-safe formatting library
...not sure that would work well. The implementation relies on being able > to index into the parameter pack. How would you do that if each parameter > is streamed in? > > "{0} {1}"_fs(1, 2) > > Could perhaps work, but it looks a little strange to me. > > Fwiw i agree format_string is long. Ideally it would be called format, but > that's taken. > > Another option is os.format("{0}", 7), and have format_string("{0}", 7) > return a std::string. > On Wed, Oct 12, 2016 at 6:43 AM Aaron Ballman <aaron at aaronballman.com> > wrote:...
2006 Jan 05
2
how to use a helper which is not inside app/helpers/
Hi, I wish to know it is possible to use a helper which is not inside the folder ''app/helpers'', if it is possbile, what should I do? Thanks you very much!!!! Saiho __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com
2016 Nov 01
4
RFC: General purpose type-safe formatting library
On Mon, Oct 31, 2016 at 3:46 PM Zachary Turner via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Hi all, > > Tentatively final version is up here: https://reviews.llvm.org/D25587 > > It has a verbal LGTM, but I plan to wait a bit longer just in case anyone > has some additional thoughts. It's a large patch, but if you're > interested, one way you can help
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...g model. It's a wrapper around snprintf, so you get what snprintf gives you. You can go *around* llvm::format() and overload an operator to print your std::chrono::time_point, but there's no way to integrate it into llvm::format. So with my proposed library you could write: os << format_string("Start: {0}, End: {1}, Elapsed: {2:ms}", start, end, start-end); Or you could write: os << "Start: " << format_time_point(start) << ", End: " << format_time_point(end) << ", Elapsed: " << std::chrono::duration_cast<...
2006 Apr 24
3
TimeStamp conversion
Hi, I''ve got a TimeStamp field in MySql and want to use the hour and minutes in the value. for example: StartTime = Schedule.find(action2.ScheduleID).DateTimeStart.to_s That returns "Mon Feb 20 08:00:00 Romance Standard Time 2006" How do I get 08:00 returned ?? Thanks ! Steven. -- Posted via http://www.ruby-forum.com/.
2003 Jul 15
2
printf and friends in R?
Hi folks Does R have anything straightforwardly resembling the commands fprintf, sprintf, printf (derived from C, and present in octave and matlab)? As in printf(format_string, ... ) where "format_string" defines the print format (including any fixed text) and "..." is a list of variables whose values are to be inserted into the line. Example: printf("Case %d#%.2f#%.2f%.4f\n", n,x1,x2,x3 ) which would output a line like Case 10#3....
2020 Apr 25
2
[PATCH 1/3] Add private key protection information extraction to ssh-keygen
....c @@ -93,6 +93,26 @@ int?? ?sshkey_private_serialize_opt(struct sshkey *key, ?static int sshkey_from_blob_internal(struct sshbuf *buf, ???? struct sshkey **keyp, int allow_cert); ? +/* Supported format types */ +const char * +sshkey_format_name(enum sshkey_private_format format) { +?? ?const char *format_str; +?? ?switch (format) { +?? ?case SSHKEY_PRIVATE_OPENSSH: +?? ??? ?format_str = "RFC4716"; +?? ??? ?break; +?? ?case SSHKEY_PRIVATE_PKCS8: +?? ??? ?format_str = "PKCS8"; +?? ??? ?break; +?? ?case SSHKEY_PRIVATE_PEM: +?? ??? ?format_str = "PEM"; +?? ??? ?break; +?? ?def...
2005 Dec 19
8
Simply Ruby question: "zerofill"
Hi there- What''s the easiest/most efficient way to perform a zerofill in Ruby? i.e. Given the value ''val'', I would like to do something like: val = 43 puts val.zerofill(8) ---> "00000043" gsub? sprintf of some sort? Jake -- Posted via http://www.ruby-forum.com/.
2016 Oct 13
2
RFC: General purpose type-safe formatting library
AFAICT this appears to be the first time you've clarified that you're talking about a situation where the compile-time checking happens using something other than format strings. In Pavel's original email, he suggested compile time checking and you mentioned that I didn't object to it. But if you go back and read my response, I said we can do the compile time checking *of the
2012 Apr 20
1
[PATCH] multiqueue: a hodge podge of things
...(void) { transport_class_unregister(&fc_transport_class); transport_class_unregister(&fc_rport_class); transport_class_unregister(&fc_host_class); transport_class_unregister(&fc_vport_class); } /* * FC Remote Port Attribute Management */ #define fc_rport_show_function(field, format_string, sz, cast) \ static ssize_t \ show_fc_rport_##field (struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ struct fc_rport *rport = transport_class_to_rport(dev); \ struct Scsi_Host *shost = rport_to_shost(rport); \ struct fc_internal *i = to_fc_...
2012 Apr 20
1
[PATCH] multiqueue: a hodge podge of things
...(void) { transport_class_unregister(&fc_transport_class); transport_class_unregister(&fc_rport_class); transport_class_unregister(&fc_host_class); transport_class_unregister(&fc_vport_class); } /* * FC Remote Port Attribute Management */ #define fc_rport_show_function(field, format_string, sz, cast) \ static ssize_t \ show_fc_rport_##field (struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ struct fc_rport *rport = transport_class_to_rport(dev); \ struct Scsi_Host *shost = rport_to_shost(rport); \ struct fc_internal *i = to_fc_...
2007 Jun 22
0
Re: Intermittent "INTERNAL ERROR: Signal 11" with 3.0.24
...2) at lib/fault.c:47 #9 0x08219b50 in sig_fault (sig=-512) at lib/fault.c:70 #10 <signal handler called> #11 0x40292d1b in strlen () from /lib/tls/libc.so.6 #12 0x40268242 in vfprintf () from /lib/tls/libc.so.6 #13 0x40285e76 in vsnprintf () from /lib/tls/libc.so.6 #14 0x08219956 in dbgtext (format_str=0x6d2e5c73 "") at lib/debug.c:1011 #15 0x0825b360 in oplock_timeout_handler (te=0x844ce10, now=0xbfffd9c0, private_data=0x84492f0) at smbd/oplock.c:351 #16 0x08242d7d in run_events () at lib/events.c:102 #17 0x080f2801 in receive_message_or_smb (buffer=0x40433008 "", buf...