conversion

How do I convert a list of objects to a list of integers using AutoMapper?

I have a Student object: public class Student { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } } And a Classroom object: public class Classroom { public List<Student> Students { get; set; } } I want to use AutoMapper to convert the list of students to a list o...

How can I configure AutoMapper to convert all collections of reference types to collections of integers?

Let's say I have the following entity: public class Store { public List<Product> Products { get; set; } public List<Employee> Employees { get; set; } public List<Camera> Cameras { get; set; } } In other words, a Store that has Products, Employees, and security Cameras. I want to convert this Store to a StoreDTO: public cl...

C/C++ header to java

Is there any good tool to generate java (+JNI support if needed) from a header file so that a C or C++ library can be used as-is. Kind of a reverse of javah. The real functionality would be in the C/C++, the Java would be only a shim on top for certain users. I'm no expert on JNI but as far as I can see Javah forces you to do this back...

converting dates between timezones in AppModel->afterFind (cakePHP)

I have a cakePHP application that is pulling data from two different databases, which store dates and times in their data from different timezones. One database's timezone is Europe/Berlin, and the other's is Australia/Sydney. To make things more complicated, the application is hosted on a server in the US, and times must be presented to...

How can I get a compilation error on accidental construction?

Given 2 classes: ... class Grades{ public: Grades(int numExams) : _numExams(numExams){ _grdArr = new double[numExams]; } double GetAverage() const; ... private: // The only data members of the class int _numExams; double *_grdArr; }; class Student{ public: Student(Grades g) : _g(g){ } ......

Howto convert decimal (xx.xx) to binary

This isn't necessarily a programming question but i'm sure you folks know how to do it. How would i convert floating point numbers into binary. The number i am looking at is 27.625. 27 would be 11011, but what do i do with the .625? ...

Write another language above Javascript VM?

I wonder if it's possible to write a new language above Javascript VM so that you could embed your language - which is based on javascript - and it will work together with native javascript. Example: var person_exists = true; // native js Animal eats banana // my language console.log(person_exists) // native js I've seen Cappuccino...

C GetTickCount (windows function) to Time (nanoseconds)

Hello guys, I'm testing one code provided from my colleague and I need to measure the time of execution of one routine than performs a context switch (of threads). What's the best choice to measure the time? I know that is available High Resolution Timers like, QueryPerformanceCounter QueryPerformanceFrequency but how can I translate...

Migrate from CVS to Mercurial: Separating projects

We have a CVS repository with years of development history and 3 projects under one project (CVS folder). Those should be different repositories in a Mercurial repo. They are in the following scheme: Project ---Sub Project 1 ---Sub Project 2 ---Sub Project 3 Is there a way to automate this during the cvs2hg process? If not, what would...

Which site charges lowest price for Document Conversion

HI all Which is the best site who charges lowest price for Document Conversion ? ...

How to convert every page in a XPS file to an image in C#?

Is there a way to convert every page in a XPS document to an image programmatically using C#? ...

how to read a sqlite3 decimal column?

I can read a text and an int column (sqlite3_column_text, sqlite3_column_int). But does anyone know how to read in a sqlite decimal column? The decimal columns essentially hold currency values. Thanks! ...

Order of execution in a WPF Textbox

I'm running into an issue with a formatting converter and data validation. I have the following textbox XAML declaration <TextBox FontFamily="Segoe" FontSize="16" FontWeight="Medium" TabIndex="{Binding TabBinding}" Foreground="Black" Opacity="0.9" IsTabStop="True" Uid="{Binding PriceID}" Text="{Binding NewPrice,Converter={S...

how to convert high quality .wmv file using ffmpeg

Please guide me how to solve this issue. Below is what I got when try to convert wmv format file to .flv. ffmpeg -i full.wmv -ar 48000 -ab 192000 -b 293000 -r 15 -s 640x480 full.flv FFmpeg version SVN-r13582, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --prefix=/usr --libdir=${prefix}/lib --shlibdir=${prefix}/lib -...

Integer convert to WoW Gold

Heya all, For a MMORPG World of Warcraft im trying to write a lib. Money in that games is stored as an Integer and in game currency is not an integer it's based of Gold, Silver and Copper coins. Every 100 copper is 1 silver and every 100 silver is 1 gold. Now I need to convert such an integer to the WoW Money format: for example 1231...

Translation of yield into VB.NET

Hello, first i must assume that i'm not very familiar with the C# yield keyword and its function. What is the best/easiest way to "translate" it into VB.NET? Especially i tried to convert this code into VB.NET, but i failed with: yield return new MatchNode(++index, current.Value); What i have is: Imports System.Collections Imports ...

Two's complement conversion

I need to convert bytes in two's complement format to positive integer bytes. The range -128 to 127 mapped to 0 to 255. Examples: -128 (10000000) -> 0 , 127 (01111111) -> 255, etc. EDIT To clear up the confusion, the input byte is (of course) an unsigned integer in the range 0 to 255. BUT it represents a signed integer in the range -1...

How can I get Client Side Recordset from Server side Recordset?

I just made a sql query through a component which returned me a server side recordset. Is there a way I can make it as a client side recordset? Creation of the recordset is not in my control. I am not going to need server side recordset again. Basically I want to minimize round trips to the server at the cost of client memory. What cou...

In python, how to precise a format when converting int to string?

More precisely, I want my format to add leading zeros to have string with constant length. e.g. if the constant length is set to 4 1 would be converted into "0001" 12 would be converted into "0012" 165 would be converted into "0165" I have no constraint on the behaviour when the integer is greater than what can allow the given length (9...

What does 401F0000C48FBAA6 mean?

Hello, I have this text 401F0000C48FBAA6 and I know that corresponds to a word. It's not in hexadecimal (I've tried). Do anyone knows in what base can it be? And what does it means? ...