Search Results

Search found 2509 results on 101 pages for 'converting'.

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

  • Python: Converting legacy string dates to dates

    - by Eric
    We have some legacy string dates that I need to convert to actual dates that can be used to perform some date logic. Converting to a date object isn't a problem if I knew what the format were! That is, some people wrote 'dd month yy', othes 'mon d, yyyy', etc. So, I was wondering if anybody knew of a py module that attempts to guess date formats and rewrites them in a uniform way? Any other suggestions? Thanks! :) Eric

    Read the article

  • Procedure in converting int to decimal data type?

    - by Fedor
    I have an int(11) column which is used to store money. I read some of the answers on SO and it seems I just need to update it to be a decimal (19,4) data type. Are there any gotchas I should know about before I actually do the converting? My application is in PHP/Zend and I'm not using an ORM so I doubt I would need to update any sort of class to consistently identify the data type.

    Read the article

  • Linq Queries converting to lambda expressions ?

    - by Freshblood
    Hello from item in range where item % 2 ==0 select i ; is converting to lamda expressions as below range.where(item % 2 ==0).select(x=>x). I feel that first way of linq is translating next one and if it is ,so is there any optimization like this range.where(item & 2 == 0) instead of other one ?

    Read the article

  • Need help converting SQL to EF4 please

    - by Ken Eldridge
    I need help converting this SQL statement, into EF4: Select Posts.PostID, Post, Comment from Posts left join Comments on posts.PostID = Comments.PostID Where CommentID not in ( Select PostID from Votes where VoteTypeID = 4 --4 = flagged comment type ) In my database, the Votes table stores either the PostID of reported posts, or CommentID of reported comments in the column Votes.PostID Thanks in advance!

    Read the article

  • converting factored number to decimal in MS SQL

    - by LS
    I need to convert a number which gives decimals in factored format in to decimals, i.e. 11.16 is 11.5 in decimal. This is because 16 is in base of 32 and 11.16 should be read as 11+16/32 = 11.5 I get 11.16 as a string and I need to change it to 11.5 as numeric in MS SQL(2005) database. Any shorter way of doing this rather than splitting strings,converting to numerics,maths,convert to string, concatenate and then convert to numeric?

    Read the article

  • Converting ObsevableCollection foreach to lambda.

    - by Jitendra Jadav
    Hello Guys, I am working some ObservableCollection converting to lembda it will give me error this is my actual code . foreach (var item in Query) { userDetail.Add(new UserDatail(item.ID,item.Name, item.Address, item.City, item.Pin, item.Phone)); } and I am try to add as lembda Query.ToList().ForEach(x => userDetail.Add(x.ID,x.Name,x.Address,x.City,x.Pin,x.Phone)); This will give me error. Thanks..

    Read the article

  • Converting to Visual Studio 2008 and .NET 3.5

    - by Grant Back
    The process of converting from Visual Studio .NET 2003 to Visual Studio 2008 is satisfyingly start forward. I thought it would be worth asking a couple of questions though: 1) Are there any 'gotchas' with this conversion process that we should be aware of? 2) Same question goes for upgrading the .NET Framework from 1.1 to 3.5? Thanks.

    Read the article

  • Converting DTOs to View Models

    - by illvm
    Does anyone know of a good (read: quick to code) method for converting DTOs to View Models or mapping DTO members to View Model members? Lately I've been finding myself writing many conversion and helper methods but this is a very arduous and tedious task. Moreover, it will often needs to be done twice (DTO - View Model, View Model - DTO). Is there a methodology, technique, or technology which would allow me to do this more quickly and efficiently?

    Read the article

  • C++ Converting image to integer array

    - by jonathanasdf
    How would I go about converting the pixels in an image (.png file) to an integer array, where each pixel is converted to its ARGB integer equivalent? I would like to do this without using external libraries. Not a 2D integer array by the way, a 1D one (where access is through array[row*width+col]). Thanks.

    Read the article

  • WPF 3D - converting from Point2D to Point3D and back again

    - by DanM
    I'm new to WPF 3D, so I may just be missing something obvious, but how would I go about converting from a 2D coordinate to a 3D coordinate and back again? I'd like the 2D coordinate to be the location measured from the upper-left corner of Viewport3D and the 3D coordinate to be the location relative to the origin (0, 0, 0) of the 3D world. The conversion functions should have these signatures: public Point3D Point2DAndWorldZToPoint3D(Point2D point2D, double worldZ) // usually I want to know where a 2D point will be on the ground plane // so worldZ will usually be zero (but not always) public Point2D Point3DToPoint2D(Point3D point3D) I found this related question, but it only addresses conversion from 3D to 2D (not the reverse), and I'm not sure if the answers are up-to-date. Note, I'm currently using .NET 3.5, but if there are improvements in .NET 4.0 that would help me, please let me know.

    Read the article

  • What does this mean: warning: converting from ‘void (ClassName::*)()’ to ‘void (*)()’

    - by Brendan Long
    I have a member function in a class that has a callback, but the callback isn't strictly neccessary, so it has a default callback, which is empty. It seems to work fine, but I get an annoying warning: warning: converting from ‘void (ClassName::*)()’ to ‘void (*)()’ I'm trying to figure out what it means and how to turn it off (or fix it if I really am doing something wrong). Here's some simple code: class ClassName{ public: void doSomething(void (*callbackFunction)() = (void(*)()) &ClassName::doNothing){ callbackFunction(); } void doNothing(){} }; int main(){ ClassName x; x.doSomething(); return 0; } Note: If I do this (without explicitly casting it as a void(*)()): void doSomething(void (*callbackFunction)() = &ClassName::doNothing) I get this: main.cpp:3: error: default argument for parameter of type ‘void (*)()’ has type ‘void (ClassName::*)()’

    Read the article

  • Converting EBNF to BNF

    - by Vivin Paliath
    It's been a few years since my computer-language class and so I've forgotten the finer points of BNF's and EBNF's and I don't have a textbook next to me. Specifically, I've forgotten how to convert an EBNF into BNF. From what little I remember, I know that one of the main points is to convert { term } into <term> | <many-terms>. But I don't remember the other rules. I've tried to look this up online but I can only find links to either homework questions, or a small comment about converting terms with curly braces. I can't find an exhaustive list of rules that define the translation.

    Read the article

  • Converting JSON into Python dict

    - by GrumpyCanuck
    I've been searching around trying to find an answer to this question, and I can't seem to track it down. Maybe it's too late in the evening to figure the answer out, so I turn to the excellent readers here. I have the following bit of JSON data that I am pulling out of a CouchDB record: "{\"description\":\"fdsafsa\",\"order\":\"1\",\"place\":\"22 Plainsman Rd, Mississauga, ON, Canada\",\"lat\":43.5969175,\"lng\":-79.7248744,\"locationDate\":\"03/24/2010\"},{\"description\":\"sadfdsa\",\"order\":\"2\",\"place\":\"50 Dawnridge Trail, Brampton, ON, Canada\",\"lat\":43.7304774,\"lng\":-79.8055435,\"locationDate\":\"03/26/2010\"}," This data is stored inside a Python dict under the key 'locations' in a dict called 'my_plan'. I want to covert this data from CouchDB into a Python dict so I can do the following in a Django template: {% for location in my_plan.locations %} <tr> <td>{{ location.place }}</td> <td>{{ location.locationDate }}</td> </tr> {% endfor %} I've found lots of info on converting dicts to JSON, but nothing on going back the other way Thanks in advance for the help!

    Read the article

  • converting between struct and byte array

    - by chonch
    his question is about converting between a struct and a byte array. Many solutions are based around GCHandle.Alloc() and Marshal.StructureToPtr(). The problem is these calls generate garbage. For example, under Windows CE 6 R3 about 400 bytes of garbarge is made with a small structure. If the code below could be made to work the solution could be considered cleaner. It appears the sizeof() happens too late in the compile to work. public struct Data { public double a; public int b; public double c; } [StructLayout(LayoutKind.Explicit)] public unsafe struct DataWrapper { private static readonly int val = sizeof(Data); [FieldOffset(0)] public fixed byte Arr[val]; // "fixed" is to embed array instead of ref [FieldOffset(0)] public Data; // based on a C++ union }

    Read the article

  • help converting sql to linq expression with count

    - by Philip
    I am trying to convert the following SQL into a LINQ expression SELECT COUNT(ID) AS Count, MyCode FROM dbo.Archive WHERE DateSent=@DateStartMonth AND DateSent<=@DateEndMonth GROUP BY MyCode and I have been trying to follow this webpage as an example http://stackoverflow.com/questions/606124/converting-sql-containing-top-count-group-and-order-to-linq-2-entities I got this so far but I am stuck on understanding the new part var res=(from p in db.Archives where (p.DateSent>= dateStartMonth) && (p.DateSent< dateToday) group p by p.MyCode into g select new { ??????MyCode = g.something?, MonthlyCount= g.Count() }); Thanks in advance for helping greatly appreciated Philip

    Read the article

  • Converting HTML to plain text in PHP for e-mail

    - by jstayton
    I use TinyMCE to allow minimal formatting of text within my site. From the HTML that's produced, I'd like to convert it to plain text for e-mail. I've been using a class called html2text, but it's really lacking in UTF-8 support, among other things. I do, however, like that it maps certain HTML tags to plain text formatting — like putting underscores around text that previously had <i> tags in the HTML. Does anyone use a similar approach to converting HTML to plain text in PHP? And if so: Do you recommend any third-party classes that I can use? Or how do you best tackle this issue? Thanks!

    Read the article

  • Converting old WCF service to RIA one

    - by Artur
    Hi there, Currently I have a service that looks like: Some app <-- WCF Service <-- Business Logic <-- Entity Framework Model <-- SQL Database One of "some app" would be Silverlight, but there as well will be lots of other clients (mainly mobile devices). To me the greatest benefit of having RIA services is possibility of making ordinary (not asynchronous) calls from Silverlight. I wondered if there is an easy way of converting what I have so far to be a RIA service? I as well wonder if there is a point of doing so if I plan to use the same service for multiple platforms/clients? Any help/links would be greatly appreciated.

    Read the article

  • Converting 24BPP to 4BPP with GDI+ in VB.NET

    - by Chris
    My VB.NET program currently takes a 4BPP TIFF as an Bitmap, converts it to a Graphic, adds some text strings and then saves it out again as a TIFF file. The output Bitmap.Save() TIFF file by default seems to be 24BPP (regardless of the input) and is a lot larger than the original TIFF. Is it possible to keep the same 4BPP palette encoding as the input for the output and if not, how can I convert my Bitmap PixelFormat from 24BPP to 4BPP Indexed. I've seen an example for converting 24 BPP to 1 BPP at http://www.bobpowell.net/onebit.htm using BitmapData.Lockbits() but cannot figure out how to do it for 4BPP. Many thanks Chris

    Read the article

  • Override transparency color when converting transparent PNG to JPG

    - by Alexander Malfait
    I'm using Dragonfly to generate thumbnail images in a Rails app. I'm serving all picture images as JPG's. Now the client is uploading transparent PNG files, like this one: http://www.ibanez.co.jp/products/images/eg2010/ART120_TRF_12_02.png Dragonfly uses RMagick to convert these images to JPG. The problem is that it converts the PNG images to JPG with a black background, and my site's design requires a white background. I've tried to override it like this: encoded_image = Magick::Image.from_blob(image.data).first if encoded_image.format.downcase == format image # do nothing else encoded_image.format = format encoded_image.background_color = "white" encoded_image.transparent_color = "white" encoded_image.to_blob end But the produced JPG images still contain a black background. Does anyone know how to beat RMagick into using a white background when converting the transparent layer? I know I could just serve as PNG, but then the images are 10 times as large, and the site is already pretty bandwidth heavy.

    Read the article

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