Search Results

Search found 2310 results on 93 pages for 'solaris containers'.

Page 28/93 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Simple CSS height problem

    - by Patrick
    Hello! I am trying to just create a basic layout, but i am having trouble to get it to auto-adjust the height. Something is wrong with the DIV-container since it's not adding the padding correctly to the top and bottom elements. It should be the size of the highest block, right now its the menu block. Any ideas? Website

    Read the article

  • Basic example of placing two component on one JPanel container?

    - by Bernard
    Here is my code to add to component (JTextArea and JList) to a panel and put it on the frame. Can I divide half/half by BorderLayout? If yes why mine looks messy one stays up one down? What is the other alternative? Regards, Bernard import java.awt.*; import javax.swing.BorderFactory; import javax.swing.border.Border; import javax.swing.JList; import javax.swing.JScrollPane; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JTextArea; public class SimpleBorder { public static void main(String[] args) { JFrame frame = new JFrame(); frame.setSize(500,500); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Border etched = (Border) BorderFactory.createEtchedBorder(); String[] items = {"A", "B", "C", "D"}; JList list = new JList(items); JTextArea text = new JTextArea(10, 40); JScrollPane scrol = new JScrollPane(text); JScrollPane scrol2 = new JScrollPane(list); JPanel panel= new JPanel(); panel.add(scrol2,BorderLayout.WEST); panel.add(scrol, BorderLayout.EAST); panel.setBorder(etched); frame.add(panel); frame.setVisible(true); } }

    Read the article

  • Quering container with Linq + group by ?

    - by Prix
    public class ItemList { public int GuID { get; set; } public int ItemID { get; set; } public string Name { get; set; } public entityType Status { get; set; } public class Waypoint { public int Zone { get; set; } public int SubID { get; set; } public int Heading { get; set; } public float PosX { get; set; } public float PosY { get; set; } public float PosZ { get; set; } } public List<Waypoint> Routes = new List<Waypoint>(); } I have a list of items using the above class and now I need to group it by ItemID and join the first entry of Routes of each iqual ItemID. So for example, let's say on my list I have: GUID ItemID ListOfRoutes 1 23 first entry only 2 23 first entry only 3 23 first entry only 4 23 first entry only 5 23 first entry only 6 23 first entry only 7 23 first entry only Means I have to group entries 1 to 7 as 1 Item with all the Routes entries. So I would have one ItemID 23 with 7 Routes on it where those routes are the first element of that given GUID Routes List. My question is if it is possible using LINQ to make a statment to do something like that this: var query = from ItemList entry in myList where status.Contains(entry.Status) group entry by entry.ItemID into result select new { items = new { ID = entry.ItemID, Name = entry.Name }, routes = from ItemList m in entry group m.Routes.FirstOrDefault() by n.NpcID into m2 }; So basicly I would have list of unique IDS information with a inner list of all the first entry of each GUID route that had the same ItemID.

    Read the article

  • developer tools for os' other than windows

    - by user225269
    I currently use visual studio 2008 for creating projects that can run on windows. Can you recommend me of other tools that can be used to develop applications for other operating systems?(Linux, Mac, Solaris) The most prominent programming languages will do(C++, C#, F#) And scripting languages(PHP, Perl, etc)

    Read the article

  • How to create a container that holds different types of function pointers in C++?

    - by Alex
    I'm doing a linear genetic programming project, where programs are bred and evolved by means of natural evolution mechanisms. Their "DNA" is basically a container (I've used arrays and vectors successfully) which contain function pointers to a set of functions available. Now, for simple problems, such as mathematical problems, I could use one type-defined function pointer which could point to functions that all return a double and all take as parameters two doubles. Unfortunately this is not very practical. I need to be able to have a container which can have different sorts of function pointers, say a function pointer to a function which takes no arguments, or a function which takes one argument, or a function which returns something, etc (you get the idea)... Is there any way to do this using any kind of container ? Could I do that using a container which contains polymorphic classes, which in their turn have various kinds of function pointers? I hope someone can direct me towards a solution because redesigning everything I've done so far is going to be painful.

    Read the article

  • Copy vector of values to vector of pairs in one line

    - by Kirill V. Lyadvinsky
    I have the following types: struct X { int x; X( int val ) : x(val) {} }; struct X2 { int x2; X2() : x2() {} }; typedef std::pair<X, X2> pair_t; typedef std::vector<pair_t> pairs_vec_t; typedef std::vector<X> X_vec_t; I need to initialize instance of pairs_vec_t with values from X_vec_t. I use the following code and it works as expected: int main() { pairs_vec_t ps; X_vec_t xs; // this is not empty in the production code ps.reserve( xs.size() ); { // I want to change this block to one line code. struct get_pair { pair_t operator()( const X& value ) { return std::make_pair( value, X2() ); } }; std::transform( xs.begin(), xs.end(), back_inserter(ps), get_pair() ); } return 0; } What I'm trying to do is to reduce my copying block to one line with using boost::bind. This code is not working: for_each( xs.begin(), xs.end(), boost::bind( &pairs_vec_t::push_back, ps, boost::bind( &std::make_pair, _1, X2() ) ) ); I know why it is not working, but I want to know how to make it working without declaring extra functions and structs?

    Read the article

  • AssociatedControlId of inner namingcontainer

    - by Eric
    Hi, I have a custom control contains a label control. I want to set the AssociatedControlId of this label to be other control id on the page, but as soon as I implement the INamingContainer in my custom control, it will run into an error saying "Unable to find control with id 'abc' that is associated with the Label 'xyz'." This would be due to the fact that the label is in a nested naming container and it trys to find the control within the same container but couldn't (as the control is on the page, outside of it own naming container) Anyone know of a way to set this property? Thanks, Eric

    Read the article

  • What is the right approach when using STL container for median calculation?

    - by sharkin
    Let's say I need to retrieve the median from a sequence of 1000000 random numeric values. If using anything but STL::list, I have no (built-in) way to sort sequence for median calculation. If using STL::list, I can't randomly access values to retrieve middle (median) of sorted sequence. Is it better to implement sorting myself and go with e.g. STL::vector, or is it better to use STL::list and use STL::list::iterator to for-loop-walk to the median value? The latter seems less overheadish, but also feels more ugly.. Or are there more and better alternatives for me?

    Read the article

  • Branchless memory manager?

    - by Richard Fabian
    Anyone thought about how to write a memory manager (in C++) that is completely branch free? I've written a pool, a stack, a queue, and a linked list (allocating from the pool), but I am wondering how plausible it is to write a branch free general memory manager. This is all to help make a really reusable framework for doing solid concurrent, in-order CPU, and cache friendly development. Edit: by branchless I mean without doing direct or indirect function calls, and without using ifs. I've been thinking that I can probably implement something that first changes the requested size to zero for false calls, but haven't really got much more than that. I feel that it's not impossible, but the other aspect of this exercise is then profiling it on said "unfriendly" processors to see if it's worth trying as hard as this to avoid branching.

    Read the article

  • increase stack size

    - by PMC
    Hi there, I am working with scons and am trying to compile a program that require bigger stack size but I dont know how to extend the stack size. This is on a solaris machine, and as I said before, we use scons to compile our projects. Anyone know how to do this ?

    Read the article

  • How to position an element next to another an element of undefined position?

    - by allin
    Hi, I am very new to html/xml/css and I'm trying my best to teach myself. However, I have run into a problem that a Google search could not solve. I would like to position a small image in a fixed location relative to another element(?) I believe this is the code of the element i want to position the second element relative to. #wrap { width:550px; background-color:#fff; margin:0 auto; padding:0; border-right:1px solid #ccc; border-left:1px solid #ccc; } #container { width: 500px; margin:0 auto; padding: 25px; font-size:.85em; background-color: #fff; } and this is partial code I'm trying to edit to position .xyz to the right of "#wrap" .xyz { position: ???; top: 200px; right: ???; _position: ???; _margin: ???; _text-align: right; z-index: 1337; } my search of SOF has lead me to believe i'm supposed to do something along the lines of this - http://stackoverflow.com/questions/104953/position-an-html-element-relative-to-its-container-using-css - but i haven't been able to. I greatly appreciate any help you may offer. Hopefully I've explained my problem properly.

    Read the article

  • Free Memory Occupied by Std List, Vector, Map etc

    - by Graviton
    Coming from a C# background, I have only vaguest idea on memory management on C++-- all I know is that I would have to free the memory manually. As a result my C++ code is written in such a way that objects of the type std::vector, std::list, std::map are freely instantiated, used, but not freed. I didn't realize this point until I am almost done with my programs, now my code is consisted of the following kinds of patterns: struct Point_2 { double x; double y; }; struct Point_3 { double x; double y; double z; }; list<list<Point_2>> Computation::ComputationJob(list<Point_3> pts3D, vector<Point_2> vectors) { map<Point_2, double> pt2DMap=ConstructPointMap(pts3D); vector<Point_2> vectorList = ConstructVectors(vectors); list<list<Point_2>> faceList2D=ConstructPoints(vectorList , pt2DMap); return faceList2D; } My question is, must I free every.single.one of the list usage ( in the above example, this means that I would have to free pt2DMap, vectorList and faceList2D)? That would be very tedious! I might just as well rewrite my Computation class so that it is less prone to memory leak. Any idea how to fix this?

    Read the article

  • What do programs see when ZFS can't deliver uncorrupted data?

    - by Jay Kominek
    Say my program attempts a read of a byte in a file on a ZFS filesystem. ZFS can locate a copy of the necessary block, but cannot locate any copy with a valid checksum (they're all corrupted, or the only disks present have corrupted copies). What does my program see, in terms of the return value from the read, and the byte it tried to read? And is there a way to influence the behavior (under Solaris, or any other ZFS-implementing OS), that is, force failure, or force success, with potentially corrupt data?

    Read the article

  • I need programmatically way to perform fastest 'trans-wrap' of mov to mp4 on iPhone/iPad application

    - by user1307877
    I want to change the container of a .mov video files that I pick using  UIImagePickerController and compressed them via AVAssetExportSession with AVAssetExportPresetMediumQuality and  shouldOptimizeForNetworkUse = YES to .mp4 container. I need programmatically way/sample code to perform a fastest 'trans-wrap' on iPhone/iPad application I tried to set AVAssetExportSession.outputFileType property to AVFileTypeMPEG4 but it not supported and I got exception I tried to do this transform using AVAssetWriter by specifying fileType:AVFileTypeMPEG4, actually I got .mp4 output file, but it was not 'wrap-trans', the output file was  3x bigger than source, and the convert process took 128 sec for video with 60 sec duration. I need solution that will run quickly and will keep the file size  please help

    Read the article

  • asking the container to notify your application whenever a session is about to timeout in Java

    - by user136101
    Which method(s) can be used to ask the container to notify your application whenever a session is about to timeout?(choose all that apply) A. HttpSessionListener.sessionDestroyed -- correct B. HttpSessionBindingListener.valueBound C. HttpSessionBindingListener.valueUnbound -- correct this is kind of round-about but if you have an attribute class this is a way to be informed of a timeout D. HttpSessionBindingEvent.sessionDestroyed -- no such method E. HttpSessionAttributeListener.attributeRemoved -- removing an attribute isn’t tightly associated with a session timeout F. HttpSessionActivationListener.sessionWillPassivate -- session passivation is different than timeout I agree with option A. 1) But C is doubtful How can value unbound be tightly coupled with session timeout.It is just the callback method when an attribute gets removed. 2) and if C is correct, E should also be correct. HttpSessionAttributeListener is just a class that wants to know when any type of attribute has been added, removed, or replaced in a session. It is implemented by any class. HttpSessionBindingListener exists so that the attribute itself can find out when it has been added to or removed from a session and the attribute class must implement this interface to achieve it. Any ideas…

    Read the article

  • redirection of awk print to a file

    - by sushil kumar
    I can get the cpu Mhz of a solaris machine by following command. % /usr/sbin/psrinfo -v | grep operate |head -1 | awk '{print $6}' 1200 when I run the following command, awk output is not getting redirected. % csh -cf "/usr/sbin/psrinfo -v | grep operate |head -1 | awk '{print $6}' > myoutput" % cat myoutput The sparcv9 processor operates at 1200 MHz, how to get following result % cat myoutput 1200

    Read the article

  • Check if a program exists in bash

    - by ~rojanu
    I am trying to check if md5sum or digest exists on solaris and script is used on different machines. Here is the function in sh script which is called from a ksh script getMD5cmd () { PATH="${PATH}:/bin:/usr/bin:/usr/sfw/bin:/usr/local/bin:/usr/sbin/bin" if type -p md5sum;then MD5CMD=`type -p md5sum` elif type -p digest;then MD5CMD="`type -p digest` -a md5" fi echo "HERE ${MD5CMD}" } When I run scripts I get -p not found md5sum not found -p not found digest is /bin/digest HERE However, when I type it in a terminal, works as exptected Any Ideas? Thanks

    Read the article

  • C++: is it safe to work with std::vectors as if they were arrays?

    - by peoro
    I need to have a fixed-size array of elements and to call on them functions that require to know about how they're placed in memory, in particular: functions like glVertexPointer, that needs to know where the vertices are, how distant they are one from the other and so on. In my case vertices would be members of the elements to store. to get the index of an element within this array, I'd prefer to avoid having an index field within my elements, but would rather play with pointers arithmetic (ie: index of Element *x will be x - & array[0]) -- btw, this sounds dirty to me: is it good practice or should I do something else? Is it safe to use std::vector for this? Something makes me think that an std::array would be more appropriate but: Constructor and destructor for my structure will be rarely called: I don't mind about such overhead. I'm going to set the std::vector capacity to size I need (the size that would use for an std::array, thus won't take any overhead due to sporadic reallocation. I don't mind a little space overhead for std::vector's internal structure. I could use the ability to resize the vector (or better: to have a size chosen during setup), and I think there's no way to do this with std::array, since its size is a template parameter (that's too bad: I could do that even with an old C-like array, just dynamically allocating it on the heap). If std::vector is fine for my purpose I'd like to know into details if it will have some runtime overhead with respect to std::array (or to a plain C array): I know that it'll call the default constructor for any element once I increase its size (but I guess this won't cost anything if my data has got an empty default constructor?), same for destructor. Anything else?

    Read the article

  • C++ iterators, default initialization and what to use as an uninitialized sentinel.

    - by Hassan Syed
    The Context I have a custom template container class put together from a map and vector. The map resolves a string to an ordinal, and the vector resolves an ordinal (only an initial string to ordinal lookup is done, future references are to the vector) to the entry. The entries are modified intrusively to contain a a bool "assigned" and an iterator_type which is a const_iterator to the container class's map. My container class will use RCF's serialization code (which models boost::serialization) to serialize my container classes to nodes in a network. Serializing iterator's is not possible, or a can of worms, and I can easily regenerate them onces the vectors and maps are serialized on the remote site. The Question I need to default initialize, and be able to test that the iterator has not been assigned to (if it is assigned it is valid, if not it is invalid). Since map iterators are not invalidated upon operations performed on it (unless of course items are removed :D) am I to assume that map<x,y>::end() is a valid sentinel (regardless of the state of the map -- i.e., it could be empty) to initialize to ? I will always have access to the parent map, I'm just unsure wheather end() is the same as the map contents change. I don't want to use another level of indirection (--i.e., boost::optional) to achieve my goal, I'd rather forego compiler checks to correct logic, but it would be nice if I didn't need to. Misc This question exists, but most of its content seems non-sense. Assigning a NULL to an iterator is invalid according to g++ and clang++. This is another similar question, but it focuses on the common use-cases of iterators, which generally tends to be using the iterator to iterate, ofcourse in this use-case the state of the container isn't meant to change whilst iteration is going on.

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >