Search Results

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

Page 20/366 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • PHP String to Float

    - by John
    I am not familiar with PHP at all and had a quick question. I have 2 variables @pricePerUnit and @invoicedUnits. Here's the code that is setting these to values: $InvoicedUnits = ((string) $InvoiceLineItem->InvoicedUnits); $pricePerUnit = ((string) $InvoiceLineItem->PricePerUnit); If I output this, I get the correct values. Lets say 5000 invoiced units and 1.00 for price. Now, I need to show the total amount spent. When I multiply these two together it doesn't work (as expected, these are strings). But I have no clue how to parse/cast/convert variables in PHP. What should I do?

    Read the article

  • FFmpeg convert video w/ dropped frames, out of sync

    - by preahkumpii
    I recorded a video using Bandicam with the MJPEG encoder to get the least amount of lag. Now, I am trying to convert that massive file to a h264 avi using ffmpeg. I know there are dropped frames in the video stream...more than 100 in the first two minutes, which I assume is simply because Bandicam dropped some when it couldn't keep up. So, when I convert the file to h264, the video and audio are out of sync, and appear to be more and more out of sync as output video progresses. Here is my basic command in ffmpeg: ffmpeg -i "C:\...\input.avi" -vcodec libx264 -q 5 -acodec libmp3lame -ar 44100 -ac 2 -b:a 128k "C:\...\output.avi" I have tried EVERYTHING I can think of including: -itsoffset [-]00:00:01 Tried this before and after input file. This doesn't work because as the video progresses it becomes more and more out of sync. -async 1 Doesn't work. -vsync 1 Doesn't work, but it does show dropped frames being duplicated. Two inputs of same file with mapping using -map 0:0 -map 1:1. Doesn't work. The source plays just fine. Any ideas how to convert it with ffmpeg and keep the audio and video synced? Thanks.

    Read the article

  • Imagemagick convert creates monochrome output only

    - by rumtscho
    I have a book scan as a pdf. When I open it with Adobe Reader, it looks like grayscale. When I open it with IrfanView, it looks like grayscale, and the Information option tells me that the image is actually 24 bit (I don't know if this is the real bit depth of the image embedded in the pdf or if IrfanView assigns the maximal depth when opening a pdf as image). I want to OCR the scan with OmniPage SE. It doesn't read PDF, so I decided to use ImageMagick to convert the file to PNG first. But no matter what I try, the output is always monochrome and practically unreadable. I tried different conversion lines, with different depth, density and resize values, but it didn't help. What you see was made with the options convert testfile.pdf -density 600x600 -depth 8 PNG:testfile.png. Any idea what causes the problem? Edit: To make it clear, the output looks like this for any value of -density, -depth and -resize I have tried. It also looks like that when I use no options at all, as in convert testfile.pdf PNG:testfile.png.

    Read the article

  • Is there a programming toolkit for converting "any file type" to a TIFF image?

    - by Ryan
    Hello, I've written several variations of a program. The purpose of the program is to convert "any file type" to a TIFF image represenation of that file, as if it were being printed using a printer. I'm currently using a third party printer driver that I send files to, and it outputs a TIFF image. This is nice, but it requires me to use Office Interop files, and interact with each individual processing application in order to print the files. I had previously tried a toolkit, called Apose .NET, which did not rely on Office Interop, and did not require any printer driver. It did the conversion all on its own and would create a TIFF image. The problem with Aspose .NET was that it did not support a wide variety of input file types. Most notably, it can't do Visio files. My project calls for the ability to create a TIFF image for virtually "any file type". (excluding exes, music files, and stuff) I know that finding something that handles literally any file type is probably not a very feasible task, so I figure if it can at least handle all the Office file types, Adobe types, and other major standard file types, then I can write a custom extension parsing module that uses those processing applications to do the printing of any file type that can be viewed using those applications. So, does anyone know of a toolkit that can do this? Preferably one that does not rely on Office or a printer driver. It does not have to be free, or open source. Or, if you know of an amazing printer driver that does this, I'm open to that too. Thanks in advance, Ryan

    Read the article

  • String to array or Array to string tips on formats, etc

    - by user316841
    hi, first of all thanks for taking your time! I'm a junior Dev, working with PHP + mysql. My issue: I'm saving data from a form to my database. From this form, there's only need to save the contacts: Name, phone number, address. But, it would be nice to have a small reference to the user answers. Let's say for each question we've got a value betwee 1 and 4. Since there's no need to create a table just for it, because what's needed is just the personal contacts. I'm thinking of recording each question/answer, as a letter and its correspondent value. Example (A2, B1, C5, D3, etc). My question is: Is there a format I could afterwards, handle easily ? Convert to array (string to array) in case the client change ideas, and ask this data, placed in table columns ? Just to prevent this situation! Example, From (A2, B1, C5 ) to array( "A" = "1", "B" = "1", "C" = "5" ) For now I guess, Regex is the answer, but it's allways hard to figure it out and I'm allways getting in troubles =) Thanks!

    Read the article

  • ASP.NET MVC Map String Url To A Route Value Object

    - by mwgriffiths
    I am creating a modular ASP.NET MVC application using areas. In short, I have created a greedy route that captures all routes beginning with {application}/{*catchAll}. Here is the action: // get /application/index public ActionResult Index(string application, object catchAll) { // forward to partial request to return partial view ViewData["partialRequest"] = new PartialRequest(catchAll); // this gets called in the view page and uses a partial request class to return a partial view } Example: The Url "/Application/Accounts/LogOn" will then cause the Index action to pass "/Accounts/LogOn" into the PartialRequest, but as a string value. // partial request constructor public PartialRequest(object routeValues) { RouteValueDictionary = new RouteValueDictionary(routeValues); } In this case, the route value dictionary will not return any values for the routeData, whereas if I specify a route in the Index Action: ViewData["partialRequest"] = new PartialRequest(new { controller = "accounts", action = "logon" }); It works, and the routeData values contains a "controller" key and an "action" key; whereas before, the keys are empty, and therefore the rest of the class wont work. So my question is, how can I convert the "/Accounts/LogOn" in the catchAll to "new { controller = "accounts", action = "logon" }"?? If this is not clear, I will explain more! :) Matt This is the "closest" I have got, but it obviously wont work for complex routes: // split values into array var routeParts = catchAll.ToString().Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); // feels like a hack catchAll = new { controller = routeParts[0], action = routeParts[1] };

    Read the article

  • Creating ODT and PDF files as end result

    - by Bill Zimmerman
    Hello, I've been working on an app to create various document formats for a while now, and I've had limited success. Ideally, I'd like to dynamically create a fairly simple ODT/PDF/DOC file. I've been focusing my efforts on ODT, because it is editable, and open enough that there are several tools which will convert it to any of the other formats I need. The problem is that the ODT XML files are NOT simple, and there aren't any good-quality API's I could find (especially in python). So far, I've had the most success creating a template ODT file, and then manipulating the DOM in python as needed. This is ok generally, but is quickly becoming inadequate and requires too much tweaking every single time I need to alter one of the templates. The requirements are: 1) Produce a simple document that will have lists, paragraphs, and the ability to draw simple graphics on the page (boxes, circles, etc...) 2) The ability to specify page size, and the different formats should generally print the exact same output when sent to a printer My questions: 1) Are there any other ways I can produce ODT/PDF/DOC files? 2) Would LaTeX be acceptable? I've never really used it, does anyone have experience converting LaTeX files into other formats? 3) Would it be possible to use HTML? There are a lot of converters online. Technically you can specify dimensions in mm/cm, etc..., but I am worried that the printed output will differ between browsers/converters.... Any other ideas?

    Read the article

  • C++ read registry string value in char*

    - by Sunny
    I'm reading a registry value like this: char mydata[2048]; DWORD dataLength = sizeof(mydata); DWORD dwType = REG_SZ; ..... open key, etc ReqQueryValueEx(hKey, keyName, 0, &dwType, (BYTE*)mydata, &dataLength); My problem is, that after this, mydata content looks like: [63, 00, 3A, 00, 5C, 00...], i.e. this looks like a unicode?!?!. I need to convert this somehow to be a normal char array, without these [00], as they fail a simple logging function I have. I.e. if I call like this: WriteMessage(mydata), it outputs only "c", which is the first char in the registry. I have calls to this logging function all over the place, so I'd better of not modify it, but somehow "fix" the registry value. Here is the log function: void Logger::WriteMessage(const char *msg) { time_t now = time(0); struct tm* tm = localtime(&now); std::ofstream logFile; logFile.open(filename, std::ios::out | std::ios::app); if ( logFile.is_open() ) { logFile << tm->tm_mon << '/' << tm->tm_mday << '/' << tm->tm_year << ' '; logFile << tm->tm_hour << ':' << tm->tm_min << ':' << tm->tm_sec << "> "; logFile << msg << "\n"; logFile.close(); } }

    Read the article

  • Convert from apache rewrite to nginx

    - by Linux Intel
    I want to convert from apache rewrite modules to nginx RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) RewriteCond %{QUERY_STRING} SELECT(=|\[|\%[0-9A-Z]{0,2}) [OR] RewriteCond %{QUERY_STRING} UNION(=|\[|\%[0-9A-Z]{0,2}) [OR] RewriteCond %{QUERY_STRING} UPDATE(=|\[|\%[0-9A-Z]{0,2}) [OR] RewriteRule ^([^.]*)/?$ index.php [L] RewriteRule ^domain/trial/cms$ index/index.php?%{QUERY_STRING} [L] RewriteCond %{HTTP:Range} ([a-z]+) [NC] RewriteRule ([0-9_\-]+)flv$ http://www.domain.com [R,L] RewriteCond %{ENV:byte-ranges-specifier} !^$ RewriteRule ([0-9_\-]+)flv$ http://www.domain.com [R,L] RewriteCond %{HTTP_USER_AGENT} !^Mozilla/5 [NC] RewriteCond %{HTTP_USER_AGENT} !^Mozilla/4 [NC] RewriteCond %{HTTP_USER_AGENT} !^Opera [NC] RewriteRule ([0-9_\-]+)flv$ http://www.domain.com [R,L] RewriteRule ^$ index/index.php?%{QUERY_STRING} [L] RewriteCond %{SCRIPT_FILENAME} !sss.php [NC] RewriteCond %{SCRIPT_FILENAME} !m-administrator [NC] RewriteRule ^([^/^.]*)$ sss.php?encrypted=$1&%{QUERY_STRING} [L] RewriteCond %{SCRIPT_FILENAME} !sss.php [NC] RewriteCond %{SCRIPT_FILENAME} !m-administrator [NC] RewriteRule ^([^/^.]*)/([^/^.]*)$ sss.php?tab=$1&page=$2&%{QUERY_STRING} [L] RewriteCond %{SCRIPT_FILENAME} !sss.php [NC] RewriteCond %{SCRIPT_FILENAME} !m-administrator [NC] RewriteRule ^([^/^.]*)/([^/^.]*)/([^.]*)$ sss.php?tab=$1&page=$2&queryString=$3&%{QUERY_STRING} [L] RewriteCond %{SCRIPT_FILENAME} !sss.php [NC] RewriteCond %{SCRIPT_FILENAME} !security.php [NC] RewriteRule ^([^/]*)$ index/$1?%{QUERY_STRING} [L] I tried to convert it by online tools such as : http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ but it didn't convert it correctly. The conversion output is : if ($args ~ "mosConfig_[a-zA-Z_]{1,21}(=|%3D)"){ set $rule_0 1; } if ($args ~ "base64_encode.*(.*)"){ set $rule_0 1; } if ($args ~* "(<|%3C).*script.*(>|%3E)"){ set $rule_0 1; } if ($args ~ "GLOBALS(=|[|%[0-9A-Z]{0,2})"){ set $rule_0 1; } if ($args ~ "_REQUEST(=|[|%[0-9A-Z]{0,2})"){ set $rule_0 1; } if ($args ~ "SELECT(=|[|%[0-9A-Z]{0,2})"){ set $rule_0 1; } if ($args ~ "UNION(=|[|%[0-9A-Z]{0,2})"){ set $rule_0 1; } if ($args ~ "UPDATE(=|[|%[0-9A-Z]{0,2})"){ set $rule_0 1; } if ($rule_0 = "1"){ rewrite ^/([^.]*)/?$ /index.php last; } if ($rule_1 = ""){ rewrite ^/domain/trial/cms$ /index/index.php?$args last; } if ($http_range ~* "([a-z]+)"){ set $rule_2 1$rule_2; } if ($rule_2 = "1"){ rewrite /([0-9_-]+)flv$ http://www.domain.com redirect; } #ignored: condition 0 if ($rule_3 = "1"){ rewrite /([0-9_-]+)flv$ http://www.domain.com redirect; } if ($http_user_agent !~* "^Mozilla/5"){ set $rule_4 1$rule_4; } if ($http_user_agent !~* "^Mozilla/4"){ set $rule_4 2$rule_4; } if ($http_user_agent !~* "^Opera"){ set $rule_4 3$rule_4; } if ($rule_4 = "321"){ rewrite /([0-9_-]+)flv$ http://www.domain.com redirect; } if ($rule_5 = ""){ rewrite ^/$ /index/index.php?$args last; } if ($uri !~* "sss.php"){ set $rule_6 1$rule_6; } if ($uri !~* "m-administrator"){ set $rule_6 2$rule_6; } if ($rule_6 = "21"){ rewrite ^/([^/^.]*)$ /sss.php?encrypted=$1&$args last; } if ($uri !~* "sss.php"){ set $rule_7 1$rule_7; } if ($uri !~* "m-administrator"){ set $rule_7 2$rule_7; } if ($rule_7 = "21"){ rewrite ^/([^/^.]*)/([^/^.]*)$ /sss.php?tab=$1&page=$2&$args last; } if ($uri !~* "sss.php"){ set $rule_8 1$rule_8; } if ($uri !~* "m-administrator"){ set $rule_8 2$rule_8; } if ($rule_8 = "21"){ rewrite ^/([^/^.]*)/([^/^.]*)/([^.]*)$ /sss.php?tab=$1&page=$2&queryString=$3&$args last; } if ($uri !~* "sss.php"){ set $rule_9 1$rule_9; } if ($uri !~* "security.php"){ set $rule_9 2$rule_9; } if ($rule_9 = "21"){ rewrite ^/([^/]*)$ /index/$1?$args last; } Please help me with the proper conversion result for nginx in order to work perfectly.

    Read the article

  • How can I convert a StaticMesh to a custom class?

    - by Almo
    In the editor, we can place a StaticMesh, right-click it, select "Convert" and do "Convert to KActor". I have a subclass of KActor: class SubclassedKActor extends KActor placeable; var(PowerEnablers) bool m_bEnableChaos; var(PowerEnablers) bool m_bEnableCreate; var(PowerEnablers) bool m_bEnableForcePush; var(PowerEnablers) bool m_bEnableVortex; DefaultProperties { m_bEnableCreate=true; m_bEnableChaos=true; m_bEnableForcePush=true; m_bEnableVortex=true; } I want to be able to place a StaticMesh, right-click Convert and be able to select "Convert to SubclassedKActor". I have not been able to find out what populates the Convert menu.

    Read the article

  • How convert html to BBcode in C#

    - by Dmitriy
    Hello! I need to convert html text into bbcodes. Where i can find how should i do this? For example, I convert links: regex = new Regex("<a href=\"(.+?)\">(.+?)</a>"); htmlCode = regex.Replace(htmlCode, "[URL]$1[/URL]"); How can i convert all html tags in bbcodes (and replace to empty which isn't bb codes, tag P

    Read the article

  • Convert byte array to wav file in C#

    - by Eyla
    Greetings, I'm trying to play a wav sound that stored in byte array called bytes. I know that I should convert the byte array to wav file and save it in my local drive then called the saved file but I was not able to convert the byte array to wav file. please help me to give sample code to convert byte arrary of wav sound to wav file. here is my code: protected void Button1_Click(object sender, EventArgs e) { byte[] bytes = GetbyteArray(); //missing code to convert the byte array to wav file ..................... System.Media.SoundPlayer myPlayer = new System.Media.SoundPlayer(myfile); myPlayer.Stream = new MemoryStream(); myPlayer.Play(); }

    Read the article

  • Convert danish numbers to english ?

    - by francisf
    Hi , How do i convert a danish number to an english format for example : 8,5 is decimal number representation in danish and in english it would be 8.5 Now i need to convert 8,5 to 8.5 my current culture is danish and i am trying to convert this in javascript (NOT C#) Regards, Francis P.

    Read the article

  • CONVERT(int, (datepart(month, @search)), (datepart(day, @search)), DateAdd(year, Years.Year - (datepart(year, @search)))

    - by MyHeadHurts
    In the query the top part is getting all the years that will run in the stored procedure. Works fine But at first i just wanted to run the queries for yesterdays date for all the years, but now i realized i want the user to select a date that will be in a parameter @search Booked <= CONVERT(int,DateAdd(year, Years.Year - Year(getdate()), DateAdd(day, DateDiff(day, 2, getdate()), 1))) this should be easy because normally it would just be Booked <= CONVERT(int,@search) but the problem is i want to do something like a Booked <= CONVERT(int, (datepart(month, @search)), (datepart(day, @search)), DateAdd(year, Years.Year - (datepart(year, @search))) would something like that work i dont need to worry about subtracting days but i still need to worry about the years WITH Years AS ( SELECT DATEPART(year, GETDATE()) [Year] UNION ALL SELECT [Year]-1 FROM Years WHERE [Year]>@YearToGet ), q_00 as ( select DIVISION , DYYYY , sum(PARTY) as asofPAX , sum(APRICE) as asofSales from dbo.B101BookingsDetails INNER JOIN Years ON B101BookingsDetails.DYYYY = Years.Year where Booked <= CONVERT(int,DateAdd(year, Years.Year - Year(getdate()), DateAdd(day, DateDiff(day, 2, getdate()), 1))) and DYYYY = Years.Year group by DIVISION, DYYYY, years.year having DYYYY = years.year ),

    Read the article

  • Convert byte array to wav file

    - by Eyla
    I'm trying to play a wav sound that stored in byte array called bytes. I know that I should convert the byte array to wav file and save it in my local drive then called the saved file but I was not able to convert the byte array to wav file. please help me to give sample code to convert byte arrary of wav sound to wav file. here is my code: protected void Button1_Click(object sender, EventArgs e) { byte[] bytes = GetbyteArray(); //missing code to convert the byte array to wav file ..................... System.Media.SoundPlayer myPlayer = new System.Media.SoundPlayer(myfile); myPlayer.Stream = new MemoryStream(); myPlayer.Play(); }

    Read the article

  • convert.php does not run in a screen session

    - by Tobias
    I am trying to convert a big forum. At the moment I have to do this via ssh and start convert.php with "php5 -f convert.php -- $OPTIONS". But my internet connection is a bit buggy and so it is often killed. If i start the above working command in a screen session it does not work. Instead php gives me the HTML code of the "convert.php" back. head of the page: X-Powered-By: PHP/5.2.12 Set-Cookie: PHPSESSID=6bc4370b2d8d40ff8c3ab23672ff4135; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html Does it has something to do with the Sessions? But why does it work on the same ssh-connection without screen?

    Read the article

  • Parse int to string with stringstream

    - by SoulBeaver
    Well! I feel really stupid for this question, and I wholly don't mind if I get downvoted for this, but I guess I wouldn't be posting this if I had not at least made an earnest attempt at looking for the solution. I'm currently working on Euler Problem 4, finding the largest palindromic number of two three-digit numbers [100..999]. As you might guess, I'm at the part where I have to work with the integer I made. I looked up a few sites and saw a few standards for converting an Int to a String, one of which included stringstream. So my code looked like this: // tempTotal is my int value I want converted. void toString( int tempTotal, string &str ) { ostringstream ss; // C++ Standard compliant method. ss << tempTotal; str = ss.str(); // Overwrite referenced value of given string. } and the function calling it was: else { toString( tempTotal, store ); cout << loop1 << " x " << loop2 << "= " << store << endl; } So far, so good. I can't really see an error in what I've written, but the output gives me the address to something. It stays constant, so I don't really know what the program is doing there. Secondly, I tried .ToString(), string.valueOf( tempTotal ), (string)tempTotal, or simply store = temptotal. All refused to work. When I simply tried doing an implicit cast with store = tempTotal, it didn't give me a value at all. When I tried checking output it literally printed nothing. I don't know if anything was copied into my string that simply isn't a printable character, or if the compiler just ignored it. I really don't know. So even though I feel this is a really, really lame question, I just have to ask: How do I convert that stupid integer to a string with the stringstream? The other tries are more or less irrelevant for me, I just really want to know why my stringstream solution isn't working.

    Read the article

  • Convert VB.NET code to C#

    - by Sorush Rabiee
    Hi people, I have three projects written with VB.NET (2005) and have to convert them to C# code. (I know that i don't need to convert codes of .net languages at all). I have no time to rewrite them, need a tool or script to convert. Note: they are console applications.

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >