Search Results

Search found 7 results on 1 pages for 'simi'.

Page 1/1 | 1 

  • Python sorting list of dictionaries by multiple keys

    - by simi
    I have a list of dicts: b = [{u'TOT_PTS_Misc': u'Utley, Alex', u'Total_Points': 96.0}, {u'TOT_PTS_Misc': u'Russo, Brandon', u'Total_Points': 96.0}, {u'TOT_PTS_Misc': u'Chappell, Justin', u'Total_Points': 96.0}, {u'TOT_PTS_Misc': u'Foster, Toney', u'Total_Points': 80.0}, {u'TOT_PTS_Misc': u'Lawson, Roman', u'Total_Points': 80.0}, {u'TOT_PTS_Misc': u'Lempke, Sam', u'Total_Points': 80.0}, {u'TOT_PTS_Misc': u'Gnezda, Alex', u'Total_Points': 78.0}, {u'TOT_PTS_Misc': u'Kirks, Damien', u'Total_Points': 78.0}, {u'TOT_PTS_Misc': u'Worden, Tom', u'Total_Points': 78.0}, {u'TOT_PTS_Misc': u'Korecz, Mike', u'Total_Points': 78.0}, {u'TOT_PTS_Misc': u'Swartz, Brian', u'Total_Points': 66.0}, {u'TOT_PTS_Misc': u'Burgess, Randy', u'Total_Points': 66.0}, {u'TOT_PTS_Misc': u'Smugala, Ryan', u'Total_Points': 66.0}, {u'TOT_PTS_Misc': u'Harmon, Gary', u'Total_Points': 66.0}, {u'TOT_PTS_Misc': u'Blasinsky, Scott', u'Total_Points': 60.0}, {u'TOT_PTS_Misc': u'Carter III, Laymon', u'Total_Points': 60.0}, {u'TOT_PTS_Misc': u'Coleman, Johnathan', u'Total_Points': 60.0}, {u'TOT_PTS_Misc': u'Venditti, Nick', u'Total_Points': 60.0}, {u'TOT_PTS_Misc': u'Blackwell, Devon', u'Total_Points': 60.0}, {u'TOT_PTS_Misc': u'Kovach, Alex', u'Total_Points': 60.0}, {u'TOT_PTS_Misc': u'Bolden, Antonio', u'Total_Points': 60.0}, {u'TOT_PTS_Misc': u'Smith, Ryan', u'Total_Points': 60.0}] and I need to use a multi key sort reversed by Total_Points, then not reversed by TOT_PTS_Misc. This can be done at the command prompt like so: a = sorted(b, key=lambda d: (-d['Total_Points'], d['TOT_PTS_Misc'])) But I have to run this through a function, where I pass in the list and the sort keys. For example, def multikeysort(dict_list, sortkeys):. How can the lambda line be used which will sort the list, for an arbitrary number of keys that are passed in to the multikeysort function, and take into consideration that the sortkeys may have any number of keys and those that need reversed sorts will be identified with a '-' before it?

    Read the article

  • Clock problem with FTDIchip FT2232 MPSSE mode

    - by Simi
    Hello, I'm trying to write/read to an extern device connected to a FTDIchip FT2232 MPSSE mode using SPI. I'm using the SPI function given by FTDI for Labview. I'm doing this: Open_Device - Init_Device - Write/Read - Close_Device The problem is that I don't have a clock signal on the scope when I try to read/write. Do you have a solution? Thanks

    Read the article

  • No clock with FTDIchip FT2232 MPSSE mode

    - by Simi
    Hello, I'm trying to write/read to an extern device connected to a FTDIchip FT2232 MPSSE mode using SPI. I'm using the SPI function given by FTDI for Labview. I'm doing this: Open_Device - Init_Device - Write/Read - Close_Device The problem is that I don't have a clock signal on the scope when I try to read/write. Do you have a solution? Thanks

    Read the article

  • CTP 4 de Juneau disponible : la boite à outils de développement pour SQL Server apporte un nouvel explorateur d'objets pour Visual Studio

    CTP 4 de Juneau disponible : la boite à outils de développement pour SQL Server apporte un nouvel explorateur d'objets pour Visual Studio Microsoft vient de publier une nouvelle version des outils de développement pour SQL Server (SSDT). Encore au stade de CTP 4 T( Community Technology Preview), le SDK pour le gestionnaire de base de données de Microsoft baptisé Juneau, apporte plusieurs améliorations et de nouvelles fonctionnalités pour la prise en charge de Denali. Juneau intègre un explorateur d'objets pour Visual Studio, qui permet d'explorer les tables et les vues de la base de données auquel le développeur est connecté. Dénommée SQL Server Object Explorer (SSOX), cette extension fonctionne de façon simi...

    Read the article

  • How Do I See The Final Text Of A Query Resulting From A Call To mysqli->prepare?

    - by Joshua
    After code like this: $stmt = $mysqli->prepare("SELECT District FROM City WHERE Name=?")) { $stmt->bind_param("s", $city); $stmt->execute(); $stmt->bind_result($district); $stmt->fetch(); printf("%s is in district %s\n", $city, $district); How Do I See The Actual SQL Statement That Was Executed? (It Should Look Something Like "SELECT District FROM City WHERE Name='Simi Valley';") I already realize that in this simplistic case it would be very easy to simply reconstruct the query... but how can I access it in a general way that will work for very complicated prepared statements, and cases where I don't necessarily already understand the intended structure of the query, etc. Isn't there some function or method that can be called on the statement object that will return the actual text of the SQL query, after binding?

    Read the article

  • Passing a list of files to javac

    - by Robert Menteer
    How can I get the javac task to use an existing fileset? In my build.xml I have created several filesets to be used in multiple places throughout build file. Here is how they have been defined: <fileset dir = "${src}" id = "java.source.all"> <include name = "**/*.java" /> </fileset> <fileset dir = "${src}" id = "java.source.examples"> <include name = "**/Examples/**/*.java" /> </fileset> <fileset dir = "${src}" id = "java.source.tests"> <include name = "**/Tests/*.java" /> </fileset> <fileset dir = "${src}" id = "java.source.project"> <include name = "**/*.java" /> <exclude name = "**/Examples/**/*.java" /> <exclude name = "**/Tests/**/*.java" /> </fileset> I have also used macrodef to compile the java files so the javac task does not need to be repeated multiple times. The macro looks like this: <macrodef name="compile"> <attribute name="sourceref"/> <sequential> <javac srcdir = "${src}" destdir = "${build}" classpathref = "classpath" includeantruntime = "no" debug = "${debug}"> <filelist dir="." files="@{sourceref}" /> <-- email is about this </javac> </sequential> What I'm trying to do is compile only the classes that are needed for specific targets not all the targets in the source tree. And do so without having to specify the files every time. Here are how the targets are defined: <target name = "compile-examples" depends = "init"> <compile sourceref = "${toString:java.source.examples}" /> </target> <target name = "compile-project" depends = "init"> <compile sourceref = "${toString:java.source.project}" /> </target> <target name = "compile-tests" depends = "init"> <compile sourceref = "${toString:java.source.tests}" /> </target> As you can see each target specifies the java files to be compiled as a simi-colon separated list of absolute file names. The only problem with this is that javac does not support filelist. It also does not support fileset, path or pathset. I've tried using but it treats the list as a single file name. Another thing I tried is sending the reference directly (not using toString) and using but include does not have a ref attribute. SO THE QUESTION IS: How do you get the javac task to use a reference to a fileset that was defined in another part of the build file? I'm not interested in solutions that cause me to have multiple javac tasks. Completely re-writting the macro is acceptable. Changes to the targets are also acceptable provided redundant code between targets is kept to a minimum. p.s. Another problem is that fileset wants a comma separated list. I've only done a brief search for a way to convert semi-colons to commas and haven't found a way to do that. p.p.s. Sorry for the yelling but some people are too quick to post responses that don't address the subject.

    Read the article

  • how use graphvis in C# application?

    - by ghasedak -
    i have a dot format file and i download graphvis for windows now how can i use graphvis to show a graph in my c# application? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using VDS.RDF; using VDS.RDF.Parsing; using VDS.RDF.Query; using System.IO; using System.Windows; using System.Runtime.InteropServices; using VDS.RDF.Writing; using System.Diagnostics; namespace WindowsFormsApplication2 { public partial class first : Form { Graph g = new Graph(); string s1 = null; /**************************************DATA********************************************/ public first() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Stream myStream = null; var parser = new Notation3Parser(); var graph = new Graph(); OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "RDF files (*.n3)|*.n3"; openFileDialog1.FilterIndex = 1; openFileDialog1.RestoreDirectory = true; openFileDialog1.Multiselect = false; if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { if ((myStream = openFileDialog1.OpenFile()) != null) { using (myStream) { string s = openFileDialog1.FileName.ToString(); string w= Directory.GetCurrentDirectory().ToString(); string Fname = openFileDialog1.SafeFileName.ToString(); File.Copy(s,Path.Combine(w,Fname),true); // Insert code to read the stream here. Win32.AllocConsole(); s1 = Path.Combine(w, Fname); insertNodeButton.Visible = true; delBut.Visible = true; simi.Visible = true; showNodes showNodes1 = new showNodes(s1); g = showNodes1.returngraph(); Console.Read(); Win32.FreeConsole(); // g.SaveToFile("firstfile.n3"); this.Show(); } } } catch (Exception ex) { MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message); } } GraphVizWriter hi = new GraphVizWriter(); hi.Save(g, "c:\\ahmad.dot"); } private void button2_Click(object sender, EventArgs e) { string strCmdLine = Application.StartupPath + "\\Tools\\rdfEditor.exe"; //string strCmdLine = "DIR"; MessageBox.Show(strCmdLine); System.Diagnostics.Process process1; process1 = new System.Diagnostics.Process(); //Do not receive an event when the process exits. process1.EnableRaisingEvents = false; //The "/C" Tells Windows to Run The Command then Terminate System.Diagnostics.Process.Start(strCmdLine); process1.Close(); } private void Form1_Load(object sender, EventArgs e) { } private void insertNodeButton_Click(object sender, EventArgs e) { //Graph parentvalue = this.g; //String parentvalueadress = this.s1; addTriple a1 = new addTriple(); a1.G = g; a1.BringToFront(); a1.ShowDialog(); g = a1.G; g.SaveToFile("c:\\Hi.n3"); } this is my code i want to visul saly dot file format to show a graph with graphvis

    Read the article

1