Search Results

Search found 9132 results on 366 pages for 'convert'.

Page 1/366 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Interrupted system call during "hg convert"

    - by Aaron Digulla
    When I run "hg convert" to convert a Subversion repository to Mercurial, I get this error: fetching revision log for "/trunk" from 1538 to 0 run hg sink post-conversion action Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 46, in _runcatch return _dispatch(ui, args) File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 454, in _dispatch return runcommand(lui, repo, cmd, fullargs, ui, options, d) File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 324, in runcommand ret = _runcommand(ui, options, cmd, d) File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 505, in _runcommand return checkargs() File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 459, in checkargs return cmdfunc() File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 453, in <lambda> d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 386, in check return func(*args, **kwargs) File "/usr/lib/pymodules/python2.6/hgext/convert/__init__.py", line 229, in convert return convcmd.convert(ui, src, dest, revmapfile, **opts) File "/usr/lib/pymodules/python2.6/hgext/convert/convcmd.py", line 398, in convert c.convert(sortmode) File "/usr/lib/pymodules/python2.6/hgext/convert/convcmd.py", line 312, in convert parents = self.walktree(heads) File "/usr/lib/pymodules/python2.6/hgext/convert/convcmd.py", line 109, in walktree commit = self.cachecommit(n) File "/usr/lib/pymodules/python2.6/hgext/convert/convcmd.py", line 267, in cachecommit commit = self.source.getcommit(rev) File "/usr/lib/pymodules/python2.6/hgext/convert/subversion.py", line 433, in getcommit self._fetch_revisions(revnum, stop) File "/usr/lib/pymodules/python2.6/hgext/convert/subversion.py", line 814, in _fetch_revisions for entry in stream: File "/usr/lib/pymodules/python2.6/hgext/convert/subversion.py", line 122, in __iter__ entry = pickle.load(self._stdout) IOError: [Errno 4] Interrupted system call abort: Interrupted system call Apparently, it is possible to restart a read on EINTR but how would I do that with pickle.load()? Also I wonder where that signal comes from? I suspect it's SIGCHILD but shouldn't popen() handle that?

    Read the article

  • The Best Text to Speech (TTS) Software Programs and Online Tools

    - by Lori Kaufman
    Text to Speech (TTS) software allows you to have text read aloud to you. This is useful for struggling readers and for writers, when editing and revising their work. You can also convert eBooks to audiobooks so you can listen to them on long drives. We’ve posted some websites here where you can find some good TTS software programs and online tools that are free or at least have free versions available. 8 Deadly Commands You Should Never Run on Linux 14 Special Google Searches That Show Instant Answers How To Create a Customized Windows 7 Installation Disc With Integrated Updates

    Read the article

  • How to convert .avi video to .mp4(for Motorola Milestone, Android 2.3.4) with Avidemux

    - by kv1dr
    I open .avi video with Avidemux and I set Video format to MPEG-4 AVC(under Configure, Bitrate tab I choose "Single Pass - Bitrate (Average)" and Target bitrate to 256 kb/s, under Filters I choose MPlayer resize to 480x360 and I also add a subtitles) audio format to AAC (Faac)(Under Configure, I choose Bitrate 96) and format to MP4(like a image below). When Avidemux convert video to .mp4 format I can play the file on my copmuter, but on my phone I can't. When I want to play it on my phone with native video player, it just show the error something like "Can't play this video". So the question is how to convert .avi video to .mp4 with Avidemux(because I want to have subtitles inside movie) to be playable with android phone(Android version 2.3.4) with native player. Any help will be highly appreciated. :)

    Read the article

  • How to convert image to CMYK in GIMP?

    - by edm
    I am supposed to send some artwork to the printers tomorrow and their guidelines requires it to be CMYK. I have installed the plugin Separate+ from the 'gimp-plugin-registy' package. I have also installed some ICC colour profiles from the 'icc-profiles' package. When I try to use the Separate+ plugin all I can get it to output is an image that looks like the original but with the colours inverted. How can I convert my image to CMYK?

    Read the article

  • Method extension for safely type convert

    - by outcoldman
    Recently I read good Russian post with many interesting extensions methods after then I remembered that I too have one good extension method “Safely type convert”. Idea of this method I got at last job. We often write code like this: int intValue; if (obj == null || !int.TryParse(obj.ToString(), out intValue)) intValue = 0; This is method how to safely parse object to int. Of course will be good if we will create some unify method for safely casting. I found that better way is to create extension methods and use them then follows: int i; i = "1".To<int>(); // i == 1 i = "1a".To<int>(); // i == 0 (default value of int) i = "1a".To(10); // i == 10 (set as default value 10) i = "1".To(10); // i == 1 // ********** Nullable sample ************** int? j; j = "1".To<int?>(); // j == 1 j = "1a".To<int?>(); // j == null j = "1a".To<int?>(10); // j == 10 j = "1".To<int?>(10); // j == 1 Read more... (redirect to http://outcoldman.ru)

    Read the article

  • Convert mkv to mp4 with ffmpeg

    - by JohnS
    When I try converting mkv to mp4 using ffmpeg, the following error occurs: [ipod @ 0x16fa0a0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: -2 = -2 av_interleaved_write_frame(): Invalid argument I used this command to convert the file: ffmpeg -i input.mkv -vcodec copy -acodec copy -absf aac_adtstoasc output.m4v The input file has the following characteristics: mediainfo input.mkv General Unique ID : 200459305952356554213392832683163418790 (0x96CF0ED8DB5914CBB9E18163689280A6) Complete name : input.mkv Format : Matroska Format version : Version 2 File size : 1.46 GiB Duration : 1h 5mn Overall bit rate : 3 168 Kbps Encoded date : UTC 2010-09-26 21:44:02 Writing application : mkvmerge v2.9.5 ('Tu es le seul') built on Jun 17 2009 16:28:30 Writing library : libebml v0.7.8 + libmatroska v0.8.1 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : [email protected] Format settings, CABAC : Yes Format settings, ReFrames : 4 frames Codec ID : V_MPEG4/ISO/AVC Duration : 1h 5mn Bit rate : 2 910 Kbps Width : 1 280 pixels Height : 720 pixels Display aspect ratio : 16:9 Frame rate : 25.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.126 Stream size : 1.31 GiB (90%) Writing library : x264 core 105 r1724 b02df7b Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=18 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc=2pass / mbtree=0 / bitrate=2910 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00 Default : Yes Forced : No Audio ID : 2 Format : AC-3 Format/Info : Audio Coding 3 Mode extension : CM (complete main) Codec ID : A_AC3 Duration : 1h 5mn Bit rate mode : Constant Bit rate : 256 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Bit depth : 16 bits Compression mode : Lossy Stream size : 121 MiB (8%) Language : English Default : Yes Forced : No Being new to ffmpeg, I'm not sure what the error means or how to correct it. Thanks!

    Read the article

  • ImageMagick convert

    - by Tim
    convert is not working on the Linux server I am using $ convert exploss_stumps.jpg exploss_stumps.eps convert: missing an image filename `exploss_stumps.eps' @ convert.c/ConvertImageCommand/2838 Any idea why?

    Read the article

  • ImageMagic convert

    - by Tim
    convert is not working on the Linux server I am using $ convert exploss_stumps.jpg exploss_stumps.eps convert: missing an image filename `exploss_stumps.eps' @ convert.c/ConvertImageCommand/2838 Any idea why?

    Read the article

  • Is there now any way to convert mp3 files to m4a or aac 192kbit?

    - by piedro
    Since about two years now I am trying to find a way to convert high quality mp3 files to m4a or aac files with a fixed bitrate 192k. Please don't suggest using another format - i thought this through as far as it goes. The problem here is: ffmpeg obvioulsy can't convert to a higher bitrate than 152k. Even when it says it does so the resulting files still have 152k instead of 192k. ffmpeg also has/had a bug not writing the bitrate into the audio file tags which means when testing you have to calculate the bitrate manually by dividing the filesize by the length of the audio in seconds (resulting in 152k - see above) choosing faac as converter gets me the same results other programs don't work reliably (see this thread Howto convert audio files to *.m4a? I know that this is not an original new problem but I am wondering if there is still no way to convert with ubuntu/kubuntu 12.04 after a lot time passed and I can't find some of the bug issues mentioned in the other thread anymore. So: Is there a solution after all?

    Read the article

  • How to convert eps file to a large jpeg image

    - by Anand
    Hello, I am using Linux. I want to convert an eps file to jpeg file. I find that I can use "convert" command. However, the resulting image looks very small. I want to enlarge the jpeg file by -resize option. It seems not to work. The resulting image is a pure black one. Do anyone has the same problem? Here are more details: 1: if I use convert -scale 1000x1000 your.eps your.jpg the resulting image looks like a low quality image. The eps vector image is not scaled properly. 2: if I use convert -geometry 300% your.eps your.jpg I get a pure black image. Here is my phf file: 2shared.com/document/RXl2Be-g/askquestions.html and my eps file: 2shared.com/file/qrmwKegj/askquestions.html Thank you very much for your help!

    Read the article

  • Imagemagick convert with resample option

    - by coneybeare
    I am creating thumbnails from much larger images and have been using this command successfully for some time: convert FILE -resize "64x" -crop "64x64+0+16" +repage -strip OUTFILE I also do some other processing that is not relevant to the question. I realized that this does not adjust the resolution at all, so if I use a 300dpi image, it ends up displaying really small on some devices. I want to resample it to 72x72 so I have been trying with this command: convert FILE -resize "64x" -crop "64x64+0+16" +repage -strip -resample 72x72 OUTFILE And expected the 64x64 image at 300dpi to be resampled to a 64x64 image at 72dpi, but instead, I am getting a very funny size and density. Here is "identify" output for the original and post-processed file WITHOUT the resample: coneybeare $ convert "aa.jpg" -crop "64x64+0+16" +repage -strip "aa.png" coneybeare $ for image in `find . -type f`; do identify $image; identify -verbose $image | egrep "^ Resolution"; done ./aa.jpg JPEG 1130x1695 1130x1695+0+0 8-bit DirectClass 1.492MiB 0.000u 0:00.000 Resolution: 300x300 ./aa.png PNG 64x64 64x64+0+0 8-bit DirectClass 7.46KiB 0.000u 0:00.000 Resolution: 118.11x118.11 And here is the "identify output for the command WITH the resample: coneybeare $ convert "aa.jpg" -crop "64x64+0+16" +repage -strip -resample 72x72 "aa.png" coneybeare $ for image in `find . -type f`; do identify $image; identify -verbose $image | egrep "^ Resolution"; done ./aa.jpg JPEG 1130x1695 1130x1695+0+0 8-bit DirectClass 1.492MiB 0.000u 0:00.000 Resolution: 300x300 ./aa.png PNG 15x15 15x15+0+0 8-bit DirectClass 901b 0.000u 0:00.000 Resolution: 28.34x28.34 So, the question is: What am I doing wrong and how can I fix it so the end result is a 64x64 cropped thumbnail image at 72dpi?

    Read the article

  • Convert mht\pdf\excel and encoding

    - by CoLLiDeR
    I am looking for a .net library that can help me do one of the following: 1. Convert an MHT file to PDF 2. Convert between pdf versions 3. Change a pdf file encoding 4. Convert an MHT to an Excel file 5. Convert a MIME version of excel (an Excel file that is readable via notepad) to a binary Excel file 6. Convert between Excel version

    Read the article

  • convert multiple segments of DVD to FLV

    - by Josh
    I have a DVD of footage that I need to convert to FLV. I would rather not convert the whole disk as I only need specific segments. Is there a program that I can input start and end times and to get multiple files of these segments? Can you also advise on the best settings to use for best quality at the smallest file sizes. I'm working on a Vista 64bit machine. Thanks. Josh

    Read the article

  • Noise when I try to convert flac to mp3 using vlc

    - by Josef
    I'd like to convert my flac files to mp3s using vlc and it's Media-Convert/Save function. The destination file is written but only contains awful noise. I've tried most of the predefined profiles (mp4, wav, etc.) and all of them seem to yield the same result. What's wrong?

    Read the article

  • App to convert from ANSI to UTF8 on windows [closed]

    - by antoniocs
    Possible Duplicate: Batch-convert files for encoding or line ending under Windows Hey! I have many files that are encoded in the ANSI (iso-8859-1) format and I want to change it to utf8. I am converting one by one using notepad++ but I was wondering if there is any application that will convert them all (I have many files) in a quick and easy way. Anyone know of one app that will do this?? (free app would be great) Thanks

    Read the article

  • Monitoring SQL Server Agent job run times

    - by okeofs
    Introduction A few months back, I was asked how long a particular nightly process took to run. It was a super question and the one thing that struck me was that there were a plethora of factors affecting the processing time. This said, I developed a query to ascertain process run times, the average nightly run times and applied some KPI’s to the end query. The end goal being to enable me to quickly detect anomalies and processes that are running beyond their normal times. As many of you are aware, most of the necessary data for this type of query, lies within the MSDB database. The core portion of the query is shown below.select sj.name,sh.run_date, sh.run_duration, case when len(sh.run_duration) = 6 then convert(varchar(8),sh.run_duration) when len(sh.run_duration) = 5 then '0' + convert(varchar(8),sh.run_duration) when len(sh.run_duration) = 4 then '00' + convert(varchar(8),sh.run_duration) when len(sh.run_duration) = 3 then '000' + convert(varchar(8),sh.run_duration) when len(sh.run_duration) = 2 then '0000' + convert(varchar(8),sh.run_duration) when len(sh.run_duration) = 1 then '00000' + convert(varchar(8),sh.run_duration) end as tt from dbo.sysjobs sj with (nolock) inner join dbo.sysjobHistory sh with (nolock) on sj.job_id = sh.job_id where sj.name = 'My Agent Job' and [sh.Message] like '%The job%') Run_date and run_duration are obvious fields. The field ‘Name’ is the name of the job that we wish to follow. The only major challenge was that the format of the run duration which was not as ‘user friendly’ as I would have liked. As an example, the run duration 1 hour 10 minutes and 3 seconds would be displayed as 11003; whereas I wanted it to display this in a more user friendly manner as 01:10:03. In order to achieve this effect, we need to add leading zeros to the run_duration based upon the case logic shown above. At this point what we need to do add colons between the hours and minutes and one between the minutes and seconds. To achieve this I nested the query shown above (in purple) within a ‘super’ query. Thus the run time ([Run Time]) is constructed concatenating a series of substrings (See below in Blue). select run_date,substring(convert(varchar(20),tt),1,2) + ':' +substring(convert(varchar(20),tt),3,2) + ':' +substring(convert(varchar(20),tt),5,2) as [run_time] from (select sj.name,sh.run_date, sh.run_duration,case when len(sh.run_duration) = 6 then convert(varchar(8),sh.run_duration)when len(sh.run_duration) = 5 then '0' + convert(varchar(8),sh.run_duration)when len(sh.run_duration) = 4 then '00' + convert(varchar(8),sh.run_duration)when len(sh.run_duration) = 3 then '000' + convert(varchar(8),sh.run_duration)when len(sh.run_duration) = 2 then '0000' + convert(varchar(8),sh.run_duration)when len(sh.run_duration) = 1 then '00000' + convert(varchar(8),sh.run_duration)end as ttfrom dbo.sysjobs sj with (nolock)inner join dbo.sysjobHistory sh with (nolock) on sj.job_id = sh.job_id where sj.name = 'My Agent Job'and [sh.Message] like '%The job%') a Now that I had each nightly run time in hours, minutes and seconds (01:10:03), I decided that it would very productive to calculate a rolling run time average. To do this, I decided to do the calculations in base units of seconds. This said, I encapsulated the query shown above into a further ‘super’ query (see the code in RED below). This encapsulation is shown below. The astute reader will note that I used implied casting from integer to string, which is not the best method to use however it works. This said and if I were constructing the query again I would definitely do an explicit convert. To Recap: I now have a key field of ‘1’, each and every applicable run date and the total number of SECONDS that the process ran for each run date, all of this data within the #rawdata1 temporary table. Select 1 as keyy,run_date,(substring(b.run_time,1,2)*3600) + (substring(b.run_time,4,2)*60) + (substring(b.run_time,7,2)) as run_time_in_Seconds,run_time into #rawdata1 from ( select run_date,substring(convert(varchar(20),tt),1,2) + ':' + substring(convert(varchar(20),tt),3,2) + ':' +substring(convert(varchar(20),tt),5,2) as [run_time] from (select sj.name,sh.run_date, sh.run_duration, case when len(sh.run_duration) = 6 then convert(varchar(8),sh.run_duration)when len(sh.run_duration) = 5 then '0' + convert(varchar(8),sh.run_duration)when len(sh.run_duration) = 4 then '00' + convert(varchar(8),sh.run_duration)when len(sh.run_duration)    = 3 then '000' + convert(varchar(8),sh.run_duration)when len(sh.run_duration)    = 2 then '0000' + convert(varchar(8),sh.run_duration)when len(sh.run_duration) = 1 then '00000' + convert(varchar(8),sh.run_duration)end as ttfrom dbo.sysjobs sj with (nolock)inner join dbo.sysjobHistory sh with (nolock)on sj.job_id = sh.job_id where sj.name = 'My Agent Job'and [sh.Message] like '%The job%') a )b   Calculating the average run time We now select each run time in seconds from #rawdata1 and place the values into another temporary table called #rawdata2. Once again we create a ‘key’, a hardwired ‘1’. select 1 as Keyy, run_time_in_Seconds into #rawdata2 from #rawdata1The purpose of doing so is to make the average time AVG() available to the query immediately without having to do adverse grouping. Applying KPI Logic At this point, we shall apply some logic to determine whether processing times are within the norms. We do this by applying colour names. Obviously, this example is a super one for SSRS and traffic light icons.select rd1.run_date, rd1.run_time, rd1.run_time_in_Seconds ,Avg(rd2.run_time_in_Seconds) as Average_run_time_in_seconds,casewhenConvert(decimal(10,1),rd1.run_time_in_Seconds)/Avg(rd2.run_time_in_Seconds)<= 1.2 then 'Green' when Convert(decimal(10,1),rd1.run_time_in_Seconds)/Avg(rd2.run_time_in_Seconds)< 1.4 then 'Yellow' else 'Red'end as [color], Calculating the Average Run Time in Hours Minutes and Seconds and the end of the query. casewhen len(convert(varchar(2),Avg(rd2.run_time_in_Seconds)/(3600))) = 1 then '0' + convert(varchar(2),Avg(rd2.run_time_in_Seconds)/(3600))else convert(varchar(2),Avg(rd2.run_time_in_Seconds)/(3600))end + ':' + case when len(convert(varchar(2),Avg(rd2.run_time_in_Seconds)%(3600)/60)) = 1 then '0' + convert(varchar(2),Avg(rd2.run_time_in_Seconds)%(3600)/60)else convert(varchar(2),Avg(rd2.run_time_in_Seconds)%(3600)/60)end + ':' + case when len(convert(varchar(2),Avg(rd2.run_time_in_Seconds)%60)) = 1 then '0' + convert(varchar(2),Avg(rd2.run_time_in_Seconds)%60)else convert(varchar(2),Avg(rd2.run_time_in_Seconds)%60)end as [Average Run Time HH:MM:SS] from #rawdata2 rd2 innerjoin #rawdata1 rd1on rd1.keyy = rd2.keyygroup by run_date,rd1.run_time ,rd1.run_time_in_Seconds order by run_date descThe complete code example use msdbgo/*drop table #rawdata1drop table #rawdata2go*/select 1 as keyy,run_date,(substring(b.run_time,1,2)*3600) + (substring(b.run_time,4,2)*60) + (substring(b.run_time,7,2)) as run_time_in_Seconds,run_time into #rawdata1 from (select run_date,substring(convert(varchar(20),tt),1,2) + ':' +substring(convert(varchar(20),tt),3,2) + ':' +substring(convert(varchar(20),tt),5,2) as [run_time] from (select name,run_date, run_duration, casewhenlen(run_duration) = 6 then convert(varchar(8),run_duration)whenlen(run_duration) = 5 then '0' + convert(varchar(8),run_duration)whenlen(run_duration) = 4 then '00' + convert(varchar(8),run_duration)whenlen(run_duration) = 3 then '000' + convert(varchar(8),run_duration)whenlen(run_duration) = 2 then '0000' + convert(varchar(8),run_duration)whenlen(run_duration) = 1 then '00000' + convert(varchar(8),run_duration)end as ttfrom dbo.sysjobs sj with (nolock)innerjoin dbo.sysjobHistory sh with (nolock) on sj.job_id = sh.job_id where name = 'My Agent Job'and [Message] like '%The job%') a ) bselect 1 as Keyy, run_time_in_Seconds into #rawdata2 from #rawdata1select rd1.run_date, rd1.run_time, rd1.run_time_in_Seconds ,Avg(rd2.run_time_in_Seconds) as Average_run_time_in_seconds,casewhenConvert(decimal(10,1),rd1.run_time_in_Seconds)/Avg(rd2.run_time_in_Seconds)<= 1.2 then 'Green' when Convert(decimal(10,1),rd1.run_time_in_Seconds)/Avg(rd2.run_time_in_Seconds)< 1.4 then 'Yellow' else 'Red'end as [color],Case when len(convert(varchar(2),Avg(rd2.run_time_in_Seconds)/(3600))) = 1 then '0' + convert(varchar(2),Avg(rd2.run_time_in_Seconds)/(3600))else convert(varchar(2),Avg(rd2.run_time_in_Seconds)/(3600))end + ':' + case when len(convert(varchar(2),Avg(rd2.run_time_in_Seconds)%(3600)/60)) = 1 then '0' + convert(varchar(2),Avg(rd2.run_time_in_Seconds)%(3600)/60)else convert(varchar(2),Avg(rd2.run_time_in_Seconds)%(3600)/60)end + ':' + case when len(convert(varchar(2),Avg(rd2.run_time_in_Seconds)%60)) = 1 then '0' + convert(varchar(2),Avg(rd2.run_time_in_Seconds)%60)else convert(varchar(2),Avg(rd2.run_time_in_Seconds)%60)end as [Average Run Time HH:MM:SS] from #rawdata2 rd2 innerjoin #rawdata1 rd1on rd1.keyy = rd2.keyygroup by run_date,rd1.run_time ,rd1.run_time_in_Seconds order by run_date desc  

    Read the article

  • Override Linq-to-Sql Datetime.ToString() Default Convert Values

    - by snmcdonald
    Is it possible to override the default CONVERT style? I would like the default CONVERT function to always return ISO8601 style 126. Steps To Reproduce: DROP TABLE DATES; CREATE TABLE DATES ( ID INT IDENTITY(1,1) PRIMARY KEY, MYDATE DATETIME DEFAULT(GETUTCDATE()) ); INSERT INTO DATES DEFAULT VALUES; INSERT INTO DATES DEFAULT VALUES; INSERT INTO DATES DEFAULT VALUES; INSERT INTO DATES DEFAULT VALUES; SELECT CONVERT(NVARCHAR,MYDATE) AS CONVERTED, CONVERT(NVARCHAR(4000),MYDATE,126) AS ISO, MYDATE FROM DATES WHERE MYDATE LIKE'Feb%' Output: CONVERTED ISO MYDATE --------------------------- ---------------------------- ----------------------- Feb 8 2011 12:17AM 2011-02-08T00:17:03.040 2011-02-08 00:17:03.040 Feb 8 2011 12:17AM 2011-02-08T00:17:03.040 2011-02-08 00:17:03.040 Feb 8 2011 12:17AM 2011-02-08T00:17:03.040 2011-02-08 00:17:03.040 Feb 8 2011 12:17AM 2011-02-08T00:17:03.040 2011-02-08 00:17:03.040 Linq-to-Sql calls CONVERT(NVARCHAR,@p) when I cast ToString(). However, I am displaying all my data in the ISO8601 format. I would like to override the database default if possible to CONVERT(NVARCHAR,@p,126). I am using Dynamic Linq-to-Sql as demoed by ScottGu to process my data. PropertyInfo piField = typeof(T).GetProperty(rule.field); if (piField != null) { Type typeField = piField.PropertyType; if (typeField.IsGenericType && typeField.GetGenericTypeDefinition().Equals(typeof(Nullable<>))) { filter = filter .Select(x => x) .Where(string.Format("{0} != null", rule.field)) .Where(string.Format("{0}.Value.ToString().Contains(\"{1}\")", rule.field, rule.data)); } else { filter = filter .Select(x => x) .Where(string.Format("{0} != null", rule.field)) .Where(string.Format("{0}.ToString().Contains(\"{1}\")", rule.field, rule.data)); } } I was hoping my property would convert the expression from CONVERT(NVARCHAR,@p) to CONVERT(NVARCHAR,@p,126), however I get a NotSupportedException: ... has no supported translation to SQL. public string IsoDate { get { if (SUBMIT_DATE.HasValue) { return SUBMIT_DATE.Value.ToString("o"); } else { return string.Empty; } } }

    Read the article

  • Convert Dynamic to Type and convert Type to Dynamic

    - by Jon Canning
    public static class DynamicExtensions     {         public static T FromDynamic<T>(this IDictionary<string, object> dictionary)         {             var bindings = new List<MemberBinding>();             foreach (var sourceProperty in typeof(T).GetProperties().Where(x => x.CanWrite))             {                 var key = dictionary.Keys.SingleOrDefault(x => x.Equals(sourceProperty.Name, StringComparison.OrdinalIgnoreCase));                 if (string.IsNullOrEmpty(key)) continue;                 var propertyValue = dictionary[key];                 bindings.Add(Expression.Bind(sourceProperty, Expression.Constant(propertyValue)));             }             Expression memberInit = Expression.MemberInit(Expression.New(typeof(T)), bindings);             return Expression.Lambda<Func<T>>(memberInit).Compile().Invoke();         }         public static dynamic ToDynamic<T>(this T obj)         {             IDictionary<string, object> expando = new ExpandoObject();             foreach (var propertyInfo in typeof(T).GetProperties())             {                 var propertyExpression = Expression.Property(Expression.Constant(obj), propertyInfo);                 var currentValue = Expression.Lambda<Func<string>>(propertyExpression).Compile().Invoke();                 expando.Add(propertyInfo.Name.ToLower(), currentValue);             }             return expando as ExpandoObject;         }     }

    Read the article

  • Program to read and convert entire website to html

    - by Frederik Wordenskjold
    I'm using a very old cms, Synkron.web. I need to convert all of my pages (written in .asp) to plain html - so I have an archive where all of the pages from my website are saved. I was wondering if there isnt some kind of program out there, with the ability to traverse all documents on a website, view their source, and save them as html-pages on my local machine? If not, do you have any suggestions on how to convert a Synkron.web database, to some kind of open-source CMS? Like Wordpress, etc...

    Read the article

  • Convert SWF/FLA back to PDF [closed]

    - by mitjak
    Possible Duplicate: How do I convert SWF into a PDF? I have a number of graphics and text only SWF and FLA files that I'd like to convert to PDF preserving the text and formatting. Printing to PDF from Flash Player seems to flatten everything into an image without preserving the text. I've got a large number of those files, so it would be quite nice to have a automatable/console utility to do the job. Appreciate any help or pointers. Thanks! EDIT: It seems like most SWF files were created with pdf2swf, so I'm hoping there is a similar tool for doing a reverse conversion.

    Read the article

  • Convert MPG w/ AC3 audio to something else - on a Mac

    - by anonymous coward
    I'm helping with a small volunteer media team, and they have several .mpg videos that don't appear to have sound when played in QuickTime, iTunes, Real Player, etc, on the local Mac machine. I was able to hear audio after transferring one of the movies to a Windows machine that had VLC media player on it. Through VLC I was able to discover that the audio stream is a52 / AC3 format. We use Autodesk Cleaner in our normal workflow of converting the format of our videos to FLV, but for some reason it's unable to convert this particular batch of videos (well, the video converts fine, but with no audio). Obviously, it seems that there's a codec issue here, but I'm not sure how to correct it. (I'm not extremely familiar with Macs, and/or Autodesk Cleaner). I've seen the Perian codec pack, but I'm not sure that having the codecs on the system will enable Cleaner to convert these videos (particularly the audio stream, since the video converts fine). Is there something obvious that I'm overlooking, or will we have to use something else for this particular batch of videos? If so, what?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >