Search Results

Search found 3322 results on 133 pages for 'equivalent'.

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

  • What is C# equivalent of PHP's mysql_fetch_array function?

    - by Mike Biff
    I am learning C#/ASP.NET and I am wondering what the C# equivalent of the following PHP code is? I know the userid, and I want to fetch the rows from this table into the array of the variable "row", so I then can use it as "row['name']" and "row['email']. $result = mysql_query("SELECT email, name FROM mytable WHERE id=7"); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { printf("Email: %s Name: %s", $row["email"], $row["name"]); } Thanks.

    Read the article

  • Python equivalent of IDL's stop and .reset

    - by Jamie
    Hi there, I'm relatively new to python but have a bit of experience using IDL. I was wondering if anyone knows if there are equivalent commands in python for IDL's stop and .reset commands. If I'm running some IDL script I wrote that I put a stop command in, essentially what it does is stop the script there and give me access to the command line in the middle of the script. So I have access to all the functions and variables that I defined before the stop command, which I find really useful for debugging. The .reset command I find extremely useful too. What it does is reset the the IDL environment (clears all variables, functions, etc.). It's as if I closed that session and opened a new one, but without having to exit and restart IDL. I find that if I'm trying to debug a script I wrote it's useful sometimes to start from scratch and not have to reset IDL (or python now). It would be useful also in python to be able to un-import any modules I had previously imported. Any help with these issues would be greatly appreciated. Cheers Related Python Drop into REPL Is it possible to go into ipython from code?

    Read the article

  • Is there an equivalent in Scala to Python's more general map function?

    - by wheaties
    I know that Scala's Lists have a map implementation with signature (f: (A) => B):List[B] and a foreach implementation with signature (f: (A) => Unit):Unit but I'm looking for something that accepts multiple iterables the same way that the Python map accepts multiple iterables. I'm looking for something with a signature of (f: (A,B) => C, Iterable[A], Iterable[B] ):Iterable[C] or equivalent. Is there a library where this exists or a comparable way of doing similar?

    Read the article

  • How do I assert that two arbitrary type objects are equivalent, without requiring them to be equal?

    - by Tomas Lycken
    To accomplish this (but failing to do so) I'm reflecting over properties of an expected and actual object and making sure their values are equal. This works as expected as long as their properties are single objects, i.e. not lists, arrays, IEnumerable... If the property is a list of some sort, the test fails (on the Assert.AreEqual(...) inside the for loop). public void WithCorrectModel<TModelType>(TModelType expected, string error = "") where TModelType : class { var actual = _result.ViewData.Model as TModelType; Assert.IsNotNull(actual, error); Assert.IsInstanceOfType(actual, typeof(TModelType), error); foreach (var prop in typeof(TModelType).GetProperties()) { Assert.AreEqual(prop.GetValue(expected, null), prop.GetValue(actual, null), error); } } If dealing with a list property, I would get the expected results if I instead used CollectionAssert.AreEquivalent(...) but that requires me to cast to ICollection, which in turn requries me to know the type listed, which I don't (want to). It also requires me to know which properties are list types, which I don't know how to. So, how should I assert that two objects of an arbitrary type are equivalent? Note: I specifically don't want to require them to be equal, since one comes from my tested object and one is built in my test class to have something to compare with.

    Read the article

  • What's the equivalent name of "procedure" in OOP?

    - by AeroCross
    In several of my programming courses in the University, my teachers always told me the following: A function and a procedure are basically the same thing: the only difference is that a function returns a value, and the procedure doesn't. That means that this: function sum($a, $b) { return $a + $b; } ... is a function, and this: function sum($a, $b) { echo $a + $b; } ... is a procedure. In the same train of thought, I've seen that a method is the equivalent of a function in the OOP world. That means that this: class Example { function sum($a, $b) { return $a + $b; } } Is a method — but how do you call this? class Example { function sum($a, $b) { echo $a + $b; } } What's the equivalent name, or how do you call a method that doesn't returns anything?

    Read the article

  • SQL SERVER – Difference Between CURRENT_TIMESTAMP and GETDATE() – CURRENT_TIMESTAMP Equivalent in SQL Server

    - by pinaldave
    A common question – I often get from Oracle/MySQL Professionals: “What is the Equivalent to CURRENT_TIMESTAMP in SQL Server?” Here is a common question I often get from SQL Server Professionals: “What are differences between Difference Between CURRENT_TIMESTAMP and GETDATE ()?” Very simple question but have showed up so frequently that I feel like to write about it. Well in SQL Server GETDATE() is Equivalent to CURRENT_TIMESTAMP. However, if you use CURRENT_TIMESTAMP in your select statement it will work fine. You can see in the above example – both of them returns the same value. Now let us go to next question regarding difference between GETDATE and CURRENT_TIMESTAMP. Well, the matter of the fact, there is no difference between them in SQL Server (Reference Link). CURRENT_TIMESTAMP is an ANSI SQL function, whereas GETDATE is T-SQL implementation of the same function. Both of them derive value from the operating system of the computer on which SQL Server instance is running. Above discussion prompts another question – in this case, what should one use GETDATE or CURRENT_TIMESTAMP? Well, this is indeed tricky and interesting question. I think I am very comfortable using the GETDATE () so I will go to use it but a matter of the fact there is no right or wrong answer. If you want to follow ancient saying “When in Rome, do as the Romans do”, I suggest using the GETDATE (), or continue using CURRENT_TIMESTAMP. With that said, there is one very important property we all need to keep in mind. If you use CURRENT_TIMESTAMP while creating an object, they are automatically converted to GETDATE() and stored internally. To illustrate what I am suggesting here is the example - Create a table using the following script CREATE TABLE [dbo].[TestTable]( [Cold2] [datetime] NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[TestTable] ADD DEFAULT (CURRENT_TIMESTAMP) FOR [Cold2] GO Now go to SSMS and generate the script for the table and you will notice following syntax. CREATE TABLE [dbo].[TestTable]( [Cold2] [datetime] NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[TestTable] ADD DEFAULT (GETDATE()) FOR [Cold2] GO You can notice that SQL Server have automatically converted CURRENT_TIMESTAMP to GETDATE(). I guess this gives us an idea how they behave. Now go ahead and make your choice! Do let me know which one will you use CURRENT_TIMESTAMP or GETDATE () in the comments area. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL DateTime, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Equivalent to Freedom and/or Anti-Social?

    - by mummey
    Freedom: http://macfreedom.com/ Anti-Social: http://anti-social.cc/ Simply put: Where can I find a equivalent to either-or/both these apps? Note: Part of the appeal of these apps is allowing the user to explicitly make it extra difficult to re-enable these services. Unplugging the network cable might seem to achieve the same results from an glance, but the added difficulty in re-enabling those services is what makes these apps valuable.

    Read the article

  • SQL Server Substr Equivalent

    - by Derek D.
    The oracle function equivalent to the SQL Server function of Substr is: Substring. All spelled out. This function is actually identical to Oracle’s function.DECLARE @BaseString varchar(max)SET @BaseString = 'My grandmothers pillows are blue'SELECT SUBSTRING ( @BaseString -- The base string to extract from ,4 -- Start Position ,5 -- Length of Characters )The above query returns the value ‘grand’. Related Posts:»SQL Server Contains [...]

    Read the article

  • VB alternative/equivalent for development of Windows apps in Ubuntu

    - by Nirmik
    I want to develop a simple form for an Invoice for the user to use on Windows. I learnt how to do it using Visual basic in Windows. It's the simplest way to make a GUI for Windows I suppose. I am going to link it to a database at the backend. I want an alternative or equivalent software that will provide me with similar drag-and-drop feature enabled programing and GUI designing that will help me crate an application that will run on Windows.

    Read the article

  • Object-Oriented equivalent of LISP's progn function?

    - by Archer
    I'm currently writing a LISP parser that iterates through some AutoLISP code and does its best to make it a little easier to read (changing prefix notation to infix notation, changing setq assignments to "=" assignments, etc.) for those that aren't used to LISP code/only learned object oriented programming. While writing commands that LISP uses to add to a "library" of LISP commands, I came across the LISP command "progn". The only problem is that it looks like progn is simply executing code in a specific order and sometimes (not usually) assigning the last value to a variable. Am I incorrect in assuming that for translating progn to object-oriented understanding that I can simply forgo the progn function and print the statements that it contains? If not, what would be a good equivalent for progn in an object-oriented language?

    Read the article

  • mac's .dll equivalent

    - by kalaracey
    Hello all-- so, a DLL is similar to a folder, but it allows for multiple programs/executables to access it at once, thus conserving memory (I think). What is Mac's equivalent of a DLL? I was looking through the Google Chrome folders inside ~/Library/Application Support, and instead of the regular Windows Default.dll there was just a folder, "Default" as a regular file, with contents, I assume, would regularly be inside the DLL. Does the Mac equivalent provide the same function?

    Read the article

  • MacOS' dll equivalent

    - by kalaracey
    Hello all-- so, a DLL is similar to a folder, but it allows for multiple programs/executables to access it at once, thus conserving memory (I think). What is Mac's equivalent of a DLL? I was looking through the Google Chrome folders inside ~/Library/Application Support, and instead of the regular Windows Default.dll there was just a folder, "Default" as a regular file, with contents, I assume, would regularly be inside the DLL. Does the Mac equivalent provide the same function?

    Read the article

  • C# equivalent of Java Punctuation regex

    - by user325099
    I'm looking to find the equivalent in C# for the equivalent of this regex. Java: public static final String expression = "[\s\p{Punct}]"; {Punct} is a reserved character class in Java but I'm not sure how to create the equivalent expression so that the .net regex engine doesn't barf.

    Read the article

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