Search Results

Search found 17924 results on 717 pages for 'z order'.

Page 138/717 | < Previous Page | 134 135 136 137 138 139 140 141 142 143 144 145  | Next Page >

  • Alternatives to C++ Reference/Pointer Syntax

    - by Jon Purdy
    What languages other than C and C++ have explicit reference and pointer type qualifiers? People seem to be easily confused by the right-to-left reading order of types, where char*& is "a reference to a pointer to a character", or a "character-pointer reference"; do any languages with explicit references make use of a left-to-right reading order, such as &*char/ref ptr char? I'm working on a little language project, and legibility is one of my key concerns. It seems to me that this is one of those questions to which it's easy for a person but hard for a search engine to provide an answer. Thanks in advance!

    Read the article

  • Alternates to C++ Reference/Pointer Syntax

    - by Jon Purdy
    What languages other than C and C++ have explicit reference and pointer type qualifiers? People seem to be easily confused by the right-to-left reading order of types, where char*& is "a reference to a pointer to a character", or a "character-pointer reference"; do any languages with explicit references make use of a left-to-right reading order, such as &*char/ref ptr char? I'm working on a little language project, and legibility is one of my key concerns. It seems to me that this is one of those questions to which it's easy for a person but hard for a search engine to provide an answer. Thanks in advance!

    Read the article

  • Neat way of gettings position of my Object in linq collections

    - by Steve
    I currently have a object called Week. A week is part of a Season object. the season can contain many weeks. What I want to do is find the position of my week (is it the first week in the season (so #1) or is it the second (so #2). int i = 0; foreach ( var w in Season.Weeks.OrderBy(w => w.WeekStarts)){ if(w.Id == Id){ return i; } i+=1; } At the moment this is what I have. I order the weeks in a second by there start date to make sure they are in the correct order. and I cycle through them until I find the week that matches the week I am currently looking at. and return the int that I have been counting up.. I feel there should be a easier linq way to do this as it feels pretty messy!

    Read the article

  • Delete an object from a tree

    - by mqpasta
    I have a Find function in order to find an element from a BST private Node Find(ref Node n, int e) { if (n == null) return null; if (n.Element == e) return n; if (e > n.Element) return Find(ref n.Right, e); else return Find(ref n.Left, e); } and I use following code in order to get a node and then set this node to null. Node x = bsTree.Find(1); x = null; bsTree.Print(); supposedly, this node should be deleted from Tree as it is set to null but it still exists in tree. I had done this before but this time missing something and no idea what.

    Read the article

  • Sort collection within collection using Linq

    - by user327066
    Hi, I have a one-to-many Linq query and I would like to sort on a property within the "many" collection. For example in the pseudo-code below, I am returned a List from the Linq query but I would like to sort / order the Products property based on the SequenceNumber property of the Product class. How can I do this? Any information is appreciated. Thanks. class Order { int OrderId; List<Product> Products; } class Product { string name; int SequenceNumber; }

    Read the article

  • Using Drools to provide error processing and consequence management

    - by Mike
    Hi, I am working on a module whose purpose is to process Java exceptions and decide upon a strategy for dealing with them. The exceptions could be things I know about (explicit business exceptions eg TransformationException) or more general environmental stuff (JMS errors, IO errors etc) The facts inserted into the knowledge base are all the same class, and wrap (contain) an Exception. I want to write a rule that will explicitly match the exceptions I know how to deal with (eg TransformationException) and have another rule that catches 'everything else' The problem seems to me to be that for a fact containing a TransformationException, both rules will fire and the output will be uncertain. How would I go about writing such exclusive rules without relying on salience to steer the order of execution (this seems to be bad practice from what I have read)? I have a solution in place that I am not happy with whereby the outcome depends on the order in which the rules are defined in my .drl.

    Read the article

  • C#: split a string into runs of characters, numbers and delimited strings and process it

    - by nrkn
    OK my regex is a bit rusty and I've been struggling with this particular problem... I need to split and process a string containing any number of the following, in any order: Chars (lowercase letters only) Quote delimited strings Ints The strings are pretty weird (I don't have control over them). When there's more than one number in a row in the string they're seperated by a comma. They need to be processed in the same order that they appeared in the original string. For example, a string might look like: abc20a"Hi""OK"100,20b With this particular string the resulting call stack would look a bit like: ProcessLetters( new[] { 'a', 'b', 'c' } ); ProcessInts( 20 ); ProcessLetters( 'a' ); ProcessStrings( new[] { "Hi", "OK" } ); ProcessInts( new[] { 100, 20 } ); ProcessLetters( 'b' ); What I could do is treat it a bit like CSV, where you build tokens by processing the characters one at a time, but I think it could be more easily done with a regex?

    Read the article

  • SQL to return the rownum of a specific row? (using Oracle db)

    - by jedierikb
    In Oracle 10g, I have this SQL: select dog.id as dogId from CANINES dog order by dog.codename asc which returns: id -- 204 203 206 923 I want to extend this query to determine the oracle rownum of a dog.id in this resultset. I have tried select rownum from (select dog.id as dogId from CANINES dog order by dog.codename asc) where dog.id=206 But this does not work out very well (it returns 1 no matter which dog.id I match on). I was expecting to get back 3. Thanks for your help! Notes http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html I am pretty sure I do not need to use rowid

    Read the article

  • Have to put files in static_dir but need to read them afterwards

    - by SanjamX
    I just started using google app engine. In order to use templates, I'm using jinja2. I want to add images dynamically after I set the width and height of the img tag. I used PIL in order to read the image size and put the one I want. However when I open the image with PIL, I need it not to be in a static_dir and to put the image in the img tag, I need it to be in the static_dir. As a testing solution I've copied the folder to see if I get results and I did. But as you can see having each image saved twice is kind of bad.

    Read the article

  • Rails fixtures seem to be adding extra unexpected data

    - by Mason Jones
    Hello, all. I've got a dynamic fixture CSV file that's generating predictable data for a table in order for my unit tests to do their thing. It's working as expected and filling the table with the data, but when I check the table after the tests run, I'm seeing a number of additional rows of "blank" data (all zeros, etc). Those aren't being created by the fixture, and the unit tests are read-only, just doing selects, so I can't blame the code. There doesn't seem to be any logging done during the fixtures setup, so I can't see when the "blank" data is being inserted. Anyone ever run across this before, or have any ideas of how to log or otherwise see what the fixture setup is doing in order to trace down the source of the blank data?

    Read the article

  • Macro - To create one [.csv] file from/using multiple workbooks, kept in a folder, containing multi

    - by AJ
    Hello, I have more than one Excel Workbooks containing multiple worksheets in each of them. I would like to have a macro which help me to create (combine the information from) all the worksheets into one pipe [|] delimited [.csv] file. These sheets should be combined/appended into the [.csv] file, in the same order these worksbooks appear in a folder and in the order sheets appear in these workbooks. The macro should ask for a delimiter/separator specific to me and the input and output path based on my selection. It would be great if the output [.csv] file is names as "foldername" + "Output.csv" Thank you, Best Regards - AJ

    Read the article

  • problem using default_scope on a model table

    - by DannyRe
    Hey. In my controller/index action I use the following query: @course_enrollments = current_user.course_enrollments This is what my table looks like. It is referencing a course table. The course table has a colum 'title'. create_table "course_enrollments", :force => true do |t| t.integer "user_id", :null => false t.integer "course_id", :null => false t.datetime "created_at" t.datetime "updated_at" end I want to be able to order my course_enrollments by course in my index view. Furthermore Id like to do a default_scope in my model, like this: default_scope :order => 'title asc' any suggestions? Thx for your time

    Read the article

  • C++ object in memory

    - by Neo_b
    Hello. Is there a standard in storing a C++ objects in memory? I wish to set a char* pointer to a certain address in memory, so that I can read certain objects' variables directly from the memory byte by byte. When I am using Dev C++, the variables are stored one by one right in the memory address of an object in the order that they were defined. Now, can it be different while using a different compiler (like the variables being in a different order, or somewhere else)? Thank you in advance. :-)

    Read the article

  • Android: How to close a cursor that returns from Class to Activity

    - by Daniel
    I have: Accounts.java public class Accounts{ private SQLiteDatabase dbConfig; public Cursor list(Context context, String db, String where, String order) { DBHelper dbHelper = new DBHelper(context, db); dbConfig = dbHelper.getReadableDatabase(); Cursor c = dbConfig.query("accounts", new String[]{ "iId","sName"}, where, null, null, null, order); return c; } } and: MainActivity.java Accounts account = new Accounts(); Cursor cursor = account.list(getApplicationContext(), globalDB, null, null); while (cursor.moveToNext()) { int id = cursor.getInt(0); String name = cursor.getString(1); } cursor.close(); Running my application I get some logcat messages like: close() was never explicitly called on database... What is the best way to prevent it? How can I close a Cursor that returns from other class? Thanks

    Read the article

  • How can I specify a single .config file for multiple EXE projects in .NET

    - by Russ
    I have a project that I am breaking up into multiple .exe projects. I still plan on publishing them, using click once, into the same location at the same time, and I would like to use the same config file. I have added the app.config to each project using the "Add link" option in Visual Studio, which is great for debugging, but in production, when I compile each exe project, the app.config is not copied into the "master project"'s bin folder. example: master.exe with master.exe.config master.exe may launch order.exe based on user settings master.exe may launch returns.exe based on user settings master, order, and returns will all reside in the same folder, and should share a single config file.

    Read the article

  • Arabic SQL query (on Oracle DB) returns empty result

    - by unprecedented
    I have this query (that runs on Oracle 10g database): SELECT ge.*, ge.concept AS glossarypivot FROM s_glossary_entries ge WHERE (ge.glossaryid = '161' OR ge.sourceglossaryid = '161') AND (ge.approved != 0 OR ge.userid = 361) AND concept = '?' ORDER BY ge.concept The query must display all words that begin with the arabic letter "?" but unfortunately, it returns empty result .. However, if I run the same query on the same database which runs on MYSQL, it works well and displays the correct result .. What should I do in order to get this query working the right way on oracle 10 database? P.S. the oracle database character set is : "AL32UTF8" thank you so much in advance

    Read the article

  • Defining a select list through controller and view model

    - by Ibrar Hussain
    I have a View Model that looks like this: public class SomeViewModel { public SomeViewModel(IEnumerable<SelectListItem> orderTemplatesListItems) { OrderTemplateListItems = orderTemplatesListItems; } public IEnumerable<SelectListItem> OrderTemplateListItems { get; set; } } I then have an Action in my Controller that does this: public ActionResult Index() { var items = _repository.GetTemplates(); var selectList = items.Select(i => new SelectListItem { Text = i.Name, Value = i.Id.ToString() }).ToList(); var viewModel = new SomeViewModel { OrderTemplateListItems = selectList }; return View(viewModel); } Lastly my view: @Html.DropDownListFor(n => n.OrderTemplateListItems, new SelectList(Model.OrderTemplateListItems, "value", "text"), "Please select an order template") The code works fine and my select list populates wonderfully. Next thing I need to do is set the selected value that will come from a Session["orderTemplateId"] which is set when the user selects a particular option from the list. Now after looking online the fourth parameter should allow me to set a selected value, so if I do this: @Html.DropDownListFor(n => n.OrderTemplateListItems, new SelectList(Model.OrderTemplateListItems, "value", "text", 56), "Please select an order template") 56 is the Id of the item that I want selected, but to no avail. I then thought why not do it in the Controller? As a final attempt I tried building up my select list items in my Controller and then passing the items into the View: public ActionResult Index() { var items = _repository.GetTemplates(); var orderTemplatesList = new List<SelectListItem>(); foreach (var item in items) { if (Session["orderTemplateId"] != null) { if (item.Id.ToString() == Session["orderTemplateId"].ToString()) { orderTemplatesList.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString(), Selected = true }); } else { orderTemplatesList.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } } else { orderTemplatesList.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } } var viewModel = new SomeViewModel { OrderTemplateListItems = orderTemplatesList }; return View(viewModel); } Leaving my View like so: @Html.DropDownListFor(n => n.OrderTemplateListItems, new SelectList(Model.OrderTemplateListItems, "value", "text"), "Please select an order template") Nothing! Why isn't this working for me?

    Read the article

  • Duplicates in a sorted java array

    - by Max Frazier
    I have to write a method that takes an array of ints that is already sorted in numerical order then remove all the duplicate numbers and return an array of just the numbers that have no duplicates. That array must then be printed out so I can't have any null pointer exceptions. The method has to be in O(n) time, can't use vectors or hashes. This is what I have so far but it only has the first couple numbers in order without duplicates and then just puts the duplicates in the back of the array. I can't create a temporary array because it gives me null pointer exceptions. public static int[] noDups(int[] myArray) { int j = 0; for (int i = 1; i < myArray.length; i++) { if (myArray[i] != myArray[j]) { j++; myArray[j] = myArray[i]; } } return myArray; }

    Read the article

  • Simple interlinear gloss: aligned bilingual paragraph

    - by D W
    An interlinear gloss can be used to layout a translation of a document. http://en.wikipedia.org/wiki/Interlinear_gloss Usually this is done word-by-word or morpheme-by-morpheme. However, I would like to do this in a different way, translating entire paragraphs at a time. http://www.optimnem.co.uk/learning/spanish/three-little-pigs.php For now I am not interested in taking into account the order of words or phrases that change order between languages. That is, I don't mind if the words in the paragraph are not aligned or if the length of one paragraph is much longer than the other, causing an overhanging line. As far as I can tell, the following packages do not meet my needs: covingtn.sty cgloss4e.sty gb4e.sty lingmacros.sty - shortex

    Read the article

  • Using TDD: "top down" vs. "bottom up"

    - by Christian Mustica
    Since I'm a TDD newbie, I'm currently developing a tiny C# console application in order to practice (because practice makes perfect, right?). I started by making a simple sketchup of how the application could be organized (class-wise) and started developing all domain classes that I could identify, one by one (test first, of course). In the end, the classes have to be integrated together in order to make the application runnable, i.e. placing necessary code in the Main method which calls the necessary logic. However, I don't see how I can do this last integration step in a "test first" manner. I suppose I wouldn't be having these issues had I used a "top down" approach. The question is: how would I do that? Should I have started by testing the Main() method? If anyone could give me some pointers, it will be much appreciated.

    Read the article

  • accessing nth element (value) of a vector after sorting

    - by memC
    dear experts, This question is an extension of this question I asked. I have a std::vector vec_B.which stores instances of class Foo. The order of elements in this vector changes in the code. Now, I want to access the value of the current "last element" or current 'nth' element of the vector. If I use the code below to get the last element using getLastFoo() method, it doesn't return the correct value. For example, to begin with the last element of the vector has Foo.getNumber() = 9. After sorting it in descending order of num, for the last element, Foo.getNumber() = 0. But with the code below, it still returns 9.. that means it is still pointing to the original element that was the last element. What change should I make to the code below so that "lastFoo" points to the correct last element? class Foo { public: Foo(int i); ~Foo(){}; int getNum(); private: int num; }; Foo:Foo(int i){ num = i; } int Foo::getNum(){ return num; } class B { public: Foo* getLastFoo(); B(); ~B(){}; private: vector<Foo> vec_B; }; B::B(){ int i; for (i = 0; i< 10; i++){ vec_B.push_back(Foo(i)); } // Do some random changes to the vector vec_B so that elements are reordered. For // example rearrange elements in decreasing order of 'num' //... } Foo* B::getLastFoo(){ &vec_B.back(); }; int main(){ B b; Foo* lastFoo; lastFoo = b.getLastFoo() cout<<lastFoo->getNumber(); return 0; }

    Read the article

  • How to check if string contains a string in string array

    - by Abu Hamzah
    edit: the order might change as you can see in the below example, both string have same name but different order.... How would you go after checking to see if the both string array match? the below code returns true but in a reality its should return false since I have extra string array in the _check what i am trying to achieve is to check to see if both string array have same number of strings. string _exists = "Adults,Men,Women,Boys"; string _check = "Men,Women,Boys,Adults,fail"; if (_exists.All(s => _check.Contains(s))) //tried Equal { return true; } else { return false; }

    Read the article

  • Which relational databases exist with a public API for a high level language?

    - by Jens Schauder
    We typically interface with a RDBMS through SQL. I.e. we create a sql string and send it to the server through JDBC or ODBC or something similar. Are there any RDBMS that allow direct interfacing with the database engine through some API in Java, C#, C or similar? I would expect an API that allows constructs like this (in some arbitrary pseudo code): Iterator iter = engine.getIndex("myIndex").getReferencesForValue("23"); for (Reference ref: iter){ Row row = engine.getTable("mytable").getRow(ref); } I guess something like this is hidden somewhere in (and available from) open source databases, but I am looking for something that is officially supported as a public API, so one finds at least a note in the release notes, when it changes. In order to make this a question that actually has a 'best' answer: I prefer languages in the order given above and I will prefer mature APIs over prototypes and research work, although these are welcome as well.

    Read the article

< Previous Page | 134 135 136 137 138 139 140 141 142 143 144 145  | Next Page >