Search Results

Search found 137626 results on 5506 pages for 'linked lists using c'.

Page 11/5506 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • What does using mean in c++?

    - by user198729
    Like : using ::size_t; using ::fpos_t; using ::FILE; In fact it's a question inspired by the comment under this question: http://stackoverflow.com/questions/2532412/when-is-h-not-needed-to-include-a-header-file

    Read the article

  • What is the right way to do this HTML: header with icon linked

    - by Hell Awaits
    I know how to make these examples look and behave the same. But I would like to know which is the right way to build a HTML structure. <a><img><h1></h1></a> - looks wrong because an inline element is inside of a block element <a><img></a><h1><a></a></h1> - the same a-element is defined twice. Also I'm not sure about markup inside headers Any other solutions ?

    Read the article

  • Algorithms or patterns for a linked question and answer cost calculator

    - by kmc
    I've been asked to build an online calculator in PHP (and the Laravel framework). It will take the answers to a series of questions to estimate the cost of a home extension. For example, a couple of questions may be: What is the lie of your property? Flat, slightly inclined, heavily inclined. (these suggestive values could have specific values in the underlying calculator like, 0 degrees, 5 degrees, 10 degrees. What is your current flooring system? Wooden, or concrete? These would then impact the results of other questions. Once the size of the extension has been input, the lie of the land will affect how much site works will cost, and how much rubbish collection will cost. The second question will impact the cost of the extensions flooring, as stumping and laying floorboards is a different cost to laying foundations and a concrete slab. It will also influence what heating and cooling systems are available in the calculator. So it's VERY interlinked. The answer to any question can influence the options of other questions, and the end result. I'm having trouble figuring out an approach to this that will allow new options and questions to be plugged in at a later stage without having things too coupled. The Observer pattern, or Laravel's events may be handy, but currently the sheer breadth of the calculator has me struggling to gather my thoughts and see a sensible implementation. Are there any patterns or OO approaches that may help? Thanks!

    Read the article

  • How Social Media Marketing and SEO Are Inter-Linked

    Today successful marketer is the one who leverages advantages from both SEO as well as Social Media Marketing (SMM). Social Media (SM) flourishes where people are, and marketers propel there only. Earlier SMM used to be a standalone strategy but with time it was realized that if it is united with marketing efforts it could generate even better results rather than working in isolation.

    Read the article

  • applications linked to desktops

    - by ricoamor
    I have just upgraded to Ubuntu 12.04 and I found a weird behaviour in the multi-workspace management. Let's say that I have a couple of terminals opened in one workspace, and that I want to do something else in another workspace. I move to that workspace and then I click on the terminal icon. Immediately I am taken to the initial workspace. This is similar to the multiple workspace behaviour in Os X and it is entirely undesirable. How can I disable the application-workspace association in 12.04? Thanks

    Read the article

  • Linked List Design

    - by Jim Scott
    The other day in a local .NET group I attend the following question came up: "Is it a valid interview question to ask about Linked Lists when hiring someone for a .NET development position?" Not having a computer sciense degree and being a self taught developer my response was that I did not feel it was appropriate as I in 5 years of developer with .NET had never been exposed to linked lists and did not hear any compeling reason for a use for one. However the person commented that it is a very common interview question so I decided when I left that I would do some reasearch on linked lists and see what I might be missing. I have read a number of posts on stack overflow and various google searches and decided the best way to learn about them was to write my own .NET classes to see how they worked from the inside out. Here is my class structure Single Linked List Constructor public SingleLinkedList(object value) Public Properties public bool IsTail public bool IsHead public object Value public int Index public int Count private fields not exposed to a property private SingleNode firstNode; private SingleNode lastNode; private SingleNode currentNode; Methods public void MoveToFirst() public void MoveToLast() public void Next() public void MoveTo(int index) public void Add(object value) public void InsertAt(int index, object value) public void Remove(object value) public void RemoveAt(int index) Questions I have: What are typical methods you would expect in a linked list? What is typical behaviour when adding new records? For example if I have 4 nodes and I am currently positioned in the second node and perform Add() should it be added after or before the current node? Or should it be added to the end of the list? Some of the designs I have seen explaining things seem to expose outside of the LinkedList class the Node object. In my design you simply add, get, remove values and know nothing about any node object. Should the Head and Tail be placeholder objects that are only used to define the head/tail of the list? I require my Linked List be instantiated with a value which creates the first node of the list which is essentially the head and tail of the list. Would you change that ? What should the rules be when it comes to removing nodes. Should someone be able to remove all nodes? Here is my Double Linked List Constructor public DoubleLinkedList(object value) Properties public bool IsHead public bool IsTail public object Value public int Index public int Count Private fields not exposed via property private DoubleNode currentNode; Methods public void AddFirst(object value) public void AddLast(object value) public void AddBefore(object existingValue, object value) public void AddAfter(object existingValue, object value) public void Add(int index, object value) public void Add(object value) public void Remove(int index) public void Next() public void Previous() public void MoveTo(int index)

    Read the article

  • Problems using a library in Xcode

    - by Pablo
    Hi! I'm actually developping an application for iPhone and I need to use a library, initially dedicated to a Linux environment. Since I'm using a Mac (with Snow Leopard and Intel Core Duo), I guess it's possible to use this library in my app. My library has 3 files: a file .h, a file .a and a file .so (both .a and .so are in /Developer/usr/lib). In addition I have included the .h i nmy code and I've added the .a in XCode has a framework (and it works because XCode find the .so compiling). For your info when I use the command "file" for the file .so, I have: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped When I compile for the Xcode Simulator, I have a warning and an error. The warning is: In /Developer/usr/lib/mylib.so, file was built for unsupported file format which is not the architecture being linked (i386) The error is: "_mylib_fct", referenced from: -[MyAppAppDelegate applicationDidBecomeActive:] in MyAppAppDelegate.o Symbol(s) not found Collect2: ld returned 1 exit status When I compile for the Device 3.0 with architecture arm6, I also have the same error, but the warning is quite different: ln /Users/Pablo/MyApp/mylib.a file is not of required architecture I try to solve this and make the app working with this lib since days, and I don't understand why the compiler is complaining... is it a 32/64 bits issues ? How can I deal with that ? Your help will be very appreciated. Thx!

    Read the article

  • Active - like-minded Java mailing lists

    - by Lewis Robbins
    I need to find an active Java mailing list, I have looked onto the GNU Java mailing list, to my surprise there had been not too much activity this month, it also focused on any GNU related Java - I'd really help me progress my Java ability, if I had an active, likeminded Java mailing list. Questions' that are not suited to Stackoverflow, or provide little benefit to any user that see's the question: discussing a new API change; best practices; open source discussion; trivia type questions on Java ArrayList boxining-unboxing; Community atmosphere. I also read Jon Skeets blog post about his previous Java/C# mailing lists examples - I did not catch any names, though I did they would be of benefit to me, if I had access to any of them.

    Read the article

  • Point me to info about constructing filters (of lists)

    - by jah
    I would like some pointers to information which would help me understand how to go about providing the ability to filter a list of entities by their attributes as well as by attributes of related entities. As an example, imagine a web app which provides order management of some kind. Orders and related entities are stored in a relational database. And imagine that the app has an interface which lists the orders. The problem is: how does one allow the list to be filtered by, for example:- order number (an attribute) line item name (an attribute of a n-n related entity) some text in an administrative note related to the order (text found in an attribute of a 1-1 related entity) I'm trying to discover whether there is something like a standard, efficient way to construct the queries and the filtering form; or some possible strategies; or any theory on the topic; or some example code. My google foo fails me.

    Read the article

  • Uploading to TwitVid using x_verify_credentials_authorization

    - by deepa
    Hi, I am developing an iPhone application that uploads videos to TwitVid using the library TwitVid-iPhone-OAuth3. I have selected this library since Twitter is shifting to OAuth mechanism of authentication. 1) Does this new library allows to upload without user-name and password parameters? 2) I am using the following steps for uploading videos (assumed that new library allows to upload without user-name and password parameters). But, I am getting the error 'Incorrect Signature'. I am not able to identify the mistake that I am doing here. Could you please help me out to solve this problem. Authenticate the app using OAuth (MGTwitterEngine etc) which redirects the user to the web-page asking for log-in and app authentication. If the user authenticates the app, access token will obtained as final step. Upload the video to TwitVid using the following code snippet: OAuth *authorizer = [[OAuth alloc] initWithConsumerKey: @"my_consumer_key" andConsumerSecret: @"my_consumer_secret"]; authorizer.oauth_token = //The key-part of the access token obtained in step 2 authorizer.oauth_token_secret = //The secret-part of the access token obtained in step 2 authorizer.oauth_token_authorized = YES; //Since authenticated in steps 1 and 2 NSString *authHeader = [authorizer oAuthHeaderForMethod: @"POST" andUrl: @"https://api.twitter.com/1/account/verify_credentials.xml" andParams: nil]; twitVid = [[TwitVid alloc] init]; [mTwitVid setDelegate: self]; [mTwitVid authenticateWithXVerifyCredentialsAuthorization: authHeader xAuthServiceProvider: nil]; Thanks and Regards, Deepa

    Read the article

  • Using Reflection.Emit to emit a "using (x) { ... }" block?

    - by Lasse V. Karlsen
    I'm trying to use Reflection.Emit in C# to emit a using (x) { ... } block. At the point I am in code, I need to take the current top of the stack, which is an object that implements IDisposable, store this away in a local variable, implement a using block on that variable, and then inside it add some more code (I can deal with that last part.) Here's a sample C# piece of code I tried to compile and look at in Reflector: public void Test() { TestDisposable disposable = new TestDisposable(); using (disposable) { throw new Exception("Test"); } } This looks like this in Reflector: .method public hidebysig instance void Test() cil managed { .maxstack 2 .locals init ( [0] class LVK.Reflection.Tests.UsingConstructTests/TestDisposable disposable, [1] class LVK.Reflection.Tests.UsingConstructTests/TestDisposable CS$3$0000, [2] bool CS$4$0001) L_0000: nop L_0001: newobj instance void LVK.Reflection.Tests.UsingConstructTests/TestDisposable::.ctor() L_0006: stloc.0 L_0007: ldloc.0 L_0008: stloc.1 L_0009: nop L_000a: ldstr "Test" L_000f: newobj instance void [mscorlib]System.Exception::.ctor(string) L_0014: throw L_0015: ldloc.1 L_0016: ldnull L_0017: ceq L_0019: stloc.2 L_001a: ldloc.2 L_001b: brtrue.s L_0024 L_001d: ldloc.1 L_001e: callvirt instance void [mscorlib]System.IDisposable::Dispose() L_0023: nop L_0024: endfinally .try L_0009 to L_0015 finally handler L_0015 to L_0025 } I have no idea how to deal with that ".try ..." part at the end there when using Reflection.Emit. Can someone point me in the right direction?

    Read the article

  • Deleting a node in a circular linked list c++?

    - by angad Soni
    I was wondering if anyone could help me understand if this code for deleting a node from a circular linked list would work, or if there is something i'm missing out on. using c++ to code. void circularList::deleteNode(int x) { node *current; node *temp; current = this-start; while(current->next != this->start) { if(current->next->value == x) { temp = current->next; current->next = current->next->next; delete current->next; } } }

    Read the article

  • Why is 'using' improving C# performances

    - by Wernight
    It seems that in most cases the C# compiler could call Dispose() automatically. Like most cases of the using pattern look like: public void SomeMethod() { ... using (var foo = new Foo()) { ... } // Foo isn't use after here (obviously). ... } Since foo isn't used (that's a very simple detection) and since its not provided as argument to another method (that's a supposition that applies to many use cases and can be extended), the compiler could automatically call Dispose() without the developper requiring to do it. This means that in most cases the using is pretty useless if the compiler does some smart job. IDisposable seem low level enough to me to be taken in account by a compiler. Now why isn't this done? Wouldn't that improve the performances (if the developpers are... dirty).

    Read the article

  • Reconciling a new BindingList into a master BindingList using LINQ

    - by Neo
    I have a seemingly simple problem whereby I wish to reconcile two lists so that an 'old' master list is updated by a 'new' list containing updated elements. Elements are denoted by a key property. These are my requirements: All elements in either list that have the same key results in an assignment of that element from the 'new' list over the original element in the 'old' list only if any properties have changed. Any elements in the 'new' list that have keys not in the 'old' list will be added to the 'old' list. Any elements in the 'old' list that have keys not in the 'new' list will be removed from the 'old' list. I found an equivalent problem here - http://stackoverflow.com/questions/161432/ - but it hasn't really been answered properly. So, I came up with an algorithm to iterate through the old and new lists and perform the reconciliation as per the above. Before anyone asks why I'm not just replacing the old list object with the new list object in its entirety, it's for presentation purposes - this is a BindingList bound to a grid on a GUI and I need to prevent refresh artifacts such as blinking, scrollbars moving, etc. So the list object must remain the same, only its updated elements changed. Another thing to note is that the objects in the 'new' list, even if the key is the same and all the properties are the same, are completely different instances to the equivalent objects in the 'old' list, so copying references is not an option. Below is what I've come up with so far - it's a generic extension method for a BindingList. I've put comments in to demonstrate what I'm trying to do. public static class BindingListExtension { public static void Reconcile<T>(this BindingList<T> left, BindingList<T> right, string key) { PropertyInfo piKey = typeof(T).GetProperty(key); // Go through each item in the new list in order to find all updated and new elements foreach (T newObj in right) { // First, find an object in the new list that shares its key with an object in the old list T oldObj = left.First(call => piKey.GetValue(call, null).Equals(piKey.GetValue(newObj, null))); if (oldObj != null) { // An object in each list was found with the same key, so now check to see if any properties have changed and // if any have, then assign the object from the new list over the top of the equivalent element in the old list foreach (PropertyInfo pi in typeof(T).GetProperties()) { if (!pi.GetValue(oldObj, null).Equals(pi.GetValue(newObj, null))) { left[left.IndexOf(oldObj)] = newObj; break; } } } else { // The object in the new list is brand new (has a new key), so add it to the old list left.Add(newObj); } } // Now, go through each item in the old list to find all elements with keys no longer in the new list foreach (T oldObj in left) { // Look for an element in the new list with a key matching an element in the old list if (right.First(call => piKey.GetValue(call, null).Equals(piKey.GetValue(oldObj, null))) == null) { // A matching element cannot be found in the new list, so remove the item from the old list left.Remove(oldObj); } } } } It can be called like this: _oldBindingList.Reconcile(newBindingList, "MyKey") However, I'm looking for perhaps a method of doing the same using LINQ type methods such as GroupJoin<, Join<, Select<, SelectMany<, Intersect<, etc. So far, the problem I've had is that each of these LINQ type methods result in brand new intermediary lists (as a return value) and really, I only want to modify the existing list for all the above reasons. If anyone can help with this, would be most appreciated. If not, no worries, the above method (as it were) will suffice for now. Thanks, Jason

    Read the article

  • Using C++ is a Linked-List implementation without using pointers possible or not?

    - by sonicoder
    My question is very simply, can one using C++, implment a link-list data structure without using pointers (next nodes)? To further qualify my question, I'm mean can one create a Linked-List data structure using only class instantiations. A common node definition might be like so: template<typename T> struct node { T t; node<T>* next; node<T>* prev; }; I'm aware of std::list etc, I'm just curious to know if its possible or not - and if so how? code examples will be greatly appreciated.

    Read the article

  • Segmentation fault in a function to reverse a singly linked list recursivley.

    - by Amanda
    I am implementing a function to recursively reverse a linked-list, but getting seg-fault. typedef struct _node { int data; struct _node *next; } Node, *NodeP; NodeP recursiveReverseList(NodeP first){ if(first == NULL) return NULL; if(first->next == NULL) return first; NodeP rest = recursiveReverseList(first->next); rest->next = first; first->next = NULL; return first; } Can you please help? P.S. The iterative version is working fine though. Its not homework. Just practicing C. Thank you all :)

    Read the article

  • bulleted lists for plain-text documents in Vim

    - by AnC
    While Vim supports automatic indenting in lists, the default setting only covers ordered lists, starting with digits: 1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim 2. veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. I have not been able to figure out how to extend this to unordered, bulleted lists: * Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim * veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Changing the formatlistpat RegEx did not lead to the desired results (indeed, it even broke ordered lists). Any help would be appreciated!

    Read the article

  • "using" keyword in java

    - by DrDro
    In Java is there an equivalent to the C# "using" statement allowing to define a scope for an object: using (AwesomeClass hooray = new AwesomeClass) { // Great code } This has probably allready been asked but the keywords make it difficult to find a relevant question.

    Read the article

  • EPM 11.1.2 - Issues during configuration when using Oracle DB if not using UTF8

    - by Ahmed A
    If you see issues during configuration when using Oracle DB if not using UTF8: Workaround: a. During configuration of EPM products, a warning message is displayed if the Oracle DB is not UTF8 enabled. If you continue with the configuration, certain products will not work as they will not be able to read the contents in the tables as the format is wrong.b. The Oracle DB must be setup to use AL32UTF8 or a superset that contains AL32UTF8. c. The only difference between AL32UTF8 and UTF8 character sets is that AL32UTF8 stores characters beyond U+FFFF as four bytes (exactly as Unicode defines UTF-8). Oracle’s “UTF8” stores these characters as a sequence of two UTF-16 surrogate characters encoded using UTF-8 (or six bytes per character). Besides this storage difference, another difference is better support for supplementary characters in AL32UTF8 character set.

    Read the article

  • Using block around a static/singleton resource reference

    - by byte
    This is interesting (to me anyway), and I'd like to see if anyone has a good answer and explanation for this behavior. Say you have a singleton database object (or static database object), and you have it stored in a class Foo. public class Foo { public static SqlConnection DBConn = new SqlConnection(ConfigurationManager.ConnectionStrings["BAR"].ConnectionString); } Then, lets say that you are cognizant of the usefulness of calling and disposing your connection (pretend for this example that its a one-time use for purposes of illustration). So you decide to use a 'using' block to take care of the Dispose() call. using (SqlConnection conn = Foo.DBConn) { conn.Open(); using (SqlCommand cmd = new SqlCommand()) { cmd.Connection = conn; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = "SP_YOUR_PROC"; cmd.ExecuteNonQuery(); } conn.Close(); } This fails, with an error stating that the "ConnectionString property is not initialized". It's not an issue with pulling the connection string from the app.config/web.config. When you investigate in a debug session you see that Foo.DBConn is not null, but contains empty properties. Why is this?

    Read the article

  • A question of style/readability regarding the C# "using" statement

    - by Charles
    I'd like to know your opinion on a matter of coding style that I'm on the fence about. I realize there probably isn't a definitive answer, but I'd like to see if there is a strong preference in one direction or the other. I'm going through a solution adding using statements in quite a few places. Often I will come across something like so: { log = new log(); log.SomeProperty = something; // several of these log.Connection = new OracleConnection("..."); log.InsertData(); // this is where log.Connection will be used ... // do other stuff with log, but connection won't be used again } where log.Connection is an OracleConnection, which implements IDisposable. The neatnik in me wants to change it to: { log = new log(); using (OracleConnection connection = new OracleConnection("...")) { log.SomeProperty = something; log.Connection = conn; log.InsertData(); ... } } But the lover of brevity and getting-the-job-done-slightly-faster wants to do: { log = new log(); log.SomeProperty = something; using (log.Connection = new OracleConnection("...")) log.InsertData(); ... } For some reason I feel a bit dirty doing this. Do you consider this bad or not? If you think this is bad, why? If it's good, why?

    Read the article

  • How to find nth element from the end of a singly linked list?

    - by Codenotguru
    The following function is trying to find the nth to last element of a singly linked list. For example: If the elements are 8->10->5->7->2->1->5->4->10->10 then the result is 7th to last node is 7. Can anybody help me on how this code is working or is there a better and simpler approach? LinkedListNode nthToLast(LinkedListNode head, int n) { if (head == null || n < 1) { return null; } LinkedListNode p1 = head; LinkedListNode p2 = head; for (int j = 0; j < n - 1; ++j) { // skip n-1 steps ahead if (p2 == null) { return null; // not found since list size < n } p2 = p2.next; } while (p2.next != null) { p1 = p1.next; p2 = p2.next; } return p1; }

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >