Search Results

Search found 14936 results on 598 pages for 'format conversion'.

Page 8/598 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Rails - Format number as currency format in the Getter

    - by daemonsy
    I am making a simple retail commerce solution, where there are prices in a few different models. These prices contribute to a total price. Imagine paying $0.30 more for selecting a topping for your yogurt. When I set the price field to t.decimal :price, precision:8, scale:2 The database stores 6.50 as 6.5. I know in the standard rails way, you call number_to_currency(price) to get the formatted value in the Views. I need to programmatically call the price field as well formatted string, i.e. $6.50 a few places that are not directly part of the View. Also, my needs are simple (no currency conversion etc), I prefer to have the price formatted universally in the model without repeated calling number_to_currency in views. Is there a good way I can modify my getter for price such that it always returns two decimal place with a dollar sign, i.e. $6.50 when it's called? Thanks in advance.

    Read the article

  • .NET component for conversion to PDF

    - by Anvar
    Hi, I am looking for .NET component to convert different files into PDF format. Right now I need to be able to convert programmatically doc, xls and TIFF files to PDF. But I may need to deal with more file types in near future. I looked at Aspose.Words, it works good but for doc only. Is there any component on the market that would allow me to convert in my code all three file types? I would appreciate your suggestions. Thanks, Anvar

    Read the article

  • SQL: covert backup file from copy format to insert format

    - by takeshin
    I have a PostgreSQL backup made with PHPPgadmin using Export Copy (instead Copy SQL which is actually what I need). File contains entries like this: COPY tablename(id, field) FROM stdin; ... How to convert this file to SQL format? INSERT INTO tablename... I want to use Pgadmin to to import this file using execute SQL command.

    Read the article

  • Nautilus and file command in 11.04 don't show metadata for WebM files

    - by Pili
    The file-name extension .webm is used for media files using the WebM multimedia format, which consists of the WebM container (a subset of the Matroska container) and audio and video streams with independet enconding and quality settings. Description of the issue: For files in the WebM format, the program file says that files are raw data, instead of determining and displaying the real file-format, which is WebM. Besides, Nautilus doesn't display the technical metadata of files in this format. Why is the file program not displaying the file format for WebM files?

    Read the article

  • How to convert an MKV to AVI with minimal loss

    - by OSX NINJA
    To convert an MKV to AVI, I do two things. The first thing I do is this: ffmpeg -i filename.mkv -vcodec copy -acodec copy output.avi or this: ffmpeg -i filename.mkv -sameq -acodec copy output.avi Either of these will convert the MKV to an AVI, but the problem is that the video does not play smoothly for some reason. That's fine though, because if I do one more thing it gets fixed: ffmpeg -i output.avi -vcodec mpeg4 -b 4000k -acodec mp2 -ab 320k converted.avi After I do this then the file plays without problem. I had success doing it this way for one file, but then I tried it on another file, and there is a slight, but noticeable loss in video quality. This is the output I get when doing the second step: FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers built on Dec 29 2010 18:02:10 with gcc 4.2.1 (Apple Inc. build 5664) configuration: libavutil 50.15. 1 / 50.15. 1 libavcodec 52.72. 2 / 52.72. 2 libavformat 52.64. 2 / 52.64. 2 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0.11. 0 / 0.11. 0 Seems stream 0 codec frame rate differs from container frame rate: 359.00 (359/1) -> 29.92 (359/12) Input #0, avi, from 'output.avi': Metadata: ISFT : Lavf52.64.2 Duration: 00:04:17.21, start: 0.000000, bitrate: 3074 kb/s Stream #0.0: Video: mpeg4, yuv420p, 704x480 [PAR 229:189 DAR 5038:2835], 29.92 fps, 29.92 tbr, 29.92 tbn, 359 tbc Stream #0.1: Audio: vorbis, 48000 Hz, stereo, s16 Output #0, avi, to 'converted.avi': Metadata: ISFT : Lavf52.64.2 Stream #0.0: Video: mpeg4, yuv420p, 704x480 [PAR 229:189 DAR 5038:2835], q=2-31, 4000 kb/s, 29.92 tbn, 29.92 tbc Stream #0.1: Audio: mp2, 48000 Hz, stereo, s16, 320 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 I just used arbitrarily large settings on the second step and it worked nicely before but not in this case. What settings should I use?

    Read the article

  • How can I format a USB drive as FAT from a MacBook Pro?

    - by Edward Tanguay
    I plugged in a 250GB USB hard drive into my MacBook Pro and want to format it in FAT so I can transfer files back and forth between a windows machine. (My windows7 machine only formats in exFAT which my Snow Leopard 2.6.4 doesn't support until I do the update). So I want to format it on the mac. but when I right click on the drive, it gives me the options to eject, copy, but not to format. I can go into Disk Utilities, click on Partition, but the only option is the "Mac Journaled format". How can I Format my USB drive as FAT from my MacBook Pro?

    Read the article

  • How can I format a USB drive as FAT from a MacBook Pro?

    - by Edward Tanguay
    I plugged in a 250GB USB hard drive into my MacBook Pro and want to format it in FAT so I can transfer files back and forth between a windows machine. (My windows7 machine only formats in exFAT which my Snow Leopard 2.6.4 doesn't support until I do the update). So I want to format it on the mac. but when I right click on the drive, it gives me the options to eject, copy, but not to format. I can go into Disk Utilities, click on Partition, but the only option is the "Mac Journaled format". How can I Format my USB drive as FAT from my MacBook Pro?

    Read the article

  • I need to convert a bunch of *pngs to *.mpg in linux/CENTOS. How can I do this?

    - by Manchine
    Title says it all, and I am not too familiar with LINUX, but I can get by if I get some help. I am looking for a way(s) where I can do the above, or in lieu of that, download a program that will do this for me. Very simply, I have a bunch of *.png 's that I would like to convert into a movie, (mpg, mpeg, mpeg2, whatever). I have tried googling for any such softwares but I am getting some dubious websites and even more dubious programs. Thanks in advance!

    Read the article

  • Programmtically choosing image conversion format to JPEG or PNG for Silverlight display

    - by Otaku
    I have a project where I need to convert a large number of image types to be displayable in a Silverlight app - TIFF, GIF, WMF, EMF, BMP, DIB, etc. I can do these conversions on the server before hydrating the Silverlight app. However, I'm not sure when I should choose to convert to which format, either JPG or PNG. Is there some kind of standard out there like TIFF should always be a JPEG and GIF should always be a PNG. Or, if a BMP is 24 bit, it should be converted to a JPEG - any lower and it can be a PNG. Or everything is a PNG and why? What I usually see or see in response to this type of question is "Well, if the picture is a photograph, go with JPEG" or "If it has straight lines, PNG is better." Unfortunately, I won't have the luxury of viewing any of the image files at all and would like just a standard way to do this via code, even if that is a zillion if/then statements. Are there any standards or best practices around this subject? P.S. Please don't move to close this subject - it actually has no duplicate on SO because I'm not looking for subjectivity.

    Read the article

  • Copy Excel Formatting the Easy Way with Format Painter

    - by DigitalGeekery
    The Format Painter in Excel makes it easy to copy the formatting of a cell and apply it to another. With just a few clicks you can reproduce formatting such as fonts, alignment, text size, border, and background color. On any Excel worksheet, click on the cell with the formatting you’d like to copy.  You will see dashed lines around the selected cell. Then select the Home tab and click on the Format Painter.   You’ll see your cursor now includes a paintbrush graphic. Move to the cell where you’d like to apply the formatting and click on it. Your target cell will now have the new formatting.   If you double-clicking on Format Painter you can then click on multiple individual files to which to apply the format. Or, you can click and drag across a group of cells. When you are finished applying formats, click on Format Painter again, or on the Esc key, to turn it off. The Format Painter is a very simple, but extremely useful and time saving tool when creating complex worksheets. Similar Articles Productive Geek Tips Use Conditional Formatting to Find Duplicate Data in Excel 2007Remove Text Formatting in Firefox the Easy WayMake Excel 2007 Always Save in Excel 2003 FormatUsing Conditional Cell Formatting in Excel 2007Make Word 2007 Always Save in Word 2003 Format TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 New Firefox release 3.6.3 fixes 1 Critical bug Dark Side of the Moon (8-bit) Norwegian Life If Web Browsers Were Modes of Transportation Google Translate (for animals) Roadkill’s Scan Port scans for open ports

    Read the article

  • Format of compiled directx9 shader files?

    - by JB
    Is the format of compiled pixel and vertex shader object files as produced by fxc.exe documented anywhere either officially or unofficially? I'd like to be able to read the constant name to register assignments from the shader files. I know that the effects framework in D3DX can do this, but I need to avoid using D3DX as it may not be installed on user's machines and I don't need it for anything else so I want to avoid them having to run the directx update. If the effects framework can do it, then so can I if I can find out the file format but I can' seem to find it documented anywhere.

    Read the article

  • Powershell: align right for a column value from Select-Object in Format-Table format

    - by David.Chu.ca
    I have the following array value $outData with several columns. I am not sure how I align some columns right? $outData | Select-Object ` Name ` @{Name="Freespace(byte)"; Expression={"{0:N0}" -f $_.FreeSpace}}, ' .... # other colums ` | Format-Table -AutoSize It works fine. However, when I tried to use align for the freespace column to right: @{Name="Freespace(byte)"; Expression={"{0:N0}" -f $_.FreeSpace}; align="right"}, ' I got error message "Specified method is not supported". Not sure if there is any way to align the value to right?

    Read the article

  • Ruby on Rails: Routing error

    - by JamesMcL13
    I am having trouble deleting and showing user records. Here is my routes.rb FinalApp::Application.routes.draw do resources :admin devise_for :users, :controllers => { :registrations => 'admin' } resources :projects match "search" => "projects#search", :as => :search root :to => 'projects#index' end Here is my admin controller: class AdminController < ApplicationController def index @users = User.all respond_to do |format| format.html # index.html.erb format.json { render :json => @users } end end def create @user = User.new(params[:user]) respond_to do |format| if @user.save format.html { redirect_to @user, notice: 'User was successfully created.' } format.json { render json: @user, status: :created, location: @user } else format.html { render action: "new" } format.json { render json: @user.errors, status: :unprocessable_entity } end end end # GET /users/1 # GET /users/1.json def show @user = User.find(params[:id]) @user_user_id = params[:id] respond_to do |format| format.html # show.html.erb format.json { render json: @user } end end # GET /users/new # GET /users/new.json def new @user = User.new respond_to do |format| format.html # new.html.erb format.json { render json: @user } end end # GET /users/1/edit def edit @user = User.find(params[:id]) end # POST /users # POST /users.json # PUT /users/1 # PUT /users/1.json def update @user = User.find(params[:id]) respond_to do |format| if @user.update_attributes(params[:user]) format.html { redirect_to @user, notice: 'User was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @user.errors, status: :unprocessable_entity } end end end # DELETE /users/1 # DELETE /users/1.json def destroy @user = User.find(params[:id]) @user.destroy respond_to do |format| format.html { redirect_to users_url } format.json { head :no_content } end end end Here is my view: <%= stylesheet_link_tag "admin" %> <body> <div id ="title1">Admin</div> <div class ="menu"></div> <div id ="section3"> <table id = "mytable"> <table border = "1"> <tr> <th>Username </th> <th>Email</th> <th>First Name</th> <th>Last Name</th> <th>Admin?</th> <th></th> <th></th> <th></th> </tr> <%= link_to "New User", admin_new_path %><br /> <% @users.each do |t| %> <tr> <td><%= t.username %></td> <td><%= t.email %></td> <td><%= t.firstname %></td> <td><%= t.lastname %></td> <td><%= t.admin %></td> <td><%= link_to 'Show', t %></td> <td> <%= button_to "Delete", t, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% end %> </table></br> </body> </html> I can display the User database, but when I go to delete a record. I get this error No route matches [DELETE] "/users/11". I am new to rails so please remember this when trying to help. Thanks in advance. Edit: here are my routes = admin_index GET /admin(.:format) admin#index POST /admin(.:format) admin#create new_admin GET /admin/new(.:format) admin#new edit_admin GET /admin/:id/edit(.:format) admin#edit admin GET /admin/:id(.:format) admin#show PUT /admin/:id(.:format) admin#update DELETE /admin/:id(.:format) admin#destroy new_user_session GET /users/sign_in(.:format) devise/sessions#new user_session POST /users/sign_in(.:format) devise/sessions#create destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy user_password POST /users/password(.:format) devise/passwords#create new_user_password GET /users/password/new(.:format) devise/passwords#new edit_user_password GET /users/password/edit(.:format) devise/passwords#edit PUT /users/password(.:format) devise/passwords#update cancel_user_registration GET /users/cancel(.:format) admin#cancel user_registration POST /users(.:format) admin#create new_user_registration GET /users/sign_up(.:format) admin#new edit_user_registration GET /users/edit(.:format) admin#edit PUT /users(.:format) admin#update DELETE /users(.:format) admin#destroy projects GET /projects(.:format) projects#index POST /projects(.:format) projects#create new_project GET /projects/new(.:format) projects#new edit_project GET /projects/:id/edit(.:format) projects#edit project GET /projects/:id(.:format) projects#show PUT /projects/:id(.:format) projects#update DELETE /projects/:id(.:format) projects#destroy search /search(.:format) projects#search root / projects#index

    Read the article

  • whats the format for a string of forward slash / in c#

    - by Calibre2010
    Hi, I'm using a htmlhelper where i give table data id's based on day and month values which are retrieved. The problem is the id is not recognized in the format it is. / seems to not be picked up yet when i replace '/' with '-' it works. daysRow.AppendFormat("<td id='{0}/{1}'>{0}</td>", day, d1.Month.ToString()); can anyone tell me how to format this please. '/' forward slash in c#.

    Read the article

  • format specifier for short integer

    - by cateof
    I don't use correctly the format specifiers in C. A few lines of code: int main() { char dest[]="stack"; unsigned short val = 500; char c = 'a'; char* final = (char*) malloc(strlen(dest) + 6); snprintf(final, strlen(dest)+6, "%c%c%hd%c%c%s", c, c, val, c, c, dest); printf("%s\n", final); return 0; } I want my executable to print aa500aastack and not aa500aasta Why I am loosing 2 byte? What is the correct format specifier for an unsighed short integer? thanks.

    Read the article

  • optimize a string.Format + replace.

    - by acidzombie24
    I have this function. The visual studio profile marked the line with string.Format as hot and were i spend much of my time. How can i write this loop more efficiently? public string EscapeNoPredicate(string sz) { var s = new StringBuilder(sz); s.Replace(sepStr, sepStr + sepStr); foreach (char v in IllegalChars) { string s2 = string.Format("{0}{1:X2}", seperator, (Int16)v); s.Replace(v.ToString(), s2); } return s.ToString(); }

    Read the article

  • Format MySQL code inside PHP string

    - by JohnA
    Is there any program IDE or not that can format MySQL code inside PHP string e.g. I use PHPStorm IDE and it cannot do it. It does that for PHP and MYSQL but not for MYSQL inside php string. I am ready to use new IDE because now i have to manually format hundreds of database requests that are one line and not readable. Only criteria for my choice is that ide can do that automatically. <?php ... $request1 = "select * from tbl_admin where admin_id= {$_SESSION['admin_id']} and active= 1 order By admin_id Asc"; ... ?> should become <?php ... $request1 = "SELECT * FROM tbl_admin WHERE admin_id = {$_SESSION['admin_id']} AND active = 1 ORDER BY admin_id ASC"; ... ?>

    Read the article

  • ActiveRecord date format

    - by Mongus Pong
    I've run into a spot of bother with date formats in our Rails application. I have a date field in our view which I want to be formatted as dd/mm/yy. This is how the user will expect to enter their dates, and the datepicker control uses this format. However, Active Record seems to be expecting mm/dd/yy. If I enter 01/03/2010, this gets put in as 03 January 2010. If I enter 25/03/2010, this gets put in a null. How do I get ActiveRecord to expect Her Majesties date format?

    Read the article

  • how to convert seconds to time format?

    - by Dewan159
    hi there for some reason i convert a time format like : 03:30 to seconds 3*3600 + 30*60 , now .. i wanna convert it back to it's first ( same ) format upthere ... how could that be ? My attempt : 3*3600 + 30*60 = 12600 12600 / 60 = 210 / 60 = 3.5 , floor(3.5) = 3 = hour now .. what about the minutes ?? considering the value can be like 19:00 or 02:51 ... i think you got the picture and by the way, how to convert 2:0 for example to 02:00 using RegEx ? Thanks in advance

    Read the article

  • MVC Pattern, ViewModels, Location of conversion.

    - by Pino
    I've been working with ASP.Net MVC for around a year now and have created my applications in the following way. X.Web - MVC Application Contains Controller and Views X.Lib - Contains Data Access, Repositories and Services. This allows us to drop the .Lib into any application that requires it. At the moment we are using Entity Framework, the conversion from EntityO to a more specific model is done in the controller. This set-up means if a service method returns an EntityO and then the Controller will do a conversion before the data is passed to a view. I'm interested to know if I should move the conversion to the Service so that the app doesn't have Entity Objects being passed around.

    Read the article

  • How to commit a file conversion?

    - by l0b0
    Say you've committed a file of type foo in your favorite vcs: $ vcs add data.foo $ vcs commit -m "My data" After publishing you realize there's a better data format bar. To convert you can use one of these solutions: $ vcs mv data.foo data.bar $ vcs commit -m "Preparing to use format bar" $ foo2bar --output data.bar data.bar $ vcs commit -m "Actual foo to bar conversion" or $ foo2bar --output data.foo data.foo $ vcs commit -m "Converted data to format bar" $ vcs mv data.foo data.bar $ vcs commit -m "Renamed to fit data type" or $ foo2bar --output data.bar data.foo $ vcs rm data.foo $ vcs add data.bar $ vcs commit -m "Converted data to format bar" In the first two cases the conversion is not an atomic operation and the file extension is "lying" in the first commit. In the last case the conversion will not be detected as a move operation, so as far as I can tell it'll be difficult to trace the file history across the commit. Although I'd instinctively prefer the last solution, I can't help thinking that tracing history should be given very high priority in version control. What is the best thing to do here?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >