Search Results

Search found 15070 results on 603 pages for 'language conversion'.

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

  • What actions should I not rely on the packaged functionality of my language for?

    - by David Peterman
    While talking with one of my coworkers, he was talking about the issues the language we used had with encryption/decryption and said that a developer should always salt their own hashes. Another example I can think of is the mysql_real_escape_string in PHP that programmers use to sanitize input data. I've heard many times that a developer should sanitize the data themselves. My question is what things should a developer always do on their own, for whatever reason, and not rely on the standard libraries packaged with a language for it?

    Read the article

  • Automatic type conversion in Java?

    - by davr
    Is there a way to do automatic implicit type conversion in Java? For example, say I have two types, 'FooSet' and 'BarSet' which both are representations of a Set. It is easy to convert between the types, such that I have written two utility methods: /** Given a BarSet, returns a FooSet */ public FooSet barTOfoo(BarSet input) { /* ... */ } /** Given a FooSet, returns a BarSet */ public BarSet fooTObar(FooSet input) { /* ... */ } Now say there's a method like this that I want to call: public void doSomething(FooSet data) { /* .. */ } But all I have is a BarSet myBarSet...it means extra typing, like: doSomething(barTOfoo(myBarSet)); Is there a way to tell the compiler that certain types can automatically be cast to other types? I know this is possible in C++ with overloading, but I can't find a way in Java. I want to just be able to type: doSomething(myBarSet); And the compiler knows to automatically call barTOfoo()

    Read the article

  • cvs to mercurial conversion gets tags wrong

    - by Mark Borgerding
    I've tried all the recommended conversion techniques Mostly they manage to get the latest version of the files right, but every one of them trashes my history. Many (most?) of the tags from my cvs project have at least one file in error when I run "hg up $tag" My cvs repo is not all that complicated. Why can't anything convert it? I'd like to dump cvs and convert to mercurial, but not without history. To recap my frustration: I tried hg convert (tried --branchsort,--timesort, fuzz=0) I tried cvs2svn and then hg convert. tailor does not work with recent versions of mercurial fromcvs disappeared from the face of the earth hg-cvs-import has been abandoned for 4 years and doesn't work with recent versions of hg I have tried using the two most recent versions of mercurial ( 1.5 and 1.5.1 ).

    Read the article

  • JSP/JSF conversion to ASP.NET

    - by sharru
    I have a pretty big JSF web application. I must convert the application to ASP.NET. I already converted the Java code to C# code manually and also using JCLA (Java Language Conversion Assistant from Microsoft). What is the best way to convert the JSF part to ASP.NET? Is there any tool that can help shorten the work? For example convert JSF <t:dataList> to ASP.NET datagrid, or converting panelGroup to asp:panel, etc...

    Read the article

  • Using implicit conversion as a substitute for multiple inheritance in .NET

    - by Daniel Plaisted
    I have a situation where I would like to have objects of a certain type be able to be used as two different types. If one of the "base" types was an interface this wouldn't be an issue, but in my case it is preferable that they both be concrete types. I am considering adding copies of the methods and properties of one of the base types to the derived type, and adding an implicit conversion from the derived type to that base type. Then users will be able treat the derived type as the base type by using the duplicated methods directly, by assigning it to a variable of the base type, or by passing it to a method that takes the base type. It seems like this solution will fit my needs well, but am I missing anything? Is there a situation where this won't work, or where it is likely to add confusion instead of simplicity when using the API?

    Read the article

  • Choice of programming language for learning data structures and algorithms

    - by bguiz
    Which programming language would you recommend to learn about data structures and algorithms in? Considering the follwing: Personal experience Language features (pointers, OO, etc) Suitability for learning DS & A concepts I ask because there are some books out there that are programming language-agnostic (written from a Mathematical perspective, and use pseudocode). If I learn from one of these I would like to work out the algorithms in a chosen language. Then, there are other books which introduce DS & A concepts with examples in a particular programming laguage - and I would follow these examples as well. Either way, I have to choose a language, and I would like to stick to one throughout. Which one best fits the bill.

    Read the article

  • Java Conversion of byte[] into a srting and then back to a byte[]

    - by Sid
    I am working on a proxy server. I am getting data in byte[] which i convert into a string to perform certain operations. Now when i convert this new string back into a byte [] it causes unkonw problems. So mainly its like i need to know how to correctly convert a byte[] into a string and then back into a byte[] again. I tried to just convert the byte[] to string and then back to byte[] again (to make sure thats its not my operations that are causing problems). So its like: // where reply is a byte[] String str= new String(reply,0, bytesRead); streamToClient.write(str.getBytes(), 0, bytesRead); is not equivalent to streamToClient.write(reply, 0, bytesRead); my proxy works fine when i just send the byte[] without any conversion but when i convert it from byte[] to a string and then back to a byte[] its causes problems. can some one please help? =]

    Read the article

  • How to detect the language of MS Excel from C#

    - by Babba
    If i try to use Excel from C# (interop) i receive error (HRESULT: 0x80028018) when current thread language is different from Excel language: so i need to set thread language, they must be the same. Which is the best method to understand the language of Excel/Office? 1) registry (HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\LanguageResources\UILanguage ? How understand wich version (12.0/14.0/...?) 2) with Application like suggested here (http://stackoverflow.com/questions/2804556/how-to-detect-the-language-of-ms-excel) ? It's ok but i need a strong reference to a specific version Microsoft.Office.Core and so i can't do it for different versione of Office: Excel.Application application = new Excel.Application(); int iUi = application.LanguageSettings.get_LanguageID(Microsoft.Office.Core.MsoAppLanguageID.msoLanguageIDUI); MessageBox.Show(iUi.ToString()); 3) other?

    Read the article

  • java decmail string to AS 3.0 conversion procedure

    - by Jack Smith
    Hello, I have a problem with conversion java code to action script 3. Anyone can help with code translation? Thanks. public static short[] decmail_str_to_binary_data(String s) { short[] data = new short[s.length()/2]; for (int i = 0; i < s.length(); i += 2) { char c1 = s.charAt(i); char c2 = s.charAt(i + 1); int comb = Character.digit(c1, 16) & 0xff; comb <<= 4; comb += Character.digit(c2, 16) & 0xff; data[i/2] = (short)comb; } return data; }

    Read the article

  • Unusual conversion error (string to integer) asp.net

    - by Phil
    I have my repeater item template: <ItemTemplate> <tr><td><%#Container.DataItem("Category")%></td></tr> </ItemTemplate> Hooked up to: s = "SQL that works ok on server" x = New SqlCommand(s, c) x.Parameters.Add("@contentid", SqlDbType.Int) x.Parameters("@contentid").Value = contentid c.Open() r = x.ExecuteReader If r.HasRows Then Linksrepeater.DataSource = r Linksrepeater.DataBind() End If c.Close() r.Close() When I run the code I get: Invalid Cast Exception was not handled by user code (Conversion from string "category" to type 'Integer' is not valid.) I'm not sure how / why it is trying to convert "Category" to integer as in the db it is a string. Can you please tell me how to avoid this error? thanks.

    Read the article

  • How to change Skype language in MacBook Pro running Mac OS X version 10.6.8?

    - by Zuul
    I am unable to change the Skype language from English to Portuguese in MacBook Pro running Mac OS X version 10.6.8. What I have done: I've downloaded the Portuguese version of Skype; I have under OSX ? System Preference ? Language & Text the language and country set to Portugal; I have my Skype account country and language set to Portugal, Portuguese. Still the Skype application is using English and AFAIK no menu exists to change the application language within the application itself. I was under the impression that Skype would collect the language from my system preferences as to properly present the menus. How can I change the language to Portuguese then?

    Read the article

  • Formal definition for term "pure OO language"?

    - by Yauhen Yakimovich
    I can't think of a better place among SO siblings to pose such a question. Originally I wanted to ask "Is python a pure OO language?" but considering troubles and some sort of discomfort people experience while trying to define the term I decided to start with obtaining a clear definition for the term itself. It would be rather fair to start with correspondence by Dr. Alan Kay, who has coined the term (note the inspiration in biological analogy to cells or other living objects). There are following ways to approach the task: Give a comparative analysis by listing programming languages that exhibits certain properties unique and sufficient to define the term (although Smalltalk and Java are passing examples but IMO this way seems neither really complete or nor fruitful) Give a formal definition (or close to it, e.g. in more academic or mathematical style). Give a philosophical definition that would totally rely on semantical context of concrete language or a priori programming experience (there must be some chance of successful explanation by the community). My current version: "If a certain programing (formal) language that can (grammatically) differentiate between operations and operands as well as infer about the type of each operand whether this type is an object (in sense of OOP) or not then we call such a language an OO-language as long as there is at least one type in this language which is an object. Finally, if all types of the language are also objects we define such language to be pure OO-language." Would appreciate any possible improvement of it. As you can see I just made the definition dependent on the term "object" (often fully referenced as class of objects).

    Read the article

  • What constitutes a programming language and how does one copyright a programming language?

    - by Yannbane
    I've decided to create a programming language of my own, mostly just for fun. However, I got interested in the legal aspect of it all. You can, for example, licence specific programs under specific terms. However, how do you go about licensing a language? Also, by that I don't just mean the implementation of the language (compiler & VM), but the standard itself. Is there something else to a programming language I'm missing? What I would like to achieve by such licensing: Make it completely FOSS (can a language even be FOSS, or is that the implementation that can be FOSS?) Establish myself as the author (can you legally be an author of a language? Or, again, just the implementation?) Make it so that anyone implementing my language would be required to attribute me (MIT-style. Please note that I do not have any hopes for anyone actually ever doing that though, I'm just learning.) I think that the solution would be to separately license the VM and the compiler for my language, as "the official implementation", and then license the design document as the language itself. What exactly am I missing here?

    Read the article

  • Using Groovy as a scripting language...

    - by Zombies
    I prefer to use scripting languages for short tasks, anything such as a really simple http bot, bulk importing/exporting data to/from somewhere, etc etc... Basic throw-away scripts and simple stuff. The point being, that a scripting language is just an efficient tool to write quick programs with. As for my understanding of Groovy at this point... If you were to program in Groovy, and you wan't to write a quick script, wouldn't you be forced to going back to regular java syntax (and we know how that can be convoluted compared to a scripting language) in order to do anything more complicated? For example, if I want to do some http scripting, wouldn't I just be right back at using java syntax to invoke Commons HttpClient? To me, the point of a scripting language is for quickly typed and less forced constructs. And here is another thing, it doesn't seem that there is any incentive for groovy based libraries to be developed when there are already so many good java one's out there, thus making groovy appear to be a Java dependent language with minor scripting features. So right now I am wondering if I could switch to Groovy as a scripting language or continue to use a more common scripting language such as Perl, Python or Ruby.

    Read the article

  • .NET C# : Image Conversion from Bitmap to Icon doesn't seem to work

    - by contactmatt
    I have a simple function that takes a bitmap, and converts the bitmap to an ICON format. Below is the function. (I placed literal values in place of the variables) Bitmap tempBmp = new Bitmap(@"C:\temp\mypicture.jpeg"); Bitmap bmp = new Bitmap(tempBmp, 16, 16); bmp.Save("@C:\temp\mypicture2.ico", ImageFormat.Icon) It doesn't seem to be converting correctly...or so I think. After the image is converted, some browsers do not reconigze the image as a true "ICON" , and even Visual Studio 2008 doesn't reconigze the image as an icon after its converted to an Icon format. For example, I was going to set the Icon property for my Win32 form app with the Icon i just converted. I open the dialouge box and select the icon I just converted and get the following error. -- "Argument 'picture' must be a picture that can be used as a Icon." I've browsed the web and come across complicated code where people take the time to manually convert the bitmap to different formats, but I would think the above code should work, and that the .NET framework would take care of this conversion.

    Read the article

  • Image Conversion from Bitmap to Icon doesn't seem to work

    - by contactmatt
    I have a simple function that takes a bitmap, and converts the bitmap to an ICON format. Below is the function. (I placed literal values in place of the variables) Bitmap tempBmp = new Bitmap(@"C:\temp\mypicture.jpeg"); Bitmap bmp = new Bitmap(tempBmp, 16, 16); bmp.Save("@C:\temp\mypicture2.ico", ImageFormat.Icon) It doesn't seem to be converting correctly...or so I think. After the image is converted, some browsers do not reconigze the image as a true "ICON" , and even Visual Studio 2008 doesn't reconigze the image as an icon after its converted to an Icon format. For example, I was going to set the Icon property for my Win32 form app with the Icon i just converted. I open the dialouge box and select the icon I just converted and get the following error. -- "Argument 'picture' must be a picture that can be used as a Icon." I've browsed the web and come across complicated code where people take the time to manually convert the bitmap to different formats, but I would think the above code should work, and that the .NET framework would take care of this conversion.

    Read the article

  • Visual Studio Conversion Suite

    - by KingPop
    I have this as my conversion program for the "Length", how can I do it the simpliest way instead of keeping the if, elseif, else too much, i do not have much experience and trying to improve my programming skills on visual studio 2008. Basically, I get annoyed with the formulas because I don't know if it is right, I use google but doesn't help because i don't know how to get it right when the program converts from type to type. Public Class Form2 Dim Metres As Integer Dim Centimetres As Integer Dim Inches As Integer Dim Feet As Integer Dim Total As Integer Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ErrorMsg.Hide() End Sub Private Sub btnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvert.Click Metres = 1 Centimetres = 0.01 Inches = 0.0254 Feet = 0.3048 txtTo.Text = 0 If txtFrom.Text <> "" Then If IsNumeric(txtFrom.Text) And IsNumeric(txtTo.Text) Then If cbFrom.Text = "Metres" And cbTo.Text = "Centimetres" Then Total = txtFrom.Text * Metres txtTo.Text = Total ElseIf cbFrom.Text = "Metres" And cbTo.Text = "Inches" Then Total = txtFrom.Text * 100 txtTo.Text = Total ElseIf cbFrom.Text = "Metres" And cbTo.Text = "Feet" Then ElseIf cbFrom.Text = "Centimetres" And cbTo.Text = "Metres" Then ElseIf cbFrom.Text = "Centimetres" And cbTo.Text = "Inches" Then ElseIf cbFrom.Text = "Centimetres" And cbTo.Text = "Feet" Then ElseIf cbFrom.Text = "Inches" And cbTo.Text = "Metres" Then ElseIf cbFrom.Text = "Inches" And cbTo.Text = "Centimetres" Then ElseIf cbFrom.Text = "Inches" And cbTo.Text = "Feet" Then ElseIf cbFrom.Text = "Feet" And cbTo.Text = "Metres" Then ElseIf cbFrom.Text = "Feet" And cbTo.Text = "Centimetres" Then ElseIf cbFrom.Text = "Feet" And cbTo.Text = "Inches" Then End If End If End If End Sub End Class This is the source for what I have done at the moment.

    Read the article

  • Reference-type conversion operators: asking for trouble?

    - by Ben
    When I compile the following code using g++ class A {}; void foo(A&) {} int main() { foo(A()); return 0; } I get the following error messages: > g++ test.cpp -o test test.cpp: In function ‘int main()’: test.cpp:10: error: invalid initialization of non-const reference of type ‘A&’ from a temporary of type ‘A’ test.cpp:6: error: in passing argument 1 of ‘void foo(A&)’ After some reflection, these errors make plenty of sense to me. A() is just a temporary value, not an assignable location on the stack, so it wouldn't seem to have an address. If it doesn't have an address, then I can't hold a reference to it. Okay, fine. But wait! If I add the following conversion operator to the class A class A { public: operator A&() { return *this; } }; then all is well! My question is whether this even remotely safe. What exactly does this point to when A() is constructed as a temporary value? I am given some confidence by the fact that void foo(const A&) {} can accept temporary values according to g++ and all other compilers I've used. The const keyword can always be cast away, so it would surprise me if there were any actual semantic differences between a const A& parameter and an A& parameter. So I guess that's another way of asking my question: why is a const reference to a temporary value considered safe by the compiler whereas a non-const reference is not?

    Read the article

  • Using string constants in implicit conversion

    - by kornelijepetak
    Consider the following code: public class TextType { public TextType(String text) { underlyingString = text; } public static implicit operator String(TextType text) { return text.underlyingString; } private String underlyingString; } TextType text = new TextType("Something"); String str = text; // This is OK. But I want to be able do the following, if possible. TextType textFromStringConstant = "SomeOtherText"; I can't extend the String class with the TextType implicit operator overload, but is there any way to assign a literal string to another class (which is handled by a method or something)? String is a reference type so when they developed C# they obviously had to use some way to get a string literal to the class. I just hope it's not hardcoded into the language.

    Read the article

  • Which programming language should i choose? (much more info inside) [closed]

    - by Andreas
    I am not completely sure if this is the right place to put this question, but since it's the programming thread I guessed that there's many experienced programmers here. :) Ok, hello! My name is Andreas and I am a 16 years old guy from Norway. For some time now I've wanted to learn a programming language. Six months ago I started learning C++, but quit withing a week due to lack of motivation. The same thing happend only 2 months ago when I tried to learn Lua. I wanted to program mods to the game Garry's mod, and was really motivated. Then I stopped playing the game, and the programming stopped with it. Today though I am ready again. The only difference is that I am not completely sure what I want to do with the language. I only want to create something, and I miss the progress of failing and enduring hard work until I finally solve the problem I've worked on for hours. What I am trying to say is; Is there any program out there that allows me, a complete noob (I didn't learn that much in a week, so I like to call myself a beginner), to create apps, mods or something similar but at the same time being qualified as a first time language? I was thinking of Java, because Android, Minecraft and many other applications and games use it. But I've heard that it is going to be replaced by a program called HTML 5 (whatever that is), is this true? I certainly don't want to spend many hours of my life on something that is useless in a year or two. Hopefully I didn't make this too complicated. I know that it is hard to recommend something when I don't have a goal, but I really don't know what to say. Have a good day kind folks! - Andreas EDIT:* I did not know that this was an off topic question, really sorry!

    Read the article

  • Windows cannot determine which language to install ?

    - by Mohammad
    I'm gonna install Windows Server 2008 SP2 on VMware Workstation 7.0.1 build-227600. But in installation I receive the following error and Windows doesn't continue installing procedure. Windows cannot determine which language to install ? What's wrong with it? Could you please guide me? Thanks.

    Read the article

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